@wordpress/edit-post 7.13.0 → 7.14.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 +7 -1
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/index.js +25 -24
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +5 -3
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +8 -6
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +0 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +11 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +5 -3
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +2 -1
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js +1 -5
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/editor.js +3 -0
- package/build/editor.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +176 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -0
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/store/actions.js +31 -15
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -23
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -7
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +6 -1
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/index.js +24 -24
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +4 -3
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -5
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +0 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +11 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -1
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js +1 -4
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/editor.js +2 -0
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +160 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -0
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +24 -11
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -21
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +9 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +1 -2
- package/build-style/style.css +1 -2
- package/package.json +32 -32
- package/src/components/block-manager/style.scss +1 -1
- package/src/components/header/header-toolbar/index.js +4 -1
- package/src/components/header/index.js +10 -10
- package/src/components/header/preferences-menu-item/index.js +4 -3
- package/src/components/keyboard-shortcut-help-modal/index.js +10 -5
- package/src/components/keyboard-shortcuts/index.js +0 -2
- package/src/components/layout/index.js +14 -1
- package/src/components/preferences-modal/index.js +6 -4
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +1 -1
- package/src/components/sidebar/post-status/index.js +1 -0
- package/src/components/sidebar/post-trash/index.js +1 -4
- package/src/components/start-page-options/style.scss +0 -3
- package/src/editor.js +2 -0
- package/src/hooks/commands/use-common-commands.js +155 -0
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +4 -3
- package/src/store/actions.js +22 -9
- package/src/store/reducer.js +0 -20
- package/src/store/selectors.js +11 -3
- package/src/store/test/reducer.js +0 -25
- package/src/store/test/selectors.js +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/store/selectors.js"],"names":["createSelector","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","deprecated","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","preferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","undefined","getHiddenBlockTypes","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","removedPanels","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","activeModal","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","deviceType","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isEditingTemplate","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,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AApB,CACN,UADM,EAEN,aAFM,EAGNN,oBAAoB,CAACxB,EAHf,CAAP;AAKA;;AAED,QAAM+B,IAAI,GAAGvF,MAAM,CAAEL,WAAF,CAAN,CAAsB6F,cAAtB,EAAb;;AACA,MAAKD,IAAI,CAACE,IAAV,EAAiB;AAChB,WAAOzF,MAAM,CAAEN,SAAF,CAAN,CAAoBgG,gCAApB,CACNH,IAAI,CAACE,IADC,CAAP;AAGA;;AAED,SAAO,IAAP;AACA,CA1ByD,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core/edit-post', 'editorMode' ) ??\n\t\t'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// These preferences now exist in the preferences store.\n\t// Fetch them so that they can be merged into the post\n\t// editor preferences.\n\tconst preferences = [\n\t\t'hiddenBlockTypes',\n\t\t'editorMode',\n\t\t'preferredStyleVariations',\n\t].reduce( ( accumulatedPrefs, preferenceKey ) => {\n\t\tconst value = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\tpreferenceKey\n\t\t);\n\n\t\treturn {\n\t\t\t...accumulatedPrefs,\n\t\t\t[ preferenceKey ]: value,\n\t\t};\n\t}, {} );\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'openPanels'\n\t);\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...preferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'hiddenBlockTypes'\n\t\t) ?? EMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport function isEditorPanelRemoved( state, panelName ) {\n\treturn state.removedPanels.includes( panelName );\n}\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst inactivePanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'inactivePanels'\n\t\t);\n\t\treturn (\n\t\t\t! isEditorPanelRemoved( state, panelName ) &&\n\t\t\t! inactivePanels?.includes( panelName )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst openPanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'openPanels'\n\t\t);\n\t\treturn !! openPanels?.includes( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport function isMetaBoxLocationVisible( state, location ) {\n\treturn (\n\t\tisMetaBoxLocationActive( state, location ) &&\n\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\treturn isEditorPanelEnabled( state, `meta-box-${ id }` );\n\t\t} )\n\t);\n}\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether we're editing the template.\n */\nexport function isEditingTemplate( state ) {\n\treturn state.isEditingTemplate;\n}\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/store/selectors.js"],"names":["createSelector","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","deprecated","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","preferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","undefined","getHiddenBlockTypes","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","removedPanels","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","deviceType","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isListViewOpened","listViewPanel","isEditingTemplate","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SAASF,KAAK,IAAIG,SAAlB,QAAmC,sBAAnC;AACA,SAASH,KAAK,IAAII,WAAlB,QAAqC,mBAArC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAMC,YAAY,GAAG,EAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAC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xB,EAHf,CAAP;AAKA;;AAED,QAAM+B,IAAI,GAAGtF,MAAM,CAAEL,WAAF,CAAN,CAAsB4F,cAAtB,EAAb;;AACA,MAAKD,IAAI,CAACE,IAAV,EAAiB;AAChB,WAAOxF,MAAM,CAAEN,SAAF,CAAN,CAAoB+F,gCAApB,CACNH,IAAI,CAACE,IADC,CAAP;AAGA;;AAED,SAAO,IAAP;AACA,CA1ByD,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core/edit-post', 'editorMode' ) ??\n\t\t'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// These preferences now exist in the preferences store.\n\t// Fetch them so that they can be merged into the post\n\t// editor preferences.\n\tconst preferences = [\n\t\t'hiddenBlockTypes',\n\t\t'editorMode',\n\t\t'preferredStyleVariations',\n\t].reduce( ( accumulatedPrefs, preferenceKey ) => {\n\t\tconst value = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\tpreferenceKey\n\t\t);\n\n\t\treturn {\n\t\t\t...accumulatedPrefs,\n\t\t\t[ preferenceKey ]: value,\n\t\t};\n\t}, {} );\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'openPanels'\n\t);\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...preferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'hiddenBlockTypes'\n\t\t) ?? EMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport function isEditorPanelRemoved( state, panelName ) {\n\treturn state.removedPanels.includes( panelName );\n}\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst inactivePanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'inactivePanels'\n\t\t);\n\t\treturn (\n\t\t\t! isEditorPanelRemoved( state, panelName ) &&\n\t\t\t! inactivePanels?.includes( panelName )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst openPanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'openPanels'\n\t\t);\n\t\treturn !! openPanels?.includes( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport function isMetaBoxLocationVisible( state, location ) {\n\treturn (\n\t\tisMetaBoxLocationActive( state, location ) &&\n\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\treturn isEditorPanelEnabled( state, `meta-box-${ id }` );\n\t\t} )\n\t);\n}\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\n}\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether we're editing the template.\n */\nexport function isEditingTemplate( state ) {\n\treturn state.isEditingTemplate;\n}\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"]}
|
|
@@ -1253,7 +1253,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1253
1253
|
|
|
1254
1254
|
.edit-post-block-manager__category-title {
|
|
1255
1255
|
position: sticky;
|
|
1256
|
-
top:
|
|
1256
|
+
top: -4px;
|
|
1257
1257
|
padding: 16px 0;
|
|
1258
1258
|
background-color: #fff;
|
|
1259
1259
|
z-index: 1;
|
|
@@ -1906,7 +1906,6 @@ h2.edit-post-template-summary__title {
|
|
|
1906
1906
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1907
1907
|
column-count: 2;
|
|
1908
1908
|
column-gap: 24px;
|
|
1909
|
-
padding-top: 2px;
|
|
1910
1909
|
}
|
|
1911
1910
|
@media (min-width: 782px) {
|
|
1912
1911
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
package/build-style/style.css
CHANGED
|
@@ -1253,7 +1253,7 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1253
1253
|
|
|
1254
1254
|
.edit-post-block-manager__category-title {
|
|
1255
1255
|
position: sticky;
|
|
1256
|
-
top:
|
|
1256
|
+
top: -4px;
|
|
1257
1257
|
padding: 16px 0;
|
|
1258
1258
|
background-color: #fff;
|
|
1259
1259
|
z-index: 1;
|
|
@@ -1906,7 +1906,6 @@ h2.edit-post-template-summary__title {
|
|
|
1906
1906
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
1907
1907
|
column-count: 2;
|
|
1908
1908
|
column-gap: 24px;
|
|
1909
|
-
padding-top: 2px;
|
|
1910
1909
|
}
|
|
1911
1910
|
@media (min-width: 782px) {
|
|
1912
1911
|
.edit-post-start-page-options__modal-content .block-editor-block-patterns-list {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.14.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^25.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/deprecated": "^3.
|
|
42
|
-
"@wordpress/dom": "^3.
|
|
43
|
-
"@wordpress/editor": "^13.
|
|
44
|
-
"@wordpress/element": "^5.
|
|
45
|
-
"@wordpress/hooks": "^3.
|
|
46
|
-
"@wordpress/i18n": "^4.
|
|
47
|
-
"@wordpress/icons": "^9.
|
|
48
|
-
"@wordpress/interface": "^5.
|
|
49
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
50
|
-
"@wordpress/keycodes": "^3.
|
|
51
|
-
"@wordpress/media-utils": "^4.
|
|
52
|
-
"@wordpress/notices": "^4.
|
|
53
|
-
"@wordpress/plugins": "^6.
|
|
54
|
-
"@wordpress/preferences": "^3.
|
|
55
|
-
"@wordpress/private-apis": "^0.
|
|
56
|
-
"@wordpress/url": "^3.
|
|
57
|
-
"@wordpress/viewport": "^5.
|
|
58
|
-
"@wordpress/warning": "^2.
|
|
59
|
-
"@wordpress/widgets": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.37.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.34.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.5.0",
|
|
33
|
+
"@wordpress/block-library": "^8.14.0",
|
|
34
|
+
"@wordpress/blocks": "^12.14.0",
|
|
35
|
+
"@wordpress/commands": "^0.8.0",
|
|
36
|
+
"@wordpress/components": "^25.3.0",
|
|
37
|
+
"@wordpress/compose": "^6.14.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.6.0",
|
|
39
|
+
"@wordpress/core-data": "^6.14.0",
|
|
40
|
+
"@wordpress/data": "^9.7.0",
|
|
41
|
+
"@wordpress/deprecated": "^3.37.0",
|
|
42
|
+
"@wordpress/dom": "^3.37.0",
|
|
43
|
+
"@wordpress/editor": "^13.14.0",
|
|
44
|
+
"@wordpress/element": "^5.14.0",
|
|
45
|
+
"@wordpress/hooks": "^3.37.0",
|
|
46
|
+
"@wordpress/i18n": "^4.37.0",
|
|
47
|
+
"@wordpress/icons": "^9.28.0",
|
|
48
|
+
"@wordpress/interface": "^5.14.0",
|
|
49
|
+
"@wordpress/keyboard-shortcuts": "^4.14.0",
|
|
50
|
+
"@wordpress/keycodes": "^3.37.0",
|
|
51
|
+
"@wordpress/media-utils": "^4.28.0",
|
|
52
|
+
"@wordpress/notices": "^4.5.0",
|
|
53
|
+
"@wordpress/plugins": "^6.5.0",
|
|
54
|
+
"@wordpress/preferences": "^3.14.0",
|
|
55
|
+
"@wordpress/private-apis": "^0.19.0",
|
|
56
|
+
"@wordpress/url": "^3.38.0",
|
|
57
|
+
"@wordpress/viewport": "^5.14.0",
|
|
58
|
+
"@wordpress/warning": "^2.37.0",
|
|
59
|
+
"@wordpress/widgets": "^3.14.0",
|
|
60
60
|
"classnames": "^2.3.1",
|
|
61
61
|
"memize": "^2.1.0",
|
|
62
62
|
"rememo": "^4.0.2"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "bcd13d59b22553b3c9dc5869077bff1e864cf9f5"
|
|
72
72
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
.edit-post-block-manager__category-title {
|
|
38
38
|
position: sticky;
|
|
39
|
-
top:
|
|
39
|
+
top: - $grid-unit-05; // Offsets the top padding on the modal content container
|
|
40
40
|
padding: $grid-unit-20 0;
|
|
41
41
|
background-color: $white;
|
|
42
42
|
z-index: z-index(".edit-post-block-manager__category-title");
|
|
@@ -19,6 +19,7 @@ import { Button, ToolbarItem } from '@wordpress/components';
|
|
|
19
19
|
import { listView, plus } from '@wordpress/icons';
|
|
20
20
|
import { useRef, useCallback } from '@wordpress/element';
|
|
21
21
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
22
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Internal dependencies
|
|
@@ -36,6 +37,8 @@ function HeaderToolbar() {
|
|
|
36
37
|
const inserterButton = useRef();
|
|
37
38
|
const { setIsInserterOpened, setIsListViewOpened } =
|
|
38
39
|
useDispatch( editPostStore );
|
|
40
|
+
const { get: getPreference } = useSelect( preferencesStore );
|
|
41
|
+
const hasFixedToolbar = getPreference( 'core/edit-post', 'fixedToolbar' );
|
|
39
42
|
const {
|
|
40
43
|
isInserterEnabled,
|
|
41
44
|
isInserterOpened,
|
|
@@ -147,7 +150,7 @@ function HeaderToolbar() {
|
|
|
147
150
|
/>
|
|
148
151
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
149
152
|
<>
|
|
150
|
-
{ isLargeViewport && (
|
|
153
|
+
{ isLargeViewport && ! hasFixedToolbar && (
|
|
151
154
|
<ToolbarItem
|
|
152
155
|
as={ ToolSelector }
|
|
153
156
|
showTooltip={ ! showIconLabels }
|
|
@@ -20,6 +20,16 @@ import MainDashboardButton from './main-dashboard-button';
|
|
|
20
20
|
import { store as editPostStore } from '../../store';
|
|
21
21
|
import DocumentTitle from './document-title';
|
|
22
22
|
|
|
23
|
+
const slideY = {
|
|
24
|
+
hidden: { y: '-50px' },
|
|
25
|
+
hover: { y: 0, transition: { type: 'tween', delay: 0.2 } },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const slideX = {
|
|
29
|
+
hidden: { x: '-100%' },
|
|
30
|
+
hover: { x: 0, transition: { type: 'tween', delay: 0.2 } },
|
|
31
|
+
};
|
|
32
|
+
|
|
23
33
|
function Header( { setEntitiesSavedStatesCallback } ) {
|
|
24
34
|
const isLargeViewport = useViewportMatch( 'large' );
|
|
25
35
|
const {
|
|
@@ -39,16 +49,6 @@ function Header( { setEntitiesSavedStatesCallback } ) {
|
|
|
39
49
|
[]
|
|
40
50
|
);
|
|
41
51
|
|
|
42
|
-
const slideY = {
|
|
43
|
-
hidden: { y: '-50px' },
|
|
44
|
-
hover: { y: 0, transition: { type: 'tween', delay: 0.2 } },
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const slideX = {
|
|
48
|
-
hidden: { x: '-100%' },
|
|
49
|
-
hover: { x: 0, transition: { type: 'tween', delay: 0.2 } },
|
|
50
|
-
};
|
|
51
|
-
|
|
52
52
|
return (
|
|
53
53
|
<div className="edit-post-header">
|
|
54
54
|
<MainDashboardButton.Slot>
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
import { useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { MenuItem } from '@wordpress/components';
|
|
7
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
|
-
import {
|
|
12
|
+
import { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';
|
|
12
13
|
|
|
13
14
|
export default function PreferencesMenuItem() {
|
|
14
|
-
const { openModal } = useDispatch(
|
|
15
|
+
const { openModal } = useDispatch( interfaceStore );
|
|
15
16
|
return (
|
|
16
17
|
<MenuItem
|
|
17
18
|
onClick={ () => {
|
|
18
|
-
openModal(
|
|
19
|
+
openModal( PREFERENCES_MODAL_NAME );
|
|
19
20
|
} }
|
|
20
21
|
>
|
|
21
22
|
{ __( 'Preferences' ) }
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '@wordpress/keyboard-shortcuts';
|
|
15
15
|
import { withSelect, withDispatch, useSelect } from '@wordpress/data';
|
|
16
16
|
import { compose } from '@wordpress/compose';
|
|
17
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Internal dependencies
|
|
@@ -21,9 +22,9 @@ import { compose } from '@wordpress/compose';
|
|
|
21
22
|
import { textFormattingShortcuts } from './config';
|
|
22
23
|
import Shortcut from './shortcut';
|
|
23
24
|
import DynamicShortcut from './dynamic-shortcut';
|
|
24
|
-
import { store as editPostStore } from '../../store';
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
export const KEYBOARD_SHORTCUT_HELP_MODAL_NAME =
|
|
27
|
+
'edit-post/keyboard-shortcut-help';
|
|
27
28
|
|
|
28
29
|
const ShortcutList = ( { shortcuts } ) => (
|
|
29
30
|
/*
|
|
@@ -141,14 +142,18 @@ export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {
|
|
|
141
142
|
|
|
142
143
|
export default compose( [
|
|
143
144
|
withSelect( ( select ) => ( {
|
|
144
|
-
isModalActive: select(
|
|
145
|
+
isModalActive: select( interfaceStore ).isModalActive(
|
|
146
|
+
KEYBOARD_SHORTCUT_HELP_MODAL_NAME
|
|
147
|
+
),
|
|
145
148
|
} ) ),
|
|
146
149
|
withDispatch( ( dispatch, { isModalActive } ) => {
|
|
147
|
-
const { openModal, closeModal } = dispatch(
|
|
150
|
+
const { openModal, closeModal } = dispatch( interfaceStore );
|
|
148
151
|
|
|
149
152
|
return {
|
|
150
153
|
toggleModal: () =>
|
|
151
|
-
isModalActive
|
|
154
|
+
isModalActive
|
|
155
|
+
? closeModal()
|
|
156
|
+
: openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME ),
|
|
152
157
|
};
|
|
153
158
|
} ),
|
|
154
159
|
] )( KeyboardShortcutHelpModal );
|
|
@@ -223,8 +223,6 @@ function KeyboardShortcuts() {
|
|
|
223
223
|
} );
|
|
224
224
|
|
|
225
225
|
useShortcut( 'core/edit-post/toggle-distraction-free', () => {
|
|
226
|
-
closeGeneralSidebar();
|
|
227
|
-
setIsListViewOpened( false );
|
|
228
226
|
toggleDistractionFree();
|
|
229
227
|
toggleFeature( 'distractionFree' );
|
|
230
228
|
createInfoNotice(
|
|
@@ -16,7 +16,10 @@ import {
|
|
|
16
16
|
store as editorStore,
|
|
17
17
|
} from '@wordpress/editor';
|
|
18
18
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
BlockBreadcrumb,
|
|
21
|
+
privateApis as blockEditorPrivateApis,
|
|
22
|
+
} from '@wordpress/block-editor';
|
|
20
23
|
import { Button, ScrollLock, Popover } from '@wordpress/components';
|
|
21
24
|
import { useViewportMatch } from '@wordpress/compose';
|
|
22
25
|
import { PluginArea } from '@wordpress/plugins';
|
|
@@ -49,6 +52,9 @@ import WelcomeGuide from '../welcome-guide';
|
|
|
49
52
|
import ActionsPanel from './actions-panel';
|
|
50
53
|
import StartPageOptions from '../start-page-options';
|
|
51
54
|
import { store as editPostStore } from '../../store';
|
|
55
|
+
import { unlock } from '../../lock-unlock';
|
|
56
|
+
|
|
57
|
+
const { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );
|
|
52
58
|
|
|
53
59
|
const interfaceLabels = {
|
|
54
60
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
@@ -63,6 +69,12 @@ const interfaceLabels = {
|
|
|
63
69
|
footer: __( 'Editor footer' ),
|
|
64
70
|
};
|
|
65
71
|
|
|
72
|
+
const blockRemovalRules = {
|
|
73
|
+
'core/footnotes': __(
|
|
74
|
+
'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
66
78
|
function Layout( { styles } ) {
|
|
67
79
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
68
80
|
const isHugeViewport = useViewportMatch( 'huge', '>=' );
|
|
@@ -202,6 +214,7 @@ function Layout( { styles } ) {
|
|
|
202
214
|
<LocalAutosaveMonitor />
|
|
203
215
|
<EditPostKeyboardShortcuts />
|
|
204
216
|
<EditorKeyboardShortcutsRegister />
|
|
217
|
+
<BlockRemovalWarningModal rules={ blockRemovalRules } />
|
|
205
218
|
<SettingsSidebar />
|
|
206
219
|
<InterfaceSkeleton
|
|
207
220
|
isDistractionFree={ isDistractionFree && isLargeViewport }
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
PreferencesModal,
|
|
19
19
|
PreferencesModalTabs,
|
|
20
20
|
PreferencesModalSection,
|
|
21
|
+
store as interfaceStore,
|
|
21
22
|
} from '@wordpress/interface';
|
|
22
23
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
23
24
|
|
|
@@ -35,17 +36,18 @@ import MetaBoxesSection from './meta-boxes-section';
|
|
|
35
36
|
import { store as editPostStore } from '../../store';
|
|
36
37
|
import BlockManager from '../block-manager';
|
|
37
38
|
|
|
38
|
-
const
|
|
39
|
+
export const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
|
|
39
40
|
|
|
40
41
|
export default function EditPostPreferencesModal() {
|
|
41
42
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
42
|
-
const { closeModal } = useDispatch(
|
|
43
|
+
const { closeModal } = useDispatch( interfaceStore );
|
|
43
44
|
const [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(
|
|
44
45
|
( select ) => {
|
|
45
46
|
const { getEditorSettings } = select( editorStore );
|
|
46
47
|
const { getEditorMode, isFeatureActive } = select( editPostStore );
|
|
47
|
-
const modalActive =
|
|
48
|
-
|
|
48
|
+
const modalActive = select( interfaceStore ).isModalActive(
|
|
49
|
+
PREFERENCES_MODAL_NAME
|
|
50
|
+
);
|
|
49
51
|
const mode = getEditorMode();
|
|
50
52
|
const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
|
|
51
53
|
const isDistractionFreeEnabled =
|
|
@@ -616,7 +616,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
616
616
|
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
.emotion-13:focus {
|
|
619
|
+
.emotion-13:focus-visible {
|
|
620
620
|
box-shadow: 0 0 0 var( --wp-admin-border-width-focus ) var(
|
|
621
621
|
--wp-components-color-accent,
|
|
622
622
|
var( --wp-admin-theme-color, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) )
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';
|
|
5
|
-
import { FlexItem } from '@wordpress/components';
|
|
6
5
|
|
|
7
6
|
export default function PostTrash() {
|
|
8
7
|
return (
|
|
9
8
|
<PostTrashCheck>
|
|
10
|
-
<
|
|
11
|
-
<PostTrashLink />
|
|
12
|
-
</FlexItem>
|
|
9
|
+
<PostTrashLink />
|
|
13
10
|
</PostTrashCheck>
|
|
14
11
|
);
|
|
15
12
|
}
|
package/src/editor.js
CHANGED
|
@@ -25,6 +25,7 @@ import Layout from './components/layout';
|
|
|
25
25
|
import EditorInitialization from './components/editor-initialization';
|
|
26
26
|
import { store as editPostStore } from './store';
|
|
27
27
|
import { unlock } from './lock-unlock';
|
|
28
|
+
import useCommonCommands from './hooks/commands/use-common-commands';
|
|
28
29
|
|
|
29
30
|
const { ExperimentalEditorProvider } = unlock( editorPrivateApis );
|
|
30
31
|
const { getLayoutStyles } = unlock( blockEditorPrivateApis );
|
|
@@ -32,6 +33,7 @@ const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
|
32
33
|
|
|
33
34
|
function Editor( { postId, postType, settings, initialEdits, ...props } ) {
|
|
34
35
|
useCommands();
|
|
36
|
+
useCommonCommands();
|
|
35
37
|
const {
|
|
36
38
|
hasFixedToolbar,
|
|
37
39
|
focusMode,
|