@wordpress/edit-widgets 5.35.0 → 6.0.1
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 +7 -0
- 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 +6 -5
- 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 +36 -33
- 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 +53 -48
- 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-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 +6 -5
- 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 +38 -33
- 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 +54 -48
- 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-style/style-rtl.css +9 -8
- package/build-style/style.css +9 -8
- package/package.json +30 -29
- package/src/components/layout/style.scss +1 -1
- package/src/index.js +1 -1
|
@@ -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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T,gBAAgB,IAAID,gBAAgB;EAEhE,oBACCjB,IAAA,CAACZ,iBAAiB;IACjBwC,MAAM,EAAG;MACR,GAAGzB,eAAe;MAClB0B,gBAAgB,EAAEH;IACnB,CAAG;IACHtB,MAAM,eAAGJ,IAAA,CAACL,MAAM,IAAE,CAAG;IACrBkC,gBAAgB,EAAGF,mBAAmB,iBAAI3B,IAAA,CAACF,gBAAgB,IAAE,CAAG;IAChEQ,OAAO,eAAGN,IAAA,CAACX,iBAAiB,CAACyC,IAAI;MAACC,KAAK,EAAC;IAAmB,CAAE,CAAG;IAChEC,OAAO,eACNhC,IAAA,CAAAE,SAAA;MAAA+B,QAAA,eACCjC,IAAA,CAACJ,6BAA6B;QAC7Ba,mBAAmB,EAAGA;MAAqB,CAC3C;IAAC,CACD,CACF;IACDF,MAAM,EACLQ,0BAA0B,IAC1B,CAAEL,gBAAgB,iBACjBV,IAAA;MAAKkC,SAAS,EAAC,6BAA6B;MAAAD,QAAA,eAC3CjC,IAAA,CAAChB,eAAe;QAACmD,aAAa,EAAG3C,EAAE,CAAE,SAAU;MAAG,CAAE;IAAC,CACjD,CAEN;IACD4C,SAAS,EAAG;MACXC,QAAQ,EAAElB,gBAAgB;MAC1BmB,IAAI,EAAElB;IACP;EAAG,CACH,CAAC;AAEJ;AAEA,eAAeZ,SAAS","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -16,79 +15,93 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
16
15
|
*/
|
|
17
16
|
import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
|
|
18
17
|
import ToolsMoreMenuGroup from './tools-more-menu-group';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
21
|
export default function MoreMenu() {
|
|
20
22
|
const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = useState(false);
|
|
21
23
|
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
|
|
22
24
|
useShortcut('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
|
|
23
25
|
const isLargeViewport = useViewportMatch('medium');
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
26
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
27
|
+
children: [/*#__PURE__*/_jsx(DropdownMenu, {
|
|
28
|
+
icon: moreVertical,
|
|
29
|
+
label: __('Options'),
|
|
30
|
+
popoverProps: {
|
|
31
|
+
placement: 'bottom-end',
|
|
32
|
+
className: 'more-menu-dropdown__content'
|
|
33
|
+
},
|
|
34
|
+
toggleProps: {
|
|
35
|
+
tooltipPosition: 'bottom',
|
|
36
|
+
size: 'compact'
|
|
37
|
+
},
|
|
38
|
+
children: onClose => /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
|
+
children: [isLargeViewport && /*#__PURE__*/_jsx(MenuGroup, {
|
|
40
|
+
label: _x('View', 'noun'),
|
|
41
|
+
children: /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
|
|
42
|
+
scope: "core/edit-widgets",
|
|
43
|
+
name: "fixedToolbar",
|
|
44
|
+
label: __('Top toolbar'),
|
|
45
|
+
info: __('Access all block and document tools in a single place'),
|
|
46
|
+
messageActivated: __('Top toolbar activated'),
|
|
47
|
+
messageDeactivated: __('Top toolbar deactivated')
|
|
48
|
+
})
|
|
49
|
+
}), /*#__PURE__*/_jsxs(MenuGroup, {
|
|
50
|
+
label: __('Tools'),
|
|
51
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
52
|
+
onClick: () => {
|
|
53
|
+
setIsKeyboardShortcutsModalVisible(true);
|
|
54
|
+
},
|
|
55
|
+
shortcut: displayShortcut.access('h'),
|
|
56
|
+
children: __('Keyboard shortcuts')
|
|
57
|
+
}), /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
|
|
58
|
+
scope: "core/edit-widgets",
|
|
59
|
+
name: "welcomeGuide",
|
|
60
|
+
label: __('Welcome Guide')
|
|
61
|
+
}), /*#__PURE__*/_jsxs(MenuItem, {
|
|
62
|
+
role: "menuitem",
|
|
63
|
+
icon: external,
|
|
64
|
+
href: __('https://wordpress.org/documentation/article/block-based-widgets-editor/'),
|
|
65
|
+
target: "_blank",
|
|
66
|
+
rel: "noopener noreferrer",
|
|
67
|
+
children: [__('Help'), /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
68
|
+
as: "span",
|
|
69
|
+
children: /* translators: accessibility text */
|
|
70
|
+
__('(opens in a new tab)')
|
|
71
|
+
})]
|
|
72
|
+
}), /*#__PURE__*/_jsx(ToolsMoreMenuGroup.Slot, {
|
|
73
|
+
fillProps: {
|
|
74
|
+
onClose
|
|
75
|
+
}
|
|
76
|
+
})]
|
|
77
|
+
}), /*#__PURE__*/_jsxs(MenuGroup, {
|
|
78
|
+
label: __('Preferences'),
|
|
79
|
+
children: [/*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
|
|
80
|
+
scope: "core/edit-widgets",
|
|
81
|
+
name: "keepCaretInsideBlock",
|
|
82
|
+
label: __('Contain text cursor inside block'),
|
|
83
|
+
info: __('Aids screen readers by stopping text caret from leaving blocks.'),
|
|
84
|
+
messageActivated: __('Contain text cursor inside block activated'),
|
|
85
|
+
messageDeactivated: __('Contain text cursor inside block deactivated')
|
|
86
|
+
}), /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
|
|
87
|
+
scope: "core/edit-widgets",
|
|
88
|
+
name: "themeStyles",
|
|
89
|
+
info: __('Make the editor look like your theme.'),
|
|
90
|
+
label: __('Use theme styles')
|
|
91
|
+
}), isLargeViewport && /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
|
|
92
|
+
scope: "core/edit-widgets",
|
|
93
|
+
name: "showBlockBreadcrumbs",
|
|
94
|
+
label: __('Display block breadcrumbs'),
|
|
95
|
+
info: __('Shows block breadcrumbs at the bottom of the editor.'),
|
|
96
|
+
messageActivated: __('Display block breadcrumbs activated'),
|
|
97
|
+
messageDeactivated: __('Display block breadcrumbs deactivated')
|
|
98
|
+
})]
|
|
99
|
+
})]
|
|
100
|
+
})
|
|
101
|
+
}), /*#__PURE__*/_jsx(KeyboardShortcutHelpModal, {
|
|
102
|
+
isModalActive: isKeyboardShortcutsModalActive,
|
|
103
|
+
toggleModal: toggleKeyboardShortcutsModal
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
93
106
|
}
|
|
94
107
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","useState","__","_x","external","moreVertical","PreferenceToggleMenuItem","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","ToolsMoreMenuGroup","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","
|
|
1
|
+
{"version":3,"names":["MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","useState","__","_x","external","moreVertical","PreferenceToggleMenuItem","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","ToolsMoreMenuGroup","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","children","icon","label","popoverProps","placement","className","toggleProps","tooltipPosition","size","onClose","scope","name","info","messageActivated","messageDeactivated","onClick","shortcut","access","role","href","target","rel","as","Slot","fillProps","isModalActive","toggleModal"],"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,YAAY,QACN,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,QAAQ,EAAEC,YAAY,QAAQ,kBAAkB;AACzD,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,kBAAkB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEzD,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,MAAM,CACLC,8BAA8B,EAC9BC,kCAAkC,CAClC,GAAGnB,QAAQ,CAAE,KAAM,CAAC;EACrB,MAAMoB,4BAA4B,GAAGA,CAAA,KACpCD,kCAAkC,CAAE,CAAED,8BAA+B,CAAC;EAEvEX,WAAW,CACV,sCAAsC,EACtCa,4BACD,CAAC;EAED,MAAMC,eAAe,GAAGb,gBAAgB,CAAE,QAAS,CAAC;EAEpD,oBACCM,KAAA,CAAAE,SAAA;IAAAM,QAAA,gBACCV,IAAA,CAACb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ACD;UAAG,CACH,CACD;QAAA,CACS,CAAC;MAAA,CACX;IACF,CACY,CAAC,eACfW,IAAA,CAACH,yBAAyB;MACzBsC,aAAa,EAAG7B,8BAAgC;MAChD8B,WAAW,EAAG5B;IAA8B,CAC5C,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
5
4
|
import { createSlotFill } from '@wordpress/components';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const {
|
|
7
7
|
Fill: ToolsMoreMenuGroup,
|
|
8
8
|
Slot
|
|
9
9
|
} = createSlotFill('EditWidgetsToolsMoreMenuGroup');
|
|
10
10
|
ToolsMoreMenuGroup.Slot = ({
|
|
11
11
|
fillProps
|
|
12
|
-
}) =>
|
|
13
|
-
fillProps: fillProps
|
|
14
|
-
|
|
12
|
+
}) => /*#__PURE__*/_jsx(Slot, {
|
|
13
|
+
fillProps: fillProps,
|
|
14
|
+
children: fills => fills.length > 0 && fills
|
|
15
|
+
});
|
|
15
16
|
export default ToolsMoreMenuGroup;
|
|
16
17
|
//# sourceMappingURL=tools-more-menu-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","Fill","ToolsMoreMenuGroup","Slot","fillProps","
|
|
1
|
+
{"version":3,"names":["createSlotFill","jsx","_jsx","Fill","ToolsMoreMenuGroup","Slot","fillProps","children","fills","length"],"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvD,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GAAGL,cAAc,CACxD,+BACD,CAAC;AAEDI,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEC;AAAU,CAAC,kBACxCJ,IAAA,CAACG,IAAI;EAACC,SAAS,EAAGA,SAAW;EAAAC,QAAA,EACxBC,KAAK,IAAMA,KAAK,CAACC,MAAM,GAAG,CAAC,IAAID;AAAK,CACnC,CACN;AAED,eAAeJ,kBAAkB","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -7,6 +6,9 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
7
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
8
7
|
|
|
9
8
|
// Last three notices. Slices from the tail end of the list.
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
const MAX_VISIBLE_NOTICES = -3;
|
|
11
13
|
function Notices() {
|
|
12
14
|
const {
|
|
@@ -30,18 +32,20 @@ function Notices() {
|
|
|
30
32
|
const snackbarNotices = notices.filter(({
|
|
31
33
|
type
|
|
32
34
|
}) => type === 'snackbar').slice(MAX_VISIBLE_NOTICES);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
36
|
+
children: [/*#__PURE__*/_jsx(NoticeList, {
|
|
37
|
+
notices: nonDismissibleNotices,
|
|
38
|
+
className: "edit-widgets-notices__pinned"
|
|
39
|
+
}), /*#__PURE__*/_jsx(NoticeList, {
|
|
40
|
+
notices: dismissibleNotices,
|
|
41
|
+
className: "edit-widgets-notices__dismissible",
|
|
42
|
+
onRemove: removeNotice
|
|
43
|
+
}), /*#__PURE__*/_jsx(SnackbarList, {
|
|
44
|
+
notices: snackbarNotices,
|
|
45
|
+
className: "edit-widgets-notices__snackbar",
|
|
46
|
+
onRemove: removeNotice
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
45
49
|
}
|
|
46
50
|
export default Notices;
|
|
47
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NoticeList","SnackbarList","useSelect","useDispatch","store","noticesStore","MAX_VISIBLE_NOTICES","Notices","removeNotice","notices","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices","slice","
|
|
1
|
+
{"version":3,"names":["NoticeList","SnackbarList","useSelect","useDispatch","store","noticesStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","MAX_VISIBLE_NOTICES","Notices","removeNotice","notices","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices","slice","children","className","onRemove"],"sources":["@wordpress/edit-widgets/src/components/notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n// Last three notices. Slices from the tail end of the list.\nconst MAX_VISIBLE_NOTICES = -3;\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices\n\t\t.filter( ( { type } ) => type === 'snackbar' )\n\t\t.slice( MAX_VISIBLE_NOTICES );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,YAAY,QAAQ,uBAAuB;AAChE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC;AAE9B,SAASC,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC;EAAa,CAAC,GAAGX,WAAW,CAAEE,YAAa,CAAC;EACpD,MAAM;IAAEU;EAAQ,CAAC,GAAGb,SAAS,CAAIc,MAAM,IAAM;IAC5C,OAAO;MACND,OAAO,EAAEC,MAAM,CAAEX,YAAa,CAAC,CAACY,UAAU,CAAC;IAC5C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,kBAAkB,GAAGH,OAAO,CAACI,MAAM,CACxC,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAMD,aAAa,IAAIC,IAAI,KAAK,SAC1D,CAAC;EACD,MAAMC,qBAAqB,GAAGP,OAAO,CAACI,MAAM,CAC3C,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAM,CAAED,aAAa,IAAIC,IAAI,KAAK,SAC5D,CAAC;EACD,MAAME,eAAe,GAAGR,OAAO,CAC7BI,MAAM,CAAE,CAAE;IAAEE;EAAK,CAAC,KAAMA,IAAI,KAAK,UAAW,CAAC,CAC7CG,KAAK,CAAEZ,mBAAoB,CAAC;EAE9B,oBACCD,KAAA,CAAAF,SAAA;IAAAgB,QAAA,gBACClB,IAAA,CAACP,UAAU;MACVe,OAAO,EAAGO,qBAAuB;MACjCI,SAAS,EAAC;IAA8B,CACxC,CAAC,eACFnB,IAAA,CAACP,UAAU;MACVe,OAAO,EAAGG,kBAAoB;MAC9BQ,SAAS,EAAC,mCAAmC;MAC7CC,QAAQ,EAAGb;IAAc,CACzB,CAAC,eACFP,IAAA,CAACN,YAAY;MACZc,OAAO,EAAGQ,eAAiB;MAC3BG,SAAS,EAAC,gCAAgC;MAC1CC,QAAQ,EAAGb;IAAc,CACzB,CAAC;EAAA,CACD,CAAC;AAEL;AAEA,eAAeD,OAAO","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -10,6 +9,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
11
|
import { store as editWidgetsStore } from '../../store';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
function SaveButton() {
|
|
14
14
|
const {
|
|
15
15
|
hasEditedWidgetAreaIds,
|
|
@@ -28,13 +28,14 @@ function SaveButton() {
|
|
|
28
28
|
saveEditedWidgetAreas
|
|
29
29
|
} = useDispatch(editWidgetsStore);
|
|
30
30
|
const isDisabled = isSaving || !hasEditedWidgetAreaIds;
|
|
31
|
-
return
|
|
31
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
32
32
|
variant: "primary",
|
|
33
33
|
isBusy: isSaving,
|
|
34
34
|
"aria-disabled": isDisabled,
|
|
35
35
|
onClick: isDisabled ? undefined : saveEditedWidgetAreas,
|
|
36
|
-
size: "compact"
|
|
37
|
-
|
|
36
|
+
size: "compact",
|
|
37
|
+
children: isSaving ? __('Saving…') : __('Update')
|
|
38
|
+
});
|
|
38
39
|
}
|
|
39
40
|
export default SaveButton;
|
|
40
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","__","useDispatch","useSelect","store","editWidgetsStore","SaveButton","hasEditedWidgetAreaIds","isSaving","select","getEditedWidgetAreas","isSavingWidgetAreas","length","saveEditedWidgetAreas","isDisabled","
|
|
1
|
+
{"version":3,"names":["Button","__","useDispatch","useSelect","store","editWidgetsStore","jsx","_jsx","SaveButton","hasEditedWidgetAreaIds","isSaving","select","getEditedWidgetAreas","isSavingWidgetAreas","length","saveEditedWidgetAreas","isDisabled","variant","isBusy","onClick","undefined","size","children"],"sources":["@wordpress/edit-widgets/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction SaveButton() {\n\tconst { hasEditedWidgetAreaIds, isSaving } = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas, isSavingWidgetAreas } =\n\t\t\tselect( editWidgetsStore );\n\n\t\treturn {\n\t\t\thasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,\n\t\t\tisSaving: isSavingWidgetAreas(),\n\t\t};\n\t}, [] );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tconst isDisabled = isSaving || ! hasEditedWidgetAreaIds;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tisBusy={ isSaving }\n\t\t\taria-disabled={ isDisabled }\n\t\t\tonClick={ isDisabled ? undefined : saveEditedWidgetAreas }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }\n\t\t</Button>\n\t);\n}\n\nexport default SaveButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC,sBAAsB;IAAEC;EAAS,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACrE,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEN,gBAAiB,CAAC;IAE3B,OAAO;MACNI,sBAAsB,EAAEG,oBAAoB,CAAC,CAAC,EAAEE,MAAM,GAAG,CAAC;MAC1DJ,QAAQ,EAAEG,mBAAmB,CAAC;IAC/B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEE;EAAsB,CAAC,GAAGb,WAAW,CAAEG,gBAAiB,CAAC;EAEjE,MAAMW,UAAU,GAAGN,QAAQ,IAAI,CAAED,sBAAsB;EAEvD,oBACCF,IAAA,CAACP,MAAM;IACNiB,OAAO,EAAC,SAAS;IACjBC,MAAM,EAAGR,QAAU;IACnB,iBAAgBM,UAAY;IAC5BG,OAAO,EAAGH,UAAU,GAAGI,SAAS,GAAGL,qBAAuB;IAC1DM,IAAI,EAAC,SAAS;IAAAC,QAAA,EAEZZ,QAAQ,GAAGT,EAAE,CAAE,SAAU,CAAC,GAAGA,EAAE,CAAE,QAAS;EAAC,CACtC,CAAC;AAEX;AAEA,eAAeO,UAAU","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -13,6 +12,7 @@ import { store as editWidgetsStore } from '../../store';
|
|
|
13
12
|
*/
|
|
14
13
|
import InserterSidebar from './inserter-sidebar';
|
|
15
14
|
import ListViewSidebar from './list-view-sidebar';
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export default function SecondarySidebar() {
|
|
17
17
|
const {
|
|
18
18
|
isInserterOpen,
|
|
@@ -28,10 +28,10 @@ export default function SecondarySidebar() {
|
|
|
28
28
|
};
|
|
29
29
|
}, []);
|
|
30
30
|
if (isInserterOpen) {
|
|
31
|
-
return
|
|
31
|
+
return /*#__PURE__*/_jsx(InserterSidebar, {});
|
|
32
32
|
}
|
|
33
33
|
if (isListViewOpen) {
|
|
34
|
-
return
|
|
34
|
+
return /*#__PURE__*/_jsx(ListViewSidebar, {});
|
|
35
35
|
}
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","SecondarySidebar","isInserterOpen","isListViewOpen","select","isInserterOpened","isListViewOpened"
|
|
1
|
+
{"version":3,"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","jsx","_jsx","SecondarySidebar","isInserterOpen","isListViewOpen","select","isInserterOpened","isListViewOpened"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Internal dependencies\n */\nimport InserterSidebar from './inserter-sidebar';\nimport ListViewSidebar from './list-view-sidebar';\n\nexport default function SecondarySidebar() {\n\tconst { isInserterOpen, isListViewOpen } = useSelect( ( select ) => {\n\t\tconst { isInserterOpened, isListViewOpened } =\n\t\t\tselect( editWidgetsStore );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t};\n\t}, [] );\n\n\tif ( isInserterOpen ) {\n\t\treturn <InserterSidebar />;\n\t}\n\tif ( isListViewOpen ) {\n\t\treturn <ListViewSidebar />;\n\t}\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,eAAe,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElD,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACnE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAC3CF,MAAM,CAAER,gBAAiB,CAAC;IAC3B,OAAO;MACNM,cAAc,EAAEG,gBAAgB,CAAC,CAAC;MAClCF,cAAc,EAAEG,gBAAgB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKJ,cAAc,EAAG;IACrB,oBAAOF,IAAA,CAACH,eAAe,IAAE,CAAC;EAC3B;EACA,IAAKM,cAAc,EAAG;IACrB,oBAAOH,IAAA,CAACF,eAAe,IAAE,CAAC;EAC3B;EACA,OAAO,IAAI;AACZ","ignoreList":[]}
|