@wordpress/edit-widgets 7.0.0 → 7.1.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.
- package/build/blocks/widget-area/edit/index.cjs +106 -116
- package/build/blocks/widget-area/edit/index.cjs.map +1 -7
- package/build/blocks/widget-area/edit/inner-blocks.cjs +44 -62
- package/build/blocks/widget-area/edit/inner-blocks.cjs.map +1 -7
- package/build/blocks/widget-area/edit/use-is-dragging-within.cjs +41 -53
- package/build/blocks/widget-area/edit/use-is-dragging-within.cjs.map +1 -7
- package/build/blocks/widget-area/index.cjs +40 -44
- package/build/blocks/widget-area/index.cjs.map +1 -7
- package/build/components/error-boundary/index.cjs +115 -155
- package/build/components/error-boundary/index.cjs.map +1 -7
- package/build/components/header/document-tools/index.cjs +80 -115
- package/build/components/header/document-tools/index.cjs.map +1 -7
- package/build/components/header/index.cjs +72 -80
- package/build/components/header/index.cjs.map +1 -7
- package/build/components/header/undo-redo/redo.cjs +30 -52
- package/build/components/header/undo-redo/redo.cjs.map +1 -7
- package/build/components/header/undo-redo/undo.cjs +29 -51
- package/build/components/header/undo-redo/undo.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
- package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/index.cjs +94 -161
- package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +37 -75
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcuts/index.cjs +107 -140
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
- package/build/components/layout/index.cjs +65 -74
- package/build/components/layout/index.cjs.map +1 -7
- package/build/components/layout/interface.cjs +82 -108
- package/build/components/layout/interface.cjs.map +1 -7
- package/build/components/layout/unsaved-changes-warning.cjs +44 -48
- package/build/components/layout/unsaved-changes-warning.cjs.map +1 -7
- package/build/components/more-menu/index.cjs +125 -191
- package/build/components/more-menu/index.cjs.map +1 -7
- package/build/components/more-menu/tools-more-menu-group.cjs +9 -29
- package/build/components/more-menu/tools-more-menu-group.cjs.map +1 -7
- package/build/components/notices/index.cjs +19 -39
- package/build/components/notices/index.cjs.map +1 -7
- package/build/components/save-button/index.cjs +31 -58
- package/build/components/save-button/index.cjs.map +1 -7
- package/build/components/secondary-sidebar/index.cjs +38 -45
- package/build/components/secondary-sidebar/index.cjs.map +1 -7
- package/build/components/secondary-sidebar/inserter-sidebar.cjs +50 -51
- package/build/components/secondary-sidebar/inserter-sidebar.cjs.map +1 -7
- package/build/components/secondary-sidebar/list-view-sidebar.cjs +51 -82
- package/build/components/secondary-sidebar/list-view-sidebar.cjs.map +1 -7
- package/build/components/sidebar/index.cjs +117 -180
- package/build/components/sidebar/index.cjs.map +1 -7
- package/build/components/sidebar/widget-areas.cjs +43 -85
- package/build/components/sidebar/widget-areas.cjs.map +1 -7
- package/build/components/welcome-guide/index.cjs +110 -186
- package/build/components/welcome-guide/index.cjs.map +1 -7
- package/build/components/widget-areas-block-editor-content/index.cjs +59 -64
- package/build/components/widget-areas-block-editor-content/index.cjs.map +1 -7
- package/build/components/widget-areas-block-editor-provider/index.cjs +105 -140
- package/build/components/widget-areas-block-editor-provider/index.cjs.map +1 -7
- package/build/constants.cjs +11 -32
- package/build/constants.cjs.map +1 -7
- package/build/filters/index.cjs +7 -4
- package/build/filters/move-to-widget-area.cjs +38 -53
- package/build/filters/move-to-widget-area.cjs.map +1 -7
- package/build/filters/replace-media-upload.cjs +11 -9
- package/build/filters/replace-media-upload.cjs.map +1 -7
- package/build/hooks/use-last-selected-widget-area.cjs +28 -49
- package/build/hooks/use-last-selected-widget-area.cjs.map +1 -7
- package/build/hooks/use-widget-library-insertion-point.cjs +33 -67
- package/build/hooks/use-widget-library-insertion-point.cjs.map +1 -7
- package/build/index.cjs +96 -97
- package/build/index.cjs.map +1 -7
- package/build/lock-unlock.cjs +10 -35
- package/build/lock-unlock.cjs.map +1 -7
- package/build/store/actions.cjs +269 -278
- package/build/store/actions.cjs.map +1 -7
- package/build/store/constants.cjs +12 -29
- package/build/store/constants.cjs.map +1 -7
- package/build/store/index.cjs +61 -52
- package/build/store/index.cjs.map +1 -7
- package/build/store/private-selectors.cjs +11 -32
- package/build/store/private-selectors.cjs.map +1 -7
- package/build/store/reducer.cjs +107 -88
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/resolvers.cjs +60 -91
- package/build/store/resolvers.cjs.map +1 -7
- package/build/store/selectors.cjs +196 -229
- package/build/store/selectors.cjs.map +1 -7
- package/build/store/transformers.cjs +51 -82
- package/build/store/transformers.cjs.map +1 -7
- package/build/store/utils.cjs +76 -63
- package/build/store/utils.cjs.map +1 -7
- package/build-module/blocks/widget-area/edit/index.mjs +82 -94
- package/build-module/blocks/widget-area/edit/index.mjs.map +1 -7
- package/build-module/blocks/widget-area/edit/inner-blocks.mjs +19 -35
- package/build-module/blocks/widget-area/edit/inner-blocks.mjs.map +1 -7
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs +36 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs.map +1 -7
- package/build-module/blocks/widget-area/index.mjs +12 -15
- package/build-module/blocks/widget-area/index.mjs.map +1 -7
- package/build-module/components/error-boundary/index.mjs +103 -128
- package/build-module/components/error-boundary/index.mjs.map +1 -7
- package/build-module/components/header/document-tools/index.mjs +51 -84
- package/build-module/components/header/document-tools/index.mjs.map +1 -7
- package/build-module/components/header/index.mjs +40 -47
- package/build-module/components/header/index.mjs.map +1 -7
- package/build-module/components/header/undo-redo/redo.mjs +20 -27
- package/build-module/components/header/undo-redo/redo.mjs.map +1 -7
- package/build-module/components/header/undo-redo/undo.mjs +19 -26
- package/build-module/components/header/undo-redo/undo.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs +67 -136
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +31 -54
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcuts/index.mjs +99 -119
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
- package/build-module/components/layout/index.mjs +29 -40
- package/build-module/components/layout/index.mjs.map +1 -7
- package/build-module/components/layout/interface.mjs +53 -82
- package/build-module/components/layout/interface.mjs.map +1 -7
- package/build-module/components/layout/unsaved-changes-warning.mjs +37 -26
- package/build-module/components/layout/unsaved-changes-warning.mjs.map +1 -7
- package/build-module/components/more-menu/index.mjs +95 -162
- package/build-module/components/more-menu/index.mjs.map +1 -7
- package/build-module/components/more-menu/tools-more-menu-group.mjs +5 -9
- package/build-module/components/more-menu/tools-more-menu-group.mjs.map +1 -7
- package/build-module/components/notices/index.mjs +12 -17
- package/build-module/components/notices/index.mjs.map +1 -7
- package/build-module/components/save-button/index.mjs +23 -35
- package/build-module/components/save-button/index.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/index.mjs +15 -20
- package/build-module/components/secondary-sidebar/index.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/inserter-sidebar.mjs +27 -25
- package/build-module/components/secondary-sidebar/inserter-sidebar.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/list-view-sidebar.mjs +39 -55
- package/build-module/components/secondary-sidebar/list-view-sidebar.mjs.map +1 -7
- package/build-module/components/sidebar/index.mjs +96 -162
- package/build-module/components/sidebar/index.mjs.map +1 -7
- package/build-module/components/sidebar/widget-areas.mjs +30 -57
- package/build-module/components/sidebar/widget-areas.mjs.map +1 -7
- package/build-module/components/welcome-guide/index.mjs +103 -164
- package/build-module/components/welcome-guide/index.mjs.map +1 -7
- package/build-module/components/widget-areas-block-editor-content/index.mjs +34 -44
- package/build-module/components/widget-areas-block-editor-content/index.mjs.map +1 -7
- package/build-module/components/widget-areas-block-editor-provider/index.mjs +76 -109
- package/build-module/components/widget-areas-block-editor-provider/index.mjs.map +1 -7
- package/build-module/constants.mjs +5 -7
- package/build-module/constants.mjs.map +1 -7
- package/build-module/filters/index.mjs +0 -2
- package/build-module/filters/move-to-widget-area.mjs +28 -48
- package/build-module/filters/move-to-widget-area.mjs.map +1 -7
- package/build-module/filters/replace-media-upload.mjs +5 -8
- package/build-module/filters/replace-media-upload.mjs.map +1 -7
- package/build-module/hooks/use-last-selected-widget-area.mjs +23 -29
- package/build-module/hooks/use-last-selected-widget-area.mjs.map +1 -7
- package/build-module/hooks/use-widget-library-insertion-point.mjs +28 -47
- package/build-module/hooks/use-widget-library-insertion-point.mjs.map +1 -7
- package/build-module/index.mjs +62 -79
- package/build-module/index.mjs.map +1 -7
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/store/actions.mjs +250 -247
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/constants.mjs +7 -5
- package/build-module/store/constants.mjs.map +1 -7
- package/build-module/store/index.mjs +18 -16
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/private-selectors.mjs +5 -7
- package/build-module/store/private-selectors.mjs.map +1 -7
- package/build-module/store/reducer.mjs +95 -58
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/resolvers.mjs +52 -71
- package/build-module/store/resolvers.mjs.map +1 -7
- package/build-module/store/selectors.mjs +178 -199
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/store/transformers.mjs +44 -56
- package/build-module/store/transformers.mjs.map +1 -7
- package/build-module/store/utils.mjs +64 -32
- package/build-module/store/utils.mjs.map +1 -7
- package/package.json +33 -33
- package/src/components/header/index.jsx +2 -2
- package/src/components/sidebar/index.jsx +18 -18
- package/src/components/welcome-guide/index.jsx +4 -2
- package/build/filters/index.cjs.map +0 -7
- 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
55
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
Object.defineProperty(exports, "metadata", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function() {
|
|
45
|
+
return __block_json.default;
|
|
46
|
+
}
|
|
54
47
|
});
|
|
55
|
-
|
|
48
|
+
exports.name = name;
|
|
49
|
+
exports.settings = settings;
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=index.cjs.map
|