Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@7365d26 from refs/heads/release/5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Feb 16, 2024
1 parent a46f7e0 commit b80183e
Show file tree
Hide file tree
Showing 22 changed files with 18,851 additions and 18,749 deletions.
7 changes: 3 additions & 4 deletions blocks/popup-controller/build/render.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$block_namespace = 'prc-block/popup-controller';

$block_id = wp_unique_id('prc-block-popup-controller-');
$block_id = md5($content);

// Why not use context here? Because I want to be able to easily close and open this modal from other namespaces. By using state this is as easy as store('prc-block/popup-controller').state[blockId].isActive = true; would open the modal by the id. This is a very powerful feature when used in conjunction with other store's and the store's ability to listen to changes in state.
wp_interactivity_state($block_namespace, array(
Expand All @@ -11,16 +11,15 @@
));

$block_wrapper_attrs = get_block_wrapper_attributes(array(
'id' => $block_id,
'data-wp-interactive' => wp_json_encode(array(
'namespace' => $block_namespace,
)),
'data-wp-context' => wp_json_encode(array(
'id' => $block_id,
'isOpen' => false,
)),
'id' => $block_id,
'data-wp-key' => wp_unique_id('popup-controller-'),
'data-wp-class--is-active' => 'state.'.$block_id.'.isActive',
'data-wp-init' => 'callbacks.onInit',
'data-wp-on-document--keydown' => 'callbacks.onESCKey',
'data-wp-on-window--click' => 'callbacks.onWindowClickCloseModal',
));
Expand Down
2 changes: 1 addition & 1 deletion blocks/popup-controller/build/style-index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/popup-controller/build/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => 'ee003e726b4417a44021', 'type' => 'module');
<?php return array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => '2bda65e3f319cb0b1d8f', 'type' => 'module');
2 changes: 1 addition & 1 deletion blocks/popup-controller/build/view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b80183e

Please sign in to comment.