@wordpress/edit-widgets 5.18.0 → 5.19.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.19.0 (2023-09-20)
6
+
5
7
  ## 5.18.0 (2023-08-31)
6
8
 
7
9
  ## 5.17.0 (2023-08-16)
@@ -29,7 +29,8 @@ function WidgetAreasBlockEditorContent({
29
29
  return (0, _element.createElement)("div", {
30
30
  className: "edit-widgets-block-editor"
31
31
  }, (0, _element.createElement)(_notices.default, null), (0, _element.createElement)(_blockEditor.BlockTools, null, (0, _element.createElement)(_keyboardShortcuts.default, null), (0, _element.createElement)(_blockEditor.__unstableEditorStyles, {
32
- styles: styles
32
+ styles: styles,
33
+ scope: ".editor-styles-wrapper"
33
34
  }), (0, _element.createElement)(_blockEditor.BlockSelectionClearer, null, (0, _element.createElement)(_blockEditor.WritingFlow, null, (0, _element.createElement)(_blockEditor.BlockList, {
34
35
  className: "edit-widgets-main-block-list"
35
36
  })))));
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blockEditor","_data","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","styles","useMemo","createElement","className","default","BlockTools","__unstableEditorStyles","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 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":";;;;;;;AAWA,IAAAA,QAAA,GAAAC,OAAA;AARA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAEA,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,IAAAV,QAAA,CAAAiB,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAlB,QAAA,CAAAiB,aAAA,EAACZ,QAAA,CAAAc,OAAO,MAAE,CAAC,EACX,IAAAnB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAkB,UAAU,QACV,IAAApB,QAAA,CAAAiB,aAAA,EAACV,kBAAA,CAAAY,OAAiB,MAAE,CAAC,EACrB,IAAAnB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAmB,sBAAY;IAACN,MAAM,EAAGA;EAAQ,CAAE,CAAC,EAClC,IAAAf,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAoB,qBAAqB,QACrB,IAAAtB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAqB,WAAW,QACX,IAAAvB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAsB,SAAS;IAACN,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
1
+ {"version":3,"names":["_element","require","_blockEditor","_data","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","styles","useMemo","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":";;;;;;;AAWA,IAAAA,QAAA,GAAAC,OAAA;AARA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAEA,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,IAAAV,QAAA,CAAAiB,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAlB,QAAA,CAAAiB,aAAA,EAACZ,QAAA,CAAAc,OAAO,MAAE,CAAC,EACX,IAAAnB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAkB,UAAU,QACV,IAAApB,QAAA,CAAAiB,aAAA,EAACV,kBAAA,CAAAY,OAAiB,MAAE,CAAC,EACrB,IAAAnB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAmB,sBAAY;IACZN,MAAM,EAAGA,MAAQ;IACjBO,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACF,IAAAtB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAqB,qBAAqB,QACrB,IAAAvB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAsB,WAAW,QACX,IAAAxB,QAAA,CAAAiB,aAAA,EAACf,YAAA,CAAAuB,SAAS;IAACP,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER"}
@@ -12,9 +12,8 @@ var _data = require("@wordpress/data");
12
12
  var _coreData = require("@wordpress/core-data");
13
13
  var _blockEditor = require("@wordpress/block-editor");
14
14
  var _patterns = require("@wordpress/patterns");
15
- var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
16
15
  var _preferences = require("@wordpress/preferences");
17
- var _keyboardShortcuts2 = _interopRequireDefault(require("../keyboard-shortcuts"));
16
+ var _keyboardShortcuts = _interopRequireDefault(require("../keyboard-shortcuts"));
18
17
  var _utils = require("../../store/utils");
19
18
  var _useLastSelectedWidgetArea = _interopRequireDefault(require("../../hooks/use-last-selected-widget-area"));
20
19
  var _store = require("../../store");
@@ -84,7 +83,7 @@ function WidgetAreasBlockEditorProvider({
84
83
  const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)(_utils.KIND, _utils.POST_TYPE, {
85
84
  id: (0, _utils.buildWidgetAreasPostId)()
86
85
  });
87
- return (0, _element.createElement)(_keyboardShortcuts.ShortcutProvider, null, (0, _element.createElement)(_keyboardShortcuts2.default.Register, null), (0, _element.createElement)(_components.SlotFillProvider, null, (0, _element.createElement)(ExperimentalBlockEditorProvider, {
86
+ return (0, _element.createElement)(_components.SlotFillProvider, null, (0, _element.createElement)(_keyboardShortcuts.default.Register, null), (0, _element.createElement)(ExperimentalBlockEditorProvider, {
88
87
  value: blocks,
89
88
  onInput: onInput,
90
89
  onChange: onChange,
@@ -93,6 +92,6 @@ function WidgetAreasBlockEditorProvider({
93
92
  ...props
94
93
  }, (0, _element.createElement)(_blockEditor.CopyHandler, null, children), (0, _element.createElement)(PatternsMenuItems, {
95
94
  rootClientId: widgetAreaId
96
- }))));
95
+ })));
97
96
  }
98
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_mediaUtils","_data","_coreData","_blockEditor","_patterns","_keyboardShortcuts","_preferences","_keyboardShortcuts2","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","useSelect","select","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","coreStore","getEntityRecords","preferencesStore","get","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","createElement","ShortcutProvider","default","Register","SlotFillProvider","value","useSubRegistry","CopyHandler","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":";;;;;;;AAWA,IAAAA,QAAA,GAAAC,OAAA;AARA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAMA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,mBAAA,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;AA5BA;AACA;AACA;;AAkBA;AACA;AACA;;AAQA,MAAM;EAAEgB;AAAgC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC5E,MAAM;EAAEC;AAAkB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,qBAAwB,CAAC;AAChD,SAASC,8BAA8BA,CAAE;EACvDC,mBAAmB;EACnBC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAG,IAAAC,gCAAsB,EAAE,OAAQ,CAAC;EAC1D,MAAM;IAAEC,cAAc;IAAEC,oBAAoB;IAAEC;EAAqB,C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pB,mBAAmB,EACnBM,oBAAoB,EACpBC,oBAAoB,EACpBJ,gBAAgB,CAACsB,SAAS,EAC1BpB,cAAc,EACde,mBAAmB,CAClB,CAAC;EAEH,MAAMiB,YAAY,GAAG,IAAAC,kCAAyB,EAAC,CAAC;EAEhD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG,IAAAC,8BAAoB,EACzDC,WAAI,EACJC,gBAAS,EACT;IAAEC,EAAE,EAAE,IAAAC,6BAAsB,EAAC;EAAE,CAChC,CAAC;EAED,OACC,IAAArE,QAAA,CAAAsE,aAAA,EAAC9D,kBAAA,CAAA+D,gBAAgB,QAChB,IAAAvE,QAAA,CAAAsE,aAAA,EAAC5D,mBAAA,CAAA8D,OAAiB,CAACC,QAAQ,MAAE,CAAC,EAC9B,IAAAzE,QAAA,CAAAsE,aAAA,EAACpE,WAAA,CAAAwE,gBAAgB,QAChB,IAAA1E,QAAA,CAAAsE,aAAA,EAACrD,+BAA+B;IAC/B0D,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnBnD;EAAK,GAEV,IAAAzB,QAAA,CAAAsE,aAAA,EAAChE,YAAA,CAAAuE,WAAW,QAAGrD,QAAuB,CAAC,EACvC,IAAAxB,QAAA,CAAAsE,aAAA,EAAClD,iBAAiB;IAAC0D,YAAY,EAAGlB;EAAc,CAAE,CAClB,CAChB,CACD,CAAC;AAErB"}
1
+ {"version":3,"names":["_element","require","_components","_mediaUtils","_data","_coreData","_blockEditor","_patterns","_preferences","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","useSelect","select","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","coreStore","getEntityRecords","preferencesStore","get","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","createElement","SlotFillProvider","default","Register","value","useSubRegistry","CopyHandler","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 }</CopyHandler>\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAWA,IAAAA,QAAA,GAAAC,OAAA;AARA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAMA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,kBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,0BAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AA3BA;AACA;AACA;;AAiBA;AACA;AACA;;AAQA,MAAM;EAAEe;AAAgC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC5E,MAAM;EAAEC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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;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,SACCC,WAAW,EACXC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASD,WAAW,IAAIE,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASR,KAAK,IAAIS,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,SAASd,KAAK,IAAIe,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAgC,CAAC,GAAGD,MAAM,CAAEX,sBAAuB,CAAC;AAC5E,MAAM;EAAEa;AAAkB,CAAC,GAAGF,MAAM,CAAEV,uBAAwB,CAAC;AAC/D,eAAe,SAASa,8BAA8BA,CAAE;EACvDC,mBAAmB;EACnBC,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAGtB,sBAAsB,CAAE,OAAQ,CAAC;EAC1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iC,EAAEb;IACpC,CAAC;EACF,CAAC,EAAE,CACFd,mBAAmB,EACnBK,oBAAoB,EACpBC,oBAAoB,EACpBH,gBAAgB,CAACc,SAAS,EAC1Bb,cAAc,EACdU,mBAAmB,CAClB,CAAC;EAEH,MAAMc,YAAY,GAAGnC,yBAAyB,CAAC,CAAC;EAEhD,MAAM,CAAEoC,MAAM,EAAEC,OAAO,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 }</CopyHandler>\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,SACCC,WAAW,EACXC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASD,WAAW,IAAIE,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASP,KAAK,IAAIQ,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,SAASb,KAAK,IAAIc,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAgC,CAAC,GAAGD,MAAM,CAAEV,sBAAuB,CAAC;AAC5E,MAAM;EAAEY;AAAkB,CAAC,GAAGF,MAAM,CAAET,uBAAwB,CAAC;AAC/D,eAAe,SAASY,8BAA8BA,CAAE;EACvDC,mBAAmB;EACn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AAe,EAAEnB,oBAAoB;MACrCC,oBAAoB;MACpBmB,WAAW,EAAET,sBAAsB;MACnCU,YAAY,EAAE,KAAK;MACnBC,iCAAiC,EAAEb;IACpC,CAAC;EACF,CAAC,EAAE,CACFd,mBAAmB,EACnBK,oBAAoB,EACpBC,oBAAoB,EACpBH,gBAAgB,CAACc,SAAS,EAC1Bb,cAAc,EACdU,mBAAmB,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.0",
3
+ "version": "5.19.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.38.0",
31
- "@wordpress/block-editor": "^12.9.0",
32
- "@wordpress/block-library": "^8.18.0",
33
- "@wordpress/blocks": "^12.18.0",
34
- "@wordpress/components": "^25.7.0",
35
- "@wordpress/compose": "^6.18.0",
36
- "@wordpress/core-data": "^6.18.0",
37
- "@wordpress/data": "^9.11.0",
38
- "@wordpress/deprecated": "^3.41.0",
39
- "@wordpress/dom": "^3.41.0",
40
- "@wordpress/element": "^5.18.0",
41
- "@wordpress/hooks": "^3.41.0",
42
- "@wordpress/i18n": "^4.41.0",
43
- "@wordpress/icons": "^9.32.0",
44
- "@wordpress/interface": "^5.18.0",
45
- "@wordpress/keyboard-shortcuts": "^4.18.0",
46
- "@wordpress/keycodes": "^3.41.0",
47
- "@wordpress/media-utils": "^4.32.0",
48
- "@wordpress/notices": "^4.9.0",
49
- "@wordpress/patterns": "^1.2.0",
50
- "@wordpress/plugins": "^6.9.0",
51
- "@wordpress/preferences": "^3.18.0",
52
- "@wordpress/private-apis": "^0.23.0",
53
- "@wordpress/reusable-blocks": "^4.18.0",
54
- "@wordpress/url": "^3.42.0",
55
- "@wordpress/widgets": "^3.18.0",
30
+ "@wordpress/api-fetch": "^6.39.0",
31
+ "@wordpress/block-editor": "^12.10.0",
32
+ "@wordpress/block-library": "^8.19.0",
33
+ "@wordpress/blocks": "^12.19.0",
34
+ "@wordpress/components": "^25.8.0",
35
+ "@wordpress/compose": "^6.19.0",
36
+ "@wordpress/core-data": "^6.19.0",
37
+ "@wordpress/data": "^9.12.0",
38
+ "@wordpress/deprecated": "^3.42.0",
39
+ "@wordpress/dom": "^3.42.0",
40
+ "@wordpress/element": "^5.19.0",
41
+ "@wordpress/hooks": "^3.42.0",
42
+ "@wordpress/i18n": "^4.42.0",
43
+ "@wordpress/icons": "^9.33.0",
44
+ "@wordpress/interface": "^5.19.0",
45
+ "@wordpress/keyboard-shortcuts": "^4.19.0",
46
+ "@wordpress/keycodes": "^3.42.0",
47
+ "@wordpress/media-utils": "^4.33.0",
48
+ "@wordpress/notices": "^4.10.0",
49
+ "@wordpress/patterns": "^1.3.0",
50
+ "@wordpress/plugins": "^6.10.0",
51
+ "@wordpress/preferences": "^3.19.0",
52
+ "@wordpress/private-apis": "^0.24.0",
53
+ "@wordpress/reusable-blocks": "^4.19.0",
54
+ "@wordpress/url": "^3.43.0",
55
+ "@wordpress/widgets": "^3.19.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": "5eac1734bcdca2301fdd37ec8cfe2a45e722a2c4"
65
+ "gitHead": "cc35f517ed017ab7131319af3e87c359e8de175d"
66
66
  }
@@ -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() {
@@ -39,7 +39,10 @@ export default function WidgetAreasBlockEditorContent( {
39
39
  <Notices />
40
40
  <BlockTools>
41
41
  <KeyboardShortcuts />
42
- <EditorStyles styles={ styles } />
42
+ <EditorStyles
43
+ styles={ styles }
44
+ scope=".editor-styles-wrapper"
45
+ />
43
46
  <BlockSelectionClearer>
44
47
  <WritingFlow>
45
48
  <BlockList className="edit-widgets-main-block-list" />
@@ -11,8 +11,7 @@
11
11
  flex-grow: 1;
12
12
 
13
13
  > div:last-of-type,
14
- .block-editor-writing-flow,
15
- .block-editor-writing-flow > div {
14
+ .block-editor-writing-flow {
16
15
  display: flex;
17
16
  flex-direction: column;
18
17
  flex-grow: 1;
@@ -35,3 +34,101 @@
35
34
  }
36
35
  }
37
36
  }
37
+
38
+ // Fixed contextual toolbar
39
+ @include editor-left(".edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed");
40
+
41
+
42
+ .edit-widgets-block-editor .block-editor-block-contextual-toolbar.is-fixed {
43
+ position: sticky;
44
+ top: 0;
45
+ z-index: z-index(".block-editor-block-popover");
46
+ display: block;
47
+ width: 100%;
48
+
49
+ // on desktop and tablet viewports the toolbar is fixed
50
+ // on top of interface header
51
+ $toolbar-margin: $grid-unit-80 * 3 - 2 * $grid-unit + $grid-unit-05;
52
+
53
+ @include break-medium() {
54
+ // leave room for block inserter, undo and redo, list view
55
+ margin-left: $toolbar-margin;
56
+ // position on top of interface header
57
+ position: fixed;
58
+ top: $admin-bar-height;
59
+ // Don't fill up when empty
60
+ min-height: initial;
61
+ // remove the border
62
+ border-bottom: none;
63
+ // has to be flex for collapse button to fit
64
+ display: flex;
65
+
66
+ // Mimic the height of the parent, vertically align center, and provide a max-height.
67
+ height: $header-height;
68
+ align-items: center;
69
+
70
+
71
+ // on tablet viewports the toolbar is fixed
72
+ // on top of interface header and covers the whole header
73
+ // except for the inserter on the left
74
+ width: calc(100% - #{$toolbar-margin});
75
+
76
+ &.is-collapsed {
77
+ width: initial;
78
+ }
79
+
80
+ &:empty {
81
+ width: initial;
82
+ }
83
+
84
+ .is-fullscreen-mode & {
85
+ // leave room for block inserter, undo and redo, list view
86
+ // and some margin left
87
+ margin-left: $grid-unit-80 * 4 - 2 * $grid-unit;
88
+
89
+ top: 0;
90
+
91
+ &.is-collapsed {
92
+ width: initial;
93
+ }
94
+
95
+ &:empty {
96
+ width: initial;
97
+ }
98
+ }
99
+
100
+ .show-icon-labels & {
101
+ margin-left: $grid-unit-80 + 2 * $grid-unit; // inserter and margin
102
+ width: calc(100% + 40px - #{$toolbar-margin}); //there are no undo, redo and list view buttons
103
+
104
+ .is-fullscreen-mode & {
105
+ margin-left: $grid-unit * 18; // site hub, inserter and margin
106
+ }
107
+ }
108
+
109
+ .blocks-widgets-container & {
110
+ margin-left: $grid-unit-80 * 2.4;
111
+
112
+ &.is-collapsed {
113
+ margin-left: $grid-unit-80 * 4.2;
114
+ }
115
+ }
116
+ }
117
+
118
+ // on desktop viewports the toolbar is fixed
119
+ // on top of interface header and leaves room
120
+ // for the block inserter the publish button
121
+ @include break-large() {
122
+ width: auto;
123
+ .show-icon-labels & {
124
+ width: auto; //there are no undo, redo and list view buttons
125
+ }
126
+
127
+ .is-fullscreen-mode & {
128
+ // in full screen mode we need to account for
129
+ // the combined with of the tools at the right of the header and the margin left
130
+ // of the toolbar which includes four buttons
131
+ width: calc(100% - 280px - #{4 * $grid-unit-80});
132
+ }
133
+ }
134
+ }
@@ -15,7 +15,6 @@ import {
15
15
  privateApis as blockEditorPrivateApis,
16
16
  } from '@wordpress/block-editor';
17
17
  import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
18
- import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
19
18
  import { store as preferencesStore } from '@wordpress/preferences';
20
19
 
21
20
  /**
@@ -98,21 +97,19 @@ export default function WidgetAreasBlockEditorProvider( {
98
97
  );
99
98
 
100
99
  return (
101
- <ShortcutProvider>
100
+ <SlotFillProvider>
102
101
  <KeyboardShortcuts.Register />
103
- <SlotFillProvider>
104
- <ExperimentalBlockEditorProvider
105
- value={ blocks }
106
- onInput={ onInput }
107
- onChange={ onChange }
108
- settings={ settings }
109
- useSubRegistry={ false }
110
- { ...props }
111
- >
112
- <CopyHandler>{ children }</CopyHandler>
113
- <PatternsMenuItems rootClientId={ widgetAreaId } />
114
- </ExperimentalBlockEditorProvider>
115
- </SlotFillProvider>
116
- </ShortcutProvider>
102
+ <ExperimentalBlockEditorProvider
103
+ value={ blocks }
104
+ onInput={ onInput }
105
+ onChange={ onChange }
106
+ settings={ settings }
107
+ useSubRegistry={ false }
108
+ { ...props }
109
+ >
110
+ <CopyHandler>{ children }</CopyHandler>
111
+ <PatternsMenuItems rootClientId={ widgetAreaId } />
112
+ </ExperimentalBlockEditorProvider>
113
+ </SlotFillProvider>
117
114
  );
118
115
  }