@wordpress/edit-widgets 6.32.0 → 6.32.1-next.ff1cebbba.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 (202) hide show
  1. package/build/blocks/widget-area/block.json +26 -0
  2. package/build/blocks/widget-area/edit/index.js +94 -87
  3. package/build/blocks/widget-area/edit/index.js.map +7 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  6. package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
  7. package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  8. package/build/blocks/widget-area/index.js +49 -52
  9. package/build/blocks/widget-area/index.js.map +7 -1
  10. package/build/components/error-boundary/index.js +49 -51
  11. package/build/components/error-boundary/index.js.map +7 -1
  12. package/build/components/header/document-tools/index.js +104 -74
  13. package/build/components/header/document-tools/index.js.map +7 -1
  14. package/build/components/header/index.js +81 -62
  15. package/build/components/header/index.js.map +7 -1
  16. package/build/components/header/undo-redo/redo.js +50 -38
  17. package/build/components/header/undo-redo/redo.js.map +7 -1
  18. package/build/components/header/undo-redo/undo.js +49 -37
  19. package/build/components/header/undo-redo/undo.js.map +7 -1
  20. package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
  21. package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  22. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
  23. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  24. package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
  25. package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  26. package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
  27. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  28. package/build/components/keyboard-shortcuts/index.js +89 -82
  29. package/build/components/keyboard-shortcuts/index.js.map +7 -1
  30. package/build/components/layout/index.js +75 -49
  31. package/build/components/layout/index.js.map +7 -1
  32. package/build/components/layout/interface.js +89 -75
  33. package/build/components/layout/interface.js.map +7 -1
  34. package/build/components/layout/unsaved-changes-warning.js +35 -42
  35. package/build/components/layout/unsaved-changes-warning.js.map +7 -1
  36. package/build/components/more-menu/index.js +189 -108
  37. package/build/components/more-menu/index.js.map +7 -1
  38. package/build/components/more-menu/tools-more-menu-group.js +29 -23
  39. package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
  40. package/build/components/notices/index.js +62 -48
  41. package/build/components/notices/index.js.map +7 -1
  42. package/build/components/save-button/index.js +55 -47
  43. package/build/components/save-button/index.js.map +7 -1
  44. package/build/components/secondary-sidebar/index.js +41 -34
  45. package/build/components/secondary-sidebar/index.js.map +7 -1
  46. package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
  47. package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  48. package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
  49. package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  50. package/build/components/sidebar/index.js +149 -138
  51. package/build/components/sidebar/index.js.map +7 -1
  52. package/build/components/sidebar/widget-areas.js +73 -57
  53. package/build/components/sidebar/widget-areas.js.map +7 -1
  54. package/build/components/welcome-guide/index.js +182 -137
  55. package/build/components/welcome-guide/index.js.map +7 -1
  56. package/build/components/widget-areas-block-editor-content/index.js +64 -43
  57. package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
  58. package/build/components/widget-areas-block-editor-provider/index.js +115 -92
  59. package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
  60. package/build/constants.js +30 -8
  61. package/build/constants.js.map +7 -1
  62. package/build/filters/index.js +3 -5
  63. package/build/filters/index.js.map +7 -1
  64. package/build/filters/move-to-widget-area.js +52 -59
  65. package/build/filters/move-to-widget-area.js.map +7 -1
  66. package/build/filters/replace-media-upload.js +9 -11
  67. package/build/filters/replace-media-upload.js.map +7 -1
  68. package/build/hooks/use-last-selected-widget-area.js +38 -44
  69. package/build/hooks/use-last-selected-widget-area.js.map +7 -1
  70. package/build/hooks/use-widget-library-insertion-point.js +60 -55
  71. package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
  72. package/build/index.js +86 -93
  73. package/build/index.js.map +7 -1
  74. package/build/lock-unlock.js +31 -15
  75. package/build/lock-unlock.js.map +7 -1
  76. package/build/store/actions.js +181 -313
  77. package/build/store/actions.js.map +7 -1
  78. package/build/store/constants.js +27 -10
  79. package/build/store/constants.js.map +7 -1
  80. package/build/store/index.js +51 -51
  81. package/build/store/index.js.map +7 -1
  82. package/build/store/private-selectors.js +28 -7
  83. package/build/store/private-selectors.js.map +7 -1
  84. package/build/store/reducer.js +65 -118
  85. package/build/store/reducer.js.map +7 -1
  86. package/build/store/resolvers.js +64 -63
  87. package/build/store/resolvers.js.map +7 -1
  88. package/build/store/selectors.js +194 -231
  89. package/build/store/selectors.js.map +7 -1
  90. package/build/store/transformers.js +47 -41
  91. package/build/store/transformers.js.map +7 -1
  92. package/build/store/utils.js +47 -70
  93. package/build/store/utils.js.map +7 -1
  94. package/build-module/blocks/widget-area/block.json +26 -0
  95. package/build-module/blocks/widget-area/edit/index.js +63 -75
  96. package/build-module/blocks/widget-area/edit/index.js.map +7 -1
  97. package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
  98. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  99. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
  100. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  101. package/build-module/blocks/widget-area/index.js +14 -46
  102. package/build-module/blocks/widget-area/index.js.map +7 -1
  103. package/build-module/components/error-boundary/index.js +30 -43
  104. package/build-module/components/error-boundary/index.js.map +7 -1
  105. package/build-module/components/header/document-tools/index.js +75 -66
  106. package/build-module/components/header/document-tools/index.js.map +7 -1
  107. package/build-module/components/header/index.js +52 -54
  108. package/build-module/components/header/index.js.map +7 -1
  109. package/build-module/components/header/undo-redo/redo.js +32 -32
  110. package/build-module/components/header/undo-redo/redo.js.map +7 -1
  111. package/build-module/components/header/undo-redo/undo.js +31 -31
  112. package/build-module/components/header/undo-redo/undo.js.map +7 -1
  113. package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
  114. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  115. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
  116. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  117. package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
  118. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  119. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
  120. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  121. package/build-module/components/keyboard-shortcuts/index.js +73 -75
  122. package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
  123. package/build-module/components/layout/index.js +46 -41
  124. package/build-module/components/layout/index.js.map +7 -1
  125. package/build-module/components/layout/interface.js +63 -66
  126. package/build-module/components/layout/interface.js.map +7 -1
  127. package/build-module/components/layout/unsaved-changes-warning.js +17 -37
  128. package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
  129. package/build-module/components/more-menu/index.js +167 -102
  130. package/build-module/components/more-menu/index.js.map +7 -1
  131. package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
  132. package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
  133. package/build-module/components/notices/index.js +43 -42
  134. package/build-module/components/notices/index.js.map +7 -1
  135. package/build-module/components/save-button/index.js +37 -41
  136. package/build-module/components/save-button/index.js.map +7 -1
  137. package/build-module/components/secondary-sidebar/index.js +14 -27
  138. package/build-module/components/secondary-sidebar/index.js.map +7 -1
  139. package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
  140. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  141. package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
  142. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  143. package/build-module/components/sidebar/index.js +129 -127
  144. package/build-module/components/sidebar/index.js.map +7 -1
  145. package/build-module/components/sidebar/widget-areas.js +53 -49
  146. package/build-module/components/sidebar/widget-areas.js.map +7 -1
  147. package/build-module/components/welcome-guide/index.js +165 -132
  148. package/build-module/components/welcome-guide/index.js.map +7 -1
  149. package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
  150. package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
  151. package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
  152. package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
  153. package/build-module/constants.js +7 -3
  154. package/build-module/constants.js.map +7 -1
  155. package/build-module/filters/index.js +3 -6
  156. package/build-module/filters/index.js.map +7 -1
  157. package/build-module/filters/move-to-widget-area.js +52 -57
  158. package/build-module/filters/move-to-widget-area.js.map +7 -1
  159. package/build-module/filters/replace-media-upload.js +8 -7
  160. package/build-module/filters/replace-media-upload.js.map +7 -1
  161. package/build-module/hooks/use-last-selected-widget-area.js +20 -39
  162. package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
  163. package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
  164. package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
  165. package/build-module/index.js +60 -72
  166. package/build-module/index.js.map +7 -1
  167. package/build-module/lock-unlock.js +8 -7
  168. package/build-module/lock-unlock.js.map +7 -1
  169. package/build-module/store/actions.js +153 -293
  170. package/build-module/store/actions.js.map +7 -1
  171. package/build-module/store/constants.js +5 -5
  172. package/build-module/store/constants.js.map +7 -1
  173. package/build-module/store/index.js +16 -40
  174. package/build-module/store/index.js.map +7 -1
  175. package/build-module/store/private-selectors.js +7 -3
  176. package/build-module/store/private-selectors.js.map +7 -1
  177. package/build-module/store/reducer.js +42 -111
  178. package/build-module/store/reducer.js.map +7 -1
  179. package/build-module/store/resolvers.js +43 -51
  180. package/build-module/store/resolvers.js.map +7 -1
  181. package/build-module/store/selectors.js +171 -224
  182. package/build-module/store/selectors.js.map +7 -1
  183. package/build-module/store/transformers.js +23 -34
  184. package/build-module/store/transformers.js.map +7 -1
  185. package/build-module/store/utils.js +22 -63
  186. package/build-module/store/utils.js.map +7 -1
  187. package/build-style/style-rtl.css +216 -88
  188. package/build-style/style.css +216 -88
  189. package/package.json +36 -29
  190. package/src/blocks/widget-area/editor.scss +3 -0
  191. package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
  192. package/src/components/error-boundary/style.scss +2 -0
  193. package/src/components/header/style.scss +5 -0
  194. package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
  195. package/src/components/layout/style.scss +3 -0
  196. package/src/components/more-menu/style.scss +2 -0
  197. package/src/components/notices/style.scss +3 -0
  198. package/src/components/secondary-sidebar/style.scss +4 -0
  199. package/src/components/sidebar/style.scss +2 -0
  200. package/src/components/welcome-guide/style.scss +2 -0
  201. package/src/components/widget-areas-block-editor-content/style.scss +2 -0
  202. package/src/style.scss +16 -13
@@ -1,45 +1,42 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { useEntityBlockEditor } from '@wordpress/core-data';
10
- import { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';
11
- import { useRef } from '@wordpress/element';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import useIsDraggingWithin from './use-is-dragging-within';
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- export default function WidgetAreaInnerBlocks({
19
- id
20
- }) {
21
- const [blocks, onInput, onChange] = useEntityBlockEditor('root', 'postType');
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { useEntityBlockEditor } from "@wordpress/core-data";
4
+ import { InnerBlocks, useInnerBlocksProps } from "@wordpress/block-editor";
5
+ import { useRef } from "@wordpress/element";
6
+ import useIsDraggingWithin from "./use-is-dragging-within";
7
+ function WidgetAreaInnerBlocks({ id }) {
8
+ const [blocks, onInput, onChange] = useEntityBlockEditor(
9
+ "root",
10
+ "postType"
11
+ );
22
12
  const innerBlocksRef = useRef();
23
13
  const isDraggingWithinInnerBlocks = useIsDraggingWithin(innerBlocksRef);
24
14
  const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
25
- // Using the experimental hook so that we can control the className of the element.
26
- const innerBlocksProps = useInnerBlocksProps({
27
- ref: innerBlocksRef
28
- }, {
29
- value: blocks,
30
- onInput,
31
- onChange,
32
- templateLock: false,
33
- renderAppender: InnerBlocks.ButtonBlockAppender
34
- });
35
- return /*#__PURE__*/_jsx("div", {
36
- "data-widget-area-id": id,
37
- className: clsx('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
38
- 'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
39
- }),
40
- children: /*#__PURE__*/_jsx("div", {
41
- ...innerBlocksProps
42
- })
43
- });
15
+ const innerBlocksProps = useInnerBlocksProps(
16
+ { ref: innerBlocksRef },
17
+ {
18
+ value: blocks,
19
+ onInput,
20
+ onChange,
21
+ templateLock: false,
22
+ renderAppender: InnerBlocks.ButtonBlockAppender
23
+ }
24
+ );
25
+ return /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ "data-widget-area-id": id,
29
+ className: clsx(
30
+ "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
31
+ {
32
+ "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
33
+ }
34
+ ),
35
+ children: /* @__PURE__ */ jsx("div", { ...innerBlocksProps })
36
+ }
37
+ );
44
38
  }
45
- //# sourceMappingURL=inner-blocks.js.map
39
+ export {
40
+ WidgetAreaInnerBlocks as default
41
+ };
42
+ //# sourceMappingURL=inner-blocks.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["clsx","useEntityBlockEditor","InnerBlocks","useInnerBlocksProps","useRef","useIsDraggingWithin","jsx","_jsx","WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","ButtonBlockAppender","className","children"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsDraggingWithin from './use-is-dragging-within';\n\nexport default function WidgetAreaInnerBlocks( { id } ) {\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'root',\n\t\t'postType'\n\t);\n\tconst innerBlocksRef = useRef();\n\tconst isDraggingWithinInnerBlocks = useIsDraggingWithin( innerBlocksRef );\n\tconst shouldHighlightDropZone = isDraggingWithinInnerBlocks;\n\t// Using the experimental hook so that we can control the className of the element.\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ref: innerBlocksRef },\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tdata-widget-area-id={ id }\n\t\t\tclassName={ clsx(\n\t\t\t\t'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper',\n\t\t\t\t{\n\t\t\t\t\t'wp-block-widget-area__highlight-drop-zone':\n\t\t\t\t\t\tshouldHighlightDropZone,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,yBAAyB;AAC1E,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,eAAe,SAASC,qBAAqBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACvD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGX,oBAAoB,CACzD,MAAM,EACN,UACD,CAAC;EACD,MAAMY,cAAc,GAAGT,MAAM,CAAC,CAAC;EAC/B,MAAMU,2BAA2B,GAAGT,mBAAmB,CAAEQ,cAAe,CAAC;EACzE,MAAME,uBAAuB,GAAGD,2BAA2B;EAC3D;EACA,MAAME,gBAAgB,GAAGb,mBAAmB,CAC3C;IAAEc,GAAG,EAAEJ;EAAe,CAAC,EACvB;IACCK,KAAK,EAAER,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRO,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAElB,WAAW,CAACmB;EAC7B,CACD,CAAC;EAED,oBACCd,IAAA;IACC,uBAAsBE,EAAI;IAC1Ba,SAAS,EAAGtB,IAAI,CACf,oFAAoF,EACpF;MACC,2CAA2C,EAC1Ce;IACF,CACD,CAAG;IAAAQ,QAAA,eAEHhB,IAAA;MAAA,GAAUS;IAAgB,CAAI;EAAC,CAC3B,CAAC;AAER","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/blocks/widget-area/edit/inner-blocks.js"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsDraggingWithin from './use-is-dragging-within';\n\nexport default function WidgetAreaInnerBlocks( { id } ) {\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'root',\n\t\t'postType'\n\t);\n\tconst innerBlocksRef = useRef();\n\tconst isDraggingWithinInnerBlocks = useIsDraggingWithin( innerBlocksRef );\n\tconst shouldHighlightDropZone = isDraggingWithinInnerBlocks;\n\t// Using the experimental hook so that we can control the className of the element.\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ref: innerBlocksRef },\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tdata-widget-area-id={ id }\n\t\t\tclassName={ clsx(\n\t\t\t\t'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper',\n\t\t\t\t{\n\t\t\t\t\t'wp-block-widget-area__highlight-drop-zone':\n\t\t\t\t\t\tshouldHighlightDropZone,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": "AAgDG;AA7CH,OAAO,UAAU;AAKjB,SAAS,4BAA4B;AACrC,SAAS,aAAa,2BAA2B;AACjD,SAAS,cAAc;AAKvB,OAAO,yBAAyB;AAEjB,SAAR,sBAAwC,EAAE,GAAG,GAAI;AACvD,QAAM,CAAE,QAAQ,SAAS,QAAS,IAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACD;AACA,QAAM,iBAAiB,OAAO;AAC9B,QAAM,8BAA8B,oBAAqB,cAAe;AACxE,QAAM,0BAA0B;AAEhC,QAAM,mBAAmB;AAAA,IACxB,EAAE,KAAK,eAAe;AAAA,IACtB;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,gBAAgB,YAAY;AAAA,IAC7B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAsB;AAAA,MACtB,WAAY;AAAA,QACX;AAAA,QACA;AAAA,UACC,6CACC;AAAA,QACF;AAAA,MACD;AAAA,MAEA,8BAAC,SAAM,GAAG,kBAAmB;AAAA;AAAA,EAC9B;AAEF;",
6
+ "names": []
7
+ }
@@ -1,53 +1,34 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useState, useEffect } from '@wordpress/element';
5
-
6
- /** @typedef {import('@wordpress/element').RefObject} RefObject */
7
-
8
- /**
9
- * A React hook to determine if it's dragging within the target element.
10
- *
11
- * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
12
- *
13
- * @return {boolean} Is dragging within the target element.
14
- */
15
- const useIsDraggingWithin = elementRef => {
1
+ import { useState, useEffect } from "@wordpress/element";
2
+ const useIsDraggingWithin = (elementRef) => {
16
3
  const [isDraggingWithin, setIsDraggingWithin] = useState(false);
17
4
  useEffect(() => {
18
- const {
19
- ownerDocument
20
- } = elementRef.current;
5
+ const { ownerDocument } = elementRef.current;
21
6
  function handleDragStart(event) {
22
- // Check the first time when the dragging starts.
23
7
  handleDragEnter(event);
24
8
  }
25
-
26
- // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
27
9
  function handleDragEnd() {
28
10
  setIsDraggingWithin(false);
29
11
  }
30
12
  function handleDragEnter(event) {
31
- // Check if the current target is inside the item element.
32
13
  if (elementRef.current.contains(event.target)) {
33
14
  setIsDraggingWithin(true);
34
15
  } else {
35
16
  setIsDraggingWithin(false);
36
17
  }
37
18
  }
38
-
39
- // Bind these events to the document to catch all drag events.
40
- // Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.
41
- ownerDocument.addEventListener('dragstart', handleDragStart);
42
- ownerDocument.addEventListener('dragend', handleDragEnd);
43
- ownerDocument.addEventListener('dragenter', handleDragEnter);
19
+ ownerDocument.addEventListener("dragstart", handleDragStart);
20
+ ownerDocument.addEventListener("dragend", handleDragEnd);
21
+ ownerDocument.addEventListener("dragenter", handleDragEnter);
44
22
  return () => {
45
- ownerDocument.removeEventListener('dragstart', handleDragStart);
46
- ownerDocument.removeEventListener('dragend', handleDragEnd);
47
- ownerDocument.removeEventListener('dragenter', handleDragEnter);
23
+ ownerDocument.removeEventListener("dragstart", handleDragStart);
24
+ ownerDocument.removeEventListener("dragend", handleDragEnd);
25
+ ownerDocument.removeEventListener("dragenter", handleDragEnter);
48
26
  };
49
27
  }, []);
50
28
  return isDraggingWithin;
51
29
  };
52
- export default useIsDraggingWithin;
53
- //# sourceMappingURL=use-is-dragging-within.js.map
30
+ var use_is_dragging_within_default = useIsDraggingWithin;
31
+ export {
32
+ use_is_dragging_within_default as default
33
+ };
34
+ //# sourceMappingURL=use-is-dragging-within.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useState","useEffect","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/use-is-dragging-within.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\nexport default useIsDraggingWithin;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAKC,UAAU,IAAM;EAC7C,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAGL,QAAQ,CAAE,KAAM,CAAC;EAEnEC,SAAS,CAAE,MAAM;IAChB,MAAM;MAAEK;IAAc,CAAC,GAAGH,UAAU,CAACI,OAAO;IAE5C,SAASC,eAAeA,CAAEC,KAAK,EAAG;MACjC;MACAC,eAAe,CAAED,KAAM,CAAC;IACzB;;IAEA;IACA,SAASE,aAAaA,CAAA,EAAG;MACxBN,mBAAmB,CAAE,KAAM,CAAC;IAC7B;IAEA,SAASK,eAAeA,CAAED,KAAK,EAAG;MACjC;MACA,IAAKN,UAAU,CAACI,OAAO,CAACK,QAAQ,CAAEH,KAAK,CAACI,MAAO,CAAC,EAAG;QAClDR,mBAAmB,CAAE,IAAK,CAAC;MAC5B,CAAC,MAAM;QACNA,mBAAmB,CAAE,KAAM,CAAC;MAC7B;IACD;;IAEA;IACA;IACAC,aAAa,CAACQ,gBAAgB,CAAE,WAAW,EAAEN,eAAgB,CAAC;IAC9DF,aAAa,CAACQ,gBAAgB,CAAE,SAAS,EAAEH,aAAc,CAAC;IAC1DL,aAAa,CAACQ,gBAAgB,CAAE,WAAW,EAAEJ,eAAgB,CAAC;IAE9D,OAAO,MAAM;MACZJ,aAAa,CAACS,mBAAmB,CAAE,WAAW,EAAEP,eAAgB,CAAC;MACjEF,aAAa,CAACS,mBAAmB,CAAE,SAAS,EAAEJ,aAAc,CAAC;MAC7DL,aAAa,CAACS,mBAAmB,CAAE,WAAW,EAAEL,eAAgB,CAAC;IAClE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OAAON,gBAAgB;AACxB,CAAC;AAED,eAAeF,mBAAmB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\nexport default useIsDraggingWithin;\n"],
5
+ "mappings": "AAGA,SAAS,UAAU,iBAAiB;AAWpC,MAAM,sBAAsB,CAAE,eAAgB;AAC7C,QAAM,CAAE,kBAAkB,mBAAoB,IAAI,SAAU,KAAM;AAElE,YAAW,MAAM;AAChB,UAAM,EAAE,cAAc,IAAI,WAAW;AAErC,aAAS,gBAAiB,OAAQ;AAEjC,sBAAiB,KAAM;AAAA,IACxB;AAGA,aAAS,gBAAgB;AACxB,0BAAqB,KAAM;AAAA,IAC5B;AAEA,aAAS,gBAAiB,OAAQ;AAEjC,UAAK,WAAW,QAAQ,SAAU,MAAM,MAAO,GAAI;AAClD,4BAAqB,IAAK;AAAA,MAC3B,OAAO;AACN,4BAAqB,KAAM;AAAA,MAC5B;AAAA,IACD;AAIA,kBAAc,iBAAkB,aAAa,eAAgB;AAC7D,kBAAc,iBAAkB,WAAW,aAAc;AACzD,kBAAc,iBAAkB,aAAa,eAAgB;AAE7D,WAAO,MAAM;AACZ,oBAAc,oBAAqB,aAAa,eAAgB;AAChE,oBAAc,oBAAqB,WAAW,aAAc;AAC5D,oBAAc,oBAAqB,aAAa,eAAgB;AAAA,IACjE;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AACR;AAEA,IAAO,iCAAQ;",
6
+ "names": []
7
+ }
@@ -1,48 +1,16 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- const metadata = {
10
- $schema: "https://schemas.wp.org/trunk/block.json",
11
- apiVersion: 3,
12
- name: "core/widget-area",
13
- title: "Widget Area",
14
- category: "widgets",
15
- attributes: {
16
- id: {
17
- type: "string"
18
- },
19
- name: {
20
- type: "string"
21
- }
22
- },
23
- supports: {
24
- html: false,
25
- inserter: false,
26
- customClassName: false,
27
- reusable: false,
28
- __experimentalToolbar: false,
29
- __experimentalParentSelector: false,
30
- __experimentalDisableBlockOverlay: true
31
- },
32
- editorStyle: "wp-block-widget-area-editor",
33
- style: "wp-block-widget-area"
34
- };
35
- import edit from './edit';
36
- const {
37
- name
38
- } = metadata;
39
- export { metadata, name };
40
- export const settings = {
41
- title: __('Widget Area'),
42
- description: __('A widget area container.'),
43
- __experimentalLabel: ({
44
- name: label
45
- }) => label,
1
+ import { __ } from "@wordpress/i18n";
2
+ import metadata from "./block.json";
3
+ import edit from "./edit";
4
+ const { name } = metadata;
5
+ const settings = {
6
+ title: __("Widget Area"),
7
+ description: __("A widget area container."),
8
+ __experimentalLabel: ({ name: label }) => label,
46
9
  edit
47
10
  };
48
- //# sourceMappingURL=index.js.map
11
+ export {
12
+ metadata,
13
+ name,
14
+ settings
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__","metadata","$schema","apiVersion","name","title","category","attributes","id","type","supports","html","inserter","customClassName","reusable","__experimentalToolbar","__experimentalParentSelector","__experimentalDisableBlockOverlay","editorStyle","style","edit","settings","description","__experimentalLabel","label"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AAFA,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,UAAA;IAAAC,EAAA;MAAAC,IAAA;IAAA;IAAAL,IAAA;MAAAK,IAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,QAAA;IAAAC,eAAA;IAAAC,QAAA;IAAAC,qBAAA;IAAAC,4BAAA;IAAAC,iCAAA;EAAA;EAAAC,WAAA;EAAAC,KAAA;AAAA;AAIA,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAEhB;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMiB,QAAQ,GAAG;EACvBhB,KAAK,EAAEL,EAAE,CAAE,aAAc,CAAC;EAC1BsB,WAAW,EAAEtB,EAAE,CAAE,0BAA2B,CAAC;EAC7CuB,mBAAmB,EAAEA,CAAE;IAAEnB,IAAI,EAAEoB;EAAM,CAAC,KAAMA,KAAK;EACjDJ;AACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/blocks/widget-area/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"],
5
+ "mappings": "AAGA,SAAS,UAAU;AAKnB,OAAO,cAAc;AACrB,OAAO,UAAU;AAEjB,MAAM,EAAE,KAAK,IAAI;AAGV,MAAM,WAAW;AAAA,EACvB,OAAO,GAAI,aAAc;AAAA,EACzB,aAAa,GAAI,0BAA2B;AAAA,EAC5C,qBAAqB,CAAE,EAAE,MAAM,MAAM,MAAO;AAAA,EAC5C;AACD;",
6
+ "names": []
7
+ }
@@ -1,40 +1,21 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { Component } from '@wordpress/element';
5
- import { __ } from '@wordpress/i18n';
6
- import { Button } from '@wordpress/components';
7
- import { Warning } from '@wordpress/block-editor';
8
- import { useCopyToClipboard } from '@wordpress/compose';
9
- import { doAction } from '@wordpress/hooks';
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- function CopyButton({
12
- text,
13
- children
14
- }) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Component } from "@wordpress/element";
3
+ import { __ } from "@wordpress/i18n";
4
+ import { Button } from "@wordpress/components";
5
+ import { Warning } from "@wordpress/block-editor";
6
+ import { useCopyToClipboard } from "@wordpress/compose";
7
+ import { doAction } from "@wordpress/hooks";
8
+ function CopyButton({ text, children }) {
15
9
  const ref = useCopyToClipboard(text);
16
- return /*#__PURE__*/_jsx(Button, {
17
- __next40pxDefaultSize: true,
18
- variant: "secondary",
19
- ref: ref,
20
- children: children
21
- });
10
+ return /* @__PURE__ */ jsx(Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children });
22
11
  }
23
- function ErrorBoundaryWarning({
24
- message,
25
- error
26
- }) {
27
- const actions = [/*#__PURE__*/_jsx(CopyButton, {
28
- text: error.stack,
29
- children: __('Copy Error')
30
- }, "copy-error")];
31
- return /*#__PURE__*/_jsx(Warning, {
32
- className: "edit-widgets-error-boundary",
33
- actions: actions,
34
- children: message
35
- });
12
+ function ErrorBoundaryWarning({ message, error }) {
13
+ const actions = [
14
+ /* @__PURE__ */ jsx(CopyButton, { text: error.stack, children: __("Copy Error") }, "copy-error")
15
+ ];
16
+ return /* @__PURE__ */ jsx(Warning, { className: "edit-widgets-error-boundary", actions, children: message });
36
17
  }
37
- export default class ErrorBoundary extends Component {
18
+ class ErrorBoundary extends Component {
38
19
  constructor() {
39
20
  super(...arguments);
40
21
  this.state = {
@@ -42,21 +23,27 @@ export default class ErrorBoundary extends Component {
42
23
  };
43
24
  }
44
25
  componentDidCatch(error) {
45
- doAction('editor.ErrorBoundary.errorLogged', error);
26
+ doAction("editor.ErrorBoundary.errorLogged", error);
46
27
  }
47
28
  static getDerivedStateFromError(error) {
48
- return {
49
- error
50
- };
29
+ return { error };
51
30
  }
52
31
  render() {
53
32
  if (!this.state.error) {
54
33
  return this.props.children;
55
34
  }
56
- return /*#__PURE__*/_jsx(ErrorBoundaryWarning, {
57
- message: __('The editor has encountered an unexpected error.'),
58
- error: this.state.error
59
- });
35
+ return /* @__PURE__ */ jsx(
36
+ ErrorBoundaryWarning,
37
+ {
38
+ message: __(
39
+ "The editor has encountered an unexpected error."
40
+ ),
41
+ error: this.state.error
42
+ }
43
+ );
60
44
  }
61
45
  }
62
- //# sourceMappingURL=index.js.map
46
+ export {
47
+ ErrorBoundary as default
48
+ };
49
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["Component","__","Button","Warning","useCopyToClipboard","doAction","jsx","_jsx","CopyButton","text","children","ref","__next40pxDefaultSize","variant","ErrorBoundaryWarning","message","error","actions","stack","className","ErrorBoundary","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,QAAQ,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5C,SAASC,UAAUA,CAAE;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,GAAG,GAAGP,kBAAkB,CAAEK,IAAK,CAAC;EACtC,oBACCF,IAAA,CAACL,MAAM;IAACU,qBAAqB;IAACC,OAAO,EAAC,WAAW;IAACF,GAAG,EAAGA,GAAK;IAAAD,QAAA,EAC1DA;EAAQ,CACH,CAAC;AAEX;AAEA,SAASI,oBAAoBA,CAAE;EAAEC,OAAO;EAAEC;AAAM,CAAC,EAAG;EACnD,MAAMC,OAAO,GAAG,cACfV,IAAA,CAACC,UAAU;IAAkBC,IAAI,EAAGO,KAAK,CAACE,KAAO;IAAAR,QAAA,EAC9CT,EAAE,CAAE,YAAa;EAAC,GADL,YAEJ,CAAC,CACb;EAED,oBACCM,IAAA,CAACJ,OAAO;IAACgB,SAAS,EAAC,6BAA6B;IAACF,OAAO,EAAGA,OAAS;IAAAP,QAAA,EACjEK;EAAO,CACD,CAAC;AAEZ;AAEA,eAAe,MAAMK,aAAa,SAASpB,SAAS,CAAC;EACpDqB,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZP,KAAK,EAAE;IACR,CAAC;EACF;EAEAQ,iBAAiBA,CAAER,KAAK,EAAG;IAC1BX,QAAQ,CAAE,kCAAkC,EAAEW,KAAM,CAAC;EACtD;EAEA,OAAOS,wBAAwBA,CAAET,KAAK,EAAG;IACxC,OAAO;MAAEA;IAAM,CAAC;EACjB;EAEAU,MAAMA,CAAA,EAAG;IACR,IAAK,CAAE,IAAI,CAACH,KAAK,CAACP,KAAK,EAAG;MACzB,OAAO,IAAI,CAACW,KAAK,CAACjB,QAAQ;IAC3B;IAEA,oBACCH,IAAA,CAACO,oBAAoB;MACpBC,OAAO,EAAGd,EAAE,CACX,iDACD,CAAG;MACHe,KAAK,EAAG,IAAI,CAACO,KAAK,CAACP;IAAO,CAC1B,CAAC;EAEJ;AACD","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/error-boundary/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],
5
+ "mappings": "AAaE;AAVF,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AAEzB,SAAS,WAAY,EAAE,MAAM,SAAS,GAAI;AACzC,QAAM,MAAM,mBAAoB,IAAK;AACrC,SACC,oBAAC,UAAO,uBAAqB,MAAC,SAAQ,aAAY,KAC/C,UACH;AAEF;AAEA,SAAS,qBAAsB,EAAE,SAAS,MAAM,GAAI;AACnD,QAAM,UAAU;AAAA,IACf,oBAAC,cAA4B,MAAO,MAAM,OACvC,aAAI,YAAa,KADJ,YAEhB;AAAA,EACD;AAEA,SACC,oBAAC,WAAQ,WAAU,+BAA8B,SAC9C,mBACH;AAEF;AAEA,MAAO,sBAAoC,UAAU;AAAA,EACpD,cAAc;AACb,UAAO,GAAG,SAAU;AAEpB,SAAK,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAQ;AAC1B,aAAU,oCAAoC,KAAM;AAAA,EACrD;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,QAAK,CAAE,KAAK,MAAM,OAAQ;AACzB,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,UACT;AAAA,QACD;AAAA,QACA,OAAQ,KAAK,MAAM;AAAA;AAAA,IACpB;AAAA,EAEF;AACD;",
6
+ "names": []
7
+ }
@@ -1,30 +1,23 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect, useDispatch } from '@wordpress/data';
5
- import { __, _x } from '@wordpress/i18n';
6
- import { Button, ToolbarItem } from '@wordpress/components';
7
- import { NavigableToolbar } from '@wordpress/block-editor';
8
- import { listView, plus } from '@wordpress/icons';
9
- import { useCallback } from '@wordpress/element';
10
- import { useViewportMatch } from '@wordpress/compose';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import UndoButton from '../undo-redo/undo';
16
- import RedoButton from '../undo-redo/redo';
17
- import { store as editWidgetsStore } from '../../../store';
18
- import { unlock } from '../../../lock-unlock';
19
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useSelect, useDispatch } from "@wordpress/data";
3
+ import { __, _x } from "@wordpress/i18n";
4
+ import { Button, ToolbarItem } from "@wordpress/components";
5
+ import { NavigableToolbar } from "@wordpress/block-editor";
6
+ import { listView, plus } from "@wordpress/icons";
7
+ import { useCallback } from "@wordpress/element";
8
+ import { useViewportMatch } from "@wordpress/compose";
9
+ import UndoButton from "../undo-redo/undo";
10
+ import RedoButton from "../undo-redo/redo";
11
+ import { store as editWidgetsStore } from "../../../store";
12
+ import { unlock } from "../../../lock-unlock";
20
13
  function DocumentTools() {
21
- const isMediumViewport = useViewportMatch('medium');
14
+ const isMediumViewport = useViewportMatch("medium");
22
15
  const {
23
16
  isInserterOpen,
24
17
  isListViewOpen,
25
18
  inserterSidebarToggleRef,
26
19
  listViewToggleRef
27
- } = useSelect(select => {
20
+ } = useSelect((select) => {
28
21
  const {
29
22
  isInserterOpened,
30
23
  getInserterSidebarToggleRef,
@@ -38,49 +31,65 @@ function DocumentTools() {
38
31
  listViewToggleRef: getListViewToggleRef()
39
32
  };
40
33
  }, []);
41
- const {
42
- setIsInserterOpened,
43
- setIsListViewOpened
44
- } = useDispatch(editWidgetsStore);
45
- const toggleListView = useCallback(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
46
- const toggleInserterSidebar = useCallback(() => setIsInserterOpened(!isInserterOpen), [setIsInserterOpened, isInserterOpen]);
47
- return /*#__PURE__*/_jsxs(NavigableToolbar, {
48
- className: "edit-widgets-header-toolbar",
49
- "aria-label": __('Document tools'),
50
- variant: "unstyled",
51
- children: [/*#__PURE__*/_jsx(ToolbarItem, {
52
- ref: inserterSidebarToggleRef,
53
- as: Button,
54
- className: "edit-widgets-header-toolbar__inserter-toggle",
55
- variant: "primary",
56
- isPressed: isInserterOpen,
57
- onMouseDown: event => {
58
- event.preventDefault();
59
- },
60
- onClick: toggleInserterSidebar,
61
- icon: plus
62
- /* translators: button label text should, if possible, be under 16
63
- characters. */,
64
- label: _x('Block Inserter', 'Generic label for block inserter button'),
65
- size: "compact"
66
- }), isMediumViewport && /*#__PURE__*/_jsxs(_Fragment, {
67
- children: [/*#__PURE__*/_jsx(ToolbarItem, {
68
- as: UndoButton
69
- }), /*#__PURE__*/_jsx(ToolbarItem, {
70
- as: RedoButton
71
- }), /*#__PURE__*/_jsx(ToolbarItem, {
72
- as: Button,
73
- className: "edit-widgets-header-toolbar__list-view-toggle",
74
- icon: listView,
75
- isPressed: isListViewOpen
76
- /* translators: button label text should, if possible, be under 16 characters. */,
77
- label: __('List View'),
78
- onClick: toggleListView,
79
- ref: listViewToggleRef,
80
- size: "compact"
81
- })]
82
- })]
83
- });
34
+ const { setIsInserterOpened, setIsListViewOpened } = useDispatch(editWidgetsStore);
35
+ const toggleListView = useCallback(
36
+ () => setIsListViewOpened(!isListViewOpen),
37
+ [setIsListViewOpened, isListViewOpen]
38
+ );
39
+ const toggleInserterSidebar = useCallback(
40
+ () => setIsInserterOpened(!isInserterOpen),
41
+ [setIsInserterOpened, isInserterOpen]
42
+ );
43
+ return /* @__PURE__ */ jsxs(
44
+ NavigableToolbar,
45
+ {
46
+ className: "edit-widgets-header-toolbar",
47
+ "aria-label": __("Document tools"),
48
+ variant: "unstyled",
49
+ children: [
50
+ /* @__PURE__ */ jsx(
51
+ ToolbarItem,
52
+ {
53
+ ref: inserterSidebarToggleRef,
54
+ as: Button,
55
+ className: "edit-widgets-header-toolbar__inserter-toggle",
56
+ variant: "primary",
57
+ isPressed: isInserterOpen,
58
+ onMouseDown: (event) => {
59
+ event.preventDefault();
60
+ },
61
+ onClick: toggleInserterSidebar,
62
+ icon: plus,
63
+ label: _x(
64
+ "Block Inserter",
65
+ "Generic label for block inserter button"
66
+ ),
67
+ size: "compact"
68
+ }
69
+ ),
70
+ isMediumViewport && /* @__PURE__ */ jsxs(Fragment, { children: [
71
+ /* @__PURE__ */ jsx(ToolbarItem, { as: UndoButton }),
72
+ /* @__PURE__ */ jsx(ToolbarItem, { as: RedoButton }),
73
+ /* @__PURE__ */ jsx(
74
+ ToolbarItem,
75
+ {
76
+ as: Button,
77
+ className: "edit-widgets-header-toolbar__list-view-toggle",
78
+ icon: listView,
79
+ isPressed: isListViewOpen,
80
+ label: __("List View"),
81
+ onClick: toggleListView,
82
+ ref: listViewToggleRef,
83
+ size: "compact"
84
+ }
85
+ )
86
+ ] })
87
+ ]
88
+ }
89
+ );
84
90
  }
85
- export default DocumentTools;
86
- //# sourceMappingURL=index.js.map
91
+ var document_tools_default = DocumentTools;
92
+ export {
93
+ document_tools_default as default
94
+ };
95
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useSelect","useDispatch","__","_x","Button","ToolbarItem","NavigableToolbar","listView","plus","useCallback","useViewportMatch","UndoButton","RedoButton","store","editWidgetsStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DocumentTools","isMediumViewport","isInserterOpen","isListViewOpen","inserterSidebarToggleRef","listViewToggleRef","select","isInserterOpened","getInserterSidebarToggleRef","isListViewOpened","getListViewToggleRef","setIsInserterOpened","setIsListViewOpened","toggleListView","toggleInserterSidebar","className","variant","children","ref","as","isPressed","onMouseDown","event","preventDefault","onClick","icon","label","size"],"sources":["@wordpress/edit-widgets/src/components/header/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Block Inserter',\n\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t) }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t{ isMediumViewport && (\n\t\t\t\t<>\n\t\t\t\t\t<ToolbarItem as={ UndoButton } />\n\t\t\t\t\t<ToolbarItem as={ RedoButton } />\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-widgets-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,QAAQ,EAAEC,IAAI,QAAQ,kBAAkB;AACjD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,SAASC,aAAaA,CAAA,EAAG;EACxB,MAAMC,gBAAgB,GAAGb,gBAAgB,CAAE,QAAS,CAAC;EAErD,MAAM;IACLc,cAAc;IACdC,cAAc;IACdC,wBAAwB;IACxBC;EACD,CAAC,GAAG3B,SAAS,CAAI4B,MAAM,IAAM;IAC5B,MAAM;MACLC,gBAAgB;MAChBC,2BAA2B;MAC3BC,gBAAgB;MAChBC;IACD,CAAC,GAAGjB,MAAM,CAAEa,MAAM,CAAEd,gBAAiB,CAAE,CAAC;IACxC,OAAO;MACNU,cAAc,EAAEK,gBAAgB,CAAC,CAAC;MAClCJ,cAAc,EAAEM,gBAAgB,CAAC,CAAC;MAClCL,wBAAwB,EAAEI,2BAA2B,CAAC,CAAC;MACvDH,iBAAiB,EAAEK,oBAAoB,CAAC;IACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjDjC,WAAW,CAAEa,gBAAiB,CAAC;EAEhC,MAAMqB,cAAc,GAAG1B,WAAW,CACjC,MAAMyB,mBAAmB,CAAE,CAAET,cAAe,CAAC,EAC7C,CAAES,mBAAmB,EAAET,cAAc,CACtC,CAAC;EAED,MAAMW,qBAAqB,GAAG3B,WAAW,CACxC,MAAMwB,mBAAmB,CAAE,CAAET,cAAe,CAAC,EAC7C,CAAES,mBAAmB,EAAET,cAAc,CACtC,CAAC;EAED,oBACCH,KAAA,CAACf,gBAAgB;IAChB+B,SAAS,EAAC,6BAA6B;IACvC,cAAanC,EAAE,CAAE,gBAAiB,CAAG;IACrCoC,OAAO,EAAC,UAAU;IAAAC,QAAA,gBAElBtB,IAAA,CAACZ,WAAW;MACXmC,GAAG,EAAGd,wBAA0B;MAChCe,EAAE,EAAGrC,MAAQ;MACbiC,SAAS,EAAC,8CAA8C;MACxDC,OAAO,EAAC,SAAS;MACjBI,SAAS,EAAGlB,cAAgB;MAC5BmB,WAAW,EAAKC,KAAK,IAAM;QAC1BA,KAAK,CAACC,cAAc,CAAC,CAAC;MACvB,CAAG;MACHC,OAAO,EAAGV,qBAAuB;MACjCW,IAAI,EAAGvC;MACP;AACJ,qBADI;MAEAwC,KAAK,EAAG7C,EAAE,CACT,gBAAgB,EAChB,yCACD,CAAG;MACH8C,IAAI,EAAC;IAAS,CACd,CAAC,EACA1B,gBAAgB,iBACjBF,KAAA,CAAAF,SAAA;MAAAoB,QAAA,gBACCtB,IAAA,CAACZ,WAAW;QAACoC,EAAE,EAAG9B;MAAY,CAAE,CAAC,eACjCM,IAAA,CAACZ,WAAW;QAACoC,EAAE,EAAG7B;MAAY,CAAE,CAAC,eACjCK,IAAA,CAACZ,WAAW;QACXoC,EAAE,EAAGrC,MAAQ;QACbiC,SAAS,EAAC,+CAA+C;QACzDU,IAAI,EAAGxC,QAAU;QACjBmC,SAAS,EAAGjB;QACZ;QACAuB,KAAK,EAAG9C,EAAE,CAAE,WAAY,CAAG;QAC3B4C,OAAO,EAAGX,cAAgB;QAC1BK,GAAG,EAAGb,iBAAmB;QACzBsB,IAAI,EAAC;MAAS,CACd,CAAC;IAAA,CACD,CACF;EAAA,CACgB,CAAC;AAErB;AAEA,eAAe3B,aAAa","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/header/document-tools/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Block Inserter',\n\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t) }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t{ isMediumViewport && (\n\t\t\t\t<>\n\t\t\t\t\t<ToolbarItem as={ UndoButton } />\n\t\t\t\t\t<ToolbarItem as={ RedoButton } />\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-widgets-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],
5
+ "mappings": "AA4DG,SAoBC,UApBD,KAoBC,YApBD;AAzDH,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB,SAAS,QAAQ,mBAAmB;AACpC,SAAS,wBAAwB;AACjC,SAAS,UAAU,YAAY;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AAKjC,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AACxB,QAAM,mBAAmB,iBAAkB,QAAS;AAEpD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,OAAQ,gBAAiB,CAAE;AACvC,WAAO;AAAA,MACN,gBAAgB,iBAAiB;AAAA,MACjC,gBAAgB,iBAAiB;AAAA,MACjC,0BAA0B,4BAA4B;AAAA,MACtD,mBAAmB,qBAAqB;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,qBAAqB,oBAAoB,IAChD,YAAa,gBAAiB;AAE/B,QAAM,iBAAiB;AAAA,IACtB,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,QAAM,wBAAwB;AAAA,IAC7B,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAa,GAAI,gBAAiB;AAAA,MAClC,SAAQ;AAAA,MAER;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,KAAM;AAAA,YACN,IAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,WAAY;AAAA,YACZ,aAAc,CAAE,UAAW;AAC1B,oBAAM,eAAe;AAAA,YACtB;AAAA,YACA,SAAU;AAAA,YACV,MAAO;AAAA,YAGP,OAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA,YACA,MAAK;AAAA;AAAA,QACN;AAAA,QACE,oBACD,iCACC;AAAA,8BAAC,eAAY,IAAK,YAAa;AAAA,UAC/B,oBAAC,eAAY,IAAK,YAAa;AAAA,UAC/B;AAAA,YAAC;AAAA;AAAA,cACA,IAAK;AAAA,cACL,WAAU;AAAA,cACV,MAAO;AAAA,cACP,WAAY;AAAA,cAEZ,OAAQ,GAAI,WAAY;AAAA,cACxB,SAAU;AAAA,cACV,KAAM;AAAA,cACN,MAAK;AAAA;AAAA,UACN;AAAA,WACD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,yBAAQ;",
6
+ "names": []
7
+ }