@wordpress/edit-widgets 7.0.0 → 7.2.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 (199) hide show
  1. package/build/blocks/widget-area/edit/index.cjs +106 -116
  2. package/build/blocks/widget-area/edit/index.cjs.map +1 -7
  3. package/build/blocks/widget-area/edit/inner-blocks.cjs +44 -62
  4. package/build/blocks/widget-area/edit/inner-blocks.cjs.map +1 -7
  5. package/build/blocks/widget-area/edit/use-is-dragging-within.cjs +41 -53
  6. package/build/blocks/widget-area/edit/use-is-dragging-within.cjs.map +1 -7
  7. package/build/blocks/widget-area/index.cjs +40 -44
  8. package/build/blocks/widget-area/index.cjs.map +1 -7
  9. package/build/components/error-boundary/index.cjs +115 -155
  10. package/build/components/error-boundary/index.cjs.map +1 -7
  11. package/build/components/header/document-tools/index.cjs +80 -115
  12. package/build/components/header/document-tools/index.cjs.map +1 -7
  13. package/build/components/header/index.cjs +77 -80
  14. package/build/components/header/index.cjs.map +1 -7
  15. package/build/components/header/undo-redo/redo.cjs +30 -52
  16. package/build/components/header/undo-redo/redo.cjs.map +1 -7
  17. package/build/components/header/undo-redo/undo.cjs +29 -51
  18. package/build/components/header/undo-redo/undo.cjs.map +1 -7
  19. package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
  20. package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
  21. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
  22. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
  23. package/build/components/keyboard-shortcut-help-modal/index.cjs +94 -161
  24. package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
  25. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +38 -75
  26. package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
  27. package/build/components/keyboard-shortcuts/index.cjs +107 -140
  28. package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
  29. package/build/components/layout/index.cjs +65 -74
  30. package/build/components/layout/index.cjs.map +1 -7
  31. package/build/components/layout/interface.cjs +82 -108
  32. package/build/components/layout/interface.cjs.map +1 -7
  33. package/build/components/layout/unsaved-changes-warning.cjs +41 -48
  34. package/build/components/layout/unsaved-changes-warning.cjs.map +1 -7
  35. package/build/components/more-menu/index.cjs +124 -191
  36. package/build/components/more-menu/index.cjs.map +1 -7
  37. package/build/components/more-menu/tools-more-menu-group.cjs +9 -29
  38. package/build/components/more-menu/tools-more-menu-group.cjs.map +1 -7
  39. package/build/components/notices/index.cjs +19 -39
  40. package/build/components/notices/index.cjs.map +1 -7
  41. package/build/components/save-button/index.cjs +31 -58
  42. package/build/components/save-button/index.cjs.map +1 -7
  43. package/build/components/secondary-sidebar/index.cjs +38 -45
  44. package/build/components/secondary-sidebar/index.cjs.map +1 -7
  45. package/build/components/secondary-sidebar/inserter-sidebar.cjs +50 -51
  46. package/build/components/secondary-sidebar/inserter-sidebar.cjs.map +1 -7
  47. package/build/components/secondary-sidebar/list-view-sidebar.cjs +51 -82
  48. package/build/components/secondary-sidebar/list-view-sidebar.cjs.map +1 -7
  49. package/build/components/sidebar/index.cjs +117 -180
  50. package/build/components/sidebar/index.cjs.map +1 -7
  51. package/build/components/sidebar/widget-areas.cjs +43 -85
  52. package/build/components/sidebar/widget-areas.cjs.map +1 -7
  53. package/build/components/welcome-guide/index.cjs +110 -186
  54. package/build/components/welcome-guide/index.cjs.map +1 -7
  55. package/build/components/widget-areas-block-editor-content/index.cjs +59 -64
  56. package/build/components/widget-areas-block-editor-content/index.cjs.map +1 -7
  57. package/build/components/widget-areas-block-editor-provider/index.cjs +105 -140
  58. package/build/components/widget-areas-block-editor-provider/index.cjs.map +1 -7
  59. package/build/constants.cjs +11 -32
  60. package/build/constants.cjs.map +1 -7
  61. package/build/filters/index.cjs +7 -4
  62. package/build/filters/move-to-widget-area.cjs +38 -53
  63. package/build/filters/move-to-widget-area.cjs.map +1 -7
  64. package/build/filters/replace-media-upload.cjs +11 -9
  65. package/build/filters/replace-media-upload.cjs.map +1 -7
  66. package/build/hooks/use-last-selected-widget-area.cjs +28 -49
  67. package/build/hooks/use-last-selected-widget-area.cjs.map +1 -7
  68. package/build/hooks/use-widget-library-insertion-point.cjs +33 -67
  69. package/build/hooks/use-widget-library-insertion-point.cjs.map +1 -7
  70. package/build/index.cjs +96 -97
  71. package/build/index.cjs.map +1 -7
  72. package/build/lock-unlock.cjs +10 -35
  73. package/build/lock-unlock.cjs.map +1 -7
  74. package/build/store/actions.cjs +276 -278
  75. package/build/store/actions.cjs.map +1 -7
  76. package/build/store/constants.cjs +12 -29
  77. package/build/store/constants.cjs.map +1 -7
  78. package/build/store/index.cjs +61 -52
  79. package/build/store/index.cjs.map +1 -7
  80. package/build/store/private-selectors.cjs +11 -32
  81. package/build/store/private-selectors.cjs.map +1 -7
  82. package/build/store/reducer.cjs +107 -88
  83. package/build/store/reducer.cjs.map +1 -7
  84. package/build/store/resolvers.cjs +60 -91
  85. package/build/store/resolvers.cjs.map +1 -7
  86. package/build/store/selectors.cjs +196 -229
  87. package/build/store/selectors.cjs.map +1 -7
  88. package/build/store/transformers.cjs +51 -82
  89. package/build/store/transformers.cjs.map +1 -7
  90. package/build/store/utils.cjs +76 -63
  91. package/build/store/utils.cjs.map +1 -7
  92. package/build-module/blocks/widget-area/edit/index.mjs +82 -94
  93. package/build-module/blocks/widget-area/edit/index.mjs.map +1 -7
  94. package/build-module/blocks/widget-area/edit/inner-blocks.mjs +19 -35
  95. package/build-module/blocks/widget-area/edit/inner-blocks.mjs.map +1 -7
  96. package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs +36 -33
  97. package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs.map +1 -7
  98. package/build-module/blocks/widget-area/index.mjs +12 -15
  99. package/build-module/blocks/widget-area/index.mjs.map +1 -7
  100. package/build-module/components/error-boundary/index.mjs +104 -129
  101. package/build-module/components/error-boundary/index.mjs.map +1 -7
  102. package/build-module/components/header/document-tools/index.mjs +51 -84
  103. package/build-module/components/header/document-tools/index.mjs.map +1 -7
  104. package/build-module/components/header/index.mjs +44 -47
  105. package/build-module/components/header/index.mjs.map +1 -7
  106. package/build-module/components/header/undo-redo/redo.mjs +20 -27
  107. package/build-module/components/header/undo-redo/redo.mjs.map +1 -7
  108. package/build-module/components/header/undo-redo/undo.mjs +19 -26
  109. package/build-module/components/header/undo-redo/undo.mjs.map +1 -7
  110. package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
  111. package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
  112. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
  113. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
  114. package/build-module/components/keyboard-shortcut-help-modal/index.mjs +67 -136
  115. package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
  116. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +32 -54
  117. package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
  118. package/build-module/components/keyboard-shortcuts/index.mjs +99 -119
  119. package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
  120. package/build-module/components/layout/index.mjs +29 -40
  121. package/build-module/components/layout/index.mjs.map +1 -7
  122. package/build-module/components/layout/interface.mjs +53 -82
  123. package/build-module/components/layout/interface.mjs.map +1 -7
  124. package/build-module/components/layout/unsaved-changes-warning.mjs +35 -27
  125. package/build-module/components/layout/unsaved-changes-warning.mjs.map +1 -7
  126. package/build-module/components/more-menu/index.mjs +94 -162
  127. package/build-module/components/more-menu/index.mjs.map +1 -7
  128. package/build-module/components/more-menu/tools-more-menu-group.mjs +5 -9
  129. package/build-module/components/more-menu/tools-more-menu-group.mjs.map +1 -7
  130. package/build-module/components/notices/index.mjs +12 -17
  131. package/build-module/components/notices/index.mjs.map +1 -7
  132. package/build-module/components/save-button/index.mjs +23 -35
  133. package/build-module/components/save-button/index.mjs.map +1 -7
  134. package/build-module/components/secondary-sidebar/index.mjs +15 -20
  135. package/build-module/components/secondary-sidebar/index.mjs.map +1 -7
  136. package/build-module/components/secondary-sidebar/inserter-sidebar.mjs +27 -25
  137. package/build-module/components/secondary-sidebar/inserter-sidebar.mjs.map +1 -7
  138. package/build-module/components/secondary-sidebar/list-view-sidebar.mjs +39 -55
  139. package/build-module/components/secondary-sidebar/list-view-sidebar.mjs.map +1 -7
  140. package/build-module/components/sidebar/index.mjs +96 -162
  141. package/build-module/components/sidebar/index.mjs.map +1 -7
  142. package/build-module/components/sidebar/widget-areas.mjs +30 -57
  143. package/build-module/components/sidebar/widget-areas.mjs.map +1 -7
  144. package/build-module/components/welcome-guide/index.mjs +103 -164
  145. package/build-module/components/welcome-guide/index.mjs.map +1 -7
  146. package/build-module/components/widget-areas-block-editor-content/index.mjs +34 -44
  147. package/build-module/components/widget-areas-block-editor-content/index.mjs.map +1 -7
  148. package/build-module/components/widget-areas-block-editor-provider/index.mjs +76 -109
  149. package/build-module/components/widget-areas-block-editor-provider/index.mjs.map +1 -7
  150. package/build-module/constants.mjs +5 -7
  151. package/build-module/constants.mjs.map +1 -7
  152. package/build-module/filters/index.mjs +0 -2
  153. package/build-module/filters/move-to-widget-area.mjs +28 -48
  154. package/build-module/filters/move-to-widget-area.mjs.map +1 -7
  155. package/build-module/filters/replace-media-upload.mjs +5 -8
  156. package/build-module/filters/replace-media-upload.mjs.map +1 -7
  157. package/build-module/hooks/use-last-selected-widget-area.mjs +23 -29
  158. package/build-module/hooks/use-last-selected-widget-area.mjs.map +1 -7
  159. package/build-module/hooks/use-widget-library-insertion-point.mjs +28 -47
  160. package/build-module/hooks/use-widget-library-insertion-point.mjs.map +1 -7
  161. package/build-module/index.mjs +62 -79
  162. package/build-module/index.mjs.map +1 -7
  163. package/build-module/lock-unlock.mjs +5 -10
  164. package/build-module/lock-unlock.mjs.map +1 -7
  165. package/build-module/store/actions.mjs +257 -247
  166. package/build-module/store/actions.mjs.map +1 -7
  167. package/build-module/store/constants.mjs +7 -5
  168. package/build-module/store/constants.mjs.map +1 -7
  169. package/build-module/store/index.mjs +18 -16
  170. package/build-module/store/index.mjs.map +1 -7
  171. package/build-module/store/private-selectors.mjs +5 -7
  172. package/build-module/store/private-selectors.mjs.map +1 -7
  173. package/build-module/store/reducer.mjs +95 -58
  174. package/build-module/store/reducer.mjs.map +1 -7
  175. package/build-module/store/resolvers.mjs +52 -71
  176. package/build-module/store/resolvers.mjs.map +1 -7
  177. package/build-module/store/selectors.mjs +178 -199
  178. package/build-module/store/selectors.mjs.map +1 -7
  179. package/build-module/store/transformers.mjs +44 -56
  180. package/build-module/store/transformers.mjs.map +1 -7
  181. package/build-module/store/utils.mjs +64 -32
  182. package/build-module/store/utils.mjs.map +1 -7
  183. package/build-style/style-rtl.css +32 -11
  184. package/build-style/style.css +32 -11
  185. package/package.json +33 -33
  186. package/src/components/error-boundary/index.jsx +2 -2
  187. package/src/components/header/index.jsx +13 -4
  188. package/src/components/header/style.scss +30 -3
  189. package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +1 -0
  190. package/src/components/keyboard-shortcut-help-modal/style.scss +1 -1
  191. package/src/components/layout/style.scss +5 -9
  192. package/src/components/layout/unsaved-changes-warning.js +4 -9
  193. package/src/components/more-menu/index.jsx +0 -1
  194. package/src/components/sidebar/index.jsx +18 -18
  195. package/src/components/welcome-guide/index.jsx +4 -2
  196. package/src/store/actions.js +25 -2
  197. package/src/store/test/actions.jsdom.test.js +230 -0
  198. package/build/filters/index.cjs.map +0 -7
  199. package/build-module/filters/index.mjs.map +0 -7
@@ -1,127 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
1
7
  var __create = Object.create;
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
11
  var __getProtoOf = Object.getPrototypeOf;
6
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
13
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
+ });
20
+ }
21
+ return to;
18
22
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let _wordpress_element = require("@wordpress/element");
28
+ let _wordpress_data = require("@wordpress/data");
29
+ let _wordpress_core_data = require("@wordpress/core-data");
30
+ let _wordpress_components = require("@wordpress/components");
31
+ let _wordpress_block_editor = require("@wordpress/block-editor");
32
+ let __inner_blocks_jsx = require("./inner-blocks.cjs");
33
+ __inner_blocks_jsx = __toESM(__inner_blocks_jsx);
34
+ let _________store_index_js = require("../../../store/index.cjs");
35
+ let __use_is_dragging_within_js = require("./use-is-dragging-within.cjs");
36
+ __use_is_dragging_within_js = __toESM(__use_is_dragging_within_js);
37
+ let react_jsx_runtime = require("react/jsx-runtime");
29
38
  // packages/edit-widgets/src/blocks/widget-area/edit/index.jsx
30
- var edit_exports = {};
31
- __export(edit_exports, {
32
- default: () => WidgetAreaEdit
33
- });
34
- module.exports = __toCommonJS(edit_exports);
35
- var import_element = require("@wordpress/element");
36
- var import_data = require("@wordpress/data");
37
- var import_core_data = require("@wordpress/core-data");
38
- var import_components = require("@wordpress/components");
39
- var import_block_editor = require("@wordpress/block-editor");
40
- var import_inner_blocks = __toESM(require("./inner-blocks.cjs"));
41
- var import_store = require("../../../store/index.cjs");
42
- var import_use_is_dragging_within = __toESM(require("./use-is-dragging-within.cjs"));
43
- var import_jsx_runtime = require("react/jsx-runtime");
44
- function WidgetAreaEdit({
45
- clientId,
46
- attributes: { id, name }
47
- }) {
48
- const isOpen = (0, import_data.useSelect)(
49
- (select) => select(import_store.store).getIsWidgetAreaOpen(clientId),
50
- [clientId]
51
- );
52
- const { setIsWidgetAreaOpen } = (0, import_data.useDispatch)(import_store.store);
53
- const wrapper = (0, import_element.useRef)();
54
- const setOpen = (0, import_element.useCallback)(
55
- (openState) => setIsWidgetAreaOpen(clientId, openState),
56
- [clientId]
57
- );
58
- const isDragging = useIsDragging(wrapper);
59
- const isDraggingWithin = (0, import_use_is_dragging_within.default)(wrapper);
60
- const [openedWhileDragging, setOpenedWhileDragging] = (0, import_element.useState)(false);
61
- (0, import_element.useEffect)(() => {
62
- if (!isDragging) {
63
- setOpenedWhileDragging(false);
64
- return;
65
- }
66
- if (isDraggingWithin && !isOpen) {
67
- setOpen(true);
68
- setOpenedWhileDragging(true);
69
- } else if (!isDraggingWithin && isOpen && openedWhileDragging) {
70
- setOpen(false);
71
- }
72
- }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
73
- const blockProps = (0, import_block_editor.useBlockProps)();
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Panel, { ref: wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
- import_components.PanelBody,
76
- {
77
- title: name,
78
- opened: isOpen,
79
- onToggle: () => {
80
- setIsWidgetAreaOpen(clientId, !isOpen);
81
- },
82
- scrollAfterOpen: !isDragging,
83
- children: ({ opened }) => (
84
- // This is required to ensure LegacyWidget blocks are not
85
- // unmounted when the panel is collapsed. Unmounting legacy
86
- // widgets may have unintended consequences (e.g. TinyMCE
87
- // not being properly reinitialized)
88
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
- import_components.__unstableDisclosureContent,
90
- {
91
- className: "wp-block-widget-area__panel-body-content",
92
- visible: opened,
93
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
- import_core_data.EntityProvider,
95
- {
96
- kind: "root",
97
- type: "postType",
98
- id: `widget-area-${id}`,
99
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_inner_blocks.default, { id })
100
- }
101
- )
102
- }
103
- )
104
- )
105
- }
106
- ) }) });
39
+ /** @typedef {import('@wordpress/element').RefObject} RefObject */
40
+ function WidgetAreaEdit({ clientId, attributes: { id, name } }) {
41
+ const isOpen = (0, _wordpress_data.useSelect)((select) => select(_________store_index_js.store).getIsWidgetAreaOpen(clientId), [clientId]);
42
+ const { setIsWidgetAreaOpen } = (0, _wordpress_data.useDispatch)(_________store_index_js.store);
43
+ const wrapper = (0, _wordpress_element.useRef)();
44
+ const setOpen = (0, _wordpress_element.useCallback)((openState) => setIsWidgetAreaOpen(clientId, openState), [clientId]);
45
+ const isDragging = useIsDragging(wrapper);
46
+ const isDraggingWithin = (0, __use_is_dragging_within_js.default)(wrapper);
47
+ const [openedWhileDragging, setOpenedWhileDragging] = (0, _wordpress_element.useState)(false);
48
+ (0, _wordpress_element.useEffect)(() => {
49
+ if (!isDragging) {
50
+ setOpenedWhileDragging(false);
51
+ return;
52
+ }
53
+ if (isDraggingWithin && !isOpen) {
54
+ setOpen(true);
55
+ setOpenedWhileDragging(true);
56
+ } else if (!isDraggingWithin && isOpen && openedWhileDragging) setOpen(false);
57
+ }, [
58
+ isOpen,
59
+ isDragging,
60
+ isDraggingWithin,
61
+ openedWhileDragging
62
+ ]);
63
+ const blockProps = (0, _wordpress_block_editor.useBlockProps)();
64
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65
+ ...blockProps,
66
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Panel, {
67
+ ref: wrapper,
68
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.PanelBody, {
69
+ title: name,
70
+ opened: isOpen,
71
+ onToggle: () => {
72
+ setIsWidgetAreaOpen(clientId, !isOpen);
73
+ },
74
+ scrollAfterOpen: !isDragging,
75
+ children: ({ opened }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.__unstableDisclosureContent, {
76
+ className: "wp-block-widget-area__panel-body-content",
77
+ visible: opened,
78
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_core_data.EntityProvider, {
79
+ kind: "root",
80
+ type: "postType",
81
+ id: `widget-area-${id}`,
82
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__inner_blocks_jsx.default, { id })
83
+ })
84
+ })
85
+ })
86
+ })
87
+ });
107
88
  }
108
- var useIsDragging = (elementRef) => {
109
- const [isDragging, setIsDragging] = (0, import_element.useState)(false);
110
- (0, import_element.useEffect)(() => {
111
- const { ownerDocument } = elementRef.current;
112
- function handleDragStart() {
113
- setIsDragging(true);
114
- }
115
- function handleDragEnd() {
116
- setIsDragging(false);
117
- }
118
- ownerDocument.addEventListener("dragstart", handleDragStart);
119
- ownerDocument.addEventListener("dragend", handleDragEnd);
120
- return () => {
121
- ownerDocument.removeEventListener("dragstart", handleDragStart);
122
- ownerDocument.removeEventListener("dragend", handleDragEnd);
123
- };
124
- }, []);
125
- return isDragging;
89
+ /**
90
+ * A React hook to determine if dragging is active.
91
+ *
92
+ * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
93
+ *
94
+ * @return {boolean} Is dragging within the entire document.
95
+ */
96
+ const useIsDragging = (elementRef) => {
97
+ const [isDragging, setIsDragging] = (0, _wordpress_element.useState)(false);
98
+ (0, _wordpress_element.useEffect)(() => {
99
+ const { ownerDocument } = elementRef.current;
100
+ function handleDragStart() {
101
+ setIsDragging(true);
102
+ }
103
+ function handleDragEnd() {
104
+ setIsDragging(false);
105
+ }
106
+ ownerDocument.addEventListener("dragstart", handleDragStart);
107
+ ownerDocument.addEventListener("dragend", handleDragEnd);
108
+ return () => {
109
+ ownerDocument.removeEventListener("dragstart", handleDragStart);
110
+ ownerDocument.removeEventListener("dragend", handleDragEnd);
111
+ };
112
+ }, []);
113
+ return isDragging;
126
114
  };
127
- //# sourceMappingURL=index.cjs.map
115
+ exports.default = WidgetAreaEdit;
116
+
117
+ //# sourceMappingURL=index.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/blocks/widget-area/edit/index.jsx"],
4
- "sourcesContent": ["import { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\tconst blockProps = useBlockProps();\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Panel ref={ wrapper }>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ name }\n\t\t\t\t\topened={ isOpen }\n\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t\t} }\n\t\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t\t>\n\t\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t\t</DisclosureContent>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</Panel>\n\t\t</div>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAyD;AACzD,kBAAuC;AACvC,uBAA+B;AAC/B,wBAIO;AACP,0BAA8B;AAC9B,0BAAkC;AAClC,mBAA0C;AAC1C,oCAAgC;AAiExB;AA7DO,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA,YAAY,EAAE,IAAI,KAAK;AACxB,GAAI;AACH,QAAM,aAAS;AAAA,IACd,CAAE,WACD,OAAQ,aAAAA,KAAiB,EAAE,oBAAqB,QAAS;AAAA,IAC1D,CAAE,QAAS;AAAA,EACZ;AACA,QAAM,EAAE,oBAAoB,QAAI,yBAAa,aAAAA,KAAiB;AAE9D,QAAM,cAAU,uBAAO;AACvB,QAAM,cAAU;AAAA,IACf,CAAE,cAAe,oBAAqB,UAAU,SAAU;AAAA,IAC1D,CAAE,QAAS;AAAA,EACZ;AACA,QAAM,aAAa,cAAe,OAAQ;AAC1C,QAAM,uBAAmB,8BAAAC,SAAqB,OAAQ;AAEtD,QAAM,CAAE,qBAAqB,sBAAuB,QAAI,yBAAU,KAAM;AACxE,gCAAW,MAAM;AAChB,QAAK,CAAE,YAAa;AACnB,6BAAwB,KAAM;AAC9B;AAAA,IACD;AAEA,QAAK,oBAAoB,CAAE,QAAS;AACnC,cAAS,IAAK;AACd,6BAAwB,IAAK;AAAA,IAC9B,WAAY,CAAE,oBAAoB,UAAU,qBAAsB;AACjE,cAAS,KAAM;AAAA,IAChB;AAAA,EACD,GAAG,CAAE,QAAQ,YAAY,kBAAkB,mBAAoB,CAAE;AAEjE,QAAM,iBAAa,mCAAc;AAEjC,SACC,4CAAC,SAAM,GAAG,YACT,sDAAC,2BAAM,KAAM,SACZ;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ;AAAA,MACR,QAAS;AAAA,MACT,UAAW,MAAM;AAChB,4BAAqB,UAAU,CAAE,MAAO;AAAA,MACzC;AAAA,MACA,iBAAkB,CAAE;AAAA,MAElB,WAAE,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,QAKZ;AAAA,UAAC,kBAAAC;AAAA,UAAA;AAAA,YACA,WAAU;AAAA,YACV,SAAU;AAAA,YAEV;AAAA,cAAC;AAAA;AAAA,gBACA,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,IAAK,eAAgB,EAAG;AAAA,gBAExB,sDAAC,oBAAAC,SAAA,EAAsB,IAAU;AAAA;AAAA,YAClC;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF,GACD,GACD;AAEF;AASA,IAAM,gBAAgB,CAAE,eAAgB;AACvC,QAAM,CAAE,YAAY,aAAc,QAAI,yBAAU,KAAM;AAEtD,gCAAW,MAAM;AAChB,UAAM,EAAE,cAAc,IAAI,WAAW;AAErC,aAAS,kBAAkB;AAC1B,oBAAe,IAAK;AAAA,IACrB;AAEA,aAAS,gBAAgB;AACxB,oBAAe,KAAM;AAAA,IACtB;AAEA,kBAAc,iBAAkB,aAAa,eAAgB;AAC7D,kBAAc,iBAAkB,WAAW,aAAc;AAEzD,WAAO,MAAM;AACZ,oBAAc,oBAAqB,aAAa,eAAgB;AAChE,oBAAc,oBAAqB,WAAW,aAAc;AAAA,IAC7D;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AACR;",
6
- "names": ["editWidgetsStore", "useIsDraggingWithin", "DisclosureContent", "WidgetAreaInnerBlocks"]
7
- }
1
+ {"version":3,"file":"index.cjs","names":["useSelect","editWidgetsStore","useDispatch","useRef","useCallback","useIsDraggingWithin","useState","useBlockProps","Panel","PanelBody","DisclosureContent","EntityProvider","WidgetAreaInnerBlocks"],"sources":["../../../../src/blocks/widget-area/edit/index.jsx"],"sourcesContent":["import { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\tconst blockProps = useBlockProps();\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Panel ref={ wrapper }>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ name }\n\t\t\t\t\topened={ isOpen }\n\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t\t} }\n\t\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t\t>\n\t\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t\t</DisclosureContent>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</Panel>\n\t\t</div>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAwB,eAAgB,EACvC,UACA,YAAY,EAAE,IAAI,UACf;CACH,MAAM,UAAA,GAASA,gBAAAA,UAAAA,EACZ,WACD,OAAQC,wBAAAA,KAAiB,CAAC,CAAC,oBAAqB,QAAS,GAC1D,CAAE,QAAS,CACZ;CACA,MAAM,EAAE,yBAAA,GAAwBC,gBAAAA,YAAAA,CAAaD,wBAAAA,KAAiB;CAE9D,MAAM,WAAA,GAAUE,mBAAAA,OAAAA,CAAO;CACvB,MAAM,WAAA,GAAUC,mBAAAA,YAAAA,EACb,cAAe,oBAAqB,UAAU,SAAU,GAC1D,CAAE,QAAS,CACZ;CACA,MAAM,aAAa,cAAe,OAAQ;CAC1C,MAAM,oBAAA,GAAmBC,4BAAAA,QAAAA,CAAqB,OAAQ;CAEtD,MAAM,CAAE,qBAAqB,2BAAA,GAA2BC,mBAAAA,SAAAA,CAAU,KAAM;CACxE,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,IAAK,CAAE,YAAa;GACnB,uBAAwB,KAAM;GAC9B;EACD;EAEA,IAAK,oBAAoB,CAAE,QAAS;GACnC,QAAS,IAAK;GACd,uBAAwB,IAAK;EAC9B,OAAO,IAAK,CAAE,oBAAoB,UAAU,qBAC3C,QAAS,KAAM;CAEjB,GAAG;EAAE;EAAQ;EAAY;EAAkB;CAAoB,CAAE;CAEjE,MAAM,cAAA,GAAaC,wBAAAA,cAAAA,CAAc;CAEjC,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,GAAK;EACT,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAD;GAAO,KAAM;GACZ,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,WAAD;IACC,OAAQ;IACR,QAAS;IACT,gBAAiB;KAChB,oBAAqB,UAAU,CAAE,MAAO;IACzC;IACA,iBAAkB,CAAE;IAEhB,WAAA,EAAE,aAKL,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,6BAAD;KACC,WAAU;KACV,SAAU;KAEV,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,gBAAD;MACC,MAAK;MACL,MAAK;MACL,IAAK,eAAgB;MAErB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,SAAD,EAA4B,GAAM,CAAA;KACnB,CAAA;IACE,CAAA;GAEV,CAAA;EACL,CAAA;CACH,CAAA;AAEP;;;;;;;;AASA,MAAM,iBAAkB,eAAgB;CACvC,MAAM,CAAE,YAAY,kBAAA,GAAkBN,mBAAAA,SAAAA,CAAU,KAAM;CAEtD,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,MAAM,EAAE,kBAAkB,WAAW;EAErC,SAAS,kBAAkB;GAC1B,cAAe,IAAK;EACrB;EAEA,SAAS,gBAAgB;GACxB,cAAe,KAAM;EACtB;EAEA,cAAc,iBAAkB,aAAa,eAAgB;EAC7D,cAAc,iBAAkB,WAAW,aAAc;EAEzD,aAAa;GACZ,cAAc,oBAAqB,aAAa,eAAgB;GAChE,cAAc,oBAAqB,WAAW,aAAc;EAC7D;CACD,GAAG,CAAC,CAAE;CAEN,OAAO;AACR"}
@@ -1,73 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
1
7
  var __create = Object.create;
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
11
  var __getProtoOf = Object.getPrototypeOf;
6
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
13
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
+ });
20
+ }
21
+ return to;
18
22
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let clsx = require("clsx");
28
+ clsx = __toESM(clsx);
29
+ let _wordpress_core_data = require("@wordpress/core-data");
30
+ let _wordpress_block_editor = require("@wordpress/block-editor");
31
+ let _wordpress_element = require("@wordpress/element");
32
+ let __use_is_dragging_within_js = require("./use-is-dragging-within.cjs");
33
+ __use_is_dragging_within_js = __toESM(__use_is_dragging_within_js);
34
+ let react_jsx_runtime = require("react/jsx-runtime");
29
35
  // packages/edit-widgets/src/blocks/widget-area/edit/inner-blocks.jsx
30
- var inner_blocks_exports = {};
31
- __export(inner_blocks_exports, {
32
- default: () => WidgetAreaInnerBlocks
33
- });
34
- module.exports = __toCommonJS(inner_blocks_exports);
35
- var import_clsx = __toESM(require("clsx"));
36
- var import_core_data = require("@wordpress/core-data");
37
- var import_block_editor = require("@wordpress/block-editor");
38
- var import_element = require("@wordpress/element");
39
- var import_use_is_dragging_within = __toESM(require("./use-is-dragging-within.cjs"));
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
36
  function WidgetAreaInnerBlocks({ id }) {
42
- const [blocks, onInput, onChange] = (0, import_core_data.useEntityBlockEditor)(
43
- "root",
44
- "postType"
45
- );
46
- const innerBlocksRef = (0, import_element.useRef)();
47
- const isDraggingWithinInnerBlocks = (0, import_use_is_dragging_within.default)(innerBlocksRef);
48
- const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
49
- const innerBlocksProps = (0, import_block_editor.useInnerBlocksProps)(
50
- { ref: innerBlocksRef },
51
- {
52
- value: blocks,
53
- onInput,
54
- onChange,
55
- templateLock: false,
56
- renderAppender: import_block_editor.InnerBlocks.ButtonBlockAppender
57
- }
58
- );
59
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
- "div",
61
- {
62
- "data-widget-area-id": id,
63
- className: (0, import_clsx.default)(
64
- "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
65
- {
66
- "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
67
- }
68
- ),
69
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...innerBlocksProps })
70
- }
71
- );
37
+ const [blocks, onInput, onChange] = (0, _wordpress_core_data.useEntityBlockEditor)("root", "postType");
38
+ const innerBlocksRef = (0, _wordpress_element.useRef)();
39
+ const shouldHighlightDropZone = (0, __use_is_dragging_within_js.default)(innerBlocksRef);
40
+ const innerBlocksProps = (0, _wordpress_block_editor.useInnerBlocksProps)({ ref: innerBlocksRef }, {
41
+ value: blocks,
42
+ onInput,
43
+ onChange,
44
+ templateLock: false,
45
+ renderAppender: _wordpress_block_editor.InnerBlocks.ButtonBlockAppender
46
+ });
47
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
48
+ "data-widget-area-id": id,
49
+ className: (0, clsx.default)("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper", { "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone }),
50
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...innerBlocksProps })
51
+ });
72
52
  }
73
- //# sourceMappingURL=inner-blocks.cjs.map
53
+ exports.default = WidgetAreaInnerBlocks;
54
+
55
+ //# sourceMappingURL=inner-blocks.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/blocks/widget-area/edit/inner-blocks.jsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,uBAAqC;AACrC,0BAAiD;AACjD,qBAAuB;AACvB,oCAAgC;AAiC7B;AA/BY,SAAR,sBAAwC,EAAE,GAAG,GAAI;AACvD,QAAM,CAAE,QAAQ,SAAS,QAAS,QAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACD;AACA,QAAM,qBAAiB,uBAAO;AAC9B,QAAM,kCAA8B,8BAAAA,SAAqB,cAAe;AACxE,QAAM,0BAA0B;AAEhC,QAAM,uBAAmB;AAAA,IACxB,EAAE,KAAK,eAAe;AAAA,IACtB;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,gBAAgB,gCAAY;AAAA,IAC7B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAsB;AAAA,MACtB,eAAY,YAAAC;AAAA,QACX;AAAA,QACA;AAAA,UACC,6CACC;AAAA,QACF;AAAA,MACD;AAAA,MAEA,sDAAC,SAAM,GAAG,kBAAmB;AAAA;AAAA,EAC9B;AAEF;",
6
- "names": ["useIsDraggingWithin", "clsx"]
7
- }
1
+ {"version":3,"file":"inner-blocks.cjs","names":["useEntityBlockEditor","useRef","useIsDraggingWithin","useInnerBlocksProps","InnerBlocks"],"sources":["../../../../src/blocks/widget-area/edit/inner-blocks.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAwB,sBAAuB,EAAE,MAAO;CACvD,MAAM,CAAE,QAAQ,SAAS,aAAA,GAAaA,qBAAAA,qBAAAA,CACrC,QACA,UACD;CACA,MAAM,kBAAA,GAAiBC,mBAAAA,OAAAA,CAAO;CAE9B,MAAM,2BAAA,GAD8BC,4BAAAA,QAAAA,CAAqB,cACC;CAE1D,MAAM,oBAAA,GAAmBC,wBAAAA,oBAAAA,CACxB,EAAE,KAAK,eAAe,GACtB;EACC,OAAO;EACP;EACA;EACA,cAAc;EACd,gBAAgBC,wBAAAA,YAAY;CAC7B,CACD;CAEA,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACC,uBAAsB;EACtB,YAAA,GAAY,KAAA,QAAA,CACX,sFACA,EACC,6CACC,wBACF,CACD;EAEA,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,GAAK,iBAAoB,CAAA;CAC1B,CAAA;AAEP"}
@@ -1,55 +1,43 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/edit-widgets/src/blocks/widget-area/edit/use-is-dragging-within.js
20
- var use_is_dragging_within_exports = {};
21
- __export(use_is_dragging_within_exports, {
22
- default: () => use_is_dragging_within_default
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
23
5
  });
24
- module.exports = __toCommonJS(use_is_dragging_within_exports);
25
- var import_element = require("@wordpress/element");
26
- var useIsDraggingWithin = (elementRef) => {
27
- const [isDraggingWithin, setIsDraggingWithin] = (0, import_element.useState)(false);
28
- (0, import_element.useEffect)(() => {
29
- const { ownerDocument } = elementRef.current;
30
- function handleDragStart(event) {
31
- handleDragEnter(event);
32
- }
33
- function handleDragEnd() {
34
- setIsDraggingWithin(false);
35
- }
36
- function handleDragEnter(event) {
37
- if (elementRef.current.contains(event.target)) {
38
- setIsDraggingWithin(true);
39
- } else {
40
- setIsDraggingWithin(false);
41
- }
42
- }
43
- ownerDocument.addEventListener("dragstart", handleDragStart);
44
- ownerDocument.addEventListener("dragend", handleDragEnd);
45
- ownerDocument.addEventListener("dragenter", handleDragEnter);
46
- return () => {
47
- ownerDocument.removeEventListener("dragstart", handleDragStart);
48
- ownerDocument.removeEventListener("dragend", handleDragEnd);
49
- ownerDocument.removeEventListener("dragenter", handleDragEnter);
50
- };
51
- }, []);
52
- return isDraggingWithin;
6
+ let _wordpress_element = require("@wordpress/element");
7
+ // packages/edit-widgets/src/blocks/widget-area/edit/use-is-dragging-within.js
8
+ /** @typedef {import('@wordpress/element').RefObject} RefObject */
9
+ /**
10
+ * A React hook to determine if it's dragging within the target element.
11
+ *
12
+ * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
13
+ *
14
+ * @return {boolean} Is dragging within the target element.
15
+ */
16
+ const useIsDraggingWithin = (elementRef) => {
17
+ const [isDraggingWithin, setIsDraggingWithin] = (0, _wordpress_element.useState)(false);
18
+ (0, _wordpress_element.useEffect)(() => {
19
+ const { ownerDocument } = elementRef.current;
20
+ function handleDragStart(event) {
21
+ handleDragEnter(event);
22
+ }
23
+ function handleDragEnd() {
24
+ setIsDraggingWithin(false);
25
+ }
26
+ function handleDragEnter(event) {
27
+ if (elementRef.current.contains(event.target)) setIsDraggingWithin(true);
28
+ else setIsDraggingWithin(false);
29
+ }
30
+ ownerDocument.addEventListener("dragstart", handleDragStart);
31
+ ownerDocument.addEventListener("dragend", handleDragEnd);
32
+ ownerDocument.addEventListener("dragenter", handleDragEnter);
33
+ return () => {
34
+ ownerDocument.removeEventListener("dragstart", handleDragStart);
35
+ ownerDocument.removeEventListener("dragend", handleDragEnd);
36
+ ownerDocument.removeEventListener("dragenter", handleDragEnter);
37
+ };
38
+ }, []);
39
+ return isDraggingWithin;
53
40
  };
54
- var use_is_dragging_within_default = useIsDraggingWithin;
55
- //# sourceMappingURL=use-is-dragging-within.cjs.map
41
+ exports.default = useIsDraggingWithin;
42
+
43
+ //# sourceMappingURL=use-is-dragging-within.cjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],
4
- "sourcesContent": ["import { 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": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AAWpC,IAAM,sBAAsB,CAAE,eAAgB;AAC7C,QAAM,CAAE,kBAAkB,mBAAoB,QAAI,yBAAU,KAAM;AAElE,gCAAW,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
+ {"version":3,"file":"use-is-dragging-within.cjs","names":["useState"],"sources":["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],"sourcesContent":["import { 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":";;;;;;;;;;;;;;;AAWA,MAAM,uBAAwB,eAAgB;CAC7C,MAAM,CAAE,kBAAkB,wBAAA,GAAwBA,mBAAAA,SAAAA,CAAU,KAAM;CAElE,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,MAAM,EAAE,kBAAkB,WAAW;EAErC,SAAS,gBAAiB,OAAQ;GAEjC,gBAAiB,KAAM;EACxB;EAGA,SAAS,gBAAgB;GACxB,oBAAqB,KAAM;EAC5B;EAEA,SAAS,gBAAiB,OAAQ;GAEjC,IAAK,WAAW,QAAQ,SAAU,MAAM,MAAO,GAC9C,oBAAqB,IAAK;QAE1B,oBAAqB,KAAM;EAE7B;EAIA,cAAc,iBAAkB,aAAa,eAAgB;EAC7D,cAAc,iBAAkB,WAAW,aAAc;EACzD,cAAc,iBAAkB,aAAa,eAAgB;EAE7D,aAAa;GACZ,cAAc,oBAAqB,aAAa,eAAgB;GAChE,cAAc,oBAAqB,WAAW,aAAc;GAC5D,cAAc,oBAAqB,aAAa,eAAgB;EACjE;CACD,GAAG,CAAC,CAAE;CAEN,OAAO;AACR"}
@@ -1,55 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
1
7
  var __create = Object.create;
2
8
  var __defProp = Object.defineProperty;
3
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
11
  var __getProtoOf = Object.getPrototypeOf;
6
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name2 in all)
9
- __defProp(target, name2, { get: all[name2], enumerable: true });
10
- };
11
13
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
+ });
20
+ }
21
+ return to;
18
22
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let _wordpress_i18n = require("@wordpress/i18n");
28
+ let _wordpress_icons = require("@wordpress/icons");
29
+ let __block_json = require("./block.json");
30
+ __block_json = __toESM(__block_json);
31
+ let __edit_index_jsx = require("./edit/index.cjs");
32
+ __edit_index_jsx = __toESM(__edit_index_jsx);
29
33
  // packages/edit-widgets/src/blocks/widget-area/index.js
30
- var widget_area_exports = {};
31
- __export(widget_area_exports, {
32
- metadata: () => import_block.default,
33
- name: () => name,
34
- settings: () => settings
35
- });
36
- module.exports = __toCommonJS(widget_area_exports);
37
- var import_i18n = require("@wordpress/i18n");
38
- var import_icons = require("@wordpress/icons");
39
- var import_block = __toESM(require("./block.json"));
40
- var import_edit = __toESM(require("./edit/index.cjs"));
41
- var { name } = import_block.default;
42
- var settings = {
43
- title: (0, import_i18n.__)("Widget Area"),
44
- description: (0, import_i18n.__)("A widget area container."),
45
- __experimentalLabel: ({ name: label }) => label,
46
- icon: import_icons.layout,
47
- edit: import_edit.default
34
+ const { name } = __block_json.default;
35
+ const settings = {
36
+ title: (0, _wordpress_i18n.__)("Widget Area"),
37
+ description: (0, _wordpress_i18n.__)("A widget area container."),
38
+ __experimentalLabel: ({ name: label }) => label,
39
+ icon: _wordpress_icons.layout,
40
+ edit: __edit_index_jsx.default
48
41
  };
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- metadata,
52
- name,
53
- settings
42
+ Object.defineProperty(exports, "metadata", {
43
+ enumerable: true,
44
+ get: function() {
45
+ return __block_json.default;
46
+ }
54
47
  });
55
- //# sourceMappingURL=index.cjs.map
48
+ exports.name = name;
49
+ exports.settings = settings;
50
+
51
+ //# sourceMappingURL=index.cjs.map