@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,146 +1,113 @@
|
|
|
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/keyboard-shortcuts/index.js
|
|
20
|
-
var keyboard_shortcuts_exports = {};
|
|
21
|
-
__export(keyboard_shortcuts_exports, {
|
|
22
|
-
default: () => keyboard_shortcuts_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
|
-
var { usesNativeUndo } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
6
|
+
let _wordpress_element = require("@wordpress/element");
|
|
7
|
+
let _wordpress_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
8
|
+
let _wordpress_keycodes = require("@wordpress/keycodes");
|
|
9
|
+
let _wordpress_data = require("@wordpress/data");
|
|
10
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
11
|
+
let _wordpress_core_data = require("@wordpress/core-data");
|
|
12
|
+
let _wordpress_block_editor = require("@wordpress/block-editor");
|
|
13
|
+
let ______store_index_js = require("../../store/index.cjs");
|
|
14
|
+
// packages/edit-widgets/src/components/keyboard-shortcuts/index.js
|
|
15
|
+
const { usesNativeUndo } = (0, require("../../lock-unlock.cjs").unlock)(_wordpress_block_editor.privateApis);
|
|
35
16
|
function KeyboardShortcuts() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
saveEditedWidgetAreas();
|
|
55
|
-
});
|
|
56
|
-
return null;
|
|
17
|
+
const { redo, undo } = (0, _wordpress_data.useDispatch)(_wordpress_core_data.store);
|
|
18
|
+
const { saveEditedWidgetAreas } = (0, _wordpress_data.useDispatch)(______store_index_js.store);
|
|
19
|
+
(0, _wordpress_keyboard_shortcuts.useShortcut)("core/edit-widgets/undo", (event) => {
|
|
20
|
+
if (usesNativeUndo(event)) return;
|
|
21
|
+
undo();
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
});
|
|
24
|
+
(0, _wordpress_keyboard_shortcuts.useShortcut)("core/edit-widgets/redo", (event) => {
|
|
25
|
+
if (usesNativeUndo(event)) return;
|
|
26
|
+
redo();
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
});
|
|
29
|
+
(0, _wordpress_keyboard_shortcuts.useShortcut)("core/edit-widgets/save", (event) => {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
saveEditedWidgetAreas();
|
|
32
|
+
});
|
|
33
|
+
return null;
|
|
57
34
|
}
|
|
58
35
|
function KeyboardShortcutsRegister() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
modifier: "access",
|
|
133
|
-
character: "p"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
modifier: "ctrlShift",
|
|
137
|
-
character: "~"
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
});
|
|
141
|
-
}, [registerShortcut]);
|
|
142
|
-
return null;
|
|
36
|
+
const { registerShortcut } = (0, _wordpress_data.useDispatch)(_wordpress_keyboard_shortcuts.store);
|
|
37
|
+
(0, _wordpress_element.useEffect)(() => {
|
|
38
|
+
registerShortcut({
|
|
39
|
+
name: "core/edit-widgets/undo",
|
|
40
|
+
category: "global",
|
|
41
|
+
description: (0, _wordpress_i18n.__)("Undo your last changes."),
|
|
42
|
+
keyCombination: {
|
|
43
|
+
modifier: "primary",
|
|
44
|
+
character: "z"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
registerShortcut({
|
|
48
|
+
name: "core/edit-widgets/redo",
|
|
49
|
+
category: "global",
|
|
50
|
+
description: (0, _wordpress_i18n.__)("Redo your last undo."),
|
|
51
|
+
keyCombination: {
|
|
52
|
+
modifier: "primaryShift",
|
|
53
|
+
character: "z"
|
|
54
|
+
},
|
|
55
|
+
aliases: (0, _wordpress_keycodes.isAppleOS)() ? [] : [{
|
|
56
|
+
modifier: "primary",
|
|
57
|
+
character: "y"
|
|
58
|
+
}]
|
|
59
|
+
});
|
|
60
|
+
registerShortcut({
|
|
61
|
+
name: "core/edit-widgets/save",
|
|
62
|
+
category: "global",
|
|
63
|
+
description: (0, _wordpress_i18n.__)("Save your changes."),
|
|
64
|
+
keyCombination: {
|
|
65
|
+
modifier: "primary",
|
|
66
|
+
character: "s"
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
registerShortcut({
|
|
70
|
+
name: "core/edit-widgets/keyboard-shortcuts",
|
|
71
|
+
category: "main",
|
|
72
|
+
description: (0, _wordpress_i18n.__)("Display these keyboard shortcuts."),
|
|
73
|
+
keyCombination: {
|
|
74
|
+
modifier: "access",
|
|
75
|
+
character: "h"
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
registerShortcut({
|
|
79
|
+
name: "core/edit-widgets/next-region",
|
|
80
|
+
category: "global",
|
|
81
|
+
description: (0, _wordpress_i18n.__)("Navigate to the next part of the editor."),
|
|
82
|
+
keyCombination: {
|
|
83
|
+
modifier: "ctrl",
|
|
84
|
+
character: "`"
|
|
85
|
+
},
|
|
86
|
+
aliases: [{
|
|
87
|
+
modifier: "access",
|
|
88
|
+
character: "n"
|
|
89
|
+
}]
|
|
90
|
+
});
|
|
91
|
+
registerShortcut({
|
|
92
|
+
name: "core/edit-widgets/previous-region",
|
|
93
|
+
category: "global",
|
|
94
|
+
description: (0, _wordpress_i18n.__)("Navigate to the previous part of the editor."),
|
|
95
|
+
keyCombination: {
|
|
96
|
+
modifier: "ctrlShift",
|
|
97
|
+
character: "`"
|
|
98
|
+
},
|
|
99
|
+
aliases: [{
|
|
100
|
+
modifier: "access",
|
|
101
|
+
character: "p"
|
|
102
|
+
}, {
|
|
103
|
+
modifier: "ctrlShift",
|
|
104
|
+
character: "~"
|
|
105
|
+
}]
|
|
106
|
+
});
|
|
107
|
+
}, [registerShortcut]);
|
|
108
|
+
return null;
|
|
143
109
|
}
|
|
144
110
|
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
|
|
145
|
-
|
|
146
|
-
|
|
111
|
+
exports.default = KeyboardShortcuts;
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/keyboard-shortcuts/index.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,gCAGO;AACP,sBAA0B;AAC1B,kBAA4B;AAC5B,kBAAmB;AACnB,uBAAmC;AACnC,0BAAsD;AACtD,mBAA0C;AAC1C,yBAAuB;AAEvB,IAAM,EAAE,eAAe,QAAI,2BAAQ,oBAAAA,WAAuB;AAE1D,SAAS,oBAAoB;AAC5B,QAAM,EAAE,MAAM,KAAK,QAAI,yBAAa,iBAAAC,KAAU;AAC9C,QAAM,EAAE,sBAAsB,QAAI,yBAAa,aAAAC,KAAiB;AAEhE,6CAAa,0BAA0B,CAAE,UAAW;AACnD,QAAK,eAAgB,KAAM,GAAI;AAC9B;AAAA,IACD;AACA,SAAK;AACL,UAAM,eAAe;AAAA,EACtB,CAAE;AAEF,6CAAa,0BAA0B,CAAE,UAAW;AACnD,QAAK,eAAgB,KAAM,GAAI;AAC9B;AAAA,IACD;AACA,SAAK;AACL,UAAM,eAAe;AAAA,EACtB,CAAE;AAEF,6CAAa,0BAA0B,CAAE,UAAW;AACnD,UAAM,eAAe;AACrB,0BAAsB;AAAA,EACvB,CAAE;AAEF,SAAO;AACR;AAEA,SAAS,4BAA4B;AAEpC,QAAM,EAAE,iBAAiB,QAAI,yBAAa,0BAAAC,KAAuB;AACjE,gCAAW,MAAM;AAChB,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,yBAA0B;AAAA,MAC3C,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,sBAAuB;AAAA,MACxC,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,aAAS,2BAAU,IAChB,CAAC,IACD;AAAA,QACA;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACH,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,oBAAqB;AAAA,MACtC,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,mCAAoC;AAAA,MACrD,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,0CAA2C;AAAA,MAC5D,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,8CAA+C;AAAA,MAChE,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,QACA;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAE,gBAAiB,CAAE;AAExB,SAAO;AACR;AAEA,kBAAkB,WAAW;AAC7B,IAAO,6BAAQ;",
|
|
6
|
-
"names": ["blockEditorPrivateApis", "coreStore", "editWidgetsStore", "keyboardShortcutsStore"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["unlock","blockEditorPrivateApis","useDispatch","coreStore","editWidgetsStore","keyboardShortcutsStore","__","isAppleOS"],"sources":["../../../src/components/keyboard-shortcuts/index.js"],"sourcesContent":["import { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,EAAE,oBAAA,G,+BAAmBA,CAAAA,CAAAA,OAAAA,CAAQC,wBAAAA,WAAuB;AAE1D,SAAS,oBAAoB;CAC5B,MAAM,EAAE,MAAM,UAAA,GAASC,gBAAAA,YAAAA,CAAaC,qBAAAA,KAAU;CAC9C,MAAM,EAAE,2BAAA,GAA0BD,gBAAAA,YAAAA,CAAaE,qBAAAA,KAAiB;CAEhE,CAAA,GAAA,8BAAA,YAAA,CAAa,2BAA4B,UAAW;EACnD,IAAK,eAAgB,KAAM,GAC1B;EAED,KAAK;EACL,MAAM,eAAe;CACtB,CAAE;CAEF,CAAA,GAAA,8BAAA,YAAA,CAAa,2BAA4B,UAAW;EACnD,IAAK,eAAgB,KAAM,GAC1B;EAED,KAAK;EACL,MAAM,eAAe;CACtB,CAAE;CAEF,CAAA,GAAA,8BAAA,YAAA,CAAa,2BAA4B,UAAW;EACnD,MAAM,eAAe;EACrB,sBAAsB;CACvB,CAAE;CAEF,OAAO;AACR;AAEA,SAAS,4BAA4B;CAEpC,MAAM,EAAE,sBAAA,GAAqBF,gBAAAA,YAAAA,CAAaG,8BAAAA,KAAuB;CACjE,CAAA,GAAA,mBAAA,UAAA,OAAiB;EAChB,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaC,gBAAAA,GAAAA,CAAI,yBAA0B;GAC3C,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;EACD,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaA,gBAAAA,GAAAA,CAAI,sBAAuB;GACxC,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;GAKA,UAAA,GAASC,oBAAAA,UAAAA,CAAU,IAChB,CAAC,IACD,CACA;IACC,UAAU;IACV,WAAW;GACZ,CACD;EACH,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaD,gBAAAA,GAAAA,CAAI,oBAAqB;GACtC,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;EACD,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaA,gBAAAA,GAAAA,CAAI,mCAAoC;GACrD,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;EACD,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaA,gBAAAA,GAAAA,CAAI,0CAA2C;GAC5D,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;GACA,SAAS,CACR;IACC,UAAU;IACV,WAAW;GACZ,CACD;EACD,CAAE;EAEF,iBAAkB;GACjB,MAAM;GACN,UAAU;GACV,cAAA,GAAaA,gBAAAA,GAAAA,CAAI,8CAA+C;GAChE,gBAAgB;IACf,UAAU;IACV,WAAW;GACZ;GACA,SAAS,CACR;IACC,UAAU;IACV,WAAW;GACZ,GACA;IACC,UAAU;IACV,WAAW;GACZ,CACD;EACD,CAAE;CACH,GAAG,CAAE,gBAAiB,CAAE;CAExB,OAAO;AACR;AAEA,kBAAkB,WAAW"}
|
|
@@ -1,85 +1,76 @@
|
|
|
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_admin_ui = require("@wordpress/admin-ui");
|
|
28
|
+
let _wordpress_i18n = require("@wordpress/i18n");
|
|
29
|
+
let _wordpress_element = require("@wordpress/element");
|
|
30
|
+
let _wordpress_data = require("@wordpress/data");
|
|
31
|
+
let _wordpress_plugins = require("@wordpress/plugins");
|
|
32
|
+
let _wordpress_notices = require("@wordpress/notices");
|
|
33
|
+
let _wordpress_components = require("@wordpress/components");
|
|
34
|
+
let _wordpress_theme = require("@wordpress/theme");
|
|
35
|
+
let ___error_boundary_index_jsx = require("../error-boundary/index.cjs");
|
|
36
|
+
___error_boundary_index_jsx = __toESM(___error_boundary_index_jsx);
|
|
37
|
+
let ___widget_areas_block_editor_provider_index_jsx = require("../widget-areas-block-editor-provider/index.cjs");
|
|
38
|
+
___widget_areas_block_editor_provider_index_jsx = __toESM(___widget_areas_block_editor_provider_index_jsx);
|
|
39
|
+
let ___sidebar_index_jsx = require("../sidebar/index.cjs");
|
|
40
|
+
___sidebar_index_jsx = __toESM(___sidebar_index_jsx);
|
|
41
|
+
let __interface_jsx = require("./interface.cjs");
|
|
42
|
+
__interface_jsx = __toESM(__interface_jsx);
|
|
43
|
+
let __unsaved_changes_warning_js = require("./unsaved-changes-warning.cjs");
|
|
44
|
+
__unsaved_changes_warning_js = __toESM(__unsaved_changes_warning_js);
|
|
45
|
+
let ___welcome_guide_index_jsx = require("../welcome-guide/index.cjs");
|
|
46
|
+
___welcome_guide_index_jsx = __toESM(___welcome_guide_index_jsx);
|
|
47
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
48
|
// packages/edit-widgets/src/components/layout/index.jsx
|
|
30
|
-
var layout_exports = {};
|
|
31
|
-
__export(layout_exports, {
|
|
32
|
-
default: () => layout_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(layout_exports);
|
|
35
|
-
var import_admin_ui = require("@wordpress/admin-ui");
|
|
36
|
-
var import_i18n = require("@wordpress/i18n");
|
|
37
|
-
var import_element = require("@wordpress/element");
|
|
38
|
-
var import_data = require("@wordpress/data");
|
|
39
|
-
var import_plugins = require("@wordpress/plugins");
|
|
40
|
-
var import_notices = require("@wordpress/notices");
|
|
41
|
-
var import_components = require("@wordpress/components");
|
|
42
|
-
var import_theme = require("@wordpress/theme");
|
|
43
|
-
var import_error_boundary = __toESM(require("../error-boundary/index.cjs"));
|
|
44
|
-
var import_widget_areas_block_editor_provider = __toESM(require("../widget-areas-block-editor-provider/index.cjs"));
|
|
45
|
-
var import_sidebar = __toESM(require("../sidebar/index.cjs"));
|
|
46
|
-
var import_interface = __toESM(require("./interface.cjs"));
|
|
47
|
-
var import_unsaved_changes_warning = __toESM(require("./unsaved-changes-warning.cjs"));
|
|
48
|
-
var import_welcome_guide = __toESM(require("../welcome-guide/index.cjs"));
|
|
49
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
49
|
function Layout({ blockEditorSettings }) {
|
|
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
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.default, {}),
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_unsaved_changes_warning.default, {}),
|
|
79
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_welcome_guide.default, {})
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
) }) }) });
|
|
50
|
+
const { createErrorNotice } = (0, _wordpress_data.useDispatch)(_wordpress_notices.store);
|
|
51
|
+
function onPluginAreaError(name) {
|
|
52
|
+
createErrorNotice((0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("The \"%s\" plugin has encountered an error and cannot be rendered."), name));
|
|
53
|
+
}
|
|
54
|
+
const navigateRegionsProps = (0, _wordpress_components.__unstableUseNavigateRegions)();
|
|
55
|
+
const adminPrimary = (0, _wordpress_element.useMemo)(() => (0, _wordpress_admin_ui.getAdminThemeColors)().primary, []);
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_theme.ThemeProvider, {
|
|
57
|
+
isRoot: true,
|
|
58
|
+
color: { primary: adminPrimary },
|
|
59
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___error_boundary_index_jsx.default, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
60
|
+
...navigateRegionsProps,
|
|
61
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(___widget_areas_block_editor_provider_index_jsx.default, {
|
|
62
|
+
blockEditorSettings,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__interface_jsx.default, { blockEditorSettings }),
|
|
65
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___sidebar_index_jsx.default, {}),
|
|
66
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_plugins.PluginArea, { onError: onPluginAreaError }),
|
|
67
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__unsaved_changes_warning_js.default, {}),
|
|
68
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___welcome_guide_index_jsx.default, {})
|
|
69
|
+
]
|
|
70
|
+
})
|
|
71
|
+
}) })
|
|
72
|
+
});
|
|
83
73
|
}
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
exports.default = Layout;
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/layout/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { getAdminThemeColors } from '@wordpress/admin-ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { ThemeProvider } from '@wordpress/theme';\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst adminPrimary = useMemo( () => getAdminThemeColors().primary, [] );\n\n\treturn (\n\t\t<ThemeProvider isRoot color={ { primary: adminPrimary } }>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Interface\n\t\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</ThemeProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoC;AACpC,kBAA4B;AAC5B,qBAAwB;AACxB,kBAA4B;AAC5B,qBAA2B;AAC3B,qBAAsC;AACtC,wBAAmE;AACnE,mBAA8B;AAC9B,4BAA0B;AAC1B,gDAA2C;AAC3C,qBAAoB;AACpB,uBAAsB;AACtB,qCAAkC;AAClC,2BAAyB;AAwBpB;AAtBL,SAAS,OAAQ,EAAE,oBAAoB,GAAI;AAC1C,QAAM,EAAE,kBAAkB,QAAI,yBAAa,eAAAA,KAAa;AAExD,WAAS,kBAAmB,MAAO;AAClC;AAAA,UACC;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,2BAAuB,kBAAAC,8BAAmB;AAChD,QAAM,mBAAe,wBAAS,UAAM,qCAAoB,EAAE,SAAS,CAAC,CAAE;AAEtE,SACC,4CAAC,8BAAc,QAAM,MAAC,OAAQ,EAAE,SAAS,aAAa,GACrD,sDAAC,sBAAAC,SAAA,EACA,sDAAC,SAAM,GAAG,sBACT;AAAA,IAAC,0CAAAC;AAAA,IAAA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC,iBAAAC;AAAA,UAAA;AAAA,YACA;AAAA;AAAA,QACD;AAAA,QACA,4CAAC,eAAAC,SAAA,EAAQ;AAAA,QACT,4CAAC,6BAAW,SAAU,mBAAoB;AAAA,QAC1C,4CAAC,+BAAAC,SAAA,EAAsB;AAAA,QACvB,4CAAC,qBAAAC,SAAA,EAAa;AAAA;AAAA;AAAA,EACf,GACD,GACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
|
-
"names": ["noticesStore", "useNavigateRegions", "ErrorBoundary", "WidgetAreasBlockEditorProvider", "Interface", "Sidebar", "UnsavedChangesWarning", "WelcomeGuide"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useDispatch","noticesStore","sprintf","__","useNavigateRegions","useMemo","getAdminThemeColors","ThemeProvider","ErrorBoundary","WidgetAreasBlockEditorProvider","Interface","Sidebar","PluginArea","UnsavedChangesWarning","WelcomeGuide"],"sources":["../../../src/components/layout/index.jsx"],"sourcesContent":["import { getAdminThemeColors } from '@wordpress/admin-ui';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\nimport { ThemeProvider } from '@wordpress/theme';\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst adminPrimary = useMemo( () => getAdminThemeColors().primary, [] );\n\n\treturn (\n\t\t<ThemeProvider isRoot color={ { primary: adminPrimary } }>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Interface\n\t\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</ThemeProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,OAAQ,EAAE,uBAAwB;CAC1C,MAAM,EAAE,uBAAA,GAAsBA,gBAAAA,YAAAA,CAAaC,mBAAAA,KAAa;CAExD,SAAS,kBAAmB,MAAO;EAClC,mBAAA,GACCC,gBAAAA,QAAAA,EAAAA,GAECC,gBAAAA,GAAAA,CACC,oEACD,GACA,IACD,CACD;CACD;CAEA,MAAM,wBAAA,GAAuBC,sBAAAA,6BAAAA,CAAmB;CAChD,MAAM,gBAAA,GAAeC,mBAAAA,QAAAA,QAAAA,GAAeC,oBAAAA,oBAAAA,CAAoB,CAAC,CAAC,SAAS,CAAC,CAAE;CAEtE,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,eAAD;EAAe,QAAA;EAAO,OAAQ,EAAE,SAAS,aAAa;EACrD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAAA,SAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,GAAK;GACT,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gDAAAA,SAAD;IACuB;IADvB,UAAA;KAGC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,SAAD,EACuB,oBACtB,CAAA;KACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD,CAAU,CAAA;KACV,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD,EAAY,SAAU,kBAAqB,CAAA;KAC3C,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,SAAD,CAAwB,CAAA;KACxB,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAe,CAAA;IACgB;;EAC5B,CAAA,EACS,CAAA;CACD,CAAA;AAEjB"}
|