@wordpress/edit-widgets 6.31.1-next.f56bd8138.0 → 6.32.1-next.47f435fc9.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/CHANGELOG.md +2 -0
- package/build/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +181 -313
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +153 -293
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1,128 +1,135 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var keyboard_shortcuts_exports = {};
|
|
19
|
+
__export(keyboard_shortcuts_exports, {
|
|
20
|
+
default: () => keyboard_shortcuts_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
+
module.exports = __toCommonJS(keyboard_shortcuts_exports);
|
|
23
|
+
var import_element = require("@wordpress/element");
|
|
24
|
+
var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
|
|
25
|
+
var import_keycodes = require("@wordpress/keycodes");
|
|
26
|
+
var import_data = require("@wordpress/data");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
var import_core_data = require("@wordpress/core-data");
|
|
29
|
+
var import_store = require("../../store");
|
|
22
30
|
function KeyboardShortcuts() {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
27
|
-
const {
|
|
28
|
-
saveEditedWidgetAreas
|
|
29
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
30
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-widgets/undo', event => {
|
|
31
|
+
const { redo, undo } = (0, import_data.useDispatch)(import_core_data.store);
|
|
32
|
+
const { saveEditedWidgetAreas } = (0, import_data.useDispatch)(import_store.store);
|
|
33
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/undo", (event) => {
|
|
31
34
|
undo();
|
|
32
35
|
event.preventDefault();
|
|
33
36
|
});
|
|
34
|
-
(0,
|
|
37
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/redo", (event) => {
|
|
35
38
|
redo();
|
|
36
39
|
event.preventDefault();
|
|
37
40
|
});
|
|
38
|
-
(0,
|
|
41
|
+
(0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/save", (event) => {
|
|
39
42
|
event.preventDefault();
|
|
40
43
|
saveEditedWidgetAreas();
|
|
41
44
|
});
|
|
42
45
|
return null;
|
|
43
46
|
}
|
|
44
47
|
function KeyboardShortcutsRegister() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
registerShortcut
|
|
48
|
-
} = (0, _data.useDispatch)(_keyboardShortcuts.store);
|
|
49
|
-
(0, _element.useEffect)(() => {
|
|
48
|
+
const { registerShortcut } = (0, import_data.useDispatch)(import_keyboard_shortcuts.store);
|
|
49
|
+
(0, import_element.useEffect)(() => {
|
|
50
50
|
registerShortcut({
|
|
51
|
-
name:
|
|
52
|
-
category:
|
|
53
|
-
description: (0,
|
|
51
|
+
name: "core/edit-widgets/undo",
|
|
52
|
+
category: "global",
|
|
53
|
+
description: (0, import_i18n.__)("Undo your last changes."),
|
|
54
54
|
keyCombination: {
|
|
55
|
-
modifier:
|
|
56
|
-
character:
|
|
55
|
+
modifier: "primary",
|
|
56
|
+
character: "z"
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
registerShortcut({
|
|
60
|
-
name:
|
|
61
|
-
category:
|
|
62
|
-
description: (0,
|
|
60
|
+
name: "core/edit-widgets/redo",
|
|
61
|
+
category: "global",
|
|
62
|
+
description: (0, import_i18n.__)("Redo your last undo."),
|
|
63
63
|
keyCombination: {
|
|
64
|
-
modifier:
|
|
65
|
-
character:
|
|
64
|
+
modifier: "primaryShift",
|
|
65
|
+
character: "z"
|
|
66
66
|
},
|
|
67
67
|
// Disable on Apple OS because it conflicts with the browser's
|
|
68
68
|
// history shortcut. It's a fine alias for both Windows and Linux.
|
|
69
69
|
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
|
|
70
70
|
// Linux, we keep it as the default for consistency.
|
|
71
|
-
aliases: (0,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
aliases: (0, import_keycodes.isAppleOS)() ? [] : [
|
|
72
|
+
{
|
|
73
|
+
modifier: "primary",
|
|
74
|
+
character: "y"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
75
77
|
});
|
|
76
78
|
registerShortcut({
|
|
77
|
-
name:
|
|
78
|
-
category:
|
|
79
|
-
description: (0,
|
|
79
|
+
name: "core/edit-widgets/save",
|
|
80
|
+
category: "global",
|
|
81
|
+
description: (0, import_i18n.__)("Save your changes."),
|
|
80
82
|
keyCombination: {
|
|
81
|
-
modifier:
|
|
82
|
-
character:
|
|
83
|
+
modifier: "primary",
|
|
84
|
+
character: "s"
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
registerShortcut({
|
|
86
|
-
name:
|
|
87
|
-
category:
|
|
88
|
-
description: (0,
|
|
88
|
+
name: "core/edit-widgets/keyboard-shortcuts",
|
|
89
|
+
category: "main",
|
|
90
|
+
description: (0, import_i18n.__)("Display these keyboard shortcuts."),
|
|
89
91
|
keyCombination: {
|
|
90
|
-
modifier:
|
|
91
|
-
character:
|
|
92
|
+
modifier: "access",
|
|
93
|
+
character: "h"
|
|
92
94
|
}
|
|
93
95
|
});
|
|
94
96
|
registerShortcut({
|
|
95
|
-
name:
|
|
96
|
-
category:
|
|
97
|
-
description: (0,
|
|
97
|
+
name: "core/edit-widgets/next-region",
|
|
98
|
+
category: "global",
|
|
99
|
+
description: (0, import_i18n.__)("Navigate to the next part of the editor."),
|
|
98
100
|
keyCombination: {
|
|
99
|
-
modifier:
|
|
100
|
-
character:
|
|
101
|
+
modifier: "ctrl",
|
|
102
|
+
character: "`"
|
|
101
103
|
},
|
|
102
|
-
aliases: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
aliases: [
|
|
105
|
+
{
|
|
106
|
+
modifier: "access",
|
|
107
|
+
character: "n"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
106
110
|
});
|
|
107
111
|
registerShortcut({
|
|
108
|
-
name:
|
|
109
|
-
category:
|
|
110
|
-
description: (0,
|
|
112
|
+
name: "core/edit-widgets/previous-region",
|
|
113
|
+
category: "global",
|
|
114
|
+
description: (0, import_i18n.__)("Navigate to the previous part of the editor."),
|
|
111
115
|
keyCombination: {
|
|
112
|
-
modifier:
|
|
113
|
-
character:
|
|
116
|
+
modifier: "ctrlShift",
|
|
117
|
+
character: "`"
|
|
114
118
|
},
|
|
115
|
-
aliases: [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
aliases: [
|
|
120
|
+
{
|
|
121
|
+
modifier: "access",
|
|
122
|
+
character: "p"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
modifier: "ctrlShift",
|
|
126
|
+
character: "~"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
122
129
|
});
|
|
123
130
|
}, [registerShortcut]);
|
|
124
131
|
return null;
|
|
125
132
|
}
|
|
126
133
|
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
|
|
127
|
-
var
|
|
128
|
-
//# sourceMappingURL=index.js.map
|
|
134
|
+
var keyboard_shortcuts_default = KeyboardShortcuts;
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcuts/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { 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';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\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 ],\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;AAGA,qBAA0B;AAC1B,gCAGO;AACP,sBAA0B;AAC1B,kBAA4B;AAC5B,kBAAmB;AACnB,uBAAmC;AAKnC,mBAA0C;AAE1C,SAAS,oBAAoB;AAC5B,QAAM,EAAE,MAAM,KAAK,QAAI,yBAAa,iBAAAA,KAAU;AAC9C,QAAM,EAAE,sBAAsB,QAAI,yBAAa,aAAAC,KAAiB;AAEhE,6CAAa,0BAA0B,CAAE,UAAW;AACnD,SAAK;AACL,UAAM,eAAe;AAAA,EACtB,CAAE;AAEF,6CAAa,0BAA0B,CAAE,UAAW;AACnD,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,MACA;AAAA,IACJ,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": ["coreStore", "editWidgetsStore", "keyboardShortcutsStore"]
|
|
7
|
+
}
|
|
@@ -1,56 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var layout_exports = {};
|
|
29
|
+
__export(layout_exports, {
|
|
30
|
+
default: () => layout_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
function Layout({
|
|
29
|
-
blockEditorSettings
|
|
30
|
-
}) {
|
|
31
|
-
const {
|
|
32
|
-
createErrorNotice
|
|
33
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
32
|
+
module.exports = __toCommonJS(layout_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_i18n = require("@wordpress/i18n");
|
|
35
|
+
var import_data = require("@wordpress/data");
|
|
36
|
+
var import_plugins = require("@wordpress/plugins");
|
|
37
|
+
var import_notices = require("@wordpress/notices");
|
|
38
|
+
var import_components = require("@wordpress/components");
|
|
39
|
+
var import_error_boundary = __toESM(require("../error-boundary"));
|
|
40
|
+
var import_widget_areas_block_editor_provider = __toESM(require("../widget-areas-block-editor-provider"));
|
|
41
|
+
var import_sidebar = __toESM(require("../sidebar"));
|
|
42
|
+
var import_interface = __toESM(require("./interface"));
|
|
43
|
+
var import_unsaved_changes_warning = __toESM(require("./unsaved-changes-warning"));
|
|
44
|
+
var import_welcome_guide = __toESM(require("../welcome-guide"));
|
|
45
|
+
function Layout({ blockEditorSettings }) {
|
|
46
|
+
const { createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
34
47
|
function onPluginAreaError(name) {
|
|
35
|
-
createErrorNotice(
|
|
36
|
-
|
|
48
|
+
createErrorNotice(
|
|
49
|
+
(0, import_i18n.sprintf)(
|
|
50
|
+
/* translators: %s: plugin name */
|
|
51
|
+
(0, import_i18n.__)(
|
|
52
|
+
'The "%s" plugin has encountered an error and cannot be rendered.'
|
|
53
|
+
),
|
|
54
|
+
name
|
|
55
|
+
)
|
|
56
|
+
);
|
|
37
57
|
}
|
|
38
|
-
const navigateRegionsProps = (0,
|
|
39
|
-
return
|
|
40
|
-
|
|
58
|
+
const navigateRegionsProps = (0, import_components.__unstableUseNavigateRegions)();
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error_boundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
41
62
|
className: navigateRegionsProps.className,
|
|
42
63
|
...navigateRegionsProps,
|
|
43
64
|
ref: navigateRegionsProps.ref,
|
|
44
|
-
children:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
blockEditorSettings
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
import_widget_areas_block_editor_provider.default,
|
|
67
|
+
{
|
|
68
|
+
blockEditorSettings,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_interface.default, { blockEditorSettings }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar.default, {}),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_unsaved_changes_warning.default, {}),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_welcome_guide.default, {})
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
) });
|
|
54
80
|
}
|
|
55
|
-
var
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
|
81
|
+
var layout_default = Layout;
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/layout/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\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\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<div\n\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t>\n\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t>\n\t\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t\t<Sidebar />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t</div>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CI;AAxCJ,kBAA4B;AAC5B,kBAA4B;AAC5B,qBAA2B;AAC3B,qBAAsC;AACtC,wBAAmE;AAKnE,4BAA0B;AAC1B,gDAA2C;AAC3C,qBAAoB;AACpB,uBAAsB;AACtB,qCAAkC;AAClC,2BAAyB;AAEzB,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;AAEhD,SACC,4CAAC,sBAAAC,SAAA,EACA;AAAA,IAAC;AAAA;AAAA,MACA,WAAY,qBAAqB;AAAA,MAC/B,GAAG;AAAA,MACL,KAAM,qBAAqB;AAAA,MAE3B;AAAA,QAAC,0CAAAC;AAAA,QAAA;AAAA,UACA;AAAA,UAEA;AAAA,wDAAC,iBAAAC,SAAA,EAAU,qBAA4C;AAAA,YACvD,4CAAC,eAAAC,SAAA,EAAQ;AAAA,YACT,4CAAC,6BAAW,SAAU,mBAAoB;AAAA,YAC1C,4CAAC,+BAAAC,SAAA,EAAsB;AAAA,YACvB,4CAAC,qBAAAC,SAAA,EAAa;AAAA;AAAA;AAAA,MACf;AAAA;AAAA,EACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
|
+
"names": ["noticesStore", "useNavigateRegions", "ErrorBoundary", "WidgetAreasBlockEditorProvider", "Interface", "Sidebar", "UnsavedChangesWarning", "WelcomeGuide"]
|
|
7
|
+
}
|
|
@@ -1,98 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var interface_exports = {};
|
|
29
|
+
__export(interface_exports, {
|
|
30
|
+
default: () => interface_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
32
|
+
module.exports = __toCommonJS(interface_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_compose = require("@wordpress/compose");
|
|
35
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_data = require("@wordpress/data");
|
|
38
|
+
var import_interface = require("@wordpress/interface");
|
|
39
|
+
var import_i18n = require("@wordpress/i18n");
|
|
40
|
+
var import_preferences = require("@wordpress/preferences");
|
|
41
|
+
var import_header = __toESM(require("../header"));
|
|
42
|
+
var import_widget_areas_block_editor_content = __toESM(require("../widget-areas-block-editor-content"));
|
|
43
|
+
var import_store = require("../../store");
|
|
44
|
+
var import_secondary_sidebar = __toESM(require("../secondary-sidebar"));
|
|
28
45
|
const interfaceLabels = {
|
|
29
46
|
/* translators: accessibility text for the widgets screen top bar landmark region. */
|
|
30
|
-
header: (0,
|
|
47
|
+
header: (0, import_i18n.__)("Widgets top bar"),
|
|
31
48
|
/* translators: accessibility text for the widgets screen content landmark region. */
|
|
32
|
-
body: (0,
|
|
49
|
+
body: (0, import_i18n.__)("Widgets and blocks"),
|
|
33
50
|
/* translators: accessibility text for the widgets screen settings landmark region. */
|
|
34
|
-
sidebar: (0,
|
|
51
|
+
sidebar: (0, import_i18n.__)("Widgets settings"),
|
|
35
52
|
/* translators: accessibility text for the widgets screen footer landmark region. */
|
|
36
|
-
footer: (0,
|
|
53
|
+
footer: (0, import_i18n.__)("Widgets footer")
|
|
37
54
|
};
|
|
38
|
-
function Interface({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const isHugeViewport = (0, _compose.useViewportMatch)('huge', '>=');
|
|
43
|
-
const {
|
|
44
|
-
setIsInserterOpened,
|
|
45
|
-
setIsListViewOpened,
|
|
46
|
-
closeGeneralSidebar
|
|
47
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
55
|
+
function Interface({ blockEditorSettings }) {
|
|
56
|
+
const isMobileViewport = (0, import_compose.useViewportMatch)("medium", "<");
|
|
57
|
+
const isHugeViewport = (0, import_compose.useViewportMatch)("huge", ">=");
|
|
58
|
+
const { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } = (0, import_data.useDispatch)(import_store.store);
|
|
48
59
|
const {
|
|
49
60
|
hasBlockBreadCrumbsEnabled,
|
|
50
61
|
hasSidebarEnabled,
|
|
51
62
|
isInserterOpened,
|
|
52
63
|
isListViewOpened
|
|
53
|
-
} = (0,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
} = (0, import_data.useSelect)(
|
|
65
|
+
(select) => ({
|
|
66
|
+
hasSidebarEnabled: !!select(
|
|
67
|
+
import_interface.store
|
|
68
|
+
).getActiveComplementaryArea(import_store.store.name),
|
|
69
|
+
isInserterOpened: !!select(import_store.store).isInserterOpened(),
|
|
70
|
+
isListViewOpened: !!select(import_store.store).isListViewOpened(),
|
|
71
|
+
hasBlockBreadCrumbsEnabled: !!select(import_preferences.store).get(
|
|
72
|
+
"core/edit-widgets",
|
|
73
|
+
"showBlockBreadcrumbs"
|
|
74
|
+
)
|
|
75
|
+
}),
|
|
76
|
+
[]
|
|
77
|
+
);
|
|
78
|
+
(0, import_element.useEffect)(() => {
|
|
62
79
|
if (hasSidebarEnabled && !isHugeViewport) {
|
|
63
80
|
setIsInserterOpened(false);
|
|
64
81
|
setIsListViewOpened(false);
|
|
65
82
|
}
|
|
66
83
|
}, [hasSidebarEnabled, isHugeViewport]);
|
|
67
|
-
(0,
|
|
84
|
+
(0, import_element.useEffect)(() => {
|
|
68
85
|
if ((isInserterOpened || isListViewOpened) && !isHugeViewport) {
|
|
69
86
|
closeGeneralSidebar();
|
|
70
87
|
}
|
|
71
88
|
}, [isInserterOpened, isListViewOpened, isHugeViewport]);
|
|
72
|
-
const secondarySidebarLabel = isListViewOpened ? (0,
|
|
89
|
+
const secondarySidebarLabel = isListViewOpened ? (0, import_i18n.__)("List View") : (0, import_i18n.__)("Block Library");
|
|
73
90
|
const hasSecondarySidebar = isListViewOpened || isInserterOpened;
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
className: "edit-widgets-layout__footer",
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
94
|
-
})
|
|
95
|
-
});
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_interface.InterfaceSkeleton,
|
|
93
|
+
{
|
|
94
|
+
labels: {
|
|
95
|
+
...interfaceLabels,
|
|
96
|
+
secondarySidebar: secondarySidebarLabel
|
|
97
|
+
},
|
|
98
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_header.default, {}),
|
|
99
|
+
secondarySidebar: hasSecondarySidebar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_secondary_sidebar.default, {}),
|
|
100
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_interface.ComplementaryArea.Slot, { scope: "core/edit-widgets" }),
|
|
101
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
import_widget_areas_block_editor_content.default,
|
|
103
|
+
{
|
|
104
|
+
blockEditorSettings
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockBreadcrumb, { rootLabelText: (0, import_i18n.__)("Widgets") }) })
|
|
108
|
+
}
|
|
109
|
+
);
|
|
96
110
|
}
|
|
97
|
-
var
|
|
98
|
-
//# sourceMappingURL=interface.js.map
|
|
111
|
+
var interface_default = Interface;
|
|
112
|
+
//# sourceMappingURL=interface.js.map
|