@wordpress/editor 12.1.0 → 12.2.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 +14 -0
- package/README.md +7 -1
- package/build/components/deprecated.js +1 -3
- package/build/components/deprecated.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/post-format/index.js +6 -4
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +3 -3
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-title/index.native.js +1 -0
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-visibility/index.js +30 -14
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/store/actions.js +19 -14
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +2 -32
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/deprecated.js +1 -2
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-format/index.js +7 -5
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +3 -3
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-title/index.native.js +1 -0
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-visibility/index.js +31 -15
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/store/actions.js +19 -14
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +0 -28
- package/build-module/store/selectors.js.map +1 -1
- package/package.json +27 -30
- package/src/components/deprecated.js +0 -5
- package/src/components/index.js +2 -0
- package/src/components/post-format/index.js +9 -10
- package/src/components/post-taxonomies/README.md +25 -1
- package/src/components/post-taxonomies/most-used-terms.js +3 -3
- package/src/components/post-title/index.native.js +1 -0
- package/src/components/post-visibility/index.js +25 -11
- package/src/store/actions.js +17 -23
- package/src/store/selectors.js +0 -35
- package/src/store/test/actions.js +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","since","alternative","id","controls","select","STORE_NAME","dispatch","coreStore","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","postTypeSlug","newPost","path","rest_base","Date","now","trashPost","TRASH_POST_NOTICE_ID","method","autosave","local","isPostNew","title","excerpt","postId","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","version","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;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC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AGA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS8D,qBAAT,GAAiC;AACvC,SAAO;AACN9D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;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,SAAS+D,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACNhE,IAAAA,IAAI,EAAE,kBADA;AAENgE,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;AACNhE,IAAAA,IAAI,EAAE,oBADA;AAENgE,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;AACNhE,IAAAA,IAAI,EAAE,sBADA;AAENgE,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;AACNhE,IAAAA,IAAI,EAAE,wBADA;AAENgE,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,UAAUzD,iBAAV,CAA6BD,MAA7B,EAAoD;AAAA,MAAfU,OAAe,uEAAL,EAAK;AAC1D,QAAM;AAAER,IAAAA,+BAAF;AAAmC4D,IAAAA;AAAnC,MAAiDpD,OAAvD;AACA,QAAMnB,KAAK,GAAG;AAAES,IAAAA,MA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ACA;AACA;;;AACO,MAAMmB,YAAY,GAAGnB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAMoB,kBAAkB,GAAGpB,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMqB,kBAAkB,GAAGrB,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMsB,mBAAmB,GAAGtB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;;AACO,MAAMuB,mBAAmB,GAAGvB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;;AACO,MAAMwB,WAAW,GAAGxB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAMyB,YAAY,GAAGzB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAM0B,WAAW,GAAG1B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM2B,eAAe,GAAG3B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;;AACO,MAAM4B,WAAW,GAAG5B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM6B,UAAU,GAAG7B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM8B,kBAAkB,GAAG9B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM+B,iBAAiB,GAAG/B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAMgC,kBAAkB,GAAGhC,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMiC,uBAAuB,GAAGjC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\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';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\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 function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield 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\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield 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 * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\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 *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\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\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\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\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Action generator for handling refreshing the current post.\n */\nexport function* refreshPost() {\n\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tconst newPost = yield apiFetch( {\n\t\t// Timestamp arg allows caller to bypass browser caching, which is\n\t\t// expected for this specific function.\n\t\tpath:\n\t\t\t`/wp/v2/${ postType.rest_base }/${ post.id }` +\n\t\t\t`?context=edit&_timestamp=${ Date.now() }`,\n\t} );\n\tyield controls.dispatch( STORE_NAME, 'resetPost', newPost );\n}\n\n/**\n * Action generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. 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 function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.dispatch( coreStore, 'undo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history record should\n * be created.\n *\n * @return {Object} Action object.\n */\nexport function createUndoLevel() {\n\treturn { type: 'CREATE_UNDO_LEVEL' };\n}\n\n/**\n * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\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 * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\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 * Returns an action object used to signal that post saving is unlocked.\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 * Returns an action object used to signal that post autosaving is locked.\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 * Returns an action object used to signal that post autosaving is unlocked.\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 *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\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\tyield* 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 ) =>\n\tfunction* ( ...args ) {\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\tyield controls.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
|
+
{"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","since","alternative","id","controls","select","STORE_NAME","dispatch","coreStore","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","version","trashPost","postTypeSlug","TRASH_POST_NOTICE_ID","path","rest_base","method","autosave","local","isPostNew","title","excerpt","postId","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","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;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC,SAAS,CAAEH,IAAF,CAAf;AACA,QAAM;AACLI,IAAAA,IAAI,EAAE,cADD;AAELJ,IAAAA,IAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAN;AAMA,QAAMG,gBAAgB,CAAEL,I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AAnB,EAA+B,UAA/B,EAA2C;AAChDI,MAAAA,UAAU,EAAE,IADoC;AAEhD,SAAGZ;AAF6C,KAA3C,CAAN;AAIA;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,UAAUsC,IAAV,GAAiB;AACvB,QAAMhC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;;;AACO,UAAU6B,IAAV,GAAiB;AACvB,QAAMjC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAAS8B,eAAT,GAA2B;AACjC,2BAAY,mDAAZ,EAAiE;AAChErC,IAAAA,KAAK,EAAE,KADyD;AAEhEsB,IAAAA,OAAO,EAAE,KAFuD;AAGhErB,IAAAA,WAAW,EAAE;AAHmD,GAAjE;AAKA,SAAO;AAAEpB,IAAAA,IAAI,EAAE;AAAR,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASyD,cAAT,CAAyBC,IAAzB,EAAgC;AACtC,SAAO;AACN1D,IAAAA,IAAI,EAAE,kBADA;AAEN0D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,oBAAT,GAAgC;AACtC,SAAO;AACN3D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS4D,qBAAT,GAAiC;AACvC,SAAO;AACN5D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;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,SAAS6D,cAAT,CAAyBC,QAAzB,EAAo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CAAhD;AAIP;AACA;AACA;;;AACO,MAAMuB,WAAW,GAAGvB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;;AACO,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 deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\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';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\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 function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield 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\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield 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 * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\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 *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\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\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\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\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\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 generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. 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 function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.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 * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\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 * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\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 * Returns an action object used to signal that post saving is unlocked.\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 * Returns an action object used to signal that post autosaving is locked.\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 * Returns an action object used to signal that post autosaving is unlocked.\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 *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\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\tyield* 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 ) =>\n\tfunction* ( ...args ) {\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\tyield controls.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"]}
|
package/build/store/selectors.js
CHANGED
|
@@ -34,7 +34,7 @@ exports.getPermalink = getPermalink;
|
|
|
34
34
|
exports.getPermalinkParts = getPermalinkParts;
|
|
35
35
|
exports.getPostEdits = void 0;
|
|
36
36
|
exports.getPostLockUser = getPostLockUser;
|
|
37
|
-
exports.getSelectedBlocksInitialCaretPosition = exports.getSelectedBlockCount = exports.getSelectedBlockClientId = exports.getSelectedBlock = exports.
|
|
37
|
+
exports.getSelectedBlocksInitialCaretPosition = exports.getSelectedBlockCount = exports.getSelectedBlockClientId = exports.getSelectedBlock = exports.getPreviousBlockClientId = exports.getPostTypeLabel = void 0;
|
|
38
38
|
exports.getStateBeforeOptimisticTransaction = getStateBeforeOptimisticTransaction;
|
|
39
39
|
exports.getSuggestedPostFormat = getSuggestedPostFormat;
|
|
40
40
|
exports.getTemplateLock = exports.getTemplate = void 0;
|
|
@@ -57,7 +57,6 @@ exports.isEditedPostNew = isEditedPostNew;
|
|
|
57
57
|
exports.isEditedPostPublishable = isEditedPostPublishable;
|
|
58
58
|
exports.isEditedPostSaveable = isEditedPostSaveable;
|
|
59
59
|
exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
|
|
60
|
-
exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
|
|
61
60
|
exports.isPermalinkEditable = isPermalinkEditable;
|
|
62
61
|
exports.isPostAutosavingLocked = isPostAutosavingLocked;
|
|
63
62
|
exports.isPostLockTakeover = isPostLockTakeover;
|
|
@@ -332,35 +331,6 @@ const getPostEdits = (0, _data.createRegistrySelector)(select => state => {
|
|
|
332
331
|
const postId = getCurrentPostId(state);
|
|
333
332
|
return select(_coreData.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
|
|
334
333
|
});
|
|
335
|
-
/**
|
|
336
|
-
* Returns a new reference when edited values have changed. This is useful in
|
|
337
|
-
* inferring where an edit has been made between states by comparison of the
|
|
338
|
-
* return values using strict equality.
|
|
339
|
-
*
|
|
340
|
-
* @deprecated since Gutenberg 6.5.0.
|
|
341
|
-
*
|
|
342
|
-
* @example
|
|
343
|
-
*
|
|
344
|
-
* ```
|
|
345
|
-
* const hasEditOccurred = (
|
|
346
|
-
* getReferenceByDistinctEdits( beforeState ) !==
|
|
347
|
-
* getReferenceByDistinctEdits( afterState )
|
|
348
|
-
* );
|
|
349
|
-
* ```
|
|
350
|
-
*
|
|
351
|
-
* @param {Object} state Editor state.
|
|
352
|
-
*
|
|
353
|
-
* @return {*} A value whose reference will change only when an edit occurs.
|
|
354
|
-
*/
|
|
355
|
-
|
|
356
|
-
exports.getPostEdits = getPostEdits;
|
|
357
|
-
const getReferenceByDistinctEdits = (0, _data.createRegistrySelector)(select => () => {
|
|
358
|
-
(0, _deprecated.default)("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", {
|
|
359
|
-
since: '5.4',
|
|
360
|
-
alternative: "`wp.data.select( 'core' ).getReferenceByDistinctEdits`"
|
|
361
|
-
});
|
|
362
|
-
return select(_coreData.store).getReferenceByDistinctEdits();
|
|
363
|
-
});
|
|
364
334
|
/**
|
|
365
335
|
* Returns an attribute value of the saved post.
|
|
366
336
|
*
|
|
@@ -370,7 +340,7 @@ const getReferenceByDistinctEdits = (0, _data.createRegistrySelector)(select =>
|
|
|
370
340
|
* @return {*} Post attribute value.
|
|
371
341
|
*/
|
|
372
342
|
|
|
373
|
-
exports.
|
|
343
|
+
exports.getPostEdits = getPostEdits;
|
|
374
344
|
|
|
375
345
|
function getCurrentPostAttribute(state, attributeName) {
|
|
376
346
|
switch (attributeName) {
|