@wordpress/edit-post 7.27.1 → 7.28.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/block-settings-menu/plugin-block-settings-menu-item.js +1 -2
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/browser-url/index.js +1 -2
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +11 -8
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +1 -2
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +8 -9
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +1 -2
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +1 -7
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +1 -2
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +1 -2
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +1 -2
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +1 -2
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +4 -18
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -5
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +1 -2
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +7 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +1 -2
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +1 -2
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +1 -2
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js +1 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +1 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +1 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -2
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +1 -2
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +1 -2
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +1 -2
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +1 -2
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +1 -2
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +1 -2
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +1 -2
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +1 -2
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +1 -2
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +2 -2
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +16 -11
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +34 -12
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +5 -10
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -2
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +1 -2
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +5 -4
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +6 -6
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/editor.js +35 -34
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +1 -2
- package/build/editor.native.js.map +1 -1
- package/build/hooks/{use-post-history.js → use-navigate-to-entity-record.js} +20 -26
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -0
- package/build/hooks/validate-multiple-use/index.js +25 -4
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -2
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +2 -2
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +8 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +3 -6
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +3 -4
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +1 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +21 -42
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +10 -6
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/index.js +7 -7
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +0 -5
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +4 -17
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +6 -3
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +1 -0
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +16 -10
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +33 -9
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +4 -8
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +5 -4
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +6 -6
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/editor.js +34 -32
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/{use-post-history.js → use-navigate-to-entity-record.js} +20 -26
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -0
- package/build-module/hooks/validate-multiple-use/index.js +26 -4
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +2 -2
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +7 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +29 -22
- package/build-style/style.css +29 -22
- package/package.json +32 -32
- package/src/components/header/fullscreen-mode-close/index.js +13 -10
- package/src/components/header/fullscreen-mode-close/test/index.js +31 -5
- package/src/components/header/index.js +10 -8
- package/src/components/header/mode-switcher/index.js +16 -25
- package/src/components/header/style.scss +40 -26
- package/src/components/header/writing-menu/index.js +3 -16
- package/src/components/layout/index.js +3 -2
- package/src/components/sidebar/post-visibility/index.js +1 -0
- package/src/components/sidebar/settings-header/index.js +17 -9
- package/src/components/sidebar/settings-sidebar/index.js +44 -9
- package/src/components/sidebar/template-summary/index.js +3 -7
- package/src/components/visual-editor/index.js +4 -2
- package/src/components/visual-editor/style.scss +1 -1
- package/src/components/welcome-guide/index.js +11 -6
- package/src/editor.js +50 -50
- package/src/hooks/{use-post-history.js → use-navigate-to-entity-record.js} +23 -27
- package/src/hooks/validate-multiple-use/index.js +28 -3
- package/src/plugins/welcome-guide-menu-item/index.js +3 -3
- package/src/store/actions.js +20 -12
- package/src/style.scss +0 -1
- package/src/test/editor.native.js +8 -5
- package/build/hooks/use-post-history.js.map +0 -1
- package/build-module/hooks/use-post-history.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_apiFetch","_interopRequireDefault","_interface","_preferences","_a11y","_notices","_blockEditor","_editor","_deprecated","_hooks","_metaBoxes","_","_lockUnlock","openGeneralSidebar","name","dispatch","registry","isDistractionFree","select","preferencesStore","get","toggleDistractionFree","interfaceStore","enableComplementaryArea","editPostStore","exports","closeGeneralSidebar","disableComplementaryArea","openModal","deprecated","since","alternative","closeModal","openPublishSidebar","type","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","editorStore","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","message","__","speak","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","_registry$select$get","existingVariations","updatedVariations","showBlockTypes","blockNames","unlock","hideBlockTypes","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","filter","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","getMetaBoxContainer","formData","reduce","memo","currentFormData","key","value","append","forEach","apiFetch","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableSwitchToTemplateMode","setRenderingMode","__unstableCreateTemplate","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","addFilter","previous","options","then","isAutosave","hasMetaBoxes","batch","noticesStore","createInfoNotice","id","actions","label","onClick"],"sources":["@wordpress/edit-post/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport const openModal =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).openModal( name )\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').openModal( name )\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).openModal( name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n * @return {Object} Action object.\n */\nexport const closeModal =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).closeModal()\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').closeModal()\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).closeModal();\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelEnabled\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelEnabled\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelEnabled( panelName );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelOpened( panelName );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport const removeEditorPanel =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).removeEditorPanel\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').removeEditorPanel\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).removeEditorPanel( panelName );\n\t};\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif (\n\t\t\tmode === 'text' &&\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n */\nexport const updatePreferredStyleVariations =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).showBlockTypes( blockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).hideBlockTypes( blockNames );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @deprecated\n */\nexport function setIsEditingTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).setIsEditingTemplate\", {\n\t\tsince: '6.5',\n\t\talternative: \"dispatch( 'core/editor').setRenderingMode\",\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Switches to the template mode.\n */\nexport const __unstableSwitchToTemplateMode =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( editorStore ).setRenderingMode( 'template-only' );\n\t};\n\n/**\n * Create a block based template.\n *\n * @deprecated\n */\nexport function __unstableCreateTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).__unstableCreateTemplate\", {\n\t\tsince: '6.5',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\t// Save metaboxes on save completion, except for autosaves.\n\t\taddFilter(\n\t\t\t'editor.__unstableSavePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\t( previous, options ) =>\n\t\t\t\tprevious.then( () => {\n\t\t\t\t\tif ( options.isAutosave ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! select.hasMetaBoxes() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn dispatch.requestMetaBoxUpdates();\n\t\t\t\t} )\n\t\t);\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t.toggle( 'core', 'distractionFree' );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QA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AK,CAAEH,iBAAiB,EAAG;IAC1BD,QAAQ,CAACuH,KAAK,CAAE,MAAM;MACrBvH,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5B4B,GAAG,CAAE,MAAM,EAAE,cAAc,EAAE,IAAK,CAAC;MACrC/B,QAAQ,CAACD,QAAQ,CAAEwB,aAAY,CAAC,CAAC0E,mBAAmB,CAAE,KAAM,CAAC;MAC7DjG,QAAQ,CAACD,QAAQ,CAAEwB,aAAY,CAAC,CAAC2E,mBAAmB,CAAE,KAAM,CAAC;MAC7DnG,QAAQ,CAACW,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACAV,QAAQ,CAACuH,KAAK,CAAE,MAAM;IACrBvH,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5B4B,GAAG,CAAE,MAAM,EAAE,iBAAiB,EAAE,CAAE9B,iBAAkB,CAAC;IACvDD,QAAQ,CACND,QAAQ,CAAEyH,cAAa,CAAC,CACxBC,gBAAgB,CAChBxH,iBAAiB,GACd,IAAAkC,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCuF,EAAE,EAAE,6CAA6C;MACjDxG,IAAI,EAAE,UAAU;MAChByG,OAAO,EAAE,CACR;QACCC,KAAK,EAAE,IAAAzF,QAAE,EAAE,MAAO,CAAC;QACnB0F,OAAO,EAAEA,CAAA,KAAM;UACd7H,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5ByB,MAAM,CAAE,MAAM,EAAE,iBAAkB,CAAC;QACtC;MACD,CAAC;IAEH,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_apiFetch","_interopRequireDefault","_interface","_preferences","_a11y","_notices","_blockEditor","_editor","_deprecated","_hooks","_metaBoxes","_","_lockUnlock","openGeneralSidebar","name","dispatch","registry","isDistractionFree","select","preferencesStore","get","toggleDistractionFree","interfaceStore","enableComplementaryArea","editPostStore","exports","closeGeneralSidebar","disableComplementaryArea","openModal","deprecated","since","alternative","closeModal","openPublishSidebar","type","closePublishSidebar","togglePublishSidebar","toggleEditorPanelEnabled","panelName","editorStore","toggleEditorPanelOpened","removeEditorPanel","toggleFeature","feature","toggle","switchEditorMode","mode","set","blockEditorStore","clearSelectedBlock","message","__","speak","togglePinnedPluginItem","pluginName","isPinned","isItemPinned","updatePreferredStyleVariations","blockName","blockStyle","_registry$select$get","existingVariations","updatedVariations","showBlockTypes","blockNames","unlock","hideBlockTypes","setAvailableMetaBoxesPerLocation","metaBoxesPerLocation","requestMetaBoxUpdates","window","tinyMCE","triggerSave","post","getCurrentPost","additionalData","comment_status","ping_status","sticky","author","filter","Boolean","baseFormData","FormData","document","querySelector","activeMetaBoxLocations","getActiveMetaBoxLocations","formDataToMerge","map","location","getMetaBoxContainer","formData","reduce","memo","currentFormData","key","value","append","forEach","apiFetch","url","_wpMetaBoxUrl","method","body","parse","metaBoxUpdatesSuccess","metaBoxUpdatesFailure","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setIsInserterOpened","setIsListViewOpened","isOpen","setIsEditingTemplate","__unstableCreateTemplate","metaBoxesInitialized","initializeMetaBoxes","isEditorReady","__unstableIsEditorReady","postType","getCurrentPostType","postboxes","page","add_postbox_toggles","addFilter","previous","options","then","isAutosave","hasMetaBoxes","batch","noticesStore","createInfoNotice","id","actions","label","onClick"],"sources":["@wordpress/edit-post/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { speak } from '@wordpress/a11y';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { store as editPostStore } from '.';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editPostStore.name, name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editPostStore.name );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport const openModal =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).openModal( name )\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').openModal( name )\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).openModal( name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n * @return {Object} Action object.\n */\nexport const closeModal =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).closeModal()\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').closeModal()\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).closeModal();\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n *\n * @return {Object} Action object\n */\nexport function openPublishSidebar() {\n\treturn {\n\t\ttype: 'OPEN_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n *\n * @return {Object} Action object.\n */\nexport function closePublishSidebar() {\n\treturn {\n\t\ttype: 'CLOSE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function togglePublishSidebar() {\n\treturn {\n\t\ttype: 'TOGGLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelEnabled\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelEnabled\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelEnabled( panelName );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelOpened( panelName );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport const removeEditorPanel =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).removeEditorPanel\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').removeEditorPanel\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).removeEditorPanel( panelName );\n\t};\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry.dispatch( preferencesStore ).set( 'core', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to the code editor.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif (\n\t\t\tmode === 'text' &&\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\n\t\tconst message =\n\t\t\tmode === 'visual'\n\t\t\t\t? __( 'Visual editor selected' )\n\t\t\t\t: __( 'Code editor selected' );\n\t\tspeak( message, 'assertive' );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core/edit-post', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ](\n\t\t\t\t'core/edit-post',\n\t\t\t\tpluginName\n\t\t\t);\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @param {string} blockName Name of the block.\n * @param {?string} blockStyle Name of the style that should be auto applied. If undefined, the \"auto apply\" setting of the block is removed.\n */\nexport const updatePreferredStyleVariations =\n\t( blockName, blockStyle ) =>\n\t( { registry } ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingVariations =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-post', 'preferredStyleVariations' ) ?? {};\n\n\t\t// When the blockStyle is omitted, remove the block's preferred variation.\n\t\tif ( ! blockStyle ) {\n\t\t\tconst updatedVariations = {\n\t\t\t\t...existingVariations,\n\t\t\t};\n\n\t\t\tdelete updatedVariations[ blockName ];\n\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations',\n\t\t\t\t\tupdatedVariations\n\t\t\t\t);\n\t\t} else {\n\t\t\t// Else add the variation.\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core/edit-post', 'preferredStyleVariations', {\n\t\t\t\t\t...existingVariations,\n\t\t\t\t\t[ blockName ]: blockStyle,\n\t\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).showBlockTypes( blockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).hideBlockTypes( blockNames );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\tconst post = registry.select( editorStore ).getCurrentPost();\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations data and the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @deprecated\n */\nexport function setIsEditingTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).setIsEditingTemplate\", {\n\t\tsince: '6.5',\n\t\talternative: \"dispatch( 'core/editor').setRenderingMode\",\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Create a block based template.\n *\n * @deprecated\n */\nexport function __unstableCreateTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).__unstableCreateTemplate\", {\n\t\tsince: '6.5',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\t// Save metaboxes on save completion, except for autosaves.\n\t\taddFilter(\n\t\t\t'editor.__unstableSavePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\t( previous, options ) =>\n\t\t\t\tprevious.then( () => {\n\t\t\t\t\tif ( options.isAutosave ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! select.hasMetaBoxes() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn dispatch.requestMetaBoxUpdates();\n\t\t\t\t} )\n\t\t);\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'fixedToolbar', false );\n\t\t}\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t.set(\n\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\t\t\tisDistractionFree ? true : false\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t'distractionFree'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,CAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AAnBA;AACA;AACA;;AAYA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMc,kBAAkB,GAC5BC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,iBA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,GAAG,CAAE,MAAM,EAAE,iBAAiB,EAAE,CAAE9B,iBAAkB,CAAC;IACvDD,QAAQ,CACND,QAAQ,CAAEuH,cAAa,CAAC,CACxBC,gBAAgB,CAChBtH,iBAAiB,GACd,IAAAkC,QAAE,EAAE,uBAAwB,CAAC,GAC7B,IAAAA,QAAE,EAAE,sBAAuB,CAAC,EAC/B;MACCqF,EAAE,EAAE,6CAA6C;MACjDtG,IAAI,EAAE,UAAU;MAChBuG,OAAO,EAAE,CACR;QACCC,KAAK,EAAE,IAAAvF,QAAE,EAAE,MAAO,CAAC;QACnBwF,OAAO,EAAEA,CAAA,KAAM;UACd3H,QAAQ,CAACqH,KAAK,CAAE,MAAM;YACrBrH,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5B4B,GAAG,CACH,MAAM,EACN,cAAc,EACd9B,iBAAiB,GAAG,IAAI,GAAG,KAC5B,CAAC;YACFD,QAAQ,CACND,QAAQ,CAAEI,kBAAiB,CAAC,CAC5ByB,MAAM,CACN,MAAM,EACN,iBACD,CAAC;UACH,CAAE,CAAC;QACJ;MACD,CAAC;IAEH,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA"}
|
package/build/store/constants.js
CHANGED
|
@@ -9,22 +9,19 @@ exports.VIEW_AS_PREVIEW_LINK_SELECTOR = exports.VIEW_AS_LINK_SELECTOR = exports.
|
|
|
9
9
|
*
|
|
10
10
|
* @type {string}
|
|
11
11
|
*/
|
|
12
|
-
const STORE_NAME = 'core/edit-post';
|
|
12
|
+
const STORE_NAME = exports.STORE_NAME = 'core/edit-post';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* CSS selector string for the admin bar view post link anchor tag.
|
|
16
16
|
*
|
|
17
17
|
* @type {string}
|
|
18
18
|
*/
|
|
19
|
-
exports.
|
|
20
|
-
const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';
|
|
19
|
+
const VIEW_AS_LINK_SELECTOR = exports.VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* CSS selector string for the admin bar preview post link anchor tag.
|
|
24
23
|
*
|
|
25
24
|
* @type {string}
|
|
26
25
|
*/
|
|
27
|
-
exports.
|
|
28
|
-
const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';
|
|
29
|
-
exports.VIEW_AS_PREVIEW_LINK_SELECTOR = VIEW_AS_PREVIEW_LINK_SELECTOR;
|
|
26
|
+
const VIEW_AS_PREVIEW_LINK_SELECTOR = exports.VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';
|
|
30
27
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["STORE_NAME","exports","VIEW_AS_LINK_SELECTOR","VIEW_AS_PREVIEW_LINK_SELECTOR"],"sources":["@wordpress/edit-post/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-post';\n\n/**\n * CSS selector string for the admin bar view post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';\n\n/**\n * CSS selector string for the admin bar preview post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAG,gBAAgB;;AAE1C;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["STORE_NAME","exports","VIEW_AS_LINK_SELECTOR","VIEW_AS_PREVIEW_LINK_SELECTOR"],"sources":["@wordpress/edit-post/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-post';\n\n/**\n * CSS selector string for the admin bar view post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';\n\n/**\n * CSS selector string for the admin bar preview post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,gBAAgB;;AAE1C;AACA;AACA;AACA;AACA;AACO,MAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,sBAAsB;;AAE3D;AACA;AACA;AACA;AACA;AACO,MAAMC,6BAA6B,GAAAF,OAAA,CAAAE,6BAAA,GAAG,yBAAyB"}
|
package/build/store/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var _reducer = _interopRequireDefault(require("./reducer"));
|
|
|
10
10
|
var actions = _interopRequireWildcard(require("./actions"));
|
|
11
11
|
var selectors = _interopRequireWildcard(require("./selectors"));
|
|
12
12
|
var _constants = require("./constants");
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
17
17
|
*/
|
|
@@ -27,11 +27,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
*
|
|
28
28
|
* @type {Object}
|
|
29
29
|
*/
|
|
30
|
-
const store = (0, _data.createReduxStore)(_constants.STORE_NAME, {
|
|
30
|
+
const store = exports.store = (0, _data.createReduxStore)(_constants.STORE_NAME, {
|
|
31
31
|
reducer: _reducer.default,
|
|
32
32
|
actions,
|
|
33
33
|
selectors
|
|
34
34
|
});
|
|
35
|
-
exports.store = store;
|
|
36
35
|
(0, _data.register)(store);
|
|
37
36
|
//# sourceMappingURL=index.js.map
|
package/build/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","_constants","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","store","exports","createReduxStore","STORE_NAME","reducer","register"],"sources":["@wordpress/edit-post/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,G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;AACO,MAAMY,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,sBAAgB,EAAEC,qBAAU,EAAE;EAClDC,OAAO,EAAPA,gBAAO;EACP7B,OAAO;EACPE;AACD,CAAE,CAAC;AAEH,IAAA4B,cAAQ,EAAEL,KAAM,CAAC"}
|
package/build/store/reducer.js
CHANGED
|
@@ -102,9 +102,8 @@ const metaBoxes = (0, _data.combineReducers)({
|
|
|
102
102
|
locations: metaBoxLocations,
|
|
103
103
|
initialized: metaBoxesInitialized
|
|
104
104
|
});
|
|
105
|
-
var _default = (0, _data.combineReducers)({
|
|
105
|
+
var _default = exports.default = (0, _data.combineReducers)({
|
|
106
106
|
metaBoxes,
|
|
107
107
|
publishSidebarActive
|
|
108
108
|
});
|
|
109
|
-
exports.default = _default;
|
|
110
109
|
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","publishSidebarActive","state","action","type","isSavingMetaBoxes","mergeMetaboxes","metaboxes","newMetaboxes","mergedMetaboxes","metabox","existing","findIndex","box","id","push","metaBoxLocations","newState","location","Object","entries","metaBoxesPerLocation","metaBoxesInitialized","metaBoxes","combineReducers","isSaving","locations","initialized","_default","exports","default"],"sources":["@wordpress/edit-post/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function publishSidebarActive( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_PUBLISH_SIDEBAR':\n\t\t\treturn true;\n\t\tcase 'CLOSE_PUBLISH_SIDEBAR':\n\t\t\treturn false;\n\t\tcase 'TOGGLE_PUBLISH_SIDEBAR':\n\t\t\treturn ! state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n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;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,8BAA8B;MAAE;QACpC,MAAMa,QAAQ,GAAG;UAAE,GAAGf;QAAM,CAAC;QAC7B,KAAM,MAAM,CAAEgB,QAAQ,EAAEX,SAAS,CAAE,IAAIY,MAAM,CAACC,OAAO,CACpDjB,MAAM,CAACkB,oBACR,CAAC,EAAG;UACHJ,QAAQ,CAAEC,QAAQ,CAAE,GAAGZ,cAAc,CACpCW,QAAQ,CAAEC,QAAQ,CAAE,EACpBX,SACD,CAAC;QACF;QACA,OAAOU,QAAQ;MAChB;EACD;EAEA,OAAOf,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASoB,oBAAoBA,CAAEpB,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAO,IAAI;EACb;EACA,OAAOF,KAAK;AACb;AAEA,MAAMqB,SAAS,GAAG,IAAAC,qBAAe,EAAE;EAClCC,QAAQ,EAAEpB,iBAAiB;EAC3BqB,SAAS,EAAEV,gBAAgB;EAC3BW,WAAW,EAAEL;AACd,CAAE,CAAC;AAAC,IAAAM,QAAA,GAEW,
|
|
1
|
+
{"version":3,"names":["_data","require","publishSidebarActive","state","action","type","isSavingMetaBoxes","mergeMetaboxes","metaboxes","newMetaboxes","mergedMetaboxes","metabox","existing","findIndex","box","id","push","metaBoxLocations","newState","location","Object","entries","metaBoxesPerLocation","metaBoxesInitialized","metaBoxes","combineReducers","isSaving","locations","initialized","_default","exports","default"],"sources":["@wordpress/edit-post/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function publishSidebarActive( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_PUBLISH_SIDEBAR':\n\t\t\treturn true;\n\t\tcase 'CLOSE_PUBLISH_SIDEBAR':\n\t\t\treturn false;\n\t\tcase 'TOGGLE_PUBLISH_SIDEBAR':\n\t\t\treturn ! state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n\tpublishSidebarActive,\n} );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC7D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,sBAAsB;MAC1B,OAAO,IAAI;IACZ,KAAK,uBAAuB;MAC3B,OAAO,KAAK;IACb,KAAK,wBAAwB;MAC5B,OAAO,CAAEF,KAAK;EAChB;EACA,OAAOA,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAAEH,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC1D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,0BAA0B;MAC9B,OAAO,IAAI;IACZ,KAAK,0BAA0B;IAC/B,KAAK,0BAA0B;MAC9B,OAAO,KAAK;IACb;MACC,OAAOF,KAAK;EACd;AACD;AAEA,SAASI,cAAcA,CAAEC,SAAS,GAAG,EAAE,EAAEC,YAAY,EAAG;EACvD,MAAMC,eAAe,GAAG,CAAE,GAAGF,SAAS,CAAE;EACxC,KAAM,MAAMG,OAAO,IAAIF,YAAY,EAAG;IACrC,MAAMG,QAAQ,GAAGF,eAAe,CAACG,SAAS,CACvCC,GAAG,IAAMA,GAAG,CAACC,EAAE,KAAKJ,OAAO,CAACI,EAC/B,CAAC;IACD,IAAKH,QAAQ,KAAK,CAAC,CAAC,EAAG;MACtBF,eAAe,CAAEE,QAAQ,CAAE,GAAGD,OAAO;IACtC,CAAC,MAAM;MACND,eAAe,CAACM,IAAI,CAAEL,OAAQ,CAAC;IAChC;EACD;EACA,OAAOD,eAAe;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,gBAAgBA,CAAEd,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,8BAA8B;MAAE;QACpC,MAAMa,QAAQ,GAAG;UAAE,GAAGf;QAAM,CAAC;QAC7B,KAAM,MAAM,CAAEgB,QAAQ,EAAEX,SAAS,CAAE,IAAIY,MAAM,CAACC,OAAO,CACpDjB,MAAM,CAACkB,oBACR,CAAC,EAAG;UACHJ,QAAQ,CAAEC,QAAQ,CAAE,GAAGZ,cAAc,CACpCW,QAAQ,CAAEC,QAAQ,CAAE,EACpBX,SACD,CAAC;QACF;QACA,OAAOU,QAAQ;MAChB;EACD;EAEA,OAAOf,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASoB,oBAAoBA,CAAEpB,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAO,IAAI;EACb;EACA,OAAOF,KAAK;AACb;AAEA,MAAMqB,SAAS,GAAG,IAAAC,qBAAe,EAAE;EAClCC,QAAQ,EAAEpB,iBAAiB;EAC3BqB,SAAS,EAAEV,gBAAgB;EAC3BW,WAAW,EAAEL;AACd,CAAE,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEW,IAAAN,qBAAe,EAAE;EAC/BD,SAAS;EACTtB;AACD,CAAE,CAAC"}
|
package/build/store/selectors.js
CHANGED
|
@@ -46,7 +46,7 @@ const EMPTY_OBJECT = {};
|
|
|
46
46
|
*
|
|
47
47
|
* @return {string} Editing mode.
|
|
48
48
|
*/
|
|
49
|
-
const getEditorMode = (0, _data.createRegistrySelector)(select => () => {
|
|
49
|
+
const getEditorMode = exports.getEditorMode = (0, _data.createRegistrySelector)(select => () => {
|
|
50
50
|
var _select$get;
|
|
51
51
|
return (_select$get = select(_preferences.store).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual';
|
|
52
52
|
});
|
|
@@ -58,8 +58,7 @@ const getEditorMode = (0, _data.createRegistrySelector)(select => () => {
|
|
|
58
58
|
*
|
|
59
59
|
* @return {boolean} Whether the editor sidebar is opened.
|
|
60
60
|
*/
|
|
61
|
-
exports.
|
|
62
|
-
const isEditorSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
61
|
+
const isEditorSidebarOpened = exports.isEditorSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
63
62
|
const activeGeneralSidebar = select(_interface.store).getActiveComplementaryArea('core/edit-post');
|
|
64
63
|
return ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
|
|
65
64
|
});
|
|
@@ -71,8 +70,7 @@ const isEditorSidebarOpened = (0, _data.createRegistrySelector)(select => () =>
|
|
|
71
70
|
*
|
|
72
71
|
* @return {boolean} Whether the plugin sidebar is opened.
|
|
73
72
|
*/
|
|
74
|
-
exports.
|
|
75
|
-
const isPluginSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
73
|
+
const isPluginSidebarOpened = exports.isPluginSidebarOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
76
74
|
const activeGeneralSidebar = select(_interface.store).getActiveComplementaryArea('core/edit-post');
|
|
77
75
|
return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
|
|
78
76
|
});
|
|
@@ -91,8 +89,7 @@ const isPluginSidebarOpened = (0, _data.createRegistrySelector)(select => () =>
|
|
|
91
89
|
*
|
|
92
90
|
* @return {?string} Active general sidebar name.
|
|
93
91
|
*/
|
|
94
|
-
exports.
|
|
95
|
-
const getActiveGeneralSidebarName = (0, _data.createRegistrySelector)(select => () => {
|
|
92
|
+
const getActiveGeneralSidebarName = exports.getActiveGeneralSidebarName = (0, _data.createRegistrySelector)(select => () => {
|
|
96
93
|
return select(_interface.store).getActiveComplementaryArea('core/edit-post');
|
|
97
94
|
});
|
|
98
95
|
|
|
@@ -116,7 +113,6 @@ const getActiveGeneralSidebarName = (0, _data.createRegistrySelector)(select =>
|
|
|
116
113
|
*
|
|
117
114
|
* @return {Object} The converted panel data.
|
|
118
115
|
*/
|
|
119
|
-
exports.getActiveGeneralSidebarName = getActiveGeneralSidebarName;
|
|
120
116
|
function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
121
117
|
var _ref;
|
|
122
118
|
// First reduce the inactive panels.
|
|
@@ -154,7 +150,7 @@ function convertPanelsToOldFormat(inactivePanels, openPanels) {
|
|
|
154
150
|
*
|
|
155
151
|
* @return {Object} Preferences Object.
|
|
156
152
|
*/
|
|
157
|
-
const getPreferences = (0, _data.createRegistrySelector)(select => () => {
|
|
153
|
+
const getPreferences = exports.getPreferences = (0, _data.createRegistrySelector)(select => () => {
|
|
158
154
|
(0, _deprecated.default)(`select( 'core/edit-post' ).getPreferences`, {
|
|
159
155
|
since: '6.0',
|
|
160
156
|
alternative: `select( 'core/preferences' ).get`
|
|
@@ -200,7 +196,6 @@ const getPreferences = (0, _data.createRegistrySelector)(select => () => {
|
|
|
200
196
|
*
|
|
201
197
|
* @return {*} Preference Value.
|
|
202
198
|
*/
|
|
203
|
-
exports.getPreferences = getPreferences;
|
|
204
199
|
function getPreference(state, preferenceKey, defaultValue) {
|
|
205
200
|
(0, _deprecated.default)(`select( 'core/edit-post' ).getPreference`, {
|
|
206
201
|
since: '6.0',
|
|
@@ -218,7 +213,7 @@ function getPreference(state, preferenceKey, defaultValue) {
|
|
|
218
213
|
*
|
|
219
214
|
* @return {Array} A list of the hidden block types
|
|
220
215
|
*/
|
|
221
|
-
const getHiddenBlockTypes = (0, _data.createRegistrySelector)(select => () => {
|
|
216
|
+
const getHiddenBlockTypes = exports.getHiddenBlockTypes = (0, _data.createRegistrySelector)(select => () => {
|
|
222
217
|
var _select$get2;
|
|
223
218
|
return (_select$get2 = select(_preferences.store).get('core', 'hiddenBlockTypes')) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY_ARRAY;
|
|
224
219
|
});
|
|
@@ -230,7 +225,6 @@ const getHiddenBlockTypes = (0, _data.createRegistrySelector)(select => () => {
|
|
|
230
225
|
*
|
|
231
226
|
* @return {boolean} Whether the publish sidebar is open.
|
|
232
227
|
*/
|
|
233
|
-
exports.getHiddenBlockTypes = getHiddenBlockTypes;
|
|
234
228
|
function isPublishSidebarOpened(state) {
|
|
235
229
|
return state.publishSidebarActive;
|
|
236
230
|
}
|
|
@@ -246,7 +240,7 @@ function isPublishSidebarOpened(state) {
|
|
|
246
240
|
*
|
|
247
241
|
* @return {boolean} Whether or not the panel is removed.
|
|
248
242
|
*/
|
|
249
|
-
const isEditorPanelRemoved = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
243
|
+
const isEditorPanelRemoved = exports.isEditorPanelRemoved = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
250
244
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
|
|
251
245
|
since: '6.5',
|
|
252
246
|
alternative: `select( 'core/editor' ).isEditorPanelRemoved`
|
|
@@ -265,8 +259,7 @@ const isEditorPanelRemoved = (0, _data.createRegistrySelector)(select => (state,
|
|
|
265
259
|
*
|
|
266
260
|
* @return {boolean} Whether or not the panel is enabled.
|
|
267
261
|
*/
|
|
268
|
-
exports.
|
|
269
|
-
const isEditorPanelEnabled = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
262
|
+
const isEditorPanelEnabled = exports.isEditorPanelEnabled = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
270
263
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
|
|
271
264
|
since: '6.5',
|
|
272
265
|
alternative: `select( 'core/editor' ).isEditorPanelEnabled`
|
|
@@ -285,8 +278,7 @@ const isEditorPanelEnabled = (0, _data.createRegistrySelector)(select => (state,
|
|
|
285
278
|
*
|
|
286
279
|
* @return {boolean} Whether or not the panel is open.
|
|
287
280
|
*/
|
|
288
|
-
exports.
|
|
289
|
-
const isEditorPanelOpened = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
281
|
+
const isEditorPanelOpened = exports.isEditorPanelOpened = (0, _data.createRegistrySelector)(select => (state, panelName) => {
|
|
290
282
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, {
|
|
291
283
|
since: '6.5',
|
|
292
284
|
alternative: `select( 'core/editor' ).isEditorPanelOpened`
|
|
@@ -304,8 +296,7 @@ const isEditorPanelOpened = (0, _data.createRegistrySelector)(select => (state,
|
|
|
304
296
|
*
|
|
305
297
|
* @return {boolean} Whether the modal is active.
|
|
306
298
|
*/
|
|
307
|
-
exports.
|
|
308
|
-
const isModalActive = (0, _data.createRegistrySelector)(select => (state, modalName) => {
|
|
299
|
+
const isModalActive = exports.isModalActive = (0, _data.createRegistrySelector)(select => (state, modalName) => {
|
|
309
300
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isModalActive`, {
|
|
310
301
|
since: '6.3',
|
|
311
302
|
alternative: `select( 'core/interface' ).isModalActive`
|
|
@@ -321,8 +312,7 @@ const isModalActive = (0, _data.createRegistrySelector)(select => (state, modalN
|
|
|
321
312
|
*
|
|
322
313
|
* @return {boolean} Is active.
|
|
323
314
|
*/
|
|
324
|
-
exports.
|
|
325
|
-
const isFeatureActive = (0, _data.createRegistrySelector)(select => (state, feature) => {
|
|
315
|
+
const isFeatureActive = exports.isFeatureActive = (0, _data.createRegistrySelector)(select => (state, feature) => {
|
|
326
316
|
return !!select(_preferences.store).get('core/edit-post', feature);
|
|
327
317
|
});
|
|
328
318
|
|
|
@@ -335,8 +325,7 @@ const isFeatureActive = (0, _data.createRegistrySelector)(select => (state, feat
|
|
|
335
325
|
*
|
|
336
326
|
* @return {boolean} Whether the plugin item is pinned.
|
|
337
327
|
*/
|
|
338
|
-
exports.
|
|
339
|
-
const isPluginItemPinned = (0, _data.createRegistrySelector)(select => (state, pluginName) => {
|
|
328
|
+
const isPluginItemPinned = exports.isPluginItemPinned = (0, _data.createRegistrySelector)(select => (state, pluginName) => {
|
|
340
329
|
return select(_interface.store).isItemPinned('core/edit-post', pluginName);
|
|
341
330
|
});
|
|
342
331
|
|
|
@@ -347,8 +336,7 @@ const isPluginItemPinned = (0, _data.createRegistrySelector)(select => (state, p
|
|
|
347
336
|
*
|
|
348
337
|
* @return {string[]} Active meta box locations.
|
|
349
338
|
*/
|
|
350
|
-
exports.
|
|
351
|
-
const getActiveMetaBoxLocations = (0, _rememo.default)(state => {
|
|
339
|
+
const getActiveMetaBoxLocations = exports.getActiveMetaBoxLocations = (0, _rememo.default)(state => {
|
|
352
340
|
return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location));
|
|
353
341
|
}, state => [state.metaBoxes.locations]);
|
|
354
342
|
|
|
@@ -360,8 +348,7 @@ const getActiveMetaBoxLocations = (0, _rememo.default)(state => {
|
|
|
360
348
|
*
|
|
361
349
|
* @return {boolean} Whether the meta box location is active and visible.
|
|
362
350
|
*/
|
|
363
|
-
exports.
|
|
364
|
-
const isMetaBoxLocationVisible = (0, _data.createRegistrySelector)(select => (state, location) => {
|
|
351
|
+
const isMetaBoxLocationVisible = exports.isMetaBoxLocationVisible = (0, _data.createRegistrySelector)(select => (state, location) => {
|
|
365
352
|
return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({
|
|
366
353
|
id
|
|
367
354
|
}) => {
|
|
@@ -378,7 +365,6 @@ const isMetaBoxLocationVisible = (0, _data.createRegistrySelector)(select => (st
|
|
|
378
365
|
*
|
|
379
366
|
* @return {boolean} Whether the meta box location is active.
|
|
380
367
|
*/
|
|
381
|
-
exports.isMetaBoxLocationVisible = isMetaBoxLocationVisible;
|
|
382
368
|
function isMetaBoxLocationActive(state, location) {
|
|
383
369
|
const metaBoxes = getMetaBoxesPerLocation(state, location);
|
|
384
370
|
return !!metaBoxes && metaBoxes.length !== 0;
|
|
@@ -403,7 +389,7 @@ function getMetaBoxesPerLocation(state, location) {
|
|
|
403
389
|
*
|
|
404
390
|
* @return {Array} List of meta boxes.
|
|
405
391
|
*/
|
|
406
|
-
const getAllMetaBoxes = (0, _rememo.default)(state => {
|
|
392
|
+
const getAllMetaBoxes = exports.getAllMetaBoxes = (0, _rememo.default)(state => {
|
|
407
393
|
return Object.values(state.metaBoxes.locations).flat();
|
|
408
394
|
}, state => [state.metaBoxes.locations]);
|
|
409
395
|
|
|
@@ -414,7 +400,6 @@ const getAllMetaBoxes = (0, _rememo.default)(state => {
|
|
|
414
400
|
*
|
|
415
401
|
* @return {boolean} Whether there are metaboxes or not.
|
|
416
402
|
*/
|
|
417
|
-
exports.getAllMetaBoxes = getAllMetaBoxes;
|
|
418
403
|
function hasMetaBoxes(state) {
|
|
419
404
|
return getActiveMetaBoxLocations(state).length > 0;
|
|
420
405
|
}
|
|
@@ -439,7 +424,7 @@ function isSavingMetaBoxes(state) {
|
|
|
439
424
|
*
|
|
440
425
|
* @return {string} Device type.
|
|
441
426
|
*/
|
|
442
|
-
const __experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(select => () => {
|
|
427
|
+
const __experimentalGetPreviewDeviceType = exports.__experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(select => () => {
|
|
443
428
|
(0, _deprecated.default)(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, {
|
|
444
429
|
since: '6.5',
|
|
445
430
|
version: '6.7',
|
|
@@ -457,8 +442,7 @@ const __experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(sel
|
|
|
457
442
|
*
|
|
458
443
|
* @return {boolean} Whether the inserter is opened.
|
|
459
444
|
*/
|
|
460
|
-
exports.
|
|
461
|
-
const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
445
|
+
const isInserterOpened = exports.isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
462
446
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isInserterOpened`, {
|
|
463
447
|
since: '6.5',
|
|
464
448
|
alternative: `select( 'core/editor' ).isInserterOpened`
|
|
@@ -475,8 +459,7 @@ const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
|
475
459
|
*
|
|
476
460
|
* @return {Object} The root client ID, index to insert at and starting filter value.
|
|
477
461
|
*/
|
|
478
|
-
exports.
|
|
479
|
-
const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
|
|
462
|
+
const __experimentalGetInsertionPoint = exports.__experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
|
|
480
463
|
(0, _deprecated.default)(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, {
|
|
481
464
|
since: '6.5',
|
|
482
465
|
version: '6.7'
|
|
@@ -491,8 +474,7 @@ const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select
|
|
|
491
474
|
*
|
|
492
475
|
* @return {boolean} Whether the list view is opened.
|
|
493
476
|
*/
|
|
494
|
-
exports.
|
|
495
|
-
const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
477
|
+
const isListViewOpened = exports.isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
496
478
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isListViewOpened`, {
|
|
497
479
|
since: '6.5',
|
|
498
480
|
alternative: `select( 'core/editor' ).isListViewOpened`
|
|
@@ -505,8 +487,7 @@ const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
|
|
|
505
487
|
*
|
|
506
488
|
* @deprecated
|
|
507
489
|
*/
|
|
508
|
-
exports.
|
|
509
|
-
const isEditingTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
490
|
+
const isEditingTemplate = exports.isEditingTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
510
491
|
(0, _deprecated.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
|
|
511
492
|
since: '6.5',
|
|
512
493
|
alternative: `select( 'core/editor' ).getRenderingMode`
|
|
@@ -521,7 +502,6 @@ const isEditingTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
|
521
502
|
*
|
|
522
503
|
* @return {boolean} Whether meta boxes are initialized.
|
|
523
504
|
*/
|
|
524
|
-
exports.isEditingTemplate = isEditingTemplate;
|
|
525
505
|
function areMetaBoxesInitialized(state) {
|
|
526
506
|
return state.metaBoxes.initialized;
|
|
527
507
|
}
|
|
@@ -531,7 +511,7 @@ function areMetaBoxesInitialized(state) {
|
|
|
531
511
|
*
|
|
532
512
|
* @return {Object?} Post Template.
|
|
533
513
|
*/
|
|
534
|
-
const getEditedPostTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
514
|
+
const getEditedPostTemplate = exports.getEditedPostTemplate = (0, _data.createRegistrySelector)(select => () => {
|
|
535
515
|
const currentTemplate = select(_editor.store).getEditedPostAttribute('template');
|
|
536
516
|
if (currentTemplate) {
|
|
537
517
|
const templateWithSameSlug = select(_coreData.store).getEntityRecords('postType', 'wp_template', {
|
|
@@ -558,5 +538,4 @@ const getEditedPostTemplate = (0, _data.createRegistrySelector)(select => () =>
|
|
|
558
538
|
});
|
|
559
539
|
return select(_coreData.store).getEditedEntityRecord('postType', 'wp_template', defaultTemplateId);
|
|
560
540
|
});
|
|
561
|
-
exports.getEditedPostTemplate = getEditedPostTemplate;
|
|
562
541
|
//# sourceMappingURL=selectors.js.map
|