@wordpress/edit-widgets 7.2.0 → 7.3.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 (187) hide show
  1. package/build/blocks/widget-area/edit/index.cjs +10 -8
  2. package/build/blocks/widget-area/edit/index.cjs.map +1 -1
  3. package/build/blocks/widget-area/edit/inner-blocks.cjs +10 -8
  4. package/build/blocks/widget-area/edit/inner-blocks.cjs.map +1 -1
  5. package/build/blocks/widget-area/edit/use-is-dragging-within.cjs.map +1 -1
  6. package/build/blocks/widget-area/index.cjs +9 -7
  7. package/build/blocks/widget-area/index.cjs.map +1 -1
  8. package/build/components/error-boundary/index.cjs.map +1 -1
  9. package/build/components/header/document-tools/index.cjs +20 -10
  10. package/build/components/header/document-tools/index.cjs.map +1 -1
  11. package/build/components/header/index.cjs +12 -10
  12. package/build/components/header/index.cjs.map +1 -1
  13. package/build/components/keyboard-shortcut-help-modal/config.cjs +5 -0
  14. package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -1
  15. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +9 -7
  16. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -1
  17. package/build/components/keyboard-shortcut-help-modal/index.cjs +12 -11
  18. package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -1
  19. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +34 -13
  20. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -1
  21. package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
  22. package/build/components/layout/index.cjs +19 -13
  23. package/build/components/layout/index.cjs.map +1 -1
  24. package/build/components/layout/interface.cjs +27 -13
  25. package/build/components/layout/interface.cjs.map +1 -1
  26. package/build/components/layout/unsaved-changes-warning.cjs.map +1 -1
  27. package/build/components/more-menu/index.cjs +14 -9
  28. package/build/components/more-menu/index.cjs.map +1 -1
  29. package/build/components/secondary-sidebar/index.cjs +10 -8
  30. package/build/components/secondary-sidebar/index.cjs.map +1 -1
  31. package/build/components/secondary-sidebar/inserter-sidebar.cjs +9 -7
  32. package/build/components/secondary-sidebar/inserter-sidebar.cjs.map +1 -1
  33. package/build/components/sidebar/index.cjs +23 -15
  34. package/build/components/sidebar/index.cjs.map +1 -1
  35. package/build/components/welcome-guide/index.cjs +5 -1
  36. package/build/components/welcome-guide/index.cjs.map +1 -1
  37. package/build/components/widget-areas-block-editor-content/index.cjs +10 -8
  38. package/build/components/widget-areas-block-editor-content/index.cjs.map +1 -1
  39. package/build/components/widget-areas-block-editor-provider/index.cjs +10 -8
  40. package/build/components/widget-areas-block-editor-provider/index.cjs.map +1 -1
  41. package/build/constants.cjs +0 -2
  42. package/build/constants.cjs.map +1 -1
  43. package/build/index.cjs +12 -10
  44. package/build/index.cjs.map +1 -1
  45. package/build/store/actions.cjs +11 -7
  46. package/build/store/actions.cjs.map +1 -1
  47. package/build/store/index.cjs +14 -12
  48. package/build/store/index.cjs.map +1 -1
  49. package/build/store/selectors.cjs +3 -1
  50. package/build/store/selectors.cjs.map +1 -1
  51. package/build-module/blocks/widget-area/index.mjs.map +1 -1
  52. package/build-module/components/header/document-tools/index.mjs +10 -2
  53. package/build-module/components/header/document-tools/index.mjs.map +1 -1
  54. package/build-module/components/header/undo-redo/redo.mjs.map +1 -1
  55. package/build-module/components/header/undo-redo/undo.mjs.map +1 -1
  56. package/build-module/components/keyboard-shortcut-help-modal/config.mjs +5 -0
  57. package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -1
  58. package/build-module/components/keyboard-shortcut-help-modal/index.mjs +1 -2
  59. package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -1
  60. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +34 -13
  61. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -1
  62. package/build-module/components/layout/index.mjs +5 -1
  63. package/build-module/components/layout/index.mjs.map +1 -1
  64. package/build-module/components/layout/interface.mjs +16 -4
  65. package/build-module/components/layout/interface.mjs.map +1 -1
  66. package/build-module/components/more-menu/index.mjs +4 -1
  67. package/build-module/components/more-menu/index.mjs.map +1 -1
  68. package/build-module/components/sidebar/index.mjs +14 -8
  69. package/build-module/components/sidebar/index.mjs.map +1 -1
  70. package/build-module/components/welcome-guide/index.mjs +5 -1
  71. package/build-module/components/welcome-guide/index.mjs.map +1 -1
  72. package/build-module/constants.mjs +1 -2
  73. package/build-module/constants.mjs.map +1 -1
  74. package/build-module/index.mjs +2 -2
  75. package/build-module/index.mjs.map +1 -1
  76. package/build-module/store/actions.mjs +11 -7
  77. package/build-module/store/actions.mjs.map +1 -1
  78. package/build-module/store/selectors.mjs +3 -1
  79. package/build-module/store/selectors.mjs.map +1 -1
  80. package/build-style/style-rtl.css +42 -37
  81. package/build-style/style.css +42 -37
  82. package/build-types/blocks/widget-area/edit/index.d.ts +10 -0
  83. package/build-types/blocks/widget-area/edit/index.d.ts.map +1 -0
  84. package/build-types/blocks/widget-area/edit/inner-blocks.d.ts +4 -0
  85. package/build-types/blocks/widget-area/edit/inner-blocks.d.ts.map +1 -0
  86. package/build-types/blocks/widget-area/edit/use-is-dragging-within.d.ts +12 -0
  87. package/build-types/blocks/widget-area/edit/use-is-dragging-within.d.ts.map +1 -0
  88. package/build-types/blocks/widget-area/index.d.ts +14 -0
  89. package/build-types/blocks/widget-area/index.d.ts.map +1 -0
  90. package/build-types/components/error-boundary/index.d.ts +14 -0
  91. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  92. package/build-types/components/header/document-tools/index.d.ts +3 -0
  93. package/build-types/components/header/document-tools/index.d.ts.map +1 -0
  94. package/build-types/components/header/index.d.ts +3 -0
  95. package/build-types/components/header/index.d.ts.map +1 -0
  96. package/build-types/components/header/undo-redo/redo.d.ts +3 -0
  97. package/build-types/components/header/undo-redo/redo.d.ts.map +1 -0
  98. package/build-types/components/header/undo-redo/undo.d.ts +3 -0
  99. package/build-types/components/header/undo-redo/undo.d.ts.map +1 -0
  100. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +3 -0
  101. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
  102. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
  103. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
  104. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +5 -0
  105. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
  106. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +25 -0
  107. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
  108. package/build-types/components/keyboard-shortcuts/index.d.ts +7 -0
  109. package/build-types/components/keyboard-shortcuts/index.d.ts.map +1 -0
  110. package/build-types/components/layout/index.d.ts +5 -0
  111. package/build-types/components/layout/index.d.ts.map +1 -0
  112. package/build-types/components/layout/interface.d.ts +5 -0
  113. package/build-types/components/layout/interface.d.ts.map +1 -0
  114. package/build-types/components/layout/unsaved-changes-warning.d.ts +10 -0
  115. package/build-types/components/layout/unsaved-changes-warning.d.ts.map +1 -0
  116. package/build-types/components/more-menu/index.d.ts +2 -0
  117. package/build-types/components/more-menu/index.d.ts.map +1 -0
  118. package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
  119. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
  120. package/build-types/components/notices/index.d.ts +3 -0
  121. package/build-types/components/notices/index.d.ts.map +1 -0
  122. package/build-types/components/save-button/index.d.ts +3 -0
  123. package/build-types/components/save-button/index.d.ts.map +1 -0
  124. package/build-types/components/secondary-sidebar/index.d.ts +2 -0
  125. package/build-types/components/secondary-sidebar/index.d.ts.map +1 -0
  126. package/build-types/components/secondary-sidebar/inserter-sidebar.d.ts +2 -0
  127. package/build-types/components/secondary-sidebar/inserter-sidebar.d.ts.map +1 -0
  128. package/build-types/components/secondary-sidebar/list-view-sidebar.d.ts +2 -0
  129. package/build-types/components/secondary-sidebar/list-view-sidebar.d.ts.map +1 -0
  130. package/build-types/components/sidebar/index.d.ts +2 -0
  131. package/build-types/components/sidebar/index.d.ts.map +1 -0
  132. package/build-types/components/sidebar/widget-areas.d.ts +4 -0
  133. package/build-types/components/sidebar/widget-areas.d.ts.map +1 -0
  134. package/build-types/components/welcome-guide/index.d.ts +2 -0
  135. package/build-types/components/welcome-guide/index.d.ts.map +1 -0
  136. package/build-types/components/widget-areas-block-editor-content/index.d.ts +4 -0
  137. package/build-types/components/widget-areas-block-editor-content/index.d.ts.map +1 -0
  138. package/build-types/components/widget-areas-block-editor-provider/index.d.ts +6 -0
  139. package/build-types/components/widget-areas-block-editor-provider/index.d.ts.map +1 -0
  140. package/build-types/constants.d.ts +2 -0
  141. package/build-types/constants.d.ts.map +1 -0
  142. package/build-types/filters/index.d.ts +3 -0
  143. package/build-types/filters/index.d.ts.map +1 -0
  144. package/build-types/filters/move-to-widget-area.d.ts +2 -0
  145. package/build-types/filters/move-to-widget-area.d.ts.map +1 -0
  146. package/build-types/filters/replace-media-upload.d.ts +2 -0
  147. package/build-types/filters/replace-media-upload.d.ts.map +1 -0
  148. package/build-types/hooks/use-last-selected-widget-area.d.ts +9 -0
  149. package/build-types/hooks/use-last-selected-widget-area.d.ts.map +1 -0
  150. package/build-types/hooks/use-widget-library-insertion-point.d.ts +3 -0
  151. package/build-types/hooks/use-widget-library-insertion-point.d.ts.map +1 -0
  152. package/build-types/index.d.ts +16 -0
  153. package/build-types/index.d.ts.map +1 -0
  154. package/build-types/lock-unlock.d.ts +2 -0
  155. package/build-types/lock-unlock.d.ts.map +1 -0
  156. package/build-types/store/actions.d.ts +144 -0
  157. package/build-types/store/actions.d.ts.map +1 -0
  158. package/build-types/store/constants.d.ts +5 -0
  159. package/build-types/store/constants.d.ts.map +1 -0
  160. package/build-types/store/index.d.ts +9 -0
  161. package/build-types/store/index.d.ts.map +1 -0
  162. package/build-types/store/private-selectors.d.ts +3 -0
  163. package/build-types/store/private-selectors.d.ts.map +1 -0
  164. package/build-types/store/reducer.d.ts +73 -0
  165. package/build-types/store/reducer.d.ts.map +1 -0
  166. package/build-types/store/resolvers.d.ts +17 -0
  167. package/build-types/store/resolvers.d.ts.map +1 -0
  168. package/build-types/store/selectors.d.ts +159 -0
  169. package/build-types/store/selectors.d.ts.map +1 -0
  170. package/build-types/store/transformers.d.ts +16 -0
  171. package/build-types/store/transformers.d.ts.map +1 -0
  172. package/build-types/store/utils.d.ts +53 -0
  173. package/build-types/store/utils.d.ts.map +1 -0
  174. package/package.json +33 -33
  175. package/src/components/header/style.scss +1 -1
  176. package/src/components/keyboard-shortcut-help-modal/config.js +3 -0
  177. package/src/components/keyboard-shortcut-help-modal/index.jsx +0 -2
  178. package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +43 -29
  179. package/src/components/sidebar/index.jsx +1 -1
  180. package/src/components/sidebar/style.scss +6 -0
  181. package/src/components/welcome-guide/style.scss +1 -1
  182. package/src/components/widget-areas-block-editor-content/style.scss +1 -1
  183. package/src/constants.js +0 -1
  184. package/src/index.jsx +2 -7
  185. package/src/store/actions.js +8 -12
  186. package/src/store/selectors.js +4 -1
  187. package/src/store/test/actions.jsdom.test.js +47 -2
@@ -5,24 +5,45 @@ Object.defineProperties(exports, {
5
5
  });
6
6
  let _wordpress_element = require("@wordpress/element");
7
7
  let _wordpress_keycodes = require("@wordpress/keycodes");
8
+ let _wordpress_ui = require("@wordpress/ui");
8
9
  let react_jsx_runtime = require("react/jsx-runtime");
9
10
  // packages/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.jsx
10
- function KeyCombination({ keyCombination, forceAriaLabel }) {
11
- const shortcut = keyCombination.modifier ? _wordpress_keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
12
- const ariaLabel = keyCombination.modifier ? _wordpress_keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
13
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
11
+ /**
12
+ * @typedef {Object} ShortcutKeyCombination
13
+ * @property {string} character Shortcut key.
14
+ * @property {import('@wordpress/keycodes').WPKeycodeModifier | null} [modifier] Optional shortcut modifier.
15
+ */
16
+ /**
17
+ * @param {Object} props Component props.
18
+ * @param {ShortcutKeyCombination} props.keyCombination Shortcut to display.
19
+ * @param {string} [props.ariaLabel] Custom readable shortcut label.
20
+ */
21
+ function KeyCombination({ keyCombination, ariaLabel }) {
22
+ const { character, modifier } = keyCombination;
23
+ const normalizedModifier = modifier ?? "undefined";
24
+ const keys = _wordpress_keycodes.displayShortcutList[normalizedModifier](character);
25
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("kbd", {
14
26
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
15
27
  dir: "ltr",
16
- "aria-label": forceAriaLabel || ariaLabel,
17
- children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
18
- if (character === "+") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_element.Fragment, { children: character }, index);
19
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
28
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.VisuallyHidden, {
29
+ render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}),
30
+ children: ariaLabel || _wordpress_keycodes.shortcutAriaLabel[normalizedModifier](character)
31
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
32
+ "aria-hidden": "true",
33
+ children: keys.map((key, index) => key === "+" && index < keys.length - 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_element.Fragment, { children: key }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
20
34
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key",
21
- children: character
22
- }, index);
23
- })
35
+ children: key
36
+ }, index))
37
+ })]
24
38
  });
25
39
  }
40
+ /**
41
+ * @param {Object} props Component props.
42
+ * @param {string} props.description Description of the shortcut action.
43
+ * @param {ShortcutKeyCombination} props.keyCombination Primary shortcut.
44
+ * @param {ShortcutKeyCombination[]} [props.aliases] Alternative shortcuts.
45
+ * @param {string} [props.ariaLabel] Custom readable shortcut label.
46
+ */
26
47
  function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
27
48
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
28
49
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description",
@@ -31,10 +52,10 @@ function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
31
52
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term",
32
53
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyCombination, {
33
54
  keyCombination,
34
- forceAriaLabel: ariaLabel
55
+ ariaLabel
35
56
  }), aliases.map((alias, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyCombination, {
36
57
  keyCombination: alias,
37
- forceAriaLabel: ariaLabel
58
+ ariaLabel
38
59
  }, index))]
39
60
  })] });
40
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shortcut.cjs","names":["displayShortcutList","shortcutAriaLabel","Fragment"],"sources":["../../../src/components/keyboard-shortcut-help-modal/shortcut.jsx"],"sourcesContent":["import { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t\t)\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t\t)\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\tdir=\"ltr\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";;;;;;;;;AAGA,SAAS,eAAgB,EAAE,gBAAgB,kBAAmB;CAC7D,MAAM,WAAW,eAAe,WAC7BA,oBAAAA,oBAAqB,eAAe,SAAU,CAC9C,eAAe,SAChB,IACC,eAAe;CAClB,MAAM,YAAY,eAAe,WAC9BC,oBAAAA,kBAAmB,eAAe,SAAU,CAC5C,eAAe,SAChB,IACC,eAAe;CAGlB,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACC,WAAU;EACV,KAAI;EACJ,cAAa,kBAAkB;EANf,WAAA,MAAM,QAAS,QAAS,IAAI,WAAW,CAAE,QAAS,EAAA,CAQtD,KAAO,WAAW,UAAW;GACxC,IAAK,cAAc,KAClB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,UAAD,EAAA,UAA0B,UAAqB,GAA/B,KAA+B;GAGvD,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAEC,WAAU;IAER,UAAA;GACE,GAJE,KAIF;EAEP,CAAE;CACE,CAAA;AAEP;AAEA,SAAS,SAAU,EAAE,aAAa,gBAAgB,UAAU,CAAC,GAAG,aAAc;CAC7E,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACZ,UAAA;CACE,CAAA,GACL,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;GACkB;GACjB,gBAAiB;EACjB,CAAA,GACC,QAAQ,KAAO,OAAO,UACvB,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;GACC,gBAAiB;GACjB,gBAAiB;EAEjB,GADM,KACN,CACA,CACE;CACJ,CAAA,CAAA,EAAA,CAAA;AAEJ"}
1
+ {"version":3,"file":"shortcut.cjs","names":["displayShortcutList","VisuallyHidden","shortcutAriaLabel","Fragment"],"sources":["../../../src/components/keyboard-shortcut-help-modal/shortcut.jsx"],"sourcesContent":["import { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * @typedef {Object} ShortcutKeyCombination\n * @property {string} character Shortcut key.\n * @property {import('@wordpress/keycodes').WPKeycodeModifier | null} [modifier] Optional shortcut modifier.\n */\n\n/**\n * @param {Object} props Component props.\n * @param {ShortcutKeyCombination} props.keyCombination Shortcut to display.\n * @param {string} [props.ariaLabel] Custom readable shortcut label.\n */\nfunction KeyCombination( { keyCombination, ariaLabel } ) {\n\tconst { character, modifier } = keyCombination;\n\tconst normalizedModifier = modifier ?? 'undefined';\n\tconst keys = displayShortcutList[ normalizedModifier ]( character );\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\tdir=\"ltr\"\n\t\t>\n\t\t\t<VisuallyHidden render={ <span /> }>\n\t\t\t\t{ ariaLabel ||\n\t\t\t\t\tshortcutAriaLabel[ normalizedModifier ]( character ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t{ keys.map( ( key, index ) =>\n\t\t\t\t\tkey === '+' && index < keys.length - 1 ? (\n\t\t\t\t\t\t<Fragment key={ index }>{ key }</Fragment>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ key }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t)\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</kbd>\n\t);\n}\n\n/**\n * @param {Object} props Component props.\n * @param {string} props.description Description of the shortcut action.\n * @param {ShortcutKeyCombination} props.keyCombination Primary shortcut.\n * @param {ShortcutKeyCombination[]} [props.aliases] Alternative shortcuts.\n * @param {string} [props.ariaLabel] Custom readable shortcut label.\n */\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tariaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tariaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,SAAS,eAAgB,EAAE,gBAAgB,aAAc;CACxD,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,qBAAqB,YAAY;CACvC,MAAM,OAAOA,oBAAAA,oBAAqB,mBAAoB,CAAE,SAAU;CAElE,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACC,WAAU;EACV,KAAI;EAFL,UAAA,CAIC,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,gBAAD;GAAgB,QAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,CAAO,CAAA;GAC7B,UAAA,aACDC,oBAAAA,kBAAmB,mBAAoB,CAAE,SAAU;EACrC,CAAA,GAChB,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,eAAY;GACf,UAAA,KAAK,KAAO,KAAK,UAClB,QAAQ,OAAO,QAAQ,KAAK,SAAS,IACpC,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,UAAD,EAAA,UAA0B,IAAe,GAAzB,KAAyB,IAEzC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAEC,WAAU;IAER,UAAA;GACE,GAJE,KAIF,CAEP;EACK,CAAA,CACF;;AAEP;;;;;;;;AASA,SAAS,SAAU,EAAE,aAAa,gBAAgB,UAAU,CAAC,GAAG,aAAc;CAC7E,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACZ,UAAA;CACE,CAAA,GACL,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;GACkB;GACL;EACZ,CAAA,GACC,QAAQ,KAAO,OAAO,UACvB,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAD;GACC,gBAAiB;GACL;EAEZ,GADM,KACN,CACA,CACE;CACJ,CAAA,CAAA,EAAA,CAAA;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["unlock","blockEditorPrivateApis","useDispatch","coreStore","editWidgetsStore","keyboardShortcutsStore","__","isAppleOS"],"sources":["../../../src/components/keyboard-shortcuts/index.js"],"sourcesContent":["import { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,EAAE,oBAAA,G,+BAAmBA,CAAAA,CAAAA,OAAAA,CAAQC,wBAAAA,WAAuB;AAE1D,SAAS,oBAAoB;CAC5B,MAAM,EAAE,MAAM,UAAA,GAASC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAU;CAC9C,MAAM,EAAE,2BAAA,GAA0BD,gBAAAA,YAAAA,CAAaE,qBAAAA,KAAiB;CAEhE,CAAA,GAAA,8BAAA,YAAA,CAAa,2BAA4B,UAAW;EACnD,IAAK,eAAgB,KAAM,GAC1B;EAED,K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,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaA,gBAAAA,GAAAA,CAAI,8CAA+C;GAChE,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;GACA,SAAS,CACR;IACC,UAAU;IACV,WAAW;GACZ,GACA;IACC,UAAU;IACV,WAAW;GACZ,CACD;EACD,CAAE;CACH,GAAG,CAAE,gBAAiB,CAAE;CAExB,OAAO;AACR;AAEA,kBAAkB,WAAW"}
1
+ {"version":3,"file":"index.cjs","names":["unlock","blockEditorPrivateApis","useDispatch","coreStore","editWidgetsStore","useShortcut","keyboardShortcutsStore","useEffect","__","isAppleOS"],"sources":["../../../src/components/keyboard-shortcuts/index.js"],"sourcesContent":["import { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,EAAE,oBAAA,G,+BAAmBA,CAAAA,CAAAA,OAAAA,CAAQC,wBAAAA,WAAuB;AAE1D,SAAS,oBAAoB;CAC5B,MAAM,EAAE,MAAM,UAAA,GAASC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAU;CAC9C,MAAM,EAAE,2BAAA,GAA0BD,gBAAAA,YAAAA,CAAaE,qBAAAA,KAAiB;CAEhEC,CAAAA,GAAAA,8BAAAA,YAAAA,CAAa,2BAA4B,UAAW;EACnD,IAAK,eAAgB,KAAM,GAC1B;EAED,KAAK;EACL,MAAM,eAAe;CACtB,CAAE;CAEFA,CAAAA,GAAAA,8BAAAA,YAAAA,CAAa,2BAA4B,UAAW;EACnD,IAAK,eAAgB,KAAM,GAC1B;EAED,KAA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AU;IACV,WAAW;GACZ;GACA,SAAS,CACR;IACC,UAAU;IACV,WAAW;GACZ,GACA;IACC,UAAU;IACV,WAAW;GACZ,CACD;EACD,CAAE;CACH,GAAG,CAAE,gBAAiB,CAAE;CAExB,OAAO;AACR;AAEA,kBAAkB,WAAW"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -33,23 +35,27 @@ let _wordpress_notices = require("@wordpress/notices");
33
35
  let _wordpress_components = require("@wordpress/components");
34
36
  let _wordpress_theme = require("@wordpress/theme");
35
37
  let ___error_boundary_index_jsx = require("../error-boundary/index.cjs");
36
- ___error_boundary_index_jsx = __toESM(___error_boundary_index_jsx);
37
38
  let ___widget_areas_block_editor_provider_index_jsx = require("../widget-areas-block-editor-provider/index.cjs");
38
- ___widget_areas_block_editor_provider_index_jsx = __toESM(___widget_areas_block_editor_provider_index_jsx);
39
39
  let ___sidebar_index_jsx = require("../sidebar/index.cjs");
40
- ___sidebar_index_jsx = __toESM(___sidebar_index_jsx);
41
40
  let __interface_jsx = require("./interface.cjs");
42
- __interface_jsx = __toESM(__interface_jsx);
43
41
  let __unsaved_changes_warning_js = require("./unsaved-changes-warning.cjs");
44
- __unsaved_changes_warning_js = __toESM(__unsaved_changes_warning_js);
45
42
  let ___welcome_guide_index_jsx = require("../welcome-guide/index.cjs");
46
- ___welcome_guide_index_jsx = __toESM(___welcome_guide_index_jsx);
47
43
  let react_jsx_runtime = require("react/jsx-runtime");
44
+ ___error_boundary_index_jsx = __toESM(___error_boundary_index_jsx);
45
+ ___widget_areas_block_editor_provider_index_jsx = __toESM(___widget_areas_block_editor_provider_index_jsx);
46
+ ___sidebar_index_jsx = __toESM(___sidebar_index_jsx);
47
+ __interface_jsx = __toESM(__interface_jsx);
48
+ __unsaved_changes_warning_js = __toESM(__unsaved_changes_warning_js);
49
+ ___welcome_guide_index_jsx = __toESM(___welcome_guide_index_jsx);
48
50
  // packages/edit-widgets/src/components/layout/index.jsx
49
51
  function Layout({ blockEditorSettings }) {
50
52
  const { createErrorNotice } = (0, _wordpress_data.useDispatch)(_wordpress_notices.store);
51
53
  function onPluginAreaError(name) {
52
- createErrorNotice((0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("The \"%s\" plugin has encountered an error and cannot be rendered."), name));
54
+ createErrorNotice((0, _wordpress_i18n.sprintf)(
55
+ /** translators: %s: plugin name */
56
+ (0, _wordpress_i18n.__)("The \"%s\" plugin has encountered an error and cannot be rendered."),
57
+ name
58
+ ));
53
59
  }
54
60
  const navigateRegionsProps = (0, _wordpress_components.__unstableUseNavigateRegions)();
55
61
  const adminPrimary = (0, _wordpress_element.useMemo)(() => (0, _wordpress_admin_ui.getAdminThemeColors)().primary, []);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useDispatch","noticesStore","sprintf","__","useNavigateRegions","useMemo","getAdminThemeColors","ThemeProvider","ErrorBoundary","WidgetAreasBlockEditorProvider","Interface","Sidebar","PluginArea","UnsavedChangesWarning","WelcomeGuide"],"sources":["../../../src/components/layout/index.jsx"],"sourcesContent":["import { getAdminThemeColors } from '@wordpress/admin-ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { ThemeProvider } from '@wordpress/theme';\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst adminPrimary = useMemo( () => getAdminThemeColors().primary, [] );\n\n\treturn (\n\t\t<ThemeProvider isRoot color={ { primary: adminPrimary } }>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Interface\n\t\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</ThemeProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,OAAQ,EAAE,uBAAwB;CAC1C,MAAM,EAAE,uBAAA,GAAsBA,gBAAAA,YAAAA,CAAaC,mBAAAA,KAAa;CAExD,SAAS,kBAAmB,MAAO;EAClC,mBAAA,GACCC,gBAAAA,QAAAA,EAAAA,GAECC,gBAAAA,GAAAA,CACC,oEACD,GACA,IACD,CACD;CACD;CAEA,MAAM,wBAAA,GAAuBC,sBAAAA,6BAAAA,CAAmB;CAChD,MAAM,gBAAA,GAAeC,mBAAAA,QAAAA,QAAAA,GAAeC,oBAAAA,oBAAAA,CAAoB,CAAC,CAAC,SAAS,CAAC,CAAE;CAEtE,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,eAAD;EAAe,QAAA;EAAO,OAAQ,EAAE,SAAS,aAAa;EACrD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAAA,SAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,GAAK;GACT,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gDAAAA,SAAD;IACuB;IADvB,UAAA;KAGC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,SAAD,EACuB,oBACtB,CAAA;KACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD,CAAU,CAAA;KACV,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD,EAAY,SAAU,kBAAqB,CAAA;KAC3C,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,SAAD,CAAwB,CAAA;KACxB,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAe,CAAA;IACgB;;EAC5B,CAAA,EACS,CAAA;CACD,CAAA;AAEjB"}
1
+ {"version":3,"file":"index.cjs","names":["useDispatch","noticesStore","sprintf","__","useNavigateRegions","useMemo","getAdminThemeColors","ThemeProvider","ErrorBoundary","WidgetAreasBlockEditorProvider","Interface","Sidebar","PluginArea","UnsavedChangesWarning","WelcomeGuide"],"sources":["../../../src/components/layout/index.jsx"],"sourcesContent":["import { getAdminThemeColors } from '@wordpress/admin-ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { ThemeProvider } from '@wordpress/theme';\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst adminPrimary = useMemo( () => getAdminThemeColors().primary, [] );\n\n\treturn (\n\t\t<ThemeProvider isRoot color={ { primary: adminPrimary } }>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Interface\n\t\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</ThemeProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,OAAQ,EAAE,uBAAwB;CAC1C,MAAM,EAAE,uBAAA,GAAsBA,gBAAAA,YAAAA,CAAaC,mBAAAA,KAAa;CAExD,SAAS,kBAAmB,MAAO;EAClC,mBAAA,GACCC,gBAAAA,QAAAA;;IAECC,GAAAA,gBAAAA,GAAAA,CACC,oEACD;GACA;EACD,CACD;CACD;CAEA,MAAM,wBAAA,GAAuBC,sBAAAA,6BAAAA,CAAmB;CAChD,MAAM,gBAAA,GAAeC,mBAAAA,QAAAA,QAAAA,GAAeC,oBAAAA,oBAAAA,CAAoB,CAAC,CAAC,SAAS,CAAC,CAAE;CAEtE,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,eAAD;EAAe,QAAA;EAAO,OAAQ,EAAE,SAAS,aAAa;EACrD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAAA,SAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,GAAK;GACT,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gDAAAA,SAAD;IACuB;IADvB,UAAA;KAGC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,SAAD,EACuB,oBACtB,CAAA;KACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD,CAAU,CAAA;KACV,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD,EAAY,SAAU,kBAAqB,CAAA;KAC3C,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,SAAD,CAAwB,CAAA;KACxB,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAe,CAAA;IACgB;;EAC5B,CAAA,EACS,CAAA;CACD,CAAA;AAEjB"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -32,19 +34,31 @@ let _wordpress_interface = require("@wordpress/interface");
32
34
  let _wordpress_i18n = require("@wordpress/i18n");
33
35
  let _wordpress_preferences = require("@wordpress/preferences");
34
36
  let ___header_index_jsx = require("../header/index.cjs");
35
- ___header_index_jsx = __toESM(___header_index_jsx);
36
37
  let ___widget_areas_block_editor_content_index_jsx = require("../widget-areas-block-editor-content/index.cjs");
37
- ___widget_areas_block_editor_content_index_jsx = __toESM(___widget_areas_block_editor_content_index_jsx);
38
38
  let ______store_index_js = require("../../store/index.cjs");
39
39
  let ___secondary_sidebar_index_jsx = require("../secondary-sidebar/index.cjs");
40
- ___secondary_sidebar_index_jsx = __toESM(___secondary_sidebar_index_jsx);
41
40
  let react_jsx_runtime = require("react/jsx-runtime");
41
+ ___header_index_jsx = __toESM(___header_index_jsx);
42
+ ___widget_areas_block_editor_content_index_jsx = __toESM(___widget_areas_block_editor_content_index_jsx);
43
+ ___secondary_sidebar_index_jsx = __toESM(___secondary_sidebar_index_jsx);
42
44
  // packages/edit-widgets/src/components/layout/interface.jsx
43
45
  const interfaceLabels = {
44
- header: (0, _wordpress_i18n.__)("Widgets top bar"),
45
- body: (0, _wordpress_i18n.__)("Widgets and blocks"),
46
- sidebar: (0, _wordpress_i18n.__)("Widgets settings"),
47
- footer: (0, _wordpress_i18n.__)("Widgets footer")
46
+ header: (0, _wordpress_i18n.__)(
47
+ /** translators: accessibility text for the widgets screen top bar landmark region. */
48
+ "Widgets top bar"
49
+ ),
50
+ body: (0, _wordpress_i18n.__)(
51
+ /** translators: accessibility text for the widgets screen content landmark region. */
52
+ "Widgets and blocks"
53
+ ),
54
+ sidebar: (0, _wordpress_i18n.__)(
55
+ /** translators: accessibility text for the widgets screen settings landmark region. */
56
+ "Widgets settings"
57
+ ),
58
+ footer: (0, _wordpress_i18n.__)(
59
+ /** translators: accessibility text for the widgets screen footer landmark region. */
60
+ "Widgets footer"
61
+ )
48
62
  };
49
63
  function Interface({ blockEditorSettings }) {
50
64
  const isMobileViewport = (0, _wordpress_compose.useViewportMatch)("medium", "<");
@@ -1 +1 @@
1
- {"version":3,"file":"interface.cjs","names":["__","useViewportMatch","useDispatch","editWidgetsStore","useSelect","interfaceStore","preferencesStore","InterfaceSkeleton","Header","SecondarySidebar","ComplementaryArea","WidgetAreasBlockEditorContent","BlockBreadcrumb"],"sources":["../../../src/components/layout/interface.jsx"],"sourcesContent":["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\tclassName=\"edit-widgets-layout__breadcrumbs\"\n\t\t\t\t\t\t\trootLabelText={ __( 'Widgets' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,kBAAkB;CAEvB,SAAA,GAAQA,gBAAAA,GAAAA,CAAI,iBAAkB;CAE9B,OAAA,GAAMA,gBAAAA,GAAAA,CAAI,oBAAqB;CAE/B,UAAA,GAASA,gBAAAA,GAAAA,CAAI,kBAAmB;CAEhC,SAAA,GAAQA,gBAAAA,GAAAA,CAAI,gBAAiB;AAC9B;AAEA,SAAS,UAAW,EAAE,uBAAwB;CAC7C,MAAM,oBAAA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BAAA,GAAA,kBAAA,IAAA,CAACC,+BAAAA,SAAD,CAAmB,CAAA;EAC7D,SAAU,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,kBAAkB,MAAnB,EAAwB,OAAM,oBAAqB,CAAA;EAC7D,SACC,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,+CAAAA,SAAD,EACuB,oBACtB,CAAA,EACA,CAAA;EAEH,QACC,8BACA,CAAE,oBACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,iBAAD;IACC,WAAU;IACV,gBAAA,GAAgBZ,gBAAAA,GAAAA,CAAI,SAAU;GAC9B,CAAA;EACG,CAAA;CAGP,CAAA;AAEH"}
1
+ {"version":3,"file":"interface.cjs","names":["__","useViewportMatch","useDispatch","editWidgetsStore","useSelect","interfaceStore","preferencesStore","useEffect","InterfaceSkeleton","Header","SecondarySidebar","ComplementaryArea","WidgetAreasBlockEditorContent","BlockBreadcrumb"],"sources":["../../../src/components/layout/interface.jsx"],"sourcesContent":["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\tclassName=\"edit-widgets-layout__breadcrumbs\"\n\t\t\t\t\t\t\trootLabelText={ __( 'Widgets' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,kBAAkB;CAEvB,SAAA,GAAQA,gBAAAA,GAAAA;;EAAI;CAAkB;CAE9B,OAAA,GAAMA,gBAAAA,GAAAA;;EAAI;CAAqB;CAE/B,UAAA,GAASA,gBAAAA,GAAAA;;EAAI;CAAmB;CAEhC,SAAA,GAAQA,gBAAAA,GAAAA;;EAAI;CAAiB;AAC9B;AAEA,SAAS,UAAW,EAAE,uBAAwB;CAC7C,MAAM,oBAAA,GAAmBC,mBAAAA,iBAAAA,CAAkB,UAAU,GAAI;CACzD,MAAM,kBAAA,GAAiBA,mBAAAA,iBAAAA,CAAkB,QAAQ,IAAK;CACtD,MAAM,EAAE,qBAAqB,qBAAqB,yBAAA,GACjDC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAiB;CAC/B,MAAM,EACL,4BACA,mBACA,kB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A,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,+CAAAA,SAAD,EACuB,oBACtB,CAAA,EACA,CAAA;EAEH,QACC,8BACA,CAAE,oBACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,iBAAD;IACC,WAAU;IACV,gBAAA,GAAgBb,gBAAAA,GAAAA,CAAI,SAAU;GAC9B,CAAA;EACG,CAAA;CAGP,CAAA;AAEH"}
@@ -1 +1 @@
1
- {"version":3,"file":"unsaved-changes-warning.cjs","names":["useSelect","editWidgetsStore"],"sources":["../../../src/components/layout/unsaved-changes-warning.js"],"sourcesContent":["import { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\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 {Component} 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 {BeforeUnloadEvent} event `beforeunload` event.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Chrome before 119 ignores `preventDefault()`.\n\t\t\t\tevent.returnValue = true;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAwB,wBAAwB;CAC/C,MAAM,WAAA,GAAUA,gBAAAA,UAAAA,EAAa,WAAY;EACxC,MAAM,EAAE,yBAAyB,OAAQC,qBAAAA,KAAiB;EAG1D,OAF0B,qBAEH,CAAC,EAAE,SAAS;CACpC,GAAG,CAAC,CAAE;CAEN,CAAA,GAAA,mBAAA,UAAA,OAAiB;;;;;;EAMhB,MAAM,wBAAyB,UAAW;GACzC,IAAK,SAAU;IACd,MAAM,eAAe;IAErB,MAAM,cAAc;GACrB;EACD;EAEA,OAAO,iBAAkB,gBAAgB,oBAAqB;EAC9D,aAAa;GACZ,OAAO,oBAAqB,gBAAgB,oBAAqB;EAClE;CACD,GAAG,CAAE,OAAQ,CAAE;CAEf,OAAO;AACR"}
1
+ {"version":3,"file":"unsaved-changes-warning.cjs","names":["useSelect","editWidgetsStore","useEffect"],"sources":["../../../src/components/layout/unsaved-changes-warning.js"],"sourcesContent":["import { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\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 {Component} 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 {BeforeUnloadEvent} event `beforeunload` event.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Chrome before 119 ignores `preventDefault()`.\n\t\t\t\tevent.returnValue = true;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAwB,wBAAwB;CAC/C,MAAM,WAAA,GAAUA,gBAAAA,UAAAA,EAAa,WAAY;EACxC,MAAM,EAAE,yBAAyB,OAAQC,qBAAAA,KAAiB;EAG1D,OAF0B,qBAEH,CAAC,EAAE,SAAS;CACpC,GAAG,CAAC,CAAE;CAENC,CAAAA,GAAAA,mBAAAA,UAAAA,OAAiB;;;;;;EAMhB,MAAM,wBAAyB,UAAW;GACzC,IAAK,SAAU;IACd,MAAM,eAAe;IAErB,MAAM,cAAc;GACrB;EACD;EAEA,OAAO,iBAAkB,gBAAgB,oBAAqB;EAC9D,aAAa;GACZ,OAAO,oBAAqB,gBAAgB,oBAAqB;EAClE;CACD,GAAG,CAAE,OAAQ,CAAE;CAEf,OAAO;AACR"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -35,10 +37,10 @@ let _wordpress_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
35
37
  let _wordpress_compose = require("@wordpress/compose");
36
38
  let _wordpress_ui = require("@wordpress/ui");
37
39
  let ___keyboard_shortcut_help_modal_index_jsx = require("../keyboard-shortcut-help-modal/index.cjs");
38
- ___keyboard_shortcut_help_modal_index_jsx = __toESM(___keyboard_shortcut_help_modal_index_jsx);
39
40
  let __tools_more_menu_group_jsx = require("./tools-more-menu-group.cjs");
40
- __tools_more_menu_group_jsx = __toESM(__tools_more_menu_group_jsx);
41
41
  let react_jsx_runtime = require("react/jsx-runtime");
42
+ ___keyboard_shortcut_help_modal_index_jsx = __toESM(___keyboard_shortcut_help_modal_index_jsx);
43
+ __tools_more_menu_group_jsx = __toESM(__tools_more_menu_group_jsx);
42
44
  // packages/edit-widgets/src/components/more-menu/index.jsx
43
45
  function MoreMenu() {
44
46
  const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0, _wordpress_element.useState)(false);
@@ -91,7 +93,10 @@ function MoreMenu() {
91
93
  target: "_blank",
92
94
  children: [(0, _wordpress_i18n.__)("Help"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_ui.VisuallyHidden, {
93
95
  render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}),
94
- children: (0, _wordpress_i18n.__)("(opens in a new tab)")
96
+ children: (0, _wordpress_i18n.__)(
97
+ /** translators: accessibility text */
98
+ "(opens in a new tab)"
99
+ )
95
100
  })]
96
101
  }),
97
102
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tools_more_menu_group_jsx.default.Slot, { fillProps: { onClose } })
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useState","useViewportMatch","useDispatch","preferencesStore","DropdownMenu","moreVertical","__","MenuGroup","_x","PreferenceToggleMenuItem","MenuItem","displayShortcut","external","VisuallyHidden","ToolsMoreMenuGroup","KeyboardShortcutHelpModal"],"sources":["../../../src/components/more-menu/index.jsx"],"sourcesContent":["import { MenuGroup, MenuItem, DropdownMenu } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\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\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\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<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuide'\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\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\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>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden render={ <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</DropdownMenu>\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAwB,WAAW;CAClC,MAAM,CACL,gCACA,uCAAA,GACGA,mBAAAA,SAAAA,CAAU,KAAM;CACpB,MAAM,qCACL,mCAAoC,CAAE,8BAA+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A,CAACG,uBAAAA,0BAAD;MACC,OAAM;MACN,MAAK;MACL,QAAA,GAAQH,gBAAAA,GAAAA,CAAI,2BAA4B;MACxC,OAAA,GAAOA,gBAAAA,GAAAA,CACN,sDACD;MACA,mBAAA,GAAmBA,gBAAAA,GAAAA,CAClB,qCACD;MACA,qBAAA,GAAqBA,gBAAAA,GAAAA,CACpB,uCACD;KACA,CAAA;IAEQ;;EACV,EAAA,CAAA;CAEU,CAAA,GACd,iBAAA,GAAA,kBAAA,IAAA,CAACS,0CAAAA,SAAD;EACC,eAAgB;EAChB,aAAc;CACd,CAAA,CACA,EAAA,CAAA;AAEJ"}
1
+ {"version":3,"file":"index.cjs","names":["useState","useShortcut","useViewportMatch","useDispatch","preferencesStore","DropdownMenu","moreVertical","__","MenuGroup","_x","PreferenceToggleMenuItem","MenuItem","displayShortcut","external","VisuallyHidden","ToolsMoreMenuGroup","KeyboardShortcutHelpModal"],"sources":["../../../src/components/more-menu/index.jsx"],"sourcesContent":["import { MenuGroup, MenuItem, DropdownMenu } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\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\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\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<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuide'\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\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\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>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden render={ <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</DropdownMenu>\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAwB,WAAW;CAClC,MAAM,CACL,gCACA,uCAAA,GACGA,mBAAAA,SAAAA,CAAU,KAAM;CACpB,MAAM,qCACL,mCAAoC,CAAE,8BAA+B;CAEtEC,CAAAA,GAAAA,8BAAAA,YAAAA,CACC,wCACA,4BACD;CAEA,MAAM,mBAAA,GAAkBC,mBAAAA,iBAAAA,CAAkB,QAAS;CACnD,MAAM,EAAE,YAAA,GAAWC,gBAAAA,YAAAA,CAAaC,uBAAAA,KAAiB;CAEjD,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;EACC,MAAOC,iBAAAA;EACP,QAAA,GAAQC,gBAAAA,GAAAA,CAAI,SAAU;EACtB,cAAe;GACd,WAAW;GACX,WAAW;EACZ;EACA,aAAc;GACb,iBAAiB;GACjB,MAAM;EACP;EAEI,WAAA,YACH,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;GACG,mBACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,WAAD;IAAW,QAAA,GAAQC,gBAAAA,GAAAA,CAAI,QAAQ,MAAO;IACrC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CA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AAAA,WAAD;IAAW,QAAA,GAAQD,gBAAAA,GAAAA,CAAI,aAAc;IAArC,UAAA;KACC,iBAAA,GAAA,kBAAA,IAAA,CAACG,uBAAAA,0BAAD;MACC,OAAM;MACN,MAAK;MACL,QAAA,GAAQH,gBAAAA,GAAAA,CACP,kCACD;MACA,OAAA,GAAOA,gBAAAA,GAAAA,CACN,iEACD;MACA,mBAAA,GAAmBA,gBAAAA,GAAAA,CAClB,4CACD;MACA,qBAAA,GAAqBA,gBAAAA,GAAAA,CACpB,8CACD;KACA,CAAA;KACD,iBAAA,GAAA,kBAAA,IAAA,CAACG,uBAAAA,0BAAD;MACC,OAAM;MACN,MAAK;MACL,OAAA,GAAOH,gBAAAA,GAAAA,CACN,uCACD;MACA,QAAA,GAAQA,gBAAAA,GAAAA,CAAI,kBAAmB;KAC/B,CAAA;KACC,mBACD,iBAAA,GAAA,kBAAA,IAAA,CAACG,uBAAAA,0BAAD;MACC,OAAM;MACN,MAAK;MACL,QAAA,GAAQH,gBAAAA,GAAAA,CAAI,2BAA4B;MACxC,OAAA,GAAOA,gBAAAA,GAAAA,CACN,sDACD;MACA,mBAAA,GAAmBA,gBAAAA,GAAAA,CAClB,qCACD;MACA,qBAAA,GAAqBA,gBAAAA,GAAAA,CACpB,uCACD;KACA,CAAA;IAEQ;;EACV,EAAA,CAAA;CAEU,CAAA,GACd,iBAAA,GAAA,kBAAA,IAAA,CAACS,0CAAAA,SAAD;EACC,eAAgB;EAChB,aAAc;CACd,CAAA,CACA,EAAA,CAAA;AAEJ"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -27,10 +29,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
29
  let _wordpress_data = require("@wordpress/data");
28
30
  let ______store_index_js = require("../../store/index.cjs");
29
31
  let __inserter_sidebar_jsx = require("./inserter-sidebar.cjs");
30
- __inserter_sidebar_jsx = __toESM(__inserter_sidebar_jsx);
31
32
  let __list_view_sidebar_jsx = require("./list-view-sidebar.cjs");
32
- __list_view_sidebar_jsx = __toESM(__list_view_sidebar_jsx);
33
33
  let react_jsx_runtime = require("react/jsx-runtime");
34
+ __inserter_sidebar_jsx = __toESM(__inserter_sidebar_jsx);
35
+ __list_view_sidebar_jsx = __toESM(__list_view_sidebar_jsx);
34
36
  // packages/edit-widgets/src/components/secondary-sidebar/index.jsx
35
37
  function SecondarySidebar() {
36
38
  const { isInserterOpen, isListViewOpen } = (0, _wordpress_data.useSelect)((select) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useSelect","editWidgetsStore","InserterSidebar","ListViewSidebar"],"sources":["../../../src/components/secondary-sidebar/index.jsx"],"sourcesContent":["import { useSelect } from '@wordpress/data';\nimport { store as editWidgetsStore } from '../../store';\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAwB,mBAAmB;CAC1C,MAAM,EAAE,gBAAgB,oBAAA,GAAmBA,gBAAAA,UAAAA,EAAa,WAAY;EACnE,MAAM,EAAE,kBAAkB,qBACzB,OAAQC,qBAAAA,KAAiB;EAC1B,OAAO;GACN,gBAAgB,iBAAiB;GACjC,gBAAgB,iBAAiB;EAClC;CACD,GAAG,CAAC,CAAE;CAEN,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,SAAD,CAAkB,CAAA;CAE1B,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAD,CAAkB,CAAA;CAE1B,OAAO;AACR"}
1
+ {"version":3,"file":"index.cjs","names":["useSelect","editWidgetsStore","InserterSidebar","ListViewSidebar"],"sources":["../../../src/components/secondary-sidebar/index.jsx"],"sourcesContent":["import { useSelect } from '@wordpress/data';\nimport { store as editWidgetsStore } from '../../store';\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAwB,mBAAmB;CAC1C,MAAM,EAAE,gBAAgB,oBAAA,GAAmBA,gBAAAA,UAAAA,EAAa,WAAY;EACnE,MAAM,EAAE,kBAAkB,qBACzB,OAAQC,qBAAAA,KAAiB;EAC1B,OAAO;GACN,gBAAgB,iBAAiB;GACjC,gBAAgB,iBAAiB;EAClC;CACD,GAAG,CAAC,CAAE;CAEN,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,SAAD,CAAkB,CAAA;CAE1B,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAD,CAAkB,CAAA;CAE1B,OAAO;AACR"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -29,9 +31,9 @@ let _wordpress_compose = require("@wordpress/compose");
29
31
  let _wordpress_element = require("@wordpress/element");
30
32
  let _wordpress_data = require("@wordpress/data");
31
33
  let ______hooks_use_widget_library_insertion_point_js = require("../../hooks/use-widget-library-insertion-point.cjs");
32
- ______hooks_use_widget_library_insertion_point_js = __toESM(______hooks_use_widget_library_insertion_point_js);
33
34
  let ______store_index_js = require("../../store/index.cjs");
34
35
  let react_jsx_runtime = require("react/jsx-runtime");
36
+ ______hooks_use_widget_library_insertion_point_js = __toESM(______hooks_use_widget_library_insertion_point_js);
35
37
  // packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.jsx
36
38
  function InserterSidebar() {
37
39
  const isMobileViewport = (0, _wordpress_compose.useViewportMatch)("medium", "<");
@@ -1 +1 @@
1
- {"version":3,"file":"inserter-sidebar.cjs","names":["useViewportMatch","useWidgetLibraryInsertionPoint","useDispatch","editWidgetsStore","useCallback","useRef","Library"],"sources":["../../../src/components/secondary-sidebar/inserter-sidebar.jsx"],"sourcesContent":["import { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\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 libraryRef = useRef();\n\n\treturn (\n\t\t<div className=\"edit-widgets-layout__inserter-panel\">\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\tonClose={ closeInserter }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAwB,kBAAkB;CACzC,MAAM,oBAAA,GAAmBA,mBAAAA,iBAAAA,CAAkB,UAAU,GAAI;CACzD,MAAM,EAAE,cAAc,oBAAA,GAAmBC,kDAAAA,QAAAA,CAA+B;CAExE,MAAM,EAAE,yBAAA,GAAwBC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAiB;CAE9D,MAAM,iBAAA,GAAgBC,mBAAAA,YAAAA,OAAmB;EACxC,OAAO,oBAAqB,KAAM;CACnC,GAAG,CAAE,mBAAoB,CAAE;CAE3B,MAAM,cAAA,GAAaC,mBAAAA,OAAAA,CAAO;CAE1B,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,uBAAD;IACC,uBAAA;IACA,kBAAmB;IACJ;IACf,8BAA+B;IAC/B,KAAM;IACN,SAAU;GACV,CAAA;EACG,CAAA;CACD,CAAA;AAEP"}
1
+ {"version":3,"file":"inserter-sidebar.cjs","names":["useViewportMatch","useWidgetLibraryInsertionPoint","useDispatch","editWidgetsStore","useCallback","useRef","Library"],"sources":["../../../src/components/secondary-sidebar/inserter-sidebar.jsx"],"sourcesContent":["import { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\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 libraryRef = useRef();\n\n\treturn (\n\t\t<div className=\"edit-widgets-layout__inserter-panel\">\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\tonClose={ closeInserter }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAwB,kBAAkB;CACzC,MAAM,oBAAA,GAAmBA,mBAAAA,iBAAAA,CAAkB,UAAU,GAAI;CACzD,MAAM,EAAE,cAAc,oBAAA,GAAmBC,kDAAAA,QAAAA,CAA+B;CAExE,MAAM,EAAE,yBAAA,GAAwBC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAiB;CAE9D,MAAM,iBAAA,GAAgBC,mBAAAA,YAAAA,OAAmB;EACxC,OAAO,oBAAqB,KAAM;CACnC,GAAG,CAAE,mBAAoB,CAAE;CAE3B,MAAM,cAAA,GAAaC,mBAAAA,OAAAA,CAAO;CAE1B,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,uBAAD;IACC,uBAAA;IACA,kBAAmB;IACJ;IACf,8BAA+B;IAC/B,KAAM;IACN,SAAU;GACV,CAAA;EACG,CAAA;CACD,CAAA;AAEP"}
@@ -11,12 +11,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
- key = keys[i];
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: ((k) => from[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ desc = __getOwnPropDesc(from, key);
17
+ __defProp(to, key, {
18
+ get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
19
+ enumerable: !desc || desc.enumerable
20
+ });
21
+ }
20
22
  }
21
23
  return to;
22
24
  };
@@ -33,22 +35,25 @@ let _wordpress_components = require("@wordpress/components");
33
35
  let _wordpress_data = require("@wordpress/data");
34
36
  let react_jsx_runtime = require("react/jsx-runtime");
35
37
  let __widget_areas_jsx = require("./widget-areas.cjs");
36
- __widget_areas_jsx = __toESM(__widget_areas_jsx);
37
38
  let ______store_index_js = require("../../store/index.cjs");
38
39
  let ______lock_unlock_js = require("../../lock-unlock.cjs");
40
+ __widget_areas_jsx = __toESM(__widget_areas_jsx);
39
41
  // packages/edit-widgets/src/components/sidebar/index.jsx
40
42
  const SIDEBAR_ACTIVE_BY_DEFAULT = true;
41
43
  const BLOCK_INSPECTOR_IDENTIFIER = "edit-widgets/block-inspector";
42
44
  const WIDGET_AREAS_IDENTIFIER = "edit-widgets/block-areas";
43
45
  const { Tabs: WCTabs } = (0, ______lock_unlock_js.unlock)(_wordpress_components.privateApis);
44
46
  function SidebarHeader({ selectedWidgetAreaBlock }) {
45
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(WCTabs.TabList, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WCTabs.Tab, {
46
- tabId: WIDGET_AREAS_IDENTIFIER,
47
- children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, _wordpress_i18n.__)("Widget Areas")
48
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WCTabs.Tab, {
49
- tabId: BLOCK_INSPECTOR_IDENTIFIER,
50
- children: (0, _wordpress_i18n.__)("Block")
51
- })] });
47
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(WCTabs.TabList, {
48
+ className: "edit-widgets-sidebar__panel-tablist",
49
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WCTabs.Tab, {
50
+ tabId: WIDGET_AREAS_IDENTIFIER,
51
+ children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, _wordpress_i18n.__)("Widget Areas")
52
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WCTabs.Tab, {
53
+ tabId: BLOCK_INSPECTOR_IDENTIFIER,
54
+ children: (0, _wordpress_i18n.__)("Block")
55
+ })]
56
+ });
52
57
  }
53
58
  function SidebarContent({ hasSelectedNonAreaBlock, currentArea, isGeneralSidebarOpen, selectedWidgetAreaBlock }) {
54
59
  const { enableComplementaryArea } = (0, _wordpress_data.useDispatch)(_wordpress_interface.store);
@@ -64,7 +69,10 @@ function SidebarContent({ hasSelectedNonAreaBlock, currentArea, isGeneralSidebar
64
69
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarHeader, { selectedWidgetAreaBlock })
65
70
  }),
66
71
  headerClassName: "edit-widgets-sidebar__panel-tabs",
67
- title: (0, _wordpress_i18n.__)("Settings"),
72
+ title: (0, _wordpress_i18n.__)(
73
+ /** translators: button label text should, if possible, be under 16 characters. */
74
+ "Settings"
75
+ ),
68
76
  closeLabel: (0, _wordpress_i18n.__)("Close Settings"),
69
77
  scope: "core/edit-widgets",
70
78
  identifier: currentArea,