@wordpress/editor 12.9.0 → 12.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -2
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-visibility/index.js +8 -11
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +3 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +1 -1
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js +4 -8
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -1
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +9 -12
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +4 -2
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +2 -2
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js +3 -5
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +0 -16
- package/build-style/style.css +0 -16
- package/package.json +28 -28
- package/src/components/editor-help/index.native.js +6 -6
- package/src/components/entities-saved-states/entity-record-item.js +6 -6
- package/src/components/entities-saved-states/index.js +6 -9
- package/src/components/global-keyboard-shortcuts/save-shortcut.js +2 -3
- package/src/components/local-autosave-monitor/index.js +15 -20
- package/src/components/page-attributes/parent.js +4 -6
- package/src/components/post-author/select.js +2 -3
- package/src/components/post-comments/index.js +4 -3
- package/src/components/post-format/index.js +2 -3
- package/src/components/post-last-revision/check.js +2 -4
- package/src/components/post-last-revision/index.js +2 -4
- package/src/components/post-pending-status/check.js +2 -5
- package/src/components/post-pingbacks/index.js +2 -3
- package/src/components/post-publish-button/index.js +7 -8
- package/src/components/post-publish-panel/index.js +2 -3
- package/src/components/post-publish-panel/maybe-category-panel.js +2 -3
- package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -3
- package/src/components/post-publish-panel/postpublish.js +2 -5
- package/src/components/post-publish-panel/prepublish.js +2 -3
- package/src/components/post-slug/index.js +2 -3
- package/src/components/post-sticky/index.js +2 -3
- package/src/components/post-switch-to-draft-button/index.js +2 -5
- package/src/components/post-taxonomies/flat-term-selector.js +4 -8
- package/src/components/post-taxonomies/hierarchical-term-selector.js +4 -6
- package/src/components/post-title/index.js +21 -31
- package/src/components/post-title/index.native.js +10 -16
- package/src/components/post-trash/check.js +2 -3
- package/src/components/post-visibility/index.js +9 -15
- package/src/components/post-visibility/style.scss +0 -17
- package/src/components/provider/index.js +2 -3
- package/src/components/provider/index.native.js +11 -10
- package/src/components/provider/use-block-editor-settings.js +4 -8
- package/src/components/template-validation-notice/index.js +2 -3
- package/src/components/theme-support-check/index.js +2 -2
- package/src/hooks/custom-sources-backwards-compatibility.js +45 -44
- package/src/store/actions.js +211 -190
- package/src/store/selectors.js +12 -19
- package/src/store/test/selectors.js +2 -3
- package/src/utils/media-upload/index.js +2 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","coreStore","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","noticesStore","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","blockEditorStore","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","TRASH_POST_NOTICE_ID","path","rest_base","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","preferencesStore","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,CAAEC,IAAF,EAAQC,KAAR,EAAeC,QAAf,KAA6B,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC3EA,EAAAA,QAAQ,CAACC,gBAAT,CAA2BJ,IAA3B,EAD2E,CAE3E;;AACA,QAAMK,SAAS,GAAGL,IAAI,CAACM,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIH,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIK,OAAJ;;AACA,QAAK,iBAAKN,KAAL,EAAY,CAAE,SAAF,CAAZ,CAAL,EAAmC;AAClCM,MAAAA,OAAO,GAAGN,KAAK,CAACM,OAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,OAAO,GAAGP,IAAI,CAACO,OAAL,CAAaC,GAAvB;AACA;;AACD,QAAIC,MAAM,GAAG,mBAAOF,OAAP,CAAb;AACAE,IAAAA,MAAM,GAAG,2CAA+BA,MAA/B,EAAuCP,QAAvC,CAAT;AACAC,IAAAA,QAAQ,CAACO,iBAAT,CAA4BD,MAA5B,EAAoC;AACnCE,MAAAA,+BAA+B,EAAE;AADE,KAApC;AAGA;;AACD,MACCV,KAAK,IACLW,MAAM,CAACC,MAAP,CAAeZ,KAAf,EAAuBa,IAAvB,CACC;AAAA;;AAAA,QAAE,CAAEC,GAAF,EAAOC,IAAP,CAAF;A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ADA;AAENuD,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;;;AACO,MAAMC,oBAAoB,GAAG,MAAM,SAAoB;AAAA,MAAlB;AAAEhD,IAAAA;AAAF,GAAkB;AAC7DA,EAAAA,QAAQ,CACNxB,QADF,CACYyE,kBADZ,EAEEC,GAFF,CAEO,gBAFP,EAEyB,yBAFzB,EAEoD,IAFpD;AAGA,CAJM;AAMP;AACA;AACA;;;;;AACO,MAAMC,qBAAqB,GAAG,MAAM,UAAoB;AAAA,MAAlB;AAAEnD,IAAAA;AAAF,GAAkB;AAC9DA,EAAAA,QAAQ,CACNxB,QADF,CACYyE,kBADZ,EAEEC,GAFF,CAEO,gBAFP,EAEyB,yBAFzB,EAEoD,KAFpD;AAGA,CAJM;AAMP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASE,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN7D,IAAAA,IAAI,EAAE,kBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN7D,IAAAA,IAAI,EAAE,oBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN7D,IAAAA,IAAI,EAAE,sBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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ACO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 { store as preferencesStore } from '@wordpress/preferences';\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 = ( post, edits, template ) => ( { dispatch } ) => {\n\tdispatch.setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.values( edits ).some(\n\t\t\t( [ key, edit ] ) => edit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t)\n\t) {\n\t\tdispatch.editPost( edits );\n\t}\n};\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 * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\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 * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\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 = ( edits, options ) => ( { select, registry } ) => {\n\tconst { id, type } = select.getCurrentPost();\n\tregistry\n\t\t.dispatch( coreStore )\n\t\t.editEntityRecord( 'postType', type, id, edits, options );\n};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost = ( options = {} ) => async ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tif ( ! select.isEditedPostSaveable() ) {\n\t\treturn;\n\t}\n\n\tconst content = select.getEditedPostContent();\n\n\tif ( ! options.isAutosave ) {\n\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t}\n\n\tconst previousRecord = select.getCurrentPost();\n\tconst edits = {\n\t\tid: previousRecord.id,\n\t\t...registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t),\n\t\tcontent,\n\t};\n\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\tawait registry\n\t\t.dispatch( coreStore )\n\t\t.saveEntityRecord( 'postType', previousRecord.type, edits, options );\n\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\tconst error = registry\n\t\t.select( coreStore )\n\t\t.getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t}\n\t} else {\n\t\tconst updatedRecord = select.getCurrentPost();\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice( ...args );\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t}\n\t}\n};\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 = () => async ( { select, dispatch, registry } ) => {\n\tconst postTypeSlug = select.getCurrentPostType();\n\tconst postType = await registry\n\t\t.resolveSelect( coreStore )\n\t\t.getPostType( postTypeSlug );\n\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\ttry {\n\t\tconst post = select.getCurrentPost();\n\t\tawait apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tawait dispatch.savePost();\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice(\n\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t);\n\t}\n};\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 = ( { local = false, ...options } = {} ) => async ( {\n\tselect,\n\tdispatch,\n} ) => {\n\tif ( local ) {\n\t\tconst post = select.getCurrentPost();\n\t\tconst isPostNew = select.isEditedPostNew();\n\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t} else {\n\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t}\n};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).redo();\n};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo = () => ( { registry } ) => {\n\tregistry.dispatch( coreStore ).undo();\n};\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 = () => ( { registry } ) => {\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar = () => ( { registry } ) => {\n\tregistry\n\t\t.dispatch( preferencesStore )\n\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n};\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 = ( blocks, options = {} ) => ( {\n\tselect,\n\tdispatch,\n\tregistry,\n} ) => {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tconst noChange =\n\t\t\tregistry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\tedits.blocks;\n\t\tif ( noChange ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\treturn;\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\n\tdispatch.editPost( edits );\n};\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 * Backward compatibility\n */\n\nconst getBlockEditorAction = ( name ) => ( ...args ) => ( { registry } ) => {\n\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\tsince: '5.3',\n\t\talternative: \"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\tversion: '6.2',\n\t} );\n\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n};\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"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","coreStore","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","noticesStore","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","blockEditorStore","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","TRASH_POST_NOTICE_ID","path","rest_base","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","preferencesStore","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBl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,EAEyB,yBAFzB,EAEoD,IAFpD;AAGA,CANK;AAQP;AACA;AACA;;;;;AACO,MAAMC,qBAAqB,GACjC,MACA,UAAoB;AAAA,MAAlB;AAAEnD,IAAAA;AAAF,GAAkB;AACnBA,EAAAA,QAAQ,CACNxB,QADF,CACYyE,kBADZ,EAEEC,GAFF,CAEO,gBAFP,EAEyB,yBAFzB,EAEoD,KAFpD;AAGA,CANK;AAQP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASE,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN7D,IAAAA,IAAI,EAAE,kBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN7D,IAAAA,IAAI,EAAE,oBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN7D,IAAAA,IAAI,EAAE,sBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BH,QAA/B,EAA0C;AAChD,SAAO;AACN7D,IAAAA,IAAI,EAAE,wBADA;AAEN6D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMtE,iBAAiB,GAC7B,UAAED,MAAF;AAAA,MAAUgB,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M8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 { store as preferencesStore } from '@wordpress/preferences';\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.setupEditorState( post );\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 ( has( edits, [ 'content' ] ) ) {\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 * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\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 * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\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\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tconst 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\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\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ 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};\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\tif ( local ) {\n\t\t\tconst post = select.getCurrentPost();\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\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 * 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/selectors.js"],"names":["EMPTY_OBJECT","EMPTY_ARRAY","hasEditorUndo","select","coreStore","hasUndo","hasEditorRedo","hasRedo","isEditedPostNew","state","getCurrentPost","status","hasChangedContent","edits","getPostEdits","isEditedPostDirty","postType","getCurrentPostType","postId","getCurrentPostId","hasEditsForEntityRecord","hasNonPostEntityChanges","dirtyEntityRecords","__experimentalGetDirtyEntityRecords","type","id","entityRecord","kind","name","key","isCleanNewPost","post","getRawEntityRecord","getCurrentPostRevisionsCount","getCurrentPostLastRevisionId","getEntityRecordEdits","getCurrentPostAttribute","attributeName","hasOwnProperty","getNestedEditedPostProperty","getEditedPostAttribute","getEditedPostContent","EDIT_MERGE_PROPERTIES","has","getAutosaveAttribute","AUTOSAVE_PROPERTIES","currentUserId","getCurrentUser","autosave","getAutosave","getEditedPostVisibility","password","isCurrentPostPending","isCurrentPostPublished","currentPost","indexOf","Date","Number","date","ONE_MINUTE_IN_MS","isCurrentPostScheduled","isEditedPostPublishable","isEditedPostSaveable","isSavingPost","isEditedPostEmpty","Platform","OS","blocks","getEditorBlocks","length","blockName","isEditedPostAutosaveable","isPostAutosavingLocked","hasFetchedAutosave","hasFetchedAutosaves","some","field","isEditedPostBeingScheduled","checkedDate","isEditedPostDateFloating","modified","isSavingEntityRecord","isSavingNonPostEntityChanges","entitiesBeingSaved","__experimentalGetEntitiesBeingSaved","didPostSaveRequestSucceed","getLastEntitySaveError","didPostSaveRequestFail","isAutosavingPost","saving","isPreviewingPost","getEditedPostPreviewLink","pending","previewLink","preview","featuredImageId","_thumbnail_id","getSuggestedPostFormat","provider","attributes","providerNameSlug","includes","record","getEditedEntityRecord","content","isPublishingPost","isPermalinkEditable","permalinkTemplate","PERMALINK_POSTNAME_REGEX","test","getPermalink","permalinkParts","getPermalinkParts","prefix","postName","suffix","getEditedPostSlug","split","isPostLocked","postLock","isLocked","isPostSavingLocked","Object","keys","postSavingLock","postAutosavingLock","isPostLockTakeover","isTakeover","getPostLockUser","user","getActivePostLock","activePostLock","canUserUseUnfilteredHTML","isPublishSidebarEnabled","preferencesStore","get","getEditorSelectionStart","since","alternative","selectionStart","getEditorSelectionEnd","selectionEnd","getEditorSelection","__unstableIsEditorReady","isReady","getEditorSettings","editorSettings","getStateBeforeOptimisticTransaction","hint","inSomeHistory","getBlockEditorSelector","version","args","blockEditorStore","getBlockName","isBlockValid","getBlockAttributes","getBlock","getBlocks","getClientIdsOfDescendants","getClientIdsWithDescendants","getGlobalBlockCount","getBlocksByClientId","getBlockCount","getBlockSelectionStart","getBlockSelectionEnd","getSelectedBlockCount","hasSelectedBlock","getSelectedBlockClientId","getSelectedBlock","getBlockRootClientId","getBlockHierarchyRootClientId","getAdjacentBlockClientId","getPreviousBlockClientId","getNextBlockClientId","getSelectedBlocksInitialCaretPosition","getMultiSelectedBlockClientIds","getMultiSelectedBlocks","getFirstMultiSelectedBlockClientId","getLastMultiSelectedBlockClientId","isFirstMultiSelectedBlock","isBlockMultiSelected","isAncestorMultiSelected","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getBlockOrder","getBlockIndex","isBlockSelected","hasSelectedInnerBlock","isBlockWithinSelection","hasMultiSelection","isMultiSelecting","isSelectionEnabled","getBlockMode","isTyping","isCaretWithinFormattedText","getBlockInsertionPoint","isBlockInsertionPointVisible","isValidTemplate","getTemplate","getTemplateLock","canInsertBlockType","getInserterItems","hasInserterItems","getBlockListSettings","__experimentalGetDefaultTemplateTypes","defaultTemplateTypes","__experimentalGetDefaultTemplatePartAreas","areas","defaultTemplatePartAreas","map","item","icon","__experimentalGetDefaultTemplateType","slug","__experimentalGetTemplateInfo","template","description","title","area","defaultTitle","defaultDescription","templateTitle","rendered","templateDescription","raw","templateIcon","find","layout","getPostTypeLabel","currentPostType","getPostType","labels","singular_name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAMA;;AACA;;AAlCA;AACA;AACA;;AAIA;AACA;AACA;;AAgBA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,EAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,aAAa,GAAG,kCAA0BC,MAAF,IAAc,MAAM;AACxE,SAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,OAApB,EAAP;AACA,CAF4B,CAAtB;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,aAAa,GAAG,kCAA0BH,MAAF,IAAc,MAAM;AACxE,SAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBG,OAApB,EAAP;AACA,CAF4B,CAAtB;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A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EtM,KAAF,CAAzC,CAAmD0N,IAAnD,CACGhB,IAAF,IAAYQ,IAAI,KAAKR,IAAI,CAACQ,IAD3B,+EAEGP,IAFH,KAEWgB,aAHZ;AAKA,SAAO;AACNV,IAAAA,KAAK,EACJI,aAAa,IAAIA,aAAa,KAAKR,IAAnC,GACGQ,aADH,GAEGF,YAAY,IAAIN,IAJd;AAKNG,IAAAA,WAAW,EAAEO,mBAAmB,IAAIH,kBAL9B;AAMNT,IAAAA,IAAI,EAAEc;AANA,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMG,gBAAgB,GAAG,kCAC7BlO,MAAF,IAAgBM,KAAF,IAAa;AAAA;;AAC1B,QAAM6N,eAAe,GAAGrN,kBAAkB,CAAER,KAAF,CAA1C;AACA,QAAMO,QAAQ,GAAGb,MAAM,CAAEC,eAAF,CAAN,CAAoBmO,WAApB,CAAiCD,eAAjC,CAAjB,CAF0B,CAG1B;AACA;;AACA,SAAOtN,QAAP,aAAOA,QAAP,2CAAOA,QAAQ,CAAEwN,MAAjB,qDAAO,iBAAkBC,aAAzB;AACA,CAP8B,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport { find, get, has, isString, includes, some } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetFreeformContentHandlerName,\n\tgetDefaultBlockName,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { isInTheFuture, getDate } from '@wordpress/date';\nimport { addQueryArgs, cleanForSlug } from '@wordpress/url';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { layout } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tEDIT_MERGE_PROPERTIES,\n\tPERMALINK_POSTNAME_REGEX,\n\tONE_MINUTE_IN_MS,\n\tAUTOSAVE_PROPERTIES,\n} from './constants';\nimport { getPostRawValue } from './reducer';\nimport { getTemplatePartIcon } from '../utils/get-template-part-icon';\n\n/**\n * Shared reference to an empty object for cases where it is important to avoid\n * returning a new object reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n */\nconst EMPTY_OBJECT = {};\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns true if any past editor history snapshots exist, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether undo history exists.\n */\nexport const hasEditorUndo = createRegistrySelector( ( select ) => () => {\n\treturn select( coreStore ).hasUndo();\n} );\n\n/**\n * Returns true if any future editor history snapshots exist, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether redo history exists.\n */\nexport const hasEditorRedo = createRegistrySelector( ( select ) => () => {\n\treturn select( coreStore ).hasRedo();\n} );\n\n/**\n * Returns true if the currently edited post is yet to be saved, or false if\n * the post has been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is new.\n */\nexport function isEditedPostNew( state ) {\n\treturn getCurrentPost( state ).status === 'auto-draft';\n}\n\n/**\n * Returns true if content includes unsaved changes, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether content includes unsaved changes.\n */\nexport function hasChangedContent( state ) {\n\tconst edits = getPostEdits( state );\n\n\treturn (\n\t\t'blocks' in edits ||\n\t\t// `edits` is intended to contain only values which are different from\n\t\t// the saved post, so the mere presence of a property is an indicator\n\t\t// that the value is different than what is known to be saved. While\n\t\t// content in Visual mode is represented by the blocks state, in Text\n\t\t// mode it is tracked by `edits.content`.\n\t\t'content' in edits\n\t);\n}\n\n/**\n * Returns true if there are unsaved values for the current edit session, or\n * false if the editing state matches the saved or new post.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether unsaved values exist.\n */\nexport const isEditedPostDirty = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\t// Edits should contain only fields which differ from the saved post (reset\n\t\t// at initial load and save complete). Thus, a non-empty edits state can be\n\t\t// inferred to contain unsaved values.\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tif (\n\t\t\tselect( coreStore ).hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n);\n\n/**\n * Returns true if there are unsaved edits for entities other than\n * the editor's post, and false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether there are edits or not.\n */\nexport const hasNonPostEntityChanges = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst dirtyEntityRecords = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetDirtyEntityRecords();\n\t\tconst { type, id } = getCurrentPost( state );\n\t\treturn some(\n\t\t\tdirtyEntityRecords,\n\t\t\t( entityRecord ) =>\n\t\t\t\tentityRecord.kind !== 'postType' ||\n\t\t\t\tentityRecord.name !== type ||\n\t\t\t\tentityRecord.key !== id\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there are no unsaved values for the current edit session and\n * if the currently edited post is new (has never been saved before).\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether new post and unsaved values exist.\n */\nexport function isCleanNewPost( state ) {\n\treturn ! isEditedPostDirty( state ) && isEditedPostNew( state );\n}\n\n/**\n * Returns the post currently being edited in its last known saved state, not\n * including unsaved edits. Returns an object containing relevant default post\n * values if the post has not yet been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Post object.\n */\nexport const getCurrentPost = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst postType = getCurrentPostType( state );\n\n\t\tconst post = select( coreStore ).getRawEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( post ) {\n\t\t\treturn post;\n\t\t}\n\n\t\t// This exists for compatibility with the previous selector behavior\n\t\t// which would guarantee an object return based on the editor reducer's\n\t\t// default empty object state.\n\t\treturn EMPTY_OBJECT;\n\t}\n);\n\n/**\n * Returns the post type of the post currently being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post type.\n */\nexport function getCurrentPostType( state ) {\n\treturn state.postType;\n}\n\n/**\n * Returns the ID of the post currently being edited, or null if the post has\n * not yet been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {?number} ID of current post.\n */\nexport function getCurrentPostId( state ) {\n\treturn state.postId;\n}\n\n/**\n * Returns the number of revisions of the post currently being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} Number of revisions.\n */\nexport function getCurrentPostRevisionsCount( state ) {\n\treturn get(\n\t\tgetCurrentPost( state ),\n\t\t[ '_links', 'version-history', 0, 'count' ],\n\t\t0\n\t);\n}\n\n/**\n * Returns the last revision ID of the post currently being edited,\n * or null if the post has no revisions.\n *\n * @param {Object} state Global application state.\n *\n * @return {?number} ID of the last revision.\n */\nexport function getCurrentPostLastRevisionId( state ) {\n\treturn get(\n\t\tgetCurrentPost( state ),\n\t\t[ '_links', 'predecessor-version', 0, 'id' ],\n\t\tnull\n\t);\n}\n\n/**\n * Returns any post values which have been changed in the editor but not yet\n * been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object of key value pairs comprising unsaved edits.\n */\nexport const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {\n\tconst postType = getCurrentPostType( state );\n\tconst postId = getCurrentPostId( state );\n\treturn (\n\t\tselect( coreStore ).getEntityRecordEdits(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t) || EMPTY_OBJECT\n\t);\n} );\n\n/**\n * Returns an attribute value of the saved post.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nexport function getCurrentPostAttribute( state, attributeName ) {\n\tswitch ( attributeName ) {\n\t\tcase 'type':\n\t\t\treturn getCurrentPostType( state );\n\n\t\tcase 'id':\n\t\t\treturn getCurrentPostId( state );\n\n\t\tdefault:\n\t\t\tconst post = getCurrentPost( state );\n\t\t\tif ( ! post.hasOwnProperty( attributeName ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn getPostRawValue( post[ attributeName ] );\n\t}\n}\n\n/**\n * Returns a single attribute of the post being edited, preferring the unsaved\n * edit if one exists, but merging with the attribute value for the last known\n * saved state of the post (this is needed for some nested attributes like meta).\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nconst getNestedEditedPostProperty = ( state, attributeName ) => {\n\tconst edits = getPostEdits( state );\n\tif ( ! edits.hasOwnProperty( attributeName ) ) {\n\t\treturn getCurrentPostAttribute( state, attributeName );\n\t}\n\n\treturn {\n\t\t...getCurrentPostAttribute( state, attributeName ),\n\t\t...edits[ attributeName ],\n\t};\n};\n\n/**\n * Returns a single attribute of the post being edited, preferring the unsaved\n * edit if one exists, but falling back to the attribute for the last known\n * saved state of the post.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nexport function getEditedPostAttribute( state, attributeName ) {\n\t// Special cases.\n\tswitch ( attributeName ) {\n\t\tcase 'content':\n\t\t\treturn getEditedPostContent( state );\n\t}\n\n\t// Fall back to saved post value if not edited.\n\tconst edits = getPostEdits( state );\n\tif ( ! edits.hasOwnProperty( attributeName ) ) {\n\t\treturn getCurrentPostAttribute( state, attributeName );\n\t}\n\n\t// Merge properties are objects which contain only the patch edit in state,\n\t// and thus must be merged with the current post attribute.\n\tif ( EDIT_MERGE_PROPERTIES.has( attributeName ) ) {\n\t\treturn getNestedEditedPostProperty( state, attributeName );\n\t}\n\n\treturn edits[ attributeName ];\n}\n\n/**\n * Returns an attribute value of the current autosave revision for a post, or\n * null if there is no autosave for the post.\n *\n * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector\n * \t\t\t from the '@wordpress/core-data' package and access properties on the returned\n * \t\t\t autosave object using getPostRawValue.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Autosave attribute name.\n *\n * @return {*} Autosave attribute value.\n */\nexport const getAutosaveAttribute = createRegistrySelector(\n\t( select ) => ( state, attributeName ) => {\n\t\tif (\n\t\t\t! includes( AUTOSAVE_PROPERTIES, attributeName ) &&\n\t\t\tattributeName !== 'preview_link'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst currentUserId = get( select( coreStore ).getCurrentUser(), [\n\t\t\t'id',\n\t\t] );\n\t\tconst autosave = select( coreStore ).getAutosave(\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\tcurrentUserId\n\t\t);\n\n\t\tif ( autosave ) {\n\t\t\treturn getPostRawValue( autosave[ attributeName ] );\n\t\t}\n\t}\n);\n\n/**\n * Returns the current visibility of the post being edited, preferring the\n * unsaved value if different than the saved post. The return value is one of\n * \"private\", \"password\", or \"public\".\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post visibility.\n */\nexport function getEditedPostVisibility( state ) {\n\tconst status = getEditedPostAttribute( state, 'status' );\n\tif ( status === 'private' ) {\n\t\treturn 'private';\n\t}\n\n\tconst password = getEditedPostAttribute( state, 'password' );\n\tif ( password ) {\n\t\treturn 'password';\n\t}\n\n\treturn 'public';\n}\n\n/**\n * Returns true if post is pending review.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether current post is pending review.\n */\nexport function isCurrentPostPending( state ) {\n\treturn getCurrentPost( state ).status === 'pending';\n}\n\n/**\n * Return true if the current post has already been published.\n *\n * @param {Object} state Global application state.\n * @param {Object?} currentPost Explicit current post for bypassing registry selector.\n *\n * @return {boolean} Whether the post has been published.\n */\nexport function isCurrentPostPublished( state, currentPost ) {\n\tconst post = currentPost || getCurrentPost( state );\n\n\treturn (\n\t\t[ 'publish', 'private' ].indexOf( post.status ) !== -1 ||\n\t\t( post.status === 'future' &&\n\t\t\t! isInTheFuture(\n\t\t\t\tnew Date( Number( getDate( post.date ) ) - ONE_MINUTE_IN_MS )\n\t\t\t) )\n\t);\n}\n\n/**\n * Returns true if post is already scheduled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether current post is scheduled to be posted.\n */\nexport function isCurrentPostScheduled( state ) {\n\treturn (\n\t\tgetCurrentPost( state ).status === 'future' &&\n\t\t! isCurrentPostPublished( state )\n\t);\n}\n\n/**\n * Return true if the post being edited can be published.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post can been published.\n */\nexport function isEditedPostPublishable( state ) {\n\tconst post = getCurrentPost( state );\n\n\t// TODO: Post being publishable should be superset of condition of post\n\t// being saveable. Currently this restriction is imposed at UI.\n\t//\n\t// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).\n\n\treturn (\n\t\tisEditedPostDirty( state ) ||\n\t\t[ 'publish', 'private', 'future' ].indexOf( post.status ) === -1\n\t);\n}\n\n/**\n * Returns true if the post can be saved, or false otherwise. A post must\n * contain a title, an excerpt, or non-empty content to be valid for save.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post can be saved.\n */\nexport function isEditedPostSaveable( state ) {\n\tif ( isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\n\t// TODO: Post should not be saveable if not dirty. Cannot be added here at\n\t// this time since posts where meta boxes are present can be saved even if\n\t// the post is not dirty. Currently this restriction is imposed at UI, but\n\t// should be moved here.\n\t//\n\t// See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)\n\t// See: <PostSavedState /> (`forceIsDirty` prop)\n\t// See: <PostPublishButton /> (`forceIsDirty` prop)\n\t// See: https://github.com/WordPress/gutenberg/pull/4184.\n\n\treturn (\n\t\t!! getEditedPostAttribute( state, 'title' ) ||\n\t\t!! getEditedPostAttribute( state, 'excerpt' ) ||\n\t\t! isEditedPostEmpty( state ) ||\n\t\tPlatform.OS === 'native'\n\t);\n}\n\n/**\n * Returns true if the edited post has content. A post has content if it has at\n * least one saveable block or otherwise has a non-empty content property\n * assigned.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post has content.\n */\nexport function isEditedPostEmpty( state ) {\n\t// While the condition of truthy content string is sufficient to determine\n\t// emptiness, testing saveable blocks length is a trivial operation. Since\n\t// this function can be called frequently, optimize for the fast case as a\n\t// condition of the mere existence of blocks. Note that the value of edited\n\t// content takes precedent over block content, and must fall through to the\n\t// default logic.\n\tconst blocks = getEditorBlocks( state );\n\n\tif ( blocks.length ) {\n\t\t// Pierce the abstraction of the serializer in knowing that blocks are\n\t\t// joined with with newlines such that even if every individual block\n\t\t// produces an empty save result, the serialized content is non-empty.\n\t\tif ( blocks.length > 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// There are two conditions under which the optimization cannot be\n\t\t// assumed, and a fallthrough to getEditedPostContent must occur:\n\t\t//\n\t\t// 1. getBlocksForSerialization has special treatment in omitting a\n\t\t// single unmodified default block.\n\t\t// 2. Comment delimiters are omitted for a freeform or unregistered\n\t\t// block in its serialization. The freeform block specifically may\n\t\t// produce an empty string in its saved output.\n\t\t//\n\t\t// For all other content, the single block is assumed to make a post\n\t\t// non-empty, if only by virtue of its own comment delimiters.\n\t\tconst blockName = blocks[ 0 ].name;\n\t\tif (\n\t\t\tblockName !== getDefaultBlockName() &&\n\t\t\tblockName !== getFreeformContentHandlerName()\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn ! getEditedPostContent( state );\n}\n\n/**\n * Returns true if the post can be autosaved, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {Object} autosave A raw autosave object from the REST API.\n *\n * @return {boolean} Whether the post can be autosaved.\n */\nexport const isEditedPostAutosaveable = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\t// A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.\n\t\tif ( ! isEditedPostSaveable( state ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// A post is not autosavable when there is a post autosave lock.\n\t\tif ( isPostAutosavingLocked( state ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst hasFetchedAutosave = select( coreStore ).hasFetchedAutosaves(\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tconst currentUserId = get( select( coreStore ).getCurrentUser(), [\n\t\t\t'id',\n\t\t] );\n\n\t\t// Disable reason - this line causes the side-effect of fetching the autosave\n\t\t// via a resolver, moving below the return would result in the autosave never\n\t\t// being fetched.\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst autosave = select( coreStore ).getAutosave(\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\tcurrentUserId\n\t\t);\n\n\t\t// If any existing autosaves have not yet been fetched, this function is\n\t\t// unable to determine if the post is autosaveable, so return false.\n\t\tif ( ! hasFetchedAutosave ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we don't already have an autosave, the post is autosaveable.\n\t\tif ( ! autosave ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// To avoid an expensive content serialization, use the content dirtiness\n\t\t// flag in place of content field comparison against the known autosave.\n\t\t// This is not strictly accurate, and relies on a tolerance toward autosave\n\t\t// request failures for unnecessary saves.\n\t\tif ( hasChangedContent( state ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If the title or excerpt has changed, the post is autosaveable.\n\t\treturn [ 'title', 'excerpt' ].some(\n\t\t\t( field ) =>\n\t\t\t\tgetPostRawValue( autosave[ field ] ) !==\n\t\t\t\tgetEditedPostAttribute( state, field )\n\t\t);\n\t}\n);\n\n/**\n * Return true if the post being edited is being scheduled. Preferring the\n * unsaved status values.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post has been published.\n */\nexport function isEditedPostBeingScheduled( state ) {\n\tconst date = getEditedPostAttribute( state, 'date' );\n\t// Offset the date by one minute (network latency).\n\tconst checkedDate = new Date(\n\t\tNumber( getDate( date ) ) - ONE_MINUTE_IN_MS\n\t);\n\n\treturn isInTheFuture( checkedDate );\n}\n\n/**\n * Returns whether the current post should be considered to have a \"floating\"\n * date (i.e. that it would publish \"Immediately\" rather than at a set time).\n *\n * Unlike in the PHP backend, the REST API returns a full date string for posts\n * where the 0000-00-00T00:00:00 placeholder is present in the database. To\n * infer that a post is set to publish \"Immediately\" we check whether the date\n * and modified date are the same.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the edited post has a floating date value.\n */\nexport function isEditedPostDateFloating( state ) {\n\tconst date = getEditedPostAttribute( state, 'date' );\n\tconst modified = getEditedPostAttribute( state, 'modified' );\n\n\t// This should be the status of the persisted post\n\t// It shouldn't use the \"edited\" status otherwise it breaks the\n\t// inferred post data floating status\n\t// See https://github.com/WordPress/gutenberg/issues/28083.\n\tconst status = getCurrentPost( state ).status;\n\tif (\n\t\tstatus === 'draft' ||\n\t\tstatus === 'auto-draft' ||\n\t\tstatus === 'pending'\n\t) {\n\t\treturn date === modified || date === null;\n\t}\n\treturn false;\n}\n\n/**\n * Returns true if the post is currently being saved, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post is being saved.\n */\nexport const isSavingPost = createRegistrySelector( ( select ) => ( state ) => {\n\tconst postType = getCurrentPostType( state );\n\tconst postId = getCurrentPostId( state );\n\treturn select( coreStore ).isSavingEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n} );\n\n/**\n * Returns true if non-post entities are currently being saved, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether non-post entities are being saved.\n */\nexport const isSavingNonPostEntityChanges = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst entitiesBeingSaved = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetEntitiesBeingSaved();\n\t\tconst { type, id } = getCurrentPost( state );\n\t\treturn some(\n\t\t\tentitiesBeingSaved,\n\t\t\t( entityRecord ) =>\n\t\t\t\tentityRecord.kind !== 'postType' ||\n\t\t\t\tentityRecord.name !== type ||\n\t\t\t\tentityRecord.key !== id\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a previous post save was attempted successfully, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post was saved successfully.\n */\nexport const didPostSaveRequestSucceed = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\treturn ! select( coreStore ).getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a previous post save was attempted but failed, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post save failed.\n */\nexport const didPostSaveRequestFail = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\treturn !! select( coreStore ).getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the post is autosaving, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is autosaving.\n */\nexport function isAutosavingPost( state ) {\n\tif ( ! isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\treturn !! get( state.saving, [ 'options', 'isAutosave' ] );\n}\n\n/**\n * Returns true if the post is being previewed, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is being previewed.\n */\nexport function isPreviewingPost( state ) {\n\tif ( ! isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\treturn !! get( state.saving, [ 'options', 'isPreview' ] );\n}\n\n/**\n * Returns the post preview link\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Preview Link.\n */\nexport function getEditedPostPreviewLink( state ) {\n\tif ( state.saving.pending || isSavingPost( state ) ) {\n\t\treturn;\n\t}\n\n\tlet previewLink = getAutosaveAttribute( state, 'preview_link' );\n\t// Fix for issue: https://github.com/WordPress/gutenberg/issues/33616\n\t// If the post is draft, ignore the preview link from the autosave record,\n\t// because the preview could be a stale autosave if the post was switched from\n\t// published to draft.\n\t// See: https://github.com/WordPress/gutenberg/pull/37952.\n\tif ( ! previewLink || 'draft' === getCurrentPost( state ).status ) {\n\t\tpreviewLink = getEditedPostAttribute( state, 'link' );\n\t\tif ( previewLink ) {\n\t\t\tpreviewLink = addQueryArgs( previewLink, { preview: true } );\n\t\t}\n\t}\n\tconst featuredImageId = getEditedPostAttribute( state, 'featured_media' );\n\n\tif ( previewLink && featuredImageId ) {\n\t\treturn addQueryArgs( previewLink, { _thumbnail_id: featuredImageId } );\n\t}\n\n\treturn previewLink;\n}\n\n/**\n * Returns a suggested post format for the current post, inferred only if there\n * is a single block within the post and it is of a type known to match a\n * default post format. Returns null if the format cannot be determined.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Suggested post format.\n */\nexport function getSuggestedPostFormat( state ) {\n\tconst blocks = getEditorBlocks( state );\n\n\tif ( blocks.length > 2 ) return null;\n\n\tlet name;\n\t// If there is only one block in the content of the post grab its name\n\t// so we can derive a suitable post format from it.\n\tif ( blocks.length === 1 ) {\n\t\tname = blocks[ 0 ].name;\n\t\t// Check for core/embed `video` and `audio` eligible suggestions.\n\t\tif ( name === 'core/embed' ) {\n\t\t\tconst provider = blocks[ 0 ].attributes?.providerNameSlug;\n\t\t\tif ( [ 'youtube', 'vimeo' ].includes( provider ) ) {\n\t\t\t\tname = 'core/video';\n\t\t\t} else if ( [ 'spotify', 'soundcloud' ].includes( provider ) ) {\n\t\t\t\tname = 'core/audio';\n\t\t\t}\n\t\t}\n\t}\n\n\t// If there are two blocks in the content and the last one is a text blocks\n\t// grab the name of the first one to also suggest a post format from it.\n\tif ( blocks.length === 2 && blocks[ 1 ].name === 'core/paragraph' ) {\n\t\tname = blocks[ 0 ].name;\n\t}\n\n\t// We only convert to default post formats in core.\n\tswitch ( name ) {\n\t\tcase 'core/image':\n\t\t\treturn 'image';\n\t\tcase 'core/quote':\n\t\tcase 'core/pullquote':\n\t\t\treturn 'quote';\n\t\tcase 'core/gallery':\n\t\t\treturn 'gallery';\n\t\tcase 'core/video':\n\t\t\treturn 'video';\n\t\tcase 'core/audio':\n\t\t\treturn 'audio';\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\n/**\n * Returns the content of the post being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post content.\n */\nexport const getEditedPostContent = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst record = select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( record ) {\n\t\t\tif ( typeof record.content === 'function' ) {\n\t\t\t\treturn record.content( record );\n\t\t\t} else if ( record.blocks ) {\n\t\t\t\treturn __unstableSerializeAndClean( record.blocks );\n\t\t\t} else if ( record.content ) {\n\t\t\t\treturn record.content;\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}\n);\n\n/**\n * Returns true if the post is being published, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post is being published.\n */\nexport function isPublishingPost( state ) {\n\treturn (\n\t\tisSavingPost( state ) &&\n\t\t! isCurrentPostPublished( state ) &&\n\t\tgetEditedPostAttribute( state, 'status' ) === 'publish'\n\t);\n}\n\n/**\n * Returns whether the permalink is editable or not.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether or not the permalink is editable.\n */\nexport function isPermalinkEditable( state ) {\n\tconst permalinkTemplate = getEditedPostAttribute(\n\t\tstate,\n\t\t'permalink_template'\n\t);\n\n\treturn PERMALINK_POSTNAME_REGEX.test( permalinkTemplate );\n}\n\n/**\n * Returns the permalink for the post.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} The permalink, or null if the post is not viewable.\n */\nexport function getPermalink( state ) {\n\tconst permalinkParts = getPermalinkParts( state );\n\tif ( ! permalinkParts ) {\n\t\treturn null;\n\t}\n\n\tconst { prefix, postName, suffix } = permalinkParts;\n\n\tif ( isPermalinkEditable( state ) ) {\n\t\treturn prefix + postName + suffix;\n\t}\n\n\treturn prefix;\n}\n\n/**\n * Returns the slug for the post being edited, preferring a manually edited\n * value if one exists, then a sanitized version of the current post title, and\n * finally the post ID.\n *\n * @param {Object} state Editor state.\n *\n * @return {string} The current slug to be displayed in the editor\n */\nexport function getEditedPostSlug( state ) {\n\treturn (\n\t\tgetEditedPostAttribute( state, 'slug' ) ||\n\t\tcleanForSlug( getEditedPostAttribute( state, 'title' ) ) ||\n\t\tgetCurrentPostId( state )\n\t);\n}\n\n/**\n * Returns the permalink for a post, split into it's three parts: the prefix,\n * the postName, and the suffix.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} An object containing the prefix, postName, and suffix for\n * the permalink, or null if the post is not viewable.\n */\nexport function getPermalinkParts( state ) {\n\tconst permalinkTemplate = getEditedPostAttribute(\n\t\tstate,\n\t\t'permalink_template'\n\t);\n\tif ( ! permalinkTemplate ) {\n\t\treturn null;\n\t}\n\n\tconst postName =\n\t\tgetEditedPostAttribute( state, 'slug' ) ||\n\t\tgetEditedPostAttribute( state, 'generated_slug' );\n\n\tconst [ prefix, suffix ] = permalinkTemplate.split(\n\t\tPERMALINK_POSTNAME_REGEX\n\t);\n\n\treturn {\n\t\tprefix,\n\t\tpostName,\n\t\tsuffix,\n\t};\n}\n\n/**\n * Returns whether the post is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostLocked( state ) {\n\treturn state.postLock.isLocked;\n}\n\n/**\n * Returns whether post saving is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostSavingLocked( state ) {\n\treturn Object.keys( state.postSavingLock ).length > 0;\n}\n\n/**\n * Returns whether post autosaving is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostAutosavingLocked( state ) {\n\treturn Object.keys( state.postAutosavingLock ).length > 0;\n}\n\n/**\n * Returns whether the edition of the post has been taken over.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is post lock takeover.\n */\nexport function isPostLockTakeover( state ) {\n\treturn state.postLock.isTakeover;\n}\n\n/**\n * Returns details about the post lock user.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} A user object.\n */\nexport function getPostLockUser( state ) {\n\treturn state.postLock.user;\n}\n\n/**\n * Returns the active post lock.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The lock object.\n */\nexport function getActivePostLock( state ) {\n\treturn state.postLock.activePostLock;\n}\n\n/**\n * Returns whether or not the user has the unfiltered_html capability.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the user can or can't post unfiltered HTML.\n */\nexport function canUserUseUnfilteredHTML( state ) {\n\treturn has( getCurrentPost( state ), [\n\t\t'_links',\n\t\t'wp:action-unfiltered-html',\n\t] );\n}\n\n/**\n * Returns whether the pre-publish panel should be shown\n * or skipped when the user clicks the \"publish\" button.\n *\n * @return {boolean} Whether the pre-publish panel should be shown or not.\n */\nexport const isPublishSidebarEnabled = createRegistrySelector(\n\t( select ) => () =>\n\t\t!! select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'isPublishSidebarEnabled'\n\t\t)\n);\n\n/**\n * Return the current block list.\n *\n * @param {Object} state\n * @return {Array} Block list.\n */\nexport function getEditorBlocks( state ) {\n\treturn getEditedPostAttribute( state, 'blocks' ) || EMPTY_ARRAY;\n}\n\n/**\n * A block selection object.\n *\n * @typedef {Object} WPBlockSelection\n *\n * @property {string} clientId A block client ID.\n * @property {string} attributeKey A block attribute key.\n * @property {number} offset An attribute value offset, based on the rich\n * text value. See `wp.richText.create`.\n */\n\n/**\n * Returns the current selection start.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection start.\n *\n * @deprecated since Gutenberg 10.0.0.\n */\nexport function getEditorSelectionStart( state ) {\n\tdeprecated( \"select('core/editor').getEditorSelectionStart\", {\n\t\tsince: '5.8',\n\t\talternative: \"select('core/editor').getEditorSelection\",\n\t} );\n\treturn getEditedPostAttribute( state, 'selection' )?.selectionStart;\n}\n\n/**\n * Returns the current selection end.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection end.\n *\n * @deprecated since Gutenberg 10.0.0.\n */\nexport function getEditorSelectionEnd( state ) {\n\tdeprecated( \"select('core/editor').getEditorSelectionStart\", {\n\t\tsince: '5.8',\n\t\talternative: \"select('core/editor').getEditorSelection\",\n\t} );\n\treturn getEditedPostAttribute( state, 'selection' )?.selectionEnd;\n}\n\n/**\n * Returns the current selection.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection end.\n */\nexport function getEditorSelection( state ) {\n\treturn getEditedPostAttribute( state, 'selection' );\n}\n\n/**\n * Is the editor ready\n *\n * @param {Object} state\n * @return {boolean} is Ready.\n */\nexport function __unstableIsEditorReady( state ) {\n\treturn state.isReady;\n}\n\n/**\n * Returns the post editor settings.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} The editor settings object.\n */\nexport function getEditorSettings( state ) {\n\treturn state.editorSettings;\n}\n\n/*\n * Backward compatibility\n */\n\n/**\n * Returns state object prior to a specified optimist transaction ID, or `null`\n * if the transaction corresponding to the given ID cannot be found.\n *\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function getStateBeforeOptimisticTransaction() {\n\tdeprecated( \"select('core/editor').getStateBeforeOptimisticTransaction\", {\n\t\tsince: '5.7',\n\t\thint: 'No state history is kept on this store anymore',\n\t} );\n\n\treturn null;\n}\n/**\n * Returns true if an optimistic transaction is pending commit, for which the\n * before state satisfies the given predicate function.\n *\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function inSomeHistory() {\n\tdeprecated( \"select('core/editor').inSomeHistory\", {\n\t\tsince: '5.7',\n\t\thint: 'No state history is kept on this store anymore',\n\t} );\n\treturn false;\n}\n\nfunction getBlockEditorSelector( name ) {\n\treturn createRegistrySelector( ( select ) => ( state, ...args ) => {\n\t\tdeprecated( \"`wp.data.select( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative: \"`wp.data.select( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn select( blockEditorStore )[ name ]( ...args );\n\t} );\n}\n\n/**\n * @see getBlockName in core/block-editor store.\n */\nexport const getBlockName = getBlockEditorSelector( 'getBlockName' );\n\n/**\n * @see isBlockValid in core/block-editor store.\n */\nexport const isBlockValid = getBlockEditorSelector( 'isBlockValid' );\n\n/**\n * @see getBlockAttributes in core/block-editor store.\n */\nexport const getBlockAttributes = getBlockEditorSelector(\n\t'getBlockAttributes'\n);\n\n/**\n * @see getBlock in core/block-editor store.\n */\nexport const getBlock = getBlockEditorSelector( 'getBlock' );\n\n/**\n * @see getBlocks in core/block-editor store.\n */\nexport const getBlocks = getBlockEditorSelector( 'getBlocks' );\n\n/**\n * @see getClientIdsOfDescendants in core/block-editor store.\n */\nexport const getClientIdsOfDescendants = getBlockEditorSelector(\n\t'getClientIdsOfDescendants'\n);\n\n/**\n * @see getClientIdsWithDescendants in core/block-editor store.\n */\nexport const getClientIdsWithDescendants = getBlockEditorSelector(\n\t'getClientIdsWithDescendants'\n);\n\n/**\n * @see getGlobalBlockCount in core/block-editor store.\n */\nexport const getGlobalBlockCount = getBlockEditorSelector(\n\t'getGlobalBlockCount'\n);\n\n/**\n * @see getBlocksByClientId in core/block-editor store.\n */\nexport const getBlocksByClientId = getBlockEditorSelector(\n\t'getBlocksByClientId'\n);\n\n/**\n * @see getBlockCount in core/block-editor store.\n */\nexport const getBlockCount = getBlockEditorSelector( 'getBlockCount' );\n\n/**\n * @see getBlockSelectionStart in core/block-editor store.\n */\nexport const getBlockSelectionStart = getBlockEditorSelector(\n\t'getBlockSelectionStart'\n);\n\n/**\n * @see getBlockSelectionEnd in core/block-editor store.\n */\nexport const getBlockSelectionEnd = getBlockEditorSelector(\n\t'getBlockSelectionEnd'\n);\n\n/**\n * @see getSelectedBlockCount in core/block-editor store.\n */\nexport const getSelectedBlockCount = getBlockEditorSelector(\n\t'getSelectedBlockCount'\n);\n\n/**\n * @see hasSelectedBlock in core/block-editor store.\n */\nexport const hasSelectedBlock = getBlockEditorSelector( 'hasSelectedBlock' );\n\n/**\n * @see getSelectedBlockClientId in core/block-editor store.\n */\nexport const getSelectedBlockClientId = getBlockEditorSelector(\n\t'getSelectedBlockClientId'\n);\n\n/**\n * @see getSelectedBlock in core/block-editor store.\n */\nexport const getSelectedBlock = getBlockEditorSelector( 'getSelectedBlock' );\n\n/**\n * @see getBlockRootClientId in core/block-editor store.\n */\nexport const getBlockRootClientId = getBlockEditorSelector(\n\t'getBlockRootClientId'\n);\n\n/**\n * @see getBlockHierarchyRootClientId in core/block-editor store.\n */\nexport const getBlockHierarchyRootClientId = getBlockEditorSelector(\n\t'getBlockHierarchyRootClientId'\n);\n\n/**\n * @see getAdjacentBlockClientId in core/block-editor store.\n */\nexport const getAdjacentBlockClientId = getBlockEditorSelector(\n\t'getAdjacentBlockClientId'\n);\n\n/**\n * @see getPreviousBlockClientId in core/block-editor store.\n */\nexport const getPreviousBlockClientId = getBlockEditorSelector(\n\t'getPreviousBlockClientId'\n);\n\n/**\n * @see getNextBlockClientId in core/block-editor store.\n */\nexport const getNextBlockClientId = getBlockEditorSelector(\n\t'getNextBlockClientId'\n);\n\n/**\n * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.\n */\nexport const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector(\n\t'getSelectedBlocksInitialCaretPosition'\n);\n\n/**\n * @see getMultiSelectedBlockClientIds in core/block-editor store.\n */\nexport const getMultiSelectedBlockClientIds = getBlockEditorSelector(\n\t'getMultiSelectedBlockClientIds'\n);\n\n/**\n * @see getMultiSelectedBlocks in core/block-editor store.\n */\nexport const getMultiSelectedBlocks = getBlockEditorSelector(\n\t'getMultiSelectedBlocks'\n);\n\n/**\n * @see getFirstMultiSelectedBlockClientId in core/block-editor store.\n */\nexport const getFirstMultiSelectedBlockClientId = getBlockEditorSelector(\n\t'getFirstMultiSelectedBlockClientId'\n);\n\n/**\n * @see getLastMultiSelectedBlockClientId in core/block-editor store.\n */\nexport const getLastMultiSelectedBlockClientId = getBlockEditorSelector(\n\t'getLastMultiSelectedBlockClientId'\n);\n\n/**\n * @see isFirstMultiSelectedBlock in core/block-editor store.\n */\nexport const isFirstMultiSelectedBlock = getBlockEditorSelector(\n\t'isFirstMultiSelectedBlock'\n);\n\n/**\n * @see isBlockMultiSelected in core/block-editor store.\n */\nexport const isBlockMultiSelected = getBlockEditorSelector(\n\t'isBlockMultiSelected'\n);\n\n/**\n * @see isAncestorMultiSelected in core/block-editor store.\n */\nexport const isAncestorMultiSelected = getBlockEditorSelector(\n\t'isAncestorMultiSelected'\n);\n\n/**\n * @see getMultiSelectedBlocksStartClientId in core/block-editor store.\n */\nexport const getMultiSelectedBlocksStartClientId = getBlockEditorSelector(\n\t'getMultiSelectedBlocksStartClientId'\n);\n\n/**\n * @see getMultiSelectedBlocksEndClientId in core/block-editor store.\n */\nexport const getMultiSelectedBlocksEndClientId = getBlockEditorSelector(\n\t'getMultiSelectedBlocksEndClientId'\n);\n\n/**\n * @see getBlockOrder in core/block-editor store.\n */\nexport const getBlockOrder = getBlockEditorSelector( 'getBlockOrder' );\n\n/**\n * @see getBlockIndex in core/block-editor store.\n */\nexport const getBlockIndex = getBlockEditorSelector( 'getBlockIndex' );\n\n/**\n * @see isBlockSelected in core/block-editor store.\n */\nexport const isBlockSelected = getBlockEditorSelector( 'isBlockSelected' );\n\n/**\n * @see hasSelectedInnerBlock in core/block-editor store.\n */\nexport const hasSelectedInnerBlock = getBlockEditorSelector(\n\t'hasSelectedInnerBlock'\n);\n\n/**\n * @see isBlockWithinSelection in core/block-editor store.\n */\nexport const isBlockWithinSelection = getBlockEditorSelector(\n\t'isBlockWithinSelection'\n);\n\n/**\n * @see hasMultiSelection in core/block-editor store.\n */\nexport const hasMultiSelection = getBlockEditorSelector( 'hasMultiSelection' );\n\n/**\n * @see isMultiSelecting in core/block-editor store.\n */\nexport const isMultiSelecting = getBlockEditorSelector( 'isMultiSelecting' );\n\n/**\n * @see isSelectionEnabled in core/block-editor store.\n */\nexport const isSelectionEnabled = getBlockEditorSelector(\n\t'isSelectionEnabled'\n);\n\n/**\n * @see getBlockMode in core/block-editor store.\n */\nexport const getBlockMode = getBlockEditorSelector( 'getBlockMode' );\n\n/**\n * @see isTyping in core/block-editor store.\n */\nexport const isTyping = getBlockEditorSelector( 'isTyping' );\n\n/**\n * @see isCaretWithinFormattedText in core/block-editor store.\n */\nexport const isCaretWithinFormattedText = getBlockEditorSelector(\n\t'isCaretWithinFormattedText'\n);\n\n/**\n * @see getBlockInsertionPoint in core/block-editor store.\n */\nexport const getBlockInsertionPoint = getBlockEditorSelector(\n\t'getBlockInsertionPoint'\n);\n\n/**\n * @see isBlockInsertionPointVisible in core/block-editor store.\n */\nexport const isBlockInsertionPointVisible = getBlockEditorSelector(\n\t'isBlockInsertionPointVisible'\n);\n\n/**\n * @see isValidTemplate in core/block-editor store.\n */\nexport const isValidTemplate = getBlockEditorSelector( 'isValidTemplate' );\n\n/**\n * @see getTemplate in core/block-editor store.\n */\nexport const getTemplate = getBlockEditorSelector( 'getTemplate' );\n\n/**\n * @see getTemplateLock in core/block-editor store.\n */\nexport const getTemplateLock = getBlockEditorSelector( 'getTemplateLock' );\n\n/**\n * @see canInsertBlockType in core/block-editor store.\n */\nexport const canInsertBlockType = getBlockEditorSelector(\n\t'canInsertBlockType'\n);\n\n/**\n * @see getInserterItems in core/block-editor store.\n */\nexport const getInserterItems = getBlockEditorSelector( 'getInserterItems' );\n\n/**\n * @see hasInserterItems in core/block-editor store.\n */\nexport const hasInserterItems = getBlockEditorSelector( 'hasInserterItems' );\n\n/**\n * @see getBlockListSettings in core/block-editor store.\n */\nexport const getBlockListSettings = getBlockEditorSelector(\n\t'getBlockListSettings'\n);\n\n/**\n * Returns the default template types.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The template types.\n */\nexport function __experimentalGetDefaultTemplateTypes( state ) {\n\treturn getEditorSettings( state )?.defaultTemplateTypes;\n}\n\n/**\n * Returns the default template part areas.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The template part areas.\n */\nexport const __experimentalGetDefaultTemplatePartAreas = createSelector(\n\t( state ) => {\n\t\tconst areas =\n\t\t\tgetEditorSettings( state )?.defaultTemplatePartAreas || [];\n\t\treturn areas?.map( ( item ) => {\n\t\t\treturn { ...item, icon: getTemplatePartIcon( item.icon ) };\n\t\t} );\n\t},\n\t( state ) => [ getEditorSettings( state )?.defaultTemplatePartAreas ]\n);\n\n/**\n * Returns a default template type searched by slug.\n *\n * @param {Object} state Global application state.\n * @param {string} slug The template type slug.\n *\n * @return {Object} The template type.\n */\nexport const __experimentalGetDefaultTemplateType = createSelector(\n\t( state, slug ) =>\n\t\tfind( __experimentalGetDefaultTemplateTypes( state ), { slug } ) || {},\n\t( state, slug ) => [ __experimentalGetDefaultTemplateTypes( state ), slug ]\n);\n\n/**\n * Given a template entity, return information about it which is ready to be\n * rendered, such as the title, description, and icon.\n *\n * @param {Object} state Global application state.\n * @param {Object} template The template for which we need information.\n * @return {Object} Information about the template, including title, description, and icon.\n */\nexport function __experimentalGetTemplateInfo( state, template ) {\n\tif ( ! template ) {\n\t\treturn {};\n\t}\n\n\tconst { description, slug, title, area } = template;\n\tconst {\n\t\ttitle: defaultTitle,\n\t\tdescription: defaultDescription,\n\t} = __experimentalGetDefaultTemplateType( state, slug );\n\n\tconst templateTitle = isString( title ) ? title : title?.rendered;\n\tconst templateDescription = isString( description )\n\t\t? description\n\t\t: description?.raw;\n\tconst templateIcon =\n\t\t__experimentalGetDefaultTemplatePartAreas( state ).find(\n\t\t\t( item ) => area === item.area\n\t\t)?.icon || layout;\n\n\treturn {\n\t\ttitle:\n\t\t\ttemplateTitle && templateTitle !== slug\n\t\t\t\t? templateTitle\n\t\t\t\t: defaultTitle || slug,\n\t\tdescription: templateDescription || defaultDescription,\n\t\ticon: templateIcon,\n\t};\n}\n\n/**\n * Returns a post type label depending on the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {string|undefined} The post type label if available, otherwise undefined.\n */\nexport const getPostTypeLabel = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst currentPostType = getCurrentPostType( state );\n\t\tconst postType = select( coreStore ).getPostType( currentPostType );\n\t\t// Disable reason: Post type labels object is shaped like this.\n\t\t// eslint-disable-next-line camelcase\n\t\treturn postType?.labels?.singular_name;\n\t}\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/selectors.js"],"names":["EMPTY_OBJECT","EMPTY_ARRAY","hasEditorUndo","select","coreStore","hasUndo","hasEditorRedo","hasRedo","isEditedPostNew","state","getCurrentPost","status","hasChangedContent","edits","getPostEdits","isEditedPostDirty","postType","getCurrentPostType","postId","getCurrentPostId","hasEditsForEntityRecord","hasNonPostEntityChanges","dirtyEntityRecords","__experimentalGetDirtyEntityRecords","type","id","entityRecord","kind","name","key","isCleanNewPost","post","getRawEntityRecord","getCurrentPostRevisionsCount","getCurrentPostLastRevisionId","getEntityRecordEdits","getCurrentPostAttribute","attributeName","hasOwnProperty","getNestedEditedPostProperty","getEditedPostAttribute","getEditedPostContent","EDIT_MERGE_PROPERTIES","has","getAutosaveAttribute","AUTOSAVE_PROPERTIES","currentUserId","getCurrentUser","autosave","getAutosave","getEditedPostVisibility","password","isCurrentPostPending","isCurrentPostPublished","currentPost","indexOf","Date","Number","date","ONE_MINUTE_IN_MS","isCurrentPostScheduled","isEditedPostPublishable","isEditedPostSaveable","isSavingPost","isEditedPostEmpty","Platform","OS","blocks","getEditorBlocks","length","blockName","isEditedPostAutosaveable","isPostAutosavingLocked","hasFetchedAutosave","hasFetchedAutosaves","some","field","isEditedPostBeingScheduled","checkedDate","isEditedPostDateFloating","modified","isSavingEntityRecord","isSavingNonPostEntityChanges","entitiesBeingSaved","__experimentalGetEntitiesBeingSaved","didPostSaveRequestSucceed","getLastEntitySaveError","didPostSaveRequestFail","isAutosavingPost","saving","isPreviewingPost","getEditedPostPreviewLink","pending","previewLink","preview","featuredImageId","_thumbnail_id","getSuggestedPostFormat","provider","attributes","providerNameSlug","includes","record","getEditedEntityRecord","content","isPublishingPost","isPermalinkEditable","permalinkTemplate","PERMALINK_POSTNAME_REGEX","test","getPermalink","permalinkParts","getPermalinkParts","prefix","postName","suffix","getEditedPostSlug","split","isPostLocked","postLock","isLocked","isPostSavingLocked","Object","keys","postSavingLock","postAutosavingLock","isPostLockTakeover","isTakeover","getPostLockUser","user","getActivePostLock","activePostLock","canUserUseUnfilteredHTML","isPublishSidebarEnabled","preferencesStore","get","getEditorSelectionStart","since","alternative","selectionStart","getEditorSelectionEnd","selectionEnd","getEditorSelection","__unstableIsEditorReady","isReady","getEditorSettings","editorSettings","getStateBeforeOptimisticTransaction","hint","inSomeHistory","getBlockEditorSelector","version","args","blockEditorStore","getBlockName","isBlockValid","getBlockAttributes","getBlock","getBlocks","getClientIdsOfDescendants","getClientIdsWithDescendants","getGlobalBlockCount","getBlocksByClientId","getBlockCount","getBlockSelectionStart","getBlockSelectionEnd","getSelectedBlockCount","hasSelectedBlock","getSelectedBlockClientId","getSelectedBlock","getBlockRootClientId","getBlockHierarchyRootClientId","getAdjacentBlockClientId","getPreviousBlockClientId","getNextBlockClientId","getSelectedBlocksInitialCaretPosition","getMultiSelectedBlockClientIds","getMultiSelectedBlocks","getFirstMultiSelectedBlockClientId","getLastMultiSelectedBlockClientId","isFirstMultiSelectedBlock","isBlockMultiSelected","isAncestorMultiSelected","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getBlockOrder","getBlockIndex","isBlockSelected","hasSelectedInnerBlock","isBlockWithinSelection","hasMultiSelection","isMultiSelecting","isSelectionEnabled","getBlockMode","isTyping","isCaretWithinFormattedText","getBlockInsertionPoint","isBlockInsertionPointVisible","isValidTemplate","getTemplate","getTemplateLock","canInsertBlockType","getInserterItems","hasInserterItems","getBlockListSettings","__experimentalGetDefaultTemplateTypes","defaultTemplateTypes","__experimentalGetDefaultTemplatePartAreas","areas","defaultTemplatePartAreas","map","item","icon","__experimentalGetDefaultTemplateType","slug","__experimentalGetTemplateInfo","template","description","title","area","defaultTitle","defaultDescription","templateTitle","rendered","templateDescription","raw","templateIcon","find","layout","getPostTypeLabel","currentPostType","getPostType","labels","singular_name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAMA;;AACA;;AAlCA;AACA;AACA;;AAIA;AACA;AACA;;AAgBA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,EAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,aAAa,GAAG,kCAA0BC,MAAF,IAAc,MAAM;AACxE,SAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,OAApB,EAAP;AACA,CAF4B,CAAtB;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,aAAa,GAAG,kCAA0BH,MAAF,IAAc,MAAM;AACxE,SAAOA,MAAM,CAAEC,eAAF,CAAN,CAAoBG,OAApB,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,CAAEQ,GAFhB;AAGA,QAAMC,YAAY,GACjB,yBAAAnB,yCAAyC,CAAEtM,KAAF,CAAzC,CAAmD0N,IAAnD,CACGhB,IAAF,IAAYQ,IAAI,KAAKR,IAAI,CAACQ,IAD3B,+EAEGP,IAFH,KAEWgB,aAHZ;AAKA,SAAO;AACNV,IAAAA,KAAK,EACJI,aAAa,IAAIA,aAAa,KAAKR,IAAnC,GACGQ,aADH,GAEGF,YAAY,IAAIN,IAJd;AAKNG,IAAAA,WAAW,EAAEO,mBAAmB,IAAIH,kBAL9B;AAMNT,IAAAA,IAAI,EAAEc;AANA,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMG,gBAAgB,GAAG,kCAC7BlO,MAAF,IAAgBM,KAAF,IAAa;AAAA;;AAC1B,QAAM6N,eAAe,GAAGrN,kBAAkB,CAAER,KAAF,CAA1C;AACA,QAAMO,QAAQ,GAAGb,MAAM,CAAEC,eAAF,CAAN,CAAoBmO,WAApB,CAAiCD,eAAjC,CAAjB,CAF0B,CAG1B;AACA;;AACA,SAAOtN,QAAP,aAAOA,QAAP,2CAAOA,QAAQ,CAAEwN,MAAjB,qDAAO,iBAAkBC,aAAzB;AACA,CAP8B,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport { find, get, has, isString, includes, some } from 'lodash';\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetFreeformContentHandlerName,\n\tgetDefaultBlockName,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { isInTheFuture, getDate } from '@wordpress/date';\nimport { addQueryArgs, cleanForSlug } from '@wordpress/url';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { layout } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tEDIT_MERGE_PROPERTIES,\n\tPERMALINK_POSTNAME_REGEX,\n\tONE_MINUTE_IN_MS,\n\tAUTOSAVE_PROPERTIES,\n} from './constants';\nimport { getPostRawValue } from './reducer';\nimport { getTemplatePartIcon } from '../utils/get-template-part-icon';\n\n/**\n * Shared reference to an empty object for cases where it is important to avoid\n * returning a new object reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n */\nconst EMPTY_OBJECT = {};\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Returns true if any past editor history snapshots exist, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether undo history exists.\n */\nexport const hasEditorUndo = createRegistrySelector( ( select ) => () => {\n\treturn select( coreStore ).hasUndo();\n} );\n\n/**\n * Returns true if any future editor history snapshots exist, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether redo history exists.\n */\nexport const hasEditorRedo = createRegistrySelector( ( select ) => () => {\n\treturn select( coreStore ).hasRedo();\n} );\n\n/**\n * Returns true if the currently edited post is yet to be saved, or false if\n * the post has been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is new.\n */\nexport function isEditedPostNew( state ) {\n\treturn getCurrentPost( state ).status === 'auto-draft';\n}\n\n/**\n * Returns true if content includes unsaved changes, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether content includes unsaved changes.\n */\nexport function hasChangedContent( state ) {\n\tconst edits = getPostEdits( state );\n\n\treturn (\n\t\t'blocks' in edits ||\n\t\t// `edits` is intended to contain only values which are different from\n\t\t// the saved post, so the mere presence of a property is an indicator\n\t\t// that the value is different than what is known to be saved. While\n\t\t// content in Visual mode is represented by the blocks state, in Text\n\t\t// mode it is tracked by `edits.content`.\n\t\t'content' in edits\n\t);\n}\n\n/**\n * Returns true if there are unsaved values for the current edit session, or\n * false if the editing state matches the saved or new post.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether unsaved values exist.\n */\nexport const isEditedPostDirty = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\t// Edits should contain only fields which differ from the saved post (reset\n\t\t// at initial load and save complete). Thus, a non-empty edits state can be\n\t\t// inferred to contain unsaved values.\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tif (\n\t\t\tselect( coreStore ).hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n);\n\n/**\n * Returns true if there are unsaved edits for entities other than\n * the editor's post, and false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether there are edits or not.\n */\nexport const hasNonPostEntityChanges = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst dirtyEntityRecords =\n\t\t\tselect( coreStore ).__experimentalGetDirtyEntityRecords();\n\t\tconst { type, id } = getCurrentPost( state );\n\t\treturn some(\n\t\t\tdirtyEntityRecords,\n\t\t\t( entityRecord ) =>\n\t\t\t\tentityRecord.kind !== 'postType' ||\n\t\t\t\tentityRecord.name !== type ||\n\t\t\t\tentityRecord.key !== id\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there are no unsaved values for the current edit session and\n * if the currently edited post is new (has never been saved before).\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether new post and unsaved values exist.\n */\nexport function isCleanNewPost( state ) {\n\treturn ! isEditedPostDirty( state ) && isEditedPostNew( state );\n}\n\n/**\n * Returns the post currently being edited in its last known saved state, not\n * including unsaved edits. Returns an object containing relevant default post\n * values if the post has not yet been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Post object.\n */\nexport const getCurrentPost = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst postType = getCurrentPostType( state );\n\n\t\tconst post = select( coreStore ).getRawEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( post ) {\n\t\t\treturn post;\n\t\t}\n\n\t\t// This exists for compatibility with the previous selector behavior\n\t\t// which would guarantee an object return based on the editor reducer's\n\t\t// default empty object state.\n\t\treturn EMPTY_OBJECT;\n\t}\n);\n\n/**\n * Returns the post type of the post currently being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post type.\n */\nexport function getCurrentPostType( state ) {\n\treturn state.postType;\n}\n\n/**\n * Returns the ID of the post currently being edited, or null if the post has\n * not yet been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {?number} ID of current post.\n */\nexport function getCurrentPostId( state ) {\n\treturn state.postId;\n}\n\n/**\n * Returns the number of revisions of the post currently being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} Number of revisions.\n */\nexport function getCurrentPostRevisionsCount( state ) {\n\treturn get(\n\t\tgetCurrentPost( state ),\n\t\t[ '_links', 'version-history', 0, 'count' ],\n\t\t0\n\t);\n}\n\n/**\n * Returns the last revision ID of the post currently being edited,\n * or null if the post has no revisions.\n *\n * @param {Object} state Global application state.\n *\n * @return {?number} ID of the last revision.\n */\nexport function getCurrentPostLastRevisionId( state ) {\n\treturn get(\n\t\tgetCurrentPost( state ),\n\t\t[ '_links', 'predecessor-version', 0, 'id' ],\n\t\tnull\n\t);\n}\n\n/**\n * Returns any post values which have been changed in the editor but not yet\n * been saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object of key value pairs comprising unsaved edits.\n */\nexport const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {\n\tconst postType = getCurrentPostType( state );\n\tconst postId = getCurrentPostId( state );\n\treturn (\n\t\tselect( coreStore ).getEntityRecordEdits(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t) || EMPTY_OBJECT\n\t);\n} );\n\n/**\n * Returns an attribute value of the saved post.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nexport function getCurrentPostAttribute( state, attributeName ) {\n\tswitch ( attributeName ) {\n\t\tcase 'type':\n\t\t\treturn getCurrentPostType( state );\n\n\t\tcase 'id':\n\t\t\treturn getCurrentPostId( state );\n\n\t\tdefault:\n\t\t\tconst post = getCurrentPost( state );\n\t\t\tif ( ! post.hasOwnProperty( attributeName ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn getPostRawValue( post[ attributeName ] );\n\t}\n}\n\n/**\n * Returns a single attribute of the post being edited, preferring the unsaved\n * edit if one exists, but merging with the attribute value for the last known\n * saved state of the post (this is needed for some nested attributes like meta).\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nconst getNestedEditedPostProperty = ( state, attributeName ) => {\n\tconst edits = getPostEdits( state );\n\tif ( ! edits.hasOwnProperty( attributeName ) ) {\n\t\treturn getCurrentPostAttribute( state, attributeName );\n\t}\n\n\treturn {\n\t\t...getCurrentPostAttribute( state, attributeName ),\n\t\t...edits[ attributeName ],\n\t};\n};\n\n/**\n * Returns a single attribute of the post being edited, preferring the unsaved\n * edit if one exists, but falling back to the attribute for the last known\n * saved state of the post.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Post attribute name.\n *\n * @return {*} Post attribute value.\n */\nexport function getEditedPostAttribute( state, attributeName ) {\n\t// Special cases.\n\tswitch ( attributeName ) {\n\t\tcase 'content':\n\t\t\treturn getEditedPostContent( state );\n\t}\n\n\t// Fall back to saved post value if not edited.\n\tconst edits = getPostEdits( state );\n\tif ( ! edits.hasOwnProperty( attributeName ) ) {\n\t\treturn getCurrentPostAttribute( state, attributeName );\n\t}\n\n\t// Merge properties are objects which contain only the patch edit in state,\n\t// and thus must be merged with the current post attribute.\n\tif ( EDIT_MERGE_PROPERTIES.has( attributeName ) ) {\n\t\treturn getNestedEditedPostProperty( state, attributeName );\n\t}\n\n\treturn edits[ attributeName ];\n}\n\n/**\n * Returns an attribute value of the current autosave revision for a post, or\n * null if there is no autosave for the post.\n *\n * @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector\n * \t\t\t from the '@wordpress/core-data' package and access properties on the returned\n * \t\t\t autosave object using getPostRawValue.\n *\n * @param {Object} state Global application state.\n * @param {string} attributeName Autosave attribute name.\n *\n * @return {*} Autosave attribute value.\n */\nexport const getAutosaveAttribute = createRegistrySelector(\n\t( select ) => ( state, attributeName ) => {\n\t\tif (\n\t\t\t! includes( AUTOSAVE_PROPERTIES, attributeName ) &&\n\t\t\tattributeName !== 'preview_link'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst currentUserId = get( select( coreStore ).getCurrentUser(), [\n\t\t\t'id',\n\t\t] );\n\t\tconst autosave = select( coreStore ).getAutosave(\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\tcurrentUserId\n\t\t);\n\n\t\tif ( autosave ) {\n\t\t\treturn getPostRawValue( autosave[ attributeName ] );\n\t\t}\n\t}\n);\n\n/**\n * Returns the current visibility of the post being edited, preferring the\n * unsaved value if different than the saved post. The return value is one of\n * \"private\", \"password\", or \"public\".\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post visibility.\n */\nexport function getEditedPostVisibility( state ) {\n\tconst status = getEditedPostAttribute( state, 'status' );\n\tif ( status === 'private' ) {\n\t\treturn 'private';\n\t}\n\n\tconst password = getEditedPostAttribute( state, 'password' );\n\tif ( password ) {\n\t\treturn 'password';\n\t}\n\n\treturn 'public';\n}\n\n/**\n * Returns true if post is pending review.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether current post is pending review.\n */\nexport function isCurrentPostPending( state ) {\n\treturn getCurrentPost( state ).status === 'pending';\n}\n\n/**\n * Return true if the current post has already been published.\n *\n * @param {Object} state Global application state.\n * @param {Object?} currentPost Explicit current post for bypassing registry selector.\n *\n * @return {boolean} Whether the post has been published.\n */\nexport function isCurrentPostPublished( state, currentPost ) {\n\tconst post = currentPost || getCurrentPost( state );\n\n\treturn (\n\t\t[ 'publish', 'private' ].indexOf( post.status ) !== -1 ||\n\t\t( post.status === 'future' &&\n\t\t\t! isInTheFuture(\n\t\t\t\tnew Date( Number( getDate( post.date ) ) - ONE_MINUTE_IN_MS )\n\t\t\t) )\n\t);\n}\n\n/**\n * Returns true if post is already scheduled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether current post is scheduled to be posted.\n */\nexport function isCurrentPostScheduled( state ) {\n\treturn (\n\t\tgetCurrentPost( state ).status === 'future' &&\n\t\t! isCurrentPostPublished( state )\n\t);\n}\n\n/**\n * Return true if the post being edited can be published.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post can been published.\n */\nexport function isEditedPostPublishable( state ) {\n\tconst post = getCurrentPost( state );\n\n\t// TODO: Post being publishable should be superset of condition of post\n\t// being saveable. Currently this restriction is imposed at UI.\n\t//\n\t// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).\n\n\treturn (\n\t\tisEditedPostDirty( state ) ||\n\t\t[ 'publish', 'private', 'future' ].indexOf( post.status ) === -1\n\t);\n}\n\n/**\n * Returns true if the post can be saved, or false otherwise. A post must\n * contain a title, an excerpt, or non-empty content to be valid for save.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post can be saved.\n */\nexport function isEditedPostSaveable( state ) {\n\tif ( isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\n\t// TODO: Post should not be saveable if not dirty. Cannot be added here at\n\t// this time since posts where meta boxes are present can be saved even if\n\t// the post is not dirty. Currently this restriction is imposed at UI, but\n\t// should be moved here.\n\t//\n\t// See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)\n\t// See: <PostSavedState /> (`forceIsDirty` prop)\n\t// See: <PostPublishButton /> (`forceIsDirty` prop)\n\t// See: https://github.com/WordPress/gutenberg/pull/4184.\n\n\treturn (\n\t\t!! getEditedPostAttribute( state, 'title' ) ||\n\t\t!! getEditedPostAttribute( state, 'excerpt' ) ||\n\t\t! isEditedPostEmpty( state ) ||\n\t\tPlatform.OS === 'native'\n\t);\n}\n\n/**\n * Returns true if the edited post has content. A post has content if it has at\n * least one saveable block or otherwise has a non-empty content property\n * assigned.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post has content.\n */\nexport function isEditedPostEmpty( state ) {\n\t// While the condition of truthy content string is sufficient to determine\n\t// emptiness, testing saveable blocks length is a trivial operation. Since\n\t// this function can be called frequently, optimize for the fast case as a\n\t// condition of the mere existence of blocks. Note that the value of edited\n\t// content takes precedent over block content, and must fall through to the\n\t// default logic.\n\tconst blocks = getEditorBlocks( state );\n\n\tif ( blocks.length ) {\n\t\t// Pierce the abstraction of the serializer in knowing that blocks are\n\t\t// joined with with newlines such that even if every individual block\n\t\t// produces an empty save result, the serialized content is non-empty.\n\t\tif ( blocks.length > 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// There are two conditions under which the optimization cannot be\n\t\t// assumed, and a fallthrough to getEditedPostContent must occur:\n\t\t//\n\t\t// 1. getBlocksForSerialization has special treatment in omitting a\n\t\t// single unmodified default block.\n\t\t// 2. Comment delimiters are omitted for a freeform or unregistered\n\t\t// block in its serialization. The freeform block specifically may\n\t\t// produce an empty string in its saved output.\n\t\t//\n\t\t// For all other content, the single block is assumed to make a post\n\t\t// non-empty, if only by virtue of its own comment delimiters.\n\t\tconst blockName = blocks[ 0 ].name;\n\t\tif (\n\t\t\tblockName !== getDefaultBlockName() &&\n\t\t\tblockName !== getFreeformContentHandlerName()\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn ! getEditedPostContent( state );\n}\n\n/**\n * Returns true if the post can be autosaved, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {Object} autosave A raw autosave object from the REST API.\n *\n * @return {boolean} Whether the post can be autosaved.\n */\nexport const isEditedPostAutosaveable = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\t// A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.\n\t\tif ( ! isEditedPostSaveable( state ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// A post is not autosavable when there is a post autosave lock.\n\t\tif ( isPostAutosavingLocked( state ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst hasFetchedAutosave = select( coreStore ).hasFetchedAutosaves(\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tconst currentUserId = get( select( coreStore ).getCurrentUser(), [\n\t\t\t'id',\n\t\t] );\n\n\t\t// Disable reason - this line causes the side-effect of fetching the autosave\n\t\t// via a resolver, moving below the return would result in the autosave never\n\t\t// being fetched.\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst autosave = select( coreStore ).getAutosave(\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t\tcurrentUserId\n\t\t);\n\n\t\t// If any existing autosaves have not yet been fetched, this function is\n\t\t// unable to determine if the post is autosaveable, so return false.\n\t\tif ( ! hasFetchedAutosave ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we don't already have an autosave, the post is autosaveable.\n\t\tif ( ! autosave ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// To avoid an expensive content serialization, use the content dirtiness\n\t\t// flag in place of content field comparison against the known autosave.\n\t\t// This is not strictly accurate, and relies on a tolerance toward autosave\n\t\t// request failures for unnecessary saves.\n\t\tif ( hasChangedContent( state ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If the title or excerpt has changed, the post is autosaveable.\n\t\treturn [ 'title', 'excerpt' ].some(\n\t\t\t( field ) =>\n\t\t\t\tgetPostRawValue( autosave[ field ] ) !==\n\t\t\t\tgetEditedPostAttribute( state, field )\n\t\t);\n\t}\n);\n\n/**\n * Return true if the post being edited is being scheduled. Preferring the\n * unsaved status values.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post has been published.\n */\nexport function isEditedPostBeingScheduled( state ) {\n\tconst date = getEditedPostAttribute( state, 'date' );\n\t// Offset the date by one minute (network latency).\n\tconst checkedDate = new Date(\n\t\tNumber( getDate( date ) ) - ONE_MINUTE_IN_MS\n\t);\n\n\treturn isInTheFuture( checkedDate );\n}\n\n/**\n * Returns whether the current post should be considered to have a \"floating\"\n * date (i.e. that it would publish \"Immediately\" rather than at a set time).\n *\n * Unlike in the PHP backend, the REST API returns a full date string for posts\n * where the 0000-00-00T00:00:00 placeholder is present in the database. To\n * infer that a post is set to publish \"Immediately\" we check whether the date\n * and modified date are the same.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the edited post has a floating date value.\n */\nexport function isEditedPostDateFloating( state ) {\n\tconst date = getEditedPostAttribute( state, 'date' );\n\tconst modified = getEditedPostAttribute( state, 'modified' );\n\n\t// This should be the status of the persisted post\n\t// It shouldn't use the \"edited\" status otherwise it breaks the\n\t// inferred post data floating status\n\t// See https://github.com/WordPress/gutenberg/issues/28083.\n\tconst status = getCurrentPost( state ).status;\n\tif (\n\t\tstatus === 'draft' ||\n\t\tstatus === 'auto-draft' ||\n\t\tstatus === 'pending'\n\t) {\n\t\treturn date === modified || date === null;\n\t}\n\treturn false;\n}\n\n/**\n * Returns true if the post is currently being saved, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post is being saved.\n */\nexport const isSavingPost = createRegistrySelector( ( select ) => ( state ) => {\n\tconst postType = getCurrentPostType( state );\n\tconst postId = getCurrentPostId( state );\n\treturn select( coreStore ).isSavingEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n} );\n\n/**\n * Returns true if non-post entities are currently being saved, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether non-post entities are being saved.\n */\nexport const isSavingNonPostEntityChanges = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst entitiesBeingSaved =\n\t\t\tselect( coreStore ).__experimentalGetEntitiesBeingSaved();\n\t\tconst { type, id } = getCurrentPost( state );\n\t\treturn some(\n\t\t\tentitiesBeingSaved,\n\t\t\t( entityRecord ) =>\n\t\t\t\tentityRecord.kind !== 'postType' ||\n\t\t\t\tentityRecord.name !== type ||\n\t\t\t\tentityRecord.key !== id\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a previous post save was attempted successfully, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post was saved successfully.\n */\nexport const didPostSaveRequestSucceed = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\treturn ! select( coreStore ).getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a previous post save was attempted but failed, or false\n * otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post save failed.\n */\nexport const didPostSaveRequestFail = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst postId = getCurrentPostId( state );\n\t\treturn !! select( coreStore ).getLastEntitySaveError(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the post is autosaving, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is autosaving.\n */\nexport function isAutosavingPost( state ) {\n\tif ( ! isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\treturn !! get( state.saving, [ 'options', 'isAutosave' ] );\n}\n\n/**\n * Returns true if the post is being previewed, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the post is being previewed.\n */\nexport function isPreviewingPost( state ) {\n\tif ( ! isSavingPost( state ) ) {\n\t\treturn false;\n\t}\n\treturn !! get( state.saving, [ 'options', 'isPreview' ] );\n}\n\n/**\n * Returns the post preview link\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Preview Link.\n */\nexport function getEditedPostPreviewLink( state ) {\n\tif ( state.saving.pending || isSavingPost( state ) ) {\n\t\treturn;\n\t}\n\n\tlet previewLink = getAutosaveAttribute( state, 'preview_link' );\n\t// Fix for issue: https://github.com/WordPress/gutenberg/issues/33616\n\t// If the post is draft, ignore the preview link from the autosave record,\n\t// because the preview could be a stale autosave if the post was switched from\n\t// published to draft.\n\t// See: https://github.com/WordPress/gutenberg/pull/37952.\n\tif ( ! previewLink || 'draft' === getCurrentPost( state ).status ) {\n\t\tpreviewLink = getEditedPostAttribute( state, 'link' );\n\t\tif ( previewLink ) {\n\t\t\tpreviewLink = addQueryArgs( previewLink, { preview: true } );\n\t\t}\n\t}\n\tconst featuredImageId = getEditedPostAttribute( state, 'featured_media' );\n\n\tif ( previewLink && featuredImageId ) {\n\t\treturn addQueryArgs( previewLink, { _thumbnail_id: featuredImageId } );\n\t}\n\n\treturn previewLink;\n}\n\n/**\n * Returns a suggested post format for the current post, inferred only if there\n * is a single block within the post and it is of a type known to match a\n * default post format. Returns null if the format cannot be determined.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Suggested post format.\n */\nexport function getSuggestedPostFormat( state ) {\n\tconst blocks = getEditorBlocks( state );\n\n\tif ( blocks.length > 2 ) return null;\n\n\tlet name;\n\t// If there is only one block in the content of the post grab its name\n\t// so we can derive a suitable post format from it.\n\tif ( blocks.length === 1 ) {\n\t\tname = blocks[ 0 ].name;\n\t\t// Check for core/embed `video` and `audio` eligible suggestions.\n\t\tif ( name === 'core/embed' ) {\n\t\t\tconst provider = blocks[ 0 ].attributes?.providerNameSlug;\n\t\t\tif ( [ 'youtube', 'vimeo' ].includes( provider ) ) {\n\t\t\t\tname = 'core/video';\n\t\t\t} else if ( [ 'spotify', 'soundcloud' ].includes( provider ) ) {\n\t\t\t\tname = 'core/audio';\n\t\t\t}\n\t\t}\n\t}\n\n\t// If there are two blocks in the content and the last one is a text blocks\n\t// grab the name of the first one to also suggest a post format from it.\n\tif ( blocks.length === 2 && blocks[ 1 ].name === 'core/paragraph' ) {\n\t\tname = blocks[ 0 ].name;\n\t}\n\n\t// We only convert to default post formats in core.\n\tswitch ( name ) {\n\t\tcase 'core/image':\n\t\t\treturn 'image';\n\t\tcase 'core/quote':\n\t\tcase 'core/pullquote':\n\t\t\treturn 'quote';\n\t\tcase 'core/gallery':\n\t\t\treturn 'gallery';\n\t\tcase 'core/video':\n\t\t\treturn 'video';\n\t\tcase 'core/audio':\n\t\t\treturn 'audio';\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\n/**\n * Returns the content of the post being edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Post content.\n */\nexport const getEditedPostContent = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst postId = getCurrentPostId( state );\n\t\tconst postType = getCurrentPostType( state );\n\t\tconst record = select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( record ) {\n\t\t\tif ( typeof record.content === 'function' ) {\n\t\t\t\treturn record.content( record );\n\t\t\t} else if ( record.blocks ) {\n\t\t\t\treturn __unstableSerializeAndClean( record.blocks );\n\t\t\t} else if ( record.content ) {\n\t\t\t\treturn record.content;\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}\n);\n\n/**\n * Returns true if the post is being published, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether post is being published.\n */\nexport function isPublishingPost( state ) {\n\treturn (\n\t\tisSavingPost( state ) &&\n\t\t! isCurrentPostPublished( state ) &&\n\t\tgetEditedPostAttribute( state, 'status' ) === 'publish'\n\t);\n}\n\n/**\n * Returns whether the permalink is editable or not.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether or not the permalink is editable.\n */\nexport function isPermalinkEditable( state ) {\n\tconst permalinkTemplate = getEditedPostAttribute(\n\t\tstate,\n\t\t'permalink_template'\n\t);\n\n\treturn PERMALINK_POSTNAME_REGEX.test( permalinkTemplate );\n}\n\n/**\n * Returns the permalink for the post.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} The permalink, or null if the post is not viewable.\n */\nexport function getPermalink( state ) {\n\tconst permalinkParts = getPermalinkParts( state );\n\tif ( ! permalinkParts ) {\n\t\treturn null;\n\t}\n\n\tconst { prefix, postName, suffix } = permalinkParts;\n\n\tif ( isPermalinkEditable( state ) ) {\n\t\treturn prefix + postName + suffix;\n\t}\n\n\treturn prefix;\n}\n\n/**\n * Returns the slug for the post being edited, preferring a manually edited\n * value if one exists, then a sanitized version of the current post title, and\n * finally the post ID.\n *\n * @param {Object} state Editor state.\n *\n * @return {string} The current slug to be displayed in the editor\n */\nexport function getEditedPostSlug( state ) {\n\treturn (\n\t\tgetEditedPostAttribute( state, 'slug' ) ||\n\t\tcleanForSlug( getEditedPostAttribute( state, 'title' ) ) ||\n\t\tgetCurrentPostId( state )\n\t);\n}\n\n/**\n * Returns the permalink for a post, split into it's three parts: the prefix,\n * the postName, and the suffix.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} An object containing the prefix, postName, and suffix for\n * the permalink, or null if the post is not viewable.\n */\nexport function getPermalinkParts( state ) {\n\tconst permalinkTemplate = getEditedPostAttribute(\n\t\tstate,\n\t\t'permalink_template'\n\t);\n\tif ( ! permalinkTemplate ) {\n\t\treturn null;\n\t}\n\n\tconst postName =\n\t\tgetEditedPostAttribute( state, 'slug' ) ||\n\t\tgetEditedPostAttribute( state, 'generated_slug' );\n\n\tconst [ prefix, suffix ] = permalinkTemplate.split(\n\t\tPERMALINK_POSTNAME_REGEX\n\t);\n\n\treturn {\n\t\tprefix,\n\t\tpostName,\n\t\tsuffix,\n\t};\n}\n\n/**\n * Returns whether the post is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostLocked( state ) {\n\treturn state.postLock.isLocked;\n}\n\n/**\n * Returns whether post saving is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostSavingLocked( state ) {\n\treturn Object.keys( state.postSavingLock ).length > 0;\n}\n\n/**\n * Returns whether post autosaving is locked.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is locked.\n */\nexport function isPostAutosavingLocked( state ) {\n\treturn Object.keys( state.postAutosavingLock ).length > 0;\n}\n\n/**\n * Returns whether the edition of the post has been taken over.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Is post lock takeover.\n */\nexport function isPostLockTakeover( state ) {\n\treturn state.postLock.isTakeover;\n}\n\n/**\n * Returns details about the post lock user.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} A user object.\n */\nexport function getPostLockUser( state ) {\n\treturn state.postLock.user;\n}\n\n/**\n * Returns the active post lock.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The lock object.\n */\nexport function getActivePostLock( state ) {\n\treturn state.postLock.activePostLock;\n}\n\n/**\n * Returns whether or not the user has the unfiltered_html capability.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the user can or can't post unfiltered HTML.\n */\nexport function canUserUseUnfilteredHTML( state ) {\n\treturn has( getCurrentPost( state ), [\n\t\t'_links',\n\t\t'wp:action-unfiltered-html',\n\t] );\n}\n\n/**\n * Returns whether the pre-publish panel should be shown\n * or skipped when the user clicks the \"publish\" button.\n *\n * @return {boolean} Whether the pre-publish panel should be shown or not.\n */\nexport const isPublishSidebarEnabled = createRegistrySelector(\n\t( select ) => () =>\n\t\t!! select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'isPublishSidebarEnabled'\n\t\t)\n);\n\n/**\n * Return the current block list.\n *\n * @param {Object} state\n * @return {Array} Block list.\n */\nexport function getEditorBlocks( state ) {\n\treturn getEditedPostAttribute( state, 'blocks' ) || EMPTY_ARRAY;\n}\n\n/**\n * A block selection object.\n *\n * @typedef {Object} WPBlockSelection\n *\n * @property {string} clientId A block client ID.\n * @property {string} attributeKey A block attribute key.\n * @property {number} offset An attribute value offset, based on the rich\n * text value. See `wp.richText.create`.\n */\n\n/**\n * Returns the current selection start.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection start.\n *\n * @deprecated since Gutenberg 10.0.0.\n */\nexport function getEditorSelectionStart( state ) {\n\tdeprecated( \"select('core/editor').getEditorSelectionStart\", {\n\t\tsince: '5.8',\n\t\talternative: \"select('core/editor').getEditorSelection\",\n\t} );\n\treturn getEditedPostAttribute( state, 'selection' )?.selectionStart;\n}\n\n/**\n * Returns the current selection end.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection end.\n *\n * @deprecated since Gutenberg 10.0.0.\n */\nexport function getEditorSelectionEnd( state ) {\n\tdeprecated( \"select('core/editor').getEditorSelectionStart\", {\n\t\tsince: '5.8',\n\t\talternative: \"select('core/editor').getEditorSelection\",\n\t} );\n\treturn getEditedPostAttribute( state, 'selection' )?.selectionEnd;\n}\n\n/**\n * Returns the current selection.\n *\n * @param {Object} state\n * @return {WPBlockSelection} The selection end.\n */\nexport function getEditorSelection( state ) {\n\treturn getEditedPostAttribute( state, 'selection' );\n}\n\n/**\n * Is the editor ready\n *\n * @param {Object} state\n * @return {boolean} is Ready.\n */\nexport function __unstableIsEditorReady( state ) {\n\treturn state.isReady;\n}\n\n/**\n * Returns the post editor settings.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} The editor settings object.\n */\nexport function getEditorSettings( state ) {\n\treturn state.editorSettings;\n}\n\n/*\n * Backward compatibility\n */\n\n/**\n * Returns state object prior to a specified optimist transaction ID, or `null`\n * if the transaction corresponding to the given ID cannot be found.\n *\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function getStateBeforeOptimisticTransaction() {\n\tdeprecated( \"select('core/editor').getStateBeforeOptimisticTransaction\", {\n\t\tsince: '5.7',\n\t\thint: 'No state history is kept on this store anymore',\n\t} );\n\n\treturn null;\n}\n/**\n * Returns true if an optimistic transaction is pending commit, for which the\n * before state satisfies the given predicate function.\n *\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function inSomeHistory() {\n\tdeprecated( \"select('core/editor').inSomeHistory\", {\n\t\tsince: '5.7',\n\t\thint: 'No state history is kept on this store anymore',\n\t} );\n\treturn false;\n}\n\nfunction getBlockEditorSelector( name ) {\n\treturn createRegistrySelector( ( select ) => ( state, ...args ) => {\n\t\tdeprecated( \"`wp.data.select( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative: \"`wp.data.select( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn select( blockEditorStore )[ name ]( ...args );\n\t} );\n}\n\n/**\n * @see getBlockName in core/block-editor store.\n */\nexport const getBlockName = getBlockEditorSelector( 'getBlockName' );\n\n/**\n * @see isBlockValid in core/block-editor store.\n */\nexport const isBlockValid = getBlockEditorSelector( 'isBlockValid' );\n\n/**\n * @see getBlockAttributes in core/block-editor store.\n */\nexport const getBlockAttributes =\n\tgetBlockEditorSelector( 'getBlockAttributes' );\n\n/**\n * @see getBlock in core/block-editor store.\n */\nexport const getBlock = getBlockEditorSelector( 'getBlock' );\n\n/**\n * @see getBlocks in core/block-editor store.\n */\nexport const getBlocks = getBlockEditorSelector( 'getBlocks' );\n\n/**\n * @see getClientIdsOfDescendants in core/block-editor store.\n */\nexport const getClientIdsOfDescendants = getBlockEditorSelector(\n\t'getClientIdsOfDescendants'\n);\n\n/**\n * @see getClientIdsWithDescendants in core/block-editor store.\n */\nexport const getClientIdsWithDescendants = getBlockEditorSelector(\n\t'getClientIdsWithDescendants'\n);\n\n/**\n * @see getGlobalBlockCount in core/block-editor store.\n */\nexport const getGlobalBlockCount = getBlockEditorSelector(\n\t'getGlobalBlockCount'\n);\n\n/**\n * @see getBlocksByClientId in core/block-editor store.\n */\nexport const getBlocksByClientId = getBlockEditorSelector(\n\t'getBlocksByClientId'\n);\n\n/**\n * @see getBlockCount in core/block-editor store.\n */\nexport const getBlockCount = getBlockEditorSelector( 'getBlockCount' );\n\n/**\n * @see getBlockSelectionStart in core/block-editor store.\n */\nexport const getBlockSelectionStart = getBlockEditorSelector(\n\t'getBlockSelectionStart'\n);\n\n/**\n * @see getBlockSelectionEnd in core/block-editor store.\n */\nexport const getBlockSelectionEnd = getBlockEditorSelector(\n\t'getBlockSelectionEnd'\n);\n\n/**\n * @see getSelectedBlockCount in core/block-editor store.\n */\nexport const getSelectedBlockCount = getBlockEditorSelector(\n\t'getSelectedBlockCount'\n);\n\n/**\n * @see hasSelectedBlock in core/block-editor store.\n */\nexport const hasSelectedBlock = getBlockEditorSelector( 'hasSelectedBlock' );\n\n/**\n * @see getSelectedBlockClientId in core/block-editor store.\n */\nexport const getSelectedBlockClientId = getBlockEditorSelector(\n\t'getSelectedBlockClientId'\n);\n\n/**\n * @see getSelectedBlock in core/block-editor store.\n */\nexport const getSelectedBlock = getBlockEditorSelector( 'getSelectedBlock' );\n\n/**\n * @see getBlockRootClientId in core/block-editor store.\n */\nexport const getBlockRootClientId = getBlockEditorSelector(\n\t'getBlockRootClientId'\n);\n\n/**\n * @see getBlockHierarchyRootClientId in core/block-editor store.\n */\nexport const getBlockHierarchyRootClientId = getBlockEditorSelector(\n\t'getBlockHierarchyRootClientId'\n);\n\n/**\n * @see getAdjacentBlockClientId in core/block-editor store.\n */\nexport const getAdjacentBlockClientId = getBlockEditorSelector(\n\t'getAdjacentBlockClientId'\n);\n\n/**\n * @see getPreviousBlockClientId in core/block-editor store.\n */\nexport const getPreviousBlockClientId = getBlockEditorSelector(\n\t'getPreviousBlockClientId'\n);\n\n/**\n * @see getNextBlockClientId in core/block-editor store.\n */\nexport const getNextBlockClientId = getBlockEditorSelector(\n\t'getNextBlockClientId'\n);\n\n/**\n * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.\n */\nexport const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector(\n\t'getSelectedBlocksInitialCaretPosition'\n);\n\n/**\n * @see getMultiSelectedBlockClientIds in core/block-editor store.\n */\nexport const getMultiSelectedBlockClientIds = getBlockEditorSelector(\n\t'getMultiSelectedBlockClientIds'\n);\n\n/**\n * @see getMultiSelectedBlocks in core/block-editor store.\n */\nexport const getMultiSelectedBlocks = getBlockEditorSelector(\n\t'getMultiSelectedBlocks'\n);\n\n/**\n * @see getFirstMultiSelectedBlockClientId in core/block-editor store.\n */\nexport const getFirstMultiSelectedBlockClientId = getBlockEditorSelector(\n\t'getFirstMultiSelectedBlockClientId'\n);\n\n/**\n * @see getLastMultiSelectedBlockClientId in core/block-editor store.\n */\nexport const getLastMultiSelectedBlockClientId = getBlockEditorSelector(\n\t'getLastMultiSelectedBlockClientId'\n);\n\n/**\n * @see isFirstMultiSelectedBlock in core/block-editor store.\n */\nexport const isFirstMultiSelectedBlock = getBlockEditorSelector(\n\t'isFirstMultiSelectedBlock'\n);\n\n/**\n * @see isBlockMultiSelected in core/block-editor store.\n */\nexport const isBlockMultiSelected = getBlockEditorSelector(\n\t'isBlockMultiSelected'\n);\n\n/**\n * @see isAncestorMultiSelected in core/block-editor store.\n */\nexport const isAncestorMultiSelected = getBlockEditorSelector(\n\t'isAncestorMultiSelected'\n);\n\n/**\n * @see getMultiSelectedBlocksStartClientId in core/block-editor store.\n */\nexport const getMultiSelectedBlocksStartClientId = getBlockEditorSelector(\n\t'getMultiSelectedBlocksStartClientId'\n);\n\n/**\n * @see getMultiSelectedBlocksEndClientId in core/block-editor store.\n */\nexport const getMultiSelectedBlocksEndClientId = getBlockEditorSelector(\n\t'getMultiSelectedBlocksEndClientId'\n);\n\n/**\n * @see getBlockOrder in core/block-editor store.\n */\nexport const getBlockOrder = getBlockEditorSelector( 'getBlockOrder' );\n\n/**\n * @see getBlockIndex in core/block-editor store.\n */\nexport const getBlockIndex = getBlockEditorSelector( 'getBlockIndex' );\n\n/**\n * @see isBlockSelected in core/block-editor store.\n */\nexport const isBlockSelected = getBlockEditorSelector( 'isBlockSelected' );\n\n/**\n * @see hasSelectedInnerBlock in core/block-editor store.\n */\nexport const hasSelectedInnerBlock = getBlockEditorSelector(\n\t'hasSelectedInnerBlock'\n);\n\n/**\n * @see isBlockWithinSelection in core/block-editor store.\n */\nexport const isBlockWithinSelection = getBlockEditorSelector(\n\t'isBlockWithinSelection'\n);\n\n/**\n * @see hasMultiSelection in core/block-editor store.\n */\nexport const hasMultiSelection = getBlockEditorSelector( 'hasMultiSelection' );\n\n/**\n * @see isMultiSelecting in core/block-editor store.\n */\nexport const isMultiSelecting = getBlockEditorSelector( 'isMultiSelecting' );\n\n/**\n * @see isSelectionEnabled in core/block-editor store.\n */\nexport const isSelectionEnabled =\n\tgetBlockEditorSelector( 'isSelectionEnabled' );\n\n/**\n * @see getBlockMode in core/block-editor store.\n */\nexport const getBlockMode = getBlockEditorSelector( 'getBlockMode' );\n\n/**\n * @see isTyping in core/block-editor store.\n */\nexport const isTyping = getBlockEditorSelector( 'isTyping' );\n\n/**\n * @see isCaretWithinFormattedText in core/block-editor store.\n */\nexport const isCaretWithinFormattedText = getBlockEditorSelector(\n\t'isCaretWithinFormattedText'\n);\n\n/**\n * @see getBlockInsertionPoint in core/block-editor store.\n */\nexport const getBlockInsertionPoint = getBlockEditorSelector(\n\t'getBlockInsertionPoint'\n);\n\n/**\n * @see isBlockInsertionPointVisible in core/block-editor store.\n */\nexport const isBlockInsertionPointVisible = getBlockEditorSelector(\n\t'isBlockInsertionPointVisible'\n);\n\n/**\n * @see isValidTemplate in core/block-editor store.\n */\nexport const isValidTemplate = getBlockEditorSelector( 'isValidTemplate' );\n\n/**\n * @see getTemplate in core/block-editor store.\n */\nexport const getTemplate = getBlockEditorSelector( 'getTemplate' );\n\n/**\n * @see getTemplateLock in core/block-editor store.\n */\nexport const getTemplateLock = getBlockEditorSelector( 'getTemplateLock' );\n\n/**\n * @see canInsertBlockType in core/block-editor store.\n */\nexport const canInsertBlockType =\n\tgetBlockEditorSelector( 'canInsertBlockType' );\n\n/**\n * @see getInserterItems in core/block-editor store.\n */\nexport const getInserterItems = getBlockEditorSelector( 'getInserterItems' );\n\n/**\n * @see hasInserterItems in core/block-editor store.\n */\nexport const hasInserterItems = getBlockEditorSelector( 'hasInserterItems' );\n\n/**\n * @see getBlockListSettings in core/block-editor store.\n */\nexport const getBlockListSettings = getBlockEditorSelector(\n\t'getBlockListSettings'\n);\n\n/**\n * Returns the default template types.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The template types.\n */\nexport function __experimentalGetDefaultTemplateTypes( state ) {\n\treturn getEditorSettings( state )?.defaultTemplateTypes;\n}\n\n/**\n * Returns the default template part areas.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The template part areas.\n */\nexport const __experimentalGetDefaultTemplatePartAreas = createSelector(\n\t( state ) => {\n\t\tconst areas =\n\t\t\tgetEditorSettings( state )?.defaultTemplatePartAreas || [];\n\t\treturn areas?.map( ( item ) => {\n\t\t\treturn { ...item, icon: getTemplatePartIcon( item.icon ) };\n\t\t} );\n\t},\n\t( state ) => [ getEditorSettings( state )?.defaultTemplatePartAreas ]\n);\n\n/**\n * Returns a default template type searched by slug.\n *\n * @param {Object} state Global application state.\n * @param {string} slug The template type slug.\n *\n * @return {Object} The template type.\n */\nexport const __experimentalGetDefaultTemplateType = createSelector(\n\t( state, slug ) =>\n\t\tfind( __experimentalGetDefaultTemplateTypes( state ), { slug } ) || {},\n\t( state, slug ) => [ __experimentalGetDefaultTemplateTypes( state ), slug ]\n);\n\n/**\n * Given a template entity, return information about it which is ready to be\n * rendered, such as the title, description, and icon.\n *\n * @param {Object} state Global application state.\n * @param {Object} template The template for which we need information.\n * @return {Object} Information about the template, including title, description, and icon.\n */\nexport function __experimentalGetTemplateInfo( state, template ) {\n\tif ( ! template ) {\n\t\treturn {};\n\t}\n\n\tconst { description, slug, title, area } = template;\n\tconst { title: defaultTitle, description: defaultDescription } =\n\t\t__experimentalGetDefaultTemplateType( state, slug );\n\n\tconst templateTitle = isString( title ) ? title : title?.rendered;\n\tconst templateDescription = isString( description )\n\t\t? description\n\t\t: description?.raw;\n\tconst templateIcon =\n\t\t__experimentalGetDefaultTemplatePartAreas( state ).find(\n\t\t\t( item ) => area === item.area\n\t\t)?.icon || layout;\n\n\treturn {\n\t\ttitle:\n\t\t\ttemplateTitle && templateTitle !== slug\n\t\t\t\t? templateTitle\n\t\t\t\t: defaultTitle || slug,\n\t\tdescription: templateDescription || defaultDescription,\n\t\ticon: templateIcon,\n\t};\n}\n\n/**\n * Returns a post type label depending on the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {string|undefined} The post type label if available, otherwise undefined.\n */\nexport const getPostTypeLabel = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst currentPostType = getCurrentPostType( state );\n\t\tconst postType = select( coreStore ).getPostType( currentPostType );\n\t\t// Disable reason: Post type labels object is shaped like this.\n\t\t// eslint-disable-next-line camelcase\n\t\treturn postType?.labels?.singular_name;\n\t}\n);\n"]}
|
|
@@ -5,18 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = mediaUpload;
|
|
7
7
|
|
|
8
|
-
var _lodash = require("lodash");
|
|
9
|
-
|
|
10
8
|
var _data = require("@wordpress/data");
|
|
11
9
|
|
|
12
10
|
var _mediaUtils = require("@wordpress/media-utils");
|
|
13
11
|
|
|
14
12
|
var _store = require("../../store");
|
|
15
13
|
|
|
16
|
-
/**
|
|
17
|
-
* External dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* WordPress dependencies
|
|
22
16
|
*/
|
|
@@ -24,7 +18,7 @@ var _store = require("../../store");
|
|
|
24
18
|
/**
|
|
25
19
|
* Internal dependencies
|
|
26
20
|
*/
|
|
27
|
-
|
|
21
|
+
const noop = () => {};
|
|
28
22
|
/**
|
|
29
23
|
* Upload a media file when the file upload button is activated.
|
|
30
24
|
* Wrapper around mediaUpload() that injects the current post ID.
|
|
@@ -37,13 +31,15 @@ var _store = require("../../store");
|
|
|
37
31
|
* @param {Function} $0.onError Function called when an error happens.
|
|
38
32
|
* @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.
|
|
39
33
|
*/
|
|
34
|
+
|
|
35
|
+
|
|
40
36
|
function mediaUpload(_ref) {
|
|
41
37
|
let {
|
|
42
38
|
additionalData = {},
|
|
43
39
|
allowedTypes,
|
|
44
40
|
filesList,
|
|
45
41
|
maxUploadFileSize,
|
|
46
|
-
onError =
|
|
42
|
+
onError = noop,
|
|
47
43
|
onFileChange
|
|
48
44
|
} = _ref;
|
|
49
45
|
const {
|