@wordpress/edit-widgets 5.16.0 → 5.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 (177) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/blocks/widget-area/edit/index.js +4 -16
  3. package/build/blocks/widget-area/edit/index.js.map +1 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +5 -10
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  6. package/build/blocks/widget-area/edit/use-is-dragging-within.js +5 -10
  7. package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +1 -1
  8. package/build/blocks/widget-area/index.js +0 -5
  9. package/build/blocks/widget-area/index.js.map +1 -1
  10. package/build/components/error-boundary/index.js +1 -15
  11. package/build/components/error-boundary/index.js.map +1 -1
  12. package/build/components/header/index.js +9 -32
  13. package/build/components/header/index.js.map +1 -1
  14. package/build/components/header/undo-redo/redo.js +3 -9
  15. package/build/components/header/undo-redo/redo.js.map +1 -1
  16. package/build/components/header/undo-redo/undo.js +3 -9
  17. package/build/components/header/undo-redo/undo.js.map +1 -1
  18. package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
  19. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  20. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
  21. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  22. package/build/components/keyboard-shortcut-help-modal/index.js +4 -20
  23. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
  25. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  26. package/build/components/keyboard-shortcuts/index.js +1 -18
  27. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  28. package/build/components/layout/index.js +2 -19
  29. package/build/components/layout/index.js.map +1 -1
  30. package/build/components/layout/interface.js +5 -21
  31. package/build/components/layout/interface.js.map +1 -1
  32. package/build/components/layout/unsaved-changes-warning.js +0 -6
  33. package/build/components/layout/unsaved-changes-warning.js.map +1 -1
  34. package/build/components/more-menu/index.js +2 -17
  35. package/build/components/more-menu/index.js.map +1 -1
  36. package/build/components/more-menu/tools-more-menu-group.js +1 -5
  37. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  38. package/build/components/notices/index.js +1 -6
  39. package/build/components/notices/index.js.map +1 -1
  40. package/build/components/save-button/index.js +1 -7
  41. package/build/components/save-button/index.js.map +1 -1
  42. package/build/components/secondary-sidebar/index.js +1 -10
  43. package/build/components/secondary-sidebar/index.js.map +1 -1
  44. package/build/components/secondary-sidebar/inserter-sidebar.js +1 -11
  45. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  46. package/build/components/secondary-sidebar/list-view-sidebar.js +6 -15
  47. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  48. package/build/components/sidebar/index.js +12 -26
  49. package/build/components/sidebar/index.js.map +1 -1
  50. package/build/components/sidebar/widget-areas.js +1 -12
  51. package/build/components/sidebar/widget-areas.js.map +1 -1
  52. package/build/components/welcome-guide/index.js +3 -12
  53. package/build/components/welcome-guide/index.js.map +1 -1
  54. package/build/components/widget-areas-block-editor-content/index.js +1 -8
  55. package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
  56. package/build/components/widget-areas-block-editor-provider/index.js +8 -23
  57. package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
  58. package/build/constants.js.map +1 -1
  59. package/build/filters/index.js +0 -1
  60. package/build/filters/index.js.map +1 -1
  61. package/build/filters/move-to-widget-area.js +3 -9
  62. package/build/filters/move-to-widget-area.js.map +1 -1
  63. package/build/filters/replace-media-upload.js +1 -3
  64. package/build/filters/replace-media-upload.js.map +1 -1
  65. package/build/hooks/use-last-selected-widget-area.js +5 -13
  66. package/build/hooks/use-last-selected-widget-area.js.map +1 -1
  67. package/build/hooks/use-widget-library-insertion-point.js +6 -14
  68. package/build/hooks/use-widget-library-insertion-point.js.map +1 -1
  69. package/build/index.js +6 -34
  70. package/build/index.js.map +1 -1
  71. package/build/lock-unlock.js +1 -2
  72. package/build/lock-unlock.js.map +1 -1
  73. package/build/store/actions.js +41 -79
  74. package/build/store/actions.js.map +1 -1
  75. package/build/store/constants.js +0 -1
  76. package/build/store/constants.js.map +1 -1
  77. package/build/store/index.js +4 -15
  78. package/build/store/index.js.map +1 -1
  79. package/build/store/reducer.js +4 -16
  80. package/build/store/reducer.js.map +1 -1
  81. package/build/store/resolvers.js +1 -17
  82. package/build/store/resolvers.js.map +1 -1
  83. package/build/store/selectors.js +28 -49
  84. package/build/store/selectors.js.map +1 -1
  85. package/build/store/transformers.js +7 -16
  86. package/build/store/transformers.js.map +1 -1
  87. package/build/store/utils.js +7 -16
  88. package/build/store/utils.js.map +1 -1
  89. package/build-module/blocks/widget-area/edit/index.js +5 -8
  90. package/build-module/blocks/widget-area/edit/index.js.map +1 -1
  91. package/build-module/blocks/widget-area/edit/inner-blocks.js +6 -6
  92. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  93. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +6 -9
  94. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +1 -1
  95. package/build-module/blocks/widget-area/index.js +1 -1
  96. package/build-module/blocks/widget-area/index.js.map +1 -1
  97. package/build-module/components/error-boundary/index.js +0 -9
  98. package/build-module/components/error-boundary/index.js.map +1 -1
  99. package/build-module/components/header/index.js +9 -17
  100. package/build-module/components/header/index.js.map +1 -1
  101. package/build-module/components/header/undo-redo/redo.js +2 -2
  102. package/build-module/components/header/undo-redo/redo.js.map +1 -1
  103. package/build-module/components/header/undo-redo/undo.js +2 -2
  104. package/build-module/components/header/undo-redo/undo.js.map +1 -1
  105. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  106. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
  107. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  108. package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
  109. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  110. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
  111. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  112. package/build-module/components/keyboard-shortcuts/index.js +1 -10
  113. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  114. package/build-module/components/layout/index.js +2 -8
  115. package/build-module/components/layout/index.js.map +1 -1
  116. package/build-module/components/layout/interface.js +5 -9
  117. package/build-module/components/layout/interface.js.map +1 -1
  118. package/build-module/components/layout/unsaved-changes-warning.js +2 -3
  119. package/build-module/components/layout/unsaved-changes-warning.js.map +1 -1
  120. package/build-module/components/more-menu/index.js +2 -6
  121. package/build-module/components/more-menu/index.js.map +1 -1
  122. package/build-module/components/more-menu/tools-more-menu-group.js +0 -3
  123. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  124. package/build-module/components/notices/index.js +0 -3
  125. package/build-module/components/notices/index.js.map +1 -1
  126. package/build-module/components/save-button/index.js +1 -4
  127. package/build-module/components/save-button/index.js.map +1 -1
  128. package/build-module/components/secondary-sidebar/index.js +1 -6
  129. package/build-module/components/secondary-sidebar/index.js.map +1 -1
  130. package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -2
  131. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  132. package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -7
  133. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  134. package/build-module/components/sidebar/index.js +13 -18
  135. package/build-module/components/sidebar/index.js.map +1 -1
  136. package/build-module/components/sidebar/widget-areas.js +1 -4
  137. package/build-module/components/sidebar/widget-areas.js.map +1 -1
  138. package/build-module/components/welcome-guide/index.js +3 -7
  139. package/build-module/components/welcome-guide/index.js.map +1 -1
  140. package/build-module/components/widget-areas-block-editor-content/index.js +1 -2
  141. package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
  142. package/build-module/components/widget-areas-block-editor-provider/index.js +8 -7
  143. package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
  144. package/build-module/constants.js.map +1 -1
  145. package/build-module/filters/index.js.map +1 -1
  146. package/build-module/filters/move-to-widget-area.js +4 -4
  147. package/build-module/filters/move-to-widget-area.js.map +1 -1
  148. package/build-module/filters/replace-media-upload.js +0 -2
  149. package/build-module/filters/replace-media-upload.js.map +1 -1
  150. package/build-module/hooks/use-last-selected-widget-area.js +7 -9
  151. package/build-module/hooks/use-last-selected-widget-area.js.map +1 -1
  152. package/build-module/hooks/use-widget-library-insertion-point.js +6 -10
  153. package/build-module/hooks/use-widget-library-insertion-point.js.map +1 -1
  154. package/build-module/index.js +8 -20
  155. package/build-module/index.js.map +1 -1
  156. package/build-module/lock-unlock.js.map +1 -1
  157. package/build-module/store/actions.js +43 -56
  158. package/build-module/store/actions.js.map +1 -1
  159. package/build-module/store/constants.js.map +1 -1
  160. package/build-module/store/index.js +6 -6
  161. package/build-module/store/index.js.map +1 -1
  162. package/build-module/store/reducer.js +5 -11
  163. package/build-module/store/reducer.js.map +1 -1
  164. package/build-module/store/resolvers.js +3 -10
  165. package/build-module/store/resolvers.js.map +1 -1
  166. package/build-module/store/selectors.js +29 -38
  167. package/build-module/store/selectors.js.map +1 -1
  168. package/build-module/store/transformers.js +8 -13
  169. package/build-module/store/transformers.js.map +1 -1
  170. package/build-module/store/utils.js +7 -7
  171. package/build-module/store/utils.js.map +1 -1
  172. package/build-style/style-rtl.css +14 -8
  173. package/build-style/style.css +14 -8
  174. package/package.json +28 -27
  175. package/src/components/widget-areas-block-editor-provider/index.js +3 -3
  176. package/src/index.js +0 -1
  177. package/src/store/selectors.js +10 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/unsaved-changes-warning.js"],"names":["__","useEffect","useSelect","store","editWidgetsStore","UnsavedChangesWarning","isDirty","select","getEditedWidgetAreas","editedWidgetAreas","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAGJ,SAAS,CAAIK,MAAF,IAAc;AACxC,UAAM;AAAEC,MAAAA;AAAF,QAA2BD,MAAM,CAAEH,gBAAF,CAAvC;AACA,UAAMK,iBAAiB,GAAGD,oBAAoB,EAA9C;AAEA,WAAOC,iBAAiB,EAAEC,MAAnB,GAA4B,CAAnC;AACA,GALwB,EAKtB,EALsB,CAAzB;AAOAT,EAAAA,SAAS,CAAE,MAAM;AAChB;AACF;AACA;AACA;AACA;AACA;AACA;AACE,UAAMU,oBAAoB,GAAKC,KAAF,IAAa;AACzC,UAAKN,OAAL,EAAe;AACdM,QAAAA,KAAK,CAACC,WAAN,GAAoBb,EAAE,CACrB,8DADqB,CAAtB;AAGA,eAAOY,KAAK,CAACC,WAAb;AACA;AACD,KAPD;;AASAC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAtBQ,EAsBN,CAAEL,OAAF,CAtBM,CAAT;AAwBA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n *\n * This is a duplicate of the component implemented in the editor package.\n * Duplicated here as edit-widgets doesn't depend on editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas } = select( editWidgetsStore );\n\t\tconst editedWidgetAreas = getEditedWidgetAreas();\n\n\t\treturn editedWidgetAreas?.length > 0;\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"names":["__","useEffect","useSelect","store","editWidgetsStore","UnsavedChangesWarning","isDirty","select","getEditedWidgetAreas","editedWidgetAreas","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/components/layout/unsaved-changes-warning.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n *\n * This is a duplicate of the component implemented in the editor package.\n * Duplicated here as edit-widgets doesn't depend on editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas } = select( editWidgetsStore );\n\t\tconst editedWidgetAreas = getEditedWidgetAreas();\n\n\t\treturn editedWidgetAreas?.length > 0;\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAMC,OAAO,GAAGJ,SAAS,CAAIK,MAAM,IAAM;IACxC,MAAM;MAAEC;IAAqB,CAAC,GAAGD,MAAM,CAAEH,gBAAiB,CAAC;IAC3D,MAAMK,iBAAiB,GAAGD,oBAAoB,CAAC,CAAC;IAEhD,OAAOC,iBAAiB,EAAEC,MAAM,GAAG,CAAC;EACrC,CAAC,EAAE,EAAG,CAAC;EAEPT,SAAS,CAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMU,oBAAoB,GAAKC,KAAK,IAAM;MACzC,IAAKN,OAAO,EAAG;QACdM,KAAK,CAACC,WAAW,GAAGb,EAAE,CACrB,8DACD,CAAC;QACD,OAAOY,KAAK,CAACC,WAAW;MACzB;IACD,CAAC;IAEDC,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEJ,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZG,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAEL,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAEL,OAAO,CAAG,CAAC;EAEhB,OAAO,IAAI;AACZ"}
@@ -1,5 +1,4 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -12,17 +11,15 @@ import { PreferenceToggleMenuItem } from '@wordpress/preferences';
12
11
  import { displayShortcut } from '@wordpress/keycodes';
13
12
  import { useShortcut } from '@wordpress/keyboard-shortcuts';
14
13
  import { useViewportMatch } from '@wordpress/compose';
14
+
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
-
19
18
  import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
20
19
  import ToolsMoreMenuGroup from './tools-more-menu-group';
21
20
  export default function MoreMenu() {
22
21
  const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = useState(false);
23
-
24
22
  const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
25
-
26
23
  useShortcut('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
27
24
  const isLargeViewport = useViewportMatch('medium');
28
25
  return createElement(Fragment, null, createElement(MoreMenuDropdown, null, onClose => createElement(Fragment, null, isLargeViewport && createElement(MenuGroup, {
@@ -53,8 +50,7 @@ export default function MoreMenu() {
53
50
  rel: "noopener noreferrer"
54
51
  }, __('Help'), createElement(VisuallyHidden, {
55
52
  as: "span"
56
- },
57
- /* translators: accessibility text */
53
+ }, /* translators: accessibility text */
58
54
  __('(opens in a new tab)'))), createElement(ToolsMoreMenuGroup.Slot, {
59
55
  fillProps: {
60
56
  onClose
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"names":["MenuGroup","MenuItem","VisuallyHidden","useState","__","_x","external","MoreMenuDropdown","PreferenceToggleMenuItem","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","ToolsMoreMenuGroup","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","onClose","access"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,cAA9B,QAAoD,uBAApD;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,EAAaC,EAAb,QAAuB,iBAAvB;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,gBAAT,QAAiC,sBAAjC;AACA,SAASC,wBAAT,QAAyC,wBAAzC;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,WAAT,QAA4B,+BAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEA,eAAe,SAASC,QAAT,GAAoB;AAClC,QAAM,CACLC,8BADK,EAELC,kCAFK,IAGFb,QAAQ,CAAE,KAAF,CAHZ;;AAIA,QAAMc,4BAA4B,GAAG,MACpCD,kCAAkC,CAAE,CAAED,8BAAJ,CADnC;;AAGAL,EAAAA,WAAW,CACV,sCADU,EAEVO,4BAFU,CAAX;AAKA,QAAMC,eAAe,GAAGP,gBAAgB,CAAE,QAAF,CAAxC;AAEA,SACC,8BACC,cAAC,gBAAD,QACKQ,OAAF,IACD,8BACGD,eAAe,IAChB,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGb,EAAE,CAAE,MAAF,EAAU,MAA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,mBADP;AAEC,IAAA,IAAI,EAAC,sBAFN;AAGC,IAAA,KAAK,EAAGA,EAAE,CACT,kCADS,CAHX;AAMC,IAAA,IAAI,EAAGA,EAAE,CACR,iEADQ,CANV;AASC,IAAA,gBAAgB,EAAGA,EAAE,CACpB,4CADoB,CATtB;AAYC,IAAA,kBAAkB,EAAGA,EAAE,CACtB,8CADsB;AAZxB,IADD,EAiBC,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,IAAI,EAAC,aAFN;AAGC,IAAA,IAAI,EAAGA,EAAE,CACR,uCADQ,CAHV;AAMC,IAAA,KAAK,EAAGA,EAAE,CAAE,kBAAF;AANX,IAjBD,EAyBGc,eAAe,IAChB,cAAC,wBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,IAAI,EAAC,sBAFN;AAGC,IAAA,KAAK,EAAGd,EAAE,CAAE,2BAAF,CAHX;AAIC,IAAA,IAAI,EAAGA,EAAE,CACR,sDADQ,CAJV;AAOC,IAAA,gBAAgB,EAAGA,EAAE,CACpB,qCADoB,CAPtB;AAUC,IAAA,kBAAkB,EAAGA,EAAE,CACtB,uCADsB;AAVxB,IA1BF,CAtDD,CAFF,CADD,EAsGC,cAAC,yBAAD;AACC,IAAA,aAAa,EAAGW,8BADjB;AAEC,IAAA,WAAW,EAAGE;AAFf,IAtGD,CADD;AA6GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown } from '@wordpress/interface';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"names":["MenuGroup","MenuItem","VisuallyHidden","useState","__","_x","external","MoreMenuDropdown","PreferenceToggleMenuItem","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","ToolsMoreMenuGroup","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","createElement","Fragment","onClose","label","scope","name","info","messageActivated","messageDeactivated","onClick","shortcut","access","role","icon","href","target","rel","as","Slot","fillProps","isModalActive","toggleModal"],"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown } from '@wordpress/interface';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,cAAc,QA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ACD,CAAG;IACHkB,KAAK,EAAGlB,EAAE,CAAE,kBAAmB;EAAG,CAClC,CAAC,EACAc,eAAe,IAChBC,aAAA,CAACX,wBAAwB;IACxBe,KAAK,EAAC,mBAAmB;IACzBC,IAAI,EAAC,sBAAsB;IAC3BF,KAAK,EAAGlB,EAAE,CAAE,2BAA4B,CAAG;IAC3CqB,IAAI,EAAGrB,EAAE,CACR,sDACD,CAAG;IACHsB,gBAAgB,EAAGtB,EAAE,CACpB,qCACD,CAAG;IACHuB,kBAAkB,EAAGvB,EAAE,CACtB,uCACD;EAAG,CACH,CAEQ,CACV,CAEc,CAAC,EACnBe,aAAA,CAACP,yBAAyB;IACzB2B,aAAa,EAAGxB,8BAAgC;IAChDyB,WAAW,EAAGvB;EAA8B,CAC5C,CACA,CAAC;AAEL"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -8,12 +7,10 @@ const {
8
7
  Fill: ToolsMoreMenuGroup,
9
8
  Slot
10
9
  } = createSlotFill('EditWidgetsToolsMoreMenuGroup');
11
-
12
10
  ToolsMoreMenuGroup.Slot = ({
13
11
  fillProps
14
12
  }) => createElement(Slot, {
15
13
  fillProps: fillProps
16
14
  }, fills => fills.length > 0 && fills);
17
-
18
15
  export default ToolsMoreMenuGroup;
19
16
  //# sourceMappingURL=tools-more-menu-group.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"names":["createSlotFill","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqCH,cAAc,CACxD,+BADwD,CAAzD;;AAIAE,kBAAkB,CAACC,IAAnB,GAA0B,CAAE;AAAEC,EAAAA;AAAF,CAAF,KACzB,cAAC,IAAD;AAAM,EAAA,SAAS,EAAGA;AAAlB,GACKC,KAAF,IAAaA,KAAK,CAACC,MAAN,GAAe,CAAf,IAAoBD,KADpC,CADD;;AAMA,eAAeH,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
1
+ {"version":3,"names":["createSlotFill","Fill","ToolsMoreMenuGroup","Slot","fillProps","createElement","fills","length"],"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,uBAAuB;AAEtD,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GAAGH,cAAc,CACxD,+BACD,CAAC;AAEDE,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEC;AAAU,CAAC,KACxCC,aAAA,CAACF,IAAI;EAACC,SAAS,EAAGA;AAAW,GACxBE,KAAK,IAAMA,KAAK,CAACC,MAAM,GAAG,CAAC,IAAID,KAC9B,CACN;AAED,eAAeJ,kBAAkB"}
@@ -1,12 +1,10 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
6
5
  import { NoticeList, SnackbarList } from '@wordpress/components';
7
6
  import { useSelect, useDispatch } from '@wordpress/data';
8
7
  import { store as noticesStore } from '@wordpress/notices';
9
-
10
8
  function Notices() {
11
9
  const {
12
10
  removeNotice
@@ -42,6 +40,5 @@ function Notices() {
42
40
  onRemove: removeNotice
43
41
  }));
44
42
  }
45
-
46
43
  export default Notices;
47
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/notices/index.js"],"names":["NoticeList","SnackbarList","useSelect","useDispatch","store","noticesStore","Notices","removeNotice","notices","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,YAArB,QAAyC,uBAAzC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;;AAEA,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA;AAAF,MAAmBJ,WAAW,CAAEE,YAAF,CAApC;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAcN,SAAS,CAAIO,MAAF,IAAc;AAC5C,WAAO;AACND,MAAAA,OAAO,EAAEC,MAAM,CAAEJ,YAAF,CAAN,CAAuBK,UAAvB;AADH,KAAP;AAGA,GAJ4B,EAI1B,EAJ0B,CAA7B;AAMA,QAAMC,kBAAkB,GAAGH,OAAO,CAACI,MAAR,CAC1B,CAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAAF,KAA+BD,aAAa,IAAIC,IAAI,KAAK,SAD/B,CAA3B;AAGA,QAAMC,qBAAqB,GAAGP,OAAO,CAACI,MAAR,CAC7B,CAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAAF,KAA+B,CAAED,aAAF,IAAmBC,IAAI,KAAK,SAD9B,CAA9B;AAGA,QAAME,eAAe,GAAGR,OAAO,CAACI,MAAR,CACvB,CAAE;AAAEE,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,UADF,CAAxB;AAIA,SACC,8BACC,cAAC,UAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,cAAC,UAAD;AACC,IAAA,OAAO,EAAGJ,kBADX;AAEC,IAAA,SAAS,EAAC,mCAFX;AAGC,IAAA,QAAQ,EAAGJ;AAHZ,IALD,EAUC,cAAC,YAAD;AACC,IAAA,OAAO,EAAGS,eADX;AAEC,IAAA,SAAS,EAAC,gCAFX;AAGC,IAAA,QAAQ,EAAGT;AAHZ,IAVD,CADD;AAkBA;;AAED,eAAeD,OAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices.filter(\n\t\t( { type } ) => type === 'snackbar'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"]}
1
+ {"version":3,"names":["NoticeList","SnackbarList","useSelect","useDispatch","store","noticesStore","Notices","removeNotice","notices","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices","createElement","Fragment","className","onRemove"],"sources":["@wordpress/edit-widgets/src/components/notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices.filter(\n\t\t( { type } ) => type === 'snackbar'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,YAAY,QAAQ,uBAAuB;AAChE,SAASC,S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  */
6
5
  import { Button } from '@wordpress/components';
7
6
  import { __ } from '@wordpress/i18n';
8
7
  import { useDispatch, useSelect } from '@wordpress/data';
8
+
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
-
13
12
  import { store as editWidgetsStore } from '../../store';
14
-
15
13
  function SaveButton() {
16
14
  const {
17
15
  hasEditedWidgetAreaIds,
@@ -37,6 +35,5 @@ function SaveButton() {
37
35
  disabled: !hasEditedWidgetAreaIds
38
36
  }, isSaving ? __('Saving…') : __('Update'));
39
37
  }
40
-
41
38
  export default SaveButton;
42
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/save-button/index.js"],"names":["Button","__","useDispatch","useSelect","store","editWidgetsStore","SaveButton","hasEditedWidgetAreaIds","isSaving","select","getEditedWidgetAreas","isSavingWidgetAreas","length","saveEditedWidgetAreas","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;;AAEA,SAASC,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAuCL,SAAS,CAAIM,MAAF,IAAc;AACrE,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEJ,gBAAF,CADP;AAGA,WAAO;AACNE,MAAAA,sBAAsB,EAAEG,oBAAoB,IAAIE,MAAxB,GAAiC,CADnD;AAENJ,MAAAA,QAAQ,EAAEG,mBAAmB;AAFvB,KAAP;AAIA,GARqD,EAQnD,EARmD,CAAtD;AASA,QAAM;AAAEE,IAAAA;AAAF,MAA4BX,WAAW,CAAEG,gBAAF,CAA7C;AAEA,SACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,MAAM,EAAGG,QAFV;AAGC,qBAAgBA,QAHjB;AAIC,IAAA,OAAO,EAAGA,QAAQ,GAAGM,SAAH,GAAeD,qBAJlC;AAKC,IAAA,QAAQ,EAAG,CAAEN;AALd,KAOGC,QAAQ,GAAGP,EAAE,CAAE,SAAF,CAAL,GAAqBA,EAAE,CAAE,QAAF,CAPlC,CADD;AAWA;;AAED,eAAeK,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction SaveButton() {\n\tconst { hasEditedWidgetAreaIds, isSaving } = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas, isSavingWidgetAreas } =\n\t\t\tselect( editWidgetsStore );\n\n\t\treturn {\n\t\t\thasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,\n\t\t\tisSaving: isSavingWidgetAreas(),\n\t\t};\n\t}, [] );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tisBusy={ isSaving }\n\t\t\taria-disabled={ isSaving }\n\t\t\tonClick={ isSaving ? undefined : saveEditedWidgetAreas }\n\t\t\tdisabled={ ! hasEditedWidgetAreaIds }\n\t\t>\n\t\t\t{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }\n\t\t</Button>\n\t);\n}\n\nexport default SaveButton;\n"]}
1
+ {"version":3,"names":["Button","__","useDispatch","useSelect","store","editWidgetsStore","SaveButton","hasEditedWidgetAreaIds","isSaving","select","getEditedWidgetAreas","isSavingWidgetAreas","length","saveEditedWidgetAreas","createElement","variant","isBusy","onClick","undefined","disabled"],"sources":["@wordpress/edit-widgets/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction SaveButton() {\n\tconst { hasEditedWidgetAreaIds, isSaving } = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas, isSavingWidgetAreas } =\n\t\t\tselect( editWidgetsStore );\n\n\t\treturn {\n\t\t\thasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,\n\t\t\tisSaving: isSavingWidgetAreas(),\n\t\t};\n\t}, [] );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tisBusy={ isSaving }\n\t\t\taria-disabled={ isSaving }\n\t\t\tonClick={ isSaving ? undefined : saveEditedWidgetAreas }\n\t\t\tdisabled={ ! hasEditedWidgetAreaIds }\n\t\t>\n\t\t\t{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }\n\t\t</Button>\n\t);\n}\n\nexport default SaveButton;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC,sBAAsB;IAAEC;EAAS,CAAC,GAAGL,SAAS,CAAIM,MAAM,IAAM;IACrE,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEJ,gBAAiB,CAAC;IAE3B,OAAO;MACNE,sBAAsB,EAAEG,oBAAoB,CAAC,CAAC,EAAEE,MAAM,GAAG,CAAC;MAC1DJ,QAAQ,EAAEG,mBAAmB,CAAC;IAC/B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEE;EAAsB,CAAC,GAAGX,WAAW,CAAEG,gBAAiB,CAAC;EAEjE,OACCS,aAAA,CAACd,MAAM;IACNe,OAAO,EAAC,SAAS;IACjBC,MAAM,EAAGR,QAAU;IACnB,iBAAgBA,QAAU;IAC1BS,OAAO,EAAGT,QAAQ,GAAGU,SAAS,GAAGL,qBAAuB;IACxDM,QAAQ,EAAG,CAAEZ;EAAwB,GAEnCC,QAAQ,GAAGP,EAAE,CAAE,SAAU,CAAC,GAAGA,EAAE,CAAE,QAAS,CACrC,CAAC;AAEX;AAEA,eAAeK,UAAU"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -7,12 +6,11 @@ import { useSelect } from '@wordpress/data';
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
-
11
9
  import { store as editWidgetsStore } from '../../store';
10
+
12
11
  /**
13
12
  * Internal dependencies
14
13
  */
15
-
16
14
  import InserterSidebar from './inserter-sidebar';
17
15
  import ListViewSidebar from './list-view-sidebar';
18
16
  export default function SecondarySidebar() {
@@ -29,15 +27,12 @@ export default function SecondarySidebar() {
29
27
  isListViewOpen: isListViewOpened()
30
28
  };
31
29
  }, []);
32
-
33
30
  if (isInserterOpen) {
34
31
  return createElement(InserterSidebar, null);
35
32
  }
36
-
37
33
  if (isListViewOpen) {
38
34
  return createElement(ListViewSidebar, null);
39
35
  }
40
-
41
36
  return null;
42
37
  }
43
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/index.js"],"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","SecondarySidebar","isInserterOpen","isListViewOpen","select","isInserterOpened","isListViewOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AAEA,eAAe,SAASC,gBAAT,GAA4B;AAC1C,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAqCP,SAAS,CAAIQ,MAAF,IAAc;AACnE,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QACLF,MAAM,CAAEN,gBAAF,CADP;AAEA,WAAO;AACNI,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,cAAc,EAAEG,gBAAgB;AAF1B,KAAP;AAIA,GAPmD,EAOjD,EAPiD,CAApD;;AASA,MAAKJ,cAAL,EAAsB;AACrB,WAAO,cAAC,eAAD,OAAP;AACA;;AACD,MAAKC,cAAL,EAAsB;AACrB,WAAO,cAAC,eAAD,OAAP;AACA;;AACD,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Internal dependencies\n */\nimport InserterSidebar from './inserter-sidebar';\nimport ListViewSidebar from './list-view-sidebar';\n\nexport default function SecondarySidebar() {\n\tconst { isInserterOpen, isListViewOpen } = useSelect( ( select ) => {\n\t\tconst { isInserterOpened, isListViewOpened } =\n\t\t\tselect( editWidgetsStore );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t};\n\t}, [] );\n\n\tif ( isInserterOpen ) {\n\t\treturn <InserterSidebar />;\n\t}\n\tif ( isListViewOpen ) {\n\t\treturn <ListViewSidebar />;\n\t}\n\treturn null;\n}\n"]}
1
+ {"version":3,"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","SecondarySidebar","isInserterOpen","isListViewOpen","select","isInserterOpened","isListViewOpened","createElement"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Internal dependencies\n */\nimport InserterSidebar from './inserter-sidebar';\nimport ListViewSidebar from './list-view-sidebar';\n\nexport default function SecondarySidebar() {\n\tconst { isInserterOpen, isListViewOpen } = useSelect( ( select ) => {\n\t\tconst { isInserterOpened, isListViewOpened } =\n\t\t\tselect( editWidgetsStore );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t};\n\t}, [] );\n\n\tif ( isInserterOpen ) {\n\t\treturn <InserterSidebar />;\n\t}\n\tif ( isListViewOpen ) {\n\t\treturn <ListViewSidebar />;\n\t}\n\treturn null;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACnE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAC3CF,MAAM,CAAEN,gBAAiB,CAAC;IAC3B,OAAO;MACNI,cAAc,EAAEG,gBAAgB,CAAC,CAAC;MAClCF,cAAc,EAAEG,gBAAgB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKJ,cAAc,EAAG;IACrB,OAAOK,aAAA,CAACR,eAAe,MAAE,CAAC;EAC3B;EACA,IAAKI,cAAc,EAAG;IACrB,OAAOI,aAAA,CAACP,eAAe,MAAE,CAAC;EAC3B;EACA,OAAO,IAAI;AACZ"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -10,10 +9,10 @@ import { useViewportMatch, __experimentalUseDialog as useDialog } from '@wordpre
10
9
  import { useCallback, useEffect, useRef } from '@wordpress/element';
11
10
  import { useDispatch } from '@wordpress/data';
12
11
  import { __ } from '@wordpress/i18n';
12
+
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
-
17
16
  import useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';
18
17
  import { store as editWidgetsStore } from '../../store';
19
18
  export default function InserterSidebar() {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["Button","VisuallyHidden","close","__experimentalLibrary","Library","useViewportMatch","__experimentalUseDialog","useDialog","useCallback","useEffect","useRef","useDispatch","__","useWidgetLibraryInsertionPoint","store","editWidgetsStore","InserterSidebar","isMobileViewport","rootClientId","insertionIndex","setIsInserterOpened","closeInserter","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,cAAjB,QAAuC,uBAAvC;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,qBAAqB,IAAIC,OAAlC,QAAiD,yBAAjD;AACA,SACCC,gBADD,EAECC,uBAAuB,IAAIC,SAF5B,QAGO,oBAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,MAAjC,QAA+C,oBAA/C;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,8BAAP,MAA2C,gDAA3C;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAMC,gBAAgB,GAAGZ,gBAAgB,CAAE,QAAF,EAAY,GAAZ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/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"names":["Button","VisuallyHidden","close","__experimentalLibrary","Library","useViewportMatch","__experimentalUseDialog","useDialog","useCallback","useEffect","useRef","useDispatch","__","useWidgetLibraryInsertionPoint","store","editWidgetsStore","InserterSidebar","isMobileViewport","rootClientId","insertionIndex","setIsInserterOpened","closeInserter","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch","createElement","ref","className","icon","onClick","label","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,yBAAyB;AAC1E,SACCC,gBAAgB,EAChBC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACnE,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,8BAA8B,MAAM,gDAAgD;AAC3F,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAMC,gBAAgB,GAAGZ,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EAC1D,MAAM;IAAEa,YAAY;IAAEC;EAAe,CAAC,GAAGN,8BAA8B,CAAC,CAAC;EAEzE,MAAM;IAAEO;EAAoB,CAAC,GAAGT,WAAW,CAAEI,gBAAiB,CAAC;EAE/D,MAAMM,aAAa,GAAGb,WAAW,CAAE,MAAM;IACxC,OAAOY,mBAAmB,CAAE,KAAM,CAAC;EACpC,CAAC,EAAE,CAAEA,mBAAmB,CAAG,CAAC;EAE5B,MAAME,OAAO,GAAG,CAAEL,gBAAgB,GAAGhB,cAAc,GAAG,KAAK;EAC3D,MAAM,CAAEsB,iBAAiB,EAAEC,mBAAmB,CAAE,GAAGjB,SAAS,CAAE;IAC7DkB,OAAO,EAAEJ,aAAa;IACtBK,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,MAAMC,UAAU,GAAGjB,MAAM,CAAC,CAAC;EAC3BD,SAAS,CAAE,MAAM;IAChBkB,UAAU,CAACC,OAAO,CAACC,WAAW,CAAC,CAAC;EACjC,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA;IACCC,GAAG,EAAGR,iBAAmB;IAAA,GACpBC,mBAAmB;IACxBQ,SAAS,EAAC;EAAqC,GAE/CF,aAAA,CAACR,OAAO;IAACU,SAAS,EAAC;EAA4C,GAC9DF,aAAA,CAAC9B,MAAM;IACNiC,IAAI,EAAG/B,KAAO;IACdgC,OAAO,EAAGb,aAAe;IACzBc,KAAK,EAAGvB,EAAE,CAAE,sBAAuB;EAAG,CACtC,CACO,CAAC,EACVkB,aAAA;IAAKE,SAAS,EAAC;EAA6C,GAC3DF,aAAA,CAAC1B,OAAO;IACPgC,qBAAqB;IACrBC,gBAAgB,EAAGpB,gBAAkB;IACrCC,YAAY,EAAGA,YAAc;IAC7BoB,4BAA4B,EAAGnB,cAAgB;IAC/CY,GAAG,EAAGJ;EAAY,CAClB,CACG,CACD,CAAC;AAER"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -11,30 +10,30 @@ import { useState } from '@wordpress/element';
11
10
  import { __ } from '@wordpress/i18n';
12
11
  import { closeSmall } from '@wordpress/icons';
13
12
  import { ESCAPE } from '@wordpress/keycodes';
13
+
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
-
18
17
  import { store as editWidgetsStore } from '../../store';
19
18
  export default function ListViewSidebar() {
20
19
  const {
21
20
  setIsListViewOpened
22
- } = useDispatch(editWidgetsStore); // Use internal state instead of a ref to make sure that the component
23
- // re-renders when the dropZoneElement updates.
21
+ } = useDispatch(editWidgetsStore);
24
22
 
23
+ // Use internal state instead of a ref to make sure that the component
24
+ // re-renders when the dropZoneElement updates.
25
25
  const [dropZoneElement, setDropZoneElement] = useState(null);
26
26
  const focusOnMountRef = useFocusOnMount('firstElement');
27
27
  const headerFocusReturnRef = useFocusReturn();
28
28
  const contentFocusReturnRef = useFocusReturn();
29
-
30
29
  function closeOnEscape(event) {
31
30
  if (event.keyCode === ESCAPE && !event.defaultPrevented) {
32
31
  event.preventDefault();
33
32
  setIsListViewOpened(false);
34
33
  }
35
34
  }
36
-
37
- return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
35
+ return (
36
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
38
37
  createElement("div", {
39
38
  className: "edit-widgets-editor__list-view-panel",
40
39
  onKeyDown: closeOnEscape
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["__experimentalListView","ListView","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","ListViewSidebar","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAnC,QAAmD,yBAAnD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAA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AAA,eAAe,EAAGD;AAA5B,MARD,CAfD;AAFD;AA6BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","ListViewSidebar","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","createElement","className","onKeyDown","ref","icon","label","onClick"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SACCC,eAAe,EACfC,cAAc,EACdC,YAAY,QACN,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAGR,WAAW,CAAEM,gBAAiB,CAAC;;EAE/D;EACA;EACA,MAAM,CAAEG,eAAe,EAAEC,kBAAkB,CAAE,GAAGT,QAAQ,CAAE,IAAK,CAAC;EAEhE,MAAMU,eAAe,GAAGd,eAAe,CAAE,cAAe,CAAC;EACzD,MAAMe,oBAAoB,GAAGd,cAAc,CAAC,CAAC;EAC7C,MAAMe,qBAAqB,GAAGf,cAAc,CAAC,CAAC;EAE9C,SAASgB,aAAaA,CAAEC,KAAK,EAAG;IAC/B,IAAKA,KAAK,CAACC,OAAO,KAAKZ,MAAM,IAAI,CAAEW,KAAK,CAACE,gBAAgB,EAAG;MAC3DF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBV,mBAAmB,CAAE,KAAM,CAAC;IAC7B;EACD;EAEA;IACC;IACAW,aAAA;MACCC,SAAS,EAAC,sCAAsC;MAChDC,SAAS,EAAGP;IAAe,GAE3BK,aAAA;MACCC,SAAS,EAAC,6CAA6C;MACvDE,GAAG,EAAGV;IAAsB,GAE5BO,aAAA,iBAAUjB,EAAE,CAAE,WAAY,CAAW,CAAC,EACtCiB,aAAA,CAACvB,MAAM;MACN2B,IAAI,EAAGpB,UAAY;MACnBqB,KAAK,EAAGtB,EAAE,CAAE,OAAQ,CAAG;MACvBuB,OAAO,EAAGA,CAAA,KAAMjB,mBAAmB,CAAE,KAAM;IAAG,CAC9C,CACG,CAAC,EACNW,aAAA;MACCC,SAAS,EAAC,8CAA8C;MACxDE,GAAG,EAAGvB,YAAY,CAAE,CACnBc,qBAAqB,EACrBF,eAAe,EACfD,kBAAkB,CACjB;IAAG,GAELS,aAAA,CAACxB,QAAQ;MAACc,eAAe,EAAGA;IAAiB,CAAE,CAC3C,CACD;EAAC;AAER"}
@@ -1,13 +1,12 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * External dependencies
5
4
  */
6
5
  import classnames from 'classnames';
6
+
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
-
11
10
  import { useEffect, Platform } from '@wordpress/element';
12
11
  import { isRTL, __, sprintf } from '@wordpress/i18n';
13
12
  import { ComplementaryArea, store as interfaceStore } from '@wordpress/interface';
@@ -19,17 +18,17 @@ const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select({
19
18
  web: true,
20
19
  native: false
21
20
  });
22
- const BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector'; // Widget areas were one called block areas, so use 'edit-widgets/block-areas'
23
- // for backwards compatibility.
21
+ const BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';
24
22
 
23
+ // Widget areas were one called block areas, so use 'edit-widgets/block-areas'
24
+ // for backwards compatibility.
25
25
  const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
26
+
26
27
  /**
27
28
  * Internal dependencies
28
29
  */
29
-
30
30
  import WidgetAreas from './widget-areas';
31
31
  import { store as editWidgetsStore } from '../../store';
32
-
33
32
  function ComplementaryAreaTab({
34
33
  identifier,
35
34
  label,
@@ -43,12 +42,12 @@ function ComplementaryAreaTab({
43
42
  className: classnames('edit-widgets-sidebar__panel-tab', {
44
43
  'is-active': isActive
45
44
  }),
46
- "aria-label": isActive ? // translators: %s: sidebar label e.g: "Widget Areas".
45
+ "aria-label": isActive ?
46
+ // translators: %s: sidebar label e.g: "Widget Areas".
47
47
  sprintf(__('%s (selected)'), label) : label,
48
48
  "data-label": label
49
49
  }, label);
50
50
  }
51
-
52
51
  export default function Sidebar() {
53
52
  const {
54
53
  enableComplementaryArea
@@ -70,7 +69,6 @@ export default function Sidebar() {
70
69
  const selectedBlock = getSelectedBlock();
71
70
  const activeArea = getActiveComplementaryArea(editWidgetsStore.name);
72
71
  let currentSelection = activeArea;
73
-
74
72
  if (!currentSelection) {
75
73
  if (selectedBlock) {
76
74
  currentSelection = BLOCK_INSPECTOR_IDENTIFIER;
@@ -78,9 +76,7 @@ export default function Sidebar() {
78
76
  currentSelection = WIDGET_AREAS_IDENTIFIER;
79
77
  }
80
78
  }
81
-
82
79
  let widgetAreaBlock;
83
-
84
80
  if (selectedBlock) {
85
81
  if (selectedBlock.name === 'core/widget-area') {
86
82
  widgetAreaBlock = selectedBlock;
@@ -88,21 +84,20 @@ export default function Sidebar() {
88
84
  widgetAreaBlock = getBlock(getBlockParentsByBlockName(selectedBlock.clientId, 'core/widget-area')[0]);
89
85
  }
90
86
  }
91
-
92
87
  return {
93
88
  currentArea: currentSelection,
94
89
  hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== 'core/widget-area'),
95
90
  isGeneralSidebarOpen: !!activeArea,
96
91
  selectedWidgetAreaBlock: widgetAreaBlock
97
92
  };
98
- }, []); // currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,
99
- // because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.
93
+ }, []);
100
94
 
95
+ // currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,
96
+ // because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.
101
97
  useEffect(() => {
102
98
  if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) {
103
99
  enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER);
104
100
  }
105
-
106
101
  if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) {
107
102
  enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
108
103
  }
@@ -119,8 +114,7 @@ export default function Sidebar() {
119
114
  isActive: currentArea === BLOCK_INSPECTOR_IDENTIFIER
120
115
  }))),
121
116
  headerClassName: "edit-widgets-sidebar__panel-tabs"
122
- /* translators: button label text should, if possible, be under 16 characters. */
123
- ,
117
+ /* translators: button label text should, if possible, be under 16 characters. */,
124
118
  title: __('Settings'),
125
119
  closeLabel: __('Close Settings'),
126
120
  scope: "core/edit-widgets",
@@ -129,7 +123,8 @@ export default function Sidebar() {
129
123
  isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
130
124
  }, currentArea === WIDGET_AREAS_IDENTIFIER && createElement(WidgetAreas, {
131
125
  selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
132
- }), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? createElement(BlockInspector, null) : // Pretend that Widget Areas are part of the UI by not
126
+ }), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? createElement(BlockInspector, null) :
127
+ // Pretend that Widget Areas are part of the UI by not
133
128
  // showing the Block Inspector when one is selected.
134
129
  createElement("span", {
135
130
  className: "block-editor-block-inspector__no-blocks"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"names":["classnames","useEffect","Platform","isRTL","__","sprintf","ComplementaryArea","store","interfaceStore","BlockInspector","blockEditorStore","drawerLeft","drawerRight","Button","useSelect","useDispatch","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","WidgetAreas","editWidgetsStore","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","name","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","getSelectedBlock","getBlock","getBlockParentsByBlockName","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","attributes","id"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AACA,SACCC,iBADD,EAECC,KAAK,IAAIC,cAFV,QAGO,sBAHP;AAIA,SACCC,cADD,EAECF,KAAK,IAAIG,gBAFV,QAGO,yBAHP;AAKA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,kBAAxC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,WAApB,Q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AIA;AACD,GArBQ,EAqBN,CAAEW,uBAAF,EAA2BJ,uBAA3B,CArBM,CAAT;AAuBA,SACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,sBADX;AAEC,IAAA,MAAM,EACL,0BACC,0BACC,cAAC,oBAAD;AACC,MAAA,UAAU,EAAGP,uBADd;AAEC,MAAA,KAAK,EACJa,uBAAuB,GACpBA,uBAAuB,CAACU,UAAxB,CAAmCf,IADf,GAEpBzB,EAAE,CAAE,cAAF,CALP;AAOC,MAAA,QAAQ,EAAG2B,WAAW,KAAKV;AAP5B,MADD,CADD,EAYC,0BACC,cAAC,oBAAD;AACC,MAAA,UAAU,EAAGD,0BADd;AAEC,MAAA,KAAK,EAAGhB,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,QAAQ,EACP2B,WAAW,KAAKX;AAJlB,MADD,CAZD,CAHF;AA0BC,IAAA,eAAe,EAAC;AAChB;AA3BD;AA4BC,IAAA,KAAK,EAAGhB,EAAE,CAAE,UAAF,CA5BX;AA6BC,IAAA,UAAU,EAAGA,EAAE,CAAE,gBAAF,CA7BhB;AA8BC,IAAA,KAAK,EAAC,mBA9BP;AA+BC,IAAA,UAAU,EAAG2B,WA/Bd;AAgCC,IAAA,IAAI,EAAG5B,KAAK,KAAKQ,UAAL,GAAkBC,WAhC/B;AAiCC,IAAA,iBAAiB,EAAGI;AAjCrB,KAmCGe,WAAW,KAAKV,uBAAhB,IACD,cAAC,WAAD;AACC,IAAA,oBAAoB,EACnBa,uBAAuB,EAAEU,UAAzB,CAAoCC;AAFtC,IApCF,EA0CGd,WAAW,KAAKX,0BAAhB,KACCY,uBAAuB,GACxB,cAAC,cAAD,OADwB,GAGxB;AACA;AACA;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG5B,EAAE,CAAE,oBAAF,CADL,CANA,CA1CH,CADD;AAuDA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"]}
1
+ {"version":3,"names":["classnames","useEffect","Platform","isRTL","__","sprintf","ComplementaryArea","store","interfaceStore","BlockInspector","blockEditorStore","drawerLeft","drawerRight","Button","useSelect","useDispatch","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","WidgetAreas","editWidgetsStore","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","createElement","onClick","name","className","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","getSelectedBlock","getBlock","getBlockParentsByBlockName","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","header","attributes","headerClassName","title","closeLabel","scope","icon","isActiveByDefault","selectedWidgetAreaId","id"],"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACxD,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SACCC,iBAAiB,EACjBC,KAAK,IAAIC,cAAc,QACjB,sBAAsB;AAC7B,SACCC,cAAc,EACdF,KAAK,IAAIG,gBAAgB,QACnB,yBAAyB;AAEhC,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AAExD,MAAMC,yBAAyB,GAAGd,QAAQ,CAACe,MAAM,CAAE;EAClDC,GAAG,EAAE,IAAI;EACTC,MAAM,EAAE;AACT,CAAE,CAAC;AAEH,MAAMC,0BAA0B,GAAG,8BAA8B;;AAEjE;AACA;AACA,MAAMC,uBAAuB,GAAG,0BAA0B;;AAE1D;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASf,KAAK,IAAIgB,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,oBAAoBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC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,CACJ;IACD6B,eAAe,EAAC;IAChB;IACAC,KAAK,EAAG9C,EAAE,CAAE,UAAW,CAAG;IAC1B+C,UAAU,EAAG/C,EAAE,CAAE,gBAAiB,CAAG;IACrCgD,KAAK,EAAC,mBAAmB;IACzB3B,UAAU,EAAGS,WAAa;IAC1BmB,IAAI,EAAGlD,KAAK,CAAC,CAAC,GAAGQ,UAAU,GAAGC,WAAa;IAC3C0C,iBAAiB,EAAGtC;EAA2B,GAE7CkB,WAAW,KAAKb,uBAAuB,IACxCQ,aAAA,CAACP,WAAW;IACXiC,oBAAoB,EACnBlB,uBAAuB,EAAEW,UAAU,CAACQ;EACpC,CACD,CACD,EACCtB,WAAW,KAAKd,0BAA0B,KACzCe,uBAAuB,GACxBN,aAAA,CAACpB,cAAc,MAAE,CAAC;EAElB;EACA;EACAoB,aAAA;IAAMG,SAAS,EAAC;EAAyC,GACtD5B,EAAE,CAAE,oBAAqB,CACtB,CACN,CACgB,CAAC;AAEtB"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -11,10 +10,10 @@ import { Button } from '@wordpress/components';
11
10
  import { __ } from '@wordpress/i18n';
12
11
  import { addQueryArgs } from '@wordpress/url';
13
12
  import { safeHTML } from '@wordpress/dom';
13
+
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
-
18
17
  import { store as editWidgetsStore } from '../../store';
19
18
  export default function WidgetAreas({
20
19
  selectedWidgetAreaId
@@ -22,7 +21,6 @@ export default function WidgetAreas({
22
21
  const widgetAreas = useSelect(select => select(editWidgetsStore).getWidgetAreas(), []);
23
22
  const selectedWidgetArea = useMemo(() => selectedWidgetAreaId && widgetAreas?.find(widgetArea => widgetArea.id === selectedWidgetAreaId), [selectedWidgetAreaId, widgetAreas]);
24
23
  let description;
25
-
26
24
  if (!selectedWidgetArea) {
27
25
  description = __('Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.');
28
26
  } else if (selectedWidgetAreaId === 'wp_inactive_widgets') {
@@ -30,7 +28,6 @@ export default function WidgetAreas({
30
28
  } else {
31
29
  description = selectedWidgetArea.description;
32
30
  }
33
-
34
31
  return createElement("div", {
35
32
  className: "edit-widgets-widget-areas"
36
33
  }, createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"names":["useSelect","useMemo","blockDefault","BlockIcon","Button","__","addQueryArgs","safeHTML","store","editWidgetsStore","WidgetAreas","selectedWidgetAreaId","widgetAreas","select","getWidgetAreas","selectedWidgetArea","find","widgetArea","id","description","__html","length","return","window","location","pathname"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,SAAT,QAA0B,yBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,QAAT,QAAyB,gBAAzB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,eAAe,SAASC,WAAT,CAAsB;AAAEC,EAAAA;AAAF,CAAtB,EAAiD;AAC/D,QAAMC,WAAW,GAAGZ,SAAS,CAC1Ba,MAAF,IAAcA,MAAM,CAAEJ,gBAAF,CAAN,CAA2BK,cAA3B,EADc,EAE5B,EAF4B,CAA7B;AAKA,QAAMC,kBAAkB,GAAGd,OAAO,CACjC,MACCU,oBAAoB,IACpBC,WAAW,EAAEI,IAAb,CACGC,UAAF,IAAkBA,UAAU,CAACC,EAAX,KAAkBP,oBADrC,CAHgC,EAMjC,CAAEA,oBAAF,EAAwBC,WAAxB,CANiC,CAAlC;AASA,MAAIO,WAAJ;;AACA,MAAK,CAAEJ,kBAAP,EAA4B;AAC3BI,IAAAA,WAAW,GAAGd,EAAE,CACf,uJADe,CAAhB;AAGA,GAJD,MAIO,IAAKM,oBAAoB,KAAK,qBAA9B,EAAsD;AAC5DQ,IAAAA,WAAW,GAAGd,EAAE,CACf,gEADe,CAAhB;AAGA,GAJM,MAIA;AACNc,IAAAA,WAAW,GAAGJ,kBAAkB,CAACI,WAAjC;AACA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,SAAD;AAAW,IAAA,IAAI,EAAGjB;AAAlB,IADD,EAEC,2BACC;AACC;AACA;AACA;AACA;AACA,IAAA,uBAAuB,EAAG;AACzBkB,MAAAA,MAAM,EAAEb,QAAQ,CAAEY,WAAF;AADS;AAL3B,IADD,EAUGP,WAAW,EAAES,MAAb,KAAwB,CAAxB,IACD,yBACGhB,EAAE,CACH,+CADG,CADL,CAXF,EAiBG,CAAEU,kBAAF,IACD,cAAC,MAAD;AACC,IAAA,IAAI,EAAGT,YAAY,CAAE,eAAF,EAAmB;AACrC,0BAAoB,SADiB;AAErCgB,MAAAA,MAAM,EAAEC,MAAM,CAACC,QAAP,CAAgBC;AAFa,KAAnB,CADpB;AAKC,IAAA,OAAO,EAAC;AALT,KAOGpB,EAAE,CAAE,0BAAF,CAPL,CAlBF,CAFD,CADD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"names":["useSelect","useMemo","blockDefault","BlockIcon","Button","__","addQueryArgs","safeHTML","store","editWidgetsStore","WidgetAreas","selectedWidgetAreaId","widgetAreas","select","getWidgetAreas","selectedWidgetArea","find","widgetArea","id","description","createElement","className","icon","dangerouslySetInnerHTML","__html","length","href","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,MAAM,QAAQ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