@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
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 3,
4
+ "name": "core/widget-area",
5
+ "title": "Widget Area",
6
+ "category": "widgets",
7
+ "attributes": {
8
+ "id": {
9
+ "type": "string"
10
+ },
11
+ "name": {
12
+ "type": "string"
13
+ }
14
+ },
15
+ "supports": {
16
+ "html": false,
17
+ "inserter": false,
18
+ "customClassName": false,
19
+ "reusable": false,
20
+ "__experimentalToolbar": false,
21
+ "__experimentalParentSelector": false,
22
+ "__experimentalDisableBlockOverlay": true
23
+ },
24
+ "editorStyle": "wp-block-widget-area-editor",
25
+ "style": "wp-block-widget-area"
26
+ }
@@ -1,44 +1,62 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ 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
+ 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;
18
+ };
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
+ var edit_exports = {};
29
+ __export(edit_exports, {
30
+ default: () => WidgetAreaEdit
6
31
  });
7
- exports.default = WidgetAreaEdit;
8
- var _element = require("@wordpress/element");
9
- var _data = require("@wordpress/data");
10
- var _coreData = require("@wordpress/core-data");
11
- var _components = require("@wordpress/components");
12
- var _blockEditor = require("@wordpress/block-editor");
13
- var _innerBlocks = _interopRequireDefault(require("./inner-blocks"));
14
- var _store = require("../../../store");
15
- var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-within"));
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- /**
18
- * WordPress dependencies
19
- */
20
-
21
- /**
22
- * Internal dependencies
23
- */
24
-
25
- /** @typedef {import('@wordpress/element').RefObject} RefObject */function WidgetAreaEdit({
32
+ module.exports = __toCommonJS(edit_exports);
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var import_element = require("@wordpress/element");
35
+ var import_data = require("@wordpress/data");
36
+ var import_core_data = require("@wordpress/core-data");
37
+ var import_components = require("@wordpress/components");
38
+ var import_block_editor = require("@wordpress/block-editor");
39
+ var import_inner_blocks = __toESM(require("./inner-blocks"));
40
+ var import_store = require("../../../store");
41
+ var import_use_is_dragging_within = __toESM(require("./use-is-dragging-within"));
42
+ function WidgetAreaEdit({
26
43
  clientId,
27
- attributes: {
28
- id,
29
- name
30
- }
44
+ attributes: { id, name }
31
45
  }) {
32
- const isOpen = (0, _data.useSelect)(select => select(_store.store).getIsWidgetAreaOpen(clientId), [clientId]);
33
- const {
34
- setIsWidgetAreaOpen
35
- } = (0, _data.useDispatch)(_store.store);
36
- const wrapper = (0, _element.useRef)();
37
- const setOpen = (0, _element.useCallback)(openState => setIsWidgetAreaOpen(clientId, openState), [clientId]);
46
+ const isOpen = (0, import_data.useSelect)(
47
+ (select) => select(import_store.store).getIsWidgetAreaOpen(clientId),
48
+ [clientId]
49
+ );
50
+ const { setIsWidgetAreaOpen } = (0, import_data.useDispatch)(import_store.store);
51
+ const wrapper = (0, import_element.useRef)();
52
+ const setOpen = (0, import_element.useCallback)(
53
+ (openState) => setIsWidgetAreaOpen(clientId, openState),
54
+ [clientId]
55
+ );
38
56
  const isDragging = useIsDragging(wrapper);
39
- const isDraggingWithin = (0, _useIsDraggingWithin.default)(wrapper);
40
- const [openedWhileDragging, setOpenedWhileDragging] = (0, _element.useState)(false);
41
- (0, _element.useEffect)(() => {
57
+ const isDraggingWithin = (0, import_use_is_dragging_within.default)(wrapper);
58
+ const [openedWhileDragging, setOpenedWhileDragging] = (0, import_element.useState)(false);
59
+ (0, import_element.useEffect)(() => {
42
60
  if (!isDragging) {
43
61
  setOpenedWhileDragging(false);
44
62
  return;
@@ -50,69 +68,58 @@ var _jsxRuntime = require("react/jsx-runtime");
50
68
  setOpen(false);
51
69
  }
52
70
  }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
53
- const blockProps = (0, _blockEditor.useBlockProps)();
54
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
55
- ...blockProps,
56
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Panel, {
57
- ref: wrapper,
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
59
- title: name,
60
- opened: isOpen,
61
- onToggle: () => {
62
- setIsWidgetAreaOpen(clientId, !isOpen);
63
- },
64
- scrollAfterOpen: !isDragging,
65
- children: ({
66
- opened
67
- }) =>
68
- /*#__PURE__*/
71
+ const blockProps = (0, import_block_editor.useBlockProps)();
72
+ 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)(
73
+ import_components.PanelBody,
74
+ {
75
+ title: name,
76
+ opened: isOpen,
77
+ onToggle: () => {
78
+ setIsWidgetAreaOpen(clientId, !isOpen);
79
+ },
80
+ scrollAfterOpen: !isDragging,
81
+ children: ({ opened }) => (
69
82
  // This is required to ensure LegacyWidget blocks are not
70
83
  // unmounted when the panel is collapsed. Unmounting legacy
71
84
  // widgets may have unintended consequences (e.g. TinyMCE
72
85
  // not being properly reinitialized)
73
- (0, _jsxRuntime.jsx)(_components.__unstableDisclosureContent, {
74
- className: "wp-block-widget-area__panel-body-content",
75
- visible: opened,
76
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_coreData.EntityProvider, {
77
- kind: "root",
78
- type: "postType",
79
- id: `widget-area-${id}`,
80
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_innerBlocks.default, {
81
- id: id
82
- })
83
- })
84
- })
85
- })
86
- })
87
- });
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
+ import_components.__unstableDisclosureContent,
88
+ {
89
+ className: "wp-block-widget-area__panel-body-content",
90
+ visible: opened,
91
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ import_core_data.EntityProvider,
93
+ {
94
+ kind: "root",
95
+ type: "postType",
96
+ id: `widget-area-${id}`,
97
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_inner_blocks.default, { id })
98
+ }
99
+ )
100
+ }
101
+ )
102
+ )
103
+ }
104
+ ) }) });
88
105
  }
89
-
90
- /**
91
- * A React hook to determine if dragging is active.
92
- *
93
- * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
94
- *
95
- * @return {boolean} Is dragging within the entire document.
96
- */
97
- const useIsDragging = elementRef => {
98
- const [isDragging, setIsDragging] = (0, _element.useState)(false);
99
- (0, _element.useEffect)(() => {
100
- const {
101
- ownerDocument
102
- } = elementRef.current;
106
+ const useIsDragging = (elementRef) => {
107
+ const [isDragging, setIsDragging] = (0, import_element.useState)(false);
108
+ (0, import_element.useEffect)(() => {
109
+ const { ownerDocument } = elementRef.current;
103
110
  function handleDragStart() {
104
111
  setIsDragging(true);
105
112
  }
106
113
  function handleDragEnd() {
107
114
  setIsDragging(false);
108
115
  }
109
- ownerDocument.addEventListener('dragstart', handleDragStart);
110
- ownerDocument.addEventListener('dragend', handleDragEnd);
116
+ ownerDocument.addEventListener("dragstart", handleDragStart);
117
+ ownerDocument.addEventListener("dragend", handleDragEnd);
111
118
  return () => {
112
- ownerDocument.removeEventListener('dragstart', handleDragStart);
113
- ownerDocument.removeEventListener('dragend', handleDragEnd);
119
+ ownerDocument.removeEventListener("dragstart", handleDragStart);
120
+ ownerDocument.removeEventListener("dragend", handleDragEnd);
114
121
  };
115
122
  }, []);
116
123
  return isDragging;
117
124
  };
118
- //# sourceMappingURL=index.js.map
125
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_components","_blockEditor","_innerBlocks","_interopRequireDefault","_store","_useIsDraggingWithin","_jsxRuntime","WidgetAreaEdit","clientId","attributes","id","name","isOpen","useSelect","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","useDispatch","wrapper","useRef","setOpen","useCallback","openState","isDragging","useIsDragging","isDraggingWithin","useIsDraggingWithin","openedWhileDragging","setOpenedWhileDragging","useState","useEffect","blockProps","useBlockProps","jsx","children","Panel","ref","PanelBody","title","opened","onToggle","scrollAfterOpen","__unstableDisclosureContent","className","visible","EntityProvider","kind","type","default","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { 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';\n\n/**\n * Internal dependencies\n */\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":"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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/blocks/widget-area/edit/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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';\n\n/**\n * Internal dependencies\n */\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;AAmFQ;AAhFR,qBAAyD;AACzD,kBAAuC;AACvC,uBAA+B;AAC/B,wBAIO;AACP,0BAA8B;AAK9B,0BAAkC;AAClC,mBAA0C;AAC1C,oCAAgC;AAIjB,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,MAAM,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,53 +1,71 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ 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
+ 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;
18
+ };
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
+ var inner_blocks_exports = {};
29
+ __export(inner_blocks_exports, {
30
+ default: () => WidgetAreaInnerBlocks
6
31
  });
7
- exports.default = WidgetAreaInnerBlocks;
8
- var _clsx = _interopRequireDefault(require("clsx"));
9
- var _coreData = require("@wordpress/core-data");
10
- var _blockEditor = require("@wordpress/block-editor");
11
- var _element = require("@wordpress/element");
12
- var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-within"));
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * External dependencies
16
- */
17
-
18
- /**
19
- * WordPress dependencies
20
- */
21
-
22
- /**
23
- * Internal dependencies
24
- */
25
-
26
- function WidgetAreaInnerBlocks({
27
- id
28
- }) {
29
- const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)('root', 'postType');
30
- const innerBlocksRef = (0, _element.useRef)();
31
- const isDraggingWithinInnerBlocks = (0, _useIsDraggingWithin.default)(innerBlocksRef);
32
+ module.exports = __toCommonJS(inner_blocks_exports);
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var import_clsx = __toESM(require("clsx"));
35
+ var import_core_data = require("@wordpress/core-data");
36
+ var import_block_editor = require("@wordpress/block-editor");
37
+ var import_element = require("@wordpress/element");
38
+ var import_use_is_dragging_within = __toESM(require("./use-is-dragging-within"));
39
+ function WidgetAreaInnerBlocks({ id }) {
40
+ const [blocks, onInput, onChange] = (0, import_core_data.useEntityBlockEditor)(
41
+ "root",
42
+ "postType"
43
+ );
44
+ const innerBlocksRef = (0, import_element.useRef)();
45
+ const isDraggingWithinInnerBlocks = (0, import_use_is_dragging_within.default)(innerBlocksRef);
32
46
  const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
33
- // Using the experimental hook so that we can control the className of the element.
34
- const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)({
35
- ref: innerBlocksRef
36
- }, {
37
- value: blocks,
38
- onInput,
39
- onChange,
40
- templateLock: false,
41
- renderAppender: _blockEditor.InnerBlocks.ButtonBlockAppender
42
- });
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
44
- "data-widget-area-id": id,
45
- className: (0, _clsx.default)('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
46
- 'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
47
- }),
48
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
49
- ...innerBlocksProps
50
- })
51
- });
47
+ const innerBlocksProps = (0, import_block_editor.useInnerBlocksProps)(
48
+ { ref: innerBlocksRef },
49
+ {
50
+ value: blocks,
51
+ onInput,
52
+ onChange,
53
+ templateLock: false,
54
+ renderAppender: import_block_editor.InnerBlocks.ButtonBlockAppender
55
+ }
56
+ );
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ "div",
59
+ {
60
+ "data-widget-area-id": id,
61
+ className: (0, import_clsx.default)(
62
+ "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
63
+ {
64
+ "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
65
+ }
66
+ ),
67
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...innerBlocksProps })
68
+ }
69
+ );
52
70
  }
53
- //# sourceMappingURL=inner-blocks.js.map
71
+ //# sourceMappingURL=inner-blocks.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_blockEditor","_element","_useIsDraggingWithin","_jsxRuntime","WidgetAreaInnerBlocks","id","blocks","onInput","onChange","useEntityBlockEditor","innerBlocksRef","useRef","isDraggingWithinInnerBlocks","useIsDraggingWithin","shouldHighlightDropZone","innerBlocksProps","useInnerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender","jsx","className","clsx","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,oBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA2D,IAAAK,WAAA,GAAAL,OAAA;AAf3D;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASM,qBAAqBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACvD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG,IAAAC,8BAAoB,EACzD,MAAM,EACN,UACD,CAAC;EACD,MAAMC,cAAc,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC/B,MAAMC,2BAA2B,GAAG,IAAAC,4BAAmB,EAAEH,cAAe,CAAC;EACzE,MAAMI,uBAAuB,GAAGF,2BAA2B;EAC3D;EACA,MAAMG,gBAAgB,GAAG,IAAAC,gCAAmB,EAC3C;IAAEC,GAAG,EAAEP;EAAe,CAAC,EACvB;IACCQ,KAAK,EAAEZ,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRW,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAEC,wBAAW,CAACC;EAC7B,CACD,CAAC;EAED,oBACC,IAAAnB,WAAA,CAAAoB,GAAA;IACC,uBAAsBlB,EAAI;IAC1BmB,SAAS,EAAG,IAAAC,aAAI,EACf,oFAAoF,EACpF;MACC,2CAA2C,EAC1CX;IACF,CACD,CAAG;IAAAY,QAAA,eAEH,IAAAvB,WAAA,CAAAoB,GAAA;MAAA,GAAUR;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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDG;AA7CH,kBAAiB;AAKjB,uBAAqC;AACrC,0BAAiD;AACjD,qBAAuB;AAKvB,oCAAgC;AAEjB,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,59 +1,53 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
+ var use_is_dragging_within_exports = {};
19
+ __export(use_is_dragging_within_exports, {
20
+ default: () => use_is_dragging_within_default
5
21
  });
6
- exports.default = void 0;
7
- var _element = require("@wordpress/element");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- /** @typedef {import('@wordpress/element').RefObject} RefObject */
13
-
14
- /**
15
- * A React hook to determine if it's dragging within the target element.
16
- *
17
- * @param {RefObject<HTMLElement>} elementRef The target elementRef object.
18
- *
19
- * @return {boolean} Is dragging within the target element.
20
- */
21
- const useIsDraggingWithin = elementRef => {
22
- const [isDraggingWithin, setIsDraggingWithin] = (0, _element.useState)(false);
23
- (0, _element.useEffect)(() => {
24
- const {
25
- ownerDocument
26
- } = elementRef.current;
22
+ module.exports = __toCommonJS(use_is_dragging_within_exports);
23
+ var import_element = require("@wordpress/element");
24
+ const useIsDraggingWithin = (elementRef) => {
25
+ const [isDraggingWithin, setIsDraggingWithin] = (0, import_element.useState)(false);
26
+ (0, import_element.useEffect)(() => {
27
+ const { ownerDocument } = elementRef.current;
27
28
  function handleDragStart(event) {
28
- // Check the first time when the dragging starts.
29
29
  handleDragEnter(event);
30
30
  }
31
-
32
- // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
33
31
  function handleDragEnd() {
34
32
  setIsDraggingWithin(false);
35
33
  }
36
34
  function handleDragEnter(event) {
37
- // Check if the current target is inside the item element.
38
35
  if (elementRef.current.contains(event.target)) {
39
36
  setIsDraggingWithin(true);
40
37
  } else {
41
38
  setIsDraggingWithin(false);
42
39
  }
43
40
  }
44
-
45
- // Bind these events to the document to catch all drag events.
46
- // Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.
47
- ownerDocument.addEventListener('dragstart', handleDragStart);
48
- ownerDocument.addEventListener('dragend', handleDragEnd);
49
- ownerDocument.addEventListener('dragenter', handleDragEnter);
41
+ ownerDocument.addEventListener("dragstart", handleDragStart);
42
+ ownerDocument.addEventListener("dragend", handleDragEnd);
43
+ ownerDocument.addEventListener("dragenter", handleDragEnter);
50
44
  return () => {
51
- ownerDocument.removeEventListener('dragstart', handleDragStart);
52
- ownerDocument.removeEventListener('dragend', handleDragEnd);
53
- ownerDocument.removeEventListener('dragenter', handleDragEnter);
45
+ ownerDocument.removeEventListener("dragstart", handleDragStart);
46
+ ownerDocument.removeEventListener("dragend", handleDragEnd);
47
+ ownerDocument.removeEventListener("dragenter", handleDragEnter);
54
48
  };
55
49
  }, []);
56
50
  return isDraggingWithin;
57
51
  };
58
- var _default = exports.default = useIsDraggingWithin;
59
- //# sourceMappingURL=use-is-dragging-within.js.map
52
+ var use_is_dragging_within_default = useIsDraggingWithin;
53
+ //# sourceMappingURL=use-is-dragging-within.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_element","require","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAKC,UAAU,IAAM;EAC7C,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEnE,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAM;MAAEC;IAAc,CAAC,GAAGL,UAAU,CAACM,OAAO;IAE5C,SAASC,eAAeA,CAAEC,KAAK,EAAG;MACjC;MACAC,eAAe,CAAED,KAAM,CAAC;IACzB;;IAEA;IACA,SAASE,aAAaA,CAAA,EAAG;MACxBR,mBAAmB,CAAE,KAAM,CAAC;IAC7B;IAEA,SAASO,eAAeA,CAAED,KAAK,EAAG;MACjC;MACA,IAAKR,UAAU,CAACM,OAAO,CAACK,QAAQ,CAAEH,KAAK,CAACI,MAAO,CAAC,EAAG;QAClDV,mBAAmB,CAAE,IAAK,CAAC;MAC5B,CAAC,MAAM;QACNA,mBAAmB,CAAE,KAAM,CAAC;MAC7B;IACD;;IAEA;IACA;IACAG,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,OAAOR,gBAAgB;AACxB,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEalB,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": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAoC;AAWpC,MAAM,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,54 +1,51 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.settings = exports.name = exports.metadata = void 0;
8
- var _i18n = require("@wordpress/i18n");
9
- var _edit = _interopRequireDefault(require("./edit"));
10
- /**
11
- * WordPress dependencies
12
- */
13
- /**
14
- * Internal dependencies
15
- */
16
- const metadata = exports.metadata = {
17
- $schema: "https://schemas.wp.org/trunk/block.json",
18
- apiVersion: 3,
19
- name: "core/widget-area",
20
- title: "Widget Area",
21
- category: "widgets",
22
- attributes: {
23
- id: {
24
- type: "string"
25
- },
26
- name: {
27
- type: "string"
28
- }
29
- },
30
- supports: {
31
- html: false,
32
- inserter: false,
33
- customClassName: false,
34
- reusable: false,
35
- __experimentalToolbar: false,
36
- __experimentalParentSelector: false,
37
- __experimentalDisableBlockOverlay: true
38
- },
39
- editorStyle: "wp-block-widget-area-editor",
40
- style: "wp-block-widget-area"
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ 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
+ 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;
41
18
  };
42
- const {
43
- name
44
- } = metadata;
45
- exports.name = name;
46
- const settings = exports.settings = {
47
- title: (0, _i18n.__)('Widget Area'),
48
- description: (0, _i18n.__)('A widget area container.'),
49
- __experimentalLabel: ({
50
- name: label
51
- }) => label,
52
- edit: _edit.default
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
+ var widget_area_exports = {};
29
+ __export(widget_area_exports, {
30
+ metadata: () => import_block.default,
31
+ name: () => name,
32
+ settings: () => settings
33
+ });
34
+ module.exports = __toCommonJS(widget_area_exports);
35
+ var import_i18n = require("@wordpress/i18n");
36
+ var import_block = __toESM(require("./block.json"));
37
+ var import_edit = __toESM(require("./edit"));
38
+ const { name } = import_block.default;
39
+ const settings = {
40
+ title: (0, import_i18n.__)("Widget Area"),
41
+ description: (0, import_i18n.__)("A widget area container."),
42
+ __experimentalLabel: ({ name: label }) => label,
43
+ edit: import_edit.default
53
44
  };
54
- //# sourceMappingURL=index.js.map
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ metadata,
48
+ name,
49
+ settings
50
+ });
51
+ //# sourceMappingURL=index.js.map