@wordpress/editor 13.30.0 → 13.32.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 +4 -0
- package/README.md +857 -0
- package/build/bindings/index.js +3 -1
- package/build/bindings/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +107 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build/components/commands/index.js +1 -1
- package/build/components/commands/index.js.map +1 -1
- package/build/components/deprecated.js +158 -0
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +7 -10
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +2 -39
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +3 -0
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +10 -16
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +28 -88
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +133 -0
- package/build/components/error-boundary/index.native.js.map +1 -0
- package/build/components/index.js +33 -8
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +5 -1
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +2 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js +30 -0
- package/build/components/pattern-overrides-panel/index.js.map +1 -0
- package/build/components/plugin-document-setting-panel/index.js +123 -0
- package/build/components/plugin-document-setting-panel/index.js.map +1 -0
- package/build/components/plugin-post-publish-panel/index.js +68 -0
- package/build/components/plugin-post-publish-panel/index.js.map +1 -0
- package/build/components/plugin-pre-publish-panel/index.js +71 -0
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
- package/build/components/post-actions/actions.js +455 -0
- package/build/components/post-actions/actions.js.map +1 -0
- package/build/components/post-card-panel/index.js +93 -0
- package/build/components/post-card-panel/index.js.map +1 -0
- package/build/components/post-featured-image/index.js +3 -8
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +7 -3
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-sync-status/index.js +0 -72
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +7 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-title/index.native.js +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +36 -20
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +8 -9
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js +4 -3
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/components/template-areas/index.js +70 -0
- package/build/components/template-areas/index.js.map +1 -0
- package/build/hooks/use-select-nearest-editable-block.js +87 -0
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
- package/build/private-apis.js +6 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +46 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +3 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +80 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +56 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +14 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +21 -11
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/get-filtered-template-parts.js +71 -0
- package/build/store/utils/get-filtered-template-parts.js.map +1 -0
- package/build-module/bindings/index.js +3 -1
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build-module/components/commands/index.js +1 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/deprecated.js +159 -0
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-bar/index.js +8 -11
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +4 -41
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +3 -0
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -16
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +29 -89
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +125 -0
- package/build-module/components/error-boundary/index.native.js.map +1 -0
- package/build-module/components/index.js +5 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +5 -1
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +2 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js +23 -0
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
- package/build-module/components/plugin-document-setting-panel/index.js +115 -0
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -0
- package/build-module/components/plugin-post-publish-panel/index.js +61 -0
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
- package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +444 -0
- package/build-module/components/post-actions/actions.js.map +1 -0
- package/build-module/components/post-card-panel/index.js +85 -0
- package/build-module/components/post-card-panel/index.js.map +1 -0
- package/build-module/components/post-featured-image/index.js +4 -9
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +6 -2
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +2 -73
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +7 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.native.js +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +9 -10
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js +4 -3
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/components/template-areas/index.js +63 -0
- package/build-module/components/template-areas/index.js.map +1 -0
- package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
- package/build-module/private-apis.js +6 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +37 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +2 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +78 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +54 -3
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +13 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +19 -10
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/get-filtered-template-parts.js +64 -0
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
- package/build-style/style-rtl.css +76 -33
- package/build-style/style.css +76 -33
- package/package.json +35 -33
- package/src/bindings/index.js +4 -1
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
- package/src/components/commands/index.js +1 -1
- package/src/components/deprecated.js +157 -0
- package/src/components/document-bar/index.js +12 -17
- package/src/components/document-bar/style.scss +9 -12
- package/src/components/document-outline/index.js +2 -1
- package/src/components/document-tools/style.scss +4 -11
- package/src/components/editor-canvas/edit-template-blocks-notification.js +6 -56
- package/src/components/editor-canvas/index.js +4 -0
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +18 -22
- package/src/components/entities-saved-states/index.js +45 -121
- package/src/components/entities-saved-states/test/use-is-dirty.js +3 -0
- package/src/components/error-boundary/index.native.js +192 -0
- package/src/components/error-boundary/style.native.scss +116 -0
- package/src/components/index.js +5 -4
- package/src/components/index.native.js +1 -0
- package/src/components/inserter-sidebar/index.js +7 -1
- package/src/components/list-view-sidebar/index.js +1 -0
- package/src/components/list-view-sidebar/style.scss +1 -1
- package/src/components/pattern-overrides-panel/index.js +26 -0
- package/src/components/plugin-document-setting-panel/index.js +121 -0
- package/src/components/plugin-post-publish-panel/index.js +64 -0
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
- package/src/components/plugin-post-publish-panel/test/index.js +33 -0
- package/src/components/plugin-pre-publish-panel/index.js +67 -0
- package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
- package/src/components/post-actions/actions.js +582 -0
- package/src/components/post-card-panel/index.js +108 -0
- package/src/components/post-card-panel/style.scss +32 -0
- package/src/components/post-featured-image/index.js +6 -15
- package/src/components/post-featured-image/panel.js +9 -3
- package/src/components/post-featured-image/style.scss +9 -13
- package/src/components/post-sync-status/index.js +1 -94
- package/src/components/post-taxonomies/flat-term-selector.js +13 -8
- package/src/components/post-title/index.native.js +1 -1
- package/src/components/provider/disable-non-page-content-blocks.js +40 -20
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/test/disable-non-page-content-blocks.js +35 -14
- package/src/components/provider/use-block-editor-settings.js +11 -11
- package/src/components/provider/use-hide-blocks-from-inserter.js +5 -3
- package/src/components/template-areas/index.js +85 -0
- package/src/components/template-areas/style.scss +23 -0
- package/src/hooks/use-select-nearest-editable-block.js +95 -0
- package/src/private-apis.js +6 -2
- package/src/store/actions.js +37 -3
- package/src/store/constants.js +2 -0
- package/src/store/private-actions.js +111 -0
- package/src/store/private-selectors.js +105 -17
- package/src/store/reducer.js +13 -0
- package/src/store/selectors.js +50 -40
- package/src/store/utils/get-filtered-template-parts.js +69 -0
- package/src/store/utils/test/get-filtered-template-parts.js +189 -0
- package/src/style.scss +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["speak","apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","applyFilters","preferencesStore","__","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setEditedPost","type","id","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","_post$key$raw","editPost","__experimentalTearDownEditor","since","resetPost","version","alternative","updatePost","setupEditorState","postType","postId","options","select","registry","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","Promise","resolve","catch","err","args","length","createErrorNotice","updatedRecord","previousPost","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","__unstableSaveForPreview","forceIsAutosaveable","isEditedPostAutosaveable","isPostLocked","isDraft","includes","isPreview","getEditedPostPreviewLink","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","setRenderingMode","mode","__unstableIsEditorReady","clearSelectedBlock","undefined","setDeviceType","deviceType","toggleEditorPanelEnabled","panelName","_registry$select$get","inactivePanels","get","isPanelInactive","updatedInactivePanels","filter","invactivePanelName","toggleEditorPanelOpened","_registry$select$get2","openPanels","isPanelOpen","updatedOpenPanels","openPanelName","removeEditorPanel","setIsInserterOpened","value","setIsListViewOpened","isOpen","toggleDistractionFree","isDistractionFree","batch","createInfoNotice","actions","label","onClick","toggle","switchEditorMode","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"sources":["@wordpress/editor/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setEditedPost( post.type, post.id );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t}\n\t);\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Setup the editor state.\n *\n * @deprecated\n *\n * @param {Object} post Post object.\n */\nexport function setupEditorState( post ) {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).setupEditorState\", {\n\t\tsince: '6.5',\n\t\talternative: \"wp.data.dispatch( 'core/editor' ).setEditedPost\",\n\t} );\n\treturn setEditedPost( post.type, post.id );\n}\n\n/**\n * Returns an action that sets the current post Type and post ID.\n *\n * @param {string} postType Post Type.\n * @param {string} postId Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPost( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tpostId,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\n\t\tlet error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\n\t\tif ( ! error ) {\n\t\t\tawait applyFilters(\n\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\tPromise.resolve(),\n\t\t\t\toptions\n\t\t\t).catch( ( err ) => {\n\t\t\t\terror = err;\n\t\t\t} );\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tconst post = select.getCurrentPost();\n\n\t\t// Currently template autosaving is not supported.\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( local ) {\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `all`: This is the default mode. It renders the post editor with all the features available. If a template is provided, it's preferred over the post.\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'post-only' or 'template-locked').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry, select } ) => {\n\t\tif ( select.__unstableIsEditorReady() ) {\n\t\t\t// We clear the block selection but we also need to clear the selection from the core store.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\tdispatch.editPost( { selection: undefined }, { undoIgnore: true } );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function setDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\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\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\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\tconst openPanels =\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'openPanels' ) ??\n\t\t\t[];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\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\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\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/editor/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\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 a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SACCC,KAAK,EACLC,6BAA6B,EAC7BC,2BAA2B,QACrB,mBAAmB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CAAC;;AAExE;AACA;AACA;AACA,OAAO,MAAM0B,WAAW,GAAG1B,oBAAoB,CAAE,aAAc,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAM2B,UAAU,GAAG3B,oBAAoB,CAAE,YAAa,CAAC;;AAE9D;AACA;AACA;AACA,OAAO,MAAM4B,kBAAkB,GAAG5B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM6B,iBAAiB,GAAG7B,oBAAoB,CAAE,mBAAoB,CAAC;;AAE5E;AACA;AACA;AACA,OAAO,MAAM8B,kBAAkB,GAAG9B,oBAAoB,CAAE,oBAAqB,CAAC;;AAE9E;AACA;AACA;AACA,OAAO,MAAM+B,uBAAuB,GAAG/B,oBAAoB,CAC1D,yBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["speak","apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","applyFilters","preferencesStore","__","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setEditedPost","type","id","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","_post$key$raw","editPost","__experimentalTearDownEditor","since","resetPost","version","alternative","updatePost","setupEditorState","postType","postId","options","select","registry","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","Promise","resolve","catch","err","args","length","createErrorNotice","updatedRecord","previousPost","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","__unstableSaveForPreview","forceIsAutosaveable","isEditedPostAutosaveable","isPostLocked","isDraft","includes","isPreview","getEditedPostPreviewLink","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","setRenderingMode","mode","__unstableIsEditorReady","clearSelectedBlock","undefined","setDeviceType","deviceType","toggleEditorPanelEnabled","panelName","_registry$select$get","inactivePanels","get","isPanelInactive","updatedInactivePanels","filter","invactivePanelName","toggleEditorPanelOpened","_registry$select$get2","openPanels","isPanelOpen","updatedOpenPanels","openPanelName","removeEditorPanel","setIsInserterOpened","value","setIsListViewOpened","isOpen","toggleDistractionFree","isDistractionFree","batch","createInfoNotice","actions","label","onClick","toggle","switchEditorMode","openPublishSidebar","closePublishSidebar","togglePublishSidebar","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"sources":["@wordpress/editor/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setEditedPost( post.type, post.id );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t}\n\t);\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Setup the editor state.\n *\n * @deprecated\n *\n * @param {Object} post Post object.\n */\nexport function setupEditorState( post ) {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).setupEditorState\", {\n\t\tsince: '6.5',\n\t\talternative: \"wp.data.dispatch( 'core/editor' ).setEditedPost\",\n\t} );\n\treturn setEditedPost( post.type, post.id );\n}\n\n/**\n * Returns an action that sets the current post Type and post ID.\n *\n * @param {string} postType Post Type.\n * @param {string} postId Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPost( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tpostId,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\n\t\tlet error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\n\t\tif ( ! error ) {\n\t\t\tawait applyFilters(\n\t\t\t\t'editor.__unstableSavePost',\n\t\t\t\tPromise.resolve(),\n\t\t\t\toptions\n\t\t\t).catch( ( err ) => {\n\t\t\t\terror = err;\n\t\t\t} );\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tconst post = select.getCurrentPost();\n\n\t\t// Currently template autosaving is not supported.\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( local ) {\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\nexport const __unstableSaveForPreview =\n\t( { forceIsAutosaveable } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif (\n\t\t\t( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&\n\t\t\t! select.isPostLocked()\n\t\t) {\n\t\t\tconst isDraft = [ 'draft', 'auto-draft' ].includes(\n\t\t\t\tselect.getEditedPostAttribute( 'status' )\n\t\t\t);\n\t\t\tif ( isDraft ) {\n\t\t\t\tawait dispatch.savePost( { isPreview: true } );\n\t\t\t} else {\n\t\t\t\tawait dispatch.autosave( { isPreview: true } );\n\t\t\t}\n\t\t}\n\n\t\treturn select.getEditedPostPreviewLink();\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:\n *\n * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.\n * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.\n *\n * @param {string} mode Mode (one of 'post-only' or 'template-locked').\n */\nexport const setRenderingMode =\n\t( mode ) =>\n\t( { dispatch, registry, select } ) => {\n\t\tif ( select.__unstableIsEditorReady() ) {\n\t\t\t// We clear the block selection but we also need to clear the selection from the core store.\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\tdispatch.editPost( { selection: undefined }, { undoIgnore: true } );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_RENDERING_MODE',\n\t\t\tmode,\n\t\t} );\n\t};\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function setDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\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\tconst inactivePanels =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'inactivePanels' ) ?? [];\n\n\t\tconst isPanelInactive = !! inactivePanels?.includes( panelName );\n\n\t\t// If the panel is inactive, remove it to enable it, else add it to\n\t\t// make it inactive.\n\t\tlet updatedInactivePanels;\n\t\tif ( isPanelInactive ) {\n\t\t\tupdatedInactivePanels = inactivePanels.filter(\n\t\t\t\t( invactivePanelName ) => invactivePanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedInactivePanels = [ ...inactivePanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'inactivePanels', updatedInactivePanels );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\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\tconst openPanels =\n\t\t\tregistry.select( preferencesStore ).get( 'core', 'openPanels' ) ??\n\t\t\t[];\n\n\t\tconst isPanelOpen = !! openPanels?.includes( panelName );\n\n\t\t// If the panel is open, remove it to close it, else add it to\n\t\t// make it open.\n\t\tlet updatedOpenPanels;\n\t\tif ( isPanelOpen ) {\n\t\t\tupdatedOpenPanels = openPanels.filter(\n\t\t\t\t( openPanelName ) => openPanelName !== panelName\n\t\t\t);\n\t\t} else {\n\t\t\tupdatedOpenPanels = [ ...openPanels, panelName ];\n\t\t}\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'openPanels', updatedOpenPanels );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport function removeEditorPanel( panelName ) {\n\treturn {\n\t\ttype: 'REMOVE_PANEL',\n\t\tpanelName,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\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\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\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/editor/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\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 a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\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 * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SACCC,KAAK,EACLC,6BAA6B,EAC7BC,2BAA2B,QACrB,mBAAmB;AAC1B,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,aAAa;AAClD,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SACCC,sCAAsC,EACtCC,mCAAmC,EACnCC,oCAAoC,QAC9B,wBAAwB;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACvBA,CAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,KACvB,CAAE;EAAEC;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAACC,aAAa,CAAEJ,IAAI,CAACK,IAAI,EAAEL,IAAI,CAACM,EAAG,CAAC;EAC5C;EACA,MAAMC,SAAS,GAAGP,IAAI,CAACQ,MAAM,KAAK,YAAY;EAC9C,IAAKD,SAAS,IAAIL,QAAQ,EAAG;IAC5B;IACA;IACA;IACA,IAAIO,OAAO;IACX,IAAK,SAAS,IAAIR,KAAK,EAAG;MACzBQ,OAAO,GAAGR,KAAK,CAACQ,OAAO;IACxB,CAAC,MAAM;MACNA,OAAO,GAAGT,IAAI,CAACS,OAAO,CAACC,GAAG;IAC3B;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postname|pagename)%/;
|
|
18
18
|
export const ONE_MINUTE_IN_MS = 60 * 1000;
|
|
19
19
|
export const AUTOSAVE_PROPERTIES = ['title', 'excerpt', 'content'];
|
|
20
|
+
export const TEMPLATE_POST_TYPE = 'wp_template';
|
|
21
|
+
export const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
|
|
20
22
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EDIT_MERGE_PROPERTIES","Set","STORE_NAME","SAVE_POST_NOTICE_ID","TRASH_POST_NOTICE_ID","PERMALINK_POSTNAME_REGEX","ONE_MINUTE_IN_MS","AUTOSAVE_PROPERTIES"],"sources":["@wordpress/editor/src/store/constants.js"],"sourcesContent":["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';\nexport const TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAE,CAAE,MAAM,CAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,aAAa;AAEvC,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,wBAAwB,GAAG,yBAAyB;AACjE,OAAO,MAAMC,gBAAgB,GAAG,EAAE,GAAG,IAAI;AACzC,OAAO,MAAMC,mBAAmB,GAAG,CAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAE"}
|
|
1
|
+
{"version":3,"names":["EDIT_MERGE_PROPERTIES","Set","STORE_NAME","SAVE_POST_NOTICE_ID","TRASH_POST_NOTICE_ID","PERMALINK_POSTNAME_REGEX","ONE_MINUTE_IN_MS","AUTOSAVE_PROPERTIES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE"],"sources":["@wordpress/editor/src/store/constants.js"],"sourcesContent":["/**\n * Set of post properties for which edits should assume a merging behavior,\n * assuming an object value.\n *\n * @type {Set}\n */\nexport const EDIT_MERGE_PROPERTIES = new Set( [ 'meta' ] );\n\n/**\n * Constant for the store module (or reducer) key.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/editor';\n\nexport const SAVE_POST_NOTICE_ID = 'SAVE_POST_NOTICE_ID';\nexport const TRASH_POST_NOTICE_ID = 'TRASH_POST_NOTICE_ID';\nexport const PERMALINK_POSTNAME_REGEX = /%(?:postname|pagename)%/;\nexport const ONE_MINUTE_IN_MS = 60 * 1000;\nexport const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAE,CAAE,MAAM,CAAG,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG,aAAa;AAEvC,OAAO,MAAMC,mBAAmB,GAAG,qBAAqB;AACxD,OAAO,MAAMC,oBAAoB,GAAG,sBAAsB;AAC1D,OAAO,MAAMC,wBAAwB,GAAG,yBAAyB;AACjE,OAAO,MAAMC,gBAAgB,GAAG,EAAE,GAAG,IAAI;AACzC,OAAO,MAAMC,mBAAmB,GAAG,CAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAE;AACpE,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -71,4 +72,81 @@ export const hideBlockTypes = blockNames => ({
|
|
|
71
72
|
const mergedBlockNames = new Set([...existingBlockNames, ...(Array.isArray(blockNames) ? blockNames : [blockNames])]);
|
|
72
73
|
registry.dispatch(preferencesStore).set('core', 'hiddenBlockTypes', [...mergedBlockNames]);
|
|
73
74
|
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Save entity records marked as dirty.
|
|
78
|
+
*
|
|
79
|
+
* @param {Object} options Options for the action.
|
|
80
|
+
* @param {Function} [options.onSave] Callback when saving happens.
|
|
81
|
+
* @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.
|
|
82
|
+
* @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.
|
|
83
|
+
* @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.
|
|
84
|
+
*/
|
|
85
|
+
export const saveDirtyEntities = ({
|
|
86
|
+
onSave,
|
|
87
|
+
dirtyEntityRecords = [],
|
|
88
|
+
entitiesToSkip = [],
|
|
89
|
+
close
|
|
90
|
+
} = {}) => ({
|
|
91
|
+
registry
|
|
92
|
+
}) => {
|
|
93
|
+
const PUBLISH_ON_SAVE_ENTITIES = [{
|
|
94
|
+
kind: 'postType',
|
|
95
|
+
name: 'wp_navigation'
|
|
96
|
+
}];
|
|
97
|
+
const saveNoticeId = 'site-editor-save-success';
|
|
98
|
+
const homeUrl = registry.select(coreStore).getUnstableBase()?.home;
|
|
99
|
+
registry.dispatch(noticesStore).removeNotice(saveNoticeId);
|
|
100
|
+
const entitiesToSave = dirtyEntityRecords.filter(({
|
|
101
|
+
kind,
|
|
102
|
+
name,
|
|
103
|
+
key,
|
|
104
|
+
property
|
|
105
|
+
}) => {
|
|
106
|
+
return !entitiesToSkip.some(elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property);
|
|
107
|
+
});
|
|
108
|
+
if (!entitiesToSave.length) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
close?.(entitiesToSave);
|
|
112
|
+
const siteItemsToSave = [];
|
|
113
|
+
const pendingSavedRecords = [];
|
|
114
|
+
entitiesToSave.forEach(({
|
|
115
|
+
kind,
|
|
116
|
+
name,
|
|
117
|
+
key,
|
|
118
|
+
property
|
|
119
|
+
}) => {
|
|
120
|
+
if ('root' === kind && 'site' === name) {
|
|
121
|
+
siteItemsToSave.push(property);
|
|
122
|
+
} else {
|
|
123
|
+
if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) {
|
|
124
|
+
registry.dispatch(coreStore).editEntityRecord(kind, name, key, {
|
|
125
|
+
status: 'publish'
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
pendingSavedRecords.push(registry.dispatch(coreStore).saveEditedEntityRecord(kind, name, key));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (siteItemsToSave.length) {
|
|
132
|
+
pendingSavedRecords.push(registry.dispatch(coreStore).__experimentalSaveSpecifiedEntityEdits('root', 'site', undefined, siteItemsToSave));
|
|
133
|
+
}
|
|
134
|
+
registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
|
|
135
|
+
Promise.all(pendingSavedRecords).then(values => {
|
|
136
|
+
return onSave ? onSave(values) : values;
|
|
137
|
+
}).then(values => {
|
|
138
|
+
if (values.some(value => typeof value === 'undefined')) {
|
|
139
|
+
registry.dispatch(noticesStore).createErrorNotice(__('Saving failed.'));
|
|
140
|
+
} else {
|
|
141
|
+
registry.dispatch(noticesStore).createSuccessNotice(__('Site updated.'), {
|
|
142
|
+
type: 'snackbar',
|
|
143
|
+
id: saveNoticeId,
|
|
144
|
+
actions: [{
|
|
145
|
+
label: __('View site'),
|
|
146
|
+
url: homeUrl
|
|
147
|
+
}]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}).catch(error => registry.dispatch(noticesStore).createErrorNotice(`${__('Saving failed.')} ${error}`));
|
|
151
|
+
};
|
|
74
152
|
//# sourceMappingURL=private-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","coreStore","__","noticesStore","preferencesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\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\t);\n\t\treturn savedTemplate;\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\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\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\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASF,KAAK,IAAIG,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,EAAE,EAAG;EAC1C,OAAO;IACNC,IAAI,EAAE,yBAAyB;IAC/BD;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,cAAc,GACxBC,QAAQ,IACV,OAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC3C,MAAMC,aAAa,GAAG,MAAMD,QAAQ,CAClCD,QAAQ,CAAEV,SAAU,CAAC,CACrBa,gBAAgB,CAAE,UAAU,EAAE,aAAa,EAAEL,QAAS,CAAC;EACzDG,QAAQ,CACND,QAAQ,CAAEV,SAAU,CAAC,CACrBc,gBAAgB,CAChB,UAAU,EACVL,MAAM,CAACM,kBAAkB,CAAC,CAAC,EAC3BN,MAAM,CAACO,gBAAgB,CAAC,CAAC,EACzB;IACCR,QAAQ,EAAEI,aAAa,CAACK;EACzB,CACD,CAAC;EACFN,QAAQ,CACND,QAAQ,CAAER,YAAa,CAAC,CACxBgB,mBAAmB,CACnBjB,EAAE,CAAE,uDAAwD,CAAC,EAC7D;IACCK,IAAI,EAAE,UAAU;IAChBa,OAAO,EAAE,CACR;MACCC,KAAK,EAAEnB,EAAE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AAU,GAAG,CAAEA,UAAU,CAAE,CAAE,CAC/D,CAAC;EAEHf,QAAQ,CACND,QAAQ,CAAEP,gBAAiB,CAAC,CAC5BgC,GAAG,CAAE,MAAM,EAAE,kBAAkB,EAAE,CAAE,GAAGG,gBAAgB,CAAG,CAAC;AAC7D,CAAC"}
|
|
1
|
+
{"version":3,"names":["store","coreStore","__","noticesStore","blockEditorStore","preferencesStore","setCurrentTemplateId","id","type","createTemplate","template","select","dispatch","registry","savedTemplate","saveEntityRecord","editEntityRecord","getCurrentPostType","getCurrentPostId","slug","createSuccessNotice","actions","label","onClick","setRenderingMode","getEditorSettings","defaultRenderingMode","showBlockTypes","blockNames","_registry$select$get","existingBlockNames","get","newBlockNames","filter","Array","isArray","includes","set","hideBlockTypes","_registry$select$get2","mergedBlockNames","Set","saveDirtyEntities","onSave","dirtyEntityRecords","entitiesToSkip","close","PUBLISH_ON_SAVE_ENTITIES","kind","name","saveNoticeId","homeUrl","getUnstableBase","home","removeNotice","entitiesToSave","key","property","some","elt","length","siteItemsToSave","pendingSavedRecords","forEach","push","typeToPublish","status","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","undefined","__unstableMarkLastChangeAsPersistent","Promise","all","then","values","value","createErrorNotice","url","catch","error"],"sources":["@wordpress/editor/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {Object?} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\n\t\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\t);\n\t\treturn savedTemplate;\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\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\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\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n\n/**\n * Save entity records marked as dirty.\n *\n * @param {Object} options Options for the action.\n * @param {Function} [options.onSave] Callback when saving happens.\n * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.\n * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.\n * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.\n */\nexport const saveDirtyEntities =\n\t( { onSave, dirtyEntityRecords = [], entitiesToSkip = [], close } = {} ) =>\n\t( { registry } ) => {\n\t\tconst PUBLISH_ON_SAVE_ENTITIES = [\n\t\t\t{ kind: 'postType', name: 'wp_navigation' },\n\t\t];\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tconst homeUrl = registry.select( coreStore ).getUnstableBase()?.home;\n\t\tregistry.dispatch( noticesStore ).removeNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! entitiesToSkip.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tif ( ! entitiesToSave.length ) {\n\t\t\treturn;\n\t\t}\n\t\tclose?.( entitiesToSave );\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord( kind, name, key, {\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.saveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__experimentalSaveSpecifiedEntityEdits(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'site',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tsiteItemsToSave\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave ? onSave( values ) : values;\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\t\turl: homeUrl,\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}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t`${ __( 'Saving failed.' ) } ${ error }`\n\t\t\t\t\t)\n\t\t\t);\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASF,KAAK,IAAIG,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,EAAE,EAAG;EAC1C,OAAO;IACNC,IAAI,EAAE,yBAAyB;IAC/BD;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,cAAc,GACxBC,QAAQ,IACV,OAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC3C,MAAMC,aAAa,GAAG,MAAMD,QAAQ,CAClCD,QAAQ,CAAEX,SAAU,CAAC,CACrBc,gBAAgB,CAAE,UAAU,EAAE,aAAa,EAAEL,QAAS,CAAC;EACzDG,QAAQ,CACND,QAAQ,CAAEX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EACF;EACAhD,QAAQ,CACND,QAAQ,CAAER,gBAAiB,CAAC,CAC5BkE,oCAAoC,CAAC,CAAC;EACxCC,OAAO,CAACC,GAAG,CAAEV,mBAAoB,CAAC,CAChCW,IAAI,CAAIC,MAAM,IAAM;IACpB,OAAO/B,MAAM,GAAGA,MAAM,CAAE+B,MAAO,CAAC,GAAGA,MAAM;EAC1C,CAAE,CAAC,CACFD,IAAI,CAAIC,MAAM,IAAM;IACpB,IACCA,MAAM,CAAChB,IAAI,CAAIiB,KAAK,IAAM,OAAOA,KAAK,KAAK,WAAY,CAAC,EACvD;MACD9D,QAAQ,CACND,QAAQ,CAAET,YAAa,CAAC,CACxByE,iBAAiB,CAAE1E,EAAE,CAAE,gBAAiB,CAAE,CAAC;IAC9C,CAAC,MAAM;MACNW,QAAQ,CACND,QAAQ,CAAET,YAAa,CAAC,CACxBiB,mBAAmB,CAAElB,EAAE,CAAE,eAAgB,CAAC,EAAE;QAC5CM,IAAI,EAAE,UAAU;QAChBD,EAAE,EAAE2C,YAAY;QAChB7B,OAAO,EAAE,CACR;UACCC,KAAK,EAAEpB,EAAE,CAAE,WAAY,CAAC;UACxB2E,GAAG,EAAE1B;QACN,CAAC;MAEH,CAAE,CAAC;IACL;EACD,CAAE,CAAC,CACF2B,KAAK,CAAIC,KAAK,IACdlE,QAAQ,CACND,QAAQ,CAAET,YAAa,CAAC,CACxByE,iBAAiB,CAChB,GAAG1E,EAAE,CAAE,gBAAiB,CAAG,IAAI6E,KAAO,EACxC,CACF,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import createSelector from 'rememo';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
10
|
import { createRegistrySelector } from '@wordpress/data';
|
|
11
|
+
import { layout, symbol, navigation, page as pageIcon, verse } from '@wordpress/icons';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Internal dependencies
|
|
9
16
|
*/
|
|
10
|
-
import { getRenderingMode } from './selectors';
|
|
17
|
+
import { getRenderingMode, __experimentalGetDefaultTemplatePartAreas } from './selectors';
|
|
18
|
+
import { TEMPLATE_PART_POST_TYPE } from './constants';
|
|
19
|
+
import { getFilteredTemplatePartBlocks } from './utils/get-filtered-template-parts';
|
|
11
20
|
const EMPTY_INSERTION_POINT = {
|
|
12
21
|
rootClientId: undefined,
|
|
13
22
|
insertionIndex: undefined,
|
|
@@ -21,7 +30,7 @@ const EMPTY_INSERTION_POINT = {
|
|
|
21
30
|
*
|
|
22
31
|
* @return {Object} The root client ID, index to insert at and starting filter value.
|
|
23
32
|
*/
|
|
24
|
-
export const getInsertionPoint = createRegistrySelector(select => state => {
|
|
33
|
+
export const getInsertionPoint = createRegistrySelector(select => createSelector(state => {
|
|
25
34
|
if (typeof state.blockInserterPanel === 'object') {
|
|
26
35
|
return state.blockInserterPanel;
|
|
27
36
|
}
|
|
@@ -36,8 +45,50 @@ export const getInsertionPoint = createRegistrySelector(select => state => {
|
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
return EMPTY_INSERTION_POINT;
|
|
39
|
-
}
|
|
48
|
+
}, state => {
|
|
49
|
+
const [postContentClientId] = select(blockEditorStore).getBlocksByName('core/post-content');
|
|
50
|
+
return [state.blockInserterPanel, getRenderingMode(state), postContentClientId];
|
|
51
|
+
}));
|
|
40
52
|
export function getListViewToggleRef(state) {
|
|
41
53
|
return state.listViewToggleRef;
|
|
42
54
|
}
|
|
55
|
+
const CARD_ICONS = {
|
|
56
|
+
wp_block: symbol,
|
|
57
|
+
wp_navigation: navigation,
|
|
58
|
+
page: pageIcon,
|
|
59
|
+
post: verse
|
|
60
|
+
};
|
|
61
|
+
export const getPostIcon = createRegistrySelector(select => (state, postType, options) => {
|
|
62
|
+
{
|
|
63
|
+
if (postType === 'wp_template_part' || postType === 'wp_template') {
|
|
64
|
+
return __experimentalGetDefaultTemplatePartAreas(state).find(item => options.area === item.area)?.icon || layout;
|
|
65
|
+
}
|
|
66
|
+
if (CARD_ICONS[postType]) {
|
|
67
|
+
return CARD_ICONS[postType];
|
|
68
|
+
}
|
|
69
|
+
const postTypeEntity = select(coreStore).getPostType(postType);
|
|
70
|
+
// `icon` is the `menu_icon` property of a post type. We
|
|
71
|
+
// only handle `dashicons` for now, even if the `menu_icon`
|
|
72
|
+
// also supports urls and svg as values.
|
|
73
|
+
if (postTypeEntity?.icon?.startsWith('dashicons-')) {
|
|
74
|
+
return postTypeEntity.icon.slice(10);
|
|
75
|
+
}
|
|
76
|
+
return pageIcon;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Returns the template parts and their blocks for the current edited template.
|
|
82
|
+
*
|
|
83
|
+
* @param {Object} state Global application state.
|
|
84
|
+
* @return {Array} Template parts and their blocks in an array.
|
|
85
|
+
*/
|
|
86
|
+
export const getCurrentTemplateTemplateParts = createRegistrySelector(select => () => {
|
|
87
|
+
const templateParts = select(coreStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
|
|
88
|
+
per_page: -1
|
|
89
|
+
});
|
|
90
|
+
const clientIds = select(blockEditorStore).getBlocksByName('core/template-part');
|
|
91
|
+
const blocks = select(blockEditorStore).getBlocksByClientId(clientIds);
|
|
92
|
+
return getFilteredTemplatePartBlocks(blocks, templateParts);
|
|
93
|
+
});
|
|
43
94
|
//# sourceMappingURL=private-selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","createRegistrySelector","getRenderingMode","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {
|
|
1
|
+
{"version":3,"names":["createSelector","store","blockEditorStore","createRegistrySelector","layout","symbol","navigation","page","pageIcon","verse","coreStore","getRenderingMode","__experimentalGetDefaultTemplatePartAreas","TEMPLATE_PART_POST_TYPE","getFilteredTemplatePartBlocks","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getInsertionPoint","select","state","blockInserterPanel","postContentClientId","getBlocksByName","getListViewToggleRef","listViewToggleRef","CARD_ICONS","wp_block","wp_navigation","post","getPostIcon","postType","options","find","item","area","icon","postTypeEntity","getPostType","startsWith","slice","getCurrentTemplateTemplateParts","templateParts","getEntityRecords","per_page","clientIds","blocks","getBlocksByClientId"],"sources":["@wordpress/editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createRegistrySelector } from '@wordpress/data';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tpage as pageIcon,\n\tverse,\n} from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetRenderingMode,\n\t__experimentalGetDefaultTemplatePartAreas,\n} from './selectors';\nimport { TEMPLATE_PART_POST_TYPE } from './constants';\nimport { getFilteredTemplatePartBlocks } from './utils/get-filtered-template-parts';\n\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\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 const getInsertionPoint = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state ) => {\n\t\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\t\treturn state.blockInserterPanel;\n\t\t\t}\n\n\t\t\tif ( getRenderingMode( state ) === 'template-locked' ) {\n\t\t\t\tconst [ postContentClientId ] =\n\t\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t\t'core/post-content'\n\t\t\t\t\t);\n\t\t\t\tif ( postContentClientId ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn EMPTY_INSERTION_POINT;\n\t\t},\n\t\t( state ) => {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).getBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\treturn [\n\t\t\t\tstate.blockInserterPanel,\n\t\t\t\tgetRenderingMode( state ),\n\t\t\t\tpostContentClientId,\n\t\t\t];\n\t\t}\n\t)\n);\n\nexport function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n\tpage: pageIcon,\n\tpost: verse,\n};\n\nexport const getPostIcon = createRegistrySelector(\n\t( select ) => ( state, postType, options ) => {\n\t\t{\n\t\t\tif (\n\t\t\t\tpostType === 'wp_template_part' ||\n\t\t\t\tpostType === 'wp_template'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\t__experimentalGetDefaultTemplatePartAreas( state ).find(\n\t\t\t\t\t\t( item ) => options.area === item.area\n\t\t\t\t\t)?.icon || layout\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( CARD_ICONS[ postType ] ) {\n\t\t\t\treturn CARD_ICONS[ postType ];\n\t\t\t}\n\t\t\tconst postTypeEntity = select( coreStore ).getPostType( postType );\n\t\t\t// `icon` is the `menu_icon` property of a post type. We\n\t\t\t// only handle `dashicons` for now, even if the `menu_icon`\n\t\t\t// also supports urls and svg as values.\n\t\t\tif ( postTypeEntity?.icon?.startsWith( 'dashicons-' ) ) {\n\t\t\t\treturn postTypeEntity.icon.slice( 10 );\n\t\t\t}\n\t\t\treturn pageIcon;\n\t\t}\n\t}\n);\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).getBlocksByName( 'core/template-part' );\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,IAAI,IAAIC,QAAQ,EAChBC,KAAK,QACC,kBAAkB;AACzB,SAASR,KAAK,IAAIS,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,yCAAyC,QACnC,aAAa;AACpB,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,6BAA6B,QAAQ,qCAAqC;AAEnF,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,iBAAiB,GAAG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KD,IAAI,CAACC,IACnC,CAAC,EAAEC,IAAI,IAAIlC,MAAM;IAEnB;IACA,IAAKwB,UAAU,CAAEK,QAAQ,CAAE,EAAG;MAC7B,OAAOL,UAAU,CAAEK,QAAQ,CAAE;IAC9B;IACA,MAAMM,cAAc,GAAGlB,MAAM,CAAEX,SAAU,CAAC,CAAC8B,WAAW,CAAEP,QAAS,CAAC;IAClE;IACA;IACA;IACA,IAAKM,cAAc,EAAED,IAAI,EAAEG,UAAU,CAAE,YAAa,CAAC,EAAG;MACvD,OAAOF,cAAc,CAACD,IAAI,CAACI,KAAK,CAAE,EAAG,CAAC;IACvC;IACA,OAAOlC,QAAQ;EAChB;AACD,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMmC,+BAA+B,GAAGxC,sBAAsB,CAClEkB,MAAM,IAAM,MAAM;EACnB,MAAMuB,aAAa,GAAGvB,MAAM,CAAEX,SAAU,CAAC,CAACmC,gBAAgB,CACzD,UAAU,EACVhC,uBAAuB,EACvB;IAAEiC,QAAQ,EAAE,CAAC;EAAE,CAChB,CAAC;EAED,MAAMC,SAAS,GACd1B,MAAM,CAAEnB,gBAAiB,CAAC,CAACuB,eAAe,CAAE,oBAAqB,CAAC;EACnE,MAAMuB,MAAM,GACX3B,MAAM,CAAEnB,gBAAiB,CAAC,CAAC+C,mBAAmB,CAAEF,SAAU,CAAC;EAE5D,OAAOjC,6BAA6B,CAAEkC,MAAM,EAAEJ,aAAc,CAAC;AAC9D,CACD,CAAC"}
|
|
@@ -351,6 +351,17 @@ export function listViewToggleRef(state = {
|
|
|
351
351
|
}) {
|
|
352
352
|
return state;
|
|
353
353
|
}
|
|
354
|
+
export function publishSidebarActive(state = false, action) {
|
|
355
|
+
switch (action.type) {
|
|
356
|
+
case 'OPEN_PUBLISH_SIDEBAR':
|
|
357
|
+
return true;
|
|
358
|
+
case 'CLOSE_PUBLISH_SIDEBAR':
|
|
359
|
+
return false;
|
|
360
|
+
case 'TOGGLE_PUBLISH_SIDEBAR':
|
|
361
|
+
return !state;
|
|
362
|
+
}
|
|
363
|
+
return state;
|
|
364
|
+
}
|
|
354
365
|
export default combineReducers({
|
|
355
366
|
postId,
|
|
356
367
|
postType,
|
|
@@ -367,6 +378,7 @@ export default combineReducers({
|
|
|
367
378
|
removedPanels,
|
|
368
379
|
blockInserterPanel,
|
|
369
380
|
listViewPanel,
|
|
370
|
-
listViewToggleRef
|
|
381
|
+
listViewToggleRef,
|
|
382
|
+
publishSidebarActive
|
|
371
383
|
});
|
|
372
384
|
//# sourceMappingURL=reducer.js.map
|