@wordpress/core-data 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +54 -6
- package/build/actions.js +6 -6
- package/build/actions.js.map +1 -1
- package/build/entity-context.js +13 -0
- package/build/entity-context.js.map +1 -0
- package/build/entity-provider.js +4 -189
- package/build/entity-provider.js.map +1 -1
- package/build/entity-types/menu-location.js.map +1 -1
- package/build/entity-types/settings.js.map +1 -1
- package/build/entity-types/theme.js.map +1 -1
- package/build/entity-types/widget-type.js.map +1 -1
- package/build/hooks/index.js +22 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-entity-block-editor.js +140 -0
- package/build/hooks/use-entity-block-editor.js.map +1 -0
- package/build/hooks/use-entity-id.js +28 -0
- package/build/hooks/use-entity-id.js.map +1 -0
- package/build/hooks/use-entity-prop.js +65 -0
- package/build/hooks/use-entity-prop.js.map +1 -0
- package/build/hooks/use-resource-permissions.js +25 -8
- package/build/hooks/use-resource-permissions.js.map +1 -1
- package/build/resolvers.js +81 -70
- package/build/resolvers.js.map +1 -1
- package/build/selectors.js +23 -9
- package/build/selectors.js.map +1 -1
- package/build/utils/index.js +19 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/user-permissions.js +32 -0
- package/build/utils/user-permissions.js.map +1 -0
- package/build-module/actions.js +6 -6
- package/build-module/actions.js.map +1 -1
- package/build-module/entity-context.js +6 -0
- package/build-module/entity-context.js.map +1 -0
- package/build-module/entity-provider.js +3 -185
- package/build-module/entity-provider.js.map +1 -1
- package/build-module/entity-types/menu-location.js.map +1 -1
- package/build-module/entity-types/settings.js.map +1 -1
- package/build-module/entity-types/theme.js.map +1 -1
- package/build-module/entity-types/widget-type.js.map +1 -1
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-entity-block-editor.js +132 -0
- package/build-module/hooks/use-entity-block-editor.js.map +1 -0
- package/build-module/hooks/use-entity-id.js +22 -0
- package/build-module/hooks/use-entity-id.js.map +1 -0
- package/build-module/hooks/use-entity-prop.js +58 -0
- package/build-module/hooks/use-entity-prop.js.map +1 -0
- package/build-module/hooks/use-resource-permissions.js +25 -8
- package/build-module/hooks/use-resource-permissions.js.map +1 -1
- package/build-module/resolvers.js +82 -71
- package/build-module/resolvers.js.map +1 -1
- package/build-module/selectors.js +24 -10
- package/build-module/selectors.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/user-permissions.js +24 -0
- package/build-module/utils/user-permissions.js.map +1 -0
- package/build-types/actions.d.ts +3 -3
- package/build-types/actions.d.ts.map +1 -1
- package/build-types/batch/create-batch.d.ts.map +1 -1
- package/build-types/entities.d.ts.map +1 -1
- package/build-types/entity-context.d.ts +2 -0
- package/build-types/entity-context.d.ts.map +1 -0
- package/build-types/entity-provider.d.ts +0 -48
- package/build-types/entity-provider.d.ts.map +1 -1
- package/build-types/entity-types/menu-location.d.ts.map +1 -1
- package/build-types/entity-types/settings.d.ts.map +1 -1
- package/build-types/entity-types/theme.d.ts.map +1 -1
- package/build-types/entity-types/widget-type.d.ts.map +1 -1
- package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -1
- package/build-types/hooks/index.d.ts +3 -0
- package/build-types/hooks/index.d.ts.map +1 -1
- package/build-types/hooks/use-entity-block-editor.d.ts +22 -0
- package/build-types/hooks/use-entity-block-editor.d.ts.map +1 -0
- package/build-types/hooks/use-entity-id.d.ts +9 -0
- package/build-types/hooks/use-entity-id.d.ts.map +1 -0
- package/build-types/hooks/use-entity-prop.d.ts +19 -0
- package/build-types/hooks/use-entity-prop.d.ts.map +1 -0
- package/build-types/hooks/use-resource-permissions.d.ts +8 -70
- package/build-types/hooks/use-resource-permissions.d.ts.map +1 -1
- package/build-types/index.d.ts +35 -32
- package/build-types/index.d.ts.map +1 -1
- package/build-types/locks/reducer.d.ts +1 -1
- package/build-types/locks/reducer.d.ts.map +1 -1
- package/build-types/queried-data/actions.d.ts +1 -1
- package/build-types/queried-data/actions.d.ts.map +1 -1
- package/build-types/queried-data/get-query-parts.d.ts.map +1 -1
- package/build-types/queried-data/reducer.d.ts +1 -1
- package/build-types/queried-data/reducer.d.ts.map +1 -1
- package/build-types/queried-data/selectors.d.ts +0 -1
- package/build-types/queried-data/selectors.d.ts.map +1 -1
- package/build-types/reducer.d.ts +13 -13
- package/build-types/reducer.d.ts.map +1 -1
- package/build-types/resolvers.d.ts +3 -2
- package/build-types/resolvers.d.ts.map +1 -1
- package/build-types/selectors.d.ts +11 -6
- package/build-types/selectors.d.ts.map +1 -1
- package/build-types/utils/get-nested-value.d.ts.map +1 -1
- package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -1
- package/build-types/utils/if-matching-action.d.ts +1 -1
- package/build-types/utils/index.d.ts +1 -0
- package/build-types/utils/on-sub-key.d.ts +1 -1
- package/build-types/utils/replace-action.d.ts +1 -1
- package/build-types/utils/set-nested-value.d.ts.map +1 -1
- package/build-types/utils/user-permissions.d.ts +4 -0
- package/build-types/utils/user-permissions.d.ts.map +1 -0
- package/package.json +18 -17
- package/src/actions.js +6 -6
- package/src/entity-context.js +6 -0
- package/src/entity-provider.js +2 -211
- package/src/entity-types/menu-location.ts +1 -0
- package/src/entity-types/settings.ts +1 -0
- package/src/entity-types/theme.ts +1 -0
- package/src/entity-types/widget-type.ts +1 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/test/use-entity-record.js +5 -3
- package/src/hooks/test/use-resource-permissions.js +96 -5
- package/src/hooks/use-entity-block-editor.js +148 -0
- package/src/hooks/use-entity-id.js +21 -0
- package/src/hooks/use-entity-prop.js +60 -0
- package/src/hooks/use-resource-permissions.ts +46 -9
- package/src/resolvers.js +102 -78
- package/src/selectors.ts +24 -9
- package/src/test/entity-provider.js +6 -2
- package/src/test/resolvers.js +221 -50
- package/src/test/selectors.js +18 -55
- package/src/utils/index.js +5 -0
- package/src/utils/user-permissions.js +39 -0
- package/tsconfig.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fastDeepEqual","v4","uuid","apiFetch","addQueryArgs","deprecated","getNestedValue","setNestedValue","receiveItems","removeItems","receiveQueriedItems","getOrLoadEntitiesConfig","DEFAULT_ENTITY_KEY","createBatch","STORE_NAME","getSyncProvider","receiveUserQuery","queryID","users","type","Array","isArray","receiveCurrentUser","currentUser","addEntities","entities","receiveEntityRecords","kind","name","records","query","invalidateCache","edits","meta","map","record","status","title","action","receiveCurrentTheme","currentTheme","__experimentalReceiveCurrentGlobalStylesId","currentGlobalStylesId","id","__experimentalReceiveThemeBaseGlobalStyles","stylesheet","globalStyles","__experimentalReceiveThemeGlobalStyleVariations","variations","receiveThemeSupports","since","receiveThemeGlobalStyleRevisions","currentId","revisions","alternative","receiveEmbedPreview","url","preview","deleteEntityRecord","recordId","__unstableFetch","throwOnError","dispatch","configs","entityConfig","find","config","error","deletedRecord","__experimentalNoFetch","lock","__unstableAcquireStoreLock","exclusive","hasError","path","baseURL","method","_error","__unstableReleaseStoreLock","editEntityRecord","options","select","getEntityConfig","Error","mergedEdits","getRawEntityRecord","editedRecord","getEditedEntityRecord","edit","Object","keys","reduce","acc","key","recordValue","editedRecordValue","value","undefined","window","__experimentalEnableSync","syncConfig","globalThis","IS_GUTENBERG_PLUGIN","objectId","getSyncObjectId","update","syncObjectType","undoIgnore","getUndoManager","addRecord","changes","from","to","isCached","undo","undoRecord","redo","redoRecord","__unstableCreateUndoLevel","saveEntityRecord","isAutosave","resolveSelect","entityIdKey","entries","evaluatedValue","updatedRecord","persistedRecord","getCurrentUser","currentUserId","autosavePost","getAutosave","data","includes","newRecord","receiveAutosaves","__unstablePrePersist","__experimentalBatch","requests","batch","api","add","saveEditedEntityRecord","resultPromises","request","results","Promise","all","run","hasEditsForEntityRecord","getEntityRecordNonTransientEdits","__experimentalSaveSpecifiedEntityEdits","itemsToSave","editsToSave","item","receiveUploadPermissions","hasUploadPermissions","receiveUserPermission","isAllowed","postId","autosaves","receiveNavigationFallbackId","fallbackId","receiveDefaultTemplateId","templateId","receiveRevisions","recordKey","revisionKey","items"],"sources":["@wordpress/core-data/src/actions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { getNestedValue, setNestedValue } from './utils';\nimport { receiveItems, removeItems, receiveQueriedItems } from './queried-data';\nimport { getOrLoadEntitiesConfig, DEFAULT_ENTITY_KEY } from './entities';\nimport { createBatch } from './batch';\nimport { STORE_NAME } from './name';\nimport { getSyncProvider } from './sync';\n\n/**\n * Returns an action object used in signalling that authors have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} queryID Query ID.\n * @param {Array|Object} users Users received.\n *\n * @return {Object} Action object.\n */\nexport function receiveUserQuery( queryID, users ) {\n\treturn {\n\t\ttype: 'RECEIVE_USER_QUERY',\n\t\tusers: Array.isArray( users ) ? users : [ users ],\n\t\tqueryID,\n\t};\n}\n\n/**\n * Returns an action used in signalling that the current user has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {Object} currentUser Current user object.\n *\n * @return {Object} Action object.\n */\nexport function receiveCurrentUser( currentUser ) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_USER',\n\t\tcurrentUser,\n\t};\n}\n\n/**\n * Returns an action object used in adding new entities.\n *\n * @param {Array} entities Entities received.\n *\n * @return {Object} Action object.\n */\nexport function addEntities( entities ) {\n\treturn {\n\t\ttype: 'ADD_ENTITIES',\n\t\tentities,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that entity records have been received.\n *\n * @param {string} kind Kind of the received entity record.\n * @param {string} name Name of the received entity record.\n * @param {Array|Object} records Records received.\n * @param {?Object} query Query Object.\n * @param {?boolean} invalidateCache Should invalidate query caches.\n * @param {?Object} edits Edits to reset.\n * @param {?Object} meta Meta information about pagination.\n * @return {Object} Action object.\n */\nexport function receiveEntityRecords(\n\tkind,\n\tname,\n\trecords,\n\tquery,\n\tinvalidateCache = false,\n\tedits,\n\tmeta\n) {\n\t// Auto drafts should not have titles, but some plugins rely on them so we can't filter this\n\t// on the server.\n\tif ( kind === 'postType' ) {\n\t\trecords = ( Array.isArray( records ) ? records : [ records ] ).map(\n\t\t\t( record ) =>\n\t\t\t\trecord.status === 'auto-draft'\n\t\t\t\t\t? { ...record, title: '' }\n\t\t\t\t\t: record\n\t\t);\n\t}\n\tlet action;\n\tif ( query ) {\n\t\taction = receiveQueriedItems( records, query, edits, meta );\n\t} else {\n\t\taction = receiveItems( records, edits, meta );\n\t}\n\n\treturn {\n\t\t...action,\n\t\tkind,\n\t\tname,\n\t\tinvalidateCache,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the current theme has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {Object} currentTheme The current theme.\n *\n * @return {Object} Action object.\n */\nexport function receiveCurrentTheme( currentTheme ) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_THEME',\n\t\tcurrentTheme,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the current global styles id has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} currentGlobalStylesId The current global styles id.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveCurrentGlobalStylesId(\n\tcurrentGlobalStylesId\n) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID',\n\t\tid: currentGlobalStylesId,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme base global styles have been received\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} stylesheet The theme's identifier\n * @param {Object} globalStyles The global styles object.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveThemeBaseGlobalStyles(\n\tstylesheet,\n\tglobalStyles\n) {\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLES',\n\t\tstylesheet,\n\t\tglobalStyles,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme global styles variations have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} stylesheet The theme's identifier\n * @param {Array} variations The global styles variations.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveThemeGlobalStyleVariations(\n\tstylesheet,\n\tvariations\n) {\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS',\n\t\tstylesheet,\n\t\tvariations,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the index has been received.\n *\n * @deprecated since WP 5.9, this is not useful anymore, use the selector direclty.\n *\n * @return {Object} Action object.\n */\nexport function receiveThemeSupports() {\n\tdeprecated( \"wp.data.dispatch( 'core' ).receiveThemeSupports\", {\n\t\tsince: '5.9',\n\t} );\n\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme global styles CPT post revisions have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead.\n *\n * @ignore\n *\n * @param {number} currentId The post id.\n * @param {Array} revisions The global styles revisions.\n *\n * @return {Object} Action object.\n */\nexport function receiveThemeGlobalStyleRevisions( currentId, revisions ) {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()\",\n\t\t{\n\t\t\tsince: '6.5.0',\n\t\t\talternative: \"wp.data.dispatch( 'core' ).receiveRevisions\",\n\t\t}\n\t);\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS',\n\t\tcurrentId,\n\t\trevisions,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the preview data for\n * a given URl has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} url URL to preview the embed for.\n * @param {*} preview Preview data.\n *\n * @return {Object} Action object.\n */\nexport function receiveEmbedPreview( url, preview ) {\n\treturn {\n\t\ttype: 'RECEIVE_EMBED_PREVIEW',\n\t\turl,\n\t\tpreview,\n\t};\n}\n\n/**\n * Action triggered to delete an entity record.\n *\n * @param {string} kind Kind of the deleted entity.\n * @param {string} name Name of the deleted entity.\n * @param {string} recordId Record ID of the deleted entity.\n * @param {?Object} query Special query parameters for the\n * DELETE API call.\n * @param {Object} [options] Delete options.\n * @param {Function} [options.__unstableFetch] Internal use only. Function to\n * call instead of `apiFetch()`.\n * Must return a promise.\n * @param {boolean} [options.throwOnError=false] If false, this action suppresses all\n * the exceptions. Defaults to false.\n */\nexport const deleteEntityRecord =\n\t(\n\t\tkind,\n\t\tname,\n\t\trecordId,\n\t\tquery,\n\t\t{ __unstableFetch = apiFetch, throwOnError = false } = {}\n\t) =>\n\tasync ( { dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tlet error;\n\t\tlet deletedRecord = false;\n\t\tif ( ! entityConfig || entityConfig?.__experimentalNoFetch ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lock = await dispatch.__unstableAcquireStoreLock(\n\t\t\tSTORE_NAME,\n\t\t\t[ 'entities', 'records', kind, name, recordId ],\n\t\t\t{ exclusive: true }\n\t\t);\n\n\t\ttry {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'DELETE_ENTITY_RECORD_START',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t} );\n\n\t\t\tlet hasError = false;\n\t\t\ttry {\n\t\t\t\tlet path = `${ entityConfig.baseURL }/${ recordId }`;\n\n\t\t\t\tif ( query ) {\n\t\t\t\t\tpath = addQueryArgs( path, query );\n\t\t\t\t}\n\n\t\t\t\tdeletedRecord = await __unstableFetch( {\n\t\t\t\t\tpath,\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t} );\n\n\t\t\t\tawait dispatch( removeItems( kind, name, recordId, true ) );\n\t\t\t} catch ( _error ) {\n\t\t\t\thasError = true;\n\t\t\t\terror = _error;\n\t\t\t}\n\n\t\t\tdispatch( {\n\t\t\t\ttype: 'DELETE_ENTITY_RECORD_FINISH',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\terror,\n\t\t\t} );\n\n\t\t\tif ( hasError && throwOnError ) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn deletedRecord;\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Returns an action object that triggers an\n * edit to an entity record.\n *\n * @param {string} kind Kind of the edited entity record.\n * @param {string} name Name of the edited entity record.\n * @param {number|string} recordId Record ID of the edited entity record.\n * @param {Object} edits The edits.\n * @param {Object} options Options for the edit.\n * @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not.\n *\n * @return {Object} Action object.\n */\nexport const editEntityRecord =\n\t( kind, name, recordId, edits, options = {} ) =>\n\t( { select, dispatch } ) => {\n\t\tconst entityConfig = select.getEntityConfig( kind, name );\n\t\tif ( ! entityConfig ) {\n\t\t\tthrow new Error(\n\t\t\t\t`The entity being edited (${ kind }, ${ name }) does not have a loaded config.`\n\t\t\t);\n\t\t}\n\t\tconst { mergedEdits = {} } = entityConfig;\n\t\tconst record = select.getRawEntityRecord( kind, name, recordId );\n\t\tconst editedRecord = select.getEditedEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\n\t\tconst edit = {\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId,\n\t\t\t// Clear edits when they are equal to their persisted counterparts\n\t\t\t// so that the property is not considered dirty.\n\t\t\tedits: Object.keys( edits ).reduce( ( acc, key ) => {\n\t\t\t\tconst recordValue = record[ key ];\n\t\t\t\tconst editedRecordValue = editedRecord[ key ];\n\t\t\t\tconst value = mergedEdits[ key ]\n\t\t\t\t\t? { ...editedRecordValue, ...edits[ key ] }\n\t\t\t\t\t: edits[ key ];\n\t\t\t\tacc[ key ] = fastDeepEqual( recordValue, value )\n\t\t\t\t\t? undefined\n\t\t\t\t\t: value;\n\t\t\t\treturn acc;\n\t\t\t}, {} ),\n\t\t};\n\t\tif ( window.__experimentalEnableSync && entityConfig.syncConfig ) {\n\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\tconst objectId = entityConfig.getSyncObjectId( recordId );\n\t\t\t\tgetSyncProvider().update(\n\t\t\t\t\tentityConfig.syncObjectType + '--edit',\n\t\t\t\t\tobjectId,\n\t\t\t\t\tedit.edits\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! options.undoIgnore ) {\n\t\t\t\tselect.getUndoManager().addRecord(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: { kind, name, recordId },\n\t\t\t\t\t\t\tchanges: Object.keys( edits ).reduce(\n\t\t\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\t\t\tacc[ key ] = {\n\t\t\t\t\t\t\t\t\t\tfrom: editedRecord[ key ],\n\t\t\t\t\t\t\t\t\t\tto: edits[ key ],\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\toptions.isCached\n\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch( {\n\t\t\t\ttype: 'EDIT_ENTITY_RECORD',\n\t\t\t\t...edit,\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Action triggered to undo the last edit to\n * an entity record, if any.\n */\nexport const undo =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\tconst undoRecord = select.getUndoManager().undo();\n\t\tif ( ! undoRecord ) {\n\t\t\treturn;\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'UNDO',\n\t\t\trecord: undoRecord,\n\t\t} );\n\t};\n\n/**\n * Action triggered to redo the last undoed\n * edit to an entity record, if any.\n */\nexport const redo =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\tconst redoRecord = select.getUndoManager().redo();\n\t\tif ( ! redoRecord ) {\n\t\t\treturn;\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'REDO',\n\t\t\trecord: redoRecord,\n\t\t} );\n\t};\n\n/**\n * Forces the creation of a new undo level.\n *\n * @return {Object} Action object.\n */\nexport const __unstableCreateUndoLevel =\n\t() =>\n\t( { select } ) => {\n\t\tselect.getUndoManager().addRecord();\n\t};\n\n/**\n * Action triggered to save an entity record.\n *\n * @param {string} kind Kind of the received entity.\n * @param {string} name Name of the received entity.\n * @param {Object} record Record to be saved.\n * @param {Object} options Saving options.\n * @param {boolean} [options.isAutosave=false] Whether this is an autosave.\n * @param {Function} [options.__unstableFetch] Internal use only. Function to\n * call instead of `apiFetch()`.\n * Must return a promise.\n * @param {boolean} [options.throwOnError=false] If false, this action suppresses all\n * the exceptions. Defaults to false.\n */\nexport const saveEntityRecord =\n\t(\n\t\tkind,\n\t\tname,\n\t\trecord,\n\t\t{\n\t\t\tisAutosave = false,\n\t\t\t__unstableFetch = apiFetch,\n\t\t\tthrowOnError = false,\n\t\t} = {}\n\t) =>\n\tasync ( { select, resolveSelect, dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tif ( ! entityConfig || entityConfig?.__experimentalNoFetch ) {\n\t\t\treturn;\n\t\t}\n\t\tconst entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;\n\t\tconst recordId = record[ entityIdKey ];\n\n\t\tconst lock = await dispatch.__unstableAcquireStoreLock(\n\t\t\tSTORE_NAME,\n\t\t\t[ 'entities', 'records', kind, name, recordId || uuid() ],\n\t\t\t{ exclusive: true }\n\t\t);\n\n\t\ttry {\n\t\t\t// Evaluate optimized edits.\n\t\t\t// (Function edits that should be evaluated on save to avoid expensive computations on every edit.)\n\t\t\tfor ( const [ key, value ] of Object.entries( record ) ) {\n\t\t\t\tif ( typeof value === 'function' ) {\n\t\t\t\t\tconst evaluatedValue = value(\n\t\t\t\t\t\tselect.getEditedEntityRecord( kind, name, recordId )\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.editEntityRecord(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\trecordId,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ key ]: evaluatedValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t\t);\n\t\t\t\t\trecord[ key ] = evaluatedValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SAVE_ENTITY_RECORD_START',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\tisAutosave,\n\t\t\t} );\n\t\t\tlet updatedRecord;\n\t\t\tlet error;\n\t\t\tlet hasError = false;\n\t\t\ttry {\n\t\t\t\tconst path = `${ entityConfig.baseURL }${\n\t\t\t\t\trecordId ? '/' + recordId : ''\n\t\t\t\t}`;\n\t\t\t\tconst persistedRecord = select.getRawEntityRecord(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecordId\n\t\t\t\t);\n\n\t\t\t\tif ( isAutosave ) {\n\t\t\t\t\t// Most of this autosave logic is very specific to posts.\n\t\t\t\t\t// This is fine for now as it is the only supported autosave,\n\t\t\t\t\t// but ideally this should all be handled in the back end,\n\t\t\t\t\t// so the client just sends and receives objects.\n\t\t\t\t\tconst currentUser = select.getCurrentUser();\n\t\t\t\t\tconst currentUserId = currentUser\n\t\t\t\t\t\t? currentUser.id\n\t\t\t\t\t\t: undefined;\n\t\t\t\t\tconst autosavePost = await resolveSelect.getAutosave(\n\t\t\t\t\t\tpersistedRecord.type,\n\t\t\t\t\t\tpersistedRecord.id,\n\t\t\t\t\t\tcurrentUserId\n\t\t\t\t\t);\n\t\t\t\t\t// Autosaves need all expected fields to be present.\n\t\t\t\t\t// So we fallback to the previous autosave and then\n\t\t\t\t\t// to the actual persisted entity if the edits don't\n\t\t\t\t\t// have a value.\n\t\t\t\t\tlet data = {\n\t\t\t\t\t\t...persistedRecord,\n\t\t\t\t\t\t...autosavePost,\n\t\t\t\t\t\t...record,\n\t\t\t\t\t};\n\t\t\t\t\tdata = Object.keys( data ).reduce(\n\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t'title',\n\t\t\t\t\t\t\t\t\t'excerpt',\n\t\t\t\t\t\t\t\t\t'content',\n\t\t\t\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t\t\t].includes( key )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tacc[ key ] = data[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Do not update the `status` if we have edited it when auto saving.\n\t\t\t\t\t\t\t// It's very important to let the user explicitly save this change,\n\t\t\t\t\t\t\t// because it can lead to unexpected results. An example would be to\n\t\t\t\t\t\t\t// have a draft post and change the status to publish.\n\t\t\t\t\t\t\tstatus:\n\t\t\t\t\t\t\t\tdata.status === 'auto-draft'\n\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tupdatedRecord = await __unstableFetch( {\n\t\t\t\t\t\tpath: `${ path }/autosaves`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata,\n\t\t\t\t\t} );\n\n\t\t\t\t\t// An autosave may be processed by the server as a regular save\n\t\t\t\t\t// when its update is requested by the author and the post had\n\t\t\t\t\t// draft or auto-draft status.\n\t\t\t\t\tif ( persistedRecord.id === updatedRecord.id ) {\n\t\t\t\t\t\tlet newRecord = {\n\t\t\t\t\t\t\t...persistedRecord,\n\t\t\t\t\t\t\t...data,\n\t\t\t\t\t\t\t...updatedRecord,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnewRecord = Object.keys( newRecord ).reduce(\n\t\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\t\t// These properties are persisted in autosaves.\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[ 'title', 'excerpt', 'content' ].includes(\n\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tacc[ key ] = newRecord[ key ];\n\t\t\t\t\t\t\t\t} else if ( key === 'status' ) {\n\t\t\t\t\t\t\t\t\t// Status is only persisted in autosaves when going from\n\t\t\t\t\t\t\t\t\t// \"auto-draft\" to \"draft\".\n\t\t\t\t\t\t\t\t\tacc[ key ] =\n\t\t\t\t\t\t\t\t\t\tpersistedRecord.status ===\n\t\t\t\t\t\t\t\t\t\t\t'auto-draft' &&\n\t\t\t\t\t\t\t\t\t\tnewRecord.status === 'draft'\n\t\t\t\t\t\t\t\t\t\t\t? newRecord.status\n\t\t\t\t\t\t\t\t\t\t\t: persistedRecord.status;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// These properties are not persisted in autosaves.\n\t\t\t\t\t\t\t\t\tacc[ key ] = persistedRecord[ key ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tnewRecord,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatch.receiveAutosaves(\n\t\t\t\t\t\t\tpersistedRecord.id,\n\t\t\t\t\t\t\tupdatedRecord\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet edits = record;\n\t\t\t\t\tif ( entityConfig.__unstablePrePersist ) {\n\t\t\t\t\t\tedits = {\n\t\t\t\t\t\t\t...edits,\n\t\t\t\t\t\t\t...entityConfig.__unstablePrePersist(\n\t\t\t\t\t\t\t\tpersistedRecord,\n\t\t\t\t\t\t\t\tedits\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tupdatedRecord = await __unstableFetch( {\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tmethod: recordId ? 'PUT' : 'POST',\n\t\t\t\t\t\tdata: edits,\n\t\t\t\t\t} );\n\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tupdatedRecord,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tedits\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch ( _error ) {\n\t\t\t\thasError = true;\n\t\t\t\terror = _error;\n\t\t\t}\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SAVE_ENTITY_RECORD_FINISH',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\terror,\n\t\t\t\tisAutosave,\n\t\t\t} );\n\n\t\t\tif ( hasError && throwOnError ) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn updatedRecord;\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Runs multiple core-data actions at the same time using one API request.\n *\n * Example:\n *\n * ```\n * const [ savedRecord, updatedRecord, deletedRecord ] =\n * await dispatch( 'core' ).__experimentalBatch( [\n * ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ),\n * ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ),\n * ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ),\n * ] );\n * ```\n *\n * @param {Array} requests Array of functions which are invoked simultaneously.\n * Each function is passed an object containing\n * `saveEntityRecord`, `saveEditedEntityRecord`, and\n * `deleteEntityRecord`.\n *\n * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return\n * values of each function given in `requests`.\n */\nexport const __experimentalBatch =\n\t( requests ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst batch = createBatch();\n\t\tconst api = {\n\t\t\tsaveEntityRecord( kind, name, record, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.saveEntityRecord( kind, name, record, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t\tsaveEditedEntityRecord( kind, name, recordId, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.saveEditedEntityRecord( kind, name, recordId, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t\tdeleteEntityRecord( kind, name, recordId, query, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.deleteEntityRecord( kind, name, recordId, query, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t\tconst resultPromises = requests.map( ( request ) => request( api ) );\n\t\tconst [ , ...results ] = await Promise.all( [\n\t\t\tbatch.run(),\n\t\t\t...resultPromises,\n\t\t] );\n\t\treturn results;\n\t};\n\n/**\n * Action triggered to save an entity record's edits.\n *\n * @param {string} kind Kind of the entity.\n * @param {string} name Name of the entity.\n * @param {Object} recordId ID of the record.\n * @param {Object} options Saving options.\n */\nexport const saveEditedEntityRecord =\n\t( kind, name, recordId, options ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\t\tconst entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;\n\n\t\tconst edits = select.getEntityRecordNonTransientEdits(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\t\tconst record = { [ entityIdKey ]: recordId, ...edits };\n\t\treturn await dispatch.saveEntityRecord( kind, name, record, options );\n\t};\n\n/**\n * Action triggered to save only specified properties for the entity.\n *\n * @param {string} kind Kind of the entity.\n * @param {string} name Name of the entity.\n * @param {Object} recordId ID of the record.\n * @param {Array} itemsToSave List of entity properties or property paths to save.\n * @param {Object} options Saving options.\n */\nexport const __experimentalSaveSpecifiedEntityEdits =\n\t( kind, name, recordId, itemsToSave, options ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst edits = select.getEntityRecordNonTransientEdits(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\t\tconst editsToSave = {};\n\n\t\tfor ( const item of itemsToSave ) {\n\t\t\tsetNestedValue( editsToSave, item, getNestedValue( edits, item ) );\n\t\t}\n\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\n\t\tconst entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY;\n\n\t\t// If a record key is provided then update the existing record.\n\t\t// This necessitates providing `recordKey` to saveEntityRecord as part of the\n\t\t// `record` argument (here called `editsToSave`) to stop that action creating\n\t\t// a new record and instead cause it to update the existing record.\n\t\tif ( recordId ) {\n\t\t\teditsToSave[ entityIdKey ] = recordId;\n\t\t}\n\t\treturn await dispatch.saveEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\teditsToSave,\n\t\t\toptions\n\t\t);\n\t};\n\n/**\n * Returns an action object used in signalling that Upload permissions have been received.\n *\n * @deprecated since WP 5.9, use receiveUserPermission instead.\n *\n * @param {boolean} hasUploadPermissions Does the user have permission to upload files?\n *\n * @return {Object} Action object.\n */\nexport function receiveUploadPermissions( hasUploadPermissions ) {\n\tdeprecated( \"wp.data.dispatch( 'core' ).receiveUploadPermissions\", {\n\t\tsince: '5.9',\n\t\talternative: 'receiveUserPermission',\n\t} );\n\n\treturn receiveUserPermission( 'create/media', hasUploadPermissions );\n}\n\n/**\n * Returns an action object used in signalling that the current user has\n * permission to perform an action on a REST resource.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} key A key that represents the action and REST resource.\n * @param {boolean} isAllowed Whether or not the user can perform the action.\n *\n * @return {Object} Action object.\n */\nexport function receiveUserPermission( key, isAllowed ) {\n\treturn {\n\t\ttype: 'RECEIVE_USER_PERMISSION',\n\t\tkey,\n\t\tisAllowed,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the autosaves for a\n * post have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {number} postId The id of the post that is parent to the autosave.\n * @param {Array|Object} autosaves An array of autosaves or singular autosave object.\n *\n * @return {Object} Action object.\n */\nexport function receiveAutosaves( postId, autosaves ) {\n\treturn {\n\t\ttype: 'RECEIVE_AUTOSAVES',\n\t\tpostId,\n\t\tautosaves: Array.isArray( autosaves ) ? autosaves : [ autosaves ],\n\t};\n}\n\n/**\n * Returns an action object signalling that the fallback Navigation\n * Menu id has been received.\n *\n * @param {integer} fallbackId the id of the fallback Navigation Menu\n * @return {Object} Action object.\n */\nexport function receiveNavigationFallbackId( fallbackId ) {\n\treturn {\n\t\ttype: 'RECEIVE_NAVIGATION_FALLBACK_ID',\n\t\tfallbackId,\n\t};\n}\n\n/**\n * Returns an action object used to set the template for a given query.\n *\n * @param {Object} query The lookup query.\n * @param {string} templateId The resolved template id.\n *\n * @return {Object} Action object.\n */\nexport function receiveDefaultTemplateId( query, templateId ) {\n\treturn {\n\t\ttype: 'RECEIVE_DEFAULT_TEMPLATE',\n\t\tquery,\n\t\ttemplateId,\n\t};\n}\n\n/**\n * Action triggered to receive revision items.\n *\n * @param {string} kind Kind of the received entity record revisions.\n * @param {string} name Name of the received entity record revisions.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {Array|Object} records Revisions received.\n * @param {?Object} query Query Object.\n * @param {?boolean} invalidateCache Should invalidate query caches.\n * @param {?Object} meta Meta information about pagination.\n */\nexport const receiveRevisions =\n\t( kind, name, recordKey, records, query, invalidateCache = false, meta ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tconst key =\n\t\t\tentityConfig && entityConfig?.revisionKey\n\t\t\t\t? entityConfig.revisionKey\n\t\t\t\t: DEFAULT_ENTITY_KEY;\n\n\t\tdispatch( {\n\t\t\ttype: 'RECEIVE_ITEM_REVISIONS',\n\t\t\tkey,\n\t\t\titems: Array.isArray( records ) ? records : [ records ],\n\t\t\trecordKey,\n\t\t\tmeta,\n\t\t\t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IACtC8I;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAAEpI,KAAK,EAAEqI,UAAU,EAAG;EAC7D,OAAO;IACNhJ,IAAI,EAAE,0BAA0B;IAChCW,KAAK;IACLqI;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAC5BA,CAAEzI,IAAI,EAAEC,IAAI,EAAEyI,SAAS,EAAExI,OAAO,EAAEC,KAAK,EAAEC,eAAe,GAAG,KAAK,EAAEE,IAAI,KACtE,OAAQ;EAAE6B;AAAS,CAAC,KAAM;EACzB,MAAMC,OAAO,GAAG,MAAMD,QAAQ,CAAEnD,uBAAuB,CAAEgB,IAAI,EAAEC,IAAK,CAAE,CAAC;EACvE,MAAMoC,YAAY,GAAGD,OAAO,CAACE,IAAI,CAC9BC,MAAM,IAAMA,MAAM,CAACvC,IAAI,KAAKA,IAAI,IAAIuC,MAAM,CAACtC,IAAI,KAAKA,IACvD,CAAC;EACD,MAAMiE,GAAG,GACR7B,YAAY,IAAIA,YAAY,EAAEsG,WAAW,GACtCtG,YAAY,CAACsG,WAAW,GACxB1J,kBAAkB;EAEtBkD,QAAQ,CAAE;IACT3C,IAAI,EAAE,wBAAwB;IAC9B0E,GAAG;IACH0E,KAAK,EAAEnJ,KAAK,CAACC,OAAO,CAAEQ,OAAQ,CAAC,GAAGA,OAAO,GAAG,CAAEA,OAAO,CAAE;IACvDwI,SAAS;IACTpI,IAAI;IACJH,KAAK;IACLH,IAAI;IACJC,IAAI;IACJG;EACD,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["fastDeepEqual","v4","uuid","apiFetch","addQueryArgs","deprecated","getNestedValue","setNestedValue","receiveItems","removeItems","receiveQueriedItems","getOrLoadEntitiesConfig","DEFAULT_ENTITY_KEY","createBatch","STORE_NAME","getSyncProvider","receiveUserQuery","queryID","users","type","Array","isArray","receiveCurrentUser","currentUser","addEntities","entities","receiveEntityRecords","kind","name","records","query","invalidateCache","edits","meta","map","record","status","title","action","receiveCurrentTheme","currentTheme","__experimentalReceiveCurrentGlobalStylesId","currentGlobalStylesId","id","__experimentalReceiveThemeBaseGlobalStyles","stylesheet","globalStyles","__experimentalReceiveThemeGlobalStyleVariations","variations","receiveThemeSupports","since","receiveThemeGlobalStyleRevisions","currentId","revisions","alternative","receiveEmbedPreview","url","preview","deleteEntityRecord","recordId","__unstableFetch","throwOnError","dispatch","configs","entityConfig","find","config","error","deletedRecord","lock","__unstableAcquireStoreLock","exclusive","hasError","path","baseURL","method","_error","__unstableReleaseStoreLock","editEntityRecord","options","select","getEntityConfig","Error","mergedEdits","getRawEntityRecord","editedRecord","getEditedEntityRecord","edit","Object","keys","reduce","acc","key","recordValue","editedRecordValue","value","undefined","window","__experimentalEnableSync","syncConfig","globalThis","IS_GUTENBERG_PLUGIN","objectId","getSyncObjectId","update","syncObjectType","undoIgnore","getUndoManager","addRecord","changes","from","to","isCached","undo","undoRecord","redo","redoRecord","__unstableCreateUndoLevel","saveEntityRecord","isAutosave","resolveSelect","entityIdKey","entries","evaluatedValue","updatedRecord","persistedRecord","getCurrentUser","currentUserId","autosavePost","getAutosave","data","includes","newRecord","receiveAutosaves","__unstablePrePersist","__experimentalBatch","requests","batch","api","add","saveEditedEntityRecord","resultPromises","request","results","Promise","all","run","hasEditsForEntityRecord","getEntityRecordNonTransientEdits","__experimentalSaveSpecifiedEntityEdits","itemsToSave","editsToSave","item","receiveUploadPermissions","hasUploadPermissions","receiveUserPermission","isAllowed","postId","autosaves","receiveNavigationFallbackId","fallbackId","receiveDefaultTemplateId","templateId","receiveRevisions","recordKey","revisionKey","items"],"sources":["@wordpress/core-data/src/actions.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { getNestedValue, setNestedValue } from './utils';\nimport { receiveItems, removeItems, receiveQueriedItems } from './queried-data';\nimport { getOrLoadEntitiesConfig, DEFAULT_ENTITY_KEY } from './entities';\nimport { createBatch } from './batch';\nimport { STORE_NAME } from './name';\nimport { getSyncProvider } from './sync';\n\n/**\n * Returns an action object used in signalling that authors have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} queryID Query ID.\n * @param {Array|Object} users Users received.\n *\n * @return {Object} Action object.\n */\nexport function receiveUserQuery( queryID, users ) {\n\treturn {\n\t\ttype: 'RECEIVE_USER_QUERY',\n\t\tusers: Array.isArray( users ) ? users : [ users ],\n\t\tqueryID,\n\t};\n}\n\n/**\n * Returns an action used in signalling that the current user has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {Object} currentUser Current user object.\n *\n * @return {Object} Action object.\n */\nexport function receiveCurrentUser( currentUser ) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_USER',\n\t\tcurrentUser,\n\t};\n}\n\n/**\n * Returns an action object used in adding new entities.\n *\n * @param {Array} entities Entities received.\n *\n * @return {Object} Action object.\n */\nexport function addEntities( entities ) {\n\treturn {\n\t\ttype: 'ADD_ENTITIES',\n\t\tentities,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that entity records have been received.\n *\n * @param {string} kind Kind of the received entity record.\n * @param {string} name Name of the received entity record.\n * @param {Array|Object} records Records received.\n * @param {?Object} query Query Object.\n * @param {?boolean} invalidateCache Should invalidate query caches.\n * @param {?Object} edits Edits to reset.\n * @param {?Object} meta Meta information about pagination.\n * @return {Object} Action object.\n */\nexport function receiveEntityRecords(\n\tkind,\n\tname,\n\trecords,\n\tquery,\n\tinvalidateCache = false,\n\tedits,\n\tmeta\n) {\n\t// Auto drafts should not have titles, but some plugins rely on them so we can't filter this\n\t// on the server.\n\tif ( kind === 'postType' ) {\n\t\trecords = ( Array.isArray( records ) ? records : [ records ] ).map(\n\t\t\t( record ) =>\n\t\t\t\trecord.status === 'auto-draft'\n\t\t\t\t\t? { ...record, title: '' }\n\t\t\t\t\t: record\n\t\t);\n\t}\n\tlet action;\n\tif ( query ) {\n\t\taction = receiveQueriedItems( records, query, edits, meta );\n\t} else {\n\t\taction = receiveItems( records, edits, meta );\n\t}\n\n\treturn {\n\t\t...action,\n\t\tkind,\n\t\tname,\n\t\tinvalidateCache,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the current theme has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {Object} currentTheme The current theme.\n *\n * @return {Object} Action object.\n */\nexport function receiveCurrentTheme( currentTheme ) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_THEME',\n\t\tcurrentTheme,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the current global styles id has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} currentGlobalStylesId The current global styles id.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveCurrentGlobalStylesId(\n\tcurrentGlobalStylesId\n) {\n\treturn {\n\t\ttype: 'RECEIVE_CURRENT_GLOBAL_STYLES_ID',\n\t\tid: currentGlobalStylesId,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme base global styles have been received\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} stylesheet The theme's identifier\n * @param {Object} globalStyles The global styles object.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveThemeBaseGlobalStyles(\n\tstylesheet,\n\tglobalStyles\n) {\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLES',\n\t\tstylesheet,\n\t\tglobalStyles,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme global styles variations have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} stylesheet The theme's identifier\n * @param {Array} variations The global styles variations.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalReceiveThemeGlobalStyleVariations(\n\tstylesheet,\n\tvariations\n) {\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS',\n\t\tstylesheet,\n\t\tvariations,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the index has been received.\n *\n * @deprecated since WP 5.9, this is not useful anymore, use the selector direclty.\n *\n * @return {Object} Action object.\n */\nexport function receiveThemeSupports() {\n\tdeprecated( \"wp.data.dispatch( 'core' ).receiveThemeSupports\", {\n\t\tsince: '5.9',\n\t} );\n\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the theme global styles CPT post revisions have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead.\n *\n * @ignore\n *\n * @param {number} currentId The post id.\n * @param {Array} revisions The global styles revisions.\n *\n * @return {Object} Action object.\n */\nexport function receiveThemeGlobalStyleRevisions( currentId, revisions ) {\n\tdeprecated(\n\t\t\"wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()\",\n\t\t{\n\t\t\tsince: '6.5.0',\n\t\t\talternative: \"wp.data.dispatch( 'core' ).receiveRevisions\",\n\t\t}\n\t);\n\treturn {\n\t\ttype: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS',\n\t\tcurrentId,\n\t\trevisions,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the preview data for\n * a given URl has been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} url URL to preview the embed for.\n * @param {*} preview Preview data.\n *\n * @return {Object} Action object.\n */\nexport function receiveEmbedPreview( url, preview ) {\n\treturn {\n\t\ttype: 'RECEIVE_EMBED_PREVIEW',\n\t\turl,\n\t\tpreview,\n\t};\n}\n\n/**\n * Action triggered to delete an entity record.\n *\n * @param {string} kind Kind of the deleted entity.\n * @param {string} name Name of the deleted entity.\n * @param {string} recordId Record ID of the deleted entity.\n * @param {?Object} query Special query parameters for the\n * DELETE API call.\n * @param {Object} [options] Delete options.\n * @param {Function} [options.__unstableFetch] Internal use only. Function to\n * call instead of `apiFetch()`.\n * Must return a promise.\n * @param {boolean} [options.throwOnError=false] If false, this action suppresses all\n * the exceptions. Defaults to false.\n */\nexport const deleteEntityRecord =\n\t(\n\t\tkind,\n\t\tname,\n\t\trecordId,\n\t\tquery,\n\t\t{ __unstableFetch = apiFetch, throwOnError = false } = {}\n\t) =>\n\tasync ( { dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tlet error;\n\t\tlet deletedRecord = false;\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lock = await dispatch.__unstableAcquireStoreLock(\n\t\t\tSTORE_NAME,\n\t\t\t[ 'entities', 'records', kind, name, recordId ],\n\t\t\t{ exclusive: true }\n\t\t);\n\n\t\ttry {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'DELETE_ENTITY_RECORD_START',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t} );\n\n\t\t\tlet hasError = false;\n\t\t\ttry {\n\t\t\t\tlet path = `${ entityConfig.baseURL }/${ recordId }`;\n\n\t\t\t\tif ( query ) {\n\t\t\t\t\tpath = addQueryArgs( path, query );\n\t\t\t\t}\n\n\t\t\t\tdeletedRecord = await __unstableFetch( {\n\t\t\t\t\tpath,\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t} );\n\n\t\t\t\tawait dispatch( removeItems( kind, name, recordId, true ) );\n\t\t\t} catch ( _error ) {\n\t\t\t\thasError = true;\n\t\t\t\terror = _error;\n\t\t\t}\n\n\t\t\tdispatch( {\n\t\t\t\ttype: 'DELETE_ENTITY_RECORD_FINISH',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\terror,\n\t\t\t} );\n\n\t\t\tif ( hasError && throwOnError ) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn deletedRecord;\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Returns an action object that triggers an\n * edit to an entity record.\n *\n * @param {string} kind Kind of the edited entity record.\n * @param {string} name Name of the edited entity record.\n * @param {number|string} recordId Record ID of the edited entity record.\n * @param {Object} edits The edits.\n * @param {Object} options Options for the edit.\n * @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not.\n *\n * @return {Object} Action object.\n */\nexport const editEntityRecord =\n\t( kind, name, recordId, edits, options = {} ) =>\n\t( { select, dispatch } ) => {\n\t\tconst entityConfig = select.getEntityConfig( kind, name );\n\t\tif ( ! entityConfig ) {\n\t\t\tthrow new Error(\n\t\t\t\t`The entity being edited (${ kind }, ${ name }) does not have a loaded config.`\n\t\t\t);\n\t\t}\n\t\tconst { mergedEdits = {} } = entityConfig;\n\t\tconst record = select.getRawEntityRecord( kind, name, recordId );\n\t\tconst editedRecord = select.getEditedEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\n\t\tconst edit = {\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId,\n\t\t\t// Clear edits when they are equal to their persisted counterparts\n\t\t\t// so that the property is not considered dirty.\n\t\t\tedits: Object.keys( edits ).reduce( ( acc, key ) => {\n\t\t\t\tconst recordValue = record[ key ];\n\t\t\t\tconst editedRecordValue = editedRecord[ key ];\n\t\t\t\tconst value = mergedEdits[ key ]\n\t\t\t\t\t? { ...editedRecordValue, ...edits[ key ] }\n\t\t\t\t\t: edits[ key ];\n\t\t\t\tacc[ key ] = fastDeepEqual( recordValue, value )\n\t\t\t\t\t? undefined\n\t\t\t\t\t: value;\n\t\t\t\treturn acc;\n\t\t\t}, {} ),\n\t\t};\n\t\tif ( window.__experimentalEnableSync && entityConfig.syncConfig ) {\n\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\tconst objectId = entityConfig.getSyncObjectId( recordId );\n\t\t\t\tgetSyncProvider().update(\n\t\t\t\t\tentityConfig.syncObjectType + '--edit',\n\t\t\t\t\tobjectId,\n\t\t\t\t\tedit.edits\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! options.undoIgnore ) {\n\t\t\t\tselect.getUndoManager().addRecord(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: { kind, name, recordId },\n\t\t\t\t\t\t\tchanges: Object.keys( edits ).reduce(\n\t\t\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\t\t\tacc[ key ] = {\n\t\t\t\t\t\t\t\t\t\tfrom: editedRecord[ key ],\n\t\t\t\t\t\t\t\t\t\tto: edits[ key ],\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\toptions.isCached\n\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch( {\n\t\t\t\ttype: 'EDIT_ENTITY_RECORD',\n\t\t\t\t...edit,\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Action triggered to undo the last edit to\n * an entity record, if any.\n */\nexport const undo =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\tconst undoRecord = select.getUndoManager().undo();\n\t\tif ( ! undoRecord ) {\n\t\t\treturn;\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'UNDO',\n\t\t\trecord: undoRecord,\n\t\t} );\n\t};\n\n/**\n * Action triggered to redo the last undoed\n * edit to an entity record, if any.\n */\nexport const redo =\n\t() =>\n\t( { select, dispatch } ) => {\n\t\tconst redoRecord = select.getUndoManager().redo();\n\t\tif ( ! redoRecord ) {\n\t\t\treturn;\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'REDO',\n\t\t\trecord: redoRecord,\n\t\t} );\n\t};\n\n/**\n * Forces the creation of a new undo level.\n *\n * @return {Object} Action object.\n */\nexport const __unstableCreateUndoLevel =\n\t() =>\n\t( { select } ) => {\n\t\tselect.getUndoManager().addRecord();\n\t};\n\n/**\n * Action triggered to save an entity record.\n *\n * @param {string} kind Kind of the received entity.\n * @param {string} name Name of the received entity.\n * @param {Object} record Record to be saved.\n * @param {Object} options Saving options.\n * @param {boolean} [options.isAutosave=false] Whether this is an autosave.\n * @param {Function} [options.__unstableFetch] Internal use only. Function to\n * call instead of `apiFetch()`.\n * Must return a promise.\n * @param {boolean} [options.throwOnError=false] If false, this action suppresses all\n * the exceptions. Defaults to false.\n */\nexport const saveEntityRecord =\n\t(\n\t\tkind,\n\t\tname,\n\t\trecord,\n\t\t{\n\t\t\tisAutosave = false,\n\t\t\t__unstableFetch = apiFetch,\n\t\t\tthrowOnError = false,\n\t\t} = {}\n\t) =>\n\tasync ( { select, resolveSelect, dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\t\tconst entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;\n\t\tconst recordId = record[ entityIdKey ];\n\n\t\tconst lock = await dispatch.__unstableAcquireStoreLock(\n\t\t\tSTORE_NAME,\n\t\t\t[ 'entities', 'records', kind, name, recordId || uuid() ],\n\t\t\t{ exclusive: true }\n\t\t);\n\n\t\ttry {\n\t\t\t// Evaluate optimized edits.\n\t\t\t// (Function edits that should be evaluated on save to avoid expensive computations on every edit.)\n\t\t\tfor ( const [ key, value ] of Object.entries( record ) ) {\n\t\t\t\tif ( typeof value === 'function' ) {\n\t\t\t\t\tconst evaluatedValue = value(\n\t\t\t\t\t\tselect.getEditedEntityRecord( kind, name, recordId )\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.editEntityRecord(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\trecordId,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[ key ]: evaluatedValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t\t);\n\t\t\t\t\trecord[ key ] = evaluatedValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SAVE_ENTITY_RECORD_START',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\tisAutosave,\n\t\t\t} );\n\t\t\tlet updatedRecord;\n\t\t\tlet error;\n\t\t\tlet hasError = false;\n\t\t\ttry {\n\t\t\t\tconst path = `${ entityConfig.baseURL }${\n\t\t\t\t\trecordId ? '/' + recordId : ''\n\t\t\t\t}`;\n\t\t\t\tconst persistedRecord = select.getRawEntityRecord(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecordId\n\t\t\t\t);\n\n\t\t\t\tif ( isAutosave ) {\n\t\t\t\t\t// Most of this autosave logic is very specific to posts.\n\t\t\t\t\t// This is fine for now as it is the only supported autosave,\n\t\t\t\t\t// but ideally this should all be handled in the back end,\n\t\t\t\t\t// so the client just sends and receives objects.\n\t\t\t\t\tconst currentUser = select.getCurrentUser();\n\t\t\t\t\tconst currentUserId = currentUser\n\t\t\t\t\t\t? currentUser.id\n\t\t\t\t\t\t: undefined;\n\t\t\t\t\tconst autosavePost = await resolveSelect.getAutosave(\n\t\t\t\t\t\tpersistedRecord.type,\n\t\t\t\t\t\tpersistedRecord.id,\n\t\t\t\t\t\tcurrentUserId\n\t\t\t\t\t);\n\t\t\t\t\t// Autosaves need all expected fields to be present.\n\t\t\t\t\t// So we fallback to the previous autosave and then\n\t\t\t\t\t// to the actual persisted entity if the edits don't\n\t\t\t\t\t// have a value.\n\t\t\t\t\tlet data = {\n\t\t\t\t\t\t...persistedRecord,\n\t\t\t\t\t\t...autosavePost,\n\t\t\t\t\t\t...record,\n\t\t\t\t\t};\n\t\t\t\t\tdata = Object.keys( data ).reduce(\n\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t'title',\n\t\t\t\t\t\t\t\t\t'excerpt',\n\t\t\t\t\t\t\t\t\t'content',\n\t\t\t\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t\t\t].includes( key )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tacc[ key ] = data[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Do not update the `status` if we have edited it when auto saving.\n\t\t\t\t\t\t\t// It's very important to let the user explicitly save this change,\n\t\t\t\t\t\t\t// because it can lead to unexpected results. An example would be to\n\t\t\t\t\t\t\t// have a draft post and change the status to publish.\n\t\t\t\t\t\t\tstatus:\n\t\t\t\t\t\t\t\tdata.status === 'auto-draft'\n\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tupdatedRecord = await __unstableFetch( {\n\t\t\t\t\t\tpath: `${ path }/autosaves`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata,\n\t\t\t\t\t} );\n\n\t\t\t\t\t// An autosave may be processed by the server as a regular save\n\t\t\t\t\t// when its update is requested by the author and the post had\n\t\t\t\t\t// draft or auto-draft status.\n\t\t\t\t\tif ( persistedRecord.id === updatedRecord.id ) {\n\t\t\t\t\t\tlet newRecord = {\n\t\t\t\t\t\t\t...persistedRecord,\n\t\t\t\t\t\t\t...data,\n\t\t\t\t\t\t\t...updatedRecord,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnewRecord = Object.keys( newRecord ).reduce(\n\t\t\t\t\t\t\t( acc, key ) => {\n\t\t\t\t\t\t\t\t// These properties are persisted in autosaves.\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[ 'title', 'excerpt', 'content' ].includes(\n\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tacc[ key ] = newRecord[ key ];\n\t\t\t\t\t\t\t\t} else if ( key === 'status' ) {\n\t\t\t\t\t\t\t\t\t// Status is only persisted in autosaves when going from\n\t\t\t\t\t\t\t\t\t// \"auto-draft\" to \"draft\".\n\t\t\t\t\t\t\t\t\tacc[ key ] =\n\t\t\t\t\t\t\t\t\t\tpersistedRecord.status ===\n\t\t\t\t\t\t\t\t\t\t\t'auto-draft' &&\n\t\t\t\t\t\t\t\t\t\tnewRecord.status === 'draft'\n\t\t\t\t\t\t\t\t\t\t\t? newRecord.status\n\t\t\t\t\t\t\t\t\t\t\t: persistedRecord.status;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// These properties are not persisted in autosaves.\n\t\t\t\t\t\t\t\t\tacc[ key ] = persistedRecord[ key ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tnewRecord,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatch.receiveAutosaves(\n\t\t\t\t\t\t\tpersistedRecord.id,\n\t\t\t\t\t\t\tupdatedRecord\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet edits = record;\n\t\t\t\t\tif ( entityConfig.__unstablePrePersist ) {\n\t\t\t\t\t\tedits = {\n\t\t\t\t\t\t\t...edits,\n\t\t\t\t\t\t\t...entityConfig.__unstablePrePersist(\n\t\t\t\t\t\t\t\tpersistedRecord,\n\t\t\t\t\t\t\t\tedits\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tupdatedRecord = await __unstableFetch( {\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tmethod: recordId ? 'PUT' : 'POST',\n\t\t\t\t\t\tdata: edits,\n\t\t\t\t\t} );\n\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tupdatedRecord,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tedits\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch ( _error ) {\n\t\t\t\thasError = true;\n\t\t\t\terror = _error;\n\t\t\t}\n\t\t\tdispatch( {\n\t\t\t\ttype: 'SAVE_ENTITY_RECORD_FINISH',\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\trecordId,\n\t\t\t\terror,\n\t\t\t\tisAutosave,\n\t\t\t} );\n\n\t\t\tif ( hasError && throwOnError ) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn updatedRecord;\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Runs multiple core-data actions at the same time using one API request.\n *\n * Example:\n *\n * ```\n * const [ savedRecord, updatedRecord, deletedRecord ] =\n * await dispatch( 'core' ).__experimentalBatch( [\n * ( { saveEntityRecord } ) => saveEntityRecord( 'root', 'widget', widget ),\n * ( { saveEditedEntityRecord } ) => saveEntityRecord( 'root', 'widget', 123 ),\n * ( { deleteEntityRecord } ) => deleteEntityRecord( 'root', 'widget', 123, null ),\n * ] );\n * ```\n *\n * @param {Array} requests Array of functions which are invoked simultaneously.\n * Each function is passed an object containing\n * `saveEntityRecord`, `saveEditedEntityRecord`, and\n * `deleteEntityRecord`.\n *\n * @return {(thunkArgs: Object) => Promise} A promise that resolves to an array containing the return\n * values of each function given in `requests`.\n */\nexport const __experimentalBatch =\n\t( requests ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst batch = createBatch();\n\t\tconst api = {\n\t\t\tsaveEntityRecord( kind, name, record, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.saveEntityRecord( kind, name, record, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t\tsaveEditedEntityRecord( kind, name, recordId, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.saveEditedEntityRecord( kind, name, recordId, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t\tdeleteEntityRecord( kind, name, recordId, query, options ) {\n\t\t\t\treturn batch.add( ( add ) =>\n\t\t\t\t\tdispatch.deleteEntityRecord( kind, name, recordId, query, {\n\t\t\t\t\t\t...options,\n\t\t\t\t\t\t__unstableFetch: add,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t\tconst resultPromises = requests.map( ( request ) => request( api ) );\n\t\tconst [ , ...results ] = await Promise.all( [\n\t\t\tbatch.run(),\n\t\t\t...resultPromises,\n\t\t] );\n\t\treturn results;\n\t};\n\n/**\n * Action triggered to save an entity record's edits.\n *\n * @param {string} kind Kind of the entity.\n * @param {string} name Name of the entity.\n * @param {Object} recordId ID of the record.\n * @param {Object=} options Saving options.\n */\nexport const saveEditedEntityRecord =\n\t( kind, name, recordId, options ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\t\tconst entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY;\n\n\t\tconst edits = select.getEntityRecordNonTransientEdits(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\t\tconst record = { [ entityIdKey ]: recordId, ...edits };\n\t\treturn await dispatch.saveEntityRecord( kind, name, record, options );\n\t};\n\n/**\n * Action triggered to save only specified properties for the entity.\n *\n * @param {string} kind Kind of the entity.\n * @param {string} name Name of the entity.\n * @param {Object} recordId ID of the record.\n * @param {Array} itemsToSave List of entity properties or property paths to save.\n * @param {Object} options Saving options.\n */\nexport const __experimentalSaveSpecifiedEntityEdits =\n\t( kind, name, recordId, itemsToSave, options ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst edits = select.getEntityRecordNonTransientEdits(\n\t\t\tkind,\n\t\t\tname,\n\t\t\trecordId\n\t\t);\n\t\tconst editsToSave = {};\n\n\t\tfor ( const item of itemsToSave ) {\n\t\t\tsetNestedValue( editsToSave, item, getNestedValue( edits, item ) );\n\t\t}\n\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\n\t\tconst entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY;\n\n\t\t// If a record key is provided then update the existing record.\n\t\t// This necessitates providing `recordKey` to saveEntityRecord as part of the\n\t\t// `record` argument (here called `editsToSave`) to stop that action creating\n\t\t// a new record and instead cause it to update the existing record.\n\t\tif ( recordId ) {\n\t\t\teditsToSave[ entityIdKey ] = recordId;\n\t\t}\n\t\treturn await dispatch.saveEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\teditsToSave,\n\t\t\toptions\n\t\t);\n\t};\n\n/**\n * Returns an action object used in signalling that Upload permissions have been received.\n *\n * @deprecated since WP 5.9, use receiveUserPermission instead.\n *\n * @param {boolean} hasUploadPermissions Does the user have permission to upload files?\n *\n * @return {Object} Action object.\n */\nexport function receiveUploadPermissions( hasUploadPermissions ) {\n\tdeprecated( \"wp.data.dispatch( 'core' ).receiveUploadPermissions\", {\n\t\tsince: '5.9',\n\t\talternative: 'receiveUserPermission',\n\t} );\n\n\treturn receiveUserPermission( 'create/media', hasUploadPermissions );\n}\n\n/**\n * Returns an action object used in signalling that the current user has\n * permission to perform an action on a REST resource.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {string} key A key that represents the action and REST resource.\n * @param {boolean} isAllowed Whether or not the user can perform the action.\n *\n * @return {Object} Action object.\n */\nexport function receiveUserPermission( key, isAllowed ) {\n\treturn {\n\t\ttype: 'RECEIVE_USER_PERMISSION',\n\t\tkey,\n\t\tisAllowed,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the autosaves for a\n * post have been received.\n * Ignored from documentation as it's internal to the data store.\n *\n * @ignore\n *\n * @param {number} postId The id of the post that is parent to the autosave.\n * @param {Array|Object} autosaves An array of autosaves or singular autosave object.\n *\n * @return {Object} Action object.\n */\nexport function receiveAutosaves( postId, autosaves ) {\n\treturn {\n\t\ttype: 'RECEIVE_AUTOSAVES',\n\t\tpostId,\n\t\tautosaves: Array.isArray( autosaves ) ? autosaves : [ autosaves ],\n\t};\n}\n\n/**\n * Returns an action object signalling that the fallback Navigation\n * Menu id has been received.\n *\n * @param {integer} fallbackId the id of the fallback Navigation Menu\n * @return {Object} Action object.\n */\nexport function receiveNavigationFallbackId( fallbackId ) {\n\treturn {\n\t\ttype: 'RECEIVE_NAVIGATION_FALLBACK_ID',\n\t\tfallbackId,\n\t};\n}\n\n/**\n * Returns an action object used to set the template for a given query.\n *\n * @param {Object} query The lookup query.\n * @param {string} templateId The resolved template id.\n *\n * @return {Object} Action object.\n */\nexport function receiveDefaultTemplateId( query, templateId ) {\n\treturn {\n\t\ttype: 'RECEIVE_DEFAULT_TEMPLATE',\n\t\tquery,\n\t\ttemplateId,\n\t};\n}\n\n/**\n * Action triggered to receive revision items.\n *\n * @param {string} kind Kind of the received entity record revisions.\n * @param {string} name Name of the received entity record revisions.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {Array|Object} records Revisions received.\n * @param {?Object} query Query Object.\n * @param {?boolean} invalidateCache Should invalidate query caches.\n * @param {?Object} meta Meta information about pagination.\n */\nexport const receiveRevisions =\n\t( kind, name, recordKey, records, query, invalidateCache = false, meta ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst configs = await dispatch( getOrLoadEntitiesConfig( kind, name ) );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.kind === kind && config.name === name\n\t\t);\n\t\tconst key =\n\t\t\tentityConfig && entityConfig?.revisionKey\n\t\t\t\t? entityConfig.revisionKey\n\t\t\t\t: DEFAULT_ENTITY_KEY;\n\n\t\tdispatch( {\n\t\t\ttype: 'RECEIVE_ITEM_REVISIONS',\n\t\t\tkey,\n\t\t\titems: Array.isArray( records ) ? records : [ records ],\n\t\t\trecordKey,\n\t\t\tmeta,\n\t\t\tquery,\n\t\t\tkind,\n\t\t\tname,\n\t\t\tinvalidateCache,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;AAC/C,SAASC,EAAE,IAAIC,IAAI,QAAQ,MAAM;;AAEjC;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,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EAAEE,IAAI,KACtE,OAAQ;EAAE6B;AAAS,CAAC,KAAM;EACzB,MAAMC,OAAO,GAAG,MAAMD,QAAQ,CAAEnD,uBAAuB,CAAEgB,IAAI,EAAEC,IAAK,CAAE,CAAC;EACvE,MAAMoC,YAAY,GAAGD,OAAO,CAACE,IAAI,CAC9BC,MAAM,IAAMA,MAAM,CAACvC,IAAI,KAAKA,IAAI,IAAIuC,MAAM,CAACtC,IAAI,KAAKA,IACvD,CAAC;EACD,MAAMgE,GAAG,GACR5B,YAAY,IAAIA,YAAY,EAAEqG,WAAW,GACtCrG,YAAY,CAACqG,WAAW,GACxBzJ,kBAAkB;EAEtBkD,QAAQ,CAAE;IACT3C,IAAI,EAAE,wBAAwB;IAC9ByE,GAAG;IACH0E,KAAK,EAAElJ,KAAK,CAACC,OAAO,CAAEQ,OAAQ,CAAC,GAAGA,OAAO,GAAG,CAAEA,OAAO,CAAE;IACvDuI,SAAS;IACTnI,IAAI;IACJH,KAAK;IACLH,IAAI;IACJC,IAAI;IACJG;EACD,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","EntityContext"],"sources":["@wordpress/core-data/src/entity-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nexport const EntityContext = createContext( {} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,OAAO,MAAMC,aAAa,GAAGD,aAAa,CAAE,CAAC,CAAE,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import { parse, __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
4
|
+
import { useContext, useMemo } from '@wordpress/element';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Internal dependencies
|
|
10
8
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import { updateFootnotesFromMeta } from './footnotes';
|
|
13
|
-
|
|
14
|
-
/** @typedef {import('@wordpress/blocks').WPBlock} WPBlock */
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const EMPTY_ARRAY = [];
|
|
17
|
-
const EntityContext = createContext({});
|
|
9
|
+
import { EntityContext } from './entity-context';
|
|
18
10
|
|
|
19
11
|
/**
|
|
20
12
|
* Context provider component for providing
|
|
@@ -29,6 +21,7 @@ const EntityContext = createContext({});
|
|
|
29
21
|
* @return {Object} The provided children, wrapped with
|
|
30
22
|
* the entity's context provider.
|
|
31
23
|
*/
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
25
|
export default function EntityProvider({
|
|
33
26
|
kind,
|
|
34
27
|
type: name,
|
|
@@ -48,179 +41,4 @@ export default function EntityProvider({
|
|
|
48
41
|
children: children
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Hook that returns the ID for the nearest
|
|
54
|
-
* provided entity of the specified type.
|
|
55
|
-
*
|
|
56
|
-
* @param {string} kind The entity kind.
|
|
57
|
-
* @param {string} name The entity name.
|
|
58
|
-
*/
|
|
59
|
-
export function useEntityId(kind, name) {
|
|
60
|
-
const context = useContext(EntityContext);
|
|
61
|
-
return context?.[kind]?.[name];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Hook that returns the value and a setter for the
|
|
66
|
-
* specified property of the nearest provided
|
|
67
|
-
* entity of the specified type.
|
|
68
|
-
*
|
|
69
|
-
* @param {string} kind The entity kind.
|
|
70
|
-
* @param {string} name The entity name.
|
|
71
|
-
* @param {string} prop The property name.
|
|
72
|
-
* @param {string} [_id] An entity ID to use instead of the context-provided one.
|
|
73
|
-
*
|
|
74
|
-
* @return {[*, Function, *]} An array where the first item is the
|
|
75
|
-
* property value, the second is the
|
|
76
|
-
* setter and the third is the full value
|
|
77
|
-
* object from REST API containing more
|
|
78
|
-
* information like `raw`, `rendered` and
|
|
79
|
-
* `protected` props.
|
|
80
|
-
*/
|
|
81
|
-
export function useEntityProp(kind, name, prop, _id) {
|
|
82
|
-
const providerId = useEntityId(kind, name);
|
|
83
|
-
const id = _id !== null && _id !== void 0 ? _id : providerId;
|
|
84
|
-
const {
|
|
85
|
-
value,
|
|
86
|
-
fullValue
|
|
87
|
-
} = useSelect(select => {
|
|
88
|
-
const {
|
|
89
|
-
getEntityRecord,
|
|
90
|
-
getEditedEntityRecord
|
|
91
|
-
} = select(STORE_NAME);
|
|
92
|
-
const record = getEntityRecord(kind, name, id); // Trigger resolver.
|
|
93
|
-
const editedRecord = getEditedEntityRecord(kind, name, id);
|
|
94
|
-
return record && editedRecord ? {
|
|
95
|
-
value: editedRecord[prop],
|
|
96
|
-
fullValue: record[prop]
|
|
97
|
-
} : {};
|
|
98
|
-
}, [kind, name, id, prop]);
|
|
99
|
-
const {
|
|
100
|
-
editEntityRecord
|
|
101
|
-
} = useDispatch(STORE_NAME);
|
|
102
|
-
const setValue = useCallback(newValue => {
|
|
103
|
-
editEntityRecord(kind, name, id, {
|
|
104
|
-
[prop]: newValue
|
|
105
|
-
});
|
|
106
|
-
}, [editEntityRecord, kind, name, id, prop]);
|
|
107
|
-
return [value, setValue, fullValue];
|
|
108
|
-
}
|
|
109
|
-
const parsedBlocksCache = new WeakMap();
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Hook that returns block content getters and setters for
|
|
113
|
-
* the nearest provided entity of the specified type.
|
|
114
|
-
*
|
|
115
|
-
* The return value has the shape `[ blocks, onInput, onChange ]`.
|
|
116
|
-
* `onInput` is for block changes that don't create undo levels
|
|
117
|
-
* or dirty the post, non-persistent changes, and `onChange` is for
|
|
118
|
-
* persistent changes. They map directly to the props of a
|
|
119
|
-
* `BlockEditorProvider` and are intended to be used with it,
|
|
120
|
-
* or similar components or hooks.
|
|
121
|
-
*
|
|
122
|
-
* @param {string} kind The entity kind.
|
|
123
|
-
* @param {string} name The entity name.
|
|
124
|
-
* @param {Object} options
|
|
125
|
-
* @param {string} [options.id] An entity ID to use instead of the context-provided one.
|
|
126
|
-
*
|
|
127
|
-
* @return {[WPBlock[], Function, Function]} The block array and setters.
|
|
128
|
-
*/
|
|
129
|
-
export function useEntityBlockEditor(kind, name, {
|
|
130
|
-
id: _id
|
|
131
|
-
} = {}) {
|
|
132
|
-
const providerId = useEntityId(kind, name);
|
|
133
|
-
const id = _id !== null && _id !== void 0 ? _id : providerId;
|
|
134
|
-
const {
|
|
135
|
-
getEntityRecord,
|
|
136
|
-
getEntityRecordEdits
|
|
137
|
-
} = useSelect(STORE_NAME);
|
|
138
|
-
const {
|
|
139
|
-
content,
|
|
140
|
-
editedBlocks,
|
|
141
|
-
meta
|
|
142
|
-
} = useSelect(select => {
|
|
143
|
-
if (!id) {
|
|
144
|
-
return {};
|
|
145
|
-
}
|
|
146
|
-
const {
|
|
147
|
-
getEditedEntityRecord
|
|
148
|
-
} = select(STORE_NAME);
|
|
149
|
-
const editedRecord = getEditedEntityRecord(kind, name, id);
|
|
150
|
-
return {
|
|
151
|
-
editedBlocks: editedRecord.blocks,
|
|
152
|
-
content: editedRecord.content,
|
|
153
|
-
meta: editedRecord.meta
|
|
154
|
-
};
|
|
155
|
-
}, [kind, name, id]);
|
|
156
|
-
const {
|
|
157
|
-
__unstableCreateUndoLevel,
|
|
158
|
-
editEntityRecord
|
|
159
|
-
} = useDispatch(STORE_NAME);
|
|
160
|
-
const blocks = useMemo(() => {
|
|
161
|
-
if (!id) {
|
|
162
|
-
return undefined;
|
|
163
|
-
}
|
|
164
|
-
if (editedBlocks) {
|
|
165
|
-
return editedBlocks;
|
|
166
|
-
}
|
|
167
|
-
if (!content || typeof content !== 'string') {
|
|
168
|
-
return EMPTY_ARRAY;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// If there's an edit, cache the parsed blocks by the edit.
|
|
172
|
-
// If not, cache by the original enity record.
|
|
173
|
-
const edits = getEntityRecordEdits(kind, name, id);
|
|
174
|
-
const isUnedited = !edits || !Object.keys(edits).length;
|
|
175
|
-
const cackeKey = isUnedited ? getEntityRecord(kind, name, id) : edits;
|
|
176
|
-
let _blocks = parsedBlocksCache.get(cackeKey);
|
|
177
|
-
if (!_blocks) {
|
|
178
|
-
_blocks = parse(content);
|
|
179
|
-
parsedBlocksCache.set(cackeKey, _blocks);
|
|
180
|
-
}
|
|
181
|
-
return _blocks;
|
|
182
|
-
}, [kind, name, id, editedBlocks, content, getEntityRecord, getEntityRecordEdits]);
|
|
183
|
-
const updateFootnotes = useCallback(_blocks => updateFootnotesFromMeta(_blocks, meta), [meta]);
|
|
184
|
-
const onChange = useCallback((newBlocks, options) => {
|
|
185
|
-
const noChange = blocks === newBlocks;
|
|
186
|
-
if (noChange) {
|
|
187
|
-
return __unstableCreateUndoLevel(kind, name, id);
|
|
188
|
-
}
|
|
189
|
-
const {
|
|
190
|
-
selection,
|
|
191
|
-
...rest
|
|
192
|
-
} = options;
|
|
193
|
-
|
|
194
|
-
// We create a new function here on every persistent edit
|
|
195
|
-
// to make sure the edit makes the post dirty and creates
|
|
196
|
-
// a new undo level.
|
|
197
|
-
const edits = {
|
|
198
|
-
selection,
|
|
199
|
-
content: ({
|
|
200
|
-
blocks: blocksForSerialization = []
|
|
201
|
-
}) => __unstableSerializeAndClean(blocksForSerialization),
|
|
202
|
-
...updateFootnotes(newBlocks)
|
|
203
|
-
};
|
|
204
|
-
editEntityRecord(kind, name, id, edits, {
|
|
205
|
-
isCached: false,
|
|
206
|
-
...rest
|
|
207
|
-
});
|
|
208
|
-
}, [kind, name, id, blocks, updateFootnotes, __unstableCreateUndoLevel, editEntityRecord]);
|
|
209
|
-
const onInput = useCallback((newBlocks, options) => {
|
|
210
|
-
const {
|
|
211
|
-
selection,
|
|
212
|
-
...rest
|
|
213
|
-
} = options;
|
|
214
|
-
const footnotesChanges = updateFootnotes(newBlocks);
|
|
215
|
-
const edits = {
|
|
216
|
-
selection,
|
|
217
|
-
...footnotesChanges
|
|
218
|
-
};
|
|
219
|
-
editEntityRecord(kind, name, id, edits, {
|
|
220
|
-
isCached: true,
|
|
221
|
-
...rest
|
|
222
|
-
});
|
|
223
|
-
}, [kind, name, id, updateFootnotes, editEntityRecord]);
|
|
224
|
-
return [blocks, onInput, onChange];
|
|
225
|
-
}
|
|
226
44
|
//# sourceMappingURL=entity-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useContext","useCallback","useMemo","useSelect","useDispatch","parse","__unstableSerializeAndClean","STORE_NAME","updateFootnotesFromMeta","jsx","_jsx","EMPTY_ARRAY","EntityContext","EntityProvider","kind","type","name","id","children","parent","childContext","Provider","value","useEntityId","context","useEntityProp","prop","_id","providerId","fullValue","select","getEntityRecord","getEditedEntityRecord","record","editedRecord","editEntityRecord","setValue","newValue","parsedBlocksCache","WeakMap","useEntityBlockEditor","getEntityRecordEdits","content","editedBlocks","meta","blocks","__unstableCreateUndoLevel","undefined","edits","isUnedited","Object","keys","length","cackeKey","_blocks","get","set","updateFootnotes","onChange","newBlocks","options","noChange","selection","rest","blocksForSerialization","isCached","onInput","footnotesChanges"],"sources":["@wordpress/core-data/src/entity-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from './name';\nimport { updateFootnotesFromMeta } from './footnotes';\n\n/** @typedef {import('@wordpress/blocks').WPBlock} WPBlock */\n\nconst EMPTY_ARRAY = [];\n\nconst EntityContext = createContext( {} );\n\n/**\n * Context provider component for providing\n * an entity for a specific entity.\n *\n * @param {Object} props The component's props.\n * @param {string} props.kind The entity kind.\n * @param {string} props.type The entity name.\n * @param {number} props.id The entity ID.\n * @param {*} props.children The children to wrap.\n *\n * @return {Object} The provided children, wrapped with\n * the entity's context provider.\n */\nexport default function EntityProvider( { kind, type: name, id, children } ) {\n\tconst parent = useContext( EntityContext );\n\tconst childContext = useMemo(\n\t\t() => ( {\n\t\t\t...parent,\n\t\t\t[ kind ]: {\n\t\t\t\t...parent?.[ kind ],\n\t\t\t\t[ name ]: id,\n\t\t\t},\n\t\t} ),\n\t\t[ parent, kind, name, id ]\n\t);\n\treturn (\n\t\t<EntityContext.Provider value={ childContext }>\n\t\t\t{ children }\n\t\t</EntityContext.Provider>\n\t);\n}\n\n/**\n * Hook that returns the ID for the nearest\n * provided entity of the specified type.\n *\n * @param {string} kind The entity kind.\n * @param {string} name The entity name.\n */\nexport function useEntityId( kind, name ) {\n\tconst context = useContext( EntityContext );\n\treturn context?.[ kind ]?.[ name ];\n}\n\n/**\n * Hook that returns the value and a setter for the\n * specified property of the nearest provided\n * entity of the specified type.\n *\n * @param {string} kind The entity kind.\n * @param {string} name The entity name.\n * @param {string} prop The property name.\n * @param {string} [_id] An entity ID to use instead of the context-provided one.\n *\n * @return {[*, Function, *]} An array where the first item is the\n * property value, the second is the\n * setter and the third is the full value\n * \t\t\t\t\t\t\t object from REST API containing more\n * \t\t\t\t\t\t\t information like `raw`, `rendered` and\n * \t\t\t\t\t\t\t `protected` props.\n */\nexport function useEntityProp( kind, name, prop, _id ) {\n\tconst providerId = useEntityId( kind, name );\n\tconst id = _id ?? providerId;\n\n\tconst { value, fullValue } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEditedEntityRecord } =\n\t\t\t\tselect( STORE_NAME );\n\t\t\tconst record = getEntityRecord( kind, name, id ); // Trigger resolver.\n\t\t\tconst editedRecord = getEditedEntityRecord( kind, name, id );\n\t\t\treturn record && editedRecord\n\t\t\t\t? {\n\t\t\t\t\t\tvalue: editedRecord[ prop ],\n\t\t\t\t\t\tfullValue: record[ prop ],\n\t\t\t\t }\n\t\t\t\t: {};\n\t\t},\n\t\t[ kind, name, id, prop ]\n\t);\n\tconst { editEntityRecord } = useDispatch( STORE_NAME );\n\tconst setValue = useCallback(\n\t\t( newValue ) => {\n\t\t\teditEntityRecord( kind, name, id, {\n\t\t\t\t[ prop ]: newValue,\n\t\t\t} );\n\t\t},\n\t\t[ editEntityRecord, kind, name, id, prop ]\n\t);\n\n\treturn [ value, setValue, fullValue ];\n}\n\nconst parsedBlocksCache = new WeakMap();\n\n/**\n * Hook that returns block content getters and setters for\n * the nearest provided entity of the specified type.\n *\n * The return value has the shape `[ blocks, onInput, onChange ]`.\n * `onInput` is for block changes that don't create undo levels\n * or dirty the post, non-persistent changes, and `onChange` is for\n * persistent changes. They map directly to the props of a\n * `BlockEditorProvider` and are intended to be used with it,\n * or similar components or hooks.\n *\n * @param {string} kind The entity kind.\n * @param {string} name The entity name.\n * @param {Object} options\n * @param {string} [options.id] An entity ID to use instead of the context-provided one.\n *\n * @return {[WPBlock[], Function, Function]} The block array and setters.\n */\nexport function useEntityBlockEditor( kind, name, { id: _id } = {} ) {\n\tconst providerId = useEntityId( kind, name );\n\tconst id = _id ?? providerId;\n\tconst { getEntityRecord, getEntityRecordEdits } = useSelect( STORE_NAME );\n\tconst { content, editedBlocks, meta } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! id ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst { getEditedEntityRecord } = select( STORE_NAME );\n\t\t\tconst editedRecord = getEditedEntityRecord( kind, name, id );\n\t\t\treturn {\n\t\t\t\teditedBlocks: editedRecord.blocks,\n\t\t\t\tcontent: editedRecord.content,\n\t\t\t\tmeta: editedRecord.meta,\n\t\t\t};\n\t\t},\n\t\t[ kind, name, id ]\n\t);\n\tconst { __unstableCreateUndoLevel, editEntityRecord } =\n\t\tuseDispatch( STORE_NAME );\n\n\tconst blocks = useMemo( () => {\n\t\tif ( ! id ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( editedBlocks ) {\n\t\t\treturn editedBlocks;\n\t\t}\n\n\t\tif ( ! content || typeof content !== 'string' ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\t// If there's an edit, cache the parsed blocks by the edit.\n\t\t// If not, cache by the original enity record.\n\t\tconst edits = getEntityRecordEdits( kind, name, id );\n\t\tconst isUnedited = ! edits || ! Object.keys( edits ).length;\n\t\tconst cackeKey = isUnedited ? getEntityRecord( kind, name, id ) : edits;\n\t\tlet _blocks = parsedBlocksCache.get( cackeKey );\n\n\t\tif ( ! _blocks ) {\n\t\t\t_blocks = parse( content );\n\t\t\tparsedBlocksCache.set( cackeKey, _blocks );\n\t\t}\n\n\t\treturn _blocks;\n\t}, [\n\t\tkind,\n\t\tname,\n\t\tid,\n\t\teditedBlocks,\n\t\tcontent,\n\t\tgetEntityRecord,\n\t\tgetEntityRecordEdits,\n\t] );\n\n\tconst updateFootnotes = useCallback(\n\t\t( _blocks ) => updateFootnotesFromMeta( _blocks, meta ),\n\t\t[ meta ]\n\t);\n\n\tconst onChange = useCallback(\n\t\t( newBlocks, options ) => {\n\t\t\tconst noChange = blocks === newBlocks;\n\t\t\tif ( noChange ) {\n\t\t\t\treturn __unstableCreateUndoLevel( kind, name, id );\n\t\t\t}\n\t\t\tconst { selection, ...rest } = options;\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\tconst edits = {\n\t\t\t\tselection,\n\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t...updateFootnotes( newBlocks ),\n\t\t\t};\n\n\t\t\teditEntityRecord( kind, name, id, edits, {\n\t\t\t\tisCached: false,\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t},\n\t\t[\n\t\t\tkind,\n\t\t\tname,\n\t\t\tid,\n\t\t\tblocks,\n\t\t\tupdateFootnotes,\n\t\t\t__unstableCreateUndoLevel,\n\t\t\teditEntityRecord,\n\t\t]\n\t);\n\n\tconst onInput = useCallback(\n\t\t( newBlocks, options ) => {\n\t\t\tconst { selection, ...rest } = options;\n\t\t\tconst footnotesChanges = updateFootnotes( newBlocks );\n\t\t\tconst edits = { selection, ...footnotesChanges };\n\n\t\t\teditEntityRecord( kind, name, id, edits, {\n\t\t\t\tisCached: true,\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t},\n\t\t[ kind, name, id, updateFootnotes, editEntityRecord ]\n\t);\n\n\treturn [ blocks, onInput, onChange ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,OAAO,QACD,oBAAoB;AAC3B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;;AAEtE;AACA;AACA;AACA,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,uBAAuB,QAAQ,aAAa;;AAErD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEA,MAAMC,WAAW,GAAG,EAAE;AAEtB,MAAMC,aAAa,GAAGb,aAAa,CAAE,CAAC,CAAE,CAAC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASc,cAAcA,CAAE;EAAEC,IAAI;EAAEC,IAAI,EAAEC,IAAI;EAAEC,EAAE;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAMC,MAAM,GAAGnB,UAAU,CAAEY,aAAc,CAAC;EAC1C,MAAMQ,YAAY,GAAGlB,OAAO,CAC3B,OAAQ;IACP,GAAGiB,MAAM;IACT,CAAEL,IAAI,GAAI;MACT,GAAGK,MAAM,GAAIL,IAAI,CAAE;MACnB,CAAEE,IAAI,GAAIC;IACX;EACD,CAAC,CAAE,EACH,CAAEE,MAAM,EAAEL,IAAI,EAAEE,IAAI,EAAEC,EA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eAAe,EAAEtB,gBAAgB,CACpD,CAAC;EAED,OAAO,CAAEU,MAAM,EAAEqB,OAAO,EAAER,QAAQ,CAAE;AACrC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useContext","useMemo","EntityContext","jsx","_jsx","EntityProvider","kind","type","name","id","children","parent","childContext","Provider","value"],"sources":["@wordpress/core-data/src/entity-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { EntityContext } from './entity-context';\n\n/**\n * Context provider component for providing\n * an entity for a specific entity.\n *\n * @param {Object} props The component's props.\n * @param {string} props.kind The entity kind.\n * @param {string} props.type The entity name.\n * @param {number} props.id The entity ID.\n * @param {*} props.children The children to wrap.\n *\n * @return {Object} The provided children, wrapped with\n * the entity's context provider.\n */\nexport default function EntityProvider( { kind, type: name, id, children } ) {\n\tconst parent = useContext( EntityContext );\n\tconst childContext = useMemo(\n\t\t() => ( {\n\t\t\t...parent,\n\t\t\t[ kind ]: {\n\t\t\t\t...parent?.[ kind ],\n\t\t\t\t[ name ]: id,\n\t\t\t},\n\t\t} ),\n\t\t[ parent, kind, name, id ]\n\t);\n\treturn (\n\t\t<EntityContext.Provider value={ childContext }>\n\t\t\t{ children }\n\t\t</EntityContext.Provider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,aAAa,QAAQ,kBAAkB;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,SAAAC,GAAA,IAAAC,IAAA;AAaA,eAAe,SAASC,cAAcA,CAAE;EAAEC,IAAI;EAAEC,IAAI,EAAEC,IAAI;EAAEC,EAAE;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAMC,MAAM,GAAGX,UAAU,CAAEE,aAAc,CAAC;EAC1C,MAAMU,YAAY,GAAGX,OAAO,CAC3B,OAAQ;IACP,GAAGU,MAAM;IACT,CAAEL,IAAI,GAAI;MACT,GAAGK,MAAM,GAAIL,IAAI,CAAE;MACnB,CAAEE,IAAI,GAAIC;IACX;EACD,CAAC,CAAE,EACH,CAAEE,MAAM,EAAEL,IAAI,EAAEE,IAAI,EAAEC,EAAE,CACzB,CAAC;EACD,oBACCL,IAAA,CAACF,aAAa,CAACW,QAAQ;IAACC,KAAK,EAAGF,YAAc;IAAAF,QAAA,EAC3CA;EAAQ,CACa,CAAC;AAE3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/menu-location.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface MenuLocation< C extends Context > {\n\t\t\t/**\n\t\t\t * The name of the menu location.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * The description of the menu location.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * The ID of the assigned menu.\n\t\t\t */\n\t\t\tmenu: number;\n\t\t}\n\t}\n}\n\nexport type MenuLocation< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.MenuLocation< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/menu-location.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\t/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n\t\texport interface MenuLocation< C extends Context > {\n\t\t\t/**\n\t\t\t * The name of the menu location.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * The description of the menu location.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * The ID of the assigned menu.\n\t\t\t */\n\t\t\tmenu: number;\n\t\t}\n\t}\n}\n\nexport type MenuLocation< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.MenuLocation< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/settings.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tOmitNevers,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Settings< C extends Context > {\n\t\t\t/**\n\t\t\t * What to show on the front page\n\t\t\t */\n\t\t\tshow_on_front: string;\n\t\t\t/**\n\t\t\t * The ID of the page that should be displayed on the front page\n\t\t\t */\n\t\t\tpage_on_front: number;\n\t\t\t/**\n\t\t\t * Site title.\n\t\t\t */\n\t\t\ttitle: string;\n\t\t\t/**\n\t\t\t * Site tagline.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Site URL.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * This address is used for admin purposes, like new user notification.\n\t\t\t */\n\t\t\temail: string;\n\t\t\t/**\n\t\t\t * A city in the same timezone as you.\n\t\t\t */\n\t\t\ttimezone: string;\n\t\t\t/**\n\t\t\t * A date format for all date strings.\n\t\t\t */\n\t\t\tdate_format: string;\n\t\t\t/**\n\t\t\t * A time format for all time strings.\n\t\t\t */\n\t\t\ttime_format: string;\n\t\t\t/**\n\t\t\t * A day number of the week that the week should start on.\n\t\t\t */\n\t\t\tstart_of_week: number;\n\t\t\t/**\n\t\t\t * WordPress locale code.\n\t\t\t */\n\t\t\tlanguage: string;\n\t\t\t/**\n\t\t\t * Convert emoticons like :-) and :-P to graphics on display.\n\t\t\t */\n\t\t\tuse_smilies: boolean;\n\t\t\t/**\n\t\t\t * Default post category.\n\t\t\t */\n\t\t\tdefault_category: number;\n\t\t\t/**\n\t\t\t * Default post format.\n\t\t\t */\n\t\t\tdefault_post_format: string;\n\t\t\t/**\n\t\t\t * Blog pages show at most.\n\t\t\t */\n\t\t\tposts_per_page: number;\n\t\t\t/**\n\t\t\t * Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.\n\t\t\t */\n\t\t\tdefault_ping_status: PingStatus;\n\t\t\t/**\n\t\t\t * Allow people to submit comments on new posts.\n\t\t\t */\n\t\t\tdefault_comment_status: CommentingStatus;\n\t\t\t/**\n\t\t\t * Site logo.\n\t\t\t */\n\t\t\tsite_logo: number;\n\t\t\t/**\n\t\t\t * Site icon.\n\t\t\t */\n\t\t\tsite_icon: number;\n\t\t}\n\t}\n}\n\nexport type Settings< C extends Context = 'view' > = OmitNevers<\n\t_BaseEntityRecords.Settings< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/settings.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tOmitNevers,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\t/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n\t\texport interface Settings< C extends Context > {\n\t\t\t/**\n\t\t\t * What to show on the front page\n\t\t\t */\n\t\t\tshow_on_front: string;\n\t\t\t/**\n\t\t\t * The ID of the page that should be displayed on the front page\n\t\t\t */\n\t\t\tpage_on_front: number;\n\t\t\t/**\n\t\t\t * Site title.\n\t\t\t */\n\t\t\ttitle: string;\n\t\t\t/**\n\t\t\t * Site tagline.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Site URL.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * This address is used for admin purposes, like new user notification.\n\t\t\t */\n\t\t\temail: string;\n\t\t\t/**\n\t\t\t * A city in the same timezone as you.\n\t\t\t */\n\t\t\ttimezone: string;\n\t\t\t/**\n\t\t\t * A date format for all date strings.\n\t\t\t */\n\t\t\tdate_format: string;\n\t\t\t/**\n\t\t\t * A time format for all time strings.\n\t\t\t */\n\t\t\ttime_format: string;\n\t\t\t/**\n\t\t\t * A day number of the week that the week should start on.\n\t\t\t */\n\t\t\tstart_of_week: number;\n\t\t\t/**\n\t\t\t * WordPress locale code.\n\t\t\t */\n\t\t\tlanguage: string;\n\t\t\t/**\n\t\t\t * Convert emoticons like :-) and :-P to graphics on display.\n\t\t\t */\n\t\t\tuse_smilies: boolean;\n\t\t\t/**\n\t\t\t * Default post category.\n\t\t\t */\n\t\t\tdefault_category: number;\n\t\t\t/**\n\t\t\t * Default post format.\n\t\t\t */\n\t\t\tdefault_post_format: string;\n\t\t\t/**\n\t\t\t * Blog pages show at most.\n\t\t\t */\n\t\t\tposts_per_page: number;\n\t\t\t/**\n\t\t\t * Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.\n\t\t\t */\n\t\t\tdefault_ping_status: PingStatus;\n\t\t\t/**\n\t\t\t * Allow people to submit comments on new posts.\n\t\t\t */\n\t\t\tdefault_comment_status: CommentingStatus;\n\t\t\t/**\n\t\t\t * Site logo.\n\t\t\t */\n\t\t\tsite_logo: number;\n\t\t\t/**\n\t\t\t * Site icon.\n\t\t\t */\n\t\t\tsite_icon: number;\n\t\t}\n\t}\n}\n\nexport type Settings< C extends Context = 'view' > = OmitNevers<\n\t_BaseEntityRecords.Settings< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/theme.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, PostFormat, RenderedText, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Theme< C extends Context > {\n\t\t\t/**\n\t\t\t * The theme's stylesheet. This uniquely identifies the theme.\n\t\t\t */\n\t\t\tstylesheet: string;\n\t\t\t/**\n\t\t\t * The theme's template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme's stylesheet.\n\t\t\t */\n\t\t\ttemplate: string;\n\t\t\t/**\n\t\t\t * The theme author.\n\t\t\t */\n\t\t\tauthor: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The website of the theme author.\n\t\t\t */\n\t\t\tauthor_uri: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * A description of the theme.\n\t\t\t */\n\t\t\tdescription: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The name of the theme.\n\t\t\t */\n\t\t\tname: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The minimum PHP version required for the theme to work.\n\t\t\t */\n\t\t\trequires_php: string;\n\t\t\t/**\n\t\t\t * The minimum WordPress version required for the theme to work.\n\t\t\t */\n\t\t\trequires_wp: string;\n\t\t\t/**\n\t\t\t * The theme's screenshot URL.\n\t\t\t */\n\t\t\tscreenshot: string;\n\t\t\t/**\n\t\t\t * Tags indicating styles and features of the theme.\n\t\t\t */\n\t\t\ttags: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The theme's text domain.\n\t\t\t */\n\t\t\ttextdomain: string;\n\t\t\t/**\n\t\t\t * Features supported by this theme.\n\t\t\t */\n\t\t\ttheme_supports: ThemeSupports;\n\t\t\t/**\n\t\t\t * The URI of the theme's webpage.\n\t\t\t */\n\t\t\ttheme_uri: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The theme's current version.\n\t\t\t */\n\t\t\tversion: string;\n\t\t\t/**\n\t\t\t * A named status for the theme.\n\t\t\t */\n\t\t\tstatus: ThemeStatus;\n\t\t}\n\n\t\texport type ThemeStatus = 'active' | 'inactive';\n\n\t\texport interface ThemeSupports {\n\t\t\t/**\n\t\t\t * Whether theme opts in to wide alignment CSS class.\n\t\t\t */\n\t\t\t'align-wide': boolean;\n\t\t\t/**\n\t\t\t * Whether appearanceTools are enabled in Global Styles.\n\t\t\t */\n\t\t\t'appearance-tools': boolean;\n\t\t\t/**\n\t\t\t * Whether posts and comments RSS feed links are added to head.\n\t\t\t */\n\t\t\t'automatic-feed-links': boolean;\n\t\t\t/**\n\t\t\t * Whether border settings are enabled.\n\t\t\t */\n\t\t\tborder: boolean;\n\t\t\t/**\n\t\t\t * Custom background if defined by the theme.\n\t\t\t */\n\t\t\t'custom-background': boolean | CustomBackground;\n\t\t\t/**\n\t\t\t * Custom header if defined by the theme.\n\t\t\t */\n\t\t\t'custom-header': boolean | CustomHeader;\n\t\t\t/**\n\t\t\t * Custom logo if defined by the theme.\n\t\t\t */\n\t\t\t'custom-logo': boolean | CustomLogo;\n\t\t\t/**\n\t\t\t * Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.\n\t\t\t */\n\t\t\t'customize-selective-refresh-widgets': boolean;\n\t\t\t/**\n\t\t\t * Whether theme opts in to the dark editor style UI.\n\t\t\t */\n\t\t\t'dark-editor-style': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom colors.\n\t\t\t */\n\t\t\t'disable-custom-colors': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom font sizes.\n\t\t\t */\n\t\t\t'disable-custom-font-sizes': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom gradients.\n\t\t\t */\n\t\t\t'disable-custom-gradients': boolean;\n\t\t\t/**\n\t\t\t * Custom color palette if defined by the theme.\n\t\t\t */\n\t\t\t'editor-color-palette': boolean | Color[];\n\t\t\t/**\n\t\t\t * Custom font sizes if defined by the theme.\n\t\t\t */\n\t\t\t'editor-font-sizes': boolean | FontSize[];\n\t\t\t/**\n\t\t\t * Custom spacing sizes if defined by the theme.\n\t\t\t */\n\t\t\t'editor-spacing-sizes': boolean | SpacingSize[];\n\t\t\t/**\n\t\t\t * Custom gradient presets if defined by the theme.\n\t\t\t */\n\t\t\t'editor-gradient-presets': boolean | GradientPreset[];\n\t\t\t/**\n\t\t\t * Whether theme opts in to the editor styles CSS wrapper.\n\t\t\t */\n\t\t\t'editor-styles': boolean;\n\t\t\t/**\n\t\t\t * Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.\n\t\t\t */\n\t\t\thtml5: boolean | Html5Option[];\n\t\t\t/**\n\t\t\t * Post formats supported.\n\t\t\t */\n\t\t\tformats: PostFormat[];\n\t\t\t/**\n\t\t\t * Whether link colors are enabled.\n\t\t\t */\n\t\t\t'link-color': boolean;\n\t\t\t/**\n\t\t\t * The post types that support thumbnails or true if all post types are supported.\n\t\t\t */\n\t\t\t'post-thumbnails': boolean | string[];\n\t\t\t/**\n\t\t\t * Whether the theme supports responsive embedded content.\n\t\t\t */\n\t\t\t'responsive-embeds': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme can manage the document title tag.\n\t\t\t */\n\t\t\t'title-tag': boolean;\n\t\t\t/**\n\t\t\t * Whether theme opts in to default WordPress block styles for viewing.\n\t\t\t */\n\t\t\t'wp-block-styles': boolean;\n\t\t}\n\n\t\texport interface CustomBackground {\n\t\t\t'default-image': string;\n\t\t\t'default-preset': 'default' | 'fill' | 'fit' | 'repeat' | 'custom';\n\t\t\t'default-position-x': 'left' | 'center' | 'right';\n\t\t\t'default-position-y': 'left' | 'center' | 'right';\n\t\t\t'default-size': 'auto' | 'contain' | 'cover';\n\t\t\t'default-repeat': 'repeat-x' | 'repeat-y' | 'repeat' | 'no-repeat';\n\t\t\t'default-attachment': 'scroll' | 'fixed';\n\t\t\t'default-color': string;\n\t\t}\n\n\t\texport interface CustomHeader {\n\t\t\t'default-image': string;\n\t\t\t'random-default': boolean;\n\t\t\twidth: number;\n\t\t\theight: number;\n\t\t\t'flex-height': boolean;\n\t\t\t'flex-width': boolean;\n\t\t\t'default-text-color': string;\n\t\t\t'header-text': boolean;\n\t\t\tuploads: boolean;\n\t\t\tvideo: boolean;\n\t\t}\n\n\t\texport interface CustomLogo {\n\t\t\twidth: number;\n\t\t\theight: number;\n\t\t\t'flex-width': boolean;\n\t\t\t'flex-height': boolean;\n\t\t\t'header-text': string[];\n\t\t\t'unlink-homepage-logo': boolean;\n\t\t}\n\n\t\texport interface Color {\n\t\t\tname: string;\n\t\t\tslug: string;\n\t\t\tcolor: string;\n\t\t}\n\n\t\texport interface FontSize {\n\t\t\tname: string;\n\t\t\tsize: number;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport interface SpacingSize {\n\t\t\tname: string;\n\t\t\tsize: number;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport interface GradientPreset {\n\t\t\tname: string;\n\t\t\tgradient: string;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport type Html5Option =\n\t\t\t| 'search-form'\n\t\t\t| 'comment-form'\n\t\t\t| 'comment-list'\n\t\t\t| 'gallery'\n\t\t\t| 'caption'\n\t\t\t| 'script'\n\t\t\t| 'style';\n\t}\n}\n\nexport type Theme< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Theme< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/theme.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, PostFormat, RenderedText, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\t/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n\t\texport interface Theme< C extends Context > {\n\t\t\t/**\n\t\t\t * The theme's stylesheet. This uniquely identifies the theme.\n\t\t\t */\n\t\t\tstylesheet: string;\n\t\t\t/**\n\t\t\t * The theme's template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme's stylesheet.\n\t\t\t */\n\t\t\ttemplate: string;\n\t\t\t/**\n\t\t\t * The theme author.\n\t\t\t */\n\t\t\tauthor: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The website of the theme author.\n\t\t\t */\n\t\t\tauthor_uri: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * A description of the theme.\n\t\t\t */\n\t\t\tdescription: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The name of the theme.\n\t\t\t */\n\t\t\tname: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The minimum PHP version required for the theme to work.\n\t\t\t */\n\t\t\trequires_php: string;\n\t\t\t/**\n\t\t\t * The minimum WordPress version required for the theme to work.\n\t\t\t */\n\t\t\trequires_wp: string;\n\t\t\t/**\n\t\t\t * The theme's screenshot URL.\n\t\t\t */\n\t\t\tscreenshot: string;\n\t\t\t/**\n\t\t\t * Tags indicating styles and features of the theme.\n\t\t\t */\n\t\t\ttags: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The theme's text domain.\n\t\t\t */\n\t\t\ttextdomain: string;\n\t\t\t/**\n\t\t\t * Features supported by this theme.\n\t\t\t */\n\t\t\ttheme_supports: ThemeSupports;\n\t\t\t/**\n\t\t\t * The URI of the theme's webpage.\n\t\t\t */\n\t\t\ttheme_uri: RenderedText< 'edit' >;\n\t\t\t/**\n\t\t\t * The theme's current version.\n\t\t\t */\n\t\t\tversion: string;\n\t\t\t/**\n\t\t\t * A named status for the theme.\n\t\t\t */\n\t\t\tstatus: ThemeStatus;\n\t\t}\n\n\t\texport type ThemeStatus = 'active' | 'inactive';\n\n\t\texport interface ThemeSupports {\n\t\t\t/**\n\t\t\t * Whether theme opts in to wide alignment CSS class.\n\t\t\t */\n\t\t\t'align-wide': boolean;\n\t\t\t/**\n\t\t\t * Whether appearanceTools are enabled in Global Styles.\n\t\t\t */\n\t\t\t'appearance-tools': boolean;\n\t\t\t/**\n\t\t\t * Whether posts and comments RSS feed links are added to head.\n\t\t\t */\n\t\t\t'automatic-feed-links': boolean;\n\t\t\t/**\n\t\t\t * Whether border settings are enabled.\n\t\t\t */\n\t\t\tborder: boolean;\n\t\t\t/**\n\t\t\t * Custom background if defined by the theme.\n\t\t\t */\n\t\t\t'custom-background': boolean | CustomBackground;\n\t\t\t/**\n\t\t\t * Custom header if defined by the theme.\n\t\t\t */\n\t\t\t'custom-header': boolean | CustomHeader;\n\t\t\t/**\n\t\t\t * Custom logo if defined by the theme.\n\t\t\t */\n\t\t\t'custom-logo': boolean | CustomLogo;\n\t\t\t/**\n\t\t\t * Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.\n\t\t\t */\n\t\t\t'customize-selective-refresh-widgets': boolean;\n\t\t\t/**\n\t\t\t * Whether theme opts in to the dark editor style UI.\n\t\t\t */\n\t\t\t'dark-editor-style': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom colors.\n\t\t\t */\n\t\t\t'disable-custom-colors': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom font sizes.\n\t\t\t */\n\t\t\t'disable-custom-font-sizes': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme disables custom gradients.\n\t\t\t */\n\t\t\t'disable-custom-gradients': boolean;\n\t\t\t/**\n\t\t\t * Custom color palette if defined by the theme.\n\t\t\t */\n\t\t\t'editor-color-palette': boolean | Color[];\n\t\t\t/**\n\t\t\t * Custom font sizes if defined by the theme.\n\t\t\t */\n\t\t\t'editor-font-sizes': boolean | FontSize[];\n\t\t\t/**\n\t\t\t * Custom spacing sizes if defined by the theme.\n\t\t\t */\n\t\t\t'editor-spacing-sizes': boolean | SpacingSize[];\n\t\t\t/**\n\t\t\t * Custom gradient presets if defined by the theme.\n\t\t\t */\n\t\t\t'editor-gradient-presets': boolean | GradientPreset[];\n\t\t\t/**\n\t\t\t * Whether theme opts in to the editor styles CSS wrapper.\n\t\t\t */\n\t\t\t'editor-styles': boolean;\n\t\t\t/**\n\t\t\t * Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.\n\t\t\t */\n\t\t\thtml5: boolean | Html5Option[];\n\t\t\t/**\n\t\t\t * Post formats supported.\n\t\t\t */\n\t\t\tformats: PostFormat[];\n\t\t\t/**\n\t\t\t * Whether link colors are enabled.\n\t\t\t */\n\t\t\t'link-color': boolean;\n\t\t\t/**\n\t\t\t * The post types that support thumbnails or true if all post types are supported.\n\t\t\t */\n\t\t\t'post-thumbnails': boolean | string[];\n\t\t\t/**\n\t\t\t * Whether the theme supports responsive embedded content.\n\t\t\t */\n\t\t\t'responsive-embeds': boolean;\n\t\t\t/**\n\t\t\t * Whether the theme can manage the document title tag.\n\t\t\t */\n\t\t\t'title-tag': boolean;\n\t\t\t/**\n\t\t\t * Whether theme opts in to default WordPress block styles for viewing.\n\t\t\t */\n\t\t\t'wp-block-styles': boolean;\n\t\t}\n\n\t\texport interface CustomBackground {\n\t\t\t'default-image': string;\n\t\t\t'default-preset': 'default' | 'fill' | 'fit' | 'repeat' | 'custom';\n\t\t\t'default-position-x': 'left' | 'center' | 'right';\n\t\t\t'default-position-y': 'left' | 'center' | 'right';\n\t\t\t'default-size': 'auto' | 'contain' | 'cover';\n\t\t\t'default-repeat': 'repeat-x' | 'repeat-y' | 'repeat' | 'no-repeat';\n\t\t\t'default-attachment': 'scroll' | 'fixed';\n\t\t\t'default-color': string;\n\t\t}\n\n\t\texport interface CustomHeader {\n\t\t\t'default-image': string;\n\t\t\t'random-default': boolean;\n\t\t\twidth: number;\n\t\t\theight: number;\n\t\t\t'flex-height': boolean;\n\t\t\t'flex-width': boolean;\n\t\t\t'default-text-color': string;\n\t\t\t'header-text': boolean;\n\t\t\tuploads: boolean;\n\t\t\tvideo: boolean;\n\t\t}\n\n\t\texport interface CustomLogo {\n\t\t\twidth: number;\n\t\t\theight: number;\n\t\t\t'flex-width': boolean;\n\t\t\t'flex-height': boolean;\n\t\t\t'header-text': string[];\n\t\t\t'unlink-homepage-logo': boolean;\n\t\t}\n\n\t\texport interface Color {\n\t\t\tname: string;\n\t\t\tslug: string;\n\t\t\tcolor: string;\n\t\t}\n\n\t\texport interface FontSize {\n\t\t\tname: string;\n\t\t\tsize: number;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport interface SpacingSize {\n\t\t\tname: string;\n\t\t\tsize: number;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport interface GradientPreset {\n\t\t\tname: string;\n\t\t\tgradient: string;\n\t\t\tslug: string;\n\t\t}\n\n\t\texport type Html5Option =\n\t\t\t| 'search-form'\n\t\t\t| 'comment-form'\n\t\t\t| 'comment-list'\n\t\t\t| 'gallery'\n\t\t\t| 'caption'\n\t\t\t| 'script'\n\t\t\t| 'style';\n\t}\n}\n\nexport type Theme< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Theme< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/widget-type.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface WidgetType< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique slug identifying the widget type.\n\t\t\t */\n\t\t\tid: string;\n\t\t\t/**\n\t\t\t * Human-readable name identifying the widget type.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * Description of the widget.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Whether the widget supports multiple instances\n\t\t\t */\n\t\t\tis_multi: boolean;\n\t\t\t/**\n\t\t\t * Class name\n\t\t\t */\n\t\t\tclassname: string;\n\t\t}\n\t}\n}\n\nexport type WidgetType< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.WidgetType< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/widget-type.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, OmitNevers } from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\t/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n\t\texport interface WidgetType< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique slug identifying the widget type.\n\t\t\t */\n\t\t\tid: string;\n\t\t\t/**\n\t\t\t * Human-readable name identifying the widget type.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * Description of the widget.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Whether the widget supports multiple instances\n\t\t\t */\n\t\t\tis_multi: boolean;\n\t\t\t/**\n\t\t\t * Class name\n\t\t\t */\n\t\t\tclassname: string;\n\t\t}\n\t}\n}\n\nexport type WidgetType< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.WidgetType< C >\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as useEntityRecord, __experimentalUseEntityRecord } from './use-entity-record';
|
|
2
2
|
export { default as useEntityRecords, __experimentalUseEntityRecords } from './use-entity-records';
|
|
3
3
|
export { default as useResourcePermissions, __experimentalUseResourcePermissions } from './use-resource-permissions';
|
|
4
|
+
export { default as useEntityBlockEditor } from './use-entity-block-editor';
|
|
5
|
+
export { default as useEntityId } from './use-entity-id';
|
|
6
|
+
export { default as useEntityProp } from './use-entity-prop';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","useEntityRecord","__experimentalUseEntityRecord","useEntityRecords","__experimentalUseEntityRecords","useResourcePermissions","__experimentalUseResourcePermissions"],"sources":["@wordpress/core-data/src/hooks/index.ts"],"sourcesContent":["export {\n\tdefault as useEntityRecord,\n\t__experimentalUseEntityRecord,\n} from './use-entity-record';\nexport {\n\tdefault as useEntityRecords,\n\t__experimentalUseEntityRecords,\n} from './use-entity-records';\nexport {\n\tdefault as useResourcePermissions,\n\t__experimentalUseResourcePermissions,\n} from './use-resource-permissions';\n"],"mappings":"AAAA,SACCA,OAAO,IAAIC,eAAe,EAC1BC,6BAA6B,QACvB,qBAAqB;AAC5B,SACCF,OAAO,IAAIG,gBAAgB,EAC3BC,8BAA8B,QACxB,sBAAsB;AAC7B,SACCJ,OAAO,IAAIK,sBAAsB,EACjCC,oCAAoC,QAC9B,4BAA4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","useEntityRecord","__experimentalUseEntityRecord","useEntityRecords","__experimentalUseEntityRecords","useResourcePermissions","__experimentalUseResourcePermissions","useEntityBlockEditor","useEntityId","useEntityProp"],"sources":["@wordpress/core-data/src/hooks/index.ts"],"sourcesContent":["export {\n\tdefault as useEntityRecord,\n\t__experimentalUseEntityRecord,\n} from './use-entity-record';\nexport {\n\tdefault as useEntityRecords,\n\t__experimentalUseEntityRecords,\n} from './use-entity-records';\nexport {\n\tdefault as useResourcePermissions,\n\t__experimentalUseResourcePermissions,\n} from './use-resource-permissions';\nexport { default as useEntityBlockEditor } from './use-entity-block-editor';\nexport { default as useEntityId } from './use-entity-id';\nexport { default as useEntityProp } from './use-entity-prop';\n"],"mappings":"AAAA,SACCA,OAAO,IAAIC,eAAe,EAC1BC,6BAA6B,QACvB,qBAAqB;AAC5B,SACCF,OAAO,IAAIG,gBAAgB,EAC3BC,8BAA8B,QACxB,sBAAsB;AAC7B,SACCJ,OAAO,IAAIK,sBAAsB,EACjCC,oCAAoC,QAC9B,4BAA4B;AACnC,SAASN,OAAO,IAAIO,oBAAoB,QAAQ,2BAA2B;AAC3E,SAASP,OAAO,IAAIQ,WAAW,QAAQ,iBAAiB;AACxD,SAASR,OAAO,IAAIS,aAAa,QAAQ,mBAAmB","ignoreList":[]}
|