@wordpress/edit-post 7.20.1 → 7.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/header/header-toolbar/index.js +2 -1
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/layout/index.js +18 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-excerpt/index.js +72 -0
- package/build/components/sidebar/plugin-post-excerpt/index.js.map +1 -0
- package/build/components/sidebar/post-excerpt/index.js +23 -20
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/editor.js +0 -7
- package/build/editor.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +2 -1
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/layout/index.js +18 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-excerpt/index.js +64 -0
- package/build-module/components/sidebar/plugin-post-excerpt/index.js.map +1 -0
- package/build-module/components/sidebar/post-excerpt/index.js +23 -20
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/editor.js +0 -7
- package/build-module/editor.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-style/style-rtl.css +0 -1
- package/build-style/style.css +0 -1
- package/package.json +32 -32
- package/src/components/header/header-toolbar/index.js +1 -0
- package/src/components/header/header-toolbar/style.scss +0 -1
- package/src/components/layout/index.js +19 -0
- package/src/components/sidebar/plugin-post-excerpt/index.js +61 -0
- package/src/components/sidebar/plugin-post-excerpt/test/index.js +36 -0
- package/src/components/sidebar/post-excerpt/index.js +25 -22
- package/src/editor.js +0 -5
- package/src/index.js +1 -0
- package/src/lock-unlock.js +1 -1
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_hooks","_preferences","_widgets","_editor","_store","_pluginBlockSettingsMenuItem","_pluginDocumentSettingPanel","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginSidebar","_pluginSidebarMoreMenuItem","_fullscreenModeClose","_mainDashboardButton","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","blocksStore","reapplyBlockTypeFilters","select","editPostStore","isFeatureActive","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","addFilter","canInsert","blockType","isEditingTemplate","name","rootClientId","getBlockParentsByBlockName","length","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\tif (\n\t\tselect( editPostStore ).isFeatureActive( 'showListViewByDefault' ) &&\n\t\t! select( editPostStore ).isFeatureActive( 'distractionFree' )\n\t) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t/*\n\t * Prevent adding post content block (except in query block) in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removePostContentFromInserter',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAQAA,OAAA;AACAA,OAAA;AACA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AA8KA,IAAAW,4BAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,2BAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,mBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,uBAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,qBAAA,GAAAZ,sBAAA,CAAAH,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;;AAEA;AACA;AACA;AACO,SAASiE,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_hooks","_preferences","_widgets","_editor","_store","_pluginBlockSettingsMenuItem","_pluginDocumentSettingPanel","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginSidebar","_pluginSidebarMoreMenuItem","_fullscreenModeClose","_mainDashboardButton","_pluginPostExcerpt","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","blocksStore","reapplyBlockTypeFilters","select","editPostStore","isFeatureActive","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","addFilter","canInsert","blockType","isEditingTemplate","name","rootClientId","getBlockParentsByBlockName","length","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\tif (\n\t\tselect( editPostStore ).isFeatureActive( 'showListViewByDefault' ) &&\n\t\t! select( editPostStore ).isFeatureActive( 'distractionFree' )\n\t) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t/*\n\t * Prevent adding post content block (except in query block) in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removePostContentFromInserter',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { default as __experimentalPluginPostExcerpt } from './components/sidebar/plugin-post-excerpt';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAQAA,OAAA;AACAA,OAAA;AACA,IAAAS,OAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AA8KA,IAAAW,4BAAA,GAAAR,sBAAA,CAAAH,OAAA;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D,IAAI,CAAC6D,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAACrF,OAAA,CAAAsF,OAAM;IACNrE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOI,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASiE,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
|
package/build/lock-unlock.js
CHANGED
|
@@ -12,7 +12,7 @@ var _privateApis = require("@wordpress/private-apis");
|
|
|
12
12
|
const {
|
|
13
13
|
lock,
|
|
14
14
|
unlock
|
|
15
|
-
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my
|
|
15
|
+
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/edit-post');
|
|
16
16
|
exports.unlock = unlock;
|
|
17
17
|
exports.lock = lock;
|
|
18
18
|
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my
|
|
1
|
+
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,sBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
|
|
@@ -117,7 +117,8 @@ function HeaderToolbar({
|
|
|
117
117
|
return createElement(NavigableToolbar, {
|
|
118
118
|
className: "edit-post-header-toolbar",
|
|
119
119
|
"aria-label": toolbarAriaLabel,
|
|
120
|
-
shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused
|
|
120
|
+
shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused,
|
|
121
|
+
variant: "unstyled"
|
|
121
122
|
}, createElement("div", {
|
|
122
123
|
className: "edit-post-header-toolbar__left"
|
|
123
124
|
}, createElement(ToolbarItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","EditorHistoryRedo","EditorHistoryUndo","editorStore","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","editPostStore","unlock","useShouldContextualToolbarShow","preventDefault","event","HeaderToolbar","setListViewToggleElement","inserterButton","setIsInserterOpened","setIsListViewOpened","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","hasFixedToolbar","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","getEditorSettings","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","get","getPreference","richEditingEnabled","isLargeViewport","isWideViewport","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","overflowItems","createElement","Fragment","as","className","icon","disabled","isPressed","label","onClick","shortcut","showTooltip","variant","undefined","ref","toggleInserter","current","focus","longLabel","shortLabel","shouldUseKeyboardFocusShortcut","onMouseDown"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tEditorHistoryRedo,\n\tEditorHistoryUndo,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction HeaderToolbar( { setListViewToggleElement } ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tisInserterEnabled,\n\t\tisInserterOpened,\n\t\tisTextModeEnabled,\n\t\tshowIconLabels,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\thasFixedToolbar,\n\t} = useSelect( ( select ) => {\n\t\tconst { hasInserterItems, getBlockRootClientId, getBlockSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getEditorMode, isFeatureActive, isListViewOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { get: getPreference } = select( preferencesStore );\n\n\t\treturn {\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tisInserterEnabled:\n\t\t\t\tgetEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisTextModeEnabled: getEditorMode() === 'text',\n\t\t\tshowIconLabels: isFeatureActive( 'showIconLabels' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-post/toggle-list-view'\n\t\t\t),\n\t\t\thasFixedToolbar: getPreference( 'core/edit-post', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useShouldContextualToolbarShow();\n\t// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.\n\t// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.\n\tconst blockToolbarCanBeFocused =\n\t\tshouldShowContextualToolbar ||\n\t\tcanFocusHiddenToolbar ||\n\t\tfixedToolbarCanBeFocused;\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\tconst overflowItems = (\n\t\t<>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-post-header-toolbar__document-overview-toggle\"\n\t\t\t\ticon={ listView }\n\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\tonClick={ toggleListView }\n\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\tref={ setListViewToggleElement }\n\t\t\t/>\n\t\t</>\n\t);\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-post-header-toolbar\"\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t>\n\t\t\t<div className=\"edit-post-header-toolbar__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"edit-post-header-toolbar__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\tdisabled={ ! isInserterEnabled }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ overflowItems }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default HeaderToolbar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,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AW;IACX0D,GAAG,EAAG5C,cAAgB;IACtBiC,EAAE,EAAGhD,MAAQ;IACbiD,SAAS,EAAC,2CAA2C;IACrDQ,OAAO,EAAC,SAAS;IACjBL,SAAS,EAAGjC,gBAAkB;IAC9B+C,WAAW,EAAGvD,cAAgB;IAC9B2C,OAAO,EAAGM,cAAgB;IAC1BT,QAAQ,EAAG,CAAEjC,iBAAmB;IAChCgC,IAAI,EAAG/C,IAAM;IACbkD,KAAK,EAAGhC,cAAc,GAAG2C,UAAU,GAAGD,SAAW;IACjDP,WAAW,EAAG,CAAEnC,cAAgB;IAChC,iBAAgBF;EAAkB,CAClC,CAAC,EACA,CAAEmB,cAAc,IAAI,CAAEjB,cAAc,KACrCyB,aAAA,CAAAC,QAAA,QACGV,eAAe,IAAI,CAAEb,eAAe,IACrCsB,aAAA,CAAC7C,WAAW;IACX+C,EAAE,EAAGxD,YAAc;IACnBgE,WAAW,EAAG,CAAEnC,cAAgB;IAChCoC,OAAO,EACNpC,cAAc,GAAG,UAAU,GAAGqC,SAC9B;IACDP,QAAQ,EAAG/B;EAAmB,CAC9B,CACD,EACD0B,aAAA,CAAC7C,WAAW;IACX+C,EAAE,EAAGlD,iBAAmB;IACxB0D,WAAW,EAAG,CAAEnC,cAAgB;IAChCoC,OAAO,EAAGpC,cAAc,GAAG,UAAU,GAAGqC;EAAW,CACnD,CAAC,EACFZ,aAAA,CAAC7C,WAAW;IACX+C,EAAE,EAAGnD,iBAAmB;IACxB2D,WAAW,EAAG,CAAEnC,cAAgB;IAChCoC,OAAO,EAAGpC,cAAc,GAAG,UAAU,GAAGqC;EAAW,CACnD,CAAC,EACAb,aACD,CAEC,CACY,CAAC;AAErB;AAEA,eAAehC,aAAa"}
|
|
1
|
+
{"version":3,"names":["useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","EditorHistoryRedo","EditorHistoryUndo","editorStore","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","editPostStore","unlock","useShouldContextualToolbarShow","preventDefault","event","HeaderToolbar","setListViewToggleElement","inserterButton","setIsInserterOpened","setIsListViewOpened","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","hasFixedToolbar","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","getEditorSettings","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","get","getPreference","richEditingEnabled","isLargeViewport","isWideViewport","shouldShowContextualToolbar","canFocusHiddenToolbar","fixedToolbarCanBeFocused","blockToolbarCanBeFocused","toolbarAriaLabel","toggleListView","overflowItems","createElement","Fragment","as","className","icon","disabled","isPressed","label","onClick","shortcut","showTooltip","variant","undefined","ref","toggleInserter","current","focus","longLabel","shortLabel","shouldUseKeyboardFocusShortcut","onMouseDown"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tEditorHistoryRedo,\n\tEditorHistoryUndo,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useShouldContextualToolbarShow } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction HeaderToolbar( { setListViewToggleElement } ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tisInserterEnabled,\n\t\tisInserterOpened,\n\t\tisTextModeEnabled,\n\t\tshowIconLabels,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\thasFixedToolbar,\n\t} = useSelect( ( select ) => {\n\t\tconst { hasInserterItems, getBlockRootClientId, getBlockSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getEditorMode, isFeatureActive, isListViewOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { get: getPreference } = select( preferencesStore );\n\n\t\treturn {\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tisInserterEnabled:\n\t\t\t\tgetEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisTextModeEnabled: getEditorMode() === 'text',\n\t\t\tshowIconLabels: isFeatureActive( 'showIconLabels' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-post/toggle-list-view'\n\t\t\t),\n\t\t\thasFixedToolbar: getPreference( 'core/edit-post', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst {\n\t\tshouldShowContextualToolbar,\n\t\tcanFocusHiddenToolbar,\n\t\tfixedToolbarCanBeFocused,\n\t} = useShouldContextualToolbarShow();\n\t// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.\n\t// There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.\n\tconst blockToolbarCanBeFocused =\n\t\tshouldShowContextualToolbar ||\n\t\tcanFocusHiddenToolbar ||\n\t\tfixedToolbarCanBeFocused;\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\tconst overflowItems = (\n\t\t<>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-post-header-toolbar__document-overview-toggle\"\n\t\t\t\ticon={ listView }\n\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\tonClick={ toggleListView }\n\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\tref={ setListViewToggleElement }\n\t\t\t/>\n\t\t</>\n\t);\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-post-header-toolbar\"\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! blockToolbarCanBeFocused }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"edit-post-header-toolbar__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"edit-post-header-toolbar__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\tdisabled={ ! isInserterEnabled }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ overflowItems }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default HeaderToolbar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SACCC,iBAAiB,EACjBC,iBAAiB,EACjBL,KAAK,IAAIM,WAAW,QACd,mBAAmB;AAC1B,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SAASC,QAAQ,EAAEC,IAAI,QAAQ,kBAAkB;AACjD,SAASC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AACxD,SAASZ,KAAK,IAAIa,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASb,KAAK,IAAIc,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASd,KAAK,IAAIe,aAAa,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAA+B,CAAC,GAAGD,MAAM,CAAEb,sBAAuB,CAAC;AAE3E,MAAMe,cAAc,GAAKC,KAAK,IAAM;EACnCA,KAAK,CAACD,cAAc,CAAC,CAAC;AACvB,CAAC;AAED,SAASE,aAAaA,CAAE;EAAEC;AAAyB,CAAC,EAAG;EACtD,MAAMC,cAAc,GAAGX,MAAM,CAAC,CAAC;EAC/B,MAAM;IAAEY,mBAAmB;IAAEC;EAAoB,CAAC,GACjD7B,WAAW,CAAEoB,aAAc,CAAC;EAC7B,MAAM;IACLU,iBAAiB;IACjBC,gB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AGpC,cAAc,GAAG,UAAU,GAAGqC;EAAW,CACnD,CAAC,EACAb,aACD,CAEC,CACY,CAAC;AAErB;AAEA,eAAehC,aAAa"}
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
import { AutosaveMonitor, LocalAutosaveMonitor, UnsavedChangesWarning, EditorNotices, EditorKeyboardShortcutsRegister, EditorKeyboardShortcuts, EditorSnackbars, PostSyncStatusModal, store as editorStore } from '@wordpress/editor';
|
|
11
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
-
import { useBlockCommands, BlockBreadcrumb, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
|
+
import { useBlockCommands, BlockBreadcrumb, privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
13
|
import { Button, ScrollLock } from '@wordpress/components';
|
|
14
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
15
15
|
import { PluginArea } from '@wordpress/plugins';
|
|
@@ -18,6 +18,14 @@ import { ComplementaryArea, FullscreenMode, InterfaceSkeleton, store as interfac
|
|
|
18
18
|
import { useState, useEffect, useCallback, useMemo } from '@wordpress/element';
|
|
19
19
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
20
20
|
import { store as noticesStore } from '@wordpress/notices';
|
|
21
|
+
import { privateApis as commandsPrivateApis } from '@wordpress/commands';
|
|
22
|
+
import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
|
|
23
|
+
const {
|
|
24
|
+
useCommands
|
|
25
|
+
} = unlock(coreCommandsPrivateApis);
|
|
26
|
+
const {
|
|
27
|
+
useCommandContext
|
|
28
|
+
} = unlock(commandsPrivateApis);
|
|
21
29
|
|
|
22
30
|
/**
|
|
23
31
|
* Internal dependencies
|
|
@@ -38,6 +46,7 @@ import ActionsPanel from './actions-panel';
|
|
|
38
46
|
import StartPageOptions from '../start-page-options';
|
|
39
47
|
import { store as editPostStore } from '../../store';
|
|
40
48
|
import { unlock } from '../../lock-unlock';
|
|
49
|
+
import useCommonCommands from '../../hooks/commands/use-common-commands';
|
|
41
50
|
const {
|
|
42
51
|
getLayoutStyles
|
|
43
52
|
} = unlock(blockEditorPrivateApis);
|
|
@@ -88,6 +97,8 @@ function useEditorStyles() {
|
|
|
88
97
|
}, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport]);
|
|
89
98
|
}
|
|
90
99
|
function Layout() {
|
|
100
|
+
useCommands();
|
|
101
|
+
useCommonCommands();
|
|
91
102
|
useBlockCommands();
|
|
92
103
|
const isMobileViewport = useViewportMatch('medium', '<');
|
|
93
104
|
const isHugeViewport = useViewportMatch('huge', '>=');
|
|
@@ -140,9 +151,14 @@ function Layout() {
|
|
|
140
151
|
isDistractionFree: select(editPostStore).isFeatureActive('distractionFree'),
|
|
141
152
|
showBlockBreadcrumbs: select(editPostStore).isFeatureActive('showBlockBreadcrumbs'),
|
|
142
153
|
// translators: Default label for the Document in the Block Breadcrumb.
|
|
143
|
-
documentLabel: postTypeLabel || _x('Document', 'noun')
|
|
154
|
+
documentLabel: postTypeLabel || _x('Document', 'noun'),
|
|
155
|
+
hasBlockSelected: select(blockEditorStore).getBlockSelectionStart()
|
|
144
156
|
};
|
|
145
157
|
}, []);
|
|
158
|
+
|
|
159
|
+
// Set the right context for the command palette
|
|
160
|
+
const commandContext = hasBlockSelected ? 'block-selection-edit' : 'post-editor-edit';
|
|
161
|
+
useCommandContext(commandContext);
|
|
146
162
|
const styles = useEditorStyles();
|
|
147
163
|
const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document');
|
|
148
164
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","PostSyncStatusModal","store","editorStore","useSelect","useDispatch","useBlockCommands","BlockBreadcrumb","privateApis","blockEditorPrivateApis","Button","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","unlock","getLayoutStyles","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","getPostTypeLabel","postTypeLabel","isEditingTemplate","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","listViewToggleElement","setListViewToggleElement","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","onPluginAreaError","Fragment","isActive","labels","editorNotices","variant","onClick","Slot","scope","notices","content","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"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\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseBlockCommands,\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock } 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, useMemo } 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 { getLayoutStyles } = 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\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout() {\n\tuseBlockCommands();\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 styles = useEditorStyles();\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\n\tconst [ listViewToggleElement, setListViewToggleElement ] =\n\t\tuseState( null );\n\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\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\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'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 (\n\t\t\t\t<ListViewSidebar\n\t\t\t\t\tlistViewToggleElement={ listViewToggleElement }\n\t\t\t\t/>\n\t\t\t);\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<EditorKeyboardShortcuts />\n\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\tsetListViewToggleElement={ setListViewToggleElement }\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<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t<SettingsSidebar />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,eAAe,EACfC,oBAAoB,EACpBC,qBAAqB,EACrBC,aAAa,EACbC,+BAA+B,EAC/BC,uBAAuB,EACvBC,eAAe,EACfC,mBAAmB,EACnBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,gBAAgB,EAChBC,eAAe,EACfC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,MAAM,EAAEC,UAAU,QAAQ,uBAAuB;AAC1D,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBjB,KAAK,IAAIkB,cAAc,QACjB,sBAAsB;AAC7B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AAC9E,SAAStB,KAAK,IAAIuB,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASvB,KAAK,IAAIwB,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,yBAAyB,MAAM,uBAAuB;AAC7D,OAAOC,yBAAyB,MAAM,iCAAiC;AACvE,OAAOC,wBAAwB,MAAM,sBAAsB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wBAAwB,MAAE,CAAC,EAC5B0F,aAAA,CAAC3F,yBAAyB,MAAE,CAAC,EAC7B2F,aAAA,CAACnF,YAAY,MAAE,CAAC,EAChBmF,aAAA,CAACxH,mBAAmB,MAAE,CAAC,EACvBwH,aAAA,CAACjF,gBAAgB,MAAE,CAAC,EACpBiF,aAAA,CAAC5G,UAAU;IAAC8H,OAAO,EAAGjB;EAAmB,CAAE,CAAC,EAC5CD,aAAA,CAACrF,eAAe,MAAE,CACjB,CAAC;AAEL;AAEA,eAAeqC,MAAM"}
|
|
1
|
+
{"version":3,"names":["classnames","AutosaveMonitor","LocalAutosaveMonitor","UnsavedChangesWarning","EditorNotices","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","EditorSnackbars","PostSyncStatusModal","store","editorStore","useSelect","useDispatch","useBlockCommands","BlockBreadcrumb","privateApis","blockEditorPrivateApis","blockEditorStore","Button","ScrollLock","useViewportMatch","PluginArea","__","_x","sprintf","ComplementaryArea","FullscreenMode","InterfaceSkeleton","interfaceStore","useState","useEffect","useCallback","useMemo","keyboardShortcutsStore","noticesStore","commandsPrivateApis","coreCommandsPrivateApis","useCommands","unlock","useCommandContext","TextEditor","VisualEditor","EditPostKeyboardShortcuts","KeyboardShortcutHelpModal","EditPostPreferencesModal","BrowserURL","Header","InserterSidebar","ListViewSidebar","SettingsSidebar","MetaBoxes","WelcomeGuide","ActionsPanel","StartPageOptions","editPostStore","useCommonCommands","getLayoutStyles","interfaceLabels","header","body","sidebar","actions","footer","useEditorStyles","hasThemeStyleSupport","editorSettings","select","isFeatureActive","getEditorSettings","_editorSettings$style","_editorSettings$style2","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","Layout","isMobileViewport","isHugeViewport","isLargeViewport","openGeneralSidebar","closeGeneralSidebar","setIsInserterOpened","createErrorNotice","mode","isFullscreenActive","isRichEditingEnabled","sidebarIsOpened","hasActiveMetaboxes","hasFixedToolbar","previousShortcut","nextShortcut","hasBlockSelected","isInserterOpened","isListViewOpened","showIconLabels","isDistractionFree","showBlockBreadcrumbs","isTemplateMode","documentLabel","getPostTypeLabel","postTypeLabel","isEditingTemplate","getActiveComplementaryArea","name","isPublishSidebarOpened","getEditorMode","richEditingEnabled","hasMetaBoxes","getAllShortcutKeyCombinations","getBlockSelectionStart","commandContext","openSidebarPanel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","listViewToggleElement","setListViewToggleElement","closeEntitiesSavedStates","arg","document","classList","add","remove","className","secondarySidebarLabel","secondarySidebar","createElement","onPluginAreaError","Fragment","isActive","labels","editorNotices","variant","onClick","Slot","scope","notices","content","location","rootLabelText","isEntitiesSavedStatesOpen","shortcuts","previous","next","onError"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"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\tEditorKeyboardShortcuts,\n\tEditorSnackbars,\n\tPostSyncStatusModal,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseBlockCommands,\n\tBlockBreadcrumb,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ScrollLock } 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, useMemo } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\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';\nimport useCommonCommands from '../../hooks/commands/use-common-commands';\n\nconst { getLayoutStyles } = 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\nfunction useEditorStyles() {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...editorSettings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? editorSettings.styles : defaultEditorStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\nfunction Layout() {\n\tuseCommands();\n\tuseCommonCommands();\n\tuseBlockCommands();\n\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\thasBlockSelected:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'post-editor-edit';\n\tuseCommandContext( commandContext );\n\n\tconst styles = useEditorStyles();\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\n\tconst [ listViewToggleElement, setListViewToggleElement ] =\n\t\tuseState( null );\n\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\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\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'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 (\n\t\t\t\t<ListViewSidebar\n\t\t\t\t\tlistViewToggleElement={ listViewToggleElement }\n\t\t\t\t/>\n\t\t\t);\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<EditorKeyboardShortcuts />\n\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\tsetListViewToggleElement={ setListViewToggleElement }\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<PostSyncStatusModal />\n\t\t\t<StartPageOptions />\n\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t<SettingsSidebar />\n\t\t</>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU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e,CAAE,CAC9C,CAEN;IACDhD,OAAO,EACN2E,aAAA,CAACpF,YAAY;MACZ2E,wBAAwB,EAAGA,wBAA0B;MACrDuB,yBAAyB,EACxB3B,2BACA;MACDC,8BAA8B,EAC7BA;IACA,CACD,CACD;IACD2B,SAAS,EAAG;MACXC,QAAQ,EAAEpD,gBAAgB;MAC1BqD,IAAI,EAAEpD;IACP;EAAG,CACH,CAAC,EACFmC,aAAA,CAAC5F,wBAAwB,MAAE,CAAC,EAC5B4F,aAAA,CAAC7F,yBAAyB,MAAE,CAAC,EAC7B6F,aAAA,CAACrF,YAAY,MAAE,CAAC,EAChBqF,aAAA,CAAChI,mBAAmB,MAAE,CAAC,EACvBgI,aAAA,CAACnF,gBAAgB,MAAE,CAAC,EACpBmF,aAAA,CAACnH,UAAU;IAACqI,OAAO,EAAGjB;EAAmB,CAAE,CAAC,EAC5CD,aAAA,CAACvF,eAAe,MAAE,CACjB,CAAC;AAEL;AAEA,eAAeqC,MAAM"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Defines as extensibility slot for the Excerpt panel.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { createSlotFill, PanelRow } from '@wordpress/components';
|
|
10
|
+
const {
|
|
11
|
+
Fill,
|
|
12
|
+
Slot
|
|
13
|
+
} = createSlotFill('PluginPostExcerpt');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Renders a post excerpt panel in the post sidebar.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} props Component properties.
|
|
19
|
+
* @param {string} [props.className] An optional class name added to the row.
|
|
20
|
+
* @param {Element} props.children Children to be rendered.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```js
|
|
24
|
+
* // Using ES5 syntax
|
|
25
|
+
* var __ = wp.i18n.__;
|
|
26
|
+
* var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;
|
|
27
|
+
*
|
|
28
|
+
* function MyPluginPostExcerpt() {
|
|
29
|
+
* return React.createElement(
|
|
30
|
+
* PluginPostExcerpt,
|
|
31
|
+
* {
|
|
32
|
+
* className: 'my-plugin-post-excerpt',
|
|
33
|
+
* },
|
|
34
|
+
* __( 'Post excerpt custom content' )
|
|
35
|
+
* )
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```jsx
|
|
41
|
+
* // Using ESNext syntax
|
|
42
|
+
* import { __ } from '@wordpress/i18n';
|
|
43
|
+
* import { PluginPostExcerpt } from '@wordpress/edit-post';
|
|
44
|
+
*
|
|
45
|
+
* const MyPluginPostExcerpt = () => (
|
|
46
|
+
* <PluginPostExcerpt className="my-plugin-post-excerpt">
|
|
47
|
+
* { __( 'Post excerpt custom content' ) }
|
|
48
|
+
* </PluginPostExcerpt>
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @return {Component} The component to be rendered.
|
|
53
|
+
*/
|
|
54
|
+
const PluginPostExcerpt = ({
|
|
55
|
+
children,
|
|
56
|
+
className
|
|
57
|
+
}) => {
|
|
58
|
+
return createElement(Fill, null, createElement(PanelRow, {
|
|
59
|
+
className: className
|
|
60
|
+
}, children));
|
|
61
|
+
};
|
|
62
|
+
PluginPostExcerpt.Slot = Slot;
|
|
63
|
+
export default PluginPostExcerpt;
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostExcerpt","children","className","createElement"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-excerpt/index.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {Element} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAEhE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CAAE,mBAAoB,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACCC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,QAAQ;IAACK,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB"}
|
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { PanelBody } from '@wordpress/components';
|
|
7
7
|
import { PostExcerpt as PostExcerptForm, PostExcerptCheck } from '@wordpress/editor';
|
|
8
|
-
import {
|
|
9
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
8
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Internal dependencies
|
|
13
12
|
*/
|
|
14
13
|
import { store as editPostStore } from '../../../store';
|
|
14
|
+
import PluginPostExcerpt from '../plugin-post-excerpt';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Module Constants
|
|
18
18
|
*/
|
|
19
19
|
const PANEL_NAME = 'post-excerpt';
|
|
20
|
-
function PostExcerpt({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
20
|
+
export default function PostExcerpt() {
|
|
21
|
+
const {
|
|
22
|
+
isOpened,
|
|
23
|
+
isEnabled
|
|
24
|
+
} = useSelect(select => {
|
|
25
|
+
const {
|
|
26
|
+
isEditorPanelOpened,
|
|
27
|
+
isEditorPanelEnabled
|
|
28
|
+
} = select(editPostStore);
|
|
29
|
+
return {
|
|
30
|
+
isOpened: isEditorPanelOpened(PANEL_NAME),
|
|
31
|
+
isEnabled: isEditorPanelEnabled(PANEL_NAME)
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
const {
|
|
35
|
+
toggleEditorPanelOpened
|
|
36
|
+
} = useDispatch(editPostStore);
|
|
37
|
+
const toggleExcerptPanel = () => toggleEditorPanelOpened(PANEL_NAME);
|
|
25
38
|
if (!isEnabled) {
|
|
26
39
|
return null;
|
|
27
40
|
}
|
|
28
41
|
return createElement(PostExcerptCheck, null, createElement(PanelBody, {
|
|
29
42
|
title: __('Excerpt'),
|
|
30
43
|
opened: isOpened,
|
|
31
|
-
onToggle:
|
|
32
|
-
}, createElement(PostExcerptForm, null)));
|
|
44
|
+
onToggle: toggleExcerptPanel
|
|
45
|
+
}, createElement(PluginPostExcerpt.Slot, null, fills => createElement(Fragment, null, createElement(PostExcerptForm, null), fills))));
|
|
33
46
|
}
|
|
34
|
-
export default compose([withSelect(select => {
|
|
35
|
-
return {
|
|
36
|
-
isEnabled: select(editPostStore).isEditorPanelEnabled(PANEL_NAME),
|
|
37
|
-
isOpened: select(editPostStore).isEditorPanelOpened(PANEL_NAME)
|
|
38
|
-
};
|
|
39
|
-
}), withDispatch(dispatch => ({
|
|
40
|
-
onTogglePanel() {
|
|
41
|
-
return dispatch(editPostStore).toggleEditorPanelOpened(PANEL_NAME);
|
|
42
|
-
}
|
|
43
|
-
}))])(PostExcerpt);
|
|
44
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","PanelBody","PostExcerpt","PostExcerptForm","PostExcerptCheck","
|
|
1
|
+
{"version":3,"names":["__","PanelBody","PostExcerpt","PostExcerptForm","PostExcerptCheck","useDispatch","useSelect","store","editPostStore","PluginPostExcerpt","PANEL_NAME","isOpened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","toggleExcerptPanel","createElement","title","opened","onToggle","Slot","fills","Fragment"],"sources":["@wordpress/edit-post/src/components/sidebar/post-excerpt/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostExcerpt as PostExcerptForm,\n\tPostExcerptCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PluginPostExcerpt from '../plugin-post-excerpt';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nexport default function PostExcerpt() {\n\tconst { isOpened, isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\tselect( editPostStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ toggleExcerptPanel }\n\t\t\t>\n\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PluginPostExcerpt.Slot>\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SACCC,WAAW,IAAIC,eAAe,EAC9BC,gBAAgB,QACV,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AACvD,OAAOC,iBAAiB,MAAM,wBAAwB;;AAEtD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,cAAc;AAEjC,eAAe,SAASR,WAAWA,CAAA,EAAG;EACrC,MAAM;IAAES,QAAQ;IAAEC;EAAU,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACxD,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEL,aAAc,CAAC;IAExB,OAAO;MACNG,QAAQ,EAAEG,mBAAmB,CAAEJ,UAAW,CAAC;MAC3CE,SAAS,EAAEG,oBAAoB,CAAEL,UAAW;IAC7C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEM;EAAwB,CAAC,GAAGX,WAAW,CAAEG,aAAc,CAAC;EAChE,MAAMS,kBAAkB,GAAGA,CAAA,KAAMD,uBAAuB,CAAEN,UAAW,CAAC;EAEtE,IAAK,CAAEE,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACCM,aAAA,CAACd,gBAAgB,QAChBc,aAAA,CAACjB,SAAS;IACTkB,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBoB,MAAM,EAAGT,QAAU;IACnBU,QAAQ,EAAGJ;EAAoB,GAE/BC,aAAA,CAACT,iBAAiB,CAACa,IAAI,QAClBC,KAAK,IACRL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAACf,eAAe,MAAE,CAAC,EACjBoB,KACD,CAEoB,CACd,CACM,CAAC;AAErB"}
|
package/build-module/editor.js
CHANGED
|
@@ -10,7 +10,6 @@ import { SlotFillProvider } from '@wordpress/components';
|
|
|
10
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
12
|
import { CommandMenu } from '@wordpress/commands';
|
|
13
|
-
import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
@@ -19,13 +18,9 @@ import Layout from './components/layout';
|
|
|
19
18
|
import EditorInitialization from './components/editor-initialization';
|
|
20
19
|
import { store as editPostStore } from './store';
|
|
21
20
|
import { unlock } from './lock-unlock';
|
|
22
|
-
import useCommonCommands from './hooks/commands/use-common-commands';
|
|
23
21
|
const {
|
|
24
22
|
ExperimentalEditorProvider
|
|
25
23
|
} = unlock(editorPrivateApis);
|
|
26
|
-
const {
|
|
27
|
-
useCommands
|
|
28
|
-
} = unlock(coreCommandsPrivateApis);
|
|
29
24
|
function Editor({
|
|
30
25
|
postId,
|
|
31
26
|
postType,
|
|
@@ -33,8 +28,6 @@ function Editor({
|
|
|
33
28
|
initialEdits,
|
|
34
29
|
...props
|
|
35
30
|
}) {
|
|
36
|
-
useCommands();
|
|
37
|
-
useCommonCommands();
|
|
38
31
|
const {
|
|
39
32
|
hasFixedToolbar,
|
|
40
33
|
focusMode,
|