@wordpress/edit-widgets 5.24.1 → 5.25.1-next.79a6196f.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/LICENSE.md +1 -1
- package/build/blocks/widget-area/index.js +1 -0
- package/build/blocks/widget-area/index.js.map +1 -1
- package/build/components/header/document-tools/index.js +19 -18
- package/build/components/header/document-tools/index.js.map +1 -1
- package/build/components/header/index.js +4 -12
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +8 -3
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +8 -3
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/layout/interface.js +2 -7
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/secondary-sidebar/index.js +2 -6
- package/build/components/secondary-sidebar/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +5 -1
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +4 -2
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/store/index.js +3 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-selectors.js +10 -0
- package/build/store/private-selectors.js.map +1 -0
- package/build/store/reducer.js +14 -0
- package/build/store/reducer.js.map +1 -1
- package/build-module/blocks/widget-area/index.js +1 -0
- package/build-module/blocks/widget-area/index.js.map +1 -1
- package/build-module/components/header/document-tools/index.js +19 -18
- package/build-module/components/header/document-tools/index.js.map +1 -1
- package/build-module/components/header/index.js +5 -13
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/undo-redo/redo.js +7 -3
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +7 -3
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/layout/interface.js +3 -8
- package/build-module/components/layout/interface.js.map +1 -1
- package/build-module/components/secondary-sidebar/index.js +2 -6
- package/build-module/components/secondary-sidebar/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +8 -6
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +6 -2
- 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 +4 -2
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/store/index.js +3 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-selectors.js +4 -0
- package/build-module/store/private-selectors.js.map +1 -0
- package/build-module/store/reducer.js +13 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +25 -5
- package/build-style/style.css +25 -5
- package/package.json +30 -29
- package/src/blocks/widget-area/block.json +1 -0
- package/src/components/header/document-tools/index.js +19 -23
- package/src/components/header/index.js +4 -9
- package/src/components/header/style.scss +25 -5
- package/src/components/header/undo-redo/redo.js +8 -3
- package/src/components/header/undo-redo/undo.js +8 -3
- package/src/components/layout/interface.js +3 -14
- package/src/components/secondary-sidebar/index.js +2 -4
- package/src/components/secondary-sidebar/list-view-sidebar.js +6 -4
- package/src/components/widget-areas-block-editor-content/index.js +4 -0
- package/src/components/widget-areas-block-editor-provider/index.js +4 -1
- package/src/store/index.js +4 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +11 -0
|
@@ -13,9 +13,7 @@ import { store as editWidgetsStore } from '../../store';
|
|
|
13
13
|
*/
|
|
14
14
|
import InserterSidebar from './inserter-sidebar';
|
|
15
15
|
import ListViewSidebar from './list-view-sidebar';
|
|
16
|
-
export default function SecondarySidebar({
|
|
17
|
-
listViewToggleElement
|
|
18
|
-
}) {
|
|
16
|
+
export default function SecondarySidebar() {
|
|
19
17
|
const {
|
|
20
18
|
isInserterOpen,
|
|
21
19
|
isListViewOpen
|
|
@@ -33,9 +31,7 @@ export default function SecondarySidebar({
|
|
|
33
31
|
return createElement(InserterSidebar, null);
|
|
34
32
|
}
|
|
35
33
|
if (isListViewOpen) {
|
|
36
|
-
return createElement(ListViewSidebar,
|
|
37
|
-
listViewToggleElement: listViewToggleElement
|
|
38
|
-
});
|
|
34
|
+
return createElement(ListViewSidebar, null);
|
|
39
35
|
}
|
|
40
36
|
return null;
|
|
41
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","SecondarySidebar","
|
|
1
|
+
{"version":3,"names":["useSelect","store","editWidgetsStore","InserterSidebar","ListViewSidebar","SecondarySidebar","isInserterOpen","isListViewOpen","select","isInserterOpened","isListViewOpened","createElement"],"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;AAEjD,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACnE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAC3CF,MAAM,CAAEN,gBAAiB,CAAC;IAC3B,OAAO;MACNI,cAAc,EAAEG,gBAAgB,CAAC,CAAC;MAClCF,cAAc,EAAEG,gBAAgB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKJ,cAAc,EAAG;IACrB,OAAOK,aAAA,CAACR,eAAe,MAAE,CAAC;EAC3B;EACA,IAAKI,cAAc,EAAG;IACrB,OAAOI,aAAA,CAACP,eAAe,MAAE,CAAC;EAC3B;EACA,OAAO,IAAI;AACZ"}
|
|
@@ -5,7 +5,7 @@ import { createElement } from "react";
|
|
|
5
5
|
import { __experimentalListView as ListView } from '@wordpress/block-editor';
|
|
6
6
|
import { Button } from '@wordpress/components';
|
|
7
7
|
import { useFocusOnMount, useMergeRefs } from '@wordpress/compose';
|
|
8
|
-
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
9
9
|
import { useCallback, useState } from '@wordpress/element';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
import { closeSmall } from '@wordpress/icons';
|
|
@@ -15,12 +15,14 @@ import { ESCAPE } from '@wordpress/keycodes';
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import { store as editWidgetsStore } from '../../store';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) {
|
|
18
|
+
import { unlock } from '../../lock-unlock';
|
|
19
|
+
export default function ListViewSidebar() {
|
|
21
20
|
const {
|
|
22
21
|
setIsListViewOpened
|
|
23
22
|
} = useDispatch(editWidgetsStore);
|
|
23
|
+
const {
|
|
24
|
+
getListViewToggleRef
|
|
25
|
+
} = unlock(useSelect(editWidgetsStore));
|
|
24
26
|
|
|
25
27
|
// Use internal state instead of a ref to make sure that the component
|
|
26
28
|
// re-renders when the dropZoneElement updates.
|
|
@@ -30,8 +32,8 @@ export default function ListViewSidebar({
|
|
|
30
32
|
// When closing the list view, focus should return to the toggle button.
|
|
31
33
|
const closeListView = useCallback(() => {
|
|
32
34
|
setIsListViewOpened(false);
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
+
getListViewToggleRef().current?.focus();
|
|
36
|
+
}, [getListViewToggleRef, setIsListViewOpened]);
|
|
35
37
|
const closeOnEscape = useCallback(event => {
|
|
36
38
|
if (event.keyCode === ESCAPE && !event.defaultPrevented) {
|
|
37
39
|
event.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useMergeRefs","useDispatch","useCallback","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","
|
|
1
|
+
{"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useMergeRefs","useDispatch","useSelect","useCallback","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","unlock","ListViewSidebar","setIsListViewOpened","getListViewToggleRef","dropZoneElement","setDropZoneElement","focusOnMountRef","closeListView","current","focus","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","createElement","className","onKeyDown","icon","label","onClick","ref"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,eAAe,EAAEC,YAAY,QAAQ,oBAAoB;AAClE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAGX,WAAW,CAAEQ,gBAAiB,CAAC;EAC/D,MAAM;IAAEI;EAAqB,CAAC,GAAGH,MAAM,CAAER,SAAS,CAAEO,gBAAiB,CAAE,CAAC;;EAExE;EACA;EACA,MAAM,CAAEK,eAAe,EAAEC,kBAAkB,CAAE,GAAGX,QAAQ,CAAE,IAAK,CAAC;EAEhE,MAAMY,eAAe,GAAGjB,eAAe,CAAE,cAAe,CAAC;;EAEzD;EACA,MAAMkB,aAAa,GAAGd,WAAW,CAAE,MAAM;IACxCS,mBAAmB,CAAE,KAAM,CAAC;IAC5BC,oBAAoB,CAAC,CAAC,CAACK,OAAO,EAAEC,KAAK,CAAC,CAAC;EACxC,CAAC,EAAE,CAAEN,oBAAoB,EAAED,mBAAmB,CAAG,CAAC;EAElD,MAAMQ,aAAa,GAAGjB,WAAW,CAC9BkB,KAAK,IAAM;IACZ,IAAKA,KAAK,CAACC,OAAO,KAAKf,MAAM,IAAI,CAAEc,KAAK,CAACE,gBAAgB,EAAG;MAC3DF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBP,aAAa,CAAC,CAAC;IAChB;EACD,CAAC,EACD,CAAEA,aAAa,CAChB,CAAC;EAED;IACC;IACAQ,aAAA;MACCC,SAAS,EAAC,sCAAsC;MAChDC,SAAS,EAAGP;IAAe,GAE3BK,aAAA;MAAKC,SAAS,EAAC;IAA6C,GAC3DD,aAAA,iBAAUpB,EAAE,CAAE,WAAY,CAAW,CAAC,EACtCoB,aAAA,CAAC3B,MAAM;MACN8B,IAAI,EAAGtB,UAAY;MACnBuB,KAAK,EAAGxB,EAAE,CAAE,OAAQ,CAAG;MACvByB,OAAO,EAAGb;IAAe,CACzB,CACG,CAAC,EACNQ,aAAA;MACCC,SAAS,EAAC,8CAA8C;MACxDK,GAAG,EAAG/B,YAAY,CAAE,CAAEgB,eAAe,EAAED,kBAAkB,CAAG;IAAG,GAE/DU,aAAA,CAAC5B,QAAQ;MAACiB,eAAe,EAAGA;IAAiB,CAAE,CAC3C,CACD;EAAC;AAER"}
|
|
@@ -2,7 +2,8 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { BlockList, BlockTools, BlockSelectionClearer, WritingFlow, __unstableEditorStyles as EditorStyles } from '@wordpress/block-editor';
|
|
5
|
+
import { BlockList, BlockToolbar, BlockTools, BlockSelectionClearer, WritingFlow, __unstableEditorStyles as EditorStyles } from '@wordpress/block-editor';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
6
7
|
import { useSelect } from '@wordpress/data';
|
|
7
8
|
import { useMemo } from '@wordpress/element';
|
|
8
9
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
@@ -16,12 +17,15 @@ export default function WidgetAreasBlockEditorContent({
|
|
|
16
17
|
blockEditorSettings
|
|
17
18
|
}) {
|
|
18
19
|
const hasThemeStyles = useSelect(select => !!select(preferencesStore).get('core/edit-widgets', 'themeStyles'), []);
|
|
20
|
+
const isLargeViewport = useViewportMatch('medium');
|
|
19
21
|
const styles = useMemo(() => {
|
|
20
22
|
return hasThemeStyles ? blockEditorSettings.styles : [];
|
|
21
23
|
}, [blockEditorSettings, hasThemeStyles]);
|
|
22
24
|
return createElement("div", {
|
|
23
25
|
className: "edit-widgets-block-editor"
|
|
24
|
-
}, createElement(Notices, null),
|
|
26
|
+
}, createElement(Notices, null), !isLargeViewport && createElement(BlockToolbar, {
|
|
27
|
+
hideDragHandle: true
|
|
28
|
+
}), createElement(BlockTools, null, createElement(KeyboardShortcuts, null), createElement(EditorStyles, {
|
|
25
29
|
styles: styles,
|
|
26
30
|
scope: ".editor-styles-wrapper"
|
|
27
31
|
}), createElement(BlockSelectionClearer, null, createElement(WritingFlow, null, createElement(BlockList, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockList","BlockTools","BlockSelectionClearer","WritingFlow","__unstableEditorStyles","EditorStyles","useSelect","useMemo","store","preferencesStore","Notices","KeyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","select","get","styles","createElement","className","scope"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\".editor-styles-wrapper\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,UAAU,EACVC,qBAAqB,EACrBC,WAAW,EACXC,sBAAsB,IAAIC,YAAY,QAChC,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,iBAAiB,MAAM,uBAAuB;AAErD,eAAe,SAASC,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGR,SAAS,CAC7BS,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEN,gBAAiB,CAAC,CAACO,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;
|
|
1
|
+
{"version":3,"names":["BlockList","BlockToolbar","BlockTools","BlockSelectionClearer","WritingFlow","__unstableEditorStyles","EditorStyles","useViewportMatch","useSelect","useMemo","store","preferencesStore","Notices","KeyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","select","get","isLargeViewport","styles","createElement","className","hideDragHandle","scope"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\".editor-styles-wrapper\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,qBAAqB,EACrBC,WAAW,EACXC,sBAAsB,IAAIC,YAAY,QAChC,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,iBAAiB,MAAM,uBAAuB;AAErD,eAAe,SAASC,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGR,SAAS,CAC7BS,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEN,gBAAiB,CAAC,CAACO,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EACD,MAAMC,eAAe,GAAGZ,gBAAgB,CAAE,QAAS,CAAC;EAEpD,MAAMa,MAAM,GAAGX,OAAO,CAAE,MAAM;IAC7B,OAAOO,cAAc,GAAGD,mBAAmB,CAACK,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEL,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACCK,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzCD,aAAA,CAACT,OAAO,MAAE,CAAC,EACT,CAAEO,eAAe,IAAIE,aAAA,CAACpB,YAAY;IAACsB,cAAc;EAAA,CAAE,CAAC,EACtDF,aAAA,CAACnB,UAAU,QACVmB,aAAA,CAACR,iBAAiB,MAAE,CAAC,EACrBQ,aAAA,CAACf,YAAY;IACZc,MAAM,EAAGA,MAAQ;IACjBI,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACFH,aAAA,CAAClB,qBAAqB,QACrBkB,aAAA,CAACjB,WAAW,QACXiB,aAAA,CAACrB,SAAS;IAACsB,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
|
|
@@ -3,6 +3,7 @@ import { createElement } from "react";
|
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { SlotFillProvider } from '@wordpress/components';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
6
7
|
import { uploadMedia } from '@wordpress/media-utils';
|
|
7
8
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
9
|
import { useEntityBlockEditor, store as coreStore, useResourcePermissions } from '@wordpress/core-data';
|
|
@@ -32,6 +33,7 @@ export default function WidgetAreasBlockEditorProvider({
|
|
|
32
33
|
...props
|
|
33
34
|
}) {
|
|
34
35
|
const mediaPermissions = useResourcePermissions('media');
|
|
36
|
+
const isLargeViewport = useViewportMatch('medium');
|
|
35
37
|
const {
|
|
36
38
|
reusableBlocks,
|
|
37
39
|
isFixedToolbarActive,
|
|
@@ -77,7 +79,7 @@ export default function WidgetAreasBlockEditorProvider({
|
|
|
77
79
|
return {
|
|
78
80
|
...blockEditorSettings,
|
|
79
81
|
__experimentalReusableBlocks: reusableBlocks,
|
|
80
|
-
hasFixedToolbar: isFixedToolbarActive,
|
|
82
|
+
hasFixedToolbar: isFixedToolbarActive || !isLargeViewport,
|
|
81
83
|
keepCaretInsideBlock,
|
|
82
84
|
mediaUpload: mediaUploadBlockEditor,
|
|
83
85
|
templateLock: 'all',
|
|
@@ -85,7 +87,7 @@ export default function WidgetAreasBlockEditorProvider({
|
|
|
85
87
|
pageOnFront,
|
|
86
88
|
pageForPosts
|
|
87
89
|
};
|
|
88
|
-
}, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
|
|
90
|
+
}, [blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
|
|
89
91
|
const widgetAreaId = useLastSelectedWidgetArea();
|
|
90
92
|
const [blocks, onInput, onChange] = useEntityBlockEditor(KIND, POST_TYPE, {
|
|
91
93
|
id: buildWidgetAreasPostId()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SlotFillProvider","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useResourcePermissions","useMemo","privateApis","blockEditorPrivateApis","editPatternsPrivateApis","preferencesStore","KeyboardShortcuts","buildWidgetAreasPostId","KIND","POST_TYPE","useLastSelectedWidgetArea","editWidgetsStore","ALLOW_REUSABLE_BLOCKS","unlock","ExperimentalBlockEditorProvider","PatternsMenuItems","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","select","canUser","getEntityRecord","getEntityRecords","siteSettings","undefined","widgetAreas","getWidgetAreas","widgets","getWidgets","get","page_on_front","page_for_posts","setIsInserterOpened","settings","mediaUploadBlockEditor","canCreate","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","blocks","onInput","onChange","id","createElement","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,oBAAoB,EACpBC,KAAK,IAAIC,SAAS,EAClBC,sBAAsB,QAChB,sBAAsB;AAC7B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,sBAAsB,EAAEC,IAAI,EAAEC,SAAS,QAAQ,mBAAmB;AAC3E,OAAOC,yBAAyB,MAAM,2CAA2C;AACjF,SAASZ,KAAK,IAAIa,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAgC,CAAC,GAAGD,MAAM,CAAEV,sBAAuB,CAAC;AAC5E,MAAM;EAAEY;AAAkB,CAAC,GAAGF,MAAM,CAAET,uBAAwB,CAAC;AAC/D,eAAe,SAASY,8BAA8BA,CAAE;EACvDC,mBAAmB;EACnBC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAGpB,sBAAsB,CAAE,OAAQ,CAAC;EAC1D,MAAM;
|
|
1
|
+
{"version":3,"names":["SlotFillProvider","useViewportMatch","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useResourcePermissions","useMemo","privateApis","blockEditorPrivateApis","editPatternsPrivateApis","preferencesStore","KeyboardShortcuts","buildWidgetAreasPostId","KIND","POST_TYPE","useLastSelectedWidgetArea","editWidgetsStore","ALLOW_REUSABLE_BLOCKS","unlock","ExperimentalBlockEditorProvider","PatternsMenuItems","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","isLargeViewport","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","select","canUser","getEntityRecord","getEntityRecords","siteSettings","undefined","widgetAreas","getWidgetAreas","widgets","getWidgets","get","page_on_front","page_for_posts","setIsInserterOpened","settings","mediaUploadBlockEditor","canCreate","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","blocks","onInput","onChange","id","createElement","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":"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"}
|
|
@@ -11,7 +11,9 @@ import reducer from './reducer';
|
|
|
11
11
|
import * as resolvers from './resolvers';
|
|
12
12
|
import * as selectors from './selectors';
|
|
13
13
|
import * as actions from './actions';
|
|
14
|
+
import * as privateSelectors from './private-selectors';
|
|
14
15
|
import { STORE_NAME } from './constants';
|
|
16
|
+
import { unlock } from '../lock-unlock';
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Block editor data store configuration.
|
|
@@ -46,4 +48,5 @@ apiFetch.use(function (options, next) {
|
|
|
46
48
|
}
|
|
47
49
|
return next(options);
|
|
48
50
|
});
|
|
51
|
+
unlock(store).registerPrivateSelectors(privateSelectors);
|
|
49
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apiFetch","createReduxStore","register","reducer","resolvers","selectors","actions","STORE_NAME","storeConfig","store","use","options","next","path","indexOf","Promise","resolve"],"sources":["@wordpress/edit-widgets/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as resolvers from './resolvers';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tresolvers,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n\n// This package uses a few in-memory post types as wrappers for convenience.\n// This middleware prevents any network requests related to these types as they are\n// bound to fail anyway.\napiFetch.use( function ( options, next ) {\n\tif ( options.path?.indexOf( '/wp/v2/types/widget-area' ) === 0 ) {\n\t\treturn Promise.resolve( {} );\n\t}\n\n\treturn next( options );\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,SAASC,UAAU,QAAQ,aAAa;;
|
|
1
|
+
{"version":3,"names":["apiFetch","createReduxStore","register","reducer","resolvers","selectors","actions","privateSelectors","STORE_NAME","unlock","storeConfig","store","use","options","next","path","indexOf","Promise","resolve","registerPrivateSelectors"],"sources":["@wordpress/edit-widgets/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as resolvers from './resolvers';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tresolvers,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n\n// This package uses a few in-memory post types as wrappers for convenience.\n// This middleware prevents any network requests related to these types as they are\n// bound to fail anyway.\napiFetch.use( function ( options, next ) {\n\tif ( options.path?.indexOf( '/wp/v2/types/widget-area' ) === 0 ) {\n\t\treturn Promise.resolve( {} );\n\t}\n\n\treturn next( options );\n} );\n\nunlock( store ).registerPrivateSelectors( privateSelectors );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,gBAAgB,MAAM,qBAAqB;AACvD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG;EACnBP,OAAO;EACPE,SAAS;EACTD,SAAS;EACTE;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,KAAK,GAAGV,gBAAgB,CAAEO,UAAU,EAAEE,WAAY,CAAC;AAChER,QAAQ,CAAES,KAAM,CAAC;;AAEjB;AACA;AACA;AACAX,QAAQ,CAACY,GAAG,CAAE,UAAWC,OAAO,EAAEC,IAAI,EAAG;EACxC,IAAKD,OAAO,CAACE,IAAI,EAAEC,OAAO,CAAE,0BAA2B,CAAC,KAAK,CAAC,EAAG;IAChE,OAAOC,OAAO,CAACC,OAAO,CAAE,CAAC,CAAE,CAAC;EAC7B;EAEA,OAAOJ,IAAI,CAAED,OAAQ,CAAC;AACvB,CAAE,CAAC;AAEHJ,MAAM,CAAEE,KAAM,CAAC,CAACQ,wBAAwB,CAAEZ,gBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getListViewToggleRef","state","listViewToggleRef"],"sources":["@wordpress/edit-widgets/src/store/private-selectors.js"],"sourcesContent":["export function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":"AAAA,OAAO,SAASA,oBAAoBA,CAAEC,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACC,iBAAiB;AAC/B"}
|
|
@@ -75,6 +75,19 @@ export function listViewPanel(state = false, action) {
|
|
|
75
75
|
}
|
|
76
76
|
return state;
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* This reducer does nothing aside initializing a ref to the list view toggle.
|
|
81
|
+
* We will have a unique ref per "editor" instance.
|
|
82
|
+
*
|
|
83
|
+
* @param {Object} state
|
|
84
|
+
* @return {Object} Reference to the list view toggle button.
|
|
85
|
+
*/
|
|
86
|
+
export function listViewToggleRef(state = {
|
|
87
|
+
current: null
|
|
88
|
+
}) {
|
|
89
|
+
return state;
|
|
90
|
+
}
|
|
78
91
|
export default combineReducers({
|
|
79
92
|
blockInserterPanel,
|
|
80
93
|
listViewPanel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["combineReducers","widgetAreasOpenState","state","action","type","clientId","isOpen","blockInserterPanel","value","listViewPanel"],"sources":["@wordpress/edit-widgets/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Controls the open state of the widget areas.\n *\n * @param {Object} state Redux state.\n * @param {Object} action Redux action.\n *\n * @return {Array} Updated state.\n */\nexport function widgetAreasOpenState( state = {}, action ) {\n\tconst { type } = action;\n\tswitch ( type ) {\n\t\tcase 'SET_WIDGET_AREAS_OPEN_STATE': {\n\t\t\treturn action.widgetAreasOpenState;\n\t\t}\n\t\tcase 'SET_IS_WIDGET_AREA_OPEN': {\n\t\t\tconst { clientId, isOpen } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ clientId ]: isOpen,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n\tlistViewPanel,\n\twidgetAreasOpenState,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGD,MAAM;EACvB,QAASC,IAAI;IACZ,KAAK,6BAA6B;MAAE;QACnC,OAAOD,MAAM,CAACF,oBAAoB;MACnC;IACA,KAAK,yBAAyB;MAAE;QAC/B,MAAM;UAAEI,QAAQ;UAAEC;QAAO,CAAC,GAAGH,MAAM;QACnC,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,QAAQ,GAAIC;QACf,CAAC;MACF;IACA;MAAS;QACR,OAAOJ,KAAK;MACb;EACD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,kBAAkBA,CAAEL,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC3D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACG,MAAM,GAAG,KAAK,GAAGJ,KAAK;IACrC,KAAK,wBAAwB;MAC5B,OAAOC,MAAM,CAACK,KAAK;EACrB;EACA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAOD,MAAM,CAACK,KAAK,GAAG,KAAK,GAAGN,KAAK;IACpC,KAAK,yBAAyB;MAC7B,OAAOC,MAAM,CAACG,MAAM;EACtB;EACA,OAAOJ,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BO,kBAAkB;EAClBE,aAAa;EACbR;AACD,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["combineReducers","widgetAreasOpenState","state","action","type","clientId","isOpen","blockInserterPanel","value","listViewPanel","listViewToggleRef","current"],"sources":["@wordpress/edit-widgets/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Controls the open state of the widget areas.\n *\n * @param {Object} state Redux state.\n * @param {Object} action Redux action.\n *\n * @return {Array} Updated state.\n */\nexport function widgetAreasOpenState( state = {}, action ) {\n\tconst { type } = action;\n\tswitch ( type ) {\n\t\tcase 'SET_WIDGET_AREAS_OPEN_STATE': {\n\t\t\treturn action.widgetAreasOpenState;\n\t\t}\n\t\tcase 'SET_IS_WIDGET_AREA_OPEN': {\n\t\t\tconst { clientId, isOpen } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ clientId ]: isOpen,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the list view toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the list view toggle button.\n */\nexport function listViewToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n\tlistViewPanel,\n\twidgetAreasOpenState,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGD,MAAM;EACvB,QAASC,IAAI;IACZ,KAAK,6BAA6B;MAAE;QACnC,OAAOD,MAAM,CAACF,oBAAoB;MACnC;IACA,KAAK,yBAAyB;MAAE;QAC/B,MAAM;UAAEI,QAAQ;UAAEC;QAAO,CAAC,GAAGH,MAAM;QACnC,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,QAAQ,GAAIC;QACf,CAAC;MACF;IACA;MAAS;QACR,OAAOJ,KAAK;MACb;EACD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,kBAAkBA,CAAEL,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC3D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACG,MAAM,GAAG,KAAK,GAAGJ,KAAK;IACrC,KAAK,wBAAwB;MAC5B,OAAOC,MAAM,CAACK,KAAK;EACrB;EACA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAOD,MAAM,CAACK,KAAK,GAAG,KAAK,GAAGN,KAAK;IACpC,KAAK,yBAAyB;MAC7B,OAAOC,MAAM,CAACG,MAAM;EACtB;EACA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,iBAAiBA,CAAER,KAAK,GAAG;EAAES,OAAO,EAAE;AAAK,CAAC,EAAG;EAC9D,OAAOT,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BO,kBAAkB;EAClBE,aAAa;EACbR;AACD,CAAE,CAAC"}
|
|
@@ -468,7 +468,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
468
468
|
|
|
469
469
|
.interface-pinned-items {
|
|
470
470
|
display: flex;
|
|
471
|
-
gap:
|
|
471
|
+
gap: 8px;
|
|
472
472
|
margin-left: -4px;
|
|
473
473
|
}
|
|
474
474
|
.interface-pinned-items .components-button {
|
|
@@ -569,6 +569,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
569
569
|
color: #757575;
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
+
.interface-preferences-modal__section:has(.interface-preferences-modal__section-content:empty) {
|
|
573
|
+
display: none;
|
|
574
|
+
}
|
|
575
|
+
|
|
572
576
|
.interface-preferences-modal__option + .interface-preferences-modal__option {
|
|
573
577
|
margin-top: 16px;
|
|
574
578
|
}
|
|
@@ -648,8 +652,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
648
652
|
.edit-widgets-header .selected-block-tools-wrapper {
|
|
649
653
|
overflow-x: hidden;
|
|
650
654
|
}
|
|
651
|
-
.edit-widgets-header .block-editor-block-contextual-toolbar
|
|
652
|
-
border:
|
|
655
|
+
.edit-widgets-header .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
|
|
656
|
+
border-bottom: 0;
|
|
657
|
+
}
|
|
658
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group,
|
|
659
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar {
|
|
660
|
+
border-left: none;
|
|
661
|
+
}
|
|
662
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group::after,
|
|
663
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar::after {
|
|
664
|
+
content: "";
|
|
665
|
+
width: 1px;
|
|
666
|
+
margin-top: 12px;
|
|
667
|
+
margin-bottom: 12px;
|
|
668
|
+
background-color: #ddd;
|
|
669
|
+
margin-right: 8px;
|
|
670
|
+
}
|
|
671
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
|
|
672
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
|
|
673
|
+
display: none;
|
|
653
674
|
}
|
|
654
675
|
|
|
655
676
|
.edit-widgets-header__navigable-toolbar-wrapper {
|
|
@@ -657,7 +678,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
657
678
|
align-items: center;
|
|
658
679
|
justify-content: center;
|
|
659
680
|
flex-shrink: 2;
|
|
660
|
-
overflow-x: hidden;
|
|
661
681
|
padding-right: 16px;
|
|
662
682
|
}
|
|
663
683
|
|
|
@@ -680,7 +700,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
680
700
|
}
|
|
681
701
|
|
|
682
702
|
.edit-widgets-header-toolbar {
|
|
683
|
-
|
|
703
|
+
gap: 8px;
|
|
684
704
|
}
|
|
685
705
|
.edit-widgets-header-toolbar > .components-button.has-icon.has-icon.has-icon,
|
|
686
706
|
.edit-widgets-header-toolbar > .components-dropdown > .components-button.has-icon.has-icon {
|
package/build-style/style.css
CHANGED
|
@@ -468,7 +468,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
468
468
|
|
|
469
469
|
.interface-pinned-items {
|
|
470
470
|
display: flex;
|
|
471
|
-
gap:
|
|
471
|
+
gap: 8px;
|
|
472
472
|
margin-right: -4px;
|
|
473
473
|
}
|
|
474
474
|
.interface-pinned-items .components-button {
|
|
@@ -569,6 +569,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
569
569
|
color: #757575;
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
+
.interface-preferences-modal__section:has(.interface-preferences-modal__section-content:empty) {
|
|
573
|
+
display: none;
|
|
574
|
+
}
|
|
575
|
+
|
|
572
576
|
.interface-preferences-modal__option + .interface-preferences-modal__option {
|
|
573
577
|
margin-top: 16px;
|
|
574
578
|
}
|
|
@@ -648,8 +652,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
648
652
|
.edit-widgets-header .selected-block-tools-wrapper {
|
|
649
653
|
overflow-x: hidden;
|
|
650
654
|
}
|
|
651
|
-
.edit-widgets-header .block-editor-block-contextual-toolbar
|
|
652
|
-
border:
|
|
655
|
+
.edit-widgets-header .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
|
|
656
|
+
border-bottom: 0;
|
|
657
|
+
}
|
|
658
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group,
|
|
659
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar {
|
|
660
|
+
border-right: none;
|
|
661
|
+
}
|
|
662
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group::after,
|
|
663
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar::after {
|
|
664
|
+
content: "";
|
|
665
|
+
width: 1px;
|
|
666
|
+
margin-top: 12px;
|
|
667
|
+
margin-bottom: 12px;
|
|
668
|
+
background-color: #ddd;
|
|
669
|
+
margin-left: 8px;
|
|
670
|
+
}
|
|
671
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
|
|
672
|
+
.edit-widgets-header .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
|
|
673
|
+
display: none;
|
|
653
674
|
}
|
|
654
675
|
|
|
655
676
|
.edit-widgets-header__navigable-toolbar-wrapper {
|
|
@@ -657,7 +678,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
657
678
|
align-items: center;
|
|
658
679
|
justify-content: center;
|
|
659
680
|
flex-shrink: 2;
|
|
660
|
-
overflow-x: hidden;
|
|
661
681
|
padding-left: 16px;
|
|
662
682
|
}
|
|
663
683
|
|
|
@@ -680,7 +700,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
680
700
|
}
|
|
681
701
|
|
|
682
702
|
.edit-widgets-header-toolbar {
|
|
683
|
-
|
|
703
|
+
gap: 8px;
|
|
684
704
|
}
|
|
685
705
|
.edit-widgets-header-toolbar > .components-button.has-icon.has-icon.has-icon,
|
|
686
706
|
.edit-widgets-header-toolbar > .components-dropdown > .components-button.has-icon.has-icon {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.1-next.79a6196f.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,33 +27,34 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/api-fetch": "^6.
|
|
31
|
-
"@wordpress/block-editor": "^12.
|
|
32
|
-
"@wordpress/block-library": "^8.
|
|
33
|
-
"@wordpress/blocks": "^12.
|
|
34
|
-
"@wordpress/components": "^25.
|
|
35
|
-
"@wordpress/compose": "^6.
|
|
36
|
-
"@wordpress/core-data": "^6.
|
|
37
|
-
"@wordpress/data": "^9.
|
|
38
|
-
"@wordpress/deprecated": "^3.
|
|
39
|
-
"@wordpress/dom": "^3.
|
|
40
|
-
"@wordpress/element": "^5.
|
|
41
|
-
"@wordpress/hooks": "^3.
|
|
42
|
-
"@wordpress/i18n": "^4.
|
|
43
|
-
"@wordpress/icons": "^9.
|
|
44
|
-
"@wordpress/interface": "^5.
|
|
45
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
46
|
-
"@wordpress/keycodes": "^3.
|
|
47
|
-
"@wordpress/media-utils": "^4.
|
|
48
|
-
"@wordpress/notices": "^4.
|
|
49
|
-
"@wordpress/patterns": "^1.
|
|
50
|
-
"@wordpress/plugins": "^6.
|
|
51
|
-
"@wordpress/preferences": "^3.
|
|
52
|
-
"@wordpress/private-apis": "^0.
|
|
53
|
-
"@wordpress/reusable-blocks": "^4.
|
|
54
|
-
"@wordpress/url": "^3.
|
|
55
|
-
"@wordpress/widgets": "^3.
|
|
56
|
-
"classnames": "^2.3.1"
|
|
30
|
+
"@wordpress/api-fetch": "^6.45.1-next.79a6196f.0",
|
|
31
|
+
"@wordpress/block-editor": "^12.16.1-next.79a6196f.0",
|
|
32
|
+
"@wordpress/block-library": "^8.25.1-next.79a6196f.0",
|
|
33
|
+
"@wordpress/blocks": "^12.25.1-next.79a6196f.0",
|
|
34
|
+
"@wordpress/components": "^25.15.1-next.79a6196f.0",
|
|
35
|
+
"@wordpress/compose": "^6.25.1-next.79a6196f.0",
|
|
36
|
+
"@wordpress/core-data": "^6.25.1-next.79a6196f.0",
|
|
37
|
+
"@wordpress/data": "^9.18.1-next.79a6196f.0",
|
|
38
|
+
"@wordpress/deprecated": "^3.48.1-next.79a6196f.0",
|
|
39
|
+
"@wordpress/dom": "^3.48.1-next.79a6196f.0",
|
|
40
|
+
"@wordpress/element": "^5.25.1-next.79a6196f.0",
|
|
41
|
+
"@wordpress/hooks": "^3.48.1-next.79a6196f.0",
|
|
42
|
+
"@wordpress/i18n": "^4.48.1-next.79a6196f.0",
|
|
43
|
+
"@wordpress/icons": "^9.39.1-next.79a6196f.0",
|
|
44
|
+
"@wordpress/interface": "^5.25.1-next.79a6196f.0",
|
|
45
|
+
"@wordpress/keyboard-shortcuts": "^4.25.1-next.79a6196f.0",
|
|
46
|
+
"@wordpress/keycodes": "^3.48.1-next.79a6196f.0",
|
|
47
|
+
"@wordpress/media-utils": "^4.39.1-next.79a6196f.0",
|
|
48
|
+
"@wordpress/notices": "^4.16.1-next.79a6196f.0",
|
|
49
|
+
"@wordpress/patterns": "^1.9.1-next.79a6196f.0",
|
|
50
|
+
"@wordpress/plugins": "^6.16.1-next.79a6196f.0",
|
|
51
|
+
"@wordpress/preferences": "^3.25.1-next.79a6196f.0",
|
|
52
|
+
"@wordpress/private-apis": "^0.30.1-next.79a6196f.0",
|
|
53
|
+
"@wordpress/reusable-blocks": "^4.25.1-next.79a6196f.0",
|
|
54
|
+
"@wordpress/url": "^3.49.1-next.79a6196f.0",
|
|
55
|
+
"@wordpress/widgets": "^3.25.1-next.79a6196f.0",
|
|
56
|
+
"classnames": "^2.3.1",
|
|
57
|
+
"rememo": "^4.0.2"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"react": "^18.0.0",
|
|
@@ -62,5 +63,5 @@
|
|
|
62
63
|
"publishConfig": {
|
|
63
64
|
"access": "public"
|
|
64
65
|
},
|
|
65
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "1e74b942ac0119a22ceaaf5c9594263f3ec516ab"
|
|
66
67
|
}
|
|
@@ -22,9 +22,9 @@ import useLastSelectedWidgetArea from '../../../hooks/use-last-selected-widget-a
|
|
|
22
22
|
import { store as editWidgetsStore } from '../../../store';
|
|
23
23
|
import { unlock } from '../../../lock-unlock';
|
|
24
24
|
|
|
25
|
-
const {
|
|
25
|
+
const { useCanBlockToolbarBeFocused } = unlock( blockEditorPrivateApis );
|
|
26
26
|
|
|
27
|
-
function DocumentTools(
|
|
27
|
+
function DocumentTools() {
|
|
28
28
|
const isMediumViewport = useViewportMatch( 'medium' );
|
|
29
29
|
const inserterButton = useRef();
|
|
30
30
|
const widgetAreaClientId = useLastSelectedWidgetArea();
|
|
@@ -35,14 +35,18 @@ function DocumentTools( { setListViewToggleElement } ) {
|
|
|
35
35
|
),
|
|
36
36
|
[ widgetAreaClientId ]
|
|
37
37
|
);
|
|
38
|
-
const { isInserterOpen, isListViewOpen } = useSelect(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
const { isInserterOpen, isListViewOpen, listViewToggleRef } = useSelect(
|
|
39
|
+
( select ) => {
|
|
40
|
+
const { isInserterOpened, isListViewOpened, getListViewToggleRef } =
|
|
41
|
+
unlock( select( editWidgetsStore ) );
|
|
42
|
+
return {
|
|
43
|
+
isInserterOpen: isInserterOpened(),
|
|
44
|
+
isListViewOpen: isListViewOpened(),
|
|
45
|
+
listViewToggleRef: getListViewToggleRef(),
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
46
50
|
const { setIsWidgetAreaOpen, setIsInserterOpened, setIsListViewOpened } =
|
|
47
51
|
useDispatch( editWidgetsStore );
|
|
48
52
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
@@ -71,23 +75,15 @@ function DocumentTools( { setListViewToggleElement } ) {
|
|
|
71
75
|
[ setIsListViewOpened, isListViewOpen ]
|
|
72
76
|
);
|
|
73
77
|
|
|
74
|
-
const {
|
|
75
|
-
shouldShowContextualToolbar,
|
|
76
|
-
canFocusHiddenToolbar,
|
|
77
|
-
fixedToolbarCanBeFocused,
|
|
78
|
-
} = useShouldContextualToolbarShow();
|
|
79
78
|
// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
|
|
80
|
-
|
|
81
|
-
const blockToolbarCanBeFocused =
|
|
82
|
-
shouldShowContextualToolbar ||
|
|
83
|
-
canFocusHiddenToolbar ||
|
|
84
|
-
fixedToolbarCanBeFocused;
|
|
79
|
+
const blockToolbarCanBeFocused = useCanBlockToolbarBeFocused();
|
|
85
80
|
|
|
86
81
|
return (
|
|
87
82
|
<NavigableToolbar
|
|
88
83
|
className="edit-widgets-header-toolbar"
|
|
89
84
|
aria-label={ __( 'Document tools' ) }
|
|
90
85
|
shouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }
|
|
86
|
+
variant="unstyled"
|
|
91
87
|
>
|
|
92
88
|
<ToolbarItem
|
|
93
89
|
ref={ inserterButton }
|
|
@@ -109,8 +105,8 @@ function DocumentTools( { setListViewToggleElement } ) {
|
|
|
109
105
|
/>
|
|
110
106
|
{ isMediumViewport && (
|
|
111
107
|
<>
|
|
112
|
-
<UndoButton />
|
|
113
|
-
<RedoButton />
|
|
108
|
+
<ToolbarItem as={ UndoButton } />
|
|
109
|
+
<ToolbarItem as={ RedoButton } />
|
|
114
110
|
<ToolbarItem
|
|
115
111
|
as={ Button }
|
|
116
112
|
className="edit-widgets-header-toolbar__list-view-toggle"
|
|
@@ -119,7 +115,7 @@ function DocumentTools( { setListViewToggleElement } ) {
|
|
|
119
115
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
120
116
|
label={ __( 'List View' ) }
|
|
121
117
|
onClick={ toggleListView }
|
|
122
|
-
ref={
|
|
118
|
+
ref={ listViewToggleRef }
|
|
123
119
|
/>
|
|
124
120
|
</>
|
|
125
121
|
) }
|