@wordpress/edit-post 7.12.7 → 7.12.8

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.
@@ -61,8 +61,6 @@ var _startPageOptions = _interopRequireDefault(require("../start-page-options"))
61
61
 
62
62
  var _store = require("../../store");
63
63
 
64
- var _lockUnlock = require("../../lock-unlock");
65
-
66
64
  /**
67
65
  * External dependencies
68
66
  */
@@ -74,9 +72,6 @@ var _lockUnlock = require("../../lock-unlock");
74
72
  /**
75
73
  * Internal dependencies
76
74
  */
77
- const {
78
- BlockRemovalWarningModal
79
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
80
75
  const interfaceLabels = {
81
76
  /* translators: accessibility text for the editor top bar landmark region. */
82
77
  header: (0, _i18n.__)('Editor top bar'),
@@ -93,9 +88,6 @@ const interfaceLabels = {
93
88
  /* translators: accessibility text for the editor footer landmark region. */
94
89
  footer: (0, _i18n.__)('Editor footer')
95
90
  };
96
- const blockRemovalRules = {
97
- 'core/footnotes': (0, _i18n.__)('The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.')
98
- };
99
91
 
100
92
  function Layout({
101
93
  styles
@@ -208,9 +200,7 @@ function Layout({
208
200
 
209
201
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.FullscreenMode, {
210
202
  isActive: isFullscreenActive
211
- }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(BlockRemovalWarningModal, {
212
- rules: blockRemovalRules
213
- }), (0, _element.createElement)(_settingsSidebar.default, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
203
+ }), (0, _element.createElement)(_browserUrl.default, null), (0, _element.createElement)(_editor.UnsavedChangesWarning, null), (0, _element.createElement)(_editor.AutosaveMonitor, null), (0, _element.createElement)(_editor.LocalAutosaveMonitor, null), (0, _element.createElement)(_keyboardShortcuts2.default, null), (0, _element.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _element.createElement)(_settingsSidebar.default, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
214
204
  isDistractionFree: isDistractionFree && isLargeViewport,
215
205
  className: className,
216
206
  labels: { ...interfaceLabels,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["BlockRemovalWarningModal","blockEditorPrivateApis","interfaceLabels","header","body","sidebar","actions","footer","blockRemovalRules","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;;;;;;;;AAgCA;;AA7BA;;AAKA;;AASA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAtDA;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;AAkBA,MAAM;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BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqB,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpC,gBADC;AAEXqC,MAAAA,IAAI,EAAEpC;AAFK;AAhFb,IAVD,EA+FC,4BAAC,yBAAD,OA/FD,EAgGC,4BAAC,kCAAD,OAhGD,EAiGC,4BAAC,qBAAD,OAjGD,EAkGC,4BAAC,yBAAD,OAlGD,EAmGC,4BAAC,mBAAD,CAAS,IAAT,OAnGD,EAoGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkC;AAAtB,IApGD,CADD;AAwGA;;eAEcpD,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nconst blockRemovalRules = {\n\t'core/footnotes': __(\n\t\t'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'\n\t),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockRemovalWarningModal rules={ blockRemovalRules } />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["interfaceLabels","header","body","sidebar","actions","footer","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","editPostStore","createErrorNotice","noticesStore","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","interfaceStore","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","keyboardShortcutsStore","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarL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AAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,4BAAC,qBAAD;AACC,MAAA,wBAAwB,EAAGqB,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEpC,gBADC;AAEXqC,MAAAA,IAAI,EAAEpC;AAFK;AAhFb,IATD,EA8FC,4BAAC,yBAAD,OA9FD,EA+FC,4BAAC,kCAAD,OA/FD,EAgGC,4BAAC,qBAAD,OAhGD,EAiGC,4BAAC,yBAAD,OAjGD,EAkGC,4BAAC,mBAAD,CAAS,IAAT,OAlGD,EAmGC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGkC;AAAtB,IAnGD,CADD;AAuGA;;eAEcpD,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -6,6 +6,12 @@ var _element = require("@wordpress/element");
6
6
 
7
7
  var _components = require("@wordpress/components");
8
8
 
9
+ var _coreData = require("@wordpress/core-data");
10
+
11
+ var _editor = require("@wordpress/editor");
12
+
13
+ var _data = require("@wordpress/data");
14
+
9
15
  var _icons = require("@wordpress/icons");
10
16
 
11
17
  var _i18n = require("@wordpress/i18n");
@@ -29,16 +35,39 @@ var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu
29
35
  /**
30
36
  * Internal dependencies
31
37
  */
38
+ function ManagePatternsMenuItem() {
39
+ const url = (0, _data.useSelect)(select => {
40
+ const {
41
+ canUser
42
+ } = select(_coreData.store);
43
+ const {
44
+ getEditorSettings
45
+ } = select(_editor.store);
46
+
47
+ const isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;
48
+
49
+ const defaultUrl = (0, _url.addQueryArgs)('edit.php', {
50
+ post_type: 'wp_block'
51
+ });
52
+ const patternsUrl = (0, _url.addQueryArgs)('site-editor.php', {
53
+ path: '/patterns'
54
+ }); // The site editor and templates both check whether the user has
55
+ // edit_theme_options capabilities. We can leverage that here and not
56
+ // display the manage patterns link if the user can't access it.
57
+
58
+ return canUser('read', 'templates') && isBlockTheme ? patternsUrl : defaultUrl;
59
+ }, []);
60
+ return (0, _element.createElement)(_components.MenuItem, {
61
+ role: "menuitem",
62
+ href: url
63
+ }, (0, _i18n.__)('Manage Patterns'));
64
+ }
65
+
32
66
  (0, _plugins.registerPlugin)('edit-post', {
33
67
  render() {
34
68
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_toolsMoreMenuGroup.default, null, ({
35
69
  onClose
36
- }) => (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.MenuItem, {
37
- role: "menuitem",
38
- href: (0, _url.addQueryArgs)('edit.php', {
39
- post_type: 'wp_block'
40
- })
41
- }, (0, _i18n.__)('Manage Patterns')), (0, _element.createElement)(_keyboardShortcutsHelpMenuItem.default, {
70
+ }) => (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(ManagePatternsMenuItem, null), (0, _element.createElement)(_keyboardShortcutsHelpMenuItem.default, {
42
71
  onSelect: onClose
43
72
  }), (0, _element.createElement)(_welcomeGuideMenuItem.default, null), (0, _element.createElement)(_copyContentMenuItem.default, null), (0, _element.createElement)(_components.MenuItem, {
44
73
  role: "menuitem",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["render","onClose","post_type","external"],"mappings":";;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;AAMA,6BAAgB,WAAhB,EAA6B;AAC5BA,EAAAA,MAAM,GAAG;AACR,WACC,qDACC,4BAAC,2BAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,qDACC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAG,uBAAc,UAAd,EAA0B;AAChCC,QAAAA,SAAS,EAAE;AADqB,OAA1B;AAFR,OAMG,cAAI,iBAAJ,CANH,CADD,EASC,4BAAC,sCAAD;AACC,MAAA,QAAQ,EAAGD;AADZ,MATD,EAYC,4BAAC,6BAAD,OAZD,EAaC,4BAAC,4BAAD,OAbD,EAcC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGE,eAFR;AAGC,MAAA,IAAI,EAAG,cACN,qEADM,CAHR;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASG,cAAI,MAAJ,CATH,EAUC,4BAAC,0BAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACA,kBAAI,sBAAJ,CAHF,CAVD,CAdD,CAFF,CADD,CADD;AAwCA;;AA1C2B,CAA7B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Manage Patterns' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["ManagePatternsMenuItem","url","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","post_type","patternsUrl","path","render","onClose","external"],"mappings":";;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAUA;AACA;AACA;AAMA,SAASA,sBAAT,GAAkC;AACjC,QAAMC,GAAG,GAAG,qBAAaC,MAAF,IAAc;AACpC,UAAM;AAAEC,MAAAA;AAAF,QAAcD,MAAM,CAAEE,eAAF,CAA1B;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAwBH,MAAM,CAAEI,aAAF,CAApC;;AAEA,UAAMC,YAAY,GAAGF,iBAAiB,GAAGG,2BAAzC;;AACA,UAAMC,UAAU,GAAG,uBAAc,UAAd,EAA0B;AAC5CC,MAAAA,SAAS,EAAE;AADiC,KAA1B,CAAnB;AAGA,UAAMC,WAAW,GAAG,uBAAc,iBAAd,EAAiC;AACpDC,MAAAA,IAAI,EAAE;AAD8C,KAAjC,CAApB,CARoC,CAYpC;AACA;AACA;;AACA,WAAOT,OAAO,CAAE,MAAF,EAAU,WAAV,CAAP,IAAkCI,YAAlC,GACJI,WADI,GAEJF,UAFH;AAGA,GAlBW,EAkBT,EAlBS,CAAZ;AAoBA,SACC,4BAAC,oBAAD;AAAU,IAAA,IAAI,EAAC,UAAf;AAA0B,IAAA,IAAI,EAAGR;AAAjC,KACG,cAAI,iBAAJ,CADH,CADD;AAKA;;AAED,6BAAgB,WAAhB,EAA6B;AAC5BY,EAAAA,MAAM,GAAG;AACR,WACC,qDACC,4BAAC,2BAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,qDACC,4BAAC,sBAAD,OADD,EAEC,4BAAC,sCAAD;AACC,MAAA,QAAQ,EAAGA;AADZ,MAFD,EAKC,4BAAC,6BAAD,OALD,EAMC,4BAAC,4BAAD,OAND,EAOC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGC,eAFR;AAGC,MAAA,IAAI,EAAG,cACN,qEADM,CAHR;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASG,cAAI,MAAJ,CATH,EAUC,4BAAC,0BAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACA,kBAAI,sBAAJ,CAHF,CAVD,CAPD,CAFF,CADD,CADD;AAiCA;;AAnC2B,CAA7B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage Patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
@@ -10,7 +10,7 @@ import classnames from 'classnames';
10
10
 
11
11
  import { AutosaveMonitor, LocalAutosaveMonitor, UnsavedChangesWarning, EditorNotices, EditorKeyboardShortcutsRegister, EditorSnackbars, store as editorStore } from '@wordpress/editor';
12
12
  import { useSelect, useDispatch } from '@wordpress/data';
13
- import { BlockBreadcrumb, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
+ import { BlockBreadcrumb } from '@wordpress/block-editor';
14
14
  import { Button, ScrollLock, Popover } from '@wordpress/components';
15
15
  import { useViewportMatch } from '@wordpress/compose';
16
16
  import { PluginArea } from '@wordpress/plugins';
@@ -38,10 +38,6 @@ import WelcomeGuide from '../welcome-guide';
38
38
  import ActionsPanel from './actions-panel';
39
39
  import StartPageOptions from '../start-page-options';
40
40
  import { store as editPostStore } from '../../store';
41
- import { unlock } from '../../lock-unlock';
42
- const {
43
- BlockRemovalWarningModal
44
- } = unlock(blockEditorPrivateApis);
45
41
  const interfaceLabels = {
46
42
  /* translators: accessibility text for the editor top bar landmark region. */
47
43
  header: __('Editor top bar'),
@@ -58,9 +54,6 @@ const interfaceLabels = {
58
54
  /* translators: accessibility text for the editor footer landmark region. */
59
55
  footer: __('Editor footer')
60
56
  };
61
- const blockRemovalRules = {
62
- 'core/footnotes': __('The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.')
63
- };
64
57
 
65
58
  function Layout({
66
59
  styles
@@ -173,9 +166,7 @@ function Layout({
173
166
 
174
167
  return createElement(Fragment, null, createElement(FullscreenMode, {
175
168
  isActive: isFullscreenActive
176
- }), createElement(BrowserURL, null), createElement(UnsavedChangesWarning, null), createElement(AutosaveMonitor, null), createElement(LocalAutosaveMonitor, null), createElement(EditPostKeyboardShortcuts, null), createElement(EditorKeyboardShortcutsRegister, null), createElement(BlockRemovalWarningModal, {
177
- rules: blockRemovalRules
178
- }), createElement(SettingsSidebar, null), createElement(InterfaceSkeleton, {
169
+ }), createElement(BrowserURL, null), createElement(UnsavedChangesWarning, null), createElement(AutosaveMonitor, null), createElement(LocalAutosaveMonitor, null), createElement(EditPostKeyboardShortcuts, null), createElement(EditorKeyboardShortcutsRegister, null), createElement(SettingsSidebar, null), createElement(InterfaceSkeleton, {
179
170
  isDistractionFree: isDistractionFree && isLargeViewport,
180
171
  className: className,
181
172
  labels: { ...interfaceLabels,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorSnackbars","store","editorStore","useSelect","useDispatch","BlockBreadcrumb","privateApis","blockEditorPrivateApis","Button","ScrollLock","Popover","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","keyboardShortcutsStore","noticesStore","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","unlock","BlockRemovalWarningModal","interfaceLabels","header","body","sidebar","actions","footer","blockRemovalRules","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,eADD,EAECC,oBAFD,EAGCC,qBAHD,EAICC,aAJD,EAKCC,+BALD,EAMCC,eAND,EAOCC,KAAK,IAAIC,WAPV,QAQO,mBARP;AASA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,eADD,EAECC,WAAW,IAAIC,sBAFhB,QAGO,yBAHP;AAIA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,uBAA5C;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SACCC,iBADD,EAECC,cAFD,EAGCC,iBAHD,EAIC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EAgGC,cAAC,yBAAD,OAhGD,EAiGC,cAAC,YAAD,OAjGD,EAkGC,cAAC,gBAAD,OAlGD,EAmGC,cAAC,OAAD,CAAS,IAAT,OAnGD,EAoGC,cAAC,UAAD;AAAY,IAAA,OAAO,EAAG+B;AAAtB,IApGD,CADD;AAwGA;;AAED,eAAe/C,MAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nconst blockRemovalRules = {\n\t'core/footnotes': __(\n\t\t'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'\n\t),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<BlockRemovalWarningModal rules={ blockRemovalRules } />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/layout/index.js"],"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorSnackbars","store","editorStore","useSelect","useDispatch","BlockBreadcrumb","Button","ScrollLock","Popover","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","keyboardShortcutsStore","noticesStore","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","interfaceLabels","header","body","sidebar","actions","footer","Layout","styles","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","select","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","isEditingTemplate","isFeatureActive","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","className","secondarySidebarLabel","secondarySidebar","onPluginAreaError","previous","next"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,eADD,EAECC,oBAFD,EAGCC,qBAHD,EAICC,aAJD,EAKCC,+BALD,EAMCC,eAND,EAOCC,KAAK,IAAIC,WAPV,QAQO,mBARP;AASA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,eAAT,QAAgC,yBAAhC;AACA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,uBAA5C;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SACCC,iBADD,EAECC,cAFD,EAGCC,iBAHD,EAICf,KAAK,IAAIgB,cAJV,QAKO,sBALP;AAMA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,WAA9B,QAAiD,oBAAjD;AACA,SAASnB,KAAK,IAAIoB,sBAAlB,QAAgD,+BAAhD;AACA,SAASpB,KAAK,IAAIqB,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,yBAAP,MAAsC,uBAAtC;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,wBAAP,MAAqC,sBAArC;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,eAAP,MAA4B,wCAA5B;AACA,OAAOC,eAAP,MAA4B,6BAA5B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAA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AAI,KAAK,QAJT,IAKC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,eAAD;AAAiB,MAAA,aAAa,EAAGe;AAAjC,MADD,CAhEH;AAqEC,IAAA,OAAO,EACN,cAAC,YAAD;AACC,MAAA,wBAAwB,EAAGkB,wBAD5B;AAEC,MAAA,yBAAyB,EACxBF,2BAHF;AAKC,MAAA,8BAA8B,EAC7BC;AANF,MAtEF;AAgFC,IAAA,SAAS,EAAG;AACXO,MAAAA,QAAQ,EAAEjC,gBADC;AAEXkC,MAAAA,IAAI,EAAEjC;AAFK;AAhFb,IATD,EA8FC,cAAC,wBAAD,OA9FD,EA+FC,cAAC,yBAAD,OA/FD,EAgGC,cAAC,YAAD,OAhGD,EAiGC,cAAC,gBAAD,OAjGD,EAkGC,cAAC,OAAD,CAAS,IAAT,OAlGD,EAmGC,cAAC,UAAD;AAAY,IAAA,OAAO,EAAG+B;AAAtB,IAnGD,CADD;AAuGA;;AAED,eAAe/C,MAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorNotices,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { Button, ScrollLock, Popover } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tFullscreenMode,\n\tInterfaceSkeleton,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useState, useEffect, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport EditPostPreferencesModal from '../preferences-modal';\nimport BrowserURL from '../browser-url';\nimport Header from '../header';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport SettingsSidebar from '../sidebar/settings-sidebar';\nimport MetaBoxes from '../meta-boxes';\nimport WelcomeGuide from '../welcome-guide';\nimport ActionsPanel from './actions-panel';\nimport StartPageOptions from '../start-page-options';\nimport { store as editPostStore } from '../../store';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nfunction Layout( { styles } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst { openGeneralSidebar, closeGeneralSidebar, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\tisRichEditingEnabled,\n\t\tsidebarIsOpened,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\thasBlockSelected,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowBlockBreadcrumbs,\n\t\tisTemplateMode,\n\t\tdocumentLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\thasFixedToolbar:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fixedToolbar' ),\n\t\t\tsidebarIsOpened: !! (\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\teditPostStore.name\n\t\t\t\t) || select( editPostStore ).isPublishSidebarOpened()\n\t\t\t),\n\t\t\tisFullscreenActive:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editPostStore ).isListViewOpened(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFree:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: select( editPostStore ).isFeatureActive(\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\tconst openSidebarPanel = () =>\n\t\topenGeneralSidebar(\n\t\t\thasBlockSelected ? 'edit-post/block' : 'edit-post/document'\n\t\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( sidebarIsOpened && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t}\n\t}, [ sidebarIsOpened, isHugeViewport ] );\n\tuseEffect( () => {\n\t\tif ( isInserterOpened && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isHugeViewport ] );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\tconst className = classnames( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'is-sidebar-opened': sidebarIsOpened,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t\t'show-icon-labels': showIconLabels,\n\t\t'is-distraction-free': isDistractionFree && isLargeViewport,\n\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t} );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( mode === 'visual' && isInserterOpened ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( mode === 'visual' && isListViewOpened ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t<BrowserURL />\n\t\t\t<UnsavedChangesWarning />\n\t\t\t<AutosaveMonitor />\n\t\t\t<LocalAutosaveMonitor />\n\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t<SettingsSidebar />\n\t\t\t<InterfaceSkeleton\n\t\t\t\tisDistractionFree={ isDistractionFree && isLargeViewport }\n\t\t\t\tclassName={ className }\n\t\t\t\tlabels={ {\n\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t} }\n\t\t\t\theader={\n\t\t\t\t\t<Header\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\tsidebar={\n\t\t\t\t\t( ! isMobileViewport || sidebarIsOpened ) && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isMobileViewport && ! sidebarIsOpened && (\n\t\t\t\t\t\t\t\t<div className=\"edit-post-layout__toggle-sidebar-panel\">\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-post-layout__toggle-sidebar-panel-button\"\n\t\t\t\t\t\t\t\t\t\tonClick={ openSidebarPanel }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ hasBlockSelected\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Open block settings' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Open document settings' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isDistractionFree && <EditorNotices /> }\n\t\t\t\t\t\t{ ( mode === 'text' || ! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t<TextEditor />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isRichEditingEnabled && mode === 'visual' && (\n\t\t\t\t\t\t\t<VisualEditor styles={ styles } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDistractionFree && ! isTemplateMode && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ isMobileViewport && sidebarIsOpened && (\n\t\t\t\t\t\t\t<ScrollLock />\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t! isMobileViewport &&\n\t\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t<div className=\"edit-post-layout__footer\">\n\t\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<ActionsPanel\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tshortcuts={ {\n\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<EditPostPreferencesModal />\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<WelcomeGuide />\n\t\t\t<StartPageOptions />\n\t\t\t<Popover.Slot />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -4,6 +4,9 @@ import { createElement, Fragment } from "@wordpress/element";
4
4
  * WordPress dependencies
5
5
  */
6
6
  import { MenuItem, VisuallyHidden } from '@wordpress/components';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+ import { store as editorStore } from '@wordpress/editor';
9
+ import { useSelect } from '@wordpress/data';
7
10
  import { external } from '@wordpress/icons';
8
11
  import { __ } from '@wordpress/i18n';
9
12
  import { registerPlugin } from '@wordpress/plugins';
@@ -16,16 +19,40 @@ import CopyContentMenuItem from './copy-content-menu-item';
16
19
  import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
17
20
  import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
18
21
  import WelcomeGuideMenuItem from './welcome-guide-menu-item';
22
+
23
+ function ManagePatternsMenuItem() {
24
+ const url = useSelect(select => {
25
+ const {
26
+ canUser
27
+ } = select(coreStore);
28
+ const {
29
+ getEditorSettings
30
+ } = select(editorStore);
31
+
32
+ const isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;
33
+
34
+ const defaultUrl = addQueryArgs('edit.php', {
35
+ post_type: 'wp_block'
36
+ });
37
+ const patternsUrl = addQueryArgs('site-editor.php', {
38
+ path: '/patterns'
39
+ }); // The site editor and templates both check whether the user has
40
+ // edit_theme_options capabilities. We can leverage that here and not
41
+ // display the manage patterns link if the user can't access it.
42
+
43
+ return canUser('read', 'templates') && isBlockTheme ? patternsUrl : defaultUrl;
44
+ }, []);
45
+ return createElement(MenuItem, {
46
+ role: "menuitem",
47
+ href: url
48
+ }, __('Manage Patterns'));
49
+ }
50
+
19
51
  registerPlugin('edit-post', {
20
52
  render() {
21
53
  return createElement(Fragment, null, createElement(ToolsMoreMenuGroup, null, ({
22
54
  onClose
23
- }) => createElement(Fragment, null, createElement(MenuItem, {
24
- role: "menuitem",
25
- href: addQueryArgs('edit.php', {
26
- post_type: 'wp_block'
27
- })
28
- }, __('Manage Patterns')), createElement(KeyboardShortcutsHelpMenuItem, {
55
+ }) => createElement(Fragment, null, createElement(ManagePatternsMenuItem, null), createElement(KeyboardShortcutsHelpMenuItem, {
29
56
  onSelect: onClose
30
57
  }), createElement(WelcomeGuideMenuItem, null), createElement(CopyContentMenuItem, null), createElement(MenuItem, {
31
58
  role: "menuitem",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","render","onClose","post_type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,uBAAzC;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,6BAAP,MAA0C,qCAA1C;AACA,OAAOC,kBAAP,MAA+B,4CAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEAL,cAAc,CAAE,WAAF,EAAe;AAC5BM,EAAAA,MAAM,GAAG;AACR,WACC,8BACC,cAAC,kBAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,8BACC,cAAC,QAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGN,YAAY,CAAE,UAAF,EAAc;AAChCO,QAAAA,SAAS,EAAE;AADqB,OAAd;AAFpB,OAMGT,EAAE,CAAE,iBAAF,CANL,CADD,EASC,cAAC,6BAAD;AACC,MAAA,QAAQ,EAAGQ;AADZ,MATD,EAYC,cAAC,oBAAD,OAZD,EAaC,cAAC,mBAAD,OAbD,EAcC,cAAC,QAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGT,QAFR;AAGC,MAAA,IAAI,EAAGC,EAAE,CACR,qEADQ,CAHV;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASGA,EAAE,CAAE,MAAF,CATL,EAUC,cAAC,cAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACAA,IAAAA,EAAE,CAAE,sBAAF,CAHJ,CAVD,CAdD,CAFF,CADD,CADD;AAwCA;;AA1C2B,CAAf,CAAd","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Manage Patterns' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","store","coreStore","editorStore","useSelect","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","ManagePatternsMenuItem","url","select","canUser","getEditorSettings","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","post_type","patternsUrl","path","render","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,uBAAzC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,mBAArC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,6BAAP,MAA0C,qCAA1C;AACA,OAAOC,kBAAP,MAA+B,4CAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;;AAEA,SAASC,sBAAT,GAAkC;AACjC,QAAMC,GAAG,GAAGV,SAAS,CAAIW,MAAF,IAAc;AACpC,UAAM;AAAEC,MAAAA;AAAF,QAAcD,MAAM,CAAEb,SAAF,CAA1B;AACA,UAAM;AAAEe,MAAAA;AAAF,QAAwBF,MAAM,CAAEZ,WAAF,CAApC;;AAEA,UAAMe,YAAY,GAAGD,iBAAiB,GAAGE,2BAAzC;;AACA,UAAMC,UAAU,GAAGZ,YAAY,CAAE,UAAF,EAAc;AAC5Ca,MAAAA,SAAS,EAAE;AADiC,KAAd,CAA/B;AAGA,UAAMC,WAAW,GAAGd,YAAY,CAAE,iBAAF,EAAqB;AACpDe,MAAAA,IAAI,EAAE;AAD8C,KAArB,CAAhC,CARoC,CAYpC;AACA;AACA;;AACA,WAAOP,OAAO,CAAE,MAAF,EAAU,WAAV,CAAP,IAAkCE,YAAlC,GACJI,WADI,GAEJF,UAFH;AAGA,GAlBoB,EAkBlB,EAlBkB,CAArB;AAoBA,SACC,cAAC,QAAD;AAAU,IAAA,IAAI,EAAC,UAAf;AAA0B,IAAA,IAAI,EAAGN;AAAjC,KACGR,EAAE,CAAE,iBAAF,CADL,CADD;AAKA;;AAEDC,cAAc,CAAE,WAAF,EAAe;AAC5BiB,EAAAA,MAAM,GAAG;AACR,WACC,8BACC,cAAC,kBAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,8BACC,cAAC,sBAAD,OADD,EAEC,cAAC,6BAAD;AACC,MAAA,QAAQ,EAAGA;AADZ,MAFD,EAKC,cAAC,oBAAD,OALD,EAMC,cAAC,mBAAD,OAND,EAOC,cAAC,QAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGpB,QAFR;AAGC,MAAA,IAAI,EAAGC,EAAE,CACR,qEADQ,CAHV;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASGA,EAAE,CAAE,MAAF,CATL,EAUC,cAAC,cAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACAA,IAAAA,EAAE,CAAE,sBAAF,CAHJ,CAVD,CAPD,CAFF,CADD,CADD;AAiCA;;AAnC2B,CAAf,CAAd","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage Patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
@@ -1939,36 +1939,32 @@ h2.edit-post-template-summary__title {
1939
1939
  opacity: 1;
1940
1940
  }
1941
1941
  }
1942
- html.wp-toolbar {
1943
- background: #fff;
1944
- }
1945
-
1946
- body.block-editor-page {
1942
+ body.js.block-editor-page {
1947
1943
  background: #fff;
1948
1944
  /* We hide legacy notices in Gutenberg Based Pages, because they were not designed in a way that scaled well.
1949
1945
  Plugins can use Gutenberg notices if they need to pass on information to the user when they are editing. */
1950
1946
  }
1951
- body.block-editor-page #wpcontent {
1947
+ body.js.block-editor-page #wpcontent {
1952
1948
  padding-right: 0;
1953
1949
  }
1954
- body.block-editor-page #wpbody-content {
1950
+ body.js.block-editor-page #wpbody-content {
1955
1951
  padding-bottom: 0;
1956
1952
  }
1957
- body.block-editor-page #wpbody-content > div:not(.block-editor):not(#screen-meta) {
1953
+ body.js.block-editor-page #wpbody-content > div:not(.block-editor):not(#screen-meta) {
1958
1954
  display: none;
1959
1955
  }
1960
- body.block-editor-page #wpfooter {
1956
+ body.js.block-editor-page #wpfooter {
1961
1957
  display: none;
1962
1958
  }
1963
- body.block-editor-page .a11y-speak-region {
1959
+ body.js.block-editor-page .a11y-speak-region {
1964
1960
  right: -1px;
1965
1961
  top: -1px;
1966
1962
  }
1967
- body.block-editor-page ul#adminmenu a.wp-has-current-submenu::after,
1968
- body.block-editor-page ul#adminmenu > li.current > a.current::after {
1963
+ body.js.block-editor-page ul#adminmenu a.wp-has-current-submenu::after,
1964
+ body.js.block-editor-page ul#adminmenu > li.current > a.current::after {
1969
1965
  border-left-color: #fff;
1970
1966
  }
1971
- body.block-editor-page .media-frame select.attachment-filters:last-of-type {
1967
+ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
1972
1968
  width: auto;
1973
1969
  max-width: 100%;
1974
1970
  }
@@ -1939,36 +1939,32 @@ h2.edit-post-template-summary__title {
1939
1939
  opacity: 1;
1940
1940
  }
1941
1941
  }
1942
- html.wp-toolbar {
1943
- background: #fff;
1944
- }
1945
-
1946
- body.block-editor-page {
1942
+ body.js.block-editor-page {
1947
1943
  background: #fff;
1948
1944
  /* We hide legacy notices in Gutenberg Based Pages, because they were not designed in a way that scaled well.
1949
1945
  Plugins can use Gutenberg notices if they need to pass on information to the user when they are editing. */
1950
1946
  }
1951
- body.block-editor-page #wpcontent {
1947
+ body.js.block-editor-page #wpcontent {
1952
1948
  padding-left: 0;
1953
1949
  }
1954
- body.block-editor-page #wpbody-content {
1950
+ body.js.block-editor-page #wpbody-content {
1955
1951
  padding-bottom: 0;
1956
1952
  }
1957
- body.block-editor-page #wpbody-content > div:not(.block-editor):not(#screen-meta) {
1953
+ body.js.block-editor-page #wpbody-content > div:not(.block-editor):not(#screen-meta) {
1958
1954
  display: none;
1959
1955
  }
1960
- body.block-editor-page #wpfooter {
1956
+ body.js.block-editor-page #wpfooter {
1961
1957
  display: none;
1962
1958
  }
1963
- body.block-editor-page .a11y-speak-region {
1959
+ body.js.block-editor-page .a11y-speak-region {
1964
1960
  left: -1px;
1965
1961
  top: -1px;
1966
1962
  }
1967
- body.block-editor-page ul#adminmenu a.wp-has-current-submenu::after,
1968
- body.block-editor-page ul#adminmenu > li.current > a.current::after {
1963
+ body.js.block-editor-page ul#adminmenu a.wp-has-current-submenu::after,
1964
+ body.js.block-editor-page ul#adminmenu > li.current > a.current::after {
1969
1965
  border-right-color: #fff;
1970
1966
  }
1971
- body.block-editor-page .media-frame select.attachment-filters:last-of-type {
1967
+ body.js.block-editor-page .media-frame select.attachment-filters:last-of-type {
1972
1968
  width: auto;
1973
1969
  max-width: 100%;
1974
1970
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "7.12.7",
3
+ "version": "7.12.8",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,34 +29,34 @@
29
29
  "@babel/runtime": "^7.16.0",
30
30
  "@wordpress/a11y": "^3.35.1",
31
31
  "@wordpress/api-fetch": "^6.32.1",
32
- "@wordpress/block-editor": "^12.3.5",
33
- "@wordpress/block-library": "^8.12.7",
32
+ "@wordpress/block-editor": "^12.3.6",
33
+ "@wordpress/block-library": "^8.12.8",
34
34
  "@wordpress/blocks": "^12.12.3",
35
- "@wordpress/commands": "^0.6.5",
36
- "@wordpress/components": "^25.1.5",
35
+ "@wordpress/commands": "^0.6.6",
36
+ "@wordpress/components": "^25.1.6",
37
37
  "@wordpress/compose": "^6.12.1",
38
- "@wordpress/core-commands": "^0.4.5",
39
- "@wordpress/core-data": "^6.12.5",
38
+ "@wordpress/core-commands": "^0.4.6",
39
+ "@wordpress/core-data": "^6.12.6",
40
40
  "@wordpress/data": "^9.5.3",
41
41
  "@wordpress/deprecated": "^3.35.1",
42
42
  "@wordpress/dom": "^3.35.1",
43
- "@wordpress/editor": "^13.12.5",
43
+ "@wordpress/editor": "^13.12.6",
44
44
  "@wordpress/element": "^5.12.1",
45
45
  "@wordpress/hooks": "^3.35.1",
46
46
  "@wordpress/i18n": "^4.35.1",
47
47
  "@wordpress/icons": "^9.26.2",
48
- "@wordpress/interface": "^5.12.5",
48
+ "@wordpress/interface": "^5.12.6",
49
49
  "@wordpress/keyboard-shortcuts": "^4.12.3",
50
50
  "@wordpress/keycodes": "^3.35.1",
51
51
  "@wordpress/media-utils": "^4.26.1",
52
52
  "@wordpress/notices": "^4.3.3",
53
- "@wordpress/plugins": "^6.3.5",
54
- "@wordpress/preferences": "^3.12.5",
53
+ "@wordpress/plugins": "^6.3.6",
54
+ "@wordpress/preferences": "^3.12.6",
55
55
  "@wordpress/private-apis": "^0.17.1",
56
56
  "@wordpress/url": "^3.36.1",
57
57
  "@wordpress/viewport": "^5.12.3",
58
58
  "@wordpress/warning": "^2.35.1",
59
- "@wordpress/widgets": "^3.12.5",
59
+ "@wordpress/widgets": "^3.12.6",
60
60
  "classnames": "^2.3.1",
61
61
  "memize": "^2.1.0",
62
62
  "rememo": "^4.0.2"
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
71
+ "gitHead": "86ecd96b3bcada6b4cc35bb2455b3029cebb0ff3"
72
72
  }
@@ -16,10 +16,7 @@ import {
16
16
  store as editorStore,
17
17
  } from '@wordpress/editor';
18
18
  import { useSelect, useDispatch } from '@wordpress/data';
19
- import {
20
- BlockBreadcrumb,
21
- privateApis as blockEditorPrivateApis,
22
- } from '@wordpress/block-editor';
19
+ import { BlockBreadcrumb } from '@wordpress/block-editor';
23
20
  import { Button, ScrollLock, Popover } from '@wordpress/components';
24
21
  import { useViewportMatch } from '@wordpress/compose';
25
22
  import { PluginArea } from '@wordpress/plugins';
@@ -52,9 +49,6 @@ import WelcomeGuide from '../welcome-guide';
52
49
  import ActionsPanel from './actions-panel';
53
50
  import StartPageOptions from '../start-page-options';
54
51
  import { store as editPostStore } from '../../store';
55
- import { unlock } from '../../lock-unlock';
56
-
57
- const { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );
58
52
 
59
53
  const interfaceLabels = {
60
54
  /* translators: accessibility text for the editor top bar landmark region. */
@@ -69,12 +63,6 @@ const interfaceLabels = {
69
63
  footer: __( 'Editor footer' ),
70
64
  };
71
65
 
72
- const blockRemovalRules = {
73
- 'core/footnotes': __(
74
- 'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'
75
- ),
76
- };
77
-
78
66
  function Layout( { styles } ) {
79
67
  const isMobileViewport = useViewportMatch( 'medium', '<' );
80
68
  const isHugeViewport = useViewportMatch( 'huge', '>=' );
@@ -214,7 +202,6 @@ function Layout( { styles } ) {
214
202
  <LocalAutosaveMonitor />
215
203
  <EditPostKeyboardShortcuts />
216
204
  <EditorKeyboardShortcutsRegister />
217
- <BlockRemovalWarningModal rules={ blockRemovalRules } />
218
205
  <SettingsSidebar />
219
206
  <InterfaceSkeleton
220
207
  isDistractionFree={ isDistractionFree && isLargeViewport }
@@ -2,6 +2,9 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { MenuItem, VisuallyHidden } from '@wordpress/components';
5
+ import { store as coreStore } from '@wordpress/core-data';
6
+ import { store as editorStore } from '@wordpress/editor';
7
+ import { useSelect } from '@wordpress/data';
5
8
  import { external } from '@wordpress/icons';
6
9
  import { __ } from '@wordpress/i18n';
7
10
  import { registerPlugin } from '@wordpress/plugins';
@@ -15,6 +18,34 @@ import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
15
18
  import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
16
19
  import WelcomeGuideMenuItem from './welcome-guide-menu-item';
17
20
 
21
+ function ManagePatternsMenuItem() {
22
+ const url = useSelect( ( select ) => {
23
+ const { canUser } = select( coreStore );
24
+ const { getEditorSettings } = select( editorStore );
25
+
26
+ const isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;
27
+ const defaultUrl = addQueryArgs( 'edit.php', {
28
+ post_type: 'wp_block',
29
+ } );
30
+ const patternsUrl = addQueryArgs( 'site-editor.php', {
31
+ path: '/patterns',
32
+ } );
33
+
34
+ // The site editor and templates both check whether the user has
35
+ // edit_theme_options capabilities. We can leverage that here and not
36
+ // display the manage patterns link if the user can't access it.
37
+ return canUser( 'read', 'templates' ) && isBlockTheme
38
+ ? patternsUrl
39
+ : defaultUrl;
40
+ }, [] );
41
+
42
+ return (
43
+ <MenuItem role="menuitem" href={ url }>
44
+ { __( 'Manage Patterns' ) }
45
+ </MenuItem>
46
+ );
47
+ }
48
+
18
49
  registerPlugin( 'edit-post', {
19
50
  render() {
20
51
  return (
@@ -22,14 +53,7 @@ registerPlugin( 'edit-post', {
22
53
  <ToolsMoreMenuGroup>
23
54
  { ( { onClose } ) => (
24
55
  <>
25
- <MenuItem
26
- role="menuitem"
27
- href={ addQueryArgs( 'edit.php', {
28
- post_type: 'wp_block',
29
- } ) }
30
- >
31
- { __( 'Manage Patterns' ) }
32
- </MenuItem>
56
+ <ManagePatternsMenuItem />
33
57
  <KeyboardShortcutsHelpMenuItem
34
58
  onSelect={ onClose }
35
59
  />
package/src/style.scss CHANGED
@@ -41,13 +41,7 @@
41
41
  }
42
42
  }
43
43
 
44
- // In order to use mix-blend-mode, this element needs to have an explicitly set background-color
45
- // We scope it to .wp-toolbar to be wp-admin only, to prevent bleed into other implementations
46
- html.wp-toolbar {
47
- background: $white;
48
- }
49
-
50
- body.block-editor-page {
44
+ body.js.block-editor-page {
51
45
  @include wp-admin-reset( ".block-editor" );
52
46
  }
53
47