@wordpress/edit-widgets 7.0.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +77 -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 +38 -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 +41 -48
- package/build/components/layout/unsaved-changes-warning.cjs.map +1 -7
- package/build/components/more-menu/index.cjs +124 -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 +276 -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 +104 -129
- 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 +44 -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 +32 -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 +35 -27
- package/build-module/components/layout/unsaved-changes-warning.mjs.map +1 -7
- package/build-module/components/more-menu/index.mjs +94 -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 +257 -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/build-style/style-rtl.css +32 -11
- package/build-style/style.css +32 -11
- package/package.json +33 -33
- package/src/components/error-boundary/index.jsx +2 -2
- package/src/components/header/index.jsx +13 -4
- package/src/components/header/style.scss +30 -3
- package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +1 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +1 -1
- package/src/components/layout/style.scss +5 -9
- package/src/components/layout/unsaved-changes-warning.js +4 -9
- package/src/components/more-menu/index.jsx +0 -1
- package/src/components/sidebar/index.jsx +18 -18
- package/src/components/welcome-guide/index.jsx +4 -2
- package/src/store/actions.js +25 -2
- package/src/store/test/actions.jsdom.test.js +230 -0
- package/build/filters/index.cjs.map +0 -7
- package/build-module/filters/index.mjs.map +0 -7
|
@@ -1,56 +1,49 @@
|
|
|
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_data = require("@wordpress/data");
|
|
28
|
+
let ______store_index_js = require("../../store/index.cjs");
|
|
29
|
+
let __inserter_sidebar_jsx = require("./inserter-sidebar.cjs");
|
|
30
|
+
__inserter_sidebar_jsx = __toESM(__inserter_sidebar_jsx);
|
|
31
|
+
let __list_view_sidebar_jsx = require("./list-view-sidebar.cjs");
|
|
32
|
+
__list_view_sidebar_jsx = __toESM(__list_view_sidebar_jsx);
|
|
33
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
34
|
// packages/edit-widgets/src/components/secondary-sidebar/index.jsx
|
|
30
|
-
var secondary_sidebar_exports = {};
|
|
31
|
-
__export(secondary_sidebar_exports, {
|
|
32
|
-
default: () => SecondarySidebar
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(secondary_sidebar_exports);
|
|
35
|
-
var import_data = require("@wordpress/data");
|
|
36
|
-
var import_store = require("../../store/index.cjs");
|
|
37
|
-
var import_inserter_sidebar = __toESM(require("./inserter-sidebar.cjs"));
|
|
38
|
-
var import_list_view_sidebar = __toESM(require("./list-view-sidebar.cjs"));
|
|
39
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
35
|
function SecondarySidebar() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (isListViewOpen) {
|
|
52
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_list_view_sidebar.default, {});
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
36
|
+
const { isInserterOpen, isListViewOpen } = (0, _wordpress_data.useSelect)((select) => {
|
|
37
|
+
const { isInserterOpened, isListViewOpened } = select(______store_index_js.store);
|
|
38
|
+
return {
|
|
39
|
+
isInserterOpen: isInserterOpened(),
|
|
40
|
+
isListViewOpen: isListViewOpened()
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
if (isInserterOpen) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__inserter_sidebar_jsx.default, {});
|
|
44
|
+
if (isListViewOpen) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__list_view_sidebar_jsx.default, {});
|
|
45
|
+
return null;
|
|
55
46
|
}
|
|
56
|
-
|
|
47
|
+
exports.default = SecondarySidebar;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/secondary-sidebar/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useSelect } from '@wordpress/data';\nimport { store as editWidgetsStore } from '../../store';\nimport InserterSidebar from './inserter-sidebar';\nimport ListViewSidebar from './list-view-sidebar';\n\nexport default function SecondarySidebar() {\n\tconst { isInserterOpen, isListViewOpen } = useSelect( ( select ) => {\n\t\tconst { isInserterOpened, isListViewOpened } =\n\t\t\tselect( editWidgetsStore );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t};\n\t}, [] );\n\n\tif ( isInserterOpen ) {\n\t\treturn <InserterSidebar />;\n\t}\n\tif ( isListViewOpen ) {\n\t\treturn <ListViewSidebar />;\n\t}\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,mBAA0C;AAC1C,8BAA4B;AAC5B,+BAA4B;AAanB;AAXM,SAAR,mBAAoC;AAC1C,QAAM,EAAE,gBAAgB,eAAe,QAAI,uBAAW,CAAE,WAAY;AACnE,UAAM,EAAE,kBAAkB,iBAAiB,IAC1C,OAAQ,aAAAA,KAAiB;AAC1B,WAAO;AAAA,MACN,gBAAgB,iBAAiB;AAAA,MACjC,gBAAgB,iBAAiB;AAAA,IAClC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,gBAAiB;AACrB,WAAO,4CAAC,wBAAAC,SAAA,EAAgB;AAAA,EACzB;AACA,MAAK,gBAAiB;AACrB,WAAO,4CAAC,yBAAAC,SAAA,EAAgB;AAAA,EACzB;AACA,SAAO;AACR;",
|
|
6
|
-
"names": ["editWidgetsStore", "InserterSidebar", "ListViewSidebar"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useSelect","editWidgetsStore","InserterSidebar","ListViewSidebar"],"sources":["../../../src/components/secondary-sidebar/index.jsx"],"sourcesContent":["import { useSelect } from '@wordpress/data';\nimport { store as editWidgetsStore } from '../../store';\nimport InserterSidebar from './inserter-sidebar';\nimport ListViewSidebar from './list-view-sidebar';\n\nexport default function SecondarySidebar() {\n\tconst { isInserterOpen, isListViewOpen } = useSelect( ( select ) => {\n\t\tconst { isInserterOpened, isListViewOpened } =\n\t\t\tselect( editWidgetsStore );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t};\n\t}, [] );\n\n\tif ( isInserterOpen ) {\n\t\treturn <InserterSidebar />;\n\t}\n\tif ( isListViewOpen ) {\n\t\treturn <ListViewSidebar />;\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAwB,mBAAmB;CAC1C,MAAM,EAAE,gBAAgB,oBAAA,GAAmBA,gBAAAA,UAAAA,EAAa,WAAY;EACnE,MAAM,EAAE,kBAAkB,qBACzB,OAAQC,qBAAAA,KAAiB;EAC1B,OAAO;GACN,gBAAgB,iBAAiB;GACjC,gBAAgB,iBAAiB;EAClC;CACD,GAAG,CAAC,CAAE;CAEN,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,SAAD,CAAkB,CAAA;CAE1B,IAAK,gBACJ,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAD,CAAkB,CAAA;CAE1B,OAAO;AACR"}
|
|
@@ -1,62 +1,61 @@
|
|
|
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_block_editor = require("@wordpress/block-editor");
|
|
28
|
+
let _wordpress_compose = require("@wordpress/compose");
|
|
29
|
+
let _wordpress_element = require("@wordpress/element");
|
|
30
|
+
let _wordpress_data = require("@wordpress/data");
|
|
31
|
+
let ______hooks_use_widget_library_insertion_point_js = require("../../hooks/use-widget-library-insertion-point.cjs");
|
|
32
|
+
______hooks_use_widget_library_insertion_point_js = __toESM(______hooks_use_widget_library_insertion_point_js);
|
|
33
|
+
let ______store_index_js = require("../../store/index.cjs");
|
|
34
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
35
|
// packages/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.jsx
|
|
30
|
-
var inserter_sidebar_exports = {};
|
|
31
|
-
__export(inserter_sidebar_exports, {
|
|
32
|
-
default: () => InserterSidebar
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(inserter_sidebar_exports);
|
|
35
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
36
|
-
var import_compose = require("@wordpress/compose");
|
|
37
|
-
var import_element = require("@wordpress/element");
|
|
38
|
-
var import_data = require("@wordpress/data");
|
|
39
|
-
var import_use_widget_library_insertion_point = __toESM(require("../../hooks/use-widget-library-insertion-point.cjs"));
|
|
40
|
-
var import_store = require("../../store/index.cjs");
|
|
41
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
36
|
function InserterSidebar() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
const isMobileViewport = (0, _wordpress_compose.useViewportMatch)("medium", "<");
|
|
38
|
+
const { rootClientId, insertionIndex } = (0, ______hooks_use_widget_library_insertion_point_js.default)();
|
|
39
|
+
const { setIsInserterOpened } = (0, _wordpress_data.useDispatch)(______store_index_js.store);
|
|
40
|
+
const closeInserter = (0, _wordpress_element.useCallback)(() => {
|
|
41
|
+
return setIsInserterOpened(false);
|
|
42
|
+
}, [setIsInserterOpened]);
|
|
43
|
+
const libraryRef = (0, _wordpress_element.useRef)();
|
|
44
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
|
+
className: "edit-widgets-layout__inserter-panel",
|
|
46
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47
|
+
className: "edit-widgets-layout__inserter-panel-content",
|
|
48
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.__experimentalLibrary, {
|
|
49
|
+
showInserterHelpPanel: true,
|
|
50
|
+
shouldFocusBlock: isMobileViewport,
|
|
51
|
+
rootClientId,
|
|
52
|
+
__experimentalInsertionIndex: insertionIndex,
|
|
53
|
+
ref: libraryRef,
|
|
54
|
+
onClose: closeInserter
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
61
58
|
}
|
|
62
|
-
|
|
59
|
+
exports.default = InserterSidebar;
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=inserter-sidebar.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/secondary-sidebar/inserter-sidebar.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div className=\"edit-widgets-layout__inserter-panel\">\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t\tonClose={ closeInserter }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiD;AACjD,qBAAiC;AACjC,qBAAoC;AACpC,kBAA4B;AAC5B,gDAA2C;AAC3C,mBAA0C;AAiBtC;AAfW,SAAR,kBAAmC;AACzC,QAAM,uBAAmB,iCAAkB,UAAU,GAAI;AACzD,QAAM,EAAE,cAAc,eAAe,QAAI,0CAAAA,SAA+B;AAExE,QAAM,EAAE,oBAAoB,QAAI,yBAAa,aAAAC,KAAiB;AAE9D,QAAM,oBAAgB,4BAAa,MAAM;AACxC,WAAO,oBAAqB,KAAM;AAAA,EACnC,GAAG,CAAE,mBAAoB,CAAE;AAE3B,QAAM,iBAAa,uBAAO;AAE1B,SACC,4CAAC,SAAI,WAAU,uCACd,sDAAC,SAAI,WAAU,+CACd;AAAA,IAAC,oBAAAC;AAAA,IAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,kBAAmB;AAAA,MACnB;AAAA,MACA,8BAA+B;AAAA,MAC/B,KAAM;AAAA,MACN,SAAU;AAAA;AAAA,EACX,GACD,GACD;AAEF;",
|
|
6
|
-
"names": ["useWidgetLibraryInsertionPoint", "editWidgetsStore", "Library"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"inserter-sidebar.cjs","names":["useViewportMatch","useWidgetLibraryInsertionPoint","useDispatch","editWidgetsStore","useCallback","useRef","Library"],"sources":["../../../src/components/secondary-sidebar/inserter-sidebar.jsx"],"sourcesContent":["import { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div className=\"edit-widgets-layout__inserter-panel\">\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t\tonClose={ closeInserter }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAwB,kBAAkB;CACzC,MAAM,oBAAA,GAAmBA,mBAAAA,iBAAAA,CAAkB,UAAU,GAAI;CACzD,MAAM,EAAE,cAAc,oBAAA,GAAmBC,kDAAAA,QAAAA,CAA+B;CAExE,MAAM,EAAE,yBAAA,GAAwBC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAiB;CAE9D,MAAM,iBAAA,GAAgBC,mBAAAA,YAAAA,OAAmB;EACxC,OAAO,oBAAqB,KAAM;CACnC,GAAG,CAAE,mBAAoB,CAAE;CAE3B,MAAM,cAAA,GAAaC,mBAAAA,OAAAA,CAAO;CAE1B,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,uBAAD;IACC,uBAAA;IACA,kBAAmB;IACJ;IACf,8BAA+B;IAC/B,KAAM;IACN,SAAU;GACV,CAAA;EACG,CAAA;CACD,CAAA;AAEP"}
|
|
@@ -1,85 +1,54 @@
|
|
|
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/components/secondary-sidebar/list-view-sidebar.jsx
|
|
20
|
-
var list_view_sidebar_exports = {};
|
|
21
|
-
__export(list_view_sidebar_exports, {
|
|
22
|
-
default: () => ListViewSidebar
|
|
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
|
-
|
|
6
|
+
let _wordpress_block_editor = require("@wordpress/block-editor");
|
|
7
|
+
let _wordpress_components = require("@wordpress/components");
|
|
8
|
+
let _wordpress_data = require("@wordpress/data");
|
|
9
|
+
let _wordpress_element = require("@wordpress/element");
|
|
10
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
11
|
+
let _wordpress_icons = require("@wordpress/icons");
|
|
12
|
+
let _wordpress_keycodes = require("@wordpress/keycodes");
|
|
13
|
+
let ______store_index_js = require("../../store/index.cjs");
|
|
14
|
+
let ______lock_unlock_js = require("../../lock-unlock.cjs");
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
// packages/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.jsx
|
|
35
17
|
function ListViewSidebar() {
|
|
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
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: "edit-widgets-editor__list-view-panel-content",
|
|
76
|
-
ref: setDropZoneElement,
|
|
77
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.__experimentalListView, { dropZoneElement, focusOnMount: true })
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
);
|
|
18
|
+
const { setIsListViewOpened } = (0, _wordpress_data.useDispatch)(______store_index_js.store);
|
|
19
|
+
const { getListViewToggleRef } = (0, ______lock_unlock_js.unlock)((0, _wordpress_data.useSelect)(______store_index_js.store));
|
|
20
|
+
const [dropZoneElement, setDropZoneElement] = (0, _wordpress_element.useState)(null);
|
|
21
|
+
const closeListView = (0, _wordpress_element.useCallback)(() => {
|
|
22
|
+
setIsListViewOpened(false);
|
|
23
|
+
getListViewToggleRef().current?.focus();
|
|
24
|
+
}, [getListViewToggleRef, setIsListViewOpened]);
|
|
25
|
+
const closeOnEscape = (0, _wordpress_element.useCallback)((event) => {
|
|
26
|
+
if (event.keyCode === _wordpress_keycodes.ESCAPE && !event.defaultPrevented) {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
closeListView();
|
|
29
|
+
}
|
|
30
|
+
}, [closeListView]);
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
32
|
+
className: "edit-widgets-editor__list-view-panel",
|
|
33
|
+
onKeyDown: closeOnEscape,
|
|
34
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
35
|
+
className: "edit-widgets-editor__list-view-panel-header",
|
|
36
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: (0, _wordpress_i18n.__)("List View") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Button, {
|
|
37
|
+
icon: _wordpress_icons.closeSmall,
|
|
38
|
+
label: (0, _wordpress_i18n.__)("Close"),
|
|
39
|
+
onClick: closeListView,
|
|
40
|
+
size: "compact"
|
|
41
|
+
})]
|
|
42
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
43
|
+
className: "edit-widgets-editor__list-view-panel-content",
|
|
44
|
+
ref: setDropZoneElement,
|
|
45
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.__experimentalListView, {
|
|
46
|
+
dropZoneElement,
|
|
47
|
+
focusOnMount: true
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
84
51
|
}
|
|
85
|
-
|
|
52
|
+
exports.default = ListViewSidebar;
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=list-view-sidebar.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/secondary-sidebar/list-view-sidebar.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ setDropZoneElement }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } focusOnMount />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmD;AACnD,wBAAuB;AACvB,kBAAuC;AACvC,qBAAsC;AACtC,kBAAmB;AACnB,mBAA2B;AAC3B,sBAAuB;AACvB,mBAA0C;AAC1C,yBAAuB;AAgCpB;AA9BY,SAAR,kBAAmC;AACzC,QAAM,EAAE,oBAAoB,QAAI,yBAAa,aAAAA,KAAiB;AAC9D,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,uBAAW,aAAAA,KAAiB,CAAE;AAIvE,QAAM,CAAE,iBAAiB,kBAAmB,QAAI,yBAAU,IAAK;AAG/D,QAAM,oBAAgB,4BAAa,MAAM;AACxC,wBAAqB,KAAM;AAC3B,yBAAqB,EAAE,SAAS,MAAM;AAAA,EACvC,GAAG,CAAE,sBAAsB,mBAAoB,CAAE;AAEjD,QAAM,oBAAgB;AAAA,IACrB,CAAE,UAAW;AACZ,UAAK,MAAM,YAAY,0BAAU,CAAE,MAAM,kBAAmB;AAC3D,cAAM,eAAe;AACrB,sBAAc;AAAA,MACf;AAAA,IACD;AAAA,IACA,CAAE,aAAc;AAAA,EACjB;AAEA;AAAA;AAAA,IAEC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,WAAY;AAAA,QAEZ;AAAA,uDAAC,SAAI,WAAU,+CACd;AAAA,wDAAC,YAAS,8BAAI,WAAY,GAAG;AAAA,YAC7B;AAAA,cAAC;AAAA;AAAA,gBACA,MAAO;AAAA,gBACP,WAAQ,gBAAI,OAAQ;AAAA,gBACpB,SAAU;AAAA,gBACV,MAAK;AAAA;AAAA,YACN;AAAA,aACD;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,KAAM;AAAA,cAEN,sDAAC,oBAAAC,wBAAA,EAAS,iBAAoC,cAAY,MAAC;AAAA;AAAA,UAC5D;AAAA;AAAA;AAAA,IACD;AAAA;AAEF;",
|
|
6
|
-
"names": ["editWidgetsStore", "ListView"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"list-view-sidebar.cjs","names":["useDispatch","editWidgetsStore","unlock","useSelect","useState","useCallback","ESCAPE","__","Button","closeSmall","ListView"],"sources":["../../../src/components/secondary-sidebar/list-view-sidebar.jsx"],"sourcesContent":["import { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ setDropZoneElement }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } focusOnMount />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAUA,SAAwB,kBAAkB;CACzC,MAAM,EAAE,yBAAA,GAAwBA,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAiB;CAC9D,MAAM,EAAE,0BAAA,GAAyBC,qBAAAA,OAAAA,EAAAA,GAAQC,gBAAAA,UAAAA,CAAWF,qBAAAA,KAAiB,CAAE;CAIvE,MAAM,CAAE,iBAAiB,uBAAA,GAAuBG,mBAAAA,SAAAA,CAAU,IAAK;CAG/D,MAAM,iBAAA,GAAgBC,mBAAAA,YAAAA,OAAmB;EACxC,oBAAqB,KAAM;EAC3B,qBAAqB,CAAC,CAAC,SAAS,MAAM;CACvC,GAAG,CAAE,sBAAsB,mBAAoB,CAAE;CAEjD,MAAM,iBAAA,GAAgBA,mBAAAA,YAAAA,EACnB,UAAW;EACZ,IAAK,MAAM,YAAYC,oBAAAA,UAAU,CAAE,MAAM,kBAAmB;GAC3D,MAAM,eAAe;GACrB,cAAc;EACf;CACD,GACA,CAAE,aAAc,CACjB;CAEA,OAEC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACC,WAAU;EACV,WAAY;EAFb,UAAA,CAIC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD,EAAA,WAAA,GAAUC,gBAAAA,GAAAA,CAAI,WAAY,EAAW,CAAA,GACrC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,QAAD;IACC,MAAOC,iBAAAA;IACP,QAAA,GAAQF,gBAAAA,GAAAA,CAAI,OAAQ;IACpB,SAAU;IACV,MAAK;GACL,CAAA,CACG;EACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACC,WAAU;GACV,KAAM;GAEN,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACG,wBAAAA,wBAAD;IAA4B;IAAkB,cAAA;GAAc,CAAA;EACxD,CAAA,CACD;;AAEP"}
|