@wordpress/customize-widgets 4.15.0 → 4.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-appender/index.js +6 -8
  3. package/build/components/block-appender/index.js.map +1 -1
  4. package/build/components/block-inspector-button/index.js +3 -9
  5. package/build/components/block-inspector-button/index.js.map +1 -1
  6. package/build/components/customize-widgets/index.js +4 -12
  7. package/build/components/customize-widgets/index.js.map +1 -1
  8. package/build/components/customize-widgets/use-clear-selected-block.js +12 -15
  9. package/build/components/customize-widgets/use-clear-selected-block.js.map +1 -1
  10. package/build/components/error-boundary/index.js +1 -14
  11. package/build/components/error-boundary/index.js.map +1 -1
  12. package/build/components/focus-control/index.js +1 -12
  13. package/build/components/focus-control/index.js.map +1 -1
  14. package/build/components/focus-control/use-blocks-focus-control.js +3 -9
  15. package/build/components/focus-control/use-blocks-focus-control.js.map +1 -1
  16. package/build/components/header/index.js +7 -18
  17. package/build/components/header/index.js.map +1 -1
  18. package/build/components/inserter/index.js +1 -10
  19. package/build/components/inserter/index.js.map +1 -1
  20. package/build/components/inserter/use-inserter.js +1 -6
  21. package/build/components/inserter/use-inserter.js.map +1 -1
  22. package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
  23. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  24. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
  25. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  26. package/build/components/keyboard-shortcut-help-modal/index.js +4 -20
  27. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  28. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
  29. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  30. package/build/components/keyboard-shortcuts/index.js +1 -16
  31. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  32. package/build/components/more-menu/index.js +2 -15
  33. package/build/components/more-menu/index.js.map +1 -1
  34. package/build/components/sidebar-block-editor/index.js +5 -22
  35. package/build/components/sidebar-block-editor/index.js.map +1 -1
  36. package/build/components/sidebar-block-editor/sidebar-adapter.js +13 -75
  37. package/build/components/sidebar-block-editor/sidebar-adapter.js.map +1 -1
  38. package/build/components/sidebar-block-editor/sidebar-editor-provider.js +1 -8
  39. package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
  40. package/build/components/sidebar-block-editor/use-sidebar-block-editor.js +14 -24
  41. package/build/components/sidebar-block-editor/use-sidebar-block-editor.js.map +1 -1
  42. package/build/components/sidebar-controls/index.js +1 -5
  43. package/build/components/sidebar-controls/index.js.map +1 -1
  44. package/build/components/welcome-guide/index.js +1 -6
  45. package/build/components/welcome-guide/index.js.map +1 -1
  46. package/build/controls/inserter-outer-section.js +15 -24
  47. package/build/controls/inserter-outer-section.js.map +1 -1
  48. package/build/controls/inspector-section.js +0 -12
  49. package/build/controls/inspector-section.js.map +1 -1
  50. package/build/controls/sidebar-control.js +1 -12
  51. package/build/controls/sidebar-control.js.map +1 -1
  52. package/build/controls/sidebar-section.js +3 -14
  53. package/build/controls/sidebar-section.js.map +1 -1
  54. package/build/filters/index.js +0 -2
  55. package/build/filters/index.js.map +1 -1
  56. package/build/filters/move-to-sidebar.js +7 -17
  57. package/build/filters/move-to-sidebar.js.map +1 -1
  58. package/build/filters/replace-media-upload.js +1 -3
  59. package/build/filters/replace-media-upload.js.map +1 -1
  60. package/build/filters/wide-widget-display.js +3 -5
  61. package/build/filters/wide-widget-display.js.map +1 -1
  62. package/build/index.js +5 -20
  63. package/build/index.js.map +1 -1
  64. package/build/lock-unlock.js +1 -2
  65. package/build/lock-unlock.js.map +1 -1
  66. package/build/store/actions.js +0 -1
  67. package/build/store/actions.js.map +1 -1
  68. package/build/store/constants.js +0 -1
  69. package/build/store/constants.js.map +1 -1
  70. package/build/store/index.js +1 -10
  71. package/build/store/index.js.map +1 -1
  72. package/build/store/reducer.js +0 -5
  73. package/build/store/reducer.js.map +1 -1
  74. package/build/store/selectors.js +9 -10
  75. package/build/store/selectors.js.map +1 -1
  76. package/build/utils.js +8 -18
  77. package/build/utils.js.map +1 -1
  78. package/build-module/components/block-appender/index.js +5 -5
  79. package/build-module/components/block-appender/index.js.map +1 -1
  80. package/build-module/components/block-inspector-button/index.js +2 -5
  81. package/build-module/components/block-inspector-button/index.js.map +1 -1
  82. package/build-module/components/customize-widgets/index.js +4 -4
  83. package/build-module/components/customize-widgets/index.js.map +1 -1
  84. package/build-module/components/customize-widgets/use-clear-selected-block.js +13 -12
  85. package/build-module/components/customize-widgets/use-clear-selected-block.js.map +1 -1
  86. package/build-module/components/error-boundary/index.js +0 -8
  87. package/build-module/components/error-boundary/index.js.map +1 -1
  88. package/build-module/components/focus-control/index.js +1 -8
  89. package/build-module/components/focus-control/index.js.map +1 -1
  90. package/build-module/components/focus-control/use-blocks-focus-control.js +3 -4
  91. package/build-module/components/focus-control/use-blocks-focus-control.js.map +1 -1
  92. package/build-module/components/header/index.js +8 -11
  93. package/build-module/components/header/index.js.map +1 -1
  94. package/build-module/components/inserter/index.js +1 -4
  95. package/build-module/components/inserter/index.js.map +1 -1
  96. package/build-module/components/inserter/use-inserter.js +1 -3
  97. package/build-module/components/inserter/use-inserter.js.map +1 -1
  98. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  99. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
  100. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  101. package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
  102. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  103. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
  104. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  105. package/build-module/components/keyboard-shortcuts/index.js +0 -9
  106. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  107. package/build-module/components/more-menu/index.js +2 -6
  108. package/build-module/components/more-menu/index.js.map +1 -1
  109. package/build-module/components/sidebar-block-editor/index.js +5 -9
  110. package/build-module/components/sidebar-block-editor/index.js.map +1 -1
  111. package/build-module/components/sidebar-block-editor/sidebar-adapter.js +12 -72
  112. package/build-module/components/sidebar-block-editor/sidebar-adapter.js.map +1 -1
  113. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +1 -2
  114. package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
  115. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js +15 -20
  116. package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js.map +1 -1
  117. package/build-module/components/sidebar-controls/index.js +0 -1
  118. package/build-module/components/sidebar-controls/index.js.map +1 -1
  119. package/build-module/components/welcome-guide/index.js +0 -1
  120. package/build-module/components/welcome-guide/index.js.map +1 -1
  121. package/build-module/controls/inserter-outer-section.js +15 -20
  122. package/build-module/controls/inserter-outer-section.js.map +1 -1
  123. package/build-module/controls/inspector-section.js +0 -11
  124. package/build-module/controls/inspector-section.js.map +1 -1
  125. package/build-module/controls/sidebar-control.js +1 -8
  126. package/build-module/controls/sidebar-control.js.map +1 -1
  127. package/build-module/controls/sidebar-section.js +3 -12
  128. package/build-module/controls/sidebar-section.js.map +1 -1
  129. package/build-module/filters/index.js.map +1 -1
  130. package/build-module/filters/move-to-sidebar.js +7 -10
  131. package/build-module/filters/move-to-sidebar.js.map +1 -1
  132. package/build-module/filters/replace-media-upload.js +0 -2
  133. package/build-module/filters/replace-media-upload.js.map +1 -1
  134. package/build-module/filters/wide-widget-display.js +2 -3
  135. package/build-module/filters/wide-widget-display.js.map +1 -1
  136. package/build-module/index.js +5 -10
  137. package/build-module/index.js.map +1 -1
  138. package/build-module/lock-unlock.js.map +1 -1
  139. package/build-module/store/actions.js.map +1 -1
  140. package/build-module/store/constants.js.map +1 -1
  141. package/build-module/store/index.js +3 -3
  142. package/build-module/store/index.js.map +1 -1
  143. package/build-module/store/reducer.js +1 -3
  144. package/build-module/store/reducer.js.map +1 -1
  145. package/build-module/store/selectors.js +10 -9
  146. package/build-module/store/selectors.js.map +1 -1
  147. package/build-module/utils.js +9 -14
  148. package/build-module/utils.js.map +1 -1
  149. package/package.json +22 -22
  150. package/src/store/selectors.js +10 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.17.0 (2023-08-16)
6
+
7
+ ## 4.16.0 (2023-08-10)
8
+
5
9
  ## 4.15.0 (2023-07-20)
6
10
 
7
11
  ## 4.14.0 (2023-07-05)
@@ -4,33 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = BlockAppender;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _blockEditor = require("@wordpress/block-editor");
11
-
12
9
  var _data = require("@wordpress/data");
13
-
14
10
  /**
15
11
  * WordPress dependencies
16
12
  */
13
+
17
14
  function BlockAppender(props) {
18
15
  const ref = (0, _element.useRef)();
19
- const isBlocksListEmpty = (0, _data.useSelect)(select => select(_blockEditor.store).getBlockCount() === 0); // Move the focus to the block appender to prevent focus from
20
- // being lost when emptying the widget area.
16
+ const isBlocksListEmpty = (0, _data.useSelect)(select => select(_blockEditor.store).getBlockCount() === 0);
21
17
 
18
+ // Move the focus to the block appender to prevent focus from
19
+ // being lost when emptying the widget area.
22
20
  (0, _element.useEffect)(() => {
23
21
  if (isBlocksListEmpty && ref.current) {
24
22
  const {
25
23
  ownerDocument
26
24
  } = ref.current;
27
-
28
25
  if (!ownerDocument.activeElement || ownerDocument.activeElement === ownerDocument.body) {
29
26
  ref.current.focus();
30
27
  }
31
28
  }
32
29
  }, [isBlocksListEmpty]);
33
- return (0, _element.createElement)(_blockEditor.ButtonBlockAppender, { ...props,
30
+ return (0, _element.createElement)(_blockEditor.ButtonBlockAppender, {
31
+ ...props,
34
32
  ref: ref
35
33
  });
36
34
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"names":["BlockAppender","props","ref","isBlocksListEmpty","select","blockEditorStore","getBlockCount","current","ownerDocument","activeElement","body","focus"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AARA;AACA;AACA;AAQe,SAASA,aAAT,CAAwBC,KAAxB,EAAgC;AAC9C,QAAMC,GAAG,GAAG,sBAAZ;AACA,QAAMC,iBAAiB,GAAG,qBACvBC,MAAF,IAAcA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,OAA+C,CADpC,CAA1B,CAF8C,CAM9C;AACA;;AACA,0BAAW,MAAM;AAChB,QAAKH,iBAAiB,IAAID,GAAG,CAACK,OAA9B,EAAwC;AACvC,YAAM;AAAEC,QAAAA;AAAF,UAAoBN,GAAG,CAACK,OAA9B;;AAEA,UACC,CAAEC,aAAa,CAACC,aAAhB,IACAD,aAAa,CAACC,aAAd,KAAgCD,aAAa,CAACE,IAF/C,EAGE;AACDR,QAAAA,GAAG,CAACK,OAAJ,CAAYI,KAAZ;AACA;AACD;AACD,GAXD,EAWG,CAAER,iBAAF,CAXH;AAaA,SAAO,4BAAC,gCAAD,OAA0BF,KAA1B;AAAkC,IAAA,GAAG,EAAGC;AAAxC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"]}
1
+ {"version":3,"names":["_element","require","_blockEditor","_data","BlockAppender","props","ref","useRef","isBlocksListEmpty","useSelect","select","blockEditorStore","getBlockCount","useEffect","current","ownerDocument","activeElement","body","focus","createElement","ButtonBlockAppender"],"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AARA;AACA;AACA;;AAQe,SAASG,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EACpB,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,KAAK,CAC9D,CAAC;;EAED;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKL,iBAAiB,IAAIF,GAAG,CAACQ,OAAO,EAAG;MACvC,MAAM;QAAEC;MAAc,CAAC,GAAGT,GAAG,CAACQ,OAAO;MAErC,IACC,CAAEC,aAAa,CAACC,aAAa,IAC7BD,aAAa,CAACC,aAAa,KAAKD,aAAa,CAACE,IAAI,EACjD;QACDX,GAAG,CAACQ,OAAO,CAACI,KAAK,CAAC,CAAC;MACpB;IACD;EACD,CAAC,EAAE,CAAEV,iBAAiB,CAAG,CAAC;EAE1B,OAAO,IAAAR,QAAA,CAAAmB,aAAA,EAACjB,YAAA,CAAAkB,mBAAmB;IAAA,GAAMf,KAAK;IAAGC,GAAG,EAAGA;EAAK,CAAE,CAAC;AACxD"}
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _i18n = require("@wordpress/i18n");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
10
  var _data = require("@wordpress/data");
15
-
16
11
  var _blockEditor = require("@wordpress/block-editor");
17
-
18
12
  /**
19
13
  * WordPress dependencies
20
14
  */
15
+
21
16
  function BlockInspectorButton({
22
17
  inspector,
23
18
  closeMenu,
@@ -30,14 +25,13 @@ function BlockInspectorButton({
30
25
  // Open the inspector.
31
26
  inspector.open({
32
27
  returnFocusWhenClose: selectedBlock
33
- }); // Then close the dropdown menu.
34
-
28
+ });
29
+ // Then close the dropdown menu.
35
30
  closeMenu();
36
31
  },
37
32
  ...props
38
33
  }, (0, _i18n.__)('Show more settings'));
39
34
  }
40
-
41
35
  var _default = BlockInspectorButton;
42
36
  exports.default = _default;
43
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"names":["BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","document","getElementById","open","returnFocusWhenClose"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,oBAAT,CAA+B;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,SAAb;AAAwB,KAAGC;AAA3B,CAA/B,EAAoE;AACnE,QAAMC,qBAAqB,GAAG,qBAC3BC,MAAF,IAAcA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,wBAA3B,EADe,EAE7B,EAF6B,CAA9B;AAKA,QAAMC,aAAa,GAAG,sBACrB,MAAMC,QAAQ,CAACC,cAAT,CAA0B,SAASN,qBAAuB,EAA1D,CADe,EAErB,CAAEA,qBAAF,CAFqB,CAAtB;AAKA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf;AACAH,MAAAA,SAAS,CAACU,IAAV,CAAgB;AACfC,QAAAA,oBAAoB,EAAEJ;AADP,OAAhB,EAFe,CAKf;;AACAN,MAAAA,SAAS;AACT,KARF;AAAA,OASMC;AATN,KAWG,cAAI,oBAAJ,CAXH,CADD;AAeA;;eAEcH,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"]}
1
+ {"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","useSelect","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","useMemo","document","getElementById","createElement","MenuItem","onClick","open","returnFocusWhenClose","__","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA,SAASK,oBAAoBA,CAAE;EAAEC,SAAS;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACnE,MAAMC,qBAAqB,GAAG,IAAAC,eAAS,EACpCC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,wBAAwB,CAAC,CAAC,EACnE,EACD,CAAC;EAED,MAAMC,aAAa,GAAG,IAAAC,gBAAO,EAC5B,MAAMC,QAAQ,CAACC,cAAc,CAAG,SAASR,qBAAuB,EAAE,CAAC,EACnE,CAAEA,qBAAqB,CACxB,CAAC;EAED,OACC,IAAAV,QAAA,CAAAmB,aAAA,EAAChB,WAAA,CAAAiB,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACf;MACAd,SAAS,CAACe,IAAI,CAAE;QACfC,oBAAoB,EAAER;MACvB,CAAE,CAAC;MACH;MACAP,SAAS,CAAC,CAAC;IACZ,CAAG;IAAA,GACEC;EAAK,GAER,IAAAe,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAEcnB,oBAAoB;AAAAoB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,28 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = CustomizeWidgets;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
10
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
15
-
16
11
  var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
17
-
18
12
  var _sidebarBlockEditor = _interopRequireDefault(require("../sidebar-block-editor"));
19
-
20
13
  var _focusControl = _interopRequireDefault(require("../focus-control"));
21
-
22
14
  var _sidebarControls = _interopRequireDefault(require("../sidebar-controls"));
23
-
24
15
  var _useClearSelectedBlock = _interopRequireDefault(require("./use-clear-selected-block"));
25
-
26
16
  /**
27
17
  * WordPress dependencies
28
18
  */
@@ -30,6 +20,7 @@ var _useClearSelectedBlock = _interopRequireDefault(require("./use-clear-selecte
30
20
  /**
31
21
  * Internal dependencies
32
22
  */
23
+
33
24
  function CustomizeWidgets({
34
25
  api,
35
26
  sidebarControls,
@@ -55,9 +46,10 @@ function CustomizeWidgets({
55
46
  sidebar: activeSidebarControl.sidebarAdapter,
56
47
  inserter: activeSidebarControl.inserter,
57
48
  inspector: activeSidebarControl.inspector
58
- })), activeSidebarControl.container[0]); // We have to portal this to the parent of both the editor and the inspector,
59
- // so that the popovers will appear above both of them.
49
+ })), activeSidebarControl.container[0]);
60
50
 
51
+ // We have to portal this to the parent of both the editor and the inspector,
52
+ // so that the popovers will appear above both of them.
61
53
  const popover = parentContainer && (0, _element.createPortal)((0, _element.createElement)("div", {
62
54
  className: "customize-widgets-popover",
63
55
  ref: popoverRef
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/customize-widgets/index.js"],"names":["CustomizeWidgets","api","sidebarControls","blockEditorSettings","activeSidebarControl","setActiveSidebarControl","parentContainer","document","getElementById","popoverRef","unsubscribers","map","sidebarControl","subscribe","expanded","forEach","unsubscriber","activeSidebar","id","sidebarAdapter","inserter","inspector","container","popover"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,GADyC;AAEzCC,EAAAA,eAFyC;AAGzCC,EAAAA;AAHyC,CAA3B,EAIX;AACH,QAAM,CAAEC,oBAAF,EAAwBC,uBAAxB,IAAoD,uBAAU,IAAV,CAA1D;AACA,QAAMC,eAAe,GAAGC,QAAQ,CAACC,cAAT,CACvB,0BADuB,CAAxB;AAGA,QAAMC,UAAU,GAAG,sBA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ent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef, createPortal } from '@wordpress/element';\nimport { SlotFillProvider, Popover } from '@wordpress/components';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport SidebarBlockEditor from '../sidebar-block-editor';\nimport FocusControl from '../focus-control';\nimport SidebarControls from '../sidebar-controls';\nimport useClearSelectedBlock from './use-clear-selected-block';\n\nexport default function CustomizeWidgets( {\n\tapi,\n\tsidebarControls,\n\tblockEditorSettings,\n} ) {\n\tconst [ activeSidebarControl, setActiveSidebarControl ] = useState( null );\n\tconst parentContainer = document.getElementById(\n\t\t'customize-theme-controls'\n\t);\n\tconst popoverRef = useRef();\n\n\tuseClearSelectedBlock( activeSidebarControl, popoverRef );\n\n\tuseEffect( () => {\n\t\tconst unsubscribers = sidebarControls.map( ( sidebarControl ) =>\n\t\t\tsidebarControl.subscribe( ( expanded ) => {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tsetActiveSidebarControl( sidebarControl );\n\t\t\t\t}\n\t\t\t} )\n\t\t);\n\n\t\treturn () => {\n\t\t\tunsubscribers.forEach( ( unsubscriber ) => unsubscriber() );\n\t\t};\n\t}, [ sidebarControls ] );\n\n\tconst activeSidebar =\n\t\tactiveSidebarControl &&\n\t\tcreatePortal(\n\t\t\t<ErrorBoundary>\n\t\t\t\t<SidebarBlockEditor\n\t\t\t\t\tkey={ activeSidebarControl.id }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\tsidebar={ activeSidebarControl.sidebarAdapter }\n\t\t\t\t\tinserter={ activeSidebarControl.inserter }\n\t\t\t\t\tinspector={ activeSidebarControl.inspector }\n\t\t\t\t/>\n\t\t\t</ErrorBoundary>,\n\t\t\tactiveSidebarControl.container[ 0 ]\n\t\t);\n\n\t// We have to portal this to the parent of both the editor and the inspector,\n\t// so that the popovers will appear above both of them.\n\tconst popover =\n\t\tparentContainer &&\n\t\tcreatePortal(\n\t\t\t<div className=\"customize-widgets-popover\" ref={ popoverRef }>\n\t\t\t\t<Popover.Slot />\n\t\t\t</div>,\n\t\t\tparentContainer\n\t\t);\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<SidebarControls\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tactiveSidebarControl={ activeSidebarControl }\n\t\t\t\t>\n\t\t\t\t\t<FocusControl\n\t\t\t\t\t\tapi={ api }\n\t\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ activeSidebar }\n\t\t\t\t\t\t{ popover }\n\t\t\t\t\t</FocusControl>\n\t\t\t\t</SidebarControls>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n"]}
1
+ {"version":3,"names":["_element","require","_components","_keyboardShortcuts","_errorBoundary","_interopRequireDefault","_sidebarBlockEditor","_focusControl","_sidebarControls","_useClearSelectedBlock","CustomizeWidgets","api","sidebarControls","blockEditorSettings","activeSidebarControl","setActiveSidebarControl","useState","parentContainer","document","getElementById","popoverRef","useRef","useClearSelectedBlock","useEffect","unsubscribers","map","sidebarControl","subscribe","expanded","forEach","unsubscriber","activeSidebar","createPortal","createElement","default","key","id","sidebar","sidebarAdapter","inserter","inspector","container","popover","className","ref","Popover","Slot","ShortcutProvider","SlotFillProvider"],"sources":["@wordpress/customize-widgets/src/components/customize-widgets/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef, createPortal } from '@wordpress/element';\nimport { SlotFillProvider, Popover } from '@wordpress/components';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport SidebarBlockEditor from '../sidebar-block-editor';\nimport FocusControl from '../focus-control';\nimport SidebarControls from '../sidebar-controls';\nimport useClearSelectedBlock from './use-clear-selected-block';\n\nexport default function CustomizeWidgets( {\n\tapi,\n\tsidebarControls,\n\tblockEditorSettings,\n} ) {\n\tconst [ activeSidebarControl, setActiveSidebarControl ] = useState( null );\n\tconst parentContainer = document.getElementById(\n\t\t'customize-theme-controls'\n\t);\n\tconst popoverRef = useRef();\n\n\tuseClearSelectedBlock( activeSidebarControl, popoverRef );\n\n\tuseEffect( () => {\n\t\tconst unsubscribers = sidebarControls.map( ( sidebarControl ) =>\n\t\t\tsidebarControl.subscribe( ( expanded ) => {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tsetActiveSidebarControl( sidebarControl );\n\t\t\t\t}\n\t\t\t} )\n\t\t);\n\n\t\treturn () => {\n\t\t\tunsubscribers.forEach( ( unsubscriber ) => unsubscriber() );\n\t\t};\n\t}, [ sidebarControls ] );\n\n\tconst activeSidebar =\n\t\tactiveSidebarControl &&\n\t\tcreatePortal(\n\t\t\t<ErrorBoundary>\n\t\t\t\t<SidebarBlockEditor\n\t\t\t\t\tkey={ activeSidebarControl.id }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\tsidebar={ activeSidebarControl.sidebarAdapter }\n\t\t\t\t\tinserter={ activeSidebarControl.inserter }\n\t\t\t\t\tinspector={ activeSidebarControl.inspector }\n\t\t\t\t/>\n\t\t\t</ErrorBoundary>,\n\t\t\tactiveSidebarControl.container[ 0 ]\n\t\t);\n\n\t// We have to portal this to the parent of both the editor and the inspector,\n\t// so that the popovers will appear above both of them.\n\tconst popover =\n\t\tparentContainer &&\n\t\tcreatePortal(\n\t\t\t<div className=\"customize-widgets-popover\" ref={ popoverRef }>\n\t\t\t\t<Popover.Slot />\n\t\t\t</div>,\n\t\t\tparentContainer\n\t\t);\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<SidebarControls\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tactiveSidebarControl={ activeSidebarControl }\n\t\t\t\t>\n\t\t\t\t\t<FocusControl\n\t\t\t\t\t\tapi={ api }\n\t\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ activeSidebar }\n\t\t\t\t\t\t{ popover }\n\t\t\t\t\t</FocusControl>\n\t\t\t\t</SidebarControls>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,sBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AAdA;AACA;AACA;;AAKA;AACA;AACA;;AAOe,SAASS,gBAAgBA,CAAE;EACzCC,GAAG;EACHC,eAAe;EACfC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,oBAAoB,EAAEC,uBAAuB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC1E,MAAMC,eAAe,GAAGC,QAAQ,CAACC,cAAc,CAC9C,0BACD,CAAC;EACD,MAAMC,UAAU,GAAG,IAAAC,eAAM,EAAC,CAAC;EAE3B,IAAAC,8BAAqB,EAAER,oBAAoB,EAAEM,UAAW,CAAC;EAEzD,IAAAG,kBAAS,EAAE,MAAM;IAChB,MAAMC,aAAa,GAAGZ,eAAe,CAACa,GAAG,CAAIC,cAAc,IAC1DA,cAAc,CAACC,SAAS,CAAIC,QAAQ,IAAM;MACzC,IAAKA,QAAQ,EAAG;QACfb,uBAAuB,CAAEW,cAAe,CAAC;MAC1C;IACD,CAAE,CACH,CAAC;IAED,OAAO,MAAM;MACZF,aAAa,CAACK,OAAO,CAAIC,YAAY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ACA,CACD,CAAC;AAErB"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = useClearSelectedBlock;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _data = require("@wordpress/data");
11
-
12
9
  var _blockEditor = require("@wordpress/block-editor");
13
-
14
10
  /**
15
11
  * WordPress dependencies
16
12
  */
@@ -45,27 +41,28 @@ function useClearSelectedBlock(sidebarControl, popoverRef) {
45
41
  const container = sidebarControl.container[0];
46
42
  const ownerDocument = container.ownerDocument;
47
43
  const ownerWindow = ownerDocument.defaultView;
48
-
49
44
  function handleClearSelectedBlock(element) {
50
- if ( // 1. Make sure there are blocks being selected.
51
- (hasSelectedBlock() || hasMultiSelection()) && // 2. The element should exist in the DOM (not deleted).
52
- element && ownerDocument.contains(element) && // 3. It should also not exist in the container, the popover, nor the dialog.
53
- !container.contains(element) && !popoverRef.current.contains(element) && !element.closest('[role="dialog"]') && // 4. The inspector should not be opened.
45
+ if (
46
+ // 1. Make sure there are blocks being selected.
47
+ (hasSelectedBlock() || hasMultiSelection()) &&
48
+ // 2. The element should exist in the DOM (not deleted).
49
+ element && ownerDocument.contains(element) &&
50
+ // 3. It should also not exist in the container, the popover, nor the dialog.
51
+ !container.contains(element) && !popoverRef.current.contains(element) && !element.closest('[role="dialog"]') &&
52
+ // 4. The inspector should not be opened.
54
53
  !inspector.expanded()) {
55
54
  clearSelectedBlock();
56
55
  }
57
- } // Handle mouse down in the same document.
58
-
56
+ }
59
57
 
58
+ // Handle mouse down in the same document.
60
59
  function handleMouseDown(event) {
61
60
  handleClearSelectedBlock(event.target);
62
- } // Handle focusing outside the current document, like to iframes.
63
-
64
-
61
+ }
62
+ // Handle focusing outside the current document, like to iframes.
65
63
  function handleBlur() {
66
64
  handleClearSelectedBlock(ownerDocument.activeElement);
67
65
  }
68
-
69
66
  ownerDocument.addEventListener('mousedown', handleMouseDown);
70
67
  ownerWindow.addEventListener('blur', handleBlur);
71
68
  return () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/customize-widgets/use-clear-selected-block.js"],"names":["useClearSelectedBlock","sidebarControl","popoverRef","hasSelectedBlock","hasMultiSelection","blockEditorStore","clearSelectedBlock","current","inspector","container","ownerDocument","ownerWindow","defaultView","handleClearSelectedBlock","element","contains","closest","expanded","handleMouseDown","event","target","handleBlur","activeElement","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,CAAgCC,cAAhC,EAAgDC,UAAhD,EAA6D;AAC3E,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MACL,qBAAWC,kBAAX,CADD;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaD,kBAAb,CAA/B;AAEA,0BAAW,MAAM;AAChB,QAAKH,UAAU,CAACK,OAAX,IAAsBN,cAA3B,EAA4C;AAC3C,YAAMO,SAAS,GAAGP,cAAc,CAACO,SAAjC;AACA,YAAMC,SAAS,GAAGR,cAAc,CAACQ,SAAf,CAA0B,CAA1B,CAAlB;AACA,YAAMC,aAAa,GAAGD,SAAS,CAACC,aAAhC;AACA,YAAMC,WAAW,GAAGD,aAAa,CAACE,WAAlC;;AAEA,eAASC,wBAAT,CAAmCC,OAAnC,EAA6C;AAC5C,aACC;AACA,SAAEX,gBAAgB,MAAMC,iBAAiB,EAAzC,KACA;AACAU,QAAAA,OAFA,IAGAJ,aAAa,CAACK,QAAd,CAAwBD,OAAxB,CAHA,IAIA;AACA,SAAEL,SAAS,CAACM,QAAV,CAAoBD,OAApB,CALF,IAMA,CAAEZ,UAAU,CAACK,OAAX,CAAmBQ,QAAnB,CAA6BD,OAA7B,CANF,IAOA,CAAEA,OAAO,CAACE,OAAR,CAAiB,iBAAjB,CAPF,IAQA;AACA,SAAER,SAAS,CAACS,QAAV,EAXH,EAYE;AACDX,UAAAA,kBAAkB;AAClB;AACD,OAtB0C,CAwB3C;;;AACA,eAASY,eAAT,CAA0BC,KAA1B,EAAkC;AACjCN,QAAAA,wBAAwB,CAAEM,KAAK,CAACC,MAAR,CAAxB;AACA,OA3B0C,CA4B3C;;;AACA,eAASC,UAAT,GAAsB;AACrBR,QAAAA,wBAAwB,CAAEH,aAAa,CAACY,aAAhB,CAAxB;AACA;;AAEDZ,MAAAA,aAAa,CAACa,gBAAd,CAAgC,WAAhC,EAA6CL,eAA7C;AACAP,MAAAA,WAAW,CAACY,gBAAZ,CAA8B,MAA9B,EAAsCF,UAAtC;AAEA,aAAO,MAAM;AACZX,QAAAA,aAAa,CAACc,mBAAd,CACC,WADD,EAECN,eAFD;AAIAP,QAAAA,WAAW,CAACa,mBAAZ,CAAiC,MAAjC,EAAyCH,UAAzC;AACA,OAND;AAOA;AACD,GA7CD,EA6CG,CACFnB,UADE,EAEFD,cAFE,EAGFE,gBAHE,EAIFC,iBAJE,EAKFE,kBALE,CA7CH;AAoDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * We can't just use <BlockSelectionClearer> because the customizer has\n * many root nodes rather than just one in the post editor.\n * We need to listen to the focus events in all those roots, and also in\n * the preview iframe.\n * This hook will clear the selected block when focusing outside the editor,\n * with a few exceptions:\n * 1. Focusing on popovers.\n * 2. Focusing on the inspector.\n * 3. Focusing on any modals/dialogs.\n * These cases are normally triggered by user interactions from the editor,\n * not by explicitly focusing outside the editor, hence no need for clearing.\n *\n * @param {Object} sidebarControl The sidebar control instance.\n * @param {Object} popoverRef The ref object of the popover node container.\n */\nexport default function useClearSelectedBlock( sidebarControl, popoverRef ) {\n\tconst { hasSelectedBlock, hasMultiSelection } =\n\t\tuseSelect( blockEditorStore );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( popoverRef.current && sidebarControl ) {\n\t\t\tconst inspector = sidebarControl.inspector;\n\t\t\tconst container = sidebarControl.container[ 0 ];\n\t\t\tconst ownerDocument = container.ownerDocument;\n\t\t\tconst ownerWindow = ownerDocument.defaultView;\n\n\t\t\tfunction handleClearSelectedBlock( element ) {\n\t\t\t\tif (\n\t\t\t\t\t// 1. Make sure there are blocks being selected.\n\t\t\t\t\t( hasSelectedBlock() || hasMultiSelection() ) &&\n\t\t\t\t\t// 2. The element should exist in the DOM (not deleted).\n\t\t\t\t\telement &&\n\t\t\t\t\townerDocument.contains( element ) &&\n\t\t\t\t\t// 3. It should also not exist in the container, the popover, nor the dialog.\n\t\t\t\t\t! container.contains( element ) &&\n\t\t\t\t\t! popoverRef.current.contains( element ) &&\n\t\t\t\t\t! element.closest( '[role=\"dialog\"]' ) &&\n\t\t\t\t\t// 4. The inspector should not be opened.\n\t\t\t\t\t! inspector.expanded()\n\t\t\t\t) {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle mouse down in the same document.\n\t\t\tfunction handleMouseDown( event ) {\n\t\t\t\thandleClearSelectedBlock( event.target );\n\t\t\t}\n\t\t\t// Handle focusing outside the current document, like to iframes.\n\t\t\tfunction handleBlur() {\n\t\t\t\thandleClearSelectedBlock( ownerDocument.activeElement );\n\t\t\t}\n\n\t\t\townerDocument.addEventListener( 'mousedown', handleMouseDown );\n\t\t\townerWindow.addEventListener( 'blur', handleBlur );\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousedown',\n\t\t\t\t\thandleMouseDown\n\t\t\t\t);\n\t\t\t\townerWindow.removeEventListener( 'blur', handleBlur );\n\t\t\t};\n\t\t}\n\t}, [\n\t\tpopoverRef,\n\t\tsidebarControl,\n\t\thasSelectedBlock,\n\t\thasMultiSelection,\n\t\tclearSelectedBlock,\n\t] );\n}\n"]}
1
+ {"version":3,"names":["_element","require","_data","_blockEditor","useClearSelectedBlock","sidebarControl","popoverRef","hasSelectedBlock","hasMultiSelection","useSelect","blockEditorStore","clearSelectedBlock","useDispatch","useEffect","current","inspector","container","ownerDocument","ownerWindow","defaultView","handleClearSelectedBlock","element","contains","closest","expanded","handleMouseDown","event","target","handleBlur","activeElement","addEventListener","removeEventListener"],"sources":["@wordpress/customize-widgets/src/components/customize-widgets/use-clear-selected-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * We can't just use <BlockSelectionClearer> because the customizer has\n * many root nodes rather than just one in the post editor.\n * We need to listen to the focus events in all those roots, and also in\n * the preview iframe.\n * This hook will clear the selected block when focusing outside the editor,\n * with a few exceptions:\n * 1. Focusing on popovers.\n * 2. Focusing on the inspector.\n * 3. Focusing on any modals/dialogs.\n * These cases are normally triggered by user interactions from the editor,\n * not by explicitly focusing outside the editor, hence no need for clearing.\n *\n * @param {Object} sidebarControl The sidebar control instance.\n * @param {Object} popoverRef The ref object of the popover node container.\n */\nexport default function useClearSelectedBlock( sidebarControl, popoverRef ) {\n\tconst { hasSelectedBlock, hasMultiSelection } =\n\t\tuseSelect( blockEditorStore );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( popoverRef.current && sidebarControl ) {\n\t\t\tconst inspector = sidebarControl.inspector;\n\t\t\tconst container = sidebarControl.container[ 0 ];\n\t\t\tconst ownerDocument = container.ownerDocument;\n\t\t\tconst ownerWindow = ownerDocument.defaultView;\n\n\t\t\tfunction handleClearSelectedBlock( element ) {\n\t\t\t\tif (\n\t\t\t\t\t// 1. Make sure there are blocks being selected.\n\t\t\t\t\t( hasSelectedBlock() || hasMultiSelection() ) &&\n\t\t\t\t\t// 2. The element should exist in the DOM (not deleted).\n\t\t\t\t\telement &&\n\t\t\t\t\townerDocument.contains( element ) &&\n\t\t\t\t\t// 3. It should also not exist in the container, the popover, nor the dialog.\n\t\t\t\t\t! container.contains( element ) &&\n\t\t\t\t\t! popoverRef.current.contains( element ) &&\n\t\t\t\t\t! element.closest( '[role=\"dialog\"]' ) &&\n\t\t\t\t\t// 4. The inspector should not be opened.\n\t\t\t\t\t! inspector.expanded()\n\t\t\t\t) {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle mouse down in the same document.\n\t\t\tfunction handleMouseDown( event ) {\n\t\t\t\thandleClearSelectedBlock( event.target );\n\t\t\t}\n\t\t\t// Handle focusing outside the current document, like to iframes.\n\t\t\tfunction handleBlur() {\n\t\t\t\thandleClearSelectedBlock( ownerDocument.activeElement );\n\t\t\t}\n\n\t\t\townerDocument.addEventListener( 'mousedown', handleMouseDown );\n\t\t\townerWindow.addEventListener( 'blur', handleBlur );\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousedown',\n\t\t\t\t\thandleMouseDown\n\t\t\t\t);\n\t\t\t\townerWindow.removeEventListener( 'blur', handleBlur );\n\t\t\t};\n\t\t}\n\t}, [\n\t\tpopoverRef,\n\t\tsidebarControl,\n\t\thasSelectedBlock,\n\t\thasMultiSelection,\n\t\tclearSelectedBlock,\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,qBAAqBA,CAAEC,cAAc,EAAEC,UAAU,EAAG;EAC3E,MAAM;IAAEC,gBAAgB;IAAEC;EAAkB,CAAC,GAC5C,IAAAC,eAAS,EAAEC,kBAAiB,CAAC;EAC9B,MAAM;IAAEC;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CAAC;IACF;EACD,CAAC,EAAE,CACFtB,UAAU,EACVD,cAAc,EACdE,gBAAgB,EAChBC,iBAAiB,EACjBG,kBAAkB,CACjB,CAAC;AACJ"}
@@ -4,22 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _i18n = require("@wordpress/i18n");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
10
  var _blockEditor = require("@wordpress/block-editor");
15
-
16
11
  var _compose = require("@wordpress/compose");
17
-
18
12
  var _hooks = require("@wordpress/hooks");
19
-
20
13
  /**
21
14
  * WordPress dependencies
22
15
  */
16
+
23
17
  function CopyButton({
24
18
  text,
25
19
  children
@@ -30,7 +24,6 @@ function CopyButton({
30
24
  ref: ref
31
25
  }, children);
32
26
  }
33
-
34
27
  class ErrorBoundary extends _element.Component {
35
28
  constructor() {
36
29
  super(...arguments);
@@ -38,23 +31,19 @@ class ErrorBoundary extends _element.Component {
38
31
  error: null
39
32
  };
40
33
  }
41
-
42
34
  componentDidCatch(error) {
43
35
  this.setState({
44
36
  error
45
37
  });
46
38
  (0, _hooks.doAction)('editor.ErrorBoundary.errorLogged', error);
47
39
  }
48
-
49
40
  render() {
50
41
  const {
51
42
  error
52
43
  } = this.state;
53
-
54
44
  if (!error) {
55
45
  return this.props.children;
56
46
  }
57
-
58
47
  return (0, _element.createElement)(_blockEditor.Warning, {
59
48
  className: "customize-widgets-error-boundary",
60
49
  actions: [(0, _element.createElement)(CopyButton, {
@@ -63,8 +52,6 @@ class ErrorBoundary extends _element.Component {
63
52
  }, (0, _i18n.__)('Copy Error'))]
64
53
  }, (0, _i18n.__)('The editor has encountered an unexpected error.'));
65
54
  }
66
-
67
55
  }
68
-
69
56
  exports.default = ErrorBoundary;
70
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/error-boundary/index.js"],"names":["CopyButton","text","children","ref","ErrorBoundary","Component","constructor","arguments","state","error","componentDidCatch","setState","render","props","stack"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQA,SAASA,UAAT,CAAqB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAArB,EAA0C;AACzC,QAAMC,GAAG,GAAG,iCAAoBF,IAApB,CAAZ;AACA,SACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,WAAhB;AAA4B,IAAA,GAAG,EAAGE;AAAlC,KACGD,QADH,CADD;AAKA;;AAEc,MAAME,aAAN,SAA4BC,kBAA5B,CAAsC;AACpDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,KAAK,EAAE;AADK,KAAb;AAGA;;AAEDC,EAAAA,iBAAiB,CAAED,KAAF,EAAU;AAC1B,SAAKE,QAAL,CAAe;AAAEF,MAAAA;AAAF,KAAf;AAEA,yBAAU,kCAAV,EAA8CA,KAA9C;AACA;;AAEDG,EAAAA,MAAM,GAAG;AACR,UAAM;AAAEH,MAAAA;AAAF,QAAY,KAAKD,KAAvB;;AACA,QAAK,CAAEC,KAAP,EAAe;AACd,aAAO,KAAKI,KAAL,CAAWX,QAAlB;AACA;;AAED,WACC,4BAAC,oBAAD;AACC,MAAA,SAAS,EAAC,kCADX;AAEC,MAAA,OAAO,EAAG,CACT,4BAAC,UAAD;AAAY,QAAA,GAAG,EAAC,YAAhB;AAA6B,QAAA,IAAI,EAAGO,KAAK,CAACK;AAA1C,SACG,cAAI,YAAJ,CADH,CADS;AAFX,OAQG,cAAI,iDAAJ,CARH,CADD;AAYA;;AAhCmD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tthis.setState( { error } );\n\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tclassName=\"customize-widgets-error-boundary\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t\t\t</CopyButton>,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"names":["_element","require","_i18n","_components","_blockEditor","_compose","_hooks","CopyButton","text","children","ref","useCopyToClipboard","createElement","Button","variant","ErrorBoundary","Component","constructor","arguments","state","error","componentDidCatch","setState","doAction","render","props","Warning","className","actions","key","stack","__","exports","default"],"sources":["@wordpress/customize-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tthis.setState( { error } );\n\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tclassName=\"customize-widgets-error-boundary\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t\t\t</CopyButton>,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQA,SAASM,UAAUA,CAAE;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEH,IAAK,CAAC;EACtC,OACC,IAAAR,QAAA,CAAAY,aAAA,EAACT,WAAA,CAAAU,MAAM;IAACC,OAAO,EAAC,WAAW;IAACJ,GAAG,EAAGA;EAAK,GACpCD,QACK,CAAC;AAEX;AAEe,MAAMM,aAAa,SAASC,kBAAS,CAAC;EACpDC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IACrB,IAAI,CAACC,KAAK,GAAG;MACZC,KAAK,EAAE;IACR,CAAC;EACF;EAEAC,iBAAiBA,CAAED,KAAK,EAAG;IAC1B,IAAI,CAACE,QAAQ,CAAE;MAAEF;IAAM,CAAE,CAAC;IAE1B,IAAAG,eAAQ,EAAE,kCAAkC,EAAEH,KAAM,CAAC;EACtD;EAEAI,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEJ;IAAM,CAAC,GAAG,IAAI,CAACD,KAAK;IAC5B,IAAK,CAAEC,KAAK,EAAG;MACd,OAAO,IAAI,CAACK,KAAK,CAAChB,QAAQ;IAC3B;IAEA,OACC,IAAAT,QAAA,CAAAY,aAAA,EAACR,YAAA,CAAAsB,OAAO;MACPC,SAAS,EAAC,kCAAkC;MAC5CC,OAAO,EAAG,CACT,IAAA5B,QAAA,CAAAY,aAAA,EAACL,UAAU;QAACsB,GAAG,EAAC,YAAY;QAACrB,IAAI,EAAGY,KAAK,CAACU;MAAO,GAC9C,IAAAC,QAAE,EAAE,YAAa,CACR,CAAC;IACX,GAED,IAAAA,QAAE,EAAE,iDAAkD,CAChD,CAAC;EAEZ;AACD;AAACC,OAAA,CAAAC,OAAA,GAAAlB,aAAA"}
@@ -5,11 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = FocusControl;
7
7
  exports.useFocusControl = void 0;
8
-
9
8
  var _element = require("@wordpress/element");
10
-
11
9
  var _utils = require("../../utils");
12
-
13
10
  /**
14
11
  * WordPress dependencies
15
12
  */
@@ -17,8 +14,8 @@ var _utils = require("../../utils");
17
14
  /**
18
15
  * Internal dependencies
19
16
  */
20
- const FocusControlContext = (0, _element.createContext)();
21
17
 
18
+ const FocusControlContext = (0, _element.createContext)();
22
19
  function FocusControl({
23
20
  api,
24
21
  sidebarControls,
@@ -30,7 +27,6 @@ function FocusControl({
30
27
  const focusWidget = (0, _element.useCallback)(widgetId => {
31
28
  for (const sidebarControl of sidebarControls) {
32
29
  const widgets = sidebarControl.setting.get();
33
-
34
30
  if (widgets.includes(widgetId)) {
35
31
  sidebarControl.sectionInstance.expand({
36
32
  // Schedule it after the complete callback so that
@@ -42,7 +38,6 @@ function FocusControl({
42
38
  current: widgetId
43
39
  });
44
40
  }
45
-
46
41
  });
47
42
  break;
48
43
  }
@@ -53,18 +48,14 @@ function FocusControl({
53
48
  const widgetId = (0, _utils.settingIdToWidgetId)(settingId);
54
49
  focusWidget(widgetId);
55
50
  }
56
-
57
51
  let previewBound = false;
58
-
59
52
  function handleReady() {
60
53
  api.previewer.preview.bind('focus-control-for-setting', handleFocus);
61
54
  previewBound = true;
62
55
  }
63
-
64
56
  api.previewer.bind('ready', handleReady);
65
57
  return () => {
66
58
  api.previewer.unbind('ready', handleReady);
67
-
68
59
  if (previewBound) {
69
60
  api.previewer.preview.unbind('focus-control-for-setting', handleFocus);
70
61
  }
@@ -75,8 +66,6 @@ function FocusControl({
75
66
  value: context
76
67
  }, children);
77
68
  }
78
-
79
69
  const useFocusControl = () => (0, _element.useContext)(FocusControlContext);
80
-
81
70
  exports.useFocusControl = useFocusControl;
82
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"names":["FocusControlContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","current","focusWidget","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","handleFocus","settingId","previewBound","handleReady","previewer","preview","bind","unbind","context","useFocusControl"],"mappings":";;;;;;;;AAGA;;AAYA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,6BAA5B;;AAEe,SAASC,YAAT,CAAuB;AAAEC,EAAAA,GAAF;AAAOC,EAAAA,eAAP;AAAwBC,EAAAA;AAAxB,CAAvB,EAA4D;AAC1E,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,uBAAU;AAC/DC,IAAAA,OAAO,EAAE;AADsD,GAAV,CAAtD;AAIA,QAAMC,WAAW,GAAG,0BACjBC,QAAF,IAAgB;AACf,SAAM,MAAMC,cAAZ,IAA8BP,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AAKA,SACC,4BAAC,mBAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGkB;AAAtC,KACGtB,QADH,CADD;AAKA;;AAEM,MAAMuB,eAAe,GAAG,MAAM,yBAAY3B,mBAAZ,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"]}
1
+ {"version":3,"names":["_element","require","_utils","FocusControlContext","createContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","useState","current","focusWidget","useCallback","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","useEffect","handleFocus","settingId","settingIdToWidgetId","previewBound","handleReady","previewer","preview","bind","unbind","context","useMemo","createElement","Provider","value","useFocusControl","useContext","exports"],"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAYA,IAAAC,MAAA,GAAAD,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAME,mBAAmB,GAAG,IAAAC,sBAAa,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S,CAACC,OAAO,CAACE,MAAM,CAC3B,2BAA2B,EAC3BR,WACD,CAAC;MACF;IACD,CAAC;EACF,CAAC,EAAE,CAAEnB,GAAG,EAAEO,WAAW,CAAG,CAAC;EAEzB,MAAMqB,OAAO,GAAG,IAAAC,gBAAO,EACtB,MAAM,CAAE1B,kBAAkB,EAAEI,WAAW,CAAE,EACzC,CAAEJ,kBAAkB,EAAEI,WAAW,CAClC,CAAC;EAED,OACC,IAAAb,QAAA,CAAAoC,aAAA,EAACjC,mBAAmB,CAACkC,QAAQ;IAACC,KAAK,EAAGJ;EAAS,GAC5C1B,QAC2B,CAAC;AAEjC;AAEO,MAAM+B,eAAe,GAAGA,CAAA,KAAM,IAAAC,mBAAU,EAAErC,mBAAoB,CAAC;AAACsC,OAAA,CAAAF,eAAA,GAAAA,eAAA"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = useBlocksFocusControl;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _data = require("@wordpress/data");
11
-
12
9
  var _blockEditor = require("@wordpress/block-editor");
13
-
14
10
  var _widgets = require("@wordpress/widgets");
15
-
16
11
  var _ = require(".");
17
-
18
12
  /**
19
13
  * WordPress dependencies
20
14
  */
@@ -22,6 +16,7 @@ var _ = require(".");
22
16
  /**
23
17
  * Internal dependencies
24
18
  */
19
+
25
20
  function useBlocksFocusControl(blocks) {
26
21
  const {
27
22
  selectBlock
@@ -34,12 +29,11 @@ function useBlocksFocusControl(blocks) {
34
29
  (0, _element.useEffect)(() => {
35
30
  if (focusedWidgetIdRef.current) {
36
31
  const focusedBlock = blocksRef.current.find(block => (0, _widgets.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current);
37
-
38
32
  if (focusedBlock) {
39
- selectBlock(focusedBlock.clientId); // If the block is already being selected, the DOM node won't
33
+ selectBlock(focusedBlock.clientId);
34
+ // If the block is already being selected, the DOM node won't
40
35
  // get focused again automatically.
41
36
  // We select the DOM and focus it manually here.
42
-
43
37
  const blockNode = document.querySelector(`[data-block="${focusedBlock.clientId}"]`);
44
38
  blockNode?.focus();
45
39
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/focus-control/use-blocks-focus-control.js"],"names":["useBlocksFocusControl","blocks","selectBlock","blockEditorStore","focusedWidgetIdRef","blocksRef","current","focusedBlock","find","block","clientId","blockNode","document","querySelector","focus"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgCC,MAAhC,EAAyC;AACvD,QAAM;AAAEC,IAAAA;AAAF,MAAkB,uBAAaC,kBAAb,CAAxB;AACA,QAAM,CAAEC,kBAAF,IAAyB,wBAA/B;AAEA,QAAMC,SAAS,GAAG,qBAAQJ,MAAR,CAAlB;AAEA,0BAAW,MAAM;AAChBI,IAAAA,SAAS,CAACC,OAAV,GAAoBL,MAApB;AACA,GAFD,EAEG,CAAEA,MAAF,CAFH;AAIA,0BAAW,MAAM;AAChB,QAAKG,kBAAkB,CAACE,OAAxB,EAAkC;AACjC,YAAMC,YAAY,GAAGF,SAAS,CAACC,OAAV,CAAkBE,IAAlB,CAClBC,KAAF,IACC,mCAAsBA,KAAtB,MAAkCL,kBAAkB,CAACE,OAFlC,CAArB;;AAKA,UAAKC,YAAL,EAAoB;AACnBL,QAAAA,WAAW,CAAEK,YAAY,CAACG,QAAf,CAAX,CADmB,CAEnB;AACA;AACA;;AACA,cAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAT,CAChB,gBAAgBN,YAAY,CAACG,QAAU,IADvB,CAAlB;AAGAC,QAAAA,SAAS,EAAEG,KAAX;AACA;AACD;AACD,GAlBD,EAkBG,CAAEV,kBAAF,EAAsBF,WAAtB,CAlBH;AAmBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { useFocusControl } from '.';\n\nexport default function useBlocksFocusControl( blocks ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst [ focusedWidgetIdRef ] = useFocusControl();\n\n\tconst blocksRef = useRef( blocks );\n\n\tuseEffect( () => {\n\t\tblocksRef.current = blocks;\n\t}, [ blocks ] );\n\n\tuseEffect( () => {\n\t\tif ( focusedWidgetIdRef.current ) {\n\t\t\tconst focusedBlock = blocksRef.current.find(\n\t\t\t\t( block ) =>\n\t\t\t\t\tgetWidgetIdFromBlock( block ) === focusedWidgetIdRef.current\n\t\t\t);\n\n\t\t\tif ( focusedBlock ) {\n\t\t\t\tselectBlock( focusedBlock.clientId );\n\t\t\t\t// If the block is already being selected, the DOM node won't\n\t\t\t\t// get focused again automatically.\n\t\t\t\t// We select the DOM and focus it manually here.\n\t\t\t\tconst blockNode = document.querySelector(\n\t\t\t\t\t`[data-block=\"${ focusedBlock.clientId }\"]`\n\t\t\t\t);\n\t\t\t\tblockNode?.focus();\n\t\t\t}\n\t\t}\n\t}, [ focusedWidgetIdRef, selectBlock ] );\n}\n"]}
1
+ {"version":3,"names":["_element","require","_data","_blockEditor","_widgets","_","useBlocksFocusControl","blocks","selectBlock","useDispatch","blockEditorStore","focusedWidgetIdRef","useFocusControl","blocksRef","useRef","useEffect","current","focusedBlock","find","block","getWidgetIdFromBlock","clientId","blockNode","document","querySelector","focus"],"sources":["@wordpress/customize-widgets/src/components/focus-control/use-blocks-focus-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { useFocusControl } from '.';\n\nexport default function useBlocksFocusControl( blocks ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst [ focusedWidgetIdRef ] = useFocusControl();\n\n\tconst blocksRef = useRef( blocks );\n\n\tuseEffect( () => {\n\t\tblocksRef.current = blocks;\n\t}, [ blocks ] );\n\n\tuseEffect( () => {\n\t\tif ( focusedWidgetIdRef.current ) {\n\t\t\tconst focusedBlock = blocksRef.current.find(\n\t\t\t\t( block ) =>\n\t\t\t\t\tgetWidgetIdFromBlock( block ) === focusedWidgetIdRef.current\n\t\t\t);\n\n\t\t\tif ( focusedBlock ) {\n\t\t\t\tselectBlock( focusedBlock.clientId );\n\t\t\t\t// If the block is already being selected, the DOM node won't\n\t\t\t\t// get focused again automatically.\n\t\t\t\t// We select the DOM and focus it manually here.\n\t\t\t\tconst blockNode = document.querySelector(\n\t\t\t\t\t`[data-block=\"${ focusedBlock.clientId }\"]`\n\t\t\t\t);\n\t\t\t\tblockNode?.focus();\n\t\t\t}\n\t\t}\n\t}, [ focusedWidgetIdRef, selectBlock ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,CAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGe,SAASK,qBAAqBA,CAAEC,MAAM,EAAG;EACvD,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EACvD,MAAM,CAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAe,EAAC,CAAC;EAEhD,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAEP,MAAO,CAAC;EAElC,IAAAQ,kBAAS,EAAE,MAAM;IAChBF,SAAS,CAACG,OAAO,GAAGT,MAAM;EAC3B,CAAC,EAAE,CAAEA,MAAM,CAAG,CAAC;EAEf,IAAAQ,kBAAS,EAAE,MAAM;IAChB,IAAKJ,kBAAkB,CAACK,OAAO,EAAG;MACjC,MAAMC,YAAY,GAAGJ,SAAS,CAACG,OAAO,CAACE,IAAI,CACxCC,KAAK,IACN,IAAAC,6BAAoB,EAAED,KAAM,CAAC,KAAKR,kBAAkB,CAACK,OACvD,CAAC;MAED,IAAKC,YAAY,EAAG;QACnBT,WAAW,CAAES,YAAY,CAACI,QAAS,CAAC;QACpC;QACA;QACA;QACA,MAAMC,SAAS,GAAGC,QAAQ,CAACC,aAAa,CACtC,gBAAgBP,YAAY,CAACI,QAAU,IACzC,CAAC;QACDC,SAAS,EAAEG,KAAK,CAAC,CAAC;MACnB;IACD;EACD,CAAC,EAAE,CAAEd,kBAAkB,EAAEH,WAAW,CAAG,CAAC;AACzC"}
@@ -1,30 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _i18n = require("@wordpress/i18n");
15
-
16
11
  var _components = require("@wordpress/components");
17
-
18
12
  var _blockEditor = require("@wordpress/block-editor");
19
-
20
13
  var _keycodes = require("@wordpress/keycodes");
21
-
22
14
  var _icons = require("@wordpress/icons");
23
-
24
15
  var _inserter = _interopRequireDefault(require("../inserter"));
25
-
26
16
  var _moreMenu = _interopRequireDefault(require("../more-menu"));
27
-
28
17
  /**
29
18
  * External dependencies
30
19
  */
@@ -36,6 +25,7 @@ var _moreMenu = _interopRequireDefault(require("../more-menu"));
36
25
  /**
37
26
  * Internal dependencies
38
27
  */
28
+
39
29
  function Header({
40
30
  sidebar,
41
31
  inserter,
@@ -59,10 +49,10 @@ function Header({
59
49
  "aria-label": (0, _i18n.__)('Document tools')
60
50
  }, (0, _element.createElement)(_components.ToolbarButton, {
61
51
  icon: !(0, _i18n.isRTL)() ? _icons.undo : _icons.redo
62
- /* translators: button label text should, if possible, be under 16 characters. */
63
- ,
52
+ /* translators: button label text should, if possible, be under 16 characters. */,
64
53
  label: (0, _i18n.__)('Undo'),
65
- shortcut: _keycodes.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this
54
+ shortcut: _keycodes.displayShortcut.primary('z')
55
+ // If there are no undo levels we don't want to actually disable this
66
56
  // button, because it will remove focus for keyboard users.
67
57
  // See: https://github.com/WordPress/gutenberg/issues/3486
68
58
  ,
@@ -71,10 +61,10 @@ function Header({
71
61
  className: "customize-widgets-editor-history-button undo-button"
72
62
  }), (0, _element.createElement)(_components.ToolbarButton, {
73
63
  icon: !(0, _i18n.isRTL)() ? _icons.redo : _icons.undo
74
- /* translators: button label text should, if possible, be under 16 characters. */
75
- ,
64
+ /* translators: button label text should, if possible, be under 16 characters. */,
76
65
  label: (0, _i18n.__)('Redo'),
77
- shortcut: shortcut // If there are no undo levels we don't want to actually disable this
66
+ shortcut: shortcut
67
+ // If there are no undo levels we don't want to actually disable this
78
68
  // button, because it will remove focus for keyboard users.
79
69
  // See: https://github.com/WordPress/gutenberg/issues/3486
80
70
  ,
@@ -94,7 +84,6 @@ function Header({
94
84
  setIsOpened: setIsInserterOpened
95
85
  }), inserter.contentContainer[0]));
96
86
  }
97
-
98
87
  var _default = Header;
99
88
  exports.default = _default;
100
89
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/customize-widgets/src/components/header/index.js"],"names":["Header","sidebar","inserter","isInserterOpened","setIsInserterOpened","isFixedToolbarActive","hasUndo","hasRedo","setUndoRedo","shortcut","displayShortcut","primaryShift","primary","subscribeHistory","undoIcon","redoIcon","undo","redo","plus","isOpen","contentContainer"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAIA,SAASA,MAAT,CAAi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A,KAAK,EAAG,cAAI,MAAJ,CAHT;AAIC,IAAA,QAAQ,EAAGL,QAJZ,CAKC;AACA;AACA;AAPD;AAQC,qBAAgB,CAAEF,OARnB;AASC,IAAA,OAAO,EAAGN,OAAO,CAACgB,IATnB;AAUC,IAAA,SAAS,EAAC;AAVX,IAhBD,EA6BC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,mDADX;AAEC,IAAA,SAAS,EAAGd,gBAFb;AAGC,IAAA,OAAO,EAAC,SAHT;AAIC,IAAA,IAAI,EAAGe,WAJR;AAKC,IAAA,KAAK,EAAG,cACP,WADO,EAEP,yCAFO,CALT;AASC,IAAA,OAAO,EAAG,MAAM;AACfd,MAAAA,mBAAmB,CAAIe,MAAF,IAAc,CAAEA,MAAlB,CAAnB;AACA;AAXF,IA7BD,EA0CC,4BAAC,iBAAD,OA1CD,CALD,CADD,EAoDG,2BACD,4BAAC,iBAAD;AAAU,IAAA,WAAW,EAAGf;AAAxB,IADC,EAEDF,QAAQ,CAACkB,gBAAT,CAA2B,CAA3B,CAFC,CApDH,CADD;AA2DA;;eAEcpB,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createPortal, useState, useEffect } from '@wordpress/element';\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { plus, undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport MoreMenu from '../more-menu';\n\nfunction Header( {\n\tsidebar,\n\tinserter,\n\tisInserterOpened,\n\tsetIsInserterOpened,\n\tisFixedToolbarActive,\n} ) {\n\tconst [ [ hasUndo, hasRedo ], setUndoRedo ] = useState( [\n\t\tsidebar.hasUndo(),\n\t\tsidebar.hasRedo(),\n\t] );\n\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tuseEffect( () => {\n\t\treturn sidebar.subscribeHistory( () => {\n\t\t\tsetUndoRedo( [ sidebar.hasUndo(), sidebar.hasRedo() ] );\n\t\t} );\n\t}, [ sidebar ] );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'customize-widgets-header', {\n\t\t\t\t\t'is-fixed-toolbar-active': isFixedToolbarActive,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<NavigableToolbar\n\t\t\t\t\tclassName=\"customize-widgets-header-toolbar\"\n\t\t\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\t\t>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Undo' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasUndo }\n\t\t\t\t\t\tonClick={ sidebar.undo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button undo-button\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Redo' ) }\n\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasRedo }\n\t\t\t\t\t\tonClick={ sidebar.redo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button redo-button\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tclassName=\"customize-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsInserterOpened( ( isOpen ) => ! isOpen );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</NavigableToolbar>\n\t\t\t</div>\n\n\t\t\t{ createPortal(\n\t\t\t\t<Inserter setIsOpened={ setIsInserterOpened } />,\n\t\t\t\tinserter.contentContainer[ 0 ]\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Header;\n"]}
1
+ {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_i18n","_components","_blockEditor","_keycodes","_icons","_inserter","_moreMenu","Header","sidebar","inserter","isInserterOpened","setIsInserterOpened","isFixedToolbarActive","hasUndo","hasRedo","setUndoRedo","useState","shortcut","isAppleOS","displayShortcut","primaryShift","primary","useEffect","subscribeHistory","createElement","Fragment","className","classnames","NavigableToolbar","__","ToolbarButton","icon","isRTL","undoIcon","redoIcon","label","onClick","undo","redo","isPressed","variant","plus","_x","isOpen","default","createPortal","setIsOpened","contentContainer","_default","exports"],"sources":["@wordpress/customize-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createPortal, useState, useEffect } from '@wordpress/element';\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { plus, undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport MoreMenu from '../more-menu';\n\nfunction Header( {\n\tsidebar,\n\tinserter,\n\tisInserterOpened,\n\tsetIsInserterOpened,\n\tisFixedToolbarActive,\n} ) {\n\tconst [ [ hasUndo, hasRedo ], setUndoRedo ] = useState( [\n\t\tsidebar.hasUndo(),\n\t\tsidebar.hasRedo(),\n\t] );\n\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tuseEffect( () => {\n\t\treturn sidebar.subscribeHistory( () => {\n\t\t\tsetUndoRedo( [ sidebar.hasUndo(), sidebar.hasRedo() ] );\n\t\t} );\n\t}, [ sidebar ] );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'customize-widgets-header', {\n\t\t\t\t\t'is-fixed-toolbar-active': isFixedToolbarActive,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<NavigableToolbar\n\t\t\t\t\tclassName=\"customize-widgets-header-toolbar\"\n\t\t\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\t\t>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Undo' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasUndo }\n\t\t\t\t\t\tonClick={ sidebar.undo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button undo-button\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Redo' ) }\n\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasRedo }\n\t\t\t\t\t\tonClick={ sidebar.redo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button redo-button\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tclassName=\"customize-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsInserterOpened( ( isOpen ) => ! isOpen );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</NavigableToolbar>\n\t\t\t</div>\n\n\t\t\t{ createPortal(\n\t\t\t\t<Inserter setIsOpened={ setIsInserterOpened } />,\n\t\t\t\tinserter.contentContainer[ 0 ]\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AALA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,I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