@wordpress/edit-widgets 5.34.0 → 6.0.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 +15 -2
- package/build/blocks/widget-area/edit/index.js +33 -30
- package/build/blocks/widget-area/edit/index.js.map +1 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +8 -7
- package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build/components/error-boundary/index.js +14 -12
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/header/document-tools/index.js +40 -60
- package/build/components/header/document-tools/index.js.map +1 -1
- package/build/components/header/index.js +32 -22
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +2 -2
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +2 -2
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +54 -49
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/index.js +11 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/interface.js +16 -13
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/more-menu/index.js +81 -70
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/tools-more-menu-group.js +5 -4
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build/components/notices/index.js +15 -13
- package/build/components/notices/index.js.map +1 -1
- package/build/components/save-button/index.js +5 -4
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/index.js +3 -3
- package/build/components/secondary-sidebar/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +21 -18
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +21 -15
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +49 -37
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/widget-areas.js +29 -22
- package/build/components/sidebar/widget-areas.js.map +1 -1
- package/build/components/welcome-guide/index.js +80 -53
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +18 -11
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +14 -11
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/filters/move-to-widget-area.js +14 -10
- package/build/filters/move-to-widget-area.js.map +1 -1
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/store/private-selectors.js +4 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +16 -0
- package/build/store/reducer.js.map +1 -1
- package/build-module/blocks/widget-area/edit/index.js +32 -28
- package/build-module/blocks/widget-area/edit/index.js.map +1 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +8 -7
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build-module/components/error-boundary/index.js +14 -12
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/header/document-tools/index.js +44 -62
- package/build-module/components/header/document-tools/index.js.map +1 -1
- package/build-module/components/header/index.js +34 -22
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +2 -2
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +2 -2
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +55 -49
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/index.js +12 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/interface.js +17 -13
- package/build-module/components/layout/interface.js.map +1 -1
- package/build-module/components/more-menu/index.js +83 -70
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +5 -4
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build-module/components/notices/index.js +17 -13
- package/build-module/components/notices/index.js.map +1 -1
- package/build-module/components/save-button/index.js +5 -4
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/index.js +3 -3
- package/build-module/components/secondary-sidebar/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +22 -18
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +22 -15
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +50 -37
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/widget-areas.js +30 -22
- package/build-module/components/sidebar/widget-areas.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +82 -53
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +19 -11
- package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +15 -11
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/filters/move-to-widget-area.js +16 -10
- package/build-module/filters/move-to-widget-area.js.map +1 -1
- package/build-module/index.js +3 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +15 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +15 -14
- package/build-style/style.css +15 -14
- package/package.json +31 -30
- package/src/blocks/widget-area/edit/inner-blocks.js +2 -2
- package/src/components/header/document-tools/index.js +30 -50
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/layout/style.scss +1 -1
- package/src/index.js +1 -1
- package/src/store/private-selectors.js +4 -0
- package/src/store/reducer.js +13 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
5
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -18,37 +17,43 @@ import { useSelect } from '@wordpress/data';
|
|
|
18
17
|
import { textFormattingShortcuts } from './config';
|
|
19
18
|
import Shortcut from './shortcut';
|
|
20
19
|
import DynamicShortcut from './dynamic-shortcut';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const ShortcutList = ({
|
|
22
23
|
shortcuts
|
|
23
24
|
}) =>
|
|
25
|
+
/*#__PURE__*/
|
|
24
26
|
/*
|
|
25
27
|
* Disable reason: The `list` ARIA role is redundant but
|
|
26
28
|
* Safari+VoiceOver won't announce the list otherwise.
|
|
27
29
|
*/
|
|
28
30
|
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
29
|
-
|
|
31
|
+
_jsx("ul", {
|
|
30
32
|
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
31
|
-
role: "list"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}))
|
|
33
|
+
role: "list",
|
|
34
|
+
children: shortcuts.map((shortcut, index) => /*#__PURE__*/_jsx("li", {
|
|
35
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
36
|
+
children: typeof shortcut === 'string' ? /*#__PURE__*/_jsx(DynamicShortcut, {
|
|
37
|
+
name: shortcut
|
|
38
|
+
}) : /*#__PURE__*/_jsx(Shortcut, {
|
|
39
|
+
...shortcut
|
|
40
|
+
})
|
|
41
|
+
}, index))
|
|
42
|
+
})
|
|
40
43
|
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
41
44
|
const ShortcutSection = ({
|
|
42
45
|
title,
|
|
43
46
|
shortcuts,
|
|
44
47
|
className
|
|
45
|
-
}) =>
|
|
46
|
-
className:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
}) => /*#__PURE__*/_jsxs("section", {
|
|
49
|
+
className: clsx('edit-widgets-keyboard-shortcut-help-modal__section', className),
|
|
50
|
+
children: [!!title && /*#__PURE__*/_jsx("h2", {
|
|
51
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__section-title",
|
|
52
|
+
children: title
|
|
53
|
+
}), /*#__PURE__*/_jsx(ShortcutList, {
|
|
54
|
+
shortcuts: shortcuts
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
52
57
|
const ShortcutCategorySection = ({
|
|
53
58
|
title,
|
|
54
59
|
categoryName,
|
|
@@ -57,7 +62,7 @@ const ShortcutCategorySection = ({
|
|
|
57
62
|
const categoryShortcuts = useSelect(select => {
|
|
58
63
|
return select(keyboardShortcutsStore).getCategoryShortcuts(categoryName);
|
|
59
64
|
}, [categoryName]);
|
|
60
|
-
return
|
|
65
|
+
return /*#__PURE__*/_jsx(ShortcutSection, {
|
|
61
66
|
title: title,
|
|
62
67
|
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
63
68
|
});
|
|
@@ -72,36 +77,37 @@ export default function KeyboardShortcutHelpModal({
|
|
|
72
77
|
if (!isModalActive) {
|
|
73
78
|
return null;
|
|
74
79
|
}
|
|
75
|
-
return
|
|
80
|
+
return /*#__PURE__*/_jsxs(Modal, {
|
|
76
81
|
className: "edit-widgets-keyboard-shortcut-help-modal",
|
|
77
82
|
title: __('Keyboard shortcuts'),
|
|
78
|
-
onRequestClose: toggleModal
|
|
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
|
-
|
|
83
|
+
onRequestClose: toggleModal,
|
|
84
|
+
children: [/*#__PURE__*/_jsx(ShortcutSection, {
|
|
85
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",
|
|
86
|
+
shortcuts: ['core/edit-widgets/keyboard-shortcuts']
|
|
87
|
+
}), /*#__PURE__*/_jsx(ShortcutCategorySection, {
|
|
88
|
+
title: __('Global shortcuts'),
|
|
89
|
+
categoryName: "global"
|
|
90
|
+
}), /*#__PURE__*/_jsx(ShortcutCategorySection, {
|
|
91
|
+
title: __('Selection shortcuts'),
|
|
92
|
+
categoryName: "selection"
|
|
93
|
+
}), /*#__PURE__*/_jsx(ShortcutCategorySection, {
|
|
94
|
+
title: __('Block shortcuts'),
|
|
95
|
+
categoryName: "block",
|
|
96
|
+
additionalShortcuts: [{
|
|
97
|
+
keyCombination: {
|
|
98
|
+
character: '/'
|
|
99
|
+
},
|
|
100
|
+
description: __('Change the block type after adding a new paragraph.'),
|
|
101
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
102
|
+
ariaLabel: __('Forward-slash')
|
|
103
|
+
}]
|
|
104
|
+
}), /*#__PURE__*/_jsx(ShortcutSection, {
|
|
105
|
+
title: __('Text formatting'),
|
|
106
|
+
shortcuts: textFormattingShortcuts
|
|
107
|
+
}), /*#__PURE__*/_jsx(ShortcutCategorySection, {
|
|
108
|
+
title: __('List View shortcuts'),
|
|
109
|
+
categoryName: "list-view"
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
106
112
|
}
|
|
107
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","Modal","__","useShortcut","store","keyboardShortcutsStore","useSelect","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'edit-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAAC,SAA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rCwB,YAAY,EAAC;IAAW,CACxB,CAAC;EAAA,CACI,CAAC;AAEV","ignoreList":[]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
5
4
|
import { Fragment } from '@wordpress/element';
|
|
6
5
|
import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
9
|
function KeyCombination({
|
|
8
10
|
keyCombination,
|
|
9
11
|
forceAriaLabel
|
|
@@ -11,20 +13,21 @@ function KeyCombination({
|
|
|
11
13
|
const shortcut = keyCombination.modifier ? displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
12
14
|
const ariaLabel = keyCombination.modifier ? shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
13
15
|
const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
|
|
14
|
-
return
|
|
16
|
+
return /*#__PURE__*/_jsx("kbd", {
|
|
15
17
|
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
16
|
-
"aria-label": forceAriaLabel || ariaLabel
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
"aria-label": forceAriaLabel || ariaLabel,
|
|
19
|
+
children: shortcuts.map((character, index) => {
|
|
20
|
+
if (character === '+') {
|
|
21
|
+
return /*#__PURE__*/_jsx(Fragment, {
|
|
22
|
+
children: character
|
|
23
|
+
}, index);
|
|
24
|
+
}
|
|
25
|
+
return /*#__PURE__*/_jsx("kbd", {
|
|
26
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key",
|
|
27
|
+
children: character
|
|
28
|
+
}, index);
|
|
29
|
+
})
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
32
|
function Shortcut({
|
|
30
33
|
description,
|
|
@@ -32,18 +35,21 @@ function Shortcut({
|
|
|
32
35
|
aliases = [],
|
|
33
36
|
ariaLabel
|
|
34
37
|
}) {
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description",
|
|
41
|
+
children: description
|
|
42
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
43
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term",
|
|
44
|
+
children: [/*#__PURE__*/_jsx(KeyCombination, {
|
|
45
|
+
keyCombination: keyCombination,
|
|
46
|
+
forceAriaLabel: ariaLabel
|
|
47
|
+
}), aliases.map((alias, index) => /*#__PURE__*/_jsx(KeyCombination, {
|
|
48
|
+
keyCombination: alias,
|
|
49
|
+
forceAriaLabel: ariaLabel
|
|
50
|
+
}, index))]
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
47
53
|
}
|
|
48
54
|
export default Shortcut;
|
|
49
55
|
//# sourceMappingURL=shortcut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","shortcuts","Array","isArray","
|
|
1
|
+
{"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","shortcuts","Array","isArray","className","children","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAN,QAAA,IAAAO,SAAA;AAE7E,SAASC,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ,GACrCX,mBAAmB,CAAEQ,cAAc,CAACG,QAAQ,CAAE,CAC9CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAMC,SAAS,GAAGL,cAAc,CAACG,QAAQ,GACtCV,iBAAiB,CAAEO,cAAc,CAACG,QAAQ,CAAE,CAC5CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAME,SAAS,GAAGC,KAAK,CAACC,OAAO,CAAEN,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE;EAErE,oBACCP,IAAA;IACCc,SAAS,EAAC,qEAAqE;IAC/E,cAAaR,cAAc,IAAII,SAAW;IAAAK,QAAA,EAExCJ,SAAS,CAACK,GAAG,CAAE,CAAEP,SAAS,EAAEQ,KAAK,KAAM;MACxC,IAAKR,SAAS,KAAK,GAAG,EAAG;QACxB,oBAAOT,IAAA,CAACJ,QAAQ;UAAAmB,QAAA,EAAiBN;QAAS,GAAnBQ,KAA+B,CAAC;MACxD;MAEA,oBACCjB,IAAA;QAECc,SAAS,EAAC,yDAAyD;QAAAC,QAAA,EAEjEN;MAAS,GAHLQ,KAIF,CAAC;IAER,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASC,QAAQA,CAAE;EAAEC,WAAW;EAAEd,cAAc;EAAEe,OAAO,GAAG,EAAE;EAAEV;AAAU,CAAC,EAAG;EAC7E,oBACCR,KAAA,CAAAC,SAAA;IAAAY,QAAA,gBACCf,IAAA;MAAKc,SAAS,EAAC,iEAAiE;MAAAC,QAAA,EAC7EI;IAAW,CACT,CAAC,eACNjB,KAAA;MAAKY,SAAS,EAAC,0DAA0D;MAAAC,QAAA,gBACxEf,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGA,cAAgB;QACjCC,cAAc,EAAGI;MAAW,CAC5B,CAAC,EACAU,OAAO,CAACJ,GAAG,CAAE,CAAEK,KAAK,EAAEJ,KAAK,kBAC5BjB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGgB,KAAO;QACxBf,cAAc,EAAGI;MAAW,GACtBO,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -16,6 +15,8 @@ import Sidebar from '../sidebar';
|
|
|
16
15
|
import Interface from './interface';
|
|
17
16
|
import UnsavedChangesWarning from './unsaved-changes-warning';
|
|
18
17
|
import WelcomeGuide from '../welcome-guide';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
function Layout({
|
|
20
21
|
blockEditorSettings
|
|
21
22
|
}) {
|
|
@@ -26,13 +27,16 @@ function Layout({
|
|
|
26
27
|
createErrorNotice(sprintf( /* translators: %s: plugin name */
|
|
27
28
|
__('The "%s" plugin has encountered an error and cannot be rendered.'), name));
|
|
28
29
|
}
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
31
|
+
children: /*#__PURE__*/_jsxs(WidgetAreasBlockEditorProvider, {
|
|
32
|
+
blockEditorSettings: blockEditorSettings,
|
|
33
|
+
children: [/*#__PURE__*/_jsx(Interface, {
|
|
34
|
+
blockEditorSettings: blockEditorSettings
|
|
35
|
+
}), /*#__PURE__*/_jsx(Sidebar, {}), /*#__PURE__*/_jsx(PluginArea, {
|
|
36
|
+
onError: onPluginAreaError
|
|
37
|
+
}), /*#__PURE__*/_jsx(UnsavedChangesWarning, {}), /*#__PURE__*/_jsx(WelcomeGuide, {})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
36
40
|
}
|
|
37
41
|
export default Layout;
|
|
38
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","useDispatch","PluginArea","store","noticesStore","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","Layout","blockEditorSettings","createErrorNotice","onPluginAreaError","name","
|
|
1
|
+
{"version":3,"names":["__","sprintf","useDispatch","PluginArea","store","noticesStore","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","jsx","_jsx","jsxs","_jsxs","Layout","blockEditorSettings","createErrorNotice","onPluginAreaError","name","children","onError"],"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"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';\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\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,8BAA8B,MAAM,uCAAuC;AAClF,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,OAAOC,YAAY,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE5C,SAASC,MAAMA,CAAE;EAAEC;AAAoB,CAAC,EAAG;EAC1C,MAAM;IAAEC;EAAkB,CAAC,GAAGhB,WAAW,CAAEG,YAAa,CAAC;EAEzD,SAASc,iBAAiBA,CAAEC,IAAI,EAAG;IAClCF,iBAAiB,CAChBjB,OAAO,EACN;IACAD,EAAE,CACD,kEACD,CAAC,EACDoB,IACD,CACD,CAAC;EACF;EAEA,oBACCP,IAAA,CAACP,aAAa;IAAAe,QAAA,eACbN,KAAA,CAACR,8BAA8B;MAC9BU,mBAAmB,EAAGA,mBAAqB;MAAAI,QAAA,gBAE3CR,IAAA,CAACJ,SAAS;QAACQ,mBAAmB,EAAGA;MAAqB,CAAE,CAAC,eACzDJ,IAAA,CAACL,OAAO,IAAE,CAAC,eACXK,IAAA,CAACV,UAAU;QAACmB,OAAO,EAAGH;MAAmB,CAAE,CAAC,eAC5CN,IAAA,CAACH,qBAAqB,IAAE,CAAC,eACzBG,IAAA,CAACF,YAAY,IAAE,CAAC;IAAA,CACe;EAAC,CACnB,CAAC;AAElB;AAEA,eAAeK,MAAM","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -18,6 +17,8 @@ import Header from '../header';
|
|
|
18
17
|
import WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';
|
|
19
18
|
import { store as editWidgetsStore } from '../../store';
|
|
20
19
|
import SecondarySidebar from '../secondary-sidebar';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
22
|
const interfaceLabels = {
|
|
22
23
|
/* translators: accessibility text for the widgets screen top bar landmark region. */
|
|
23
24
|
header: __('Widgets top bar'),
|
|
@@ -68,24 +69,27 @@ function Interface({
|
|
|
68
69
|
}, [isInserterOpened, isListViewOpened, isHugeViewport]);
|
|
69
70
|
const secondarySidebarLabel = isListViewOpened ? __('List View') : __('Block Library');
|
|
70
71
|
const hasSecondarySidebar = isListViewOpened || isInserterOpened;
|
|
71
|
-
return
|
|
72
|
+
return /*#__PURE__*/_jsx(InterfaceSkeleton, {
|
|
72
73
|
labels: {
|
|
73
74
|
...interfaceLabels,
|
|
74
75
|
secondarySidebar: secondarySidebarLabel
|
|
75
76
|
},
|
|
76
|
-
header:
|
|
77
|
-
secondarySidebar: hasSecondarySidebar &&
|
|
78
|
-
sidebar:
|
|
77
|
+
header: /*#__PURE__*/_jsx(Header, {}),
|
|
78
|
+
secondarySidebar: hasSecondarySidebar && /*#__PURE__*/_jsx(SecondarySidebar, {}),
|
|
79
|
+
sidebar: /*#__PURE__*/_jsx(ComplementaryArea.Slot, {
|
|
79
80
|
scope: "core/edit-widgets"
|
|
80
81
|
}),
|
|
81
|
-
content:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
content: /*#__PURE__*/_jsx(_Fragment, {
|
|
83
|
+
children: /*#__PURE__*/_jsx(WidgetAreasBlockEditorContent, {
|
|
84
|
+
blockEditorSettings: blockEditorSettings
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /*#__PURE__*/_jsx("div", {
|
|
88
|
+
className: "edit-widgets-layout__footer",
|
|
89
|
+
children: /*#__PURE__*/_jsx(BlockBreadcrumb, {
|
|
90
|
+
rootLabelText: __('Widgets')
|
|
91
|
+
})
|
|
92
|
+
}),
|
|
89
93
|
shortcuts: {
|
|
90
94
|
previous: previousShortcut,
|
|
91
95
|
next: nextShortcut
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useViewportMatch","BlockBreadcrumb","useEffect","useDispatch","useSelect","InterfaceSkeleton","ComplementaryArea","store","interfaceStore","__","keyboardShortcutsStore","preferencesStore","Header","WidgetAreasBlockEditorContent","editWidgetsStore","SecondarySidebar","interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","getActiveComplementaryArea","name","get","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","
|
|
1
|
+
{"version":3,"names":["useViewportMatch","BlockBreadcrumb","useEffect","useDispatch","useSelect","InterfaceSkeleton","ComplementaryArea","store","interfaceStore","__","keyboardShortcutsStore","preferencesStore","Header","WidgetAreasBlockEditorContent","editWidgetsStore","SecondarySidebar","jsx","_jsx","Fragment","_Fragment","interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","getActiveComplementaryArea","name","get","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","labels","secondarySidebar","Slot","scope","content","children","className","rootLabelText","shortcuts","previous","next"],"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,iBAAiB,EACjBC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