@wordpress/edit-widgets 5.18.1-next.5a1d1283.0 → 5.19.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/header/index.js +5 -2
  3. package/build/components/header/index.js.map +1 -1
  4. package/build/components/layout/interface.js +7 -2
  5. package/build/components/layout/interface.js.map +1 -1
  6. package/build/components/secondary-sidebar/index.js +6 -2
  7. package/build/components/secondary-sidebar/index.js.map +1 -1
  8. package/build/components/secondary-sidebar/list-view-sidebar.js +15 -10
  9. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  10. package/build/components/widget-areas-block-editor-content/index.js +2 -1
  11. package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
  12. package/build/components/widget-areas-block-editor-provider/index.js +3 -4
  13. package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
  14. package/build-module/components/header/index.js +5 -2
  15. package/build-module/components/header/index.js.map +1 -1
  16. package/build-module/components/layout/interface.js +8 -3
  17. package/build-module/components/layout/interface.js.map +1 -1
  18. package/build-module/components/secondary-sidebar/index.js +6 -2
  19. package/build-module/components/secondary-sidebar/index.js.map +1 -1
  20. package/build-module/components/secondary-sidebar/list-view-sidebar.js +17 -12
  21. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  22. package/build-module/components/widget-areas-block-editor-content/index.js +2 -1
  23. package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
  24. package/build-module/components/widget-areas-block-editor-provider/index.js +2 -3
  25. package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
  26. package/build-style/style-rtl.css +103 -4
  27. package/build-style/style.css +103 -4
  28. package/package.json +28 -28
  29. package/src/components/header/index.js +2 -1
  30. package/src/components/header/style.scss +2 -2
  31. package/src/components/layout/interface.js +14 -3
  32. package/src/components/secondary-sidebar/index.js +4 -2
  33. package/src/components/secondary-sidebar/list-view-sidebar.js +21 -25
  34. package/src/components/widget-areas-block-editor-content/index.js +4 -1
  35. package/src/components/widget-areas-block-editor-content/style.scss +99 -2
  36. package/src/components/widget-areas-block-editor-provider/index.js +13 -16
@@ -4,9 +4,9 @@ import { createElement } from "@wordpress/element";
4
4
  */
5
5
  import { __experimentalListView as ListView } from '@wordpress/block-editor';
6
6
  import { Button } from '@wordpress/components';
7
- import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
7
+ import { useFocusOnMount, useMergeRefs } from '@wordpress/compose';
8
8
  import { useDispatch } from '@wordpress/data';
9
- import { useState } from '@wordpress/element';
9
+ import { useCallback, useState } from '@wordpress/element';
10
10
  import { __ } from '@wordpress/i18n';
11
11
  import { closeSmall } from '@wordpress/icons';
12
12
  import { ESCAPE } from '@wordpress/keycodes';
@@ -15,7 +15,9 @@ import { ESCAPE } from '@wordpress/keycodes';
15
15
  * Internal dependencies
16
16
  */
17
17
  import { store as editWidgetsStore } from '../../store';
18
- export default function ListViewSidebar() {
18
+ export default function ListViewSidebar({
19
+ listViewToggleElement
20
+ }) {
19
21
  const {
20
22
  setIsListViewOpened
21
23
  } = useDispatch(editWidgetsStore);
@@ -24,29 +26,32 @@ export default function ListViewSidebar() {
24
26
  // re-renders when the dropZoneElement updates.
25
27
  const [dropZoneElement, setDropZoneElement] = useState(null);
26
28
  const focusOnMountRef = useFocusOnMount('firstElement');
27
- const headerFocusReturnRef = useFocusReturn();
28
- const contentFocusReturnRef = useFocusReturn();
29
- function closeOnEscape(event) {
29
+
30
+ // When closing the list view, focus should return to the toggle button.
31
+ const closeListView = useCallback(() => {
32
+ setIsListViewOpened(false);
33
+ listViewToggleElement?.focus();
34
+ }, [listViewToggleElement, setIsListViewOpened]);
35
+ const closeOnEscape = useCallback(event => {
30
36
  if (event.keyCode === ESCAPE && !event.defaultPrevented) {
31
37
  event.preventDefault();
32
- setIsListViewOpened(false);
38
+ closeListView();
33
39
  }
34
- }
40
+ }, [closeListView]);
35
41
  return (
36
42
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
37
43
  createElement("div", {
38
44
  className: "edit-widgets-editor__list-view-panel",
39
45
  onKeyDown: closeOnEscape
40
46
  }, createElement("div", {
41
- className: "edit-widgets-editor__list-view-panel-header",
42
- ref: headerFocusReturnRef
47
+ className: "edit-widgets-editor__list-view-panel-header"
43
48
  }, createElement("strong", null, __('List View')), createElement(Button, {
44
49
  icon: closeSmall,
45
50
  label: __('Close'),
46
- onClick: () => setIsListViewOpened(false)
51
+ onClick: closeListView
47
52
  })), createElement("div", {
48
53
  className: "edit-widgets-editor__list-view-panel-content",
49
- ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef, setDropZoneElement])
54
+ ref: useMergeRefs([focusOnMountRef, setDropZoneElement])
50
55
  }, createElement(ListView, {
51
56
  dropZoneElement: dropZoneElement
52
57
  })))
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","ListViewSidebar","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","createElement","className","onKeyDown","ref","icon","label","onClick"],"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 {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { 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';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( 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\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\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\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\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={ () => setIsListViewOpened( false ) }\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( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t] ) }\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,SACCC,eAAe,EACfC,cAAc,EACdC,YAAY,QACN,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,QAA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,CACjB;IAAG,GAELS,aAAA,CAACxB,QAAQ;MAACc,eAAe,EAAGA;IAAiB,CAAE,CAC3C,CACD;EAAC;AAER"}
1
+ {"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useMergeRefs","useDispatch","useCallback","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","ListViewSidebar","listViewToggleElement","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","closeListView","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 } 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';\n\nexport default function ListViewSidebar( { listViewToggleElement } ) {\n\tconst { setIsListViewOpened } = useDispatch( 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\tlistViewToggleElement?.focus();\n\t}, [ listViewToggleElement, 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,QAAQ,iBAAiB;AAC7C,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;AAEvD,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAsB,CAAC,EAAG;EACpE,MAAM;IAAEC;EAAoB,CAAC,GAAGV,WAAW,CAAEO,gBAAiB,CAAC;;EAE/D;EACA;EACA,MAAM,CAAEI,eAAe,EAAEC,kBAAkB,CAAE,GAAGV,QAAQ,CAAE,IAAK,CAAC;EAEhE,MAAMW,eAAe,GAAGf,eAAe,CAAE,cAAe,CAAC;;EAEzD;EACA,MAAMgB,aAAa,GAAGb,WAAW,CAAE,MAAM;IACxCS,mBAAmB,CAAE,KAAM,CAAC;IAC5BD,qBAAqB,EAAEM,KAAK,CAAC,CAAC;EAC/B,CAAC,EAAE,CAAEN,qBAAqB,EAAEC,mBAAmB,CAAG,CAAC;EAEnD,MAAMM,aAAa,GAAGf,WAAW,CAC9BgB,KAAK,IAAM;IACZ,IAAKA,KAAK,CAACC,OAAO,KAAKb,MAAM,IAAI,CAAEY,KAAK,CAACE,gBAAgB,EAAG;MAC3DF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBN,aAAa,CAAC,CAAC;IAChB;EACD,CAAC,EACD,CAAEA,aAAa,CAChB,CAAC;EAED;IACC;IACAO,aAAA;MACCC,SAAS,EAAC,sCAAsC;MAChDC,SAAS,EAAGP;IAAe,GAE3BK,aAAA;MAAKC,SAAS,EAAC;IAA6C,GAC3DD,aAAA,iBAAUlB,EAAE,CAAE,WAAY,CAAW,CAAC,EACtCkB,aAAA,CAACxB,MAAM;MACN2B,IAAI,EAAGpB,UAAY;MACnBqB,KAAK,EAAGtB,EAAE,CAAE,OAAQ,CAAG;MACvBuB,OAAO,EAAGZ;IAAe,CACzB,CACG,CAAC,EACNO,aAAA;MACCC,SAAS,EAAC,8CAA8C;MACxDK,GAAG,EAAG5B,YAAY,CAAE,CAAEc,eAAe,EAAED,kBAAkB,CAAG;IAAG,GAE/DS,aAAA,CAACzB,QAAQ;MAACe,eAAe,EAAGA;IAAiB,CAAE,CAC3C,CACD;EAAC;AAER"}
@@ -22,7 +22,8 @@ export default function WidgetAreasBlockEditorContent({
22
22
  return createElement("div", {
23
23
  className: "edit-widgets-block-editor"
24
24
  }, createElement(Notices, null), createElement(BlockTools, null, createElement(KeyboardShortcuts, null), createElement(EditorStyles, {
25
- styles: styles
25
+ styles: styles,
26
+ scope: ".editor-styles-wrapper"
26
27
  }), createElement(BlockSelectionClearer, null, createElement(WritingFlow, null, createElement(BlockList, {
27
28
  className: "edit-widgets-main-block-list"
28
29
  })))));
@@ -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"],"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 styles={ styles } />\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;EAED,MAAMC,MAAM,GAAGV,OAAO,CAAE,MAAM;IAC7B,OAAOO,cAAc,GAAGD,mBAAmB,CAACI,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEJ,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACCI,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzCD,aAAA,CAACR,OAAO,MAAE,CAAC,EACXQ,aAAA,CAACjB,UAAU,QACViB,aAAA,CAACP,iBAAiB,MAAE,CAAC,EACrBO,aAAA,CAACb,YAAY;IAACY,MAAM,EAAGA;EAAQ,CAAE,CAAC,EAClCC,aAAA,CAAChB,qBAAqB,QACrBgB,aAAA,CAACf,WAAW,QACXe,aAAA,CAAClB,SAAS;IAACmB,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
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;EAED,MAAMC,MAAM,GAAGV,OAAO,CAAE,MAAM;IAC7B,OAAOO,cAAc,GAAGD,mBAAmB,CAACI,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEJ,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACCI,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzCD,aAAA,CAACR,OAAO,MAAE,CAAC,EACXQ,aAAA,CAACjB,UAAU,QACViB,aAAA,CAACP,iBAAiB,MAAE,CAAC,EACrBO,aAAA,CAACb,YAAY;IACZY,MAAM,EAAGA,MAAQ;IACjBG,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACFF,aAAA,CAAChB,qBAAqB,QACrBgB,aAAA,CAACf,WAAW,QACXe,aAAA,CAAClB,SAAS;IAACmB,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
@@ -9,7 +9,6 @@ import { useEntityBlockEditor, store as coreStore, useResourcePermissions } from
9
9
  import { useMemo } from '@wordpress/element';
10
10
  import { CopyHandler, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
11
11
  import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
12
- import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
13
12
  import { store as preferencesStore } from '@wordpress/preferences';
14
13
 
15
14
  /**
@@ -77,7 +76,7 @@ export default function WidgetAreasBlockEditorProvider({
77
76
  const [blocks, onInput, onChange] = useEntityBlockEditor(KIND, POST_TYPE, {
78
77
  id: buildWidgetAreasPostId()
79
78
  });
80
- return createElement(ShortcutProvider, null, createElement(KeyboardShortcuts.Register, null), createElement(SlotFillProvider, null, createElement(ExperimentalBlockEditorProvider, {
79
+ return createElement(SlotFillProvider, null, createElement(KeyboardShortcuts.Register, null), createElement(ExperimentalBlockEditorProvider, {
81
80
  value: blocks,
82
81
  onInput: onInput,
83
82
  onChange: onChange,
@@ -86,6 +85,6 @@ export default function WidgetAreasBlockEditorProvider({
86
85
  ...props
87
86
  }, createElement(CopyHandler, null, children), createElement(PatternsMenuItems, {
88
87
  rootClientId: widgetAreaId
89
- }))));
88
+ })));
90
89
  }
91
90
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SlotFillProvider","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useResourcePermissions","useMemo","CopyHandler","privateApis","blockEditorPrivateApis","editPatternsPrivateApis","ShortcutProvider","preferencesStore","KeyboardShortcuts","buildWidgetAreasPostId","KIND","POST_TYPE","useLastSelectedWidgetArea","editWidgetsStore","ALLOW_REUSABLE_BLOCKS","unlock","ExperimentalBlockEditorProvider","PatternsMenuItems","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","select","widgetAreas","getWidgetAreas","widgets","getWidgets","getEntityRecords","get","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 {\n\tCopyHandler,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\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 { reusableBlocks, isFixedToolbarActive, keepCaretInsideBlock } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block'\n\t\t\t\t\t )\n\t\t\t\t\t: [],\n\t\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'fixedToolbar'\n\t\t\t\t),\n\t\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'keepCaretInsideBlock'\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[]\n\t\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};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\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<ShortcutProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<SlotFillProvider>\n\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<CopyHandler>{ children }</CopyHandler>\n\t\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AAC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O,EAAEC,QAAQ,CAAE,GAAGrD,oBAAoB,CACzDa,IAAI,EACJC,SAAS,EACT;IAAEwC,EAAE,EAAE1C,sBAAsB,CAAC;EAAE,CAChC,CAAC;EAED,OACC2C,aAAA,CAAC9C,gBAAgB,QAChB8C,aAAA,CAAC5C,iBAAiB,CAAC6C,QAAQ,MAAE,CAAC,EAC9BD,aAAA,CAAC3D,gBAAgB,QAChB2D,aAAA,CAACpC,+BAA+B;IAC/BsC,KAAK,EAAGN,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBhB,QAAQ,EAAGA,QAAU;IACrBqB,cAAc,EAAG,KAAO;IAAA,GACnBlC;EAAK,GAEV+B,aAAA,CAAClD,WAAW,QAAGkB,QAAuB,CAAC,EACvCgC,aAAA,CAACnC,iBAAiB;IAACuC,YAAY,EAAGT;EAAc,CAAE,CAClB,CAChB,CACD,CAAC;AAErB"}
1
+ {"version":3,"names":["SlotFillProvider","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useResourcePermissions","useMemo","CopyHandler","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","select","widgetAreas","getWidgetAreas","widgets","getWidgets","getEntityRecords","get","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 {\n\tCopyHandler,\n\tprivateApis as blockEditorPrivateApis,\n} 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 { reusableBlocks, isFixedToolbarActive, keepCaretInsideBlock } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block'\n\t\t\t\t\t )\n\t\t\t\t\t: [],\n\t\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'fixedToolbar'\n\t\t\t\t),\n\t\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-widgets',\n\t\t\t\t\t'keepCaretInsideBlock'\n\t\t\t\t),\n\t\t\t} ),\n\t\t\t[]\n\t\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};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\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<CopyHandler>{ children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AmB,CAClB,CAAC;EAEH,MAAMc,YAAY,GAAGnC,yBAAyB,CAAC,CAAC;EAEhD,MAAM,CAAEoC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGpD,oBAAoB,CACzDY,IAAI,EACJC,SAAS,EACT;IAAEwC,EAAE,EAAE1C,sBAAsB,CAAC;EAAE,CAChC,CAAC;EAED,OACC2C,aAAA,CAAC1D,gBAAgB,QAChB0D,aAAA,CAAC5C,iBAAiB,CAAC6C,QAAQ,MAAE,CAAC,EAC9BD,aAAA,CAACpC,+BAA+B;IAC/BsC,KAAK,EAAGN,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBhB,QAAQ,EAAGA,QAAU;IACrBqB,cAAc,EAAG,KAAO;IAAA,GACnBlC;EAAK,GAEV+B,aAAA,CAACjD,WAAW,QAAGiB,QAAuB,CAAC,EACvCgC,aAAA,CAACnC,iBAAiB;IAACuC,YAAY,EAAGT;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB"}
@@ -475,7 +475,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
475
475
  display: none;
476
476
  margin: 0;
477
477
  }
478
- .interface-pinned-items .components-button:nth-last-child(1), .interface-pinned-items .components-button:nth-last-child(2) {
478
+ .interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"], .interface-pinned-items .components-button[aria-controls="edit-site:global-styles"] {
479
479
  display: flex;
480
480
  }
481
481
  .interface-pinned-items .components-button svg {
@@ -637,7 +637,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
637
637
  align-items: center;
638
638
  justify-content: space-between;
639
639
  height: 60px;
640
- padding: 0 16px;
641
640
  overflow: auto;
642
641
  background: #fff;
643
642
  }
@@ -651,6 +650,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
651
650
  display: flex;
652
651
  align-items: center;
653
652
  justify-content: center;
653
+ padding-right: 16px;
654
654
  }
655
655
 
656
656
  .edit-widgets-header__title {
@@ -662,6 +662,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
662
662
  .edit-widgets-header__actions {
663
663
  display: flex;
664
664
  align-items: center;
665
+ padding-left: 16px;
665
666
  gap: 4px;
666
667
  }
667
668
  @media (min-width: 600px) {
@@ -989,8 +990,7 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
989
990
  flex-grow: 1;
990
991
  }
991
992
  .edit-widgets-block-editor > div:last-of-type,
992
- .edit-widgets-block-editor .block-editor-writing-flow,
993
- .edit-widgets-block-editor .block-editor-writing-flow > div {
993
+ .edit-widgets-block-editor .block-editor-writing-flow {
994
994
  display: flex;
995
995
  flex-direction: column;
996
996
  flex-grow: 1;
@@ -1006,6 +1006,105 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
1006
1006
  padding: 6px;
1007
1007
  }
1008
1008
 
1009
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1010
+ /* Set left position when auto-fold is not on the body element. */
1011
+ right: 0;
1012
+ }
1013
+ @media (min-width: 783px) {
1014
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1015
+ right: 160px;
1016
+ }
1017
+ }
1018
+
1019
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1020
+ /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
1021
+ }
1022
+ @media (min-width: 783px) {
1023
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1024
+ right: 36px;
1025
+ }
1026
+ }
1027
+ @media (min-width: 961px) {
1028
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1029
+ right: 160px;
1030
+ }
1031
+ }
1032
+
1033
+ /* Sidebar manually collapsed. */
1034
+ .folded .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1035
+ right: 0;
1036
+ }
1037
+ @media (min-width: 783px) {
1038
+ .folded .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1039
+ right: 36px;
1040
+ }
1041
+ }
1042
+
1043
+ body.is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1044
+ right: 0 !important;
1045
+ }
1046
+
1047
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1048
+ position: sticky;
1049
+ top: 0;
1050
+ z-index: 31;
1051
+ display: block;
1052
+ width: 100%;
1053
+ }
1054
+ @media (min-width: 782px) {
1055
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1056
+ margin-right: 180px;
1057
+ position: fixed;
1058
+ top: 32px;
1059
+ min-height: initial;
1060
+ border-bottom: none;
1061
+ display: flex;
1062
+ height: 60px;
1063
+ align-items: center;
1064
+ width: calc(100% - 180px);
1065
+ }
1066
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1067
+ width: initial;
1068
+ }
1069
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
1070
+ width: initial;
1071
+ }
1072
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1073
+ margin-right: 240px;
1074
+ top: 0;
1075
+ }
1076
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1077
+ width: initial;
1078
+ }
1079
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
1080
+ width: initial;
1081
+ }
1082
+ .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1083
+ margin-right: 80px;
1084
+ width: calc(100% + 40px - 180px);
1085
+ }
1086
+ .is-fullscreen-mode .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1087
+ margin-right: 144px;
1088
+ }
1089
+ .blocks-widgets-container .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1090
+ margin-right: 153.6px;
1091
+ }
1092
+ .blocks-widgets-container .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1093
+ margin-right: 268.8px;
1094
+ }
1095
+ }
1096
+ @media (min-width: 960px) {
1097
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1098
+ width: auto;
1099
+ }
1100
+ .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1101
+ width: auto;
1102
+ }
1103
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1104
+ width: calc(100% - 280px - 256px);
1105
+ }
1106
+ }
1107
+
1009
1108
  .edit-widgets-editor__list-view-panel {
1010
1109
  height: 100%;
1011
1110
  display: flex;
@@ -475,7 +475,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
475
475
  display: none;
476
476
  margin: 0;
477
477
  }
478
- .interface-pinned-items .components-button:nth-last-child(1), .interface-pinned-items .components-button:nth-last-child(2) {
478
+ .interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"], .interface-pinned-items .components-button[aria-controls="edit-site:global-styles"] {
479
479
  display: flex;
480
480
  }
481
481
  .interface-pinned-items .components-button svg {
@@ -637,7 +637,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
637
637
  align-items: center;
638
638
  justify-content: space-between;
639
639
  height: 60px;
640
- padding: 0 16px;
641
640
  overflow: auto;
642
641
  background: #fff;
643
642
  }
@@ -651,6 +650,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
651
650
  display: flex;
652
651
  align-items: center;
653
652
  justify-content: center;
653
+ padding-left: 16px;
654
654
  }
655
655
 
656
656
  .edit-widgets-header__title {
@@ -662,6 +662,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
662
662
  .edit-widgets-header__actions {
663
663
  display: flex;
664
664
  align-items: center;
665
+ padding-right: 16px;
665
666
  gap: 4px;
666
667
  }
667
668
  @media (min-width: 600px) {
@@ -989,8 +990,7 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
989
990
  flex-grow: 1;
990
991
  }
991
992
  .edit-widgets-block-editor > div:last-of-type,
992
- .edit-widgets-block-editor .block-editor-writing-flow,
993
- .edit-widgets-block-editor .block-editor-writing-flow > div {
993
+ .edit-widgets-block-editor .block-editor-writing-flow {
994
994
  display: flex;
995
995
  flex-direction: column;
996
996
  flex-grow: 1;
@@ -1006,6 +1006,105 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
1006
1006
  padding: 6px;
1007
1007
  }
1008
1008
 
1009
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1010
+ /* Set left position when auto-fold is not on the body element. */
1011
+ left: 0;
1012
+ }
1013
+ @media (min-width: 783px) {
1014
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1015
+ left: 160px;
1016
+ }
1017
+ }
1018
+
1019
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1020
+ /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
1021
+ }
1022
+ @media (min-width: 783px) {
1023
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1024
+ left: 36px;
1025
+ }
1026
+ }
1027
+ @media (min-width: 961px) {
1028
+ .auto-fold .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1029
+ left: 160px;
1030
+ }
1031
+ }
1032
+
1033
+ /* Sidebar manually collapsed. */
1034
+ .folded .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1035
+ left: 0;
1036
+ }
1037
+ @media (min-width: 783px) {
1038
+ .folded .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1039
+ left: 36px;
1040
+ }
1041
+ }
1042
+
1043
+ body.is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1044
+ left: 0 !important;
1045
+ }
1046
+
1047
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1048
+ position: sticky;
1049
+ top: 0;
1050
+ z-index: 31;
1051
+ display: block;
1052
+ width: 100%;
1053
+ }
1054
+ @media (min-width: 782px) {
1055
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1056
+ margin-left: 180px;
1057
+ position: fixed;
1058
+ top: 32px;
1059
+ min-height: initial;
1060
+ border-bottom: none;
1061
+ display: flex;
1062
+ height: 60px;
1063
+ align-items: center;
1064
+ width: calc(100% - 180px);
1065
+ }
1066
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1067
+ width: initial;
1068
+ }
1069
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
1070
+ width: initial;
1071
+ }
1072
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1073
+ margin-left: 240px;
1074
+ top: 0;
1075
+ }
1076
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1077
+ width: initial;
1078
+ }
1079
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed:empty {
1080
+ width: initial;
1081
+ }
1082
+ .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1083
+ margin-left: 80px;
1084
+ width: calc(100% + 40px - 180px);
1085
+ }
1086
+ .is-fullscreen-mode .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1087
+ margin-left: 144px;
1088
+ }
1089
+ .blocks-widgets-container .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1090
+ margin-left: 153.6px;
1091
+ }
1092
+ .blocks-widgets-container .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
1093
+ margin-left: 268.8px;
1094
+ }
1095
+ }
1096
+ @media (min-width: 960px) {
1097
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1098
+ width: auto;
1099
+ }
1100
+ .show-icon-labels .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1101
+ width: auto;
1102
+ }
1103
+ .is-fullscreen-mode .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
1104
+ width: calc(100% - 280px - 256px);
1105
+ }
1106
+ }
1107
+
1009
1108
  .edit-widgets-editor__list-view-panel {
1010
1109
  height: 100%;
1011
1110
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-widgets",
3
- "version": "5.18.1-next.5a1d1283.0",
3
+ "version": "5.19.1",
4
4
  "description": "Widgets Page module for WordPress..",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,32 +27,32 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/api-fetch": "^6.38.1-next.5a1d1283.0",
31
- "@wordpress/block-editor": "^12.9.1-next.5a1d1283.0",
32
- "@wordpress/block-library": "^8.18.1-next.5a1d1283.0",
33
- "@wordpress/blocks": "^12.18.1-next.5a1d1283.0",
34
- "@wordpress/components": "^26.0.1-next.5a1d1283.0",
35
- "@wordpress/compose": "^6.18.1-next.5a1d1283.0",
36
- "@wordpress/core-data": "^6.18.1-next.5a1d1283.0",
37
- "@wordpress/data": "^9.11.1-next.5a1d1283.0",
38
- "@wordpress/deprecated": "^3.41.1-next.5a1d1283.0",
39
- "@wordpress/dom": "^3.41.1-next.5a1d1283.0",
40
- "@wordpress/element": "^5.18.1-next.5a1d1283.0",
41
- "@wordpress/hooks": "^3.41.1-next.5a1d1283.0",
42
- "@wordpress/i18n": "^4.41.1-next.5a1d1283.0",
43
- "@wordpress/icons": "^9.32.1-next.5a1d1283.0",
44
- "@wordpress/interface": "^5.18.1-next.5a1d1283.0",
45
- "@wordpress/keyboard-shortcuts": "^4.18.1-next.5a1d1283.0",
46
- "@wordpress/keycodes": "^3.41.1-next.5a1d1283.0",
47
- "@wordpress/media-utils": "^4.32.1-next.5a1d1283.0",
48
- "@wordpress/notices": "^4.9.1-next.5a1d1283.0",
49
- "@wordpress/patterns": "^1.2.1-next.5a1d1283.0",
50
- "@wordpress/plugins": "^6.9.1-next.5a1d1283.0",
51
- "@wordpress/preferences": "^3.18.1-next.5a1d1283.0",
52
- "@wordpress/private-apis": "^0.23.1-next.5a1d1283.0",
53
- "@wordpress/reusable-blocks": "^4.18.1-next.5a1d1283.0",
54
- "@wordpress/url": "^3.42.1-next.5a1d1283.0",
55
- "@wordpress/widgets": "^3.18.1-next.5a1d1283.0",
30
+ "@wordpress/api-fetch": "^6.39.1",
31
+ "@wordpress/block-editor": "^12.10.1",
32
+ "@wordpress/block-library": "^8.19.1",
33
+ "@wordpress/blocks": "^12.19.1",
34
+ "@wordpress/components": "^25.8.1",
35
+ "@wordpress/compose": "^6.19.1",
36
+ "@wordpress/core-data": "^6.19.1",
37
+ "@wordpress/data": "^9.12.1",
38
+ "@wordpress/deprecated": "^3.42.1",
39
+ "@wordpress/dom": "^3.42.1",
40
+ "@wordpress/element": "^5.19.1",
41
+ "@wordpress/hooks": "^3.42.1",
42
+ "@wordpress/i18n": "^4.42.1",
43
+ "@wordpress/icons": "^9.33.1",
44
+ "@wordpress/interface": "^5.19.1",
45
+ "@wordpress/keyboard-shortcuts": "^4.19.1",
46
+ "@wordpress/keycodes": "^3.42.1",
47
+ "@wordpress/media-utils": "^4.33.1",
48
+ "@wordpress/notices": "^4.10.1",
49
+ "@wordpress/patterns": "^1.3.1",
50
+ "@wordpress/plugins": "^6.10.1",
51
+ "@wordpress/preferences": "^3.19.1",
52
+ "@wordpress/private-apis": "^0.24.1",
53
+ "@wordpress/reusable-blocks": "^4.19.1",
54
+ "@wordpress/url": "^3.43.1",
55
+ "@wordpress/widgets": "^3.19.1",
56
56
  "classnames": "^2.3.1"
57
57
  },
58
58
  "peerDependencies": {
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "fa0b66987dab5a15f38663e06036d09bccffaa4b"
65
+ "gitHead": "4987d16acb5c41b62704dc4f88225acb97ddd698"
66
66
  }
@@ -27,7 +27,7 @@ import { unlock } from '../../lock-unlock';
27
27
 
28
28
  const { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );
29
29
 
30
- function Header() {
30
+ function Header( { setListViewToggleElement } ) {
31
31
  const isMediumViewport = useViewportMatch( 'medium' );
32
32
  const inserterButton = useRef();
33
33
  const widgetAreaClientId = useLastSelectedWidgetArea();
@@ -140,6 +140,7 @@ function Header() {
140
140
  /* translators: button label text should, if possible, be under 16 characters. */
141
141
  label={ __( 'List View' ) }
142
142
  onClick={ toggleListView }
143
+ ref={ setListViewToggleElement }
143
144
  />
144
145
  </>
145
146
  ) }
@@ -3,7 +3,6 @@
3
3
  align-items: center;
4
4
  justify-content: space-between;
5
5
  height: $header-height;
6
- padding: 0 $grid-unit-20;
7
6
  overflow: auto;
8
7
  background: #fff;
9
8
 
@@ -16,6 +15,7 @@
16
15
  display: flex;
17
16
  align-items: center;
18
17
  justify-content: center;
18
+ padding-left: $grid-unit-20;
19
19
  }
20
20
 
21
21
  .edit-widgets-header__title {
@@ -27,7 +27,7 @@
27
27
  .edit-widgets-header__actions {
28
28
  display: flex;
29
29
  align-items: center;
30
-
30
+ padding-right: $grid-unit-20;
31
31
  gap: $grid-unit-05;
32
32
 
33
33
  @include break-small() {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useViewportMatch } from '@wordpress/compose';
5
5
  import { BlockBreadcrumb } from '@wordpress/block-editor';
6
- import { useEffect } from '@wordpress/element';
6
+ import { useEffect, useState } from '@wordpress/element';
7
7
  import { useDispatch, useSelect } from '@wordpress/data';
8
8
  import {
9
9
  InterfaceSkeleton,
@@ -68,6 +68,9 @@ function Interface( { blockEditorSettings } ) {
68
68
  []
69
69
  );
70
70
 
71
+ const [ listViewToggleElement, setListViewToggleElement ] =
72
+ useState( null );
73
+
71
74
  // Inserter and Sidebars are mutually exclusive
72
75
  useEffect( () => {
73
76
  if ( hasSidebarEnabled && ! isHugeViewport ) {
@@ -94,8 +97,16 @@ function Interface( { blockEditorSettings } ) {
94
97
  ...interfaceLabels,
95
98
  secondarySidebar: secondarySidebarLabel,
96
99
  } }
97
- header={ <Header /> }
98
- secondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }
100
+ header={
101
+ <Header setListViewToggleElement={ setListViewToggleElement } />
102
+ }
103
+ secondarySidebar={
104
+ hasSecondarySidebar && (
105
+ <SecondarySidebar
106
+ listViewToggleElement={ listViewToggleElement }
107
+ />
108
+ )
109
+ }
99
110
  sidebar={
100
111
  hasSidebarEnabled && (
101
112
  <ComplementaryArea.Slot scope="core/edit-widgets" />