@wordpress/edit-widgets 5.24.1 → 5.25.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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.25.0 (2023-12-13)
6
+
5
7
  ## 5.24.0 (2023-11-29)
6
8
 
7
9
  ## 5.23.0 (2023-11-16)
@@ -17,7 +17,6 @@ var _preferences = require("@wordpress/preferences");
17
17
  var _documentTools = _interopRequireDefault(require("./document-tools"));
18
18
  var _saveButton = _interopRequireDefault(require("../save-button"));
19
19
  var _moreMenu = _interopRequireDefault(require("../more-menu"));
20
- var _lockUnlock = require("../../lock-unlock");
21
20
  /**
22
21
  * WordPress dependencies
23
22
  */
@@ -26,9 +25,6 @@ var _lockUnlock = require("../../lock-unlock");
26
25
  * Internal dependencies
27
26
  */
28
27
 
29
- const {
30
- BlockContextualToolbar
31
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
32
28
  function Header({
33
29
  setListViewToggleElement
34
30
  }) {
@@ -52,8 +48,8 @@ function Header({
52
48
  setListViewToggleElement: setListViewToggleElement
53
49
  }), hasFixedToolbar && isLargeViewport && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
54
50
  className: "selected-block-tools-wrapper"
55
- }, (0, _react.createElement)(BlockContextualToolbar, {
56
- isFixed: true
51
+ }, (0, _react.createElement)(_blockEditor.BlockToolbar, {
52
+ hideDragHandle: true
57
53
  })), (0, _react.createElement)(_components.Popover.Slot, {
58
54
  ref: blockToolbarRef,
59
55
  name: "block-toolbar"
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_components","_interface","_compose","_preferences","_documentTools","_interopRequireDefault","_saveButton","_moreMenu","_lockUnlock","BlockContextualToolbar","unlock","blockEditorPrivateApis","Header","setListViewToggleElement","isLargeViewport","useViewportMatch","blockToolbarRef","useRef","hasFixedToolbar","useSelect","select","preferencesStore","get","_react","createElement","Fragment","className","__","VisuallyHidden","as","default","isFixed","Popover","Slot","ref","name","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockContextualToolbar } = unlock( blockEditorPrivateApis );\n\nfunction Header( { setListViewToggleElement } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockContextualToolbar isFixed />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,cAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,WAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,SAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAlBA;AACA;AACA;;AAUA;AACA;AACA;;AAMA,MAAM;EAAEa;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEnE,SAASC,MAAMA,CAAE;E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B;IACvBmB,IAAI,EAAC;EAAe,CACpB,CACA,CAEC,CAAC,EACN,IAAAZ,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA8B,GAC5C,IAAAH,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAwB,OAAU,MAAE,CAAC,EACd,IAAAP,MAAA,CAAAC,aAAA,EAACvB,UAAA,CAAAmC,WAAW,CAACH,IAAI;IAACI,KAAK,EAAC;EAAmB,CAAE,CAAC,EAC9C,IAAAd,MAAA,CAAAC,aAAA,EAACjB,SAAA,CAAAuB,OAAQ,MAAE,CACP,CACD,CACJ,CAAC;AAEL;AAAC,IAAAQ,QAAA,GAEc1B,MAAM;AAAA2B,OAAA,CAAAT,OAAA,GAAAQ,QAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_components","_interface","_compose","_preferences","_documentTools","_interopRequireDefault","_saveButton","_moreMenu","Header","setListViewToggleElement","isLargeViewport","useViewportMatch","blockToolbarRef","useRef","hasFixedToolbar","useSelect","select","preferencesStore","get","_react","createElement","Fragment","className","__","VisuallyHidden","as","default","BlockToolbar","hideDragHandle","Popover","Slot","ref","name","PinnedItems","scope","_default","exports"],"sources":["@wordpress/edit-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockToolbar } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\n\nfunction Header( { setListViewToggleElement } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],"mappings":";;;;;;;;AAG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AAE,SAAU,CACD,CAChB,EACD,IAAAJ,MAAA,CAAAC,aAAA,EAAChB,cAAA,CAAAsB,OAAa;IACbjB,wBAAwB,EAAGA;EAA0B,CACrD,CAAC,EACAK,eAAe,IAAIJ,eAAe,IACnC,IAAAS,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA8B,GAC5C,IAAAH,MAAA,CAAAC,aAAA,EAACzB,YAAA,CAAAgC,YAAY;IAACC,cAAc;EAAA,CAAE,CAC1B,CAAC,EACN,IAAAT,MAAA,CAAAC,aAAA,EAACpB,WAAA,CAAA6B,OAAO,CAACC,IAAI;IACZC,GAAG,EAAGnB,eAAiB;IACvBoB,IAAI,EAAC;EAAe,CACpB,CACA,CAEC,CAAC,EACN,IAAAb,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA8B,GAC5C,IAAAH,MAAA,CAAAC,aAAA,EAACd,WAAA,CAAAoB,OAAU,MAAE,CAAC,EACd,IAAAP,MAAA,CAAAC,aAAA,EAACnB,UAAA,CAAAgC,WAAW,CAACH,IAAI;IAACI,KAAK,EAAC;EAAmB,CAAE,CAAC,EAC9C,IAAAf,MAAA,CAAAC,aAAA,EAACb,SAAA,CAAAmB,OAAQ,MAAE,CACP,CACD,CACJ,CAAC;AAEL;AAAC,IAAAS,QAAA,GAEc3B,MAAM;AAAA4B,OAAA,CAAAV,OAAA,GAAAS,QAAA"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = WidgetAreasBlockEditorContent;
8
8
  var _react = require("react");
9
9
  var _blockEditor = require("@wordpress/block-editor");
10
+ var _compose = require("@wordpress/compose");
10
11
  var _data = require("@wordpress/data");
11
12
  var _element = require("@wordpress/element");
12
13
  var _preferences = require("@wordpress/preferences");
@@ -24,12 +25,15 @@ function WidgetAreasBlockEditorContent({
24
25
  blockEditorSettings
25
26
  }) {
26
27
  const hasThemeStyles = (0, _data.useSelect)(select => !!select(_preferences.store).get('core/edit-widgets', 'themeStyles'), []);
28
+ const isLargeViewport = (0, _compose.useViewportMatch)('medium');
27
29
  const styles = (0, _element.useMemo)(() => {
28
30
  return hasThemeStyles ? blockEditorSettings.styles : [];
29
31
  }, [blockEditorSettings, hasThemeStyles]);
30
32
  return (0, _react.createElement)("div", {
31
33
  className: "edit-widgets-block-editor"
32
- }, (0, _react.createElement)(_notices.default, null), (0, _react.createElement)(_blockEditor.BlockTools, null, (0, _react.createElement)(_keyboardShortcuts.default, null), (0, _react.createElement)(_blockEditor.__unstableEditorStyles, {
34
+ }, (0, _react.createElement)(_notices.default, null), !isLargeViewport && (0, _react.createElement)(_blockEditor.BlockToolbar, {
35
+ hideDragHandle: true
36
+ }), (0, _react.createElement)(_blockEditor.BlockTools, null, (0, _react.createElement)(_keyboardShortcuts.default, null), (0, _react.createElement)(_blockEditor.__unstableEditorStyles, {
33
37
  styles: styles,
34
38
  scope: ".editor-styles-wrapper"
35
39
  }), (0, _react.createElement)(_blockEditor.BlockSelectionClearer, null, (0, _react.createElement)(_blockEditor.WritingFlow, null, (0, _react.createElement)(_blockEditor.BlockList, {
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","styles","useMemo","_react","createElement","className","default","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"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":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAD,sBAAA,CAAAL,OAAA;AAlBA;AACA;AACA;;AAYA;AACA;AACA;;AAIe,SAASO,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EAED,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC7B,OAAON,cAAc,GAAGD,mBAAmB,CAACM,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEN,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACC,IAAAO,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAF,MAAA,CAAAC,aAAA,EAACb,QAAA,CAAAe,OAAO,MAAE,CAAC,EACX,IAAAH,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAqB,UAAU,QACV,IAAAJ,MAAA,CAAAC,aAAA,EAACX,kBAAA,CAAAa,OAAiB,MAAE,CAAC,EACrB,IAAAH,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAsB,sBAAY;IACZP,MAAM,EAAGA,MAAQ;IACjBQ,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACF,IAAAN,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAwB,qBAAqB,QACrB,IAAAP,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAyB,WAAW,QACX,IAAAR,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAA0B,SAAS;IAACP,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
1
+ {"version":3,"names":["_blockEditor","require","_compose","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","isLargeViewport","useViewportMatch","styles","useMemo","_react","createElement","className","default","BlockToolbar","hideDragHandle","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"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":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAD,sBAAA,CAAAN,OAAA;AApBA;AACA;AACA;;AAcA;AACA;AACA;;A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
7
  exports.default = WidgetAreasBlockEditorProvider;
8
8
  var _react = require("react");
9
9
  var _components = require("@wordpress/components");
10
+ var _compose = require("@wordpress/compose");
10
11
  var _mediaUtils = require("@wordpress/media-utils");
11
12
  var _data = require("@wordpress/data");
12
13
  var _coreData = require("@wordpress/core-data");
@@ -40,6 +41,7 @@ function WidgetAreasBlockEditorProvider({
40
41
  ...props
41
42
  }) {
42
43
  const mediaPermissions = (0, _coreData.useResourcePermissions)('media');
44
+ const isLargeViewport = (0, _compose.useViewportMatch)('medium');
43
45
  const {
44
46
  reusableBlocks,
45
47
  isFixedToolbarActive,
@@ -85,7 +87,7 @@ function WidgetAreasBlockEditorProvider({
85
87
  return {
86
88
  ...blockEditorSettings,
87
89
  __experimentalReusableBlocks: reusableBlocks,
88
- hasFixedToolbar: isFixedToolbarActive,
90
+ hasFixedToolbar: isFixedToolbarActive || !isLargeViewport,
89
91
  keepCaretInsideBlock,
90
92
  mediaUpload: mediaUploadBlockEditor,
91
93
  templateLock: 'all',
@@ -93,7 +95,7 @@ function WidgetAreasBlockEditorProvider({
93
95
  pageOnFront,
94
96
  pageForPosts
95
97
  };
96
- }, [blockEditorSettings, isFixedToolbarActive, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
98
+ }, [blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, mediaPermissions.canCreate, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
97
99
  const widgetAreaId = (0, _useLastSelectedWidgetArea.default)();
98
100
  const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)(_utils.KIND, _utils.POST_TYPE, {
99
101
  id: (0, _utils.buildWidgetAreasPostId)()
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,k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AAI,EACJC,gBAAS,EACT;IAAEC,EAAE,EAAE,IAAAC,6BAAsB,EAAC;EAAE,CAChC,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC9E,WAAA,CAAA+E,gBAAgB,QAChB,IAAAF,MAAA,CAAAC,aAAA,EAACrE,kBAAA,CAAAuE,OAAiB,CAACC,QAAQ,MAAE,CAAC,EAC9B,IAAAJ,MAAA,CAAAC,aAAA,EAAC9D,+BAA+B;IAC/BkE,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnB3D;EAAK,GAERD,QAAQ,EACV,IAAAsD,MAAA,CAAAC,aAAA,EAAC3D,iBAAiB;IAACiE,YAAY,EAAGjB;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB"}
1
+ {"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","isLargeViewport","useViewportMatch","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,kBAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,0BAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,UAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAzBA;AACA;AACA;;AAeA;AACA;AACA;;AAQA,MAAM;EAAEgB;AAAgC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC5E,MAAM;EAAEC;AAAkB,CAAC,GAAG,IAAAF,kBAAM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BAA+B;IAC/BoE,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnB7D;EAAK,GAERD,QAAQ,EACV,IAAAwD,MAAA,CAAAC,aAAA,EAAC7D,iBAAiB;IAACmE,YAAY,EAAGjB;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB"}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
+ import { BlockToolbar } from '@wordpress/block-editor';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { useRef } from '@wordpress/element';
8
8
  import { __ } from '@wordpress/i18n';
@@ -17,10 +17,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
17
17
  import DocumentTools from './document-tools';
18
18
  import SaveButton from '../save-button';
19
19
  import MoreMenu from '../more-menu';
20
- import { unlock } from '../../lock-unlock';
21
- const {
22
- BlockContextualToolbar
23
- } = unlock(blockEditorPrivateApis);
24
20
  function Header({
25
21
  setListViewToggleElement
26
22
  }) {
@@ -44,8 +40,8 @@ function Header({
44
40
  setListViewToggleElement: setListViewToggleElement
45
41
  }), hasFixedToolbar && isLargeViewport && createElement(Fragment, null, createElement("div", {
46
42
  className: "selected-block-tools-wrapper"
47
- }, createElement(BlockContextualToolbar, {
48
- isFixed: true
43
+ }, createElement(BlockToolbar, {
44
+ hideDragHandle: true
49
45
  })), createElement(Popover.Slot, {
50
46
  ref: blockToolbarRef,
51
47
  name: "block-toolbar"
@@ -1 +1 @@
1
- {"version":3,"names":["privateApis","blockEditorPrivateApis","useSelect","useRef","__","Popover","VisuallyHidden","PinnedItems","useViewportMatch","store","preferencesStore","DocumentTools","SaveButton","MoreMenu","unlock","BlockContextualToolbar","Header","setListViewToggleElement","isLargeViewport","blockToolbarRef","hasFixedToolbar","select","get","createElement","Fragment","className","as","isFixed","Slot","ref","name","scope"],"sources":["@wordpress/edit-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockContextualToolbar } = unlock( blockEditorPrivateApis );\n\nfunction Header( { setListViewToggleElement } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockContextualToolbar isFixed />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,cAAc,QAAQ,uBAAuB;AAC/D,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAuB,CAAC,GAAGD,MAAM,CAAEb,sBAAuB,CAAC;AAEnE,SAASe,MAAMA,CAAE;EAAEC;AAAyB,CAAC,EAAG;EAC/C,MAAMC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Popover","VisuallyHidden","PinnedItems","useViewportMatch","store","preferencesStore","DocumentTools","SaveButton","MoreMenu","Header","setListViewToggleElement","isLargeViewport","blockToolbarRef","hasFixedToolbar","select","get","createElement","Fragment","className","as","hideDragHandle","Slot","ref","name","scope"],"sources":["@wordpress/edit-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockToolbar } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\n\nfunction Header( { setListViewToggleElement } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,yBAAyB;AACtD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,cAAc,QAAQ,uBAAuB;AAC/D,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,QAAQ,MAAM,cAAc;AAEnC,SAASC,MAAMA,CAAE;EAAEC;AAAyB,CAAC,EAAG;EAC/C,MAAMC,eAAe,GAAGR,gBAAgB,CAAE,QAAS,CAAC;EACpD,MAAMS,eAAe,GAAGd,MAAM,CAAC,CAAC;EAChC,MAAM;IAAEe;EAAgB,CAAC,GAAGhB,SAAS,CAClCiB,MAAM,KAAQ;IACfD,eAAe,EAAE,CAAC,CAAEC,MAAM,CAAET,gBAAiB,CAAC,CAACU,GAAG,CACjD,mBAAmB,EACnB,cACD;EACD,CAAC,CAAE,EACH,EACD,CAAC;EAED,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA;IAAKE,SAAS,EAAC;EAAqB,GACnCF,aAAA;IAAKE,SAAS,EAAC;EAAgD,GAC5DP,eAAe,IAChBK,aAAA;IAAIE,SAAS,EAAC;EAA4B,GACvCnB,EAAE,CAAE,SAAU,CACb,CACJ,EACC,CAAEY,eAAe,IAClBK,aAAA,CAACf,cAAc;IACdkB,EAAE,EAAC,IAAI;IACPD,SAAS,EAAC;EAA4B,GAEpCnB,EAAE,CAAE,SAAU,CACD,CAChB,EACDiB,aAAA,CAACV,aAAa;IACbI,wBAAwB,EAAGA;EAA0B,CACrD,CAAC,EACAG,eAAe,IAAIF,eAAe,IACnCK,aAAA,CAAAC,QAAA,QACCD,aAAA;IAAKE,SAAS,EAAC;EAA8B,GAC5CF,aAAA,CAACpB,YAAY;IAACwB,cAAc;EAAA,CAAE,CAC1B,CAAC,EACNJ,aAAA,CAAChB,OAAO,CAACqB,IAAI;IACZC,GAAG,EAAGV,eAAiB;IACvBW,IAAI,EAAC;EAAe,CACpB,CACA,CAEC,CAAC,EACNP,aAAA;IAAKE,SAAS,EAAC;EAA8B,GAC5CF,aAAA,CAACT,UAAU,MAAE,CAAC,EACdS,aAAA,CAACd,WAAW,CAACmB,IAAI;IAACG,KAAK,EAAC;EAAmB,CAAE,CAAC,EAC9CR,aAAA,CAACR,QAAQ,MAAE,CACP,CACD,CACJ,CAAC;AAEL;AAEA,eAAeC,MAAM"}
@@ -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), createElement(BlockTools, null, createElement(KeyboardShortcuts, null), createElement(EditorStyles, {
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;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"}
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,8BAA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B,CAChB,CAAC;AAErB"}
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":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,W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WAAW,EAAET,sBAAsB;MACnCU,YAAY,EAAE,KAAK;MACnBC,iCAAiC,EAAEb,mBAAmB;MACtDf,WAAW;MACXC;IACD,CAAC;EACF,CAAC,EAAE,CACFT,mBAAmB,EACnBM,oBAAoB,EACpBF,eAAe,EACfG,oBAAoB,EACpBJ,gBAAgB,CAACuB,SAAS,EAC1BrB,cAAc,EACdkB,mBAAmB,EACnBf,WAAW,EACXC,YAAY,CACX,CAAC;EAEH,MAAM4B,YAAY,GAAG5C,yBAAyB,CAAC,CAAC;EAEhD,MAAM,CAAE6C,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG5D,oBAAoB,CACzDW,IAAI,EACJC,SAAS,EACT;IAAEiD,EAAE,EAAEnD,sBAAsB,CAAC;EAAE,CAChC,CAAC;EAED,OACCoD,aAAA,CAACnE,gBAAgB,QAChBmE,aAAA,CAACrD,iBAAiB,CAACsD,QAAQ,MAAE,CAAC,EAC9BD,aAAA,CAAC7C,+BAA+B;IAC/B+C,KAAK,EAAGN,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBhB,QAAQ,EAAGA,QAAU;IACrBqB,cAAc,EAAG,KAAO;IAAA,GACnB3C;EAAK,GAERD,QAAQ,EACVyC,aAAA,CAAC5C,iBAAiB;IAACgD,YAAY,EAAGT;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB"}
@@ -468,7 +468,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
468
468
 
469
469
  .interface-pinned-items {
470
470
  display: flex;
471
- gap: 4px;
471
+ gap: 8px;
472
472
  margin-left: -4px;
473
473
  }
474
474
  .interface-pinned-items .components-button {
@@ -648,8 +648,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
648
648
  .edit-widgets-header .selected-block-tools-wrapper {
649
649
  overflow-x: hidden;
650
650
  }
651
- .edit-widgets-header .block-editor-block-contextual-toolbar.is-fixed {
652
- border: none;
651
+ .edit-widgets-header .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
652
+ border-bottom: 0;
653
+ }
654
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group,
655
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar {
656
+ border-left: none;
657
+ }
658
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group::after,
659
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar::after {
660
+ content: "";
661
+ width: 1px;
662
+ margin-top: 12px;
663
+ margin-bottom: 12px;
664
+ background-color: #ddd;
665
+ margin-right: 8px;
666
+ }
667
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
668
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
669
+ display: none;
653
670
  }
654
671
 
655
672
  .edit-widgets-header__navigable-toolbar-wrapper {
@@ -468,7 +468,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
468
468
 
469
469
  .interface-pinned-items {
470
470
  display: flex;
471
- gap: 4px;
471
+ gap: 8px;
472
472
  margin-right: -4px;
473
473
  }
474
474
  .interface-pinned-items .components-button {
@@ -648,8 +648,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
648
648
  .edit-widgets-header .selected-block-tools-wrapper {
649
649
  overflow-x: hidden;
650
650
  }
651
- .edit-widgets-header .block-editor-block-contextual-toolbar.is-fixed {
652
- border: none;
651
+ .edit-widgets-header .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
652
+ border-bottom: 0;
653
+ }
654
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group,
655
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar {
656
+ border-right: none;
657
+ }
658
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group::after,
659
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar::after {
660
+ content: "";
661
+ width: 1px;
662
+ margin-top: 12px;
663
+ margin-bottom: 12px;
664
+ background-color: #ddd;
665
+ margin-left: 8px;
666
+ }
667
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
668
+ .edit-widgets-header .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
669
+ display: none;
653
670
  }
654
671
 
655
672
  .edit-widgets-header__navigable-toolbar-wrapper {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-widgets",
3
- "version": "5.24.1",
3
+ "version": "5.25.0",
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.44.0",
31
- "@wordpress/block-editor": "^12.15.0",
32
- "@wordpress/block-library": "^8.24.1",
33
- "@wordpress/blocks": "^12.24.0",
34
- "@wordpress/components": "^25.13.0",
35
- "@wordpress/compose": "^6.24.0",
36
- "@wordpress/core-data": "^6.24.0",
37
- "@wordpress/data": "^9.17.0",
38
- "@wordpress/deprecated": "^3.47.0",
39
- "@wordpress/dom": "^3.47.0",
40
- "@wordpress/element": "^5.24.0",
41
- "@wordpress/hooks": "^3.47.0",
42
- "@wordpress/i18n": "^4.47.0",
43
- "@wordpress/icons": "^9.38.0",
44
- "@wordpress/interface": "^5.24.0",
45
- "@wordpress/keyboard-shortcuts": "^4.24.0",
46
- "@wordpress/keycodes": "^3.47.0",
47
- "@wordpress/media-utils": "^4.38.0",
48
- "@wordpress/notices": "^4.15.0",
49
- "@wordpress/patterns": "^1.8.0",
50
- "@wordpress/plugins": "^6.15.0",
51
- "@wordpress/preferences": "^3.24.0",
52
- "@wordpress/private-apis": "^0.29.0",
53
- "@wordpress/reusable-blocks": "^4.24.0",
54
- "@wordpress/url": "^3.48.0",
55
- "@wordpress/widgets": "^3.24.0",
30
+ "@wordpress/api-fetch": "^6.45.0",
31
+ "@wordpress/block-editor": "^12.16.0",
32
+ "@wordpress/block-library": "^8.25.0",
33
+ "@wordpress/blocks": "^12.25.0",
34
+ "@wordpress/components": "^25.14.0",
35
+ "@wordpress/compose": "^6.25.0",
36
+ "@wordpress/core-data": "^6.25.0",
37
+ "@wordpress/data": "^9.18.0",
38
+ "@wordpress/deprecated": "^3.48.0",
39
+ "@wordpress/dom": "^3.48.0",
40
+ "@wordpress/element": "^5.25.0",
41
+ "@wordpress/hooks": "^3.48.0",
42
+ "@wordpress/i18n": "^4.48.0",
43
+ "@wordpress/icons": "^9.39.0",
44
+ "@wordpress/interface": "^5.25.0",
45
+ "@wordpress/keyboard-shortcuts": "^4.25.0",
46
+ "@wordpress/keycodes": "^3.48.0",
47
+ "@wordpress/media-utils": "^4.39.0",
48
+ "@wordpress/notices": "^4.16.0",
49
+ "@wordpress/patterns": "^1.9.0",
50
+ "@wordpress/plugins": "^6.16.0",
51
+ "@wordpress/preferences": "^3.25.0",
52
+ "@wordpress/private-apis": "^0.30.0",
53
+ "@wordpress/reusable-blocks": "^4.25.0",
54
+ "@wordpress/url": "^3.49.0",
55
+ "@wordpress/widgets": "^3.25.0",
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": "12b897d7feff1cb00ddbf9016b62c1177d9c0081"
65
+ "gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
66
66
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
4
+ import { BlockToolbar } from '@wordpress/block-editor';
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { useRef } from '@wordpress/element';
7
7
  import { __ } from '@wordpress/i18n';
@@ -16,9 +16,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
16
16
  import DocumentTools from './document-tools';
17
17
  import SaveButton from '../save-button';
18
18
  import MoreMenu from '../more-menu';
19
- import { unlock } from '../../lock-unlock';
20
-
21
- const { BlockContextualToolbar } = unlock( blockEditorPrivateApis );
22
19
 
23
20
  function Header( { setListViewToggleElement } ) {
24
21
  const isLargeViewport = useViewportMatch( 'medium' );
@@ -56,7 +53,7 @@ function Header( { setListViewToggleElement } ) {
56
53
  { hasFixedToolbar && isLargeViewport && (
57
54
  <>
58
55
  <div className="selected-block-tools-wrapper">
59
- <BlockContextualToolbar isFixed />
56
+ <BlockToolbar hideDragHandle />
60
57
  </div>
61
58
  <Popover.Slot
62
59
  ref={ blockToolbarRef }
@@ -12,10 +12,31 @@
12
12
 
13
13
  .selected-block-tools-wrapper {
14
14
  overflow-x: hidden;
15
- }
16
15
 
17
- .block-editor-block-contextual-toolbar.is-fixed {
18
- border: none;
16
+ .block-editor-block-contextual-toolbar {
17
+ border-bottom: 0;
18
+ }
19
+
20
+ // Modified group borders
21
+ .components-toolbar-group,
22
+ .components-toolbar {
23
+ border-right: none;
24
+
25
+ &::after {
26
+ content: "";
27
+ width: $border-width;
28
+ margin-top: $grid-unit + $grid-unit-05;
29
+ margin-bottom: $grid-unit + $grid-unit-05;
30
+ background-color: $gray-300;
31
+ margin-left: $grid-unit;
32
+ }
33
+
34
+ & .components-toolbar-group.components-toolbar-group {
35
+ &::after {
36
+ display: none;
37
+ }
38
+ }
39
+ }
19
40
  }
20
41
  }
21
42
 
@@ -3,11 +3,13 @@
3
3
  */
4
4
  import {
5
5
  BlockList,
6
+ BlockToolbar,
6
7
  BlockTools,
7
8
  BlockSelectionClearer,
8
9
  WritingFlow,
9
10
  __unstableEditorStyles as EditorStyles,
10
11
  } from '@wordpress/block-editor';
12
+ import { useViewportMatch } from '@wordpress/compose';
11
13
  import { useSelect } from '@wordpress/data';
12
14
  import { useMemo } from '@wordpress/element';
13
15
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -29,6 +31,7 @@ export default function WidgetAreasBlockEditorContent( {
29
31
  ),
30
32
  []
31
33
  );
34
+ const isLargeViewport = useViewportMatch( 'medium' );
32
35
 
33
36
  const styles = useMemo( () => {
34
37
  return hasThemeStyles ? blockEditorSettings.styles : [];
@@ -37,6 +40,7 @@ export default function WidgetAreasBlockEditorContent( {
37
40
  return (
38
41
  <div className="edit-widgets-block-editor">
39
42
  <Notices />
43
+ { ! isLargeViewport && <BlockToolbar hideDragHandle /> }
40
44
  <BlockTools>
41
45
  <KeyboardShortcuts />
42
46
  <EditorStyles
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { SlotFillProvider } from '@wordpress/components';
5
+ import { useViewportMatch } from '@wordpress/compose';
5
6
  import { uploadMedia } from '@wordpress/media-utils';
6
7
  import { useDispatch, useSelect } from '@wordpress/data';
7
8
  import {
@@ -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,
@@ -78,7 +80,7 @@ export default function WidgetAreasBlockEditorProvider( {
78
80
  return {
79
81
  ...blockEditorSettings,
80
82
  __experimentalReusableBlocks: reusableBlocks,
81
- hasFixedToolbar: isFixedToolbarActive,
83
+ hasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,
82
84
  keepCaretInsideBlock,
83
85
  mediaUpload: mediaUploadBlockEditor,
84
86
  templateLock: 'all',
@@ -89,6 +91,7 @@ export default function WidgetAreasBlockEditorProvider( {
89
91
  }, [
90
92
  blockEditorSettings,
91
93
  isFixedToolbarActive,
94
+ isLargeViewport,
92
95
  keepCaretInsideBlock,
93
96
  mediaPermissions.canCreate,
94
97
  reusableBlocks,