@wordpress/core-data 7.26.0 → 7.27.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/entity-types/attachment.js.map +1 -1
  3. package/build/entity-types/comment.js.map +1 -1
  4. package/build/entity-types/nav-menu-item.js.map +1 -1
  5. package/build/entity-types/nav-menu.js.map +1 -1
  6. package/build/entity-types/page.js.map +1 -1
  7. package/build/entity-types/post-revision.js.map +1 -1
  8. package/build/entity-types/post.js.map +1 -1
  9. package/build/entity-types/term.js.map +1 -1
  10. package/build/entity-types/user.js.map +1 -1
  11. package/build/hooks/use-entity-records.js +8 -1
  12. package/build/hooks/use-entity-records.js.map +1 -1
  13. package/build/resolvers.js +11 -6
  14. package/build/resolvers.js.map +1 -1
  15. package/build-module/entity-types/attachment.js.map +1 -1
  16. package/build-module/entity-types/comment.js.map +1 -1
  17. package/build-module/entity-types/nav-menu-item.js.map +1 -1
  18. package/build-module/entity-types/nav-menu.js.map +1 -1
  19. package/build-module/entity-types/page.js.map +1 -1
  20. package/build-module/entity-types/post-revision.js.map +1 -1
  21. package/build-module/entity-types/post.js.map +1 -1
  22. package/build-module/entity-types/term.js.map +1 -1
  23. package/build-module/entity-types/user.js.map +1 -1
  24. package/build-module/hooks/use-entity-records.js +8 -1
  25. package/build-module/hooks/use-entity-records.js.map +1 -1
  26. package/build-module/resolvers.js +11 -6
  27. package/build-module/resolvers.js.map +1 -1
  28. package/build-types/entities.d.ts +163 -9
  29. package/build-types/entities.d.ts.map +1 -1
  30. package/build-types/entity-types/attachment.d.ts +1 -1
  31. package/build-types/entity-types/attachment.d.ts.map +1 -1
  32. package/build-types/entity-types/comment.d.ts +1 -1
  33. package/build-types/entity-types/comment.d.ts.map +1 -1
  34. package/build-types/entity-types/nav-menu-item.d.ts +1 -1
  35. package/build-types/entity-types/nav-menu-item.d.ts.map +1 -1
  36. package/build-types/entity-types/nav-menu.d.ts +1 -1
  37. package/build-types/entity-types/nav-menu.d.ts.map +1 -1
  38. package/build-types/entity-types/page.d.ts +1 -1
  39. package/build-types/entity-types/page.d.ts.map +1 -1
  40. package/build-types/entity-types/post-revision.d.ts +1 -1
  41. package/build-types/entity-types/post-revision.d.ts.map +1 -1
  42. package/build-types/entity-types/post.d.ts +1 -1
  43. package/build-types/entity-types/post.d.ts.map +1 -1
  44. package/build-types/entity-types/term.d.ts +1 -1
  45. package/build-types/entity-types/term.d.ts.map +1 -1
  46. package/build-types/entity-types/user.d.ts +1 -1
  47. package/build-types/entity-types/user.d.ts.map +1 -1
  48. package/build-types/hooks/use-entity-records.d.ts.map +1 -1
  49. package/build-types/resolvers.d.ts.map +1 -1
  50. package/package.json +18 -18
  51. package/src/entity-types/attachment.ts +1 -1
  52. package/src/entity-types/comment.ts +1 -1
  53. package/src/entity-types/nav-menu-item.ts +1 -1
  54. package/src/entity-types/nav-menu.ts +1 -1
  55. package/src/entity-types/page.ts +1 -1
  56. package/src/entity-types/post-revision.ts +1 -1
  57. package/src/entity-types/post.ts +1 -1
  58. package/src/entity-types/term.ts +1 -1
  59. package/src/entity-types/user.ts +1 -1
  60. package/src/hooks/test/use-entity-records.js +104 -1
  61. package/src/hooks/use-entity-records.ts +17 -1
  62. package/src/resolvers.js +25 -14
  63. package/src/test/resolvers.js +101 -0
  64. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_changeCase","require","_url","_htmlEntities","_apiFetch","_interopRequireDefault","_name","_entities","_utils","_sync","_fetch","getAuthors","query","dispatch","path","addQueryArgs","users","apiFetch","receiveUserQuery","exports","getCurrentUser","currentUser","receiveCurrentUser","getEntityRecord","kind","name","key","select","registry","resolveSelect","configs","getEntitiesConfig","entityConfig","find","config","lock","__unstableAcquireStoreLock","STORE_NAME","exclusive","window","__experimentalEnableSync","syncConfig","globalThis","IS_GUTENBERG_PLUGIN","objectId","getSyncObjectId","getSyncProvider","bootstrap","syncObjectType","record","receiveEntityRecords","type","recordId","edits","meta","undo","undefined","_fields","Set","getNormalizedCommaSeparable","DEFAULT_ENTITY_KEY","join","baseURL","baseURLParams","include","hasRecords","hasEntityRecords","response","parse","json","permissions","getUserPermissionsFromAllowHeader","headers","get","canUserResolutionsArgs","receiveUserPermissionArgs","action","ALLOWED_RESOURCE_ACTIONS","getUserPermissionCacheKey","id","push","batch","receiveUserPermissions","finishResolutions","__unstableReleaseStoreLock","getRawEntityRecord","forwardResolver","getEditedEntityRecord","getEntityRecords","getResolutionsArgs","records","filter","map","supportsPagination","per_page","Object","values","totalItems","parseInt","totalPages","RECEIVE_INTERMEDIATE_RESULTS","page","pageRecords","length","split","forEach","field","hasOwnProperty","context","targetHints","_links","self","allow","targetHint","e","shouldInvalidate","invalidateCache","getCurrentTheme","activeThemes","status","receiveCurrentTheme","getThemeSupports","getEmbedPreview","url","embedProxyResponse","receiveEmbedPreview","error","canUser","requestedAction","resource","includes","Error","hasStartedResolution","relatedAction","isAlreadyResolving","resourcePath","method","receiveUserPermission","finishResolution","canUserEditEntityRecord","getAutosaves","postType","postId","rest_base","restBase","rest_namespace","restNamespace","supports","getPostType","autosave","autosaves","receiveAutosaves","getAutosave","__experimentalGetCurrentGlobalStylesId","globalStylesURL","href","matches","match","Number","__experimentalReceiveCurrentGlobalStylesId","__experimentalGetCurrentThemeBaseGlobalStyles","currentTheme","themeGlobalStyles","stylesheet","__experimentalReceiveThemeBaseGlobalStyles","__experimentalGetCurrentThemeGlobalStylesVariations","variations","__experimentalReceiveThemeGlobalStyleVariations","getCurrentThemeGlobalStylesRevisions","globalStylesId","revisionsURL","resetRevisions","revisions","revision","fromEntries","entries","value","camelCase","receiveThemeGlobalStyleRevisions","getBlockPatterns","patterns","fetchBlockPatterns","getBlockPatternCategories","categories","getUserPatternCategories","patternCategories","mappedPatternCategories","userCategory","label","decodeEntities","slug","getNavigationFallbackId","fallback","_embed","_embedded","receiveNavigationFallbackId","existingFallbackEntityRecord","invalidateNavigationQueries","getDefaultTemplateId","template","receiveDefaultTemplateId","getRevisions","recordKey","revisionKey","getRevisionsUrl","isPaginated","receiveRevisions","resolutionsArgs","getRevision","getRegisteredPostMeta","options","receiveRegisteredPostMeta","schema","properties","loader","additionalEntityConfigLoaders","l","loadEntities","addEntities"],"sources":["@wordpress/core-data/src/resolvers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from './name';\nimport { additionalEntityConfigLoaders, DEFAULT_ENTITY_KEY } from './entities';\nimport {\n\tforwardResolver,\n\tgetNormalizedCommaSeparable,\n\tgetUserPermissionCacheKey,\n\tgetUserPermissionsFromAllowHeader,\n\tALLOWED_RESOURCE_ACTIONS,\n\tRECEIVE_INTERMEDIATE_RESULTS,\n} from './utils';\nimport { getSyncProvider } from './sync';\nimport { fetchBlockPatterns } from './fetch';\n\n/**\n * Requests authors from the REST API.\n *\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request.\n */\nexport const getAuthors =\n\t( query ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst path = addQueryArgs(\n\t\t\t'/wp/v2/users/?who=authors&per_page=100',\n\t\t\tquery\n\t\t);\n\t\tconst users = await apiFetch( { path } );\n\t\tdispatch.receiveUserQuery( path, users );\n\t};\n\n/**\n * Requests the current user from the REST API.\n */\nexport const getCurrentUser =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst currentUser = await apiFetch( { path: '/wp/v2/users/me' } );\n\t\tdispatch.receiveCurrentUser( currentUser );\n\t};\n\n/**\n * Requests an entity's record from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} key Record's key\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getEntityRecord =\n\t( kind, name, key = '', query ) =>\n\tasync ( { select, dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\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, key ],\n\t\t\t{ exclusive: false }\n\t\t);\n\n\t\ttry {\n\t\t\t// Entity supports configs,\n\t\t\t// use the sync algorithm instead of the old fetch behavior.\n\t\t\tif (\n\t\t\t\twindow.__experimentalEnableSync &&\n\t\t\t\tentityConfig.syncConfig &&\n\t\t\t\t! query\n\t\t\t) {\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tconst objectId = entityConfig.getSyncObjectId( key );\n\n\t\t\t\t\t// Loads the persisted document.\n\t\t\t\t\tawait getSyncProvider().bootstrap(\n\t\t\t\t\t\tentityConfig.syncObjectType,\n\t\t\t\t\t\tobjectId,\n\t\t\t\t\t\t( record ) => {\n\t\t\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\trecord,\n\t\t\t\t\t\t\t\tquery\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Bootstraps the edited document as well (and load from peers).\n\t\t\t\t\tawait getSyncProvider().bootstrap(\n\t\t\t\t\t\tentityConfig.syncObjectType + '--edit',\n\t\t\t\t\t\tobjectId,\n\t\t\t\t\t\t( record ) => {\n\t\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\t\ttype: 'EDIT_ENTITY_RECORD',\n\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\trecordId: key,\n\t\t\t\t\t\t\t\tedits: record,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\tundo: undefined,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( query !== undefined && query._fields ) {\n\t\t\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t\t\t// the ID.\n\t\t\t\t\tquery = {\n\t\t\t\t\t\t...query,\n\t\t\t\t\t\t_fields: [\n\t\t\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t\t\t...( getNormalizedCommaSeparable(\n\t\t\t\t\t\t\t\t\tquery._fields\n\t\t\t\t\t\t\t\t) || [] ),\n\t\t\t\t\t\t\t\tentityConfig.key || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t\t\t] ),\n\t\t\t\t\t\t].join(),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Disable reason: While true that an early return could leave `path`\n\t\t\t\t// unused, it's important that path is derived using the query prior to\n\t\t\t\t// additional query modifications in the condition below, since those\n\t\t\t\t// modifications are relevant to how the data is tracked in state, and not\n\t\t\t\t// for how the request is made to the REST API.\n\n\t\t\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\t\tconst path = addQueryArgs(\n\t\t\t\t\tentityConfig.baseURL + ( key ? '/' + key : '' ),\n\t\t\t\t\t{\n\t\t\t\t\t\t...entityConfig.baseURLParams,\n\t\t\t\t\t\t...query,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( query !== undefined && query._fields ) {\n\t\t\t\t\tquery = { ...query, include: [ key ] };\n\n\t\t\t\t\t// The resolution cache won't consider query as reusable based on the\n\t\t\t\t\t// fields, so it's tested here, prior to initiating the REST request,\n\t\t\t\t\t// and without causing `getEntityRecords` resolution to occur.\n\t\t\t\t\tconst hasRecords = select.hasEntityRecords(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquery\n\t\t\t\t\t);\n\t\t\t\t\tif ( hasRecords ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst response = await apiFetch( { path, parse: false } );\n\t\t\t\tconst record = await response.json();\n\t\t\t\tconst permissions = getUserPermissionsFromAllowHeader(\n\t\t\t\t\tresponse.headers?.get( 'allow' )\n\t\t\t\t);\n\n\t\t\t\tconst canUserResolutionsArgs = [];\n\t\t\t\tconst receiveUserPermissionArgs = {};\n\t\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\t\treceiveUserPermissionArgs[\n\t\t\t\t\t\tgetUserPermissionCacheKey( action, {\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tid: key,\n\t\t\t\t\t\t} )\n\t\t\t\t\t] = permissions[ action ];\n\n\t\t\t\t\tcanUserResolutionsArgs.push( [\n\t\t\t\t\t\taction,\n\t\t\t\t\t\t{ kind, name, id: key },\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tdispatch.receiveEntityRecords( kind, name, record, query );\n\t\t\t\t\tdispatch.receiveUserPermissions(\n\t\t\t\t\t\treceiveUserPermissionArgs\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'canUser',\n\t\t\t\t\t\tcanUserResolutionsArgs\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Requests an entity's record from the REST API.\n */\nexport const getRawEntityRecord = forwardResolver( 'getEntityRecord' );\n\n/**\n * Requests an entity's record from the REST API.\n */\nexport const getEditedEntityRecord = forwardResolver( 'getEntityRecord' );\n\n/**\n * Requests the entity's records from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {?Object} query Query Object. If requesting specific fields, fields\n * must always include the ID.\n */\nexport const getEntityRecords =\n\t( kind, name, query = {} ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\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 ],\n\t\t\t{ exclusive: false }\n\t\t);\n\n\t\tconst key = entityConfig.key || DEFAULT_ENTITY_KEY;\n\n\t\tfunction getResolutionsArgs( records ) {\n\t\t\treturn records\n\t\t\t\t.filter( ( record ) => record?.[ key ] )\n\t\t\t\t.map( ( record ) => [ kind, name, record[ key ] ] );\n\t\t}\n\n\t\ttry {\n\t\t\tif ( query._fields ) {\n\t\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t\t// the ID.\n\t\t\t\tquery = {\n\t\t\t\t\t...query,\n\t\t\t\t\t_fields: [\n\t\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\t\tentityConfig.key || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t\t] ),\n\t\t\t\t\t].join(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst path = addQueryArgs( entityConfig.baseURL, {\n\t\t\t\t...entityConfig.baseURLParams,\n\t\t\t\t...query,\n\t\t\t} );\n\n\t\t\tlet records = [],\n\t\t\t\tmeta;\n\t\t\tif ( entityConfig.supportsPagination && query.per_page !== -1 ) {\n\t\t\t\tconst response = await apiFetch( { path, parse: false } );\n\t\t\t\trecords = Object.values( await response.json() );\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-Total' )\n\t\t\t\t\t),\n\t\t\t\t\ttotalPages: parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-TotalPages' )\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t} else if (\n\t\t\t\tquery.per_page === -1 &&\n\t\t\t\tquery[ RECEIVE_INTERMEDIATE_RESULTS ] === true\n\t\t\t) {\n\t\t\t\tlet page = 1;\n\t\t\t\tlet totalPages;\n\n\t\t\t\tdo {\n\t\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\t\tpath: addQueryArgs( path, { page, per_page: 100 } ),\n\t\t\t\t\t\tparse: false,\n\t\t\t\t\t} );\n\t\t\t\t\tconst pageRecords = Object.values( await response.json() );\n\n\t\t\t\t\ttotalPages = parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-TotalPages' )\n\t\t\t\t\t);\n\n\t\t\t\t\trecords.push( ...pageRecords );\n\t\t\t\t\tregistry.batch( () => {\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\trecords,\n\t\t\t\t\t\t\tquery\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\tgetResolutionsArgs( pageRecords )\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t\tpage++;\n\t\t\t\t} while ( page <= totalPages );\n\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: records.length,\n\t\t\t\t\ttotalPages: 1,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\trecords = Object.values( await apiFetch( { path } ) );\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: records.length,\n\t\t\t\t\ttotalPages: 1,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// If we request fields but the result doesn't contain the fields,\n\t\t\t// explicitly set these fields as \"undefined\"\n\t\t\t// that way we consider the query \"fulfilled\".\n\t\t\tif ( query._fields ) {\n\t\t\t\trecords = records.map( ( record ) => {\n\t\t\t\t\tquery._fields.split( ',' ).forEach( ( field ) => {\n\t\t\t\t\t\tif ( ! record.hasOwnProperty( field ) ) {\n\t\t\t\t\t\t\trecord[ field ] = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn record;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecords,\n\t\t\t\t\tquery,\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\n\t\t\t\t// When requesting all fields, the list of results can be used to resolve\n\t\t\t\t// the `getEntityRecord` and `canUser` selectors in addition to `getEntityRecords`.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/26575\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/64504\n\t\t\t\tif ( ! query?._fields && ! query.context ) {\n\t\t\t\t\tconst targetHints = records\n\t\t\t\t\t\t.filter( ( record ) => record?.[ key ] )\n\t\t\t\t\t\t.map( ( record ) => ( {\n\t\t\t\t\t\t\tid: record[ key ],\n\t\t\t\t\t\t\tpermissions: getUserPermissionsFromAllowHeader(\n\t\t\t\t\t\t\t\trecord?._links?.self?.[ 0 ].targetHints.allow\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} ) );\n\n\t\t\t\t\tconst canUserResolutionsArgs = [];\n\t\t\t\t\tconst receiveUserPermissionArgs = {};\n\t\t\t\t\tfor ( const targetHint of targetHints ) {\n\t\t\t\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\t\t\t\tcanUserResolutionsArgs.push( [\n\t\t\t\t\t\t\t\taction,\n\t\t\t\t\t\t\t\t{ kind, name, id: targetHint.id },\n\t\t\t\t\t\t\t] );\n\n\t\t\t\t\t\t\treceiveUserPermissionArgs[\n\t\t\t\t\t\t\t\tgetUserPermissionCacheKey( action, {\n\t\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tid: targetHint.id,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t] = targetHint.permissions[ action ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch.receiveUserPermissions(\n\t\t\t\t\t\treceiveUserPermissionArgs\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\tgetResolutionsArgs( records )\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'canUser',\n\t\t\t\t\t\tcanUserResolutionsArgs\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\ngetEntityRecords.shouldInvalidate = ( action, kind, name ) => {\n\treturn (\n\t\t( action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS' ) &&\n\t\taction.invalidateCache &&\n\t\tkind === action.kind &&\n\t\tname === action.name\n\t);\n};\n\n/**\n * Requests the current theme.\n */\nexport const getCurrentTheme =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst activeThemes = await resolveSelect.getEntityRecords(\n\t\t\t'root',\n\t\t\t'theme',\n\t\t\t{ status: 'active' }\n\t\t);\n\n\t\tdispatch.receiveCurrentTheme( activeThemes[ 0 ] );\n\t};\n\n/**\n * Requests theme supports data from the index.\n */\nexport const getThemeSupports = forwardResolver( 'getCurrentTheme' );\n\n/**\n * Requests a preview from the Embed API.\n *\n * @param {string} url URL to get the preview for.\n */\nexport const getEmbedPreview =\n\t( url ) =>\n\tasync ( { dispatch } ) => {\n\t\ttry {\n\t\t\tconst embedProxyResponse = await apiFetch( {\n\t\t\t\tpath: addQueryArgs( '/oembed/1.0/proxy', { url } ),\n\t\t\t} );\n\t\t\tdispatch.receiveEmbedPreview( url, embedProxyResponse );\n\t\t} catch ( error ) {\n\t\t\t// Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.\n\t\t\tdispatch.receiveEmbedPreview( url, false );\n\t\t}\n\t};\n\n/**\n * Checks whether the current user can perform the given action on the given\n * REST resource.\n *\n * @param {string} requestedAction Action to check. One of: 'create', 'read', 'update',\n * 'delete'.\n * @param {string|Object} resource Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }`\n * or REST base as a string - `media`.\n * @param {?string} id ID of the rest resource to check.\n */\nexport const canUser =\n\t( requestedAction, resource, id ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tif ( ! ALLOWED_RESOURCE_ACTIONS.includes( requestedAction ) ) {\n\t\t\tthrow new Error( `'${ requestedAction }' is not a valid action.` );\n\t\t}\n\n\t\tconst { hasStartedResolution } = registry.select( STORE_NAME );\n\n\t\t// Prevent resolving the same resource twice.\n\t\tfor ( const relatedAction of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\tif ( relatedAction === requestedAction ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isAlreadyResolving = hasStartedResolution( 'canUser', [\n\t\t\t\trelatedAction,\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t] );\n\t\t\tif ( isAlreadyResolving ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet resourcePath = null;\n\t\tif ( typeof resource === 'object' ) {\n\t\t\tif ( ! resource.kind || ! resource.name ) {\n\t\t\t\tthrow new Error( 'The entity resource object is not valid.' );\n\t\t\t}\n\n\t\t\tconst configs = await resolveSelect.getEntitiesConfig(\n\t\t\t\tresource.kind\n\t\t\t);\n\t\t\tconst entityConfig = configs.find(\n\t\t\t\t( config ) =>\n\t\t\t\t\tconfig.name === resource.name &&\n\t\t\t\t\tconfig.kind === resource.kind\n\t\t\t);\n\t\t\tif ( ! entityConfig ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresourcePath =\n\t\t\t\tentityConfig.baseURL + ( resource.id ? '/' + resource.id : '' );\n\t\t} else {\n\t\t\tresourcePath = `/wp/v2/${ resource }` + ( id ? '/' + id : '' );\n\t\t}\n\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await apiFetch( {\n\t\t\t\tpath: resourcePath,\n\t\t\t\tmethod: 'OPTIONS',\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our OPTIONS request comes back with an API error (4xx or\n\t\t\t// 5xx). The previously determined isAllowed value will remain in the store.\n\t\t\treturn;\n\t\t}\n\n\t\t// Optional chaining operator is used here because the API requests don't\n\t\t// return the expected result in the React native version. Instead, API requests\n\t\t// only return the result, without including response properties like the headers.\n\t\tconst permissions = getUserPermissionsFromAllowHeader(\n\t\t\tresponse.headers?.get( 'allow' )\n\t\t);\n\t\tregistry.batch( () => {\n\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\tconst key = getUserPermissionCacheKey( action, resource, id );\n\n\t\t\t\tdispatch.receiveUserPermission( key, permissions[ action ] );\n\n\t\t\t\t// Mark related action resolutions as finished.\n\t\t\t\tif ( action !== requestedAction ) {\n\t\t\t\t\tdispatch.finishResolution( 'canUser', [\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tid,\n\t\t\t\t\t] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t};\n\n/**\n * Checks whether the current user can perform the given action on the given\n * REST resource.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordId Record's id.\n */\nexport const canUserEditEntityRecord =\n\t( kind, name, recordId ) =>\n\tasync ( { dispatch } ) => {\n\t\tawait dispatch( canUser( 'update', { kind, name, id: recordId } ) );\n\t};\n\n/**\n * Request autosave data from the REST API.\n *\n * @param {string} postType The type of the parent post.\n * @param {number} postId The id of the parent post.\n */\nexport const getAutosaves =\n\t( postType, postId ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst {\n\t\t\trest_base: restBase,\n\t\t\trest_namespace: restNamespace = 'wp/v2',\n\t\t\tsupports,\n\t\t} = await resolveSelect.getPostType( postType );\n\t\tif ( ! supports?.autosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst autosaves = await apiFetch( {\n\t\t\tpath: `/${ restNamespace }/${ restBase }/${ postId }/autosaves?context=edit`,\n\t\t} );\n\n\t\tif ( autosaves && autosaves.length ) {\n\t\t\tdispatch.receiveAutosaves( postId, autosaves );\n\t\t}\n\t};\n\n/**\n * Request autosave data from the REST API.\n *\n * This resolver exists to ensure the underlying autosaves are fetched via\n * `getAutosaves` when a call to the `getAutosave` selector is made.\n *\n * @param {string} postType The type of the parent post.\n * @param {number} postId The id of the parent post.\n */\nexport const getAutosave =\n\t( postType, postId ) =>\n\tasync ( { resolveSelect } ) => {\n\t\tawait resolveSelect.getAutosaves( postType, postId );\n\t};\n\nexport const __experimentalGetCurrentGlobalStylesId =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst activeThemes = await resolveSelect.getEntityRecords(\n\t\t\t'root',\n\t\t\t'theme',\n\t\t\t{ status: 'active' }\n\t\t);\n\t\tconst globalStylesURL =\n\t\t\tactiveThemes?.[ 0 ]?._links?.[ 'wp:user-global-styles' ]?.[ 0 ]\n\t\t\t\t?.href;\n\t\tif ( ! globalStylesURL ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Regex matches the ID at the end of a URL or immediately before\n\t\t// the query string.\n\t\tconst matches = globalStylesURL.match( /\\/(\\d+)(?:\\?|$)/ );\n\t\tconst id = matches ? Number( matches[ 1 ] ) : null;\n\n\t\tif ( id ) {\n\t\t\tdispatch.__experimentalReceiveCurrentGlobalStylesId( id );\n\t\t}\n\t};\n\nexport const __experimentalGetCurrentThemeBaseGlobalStyles =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst currentTheme = await resolveSelect.getCurrentTheme();\n\t\t// Please adjust the preloaded requests if this changes!\n\t\tconst themeGlobalStyles = await apiFetch( {\n\t\t\tpath: `/wp/v2/global-styles/themes/${ currentTheme.stylesheet }?context=view`,\n\t\t} );\n\t\tdispatch.__experimentalReceiveThemeBaseGlobalStyles(\n\t\t\tcurrentTheme.stylesheet,\n\t\t\tthemeGlobalStyles\n\t\t);\n\t};\n\nexport const __experimentalGetCurrentThemeGlobalStylesVariations =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst currentTheme = await resolveSelect.getCurrentTheme();\n\t\t// Please adjust the preloaded requests if this changes!\n\t\tconst variations = await apiFetch( {\n\t\t\tpath: `/wp/v2/global-styles/themes/${ currentTheme.stylesheet }/variations?context=view`,\n\t\t} );\n\t\tdispatch.__experimentalReceiveThemeGlobalStyleVariations(\n\t\t\tcurrentTheme.stylesheet,\n\t\t\tvariations\n\t\t);\n\t};\n\n/**\n * Fetches and returns the revisions of the current global styles theme.\n */\nexport const getCurrentThemeGlobalStylesRevisions =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst globalStylesId =\n\t\t\tawait resolveSelect.__experimentalGetCurrentGlobalStylesId();\n\t\tconst record = globalStylesId\n\t\t\t? await resolveSelect.getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId\n\t\t\t )\n\t\t\t: undefined;\n\t\tconst revisionsURL = record?._links?.[ 'version-history' ]?.[ 0 ]?.href;\n\n\t\tif ( revisionsURL ) {\n\t\t\tconst resetRevisions = await apiFetch( {\n\t\t\t\turl: revisionsURL,\n\t\t\t} );\n\t\t\tconst revisions = resetRevisions?.map( ( revision ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( revision ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\t\t\tdispatch.receiveThemeGlobalStyleRevisions(\n\t\t\t\tglobalStylesId,\n\t\t\t\trevisions\n\t\t\t);\n\t\t}\n\t};\n\ngetCurrentThemeGlobalStylesRevisions.shouldInvalidate = ( action ) => {\n\treturn (\n\t\taction.type === 'SAVE_ENTITY_RECORD_FINISH' &&\n\t\taction.kind === 'root' &&\n\t\t! action.error &&\n\t\taction.name === 'globalStyles'\n\t);\n};\n\nexport const getBlockPatterns =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst patterns = await fetchBlockPatterns();\n\t\tdispatch( { type: 'RECEIVE_BLOCK_PATTERNS', patterns } );\n\t};\n\nexport const getBlockPatternCategories =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst categories = await apiFetch( {\n\t\t\tpath: '/wp/v2/block-patterns/categories',\n\t\t} );\n\t\tdispatch( { type: 'RECEIVE_BLOCK_PATTERN_CATEGORIES', categories } );\n\t};\n\nexport const getUserPatternCategories =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst patternCategories = await resolveSelect.getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_pattern_category',\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\t_fields: 'id,name,description,slug',\n\t\t\t\tcontext: 'view',\n\t\t\t}\n\t\t);\n\n\t\tconst mappedPatternCategories =\n\t\t\tpatternCategories?.map( ( userCategory ) => ( {\n\t\t\t\t...userCategory,\n\t\t\t\tlabel: decodeEntities( userCategory.name ),\n\t\t\t\tname: userCategory.slug,\n\t\t\t} ) ) || [];\n\n\t\tdispatch( {\n\t\t\ttype: 'RECEIVE_USER_PATTERN_CATEGORIES',\n\t\t\tpatternCategories: mappedPatternCategories,\n\t\t} );\n\t};\n\nexport const getNavigationFallbackId =\n\t() =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst fallback = await apiFetch( {\n\t\t\tpath: addQueryArgs( '/wp-block-editor/v1/navigation-fallback', {\n\t\t\t\t_embed: true,\n\t\t\t} ),\n\t\t} );\n\n\t\tconst record = fallback?._embedded?.self;\n\n\t\tregistry.batch( () => {\n\t\t\tdispatch.receiveNavigationFallbackId( fallback?.id );\n\n\t\t\tif ( ! record ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the fallback is already in the store, don't invalidate navigation queries.\n\t\t\t// Otherwise, invalidate the cache for the scenario where there were no Navigation\n\t\t\t// posts in the state and the fallback created one.\n\t\t\tconst existingFallbackEntityRecord = select.getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\tfallback.id\n\t\t\t);\n\t\t\tconst invalidateNavigationQueries = ! existingFallbackEntityRecord;\n\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\trecord,\n\t\t\t\tundefined,\n\t\t\t\tinvalidateNavigationQueries\n\t\t\t);\n\n\t\t\t// Resolve to avoid further network requests.\n\t\t\tdispatch.finishResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\tfallback.id,\n\t\t\t] );\n\t\t} );\n\t};\n\nexport const getDefaultTemplateId =\n\t( query ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst template = await apiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', query ),\n\t\t} );\n\t\t// Wait for the the entities config to be loaded, otherwise receiving\n\t\t// the template as an entity will not work.\n\t\tawait resolveSelect.getEntitiesConfig( 'postType' );\n\t\t// Endpoint may return an empty object if no template is found.\n\t\tif ( template?.id ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveDefaultTemplateId( query, template.id );\n\t\t\t\tdispatch.receiveEntityRecords( 'postType', 'wp_template', [\n\t\t\t\t\ttemplate,\n\t\t\t\t] );\n\t\t\t\t// Avoid further network requests.\n\t\t\t\tdispatch.finishResolution( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\ttemplate.id,\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Requests an entity's revisions from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getRevisions =\n\t( kind, name, recordKey, query = {} ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\n\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( query._fields ) {\n\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t// the ID.\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\tentityConfig.revisionKey || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t};\n\t\t}\n\n\t\tconst path = addQueryArgs(\n\t\t\tentityConfig.getRevisionsUrl( recordKey ),\n\t\t\tquery\n\t\t);\n\n\t\tlet records, response;\n\t\tconst meta = {};\n\t\tconst isPaginated =\n\t\t\tentityConfig.supportsPagination && query.per_page !== -1;\n\t\ttry {\n\t\t\tresponse = await apiFetch( { path, parse: ! isPaginated } );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( response ) {\n\t\t\tif ( isPaginated ) {\n\t\t\t\trecords = Object.values( await response.json() );\n\t\t\t\tmeta.totalItems = parseInt(\n\t\t\t\t\tresponse.headers.get( 'X-WP-Total' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\trecords = Object.values( response );\n\t\t\t}\n\n\t\t\t// If we request fields but the result doesn't contain the fields,\n\t\t\t// explicitly set these fields as \"undefined\"\n\t\t\t// that way we consider the query \"fulfilled\".\n\t\t\tif ( query._fields ) {\n\t\t\t\trecords = records.map( ( record ) => {\n\t\t\t\t\tquery._fields.split( ',' ).forEach( ( field ) => {\n\t\t\t\t\t\tif ( ! record.hasOwnProperty( field ) ) {\n\t\t\t\t\t\t\trecord[ field ] = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn record;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveRevisions(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecordKey,\n\t\t\t\t\trecords,\n\t\t\t\t\tquery,\n\t\t\t\t\tfalse,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\n\t\t\t\t// When requesting all fields, the list of results can be used to\n\t\t\t\t// resolve the `getRevision` selector in addition to `getRevisions`.\n\t\t\t\tif ( ! query?._fields && ! query.context ) {\n\t\t\t\t\tconst key = entityConfig.key || DEFAULT_ENTITY_KEY;\n\t\t\t\t\tconst resolutionsArgs = records\n\t\t\t\t\t\t.filter( ( record ) => record[ key ] )\n\t\t\t\t\t\t.map( ( record ) => [\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\trecordKey,\n\t\t\t\t\t\t\trecord[ key ],\n\t\t\t\t\t\t] );\n\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'getRevision',\n\t\t\t\t\t\tresolutionsArgs\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n// Invalidate cache when a new revision is created.\ngetRevisions.shouldInvalidate = ( action, kind, name, recordKey ) =>\n\taction.type === 'SAVE_ENTITY_RECORD_FINISH' &&\n\tname === action.name &&\n\tkind === action.kind &&\n\t! action.error &&\n\trecordKey === action.recordId;\n\n/**\n * Requests a specific Entity revision from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {number|string} revisionKey The revision's key.\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getRevision =\n\t( kind, name, recordKey, revisionKey, query ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\n\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( query !== undefined && query._fields ) {\n\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t// the ID.\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\tentityConfig.revisionKey || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t};\n\t\t}\n\t\tconst path = addQueryArgs(\n\t\t\tentityConfig.getRevisionsUrl( recordKey, revisionKey ),\n\t\t\tquery\n\t\t);\n\n\t\tlet record;\n\t\ttry {\n\t\t\trecord = await apiFetch( { path } );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( record ) {\n\t\t\tdispatch.receiveRevisions( kind, name, recordKey, record, query );\n\t\t}\n\t};\n\n/**\n * Requests a specific post type options from the REST API.\n *\n * @param {string} postType Post type slug.\n */\nexport const getRegisteredPostMeta =\n\t( postType ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tlet options;\n\t\ttry {\n\t\t\tconst {\n\t\t\t\trest_namespace: restNamespace = 'wp/v2',\n\t\t\t\trest_base: restBase,\n\t\t\t} = ( await resolveSelect.getPostType( postType ) ) || {};\n\t\t\toptions = await apiFetch( {\n\t\t\t\tpath: `${ restNamespace }/${ restBase }/?context=edit`,\n\t\t\t\tmethod: 'OPTIONS',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if the request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( options ) {\n\t\t\tdispatch.receiveRegisteredPostMeta(\n\t\t\t\tpostType,\n\t\t\t\toptions?.schema?.properties?.meta?.properties\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Requests entity configs for the given kind from the REST API.\n *\n * @param {string} kind Entity kind.\n */\nexport const getEntitiesConfig =\n\t( kind ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst loader = additionalEntityConfigLoaders.find(\n\t\t\t( l ) => l.kind === kind\n\t\t);\n\n\t\tif ( ! loader ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst configs = await loader.loadEntities();\n\t\t\tif ( ! configs.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch.addEntities( configs );\n\t\t} catch {\n\t\t\t// Do nothing if the request comes back with an API error.\n\t\t}\n\t};\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,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KAAK,EAAG;IACjB;IACA;EACD;EAEA,IAAKoF,OAAO,EAAG;IACdrM,QAAQ,CAACsM,yBAAyB,CACjCtE,QAAQ,EACRqE,OAAO,EAAEE,MAAM,EAAEC,UAAU,EAAE/J,IAAI,EAAE+J,UACpC,CAAC;EACF;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAlM,OAAA,CAAA8L,qBAAA,GAAAA,qBAAA;AAKO,MAAMlL,iBAAiB,GAC3BP,IAAI,IACN,OAAQ;EAAEX;AAAS,CAAC,KAAM;EACzB,MAAMyM,MAAM,GAAGC,uCAA6B,CAACtL,IAAI,CAC9CuL,CAAC,IAAMA,CAAC,CAAChM,IAAI,KAAKA,IACrB,CAAC;EAED,IAAK,CAAE8L,MAAM,EAAG;IACf;EACD;EAEA,IAAI;IACH,MAAMxL,OAAO,GAAG,MAAMwL,MAAM,CAACG,YAAY,CAAC,CAAC;IAC3C,IAAK,CAAE3L,OAAO,CAACyE,MAAM,EAAG;MACvB;IACD;IAEA1F,QAAQ,CAAC6M,WAAW,CAAE5L,OAAQ,CAAC;EAChC,CAAC,CAAC,MAAM;IACP;EAAA;AAEF,CAAC;AAACX,OAAA,CAAAY,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_changeCase","require","_url","_htmlEntities","_apiFetch","_interopRequireDefault","_name","_entities","_utils","_sync","_fetch","getAuthors","query","dispatch","path","addQueryArgs","users","apiFetch","receiveUserQuery","exports","getCurrentUser","currentUser","receiveCurrentUser","getEntityRecord","kind","name","key","select","registry","resolveSelect","configs","getEntitiesConfig","entityConfig","find","config","lock","__unstableAcquireStoreLock","STORE_NAME","exclusive","window","__experimentalEnableSync","syncConfig","globalThis","IS_GUTENBERG_PLUGIN","objectId","getSyncObjectId","getSyncProvider","bootstrap","syncObjectType","record","receiveEntityRecords","type","recordId","edits","meta","undo","undefined","_fields","Set","getNormalizedCommaSeparable","DEFAULT_ENTITY_KEY","join","baseURL","baseURLParams","include","hasRecords","hasEntityRecords","response","parse","json","permissions","getUserPermissionsFromAllowHeader","headers","get","canUserResolutionsArgs","receiveUserPermissionArgs","action","ALLOWED_RESOURCE_ACTIONS","getUserPermissionCacheKey","id","push","batch","receiveUserPermissions","finishResolutions","__unstableReleaseStoreLock","getRawEntityRecord","forwardResolver","getEditedEntityRecord","getEntityRecords","getResolutionsArgs","records","filter","map","supportsPagination","per_page","Object","values","totalItems","parseInt","totalPages","RECEIVE_INTERMEDIATE_RESULTS","page","pageRecords","length","split","forEach","field","hasOwnProperty","context","targetHints","_links","self","allow","targetHint","e","shouldInvalidate","invalidateCache","getCurrentTheme","activeThemes","status","receiveCurrentTheme","getThemeSupports","getEmbedPreview","url","embedProxyResponse","receiveEmbedPreview","error","canUser","requestedAction","resource","includes","Error","hasStartedResolution","relatedAction","isAlreadyResolving","resourcePath","method","receiveUserPermission","finishResolution","canUserEditEntityRecord","getAutosaves","postType","postId","rest_base","restBase","rest_namespace","restNamespace","supports","getPostType","autosave","autosaves","receiveAutosaves","getAutosave","__experimentalGetCurrentGlobalStylesId","globalStylesURL","href","matches","match","Number","__experimentalReceiveCurrentGlobalStylesId","__experimentalGetCurrentThemeBaseGlobalStyles","currentTheme","themeGlobalStyles","stylesheet","__experimentalReceiveThemeBaseGlobalStyles","__experimentalGetCurrentThemeGlobalStylesVariations","variations","__experimentalReceiveThemeGlobalStyleVariations","getCurrentThemeGlobalStylesRevisions","globalStylesId","revisionsURL","resetRevisions","revisions","revision","fromEntries","entries","value","camelCase","receiveThemeGlobalStyleRevisions","getBlockPatterns","patterns","fetchBlockPatterns","getBlockPatternCategories","categories","getUserPatternCategories","patternCategories","mappedPatternCategories","userCategory","label","decodeEntities","slug","getNavigationFallbackId","fallback","_embed","_embedded","receiveNavigationFallbackId","existingFallbackEntityRecord","invalidateNavigationQueries","getDefaultTemplateId","template","receiveDefaultTemplateId","getRevisions","recordKey","revisionKey","getRevisionsUrl","isPaginated","receiveRevisions","resolutionsArgs","getRevision","getRegisteredPostMeta","options","receiveRegisteredPostMeta","schema","properties","loader","additionalEntityConfigLoaders","l","loadEntities","addEntities"],"sources":["@wordpress/core-data/src/resolvers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from './name';\nimport { additionalEntityConfigLoaders, DEFAULT_ENTITY_KEY } from './entities';\nimport {\n\tforwardResolver,\n\tgetNormalizedCommaSeparable,\n\tgetUserPermissionCacheKey,\n\tgetUserPermissionsFromAllowHeader,\n\tALLOWED_RESOURCE_ACTIONS,\n\tRECEIVE_INTERMEDIATE_RESULTS,\n} from './utils';\nimport { getSyncProvider } from './sync';\nimport { fetchBlockPatterns } from './fetch';\n\n/**\n * Requests authors from the REST API.\n *\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request.\n */\nexport const getAuthors =\n\t( query ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst path = addQueryArgs(\n\t\t\t'/wp/v2/users/?who=authors&per_page=100',\n\t\t\tquery\n\t\t);\n\t\tconst users = await apiFetch( { path } );\n\t\tdispatch.receiveUserQuery( path, users );\n\t};\n\n/**\n * Requests the current user from the REST API.\n */\nexport const getCurrentUser =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst currentUser = await apiFetch( { path: '/wp/v2/users/me' } );\n\t\tdispatch.receiveCurrentUser( currentUser );\n\t};\n\n/**\n * Requests an entity's record from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} key Record's key\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getEntityRecord =\n\t( kind, name, key = '', query ) =>\n\tasync ( { select, dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\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, key ],\n\t\t\t{ exclusive: false }\n\t\t);\n\n\t\ttry {\n\t\t\t// Entity supports configs,\n\t\t\t// use the sync algorithm instead of the old fetch behavior.\n\t\t\tif (\n\t\t\t\twindow.__experimentalEnableSync &&\n\t\t\t\tentityConfig.syncConfig &&\n\t\t\t\t! query\n\t\t\t) {\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tconst objectId = entityConfig.getSyncObjectId( key );\n\n\t\t\t\t\t// Loads the persisted document.\n\t\t\t\t\tawait getSyncProvider().bootstrap(\n\t\t\t\t\t\tentityConfig.syncObjectType,\n\t\t\t\t\t\tobjectId,\n\t\t\t\t\t\t( record ) => {\n\t\t\t\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\trecord,\n\t\t\t\t\t\t\t\tquery\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Bootstraps the edited document as well (and load from peers).\n\t\t\t\t\tawait getSyncProvider().bootstrap(\n\t\t\t\t\t\tentityConfig.syncObjectType + '--edit',\n\t\t\t\t\t\tobjectId,\n\t\t\t\t\t\t( record ) => {\n\t\t\t\t\t\t\tdispatch( {\n\t\t\t\t\t\t\t\ttype: 'EDIT_ENTITY_RECORD',\n\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\trecordId: key,\n\t\t\t\t\t\t\t\tedits: record,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\tundo: undefined,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( query !== undefined && query._fields ) {\n\t\t\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t\t\t// the ID.\n\t\t\t\t\tquery = {\n\t\t\t\t\t\t...query,\n\t\t\t\t\t\t_fields: [\n\t\t\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t\t\t...( getNormalizedCommaSeparable(\n\t\t\t\t\t\t\t\t\tquery._fields\n\t\t\t\t\t\t\t\t) || [] ),\n\t\t\t\t\t\t\t\tentityConfig.key || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t\t\t] ),\n\t\t\t\t\t\t].join(),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Disable reason: While true that an early return could leave `path`\n\t\t\t\t// unused, it's important that path is derived using the query prior to\n\t\t\t\t// additional query modifications in the condition below, since those\n\t\t\t\t// modifications are relevant to how the data is tracked in state, and not\n\t\t\t\t// for how the request is made to the REST API.\n\n\t\t\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\t\t\tconst path = addQueryArgs(\n\t\t\t\t\tentityConfig.baseURL + ( key ? '/' + key : '' ),\n\t\t\t\t\t{\n\t\t\t\t\t\t...entityConfig.baseURLParams,\n\t\t\t\t\t\t...query,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( query !== undefined && query._fields ) {\n\t\t\t\t\tquery = { ...query, include: [ key ] };\n\n\t\t\t\t\t// The resolution cache won't consider query as reusable based on the\n\t\t\t\t\t// fields, so it's tested here, prior to initiating the REST request,\n\t\t\t\t\t// and without causing `getEntityRecords` resolution to occur.\n\t\t\t\t\tconst hasRecords = select.hasEntityRecords(\n\t\t\t\t\t\tkind,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tquery\n\t\t\t\t\t);\n\t\t\t\t\tif ( hasRecords ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst response = await apiFetch( { path, parse: false } );\n\t\t\t\tconst record = await response.json();\n\t\t\t\tconst permissions = getUserPermissionsFromAllowHeader(\n\t\t\t\t\tresponse.headers?.get( 'allow' )\n\t\t\t\t);\n\n\t\t\t\tconst canUserResolutionsArgs = [];\n\t\t\t\tconst receiveUserPermissionArgs = {};\n\t\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\t\treceiveUserPermissionArgs[\n\t\t\t\t\t\tgetUserPermissionCacheKey( action, {\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tid: key,\n\t\t\t\t\t\t} )\n\t\t\t\t\t] = permissions[ action ];\n\n\t\t\t\t\tcanUserResolutionsArgs.push( [\n\t\t\t\t\t\taction,\n\t\t\t\t\t\t{ kind, name, id: key },\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tdispatch.receiveEntityRecords( kind, name, record, query );\n\t\t\t\t\tdispatch.receiveUserPermissions(\n\t\t\t\t\t\treceiveUserPermissionArgs\n\t\t\t\t\t);\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'canUser',\n\t\t\t\t\t\tcanUserResolutionsArgs\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t} finally {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\n/**\n * Requests an entity's record from the REST API.\n */\nexport const getRawEntityRecord = forwardResolver( 'getEntityRecord' );\n\n/**\n * Requests an entity's record from the REST API.\n */\nexport const getEditedEntityRecord = forwardResolver( 'getEntityRecord' );\n\n/**\n * Requests the entity's records from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {?Object} query Query Object. If requesting specific fields, fields\n * must always include the ID.\n */\nexport const getEntityRecords =\n\t( kind, name, query = {} ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\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 ],\n\t\t\t{ exclusive: false }\n\t\t);\n\n\t\tconst key = entityConfig.key || DEFAULT_ENTITY_KEY;\n\n\t\tfunction getResolutionsArgs( records ) {\n\t\t\treturn records\n\t\t\t\t.filter( ( record ) => record?.[ key ] )\n\t\t\t\t.map( ( record ) => [ kind, name, record[ key ] ] );\n\t\t}\n\n\t\ttry {\n\t\t\tif ( query._fields ) {\n\t\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t\t// the ID.\n\t\t\t\tquery = {\n\t\t\t\t\t...query,\n\t\t\t\t\t_fields: [\n\t\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\t\tentityConfig.key || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t\t] ),\n\t\t\t\t\t].join(),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst path = addQueryArgs( entityConfig.baseURL, {\n\t\t\t\t...entityConfig.baseURLParams,\n\t\t\t\t...query,\n\t\t\t} );\n\n\t\t\tlet records = [],\n\t\t\t\tmeta;\n\t\t\tif ( entityConfig.supportsPagination && query.per_page !== -1 ) {\n\t\t\t\tconst response = await apiFetch( { path, parse: false } );\n\t\t\t\trecords = Object.values( await response.json() );\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-Total' )\n\t\t\t\t\t),\n\t\t\t\t\ttotalPages: parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-TotalPages' )\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t} else if (\n\t\t\t\tquery.per_page === -1 &&\n\t\t\t\tquery[ RECEIVE_INTERMEDIATE_RESULTS ] === true\n\t\t\t) {\n\t\t\t\tlet page = 1;\n\t\t\t\tlet totalPages;\n\n\t\t\t\tdo {\n\t\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\t\tpath: addQueryArgs( path, { page, per_page: 100 } ),\n\t\t\t\t\t\tparse: false,\n\t\t\t\t\t} );\n\t\t\t\t\tconst pageRecords = Object.values( await response.json() );\n\n\t\t\t\t\ttotalPages = parseInt(\n\t\t\t\t\t\tresponse.headers.get( 'X-WP-TotalPages' )\n\t\t\t\t\t);\n\n\t\t\t\t\trecords.push( ...pageRecords );\n\t\t\t\t\tregistry.batch( () => {\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\trecords,\n\t\t\t\t\t\t\tquery\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\tgetResolutionsArgs( pageRecords )\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t\tpage++;\n\t\t\t\t} while ( page <= totalPages );\n\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: records.length,\n\t\t\t\t\ttotalPages: 1,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\trecords = Object.values( await apiFetch( { path } ) );\n\t\t\t\tmeta = {\n\t\t\t\t\ttotalItems: records.length,\n\t\t\t\t\ttotalPages: 1,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// If we request fields but the result doesn't contain the fields,\n\t\t\t// explicitly set these fields as \"undefined\"\n\t\t\t// that way we consider the query \"fulfilled\".\n\t\t\tif ( query._fields ) {\n\t\t\t\trecords = records.map( ( record ) => {\n\t\t\t\t\tquery._fields.split( ',' ).forEach( ( field ) => {\n\t\t\t\t\t\tif ( ! record.hasOwnProperty( field ) ) {\n\t\t\t\t\t\t\trecord[ field ] = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn record;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecords,\n\t\t\t\t\tquery,\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\n\t\t\t\t// When requesting all fields, the list of results can be used to resolve\n\t\t\t\t// the `getEntityRecord` and `canUser` selectors in addition to `getEntityRecords`.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/26575\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/64504\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/70738\n\t\t\t\tif ( ! query.context ) {\n\t\t\t\t\tconst targetHints = records\n\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t( record ) =>\n\t\t\t\t\t\t\t\t!! record?.[ key ] &&\n\t\t\t\t\t\t\t\t!! record?._links?.self?.[ 0 ]?.targetHints\n\t\t\t\t\t\t\t\t\t?.allow\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map( ( record ) => ( {\n\t\t\t\t\t\t\tid: record[ key ],\n\t\t\t\t\t\t\tpermissions: getUserPermissionsFromAllowHeader(\n\t\t\t\t\t\t\t\trecord._links.self[ 0 ].targetHints.allow\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t} ) );\n\n\t\t\t\t\tconst canUserResolutionsArgs = [];\n\t\t\t\t\tconst receiveUserPermissionArgs = {};\n\t\t\t\t\tfor ( const targetHint of targetHints ) {\n\t\t\t\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\t\t\t\tcanUserResolutionsArgs.push( [\n\t\t\t\t\t\t\t\taction,\n\t\t\t\t\t\t\t\t{ kind, name, id: targetHint.id },\n\t\t\t\t\t\t\t] );\n\n\t\t\t\t\t\t\treceiveUserPermissionArgs[\n\t\t\t\t\t\t\t\tgetUserPermissionCacheKey( action, {\n\t\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tid: targetHint.id,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t] = targetHint.permissions[ action ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( targetHints.length > 0 ) {\n\t\t\t\t\t\tdispatch.receiveUserPermissions(\n\t\t\t\t\t\t\treceiveUserPermissionArgs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t\t'canUser',\n\t\t\t\t\t\t\tcanUserResolutionsArgs\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! query?._fields ) {\n\t\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\tgetResolutionsArgs( records )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tdispatch.__unstableReleaseStoreLock( lock );\n\t\t}\n\t};\n\ngetEntityRecords.shouldInvalidate = ( action, kind, name ) => {\n\treturn (\n\t\t( action.type === 'RECEIVE_ITEMS' || action.type === 'REMOVE_ITEMS' ) &&\n\t\taction.invalidateCache &&\n\t\tkind === action.kind &&\n\t\tname === action.name\n\t);\n};\n\n/**\n * Requests the current theme.\n */\nexport const getCurrentTheme =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst activeThemes = await resolveSelect.getEntityRecords(\n\t\t\t'root',\n\t\t\t'theme',\n\t\t\t{ status: 'active' }\n\t\t);\n\n\t\tdispatch.receiveCurrentTheme( activeThemes[ 0 ] );\n\t};\n\n/**\n * Requests theme supports data from the index.\n */\nexport const getThemeSupports = forwardResolver( 'getCurrentTheme' );\n\n/**\n * Requests a preview from the Embed API.\n *\n * @param {string} url URL to get the preview for.\n */\nexport const getEmbedPreview =\n\t( url ) =>\n\tasync ( { dispatch } ) => {\n\t\ttry {\n\t\t\tconst embedProxyResponse = await apiFetch( {\n\t\t\t\tpath: addQueryArgs( '/oembed/1.0/proxy', { url } ),\n\t\t\t} );\n\t\t\tdispatch.receiveEmbedPreview( url, embedProxyResponse );\n\t\t} catch ( error ) {\n\t\t\t// Embed API 404s if the URL cannot be embedded, so we have to catch the error from the apiRequest here.\n\t\t\tdispatch.receiveEmbedPreview( url, false );\n\t\t}\n\t};\n\n/**\n * Checks whether the current user can perform the given action on the given\n * REST resource.\n *\n * @param {string} requestedAction Action to check. One of: 'create', 'read', 'update',\n * 'delete'.\n * @param {string|Object} resource Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }`\n * or REST base as a string - `media`.\n * @param {?string} id ID of the rest resource to check.\n */\nexport const canUser =\n\t( requestedAction, resource, id ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tif ( ! ALLOWED_RESOURCE_ACTIONS.includes( requestedAction ) ) {\n\t\t\tthrow new Error( `'${ requestedAction }' is not a valid action.` );\n\t\t}\n\n\t\tconst { hasStartedResolution } = registry.select( STORE_NAME );\n\n\t\t// Prevent resolving the same resource twice.\n\t\tfor ( const relatedAction of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\tif ( relatedAction === requestedAction ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isAlreadyResolving = hasStartedResolution( 'canUser', [\n\t\t\t\trelatedAction,\n\t\t\t\tresource,\n\t\t\t\tid,\n\t\t\t] );\n\t\t\tif ( isAlreadyResolving ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet resourcePath = null;\n\t\tif ( typeof resource === 'object' ) {\n\t\t\tif ( ! resource.kind || ! resource.name ) {\n\t\t\t\tthrow new Error( 'The entity resource object is not valid.' );\n\t\t\t}\n\n\t\t\tconst configs = await resolveSelect.getEntitiesConfig(\n\t\t\t\tresource.kind\n\t\t\t);\n\t\t\tconst entityConfig = configs.find(\n\t\t\t\t( config ) =>\n\t\t\t\t\tconfig.name === resource.name &&\n\t\t\t\t\tconfig.kind === resource.kind\n\t\t\t);\n\t\t\tif ( ! entityConfig ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresourcePath =\n\t\t\t\tentityConfig.baseURL + ( resource.id ? '/' + resource.id : '' );\n\t\t} else {\n\t\t\tresourcePath = `/wp/v2/${ resource }` + ( id ? '/' + id : '' );\n\t\t}\n\n\t\tlet response;\n\t\ttry {\n\t\t\tresponse = await apiFetch( {\n\t\t\t\tpath: resourcePath,\n\t\t\t\tmethod: 'OPTIONS',\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our OPTIONS request comes back with an API error (4xx or\n\t\t\t// 5xx). The previously determined isAllowed value will remain in the store.\n\t\t\treturn;\n\t\t}\n\n\t\t// Optional chaining operator is used here because the API requests don't\n\t\t// return the expected result in the React native version. Instead, API requests\n\t\t// only return the result, without including response properties like the headers.\n\t\tconst permissions = getUserPermissionsFromAllowHeader(\n\t\t\tresponse.headers?.get( 'allow' )\n\t\t);\n\t\tregistry.batch( () => {\n\t\t\tfor ( const action of ALLOWED_RESOURCE_ACTIONS ) {\n\t\t\t\tconst key = getUserPermissionCacheKey( action, resource, id );\n\n\t\t\t\tdispatch.receiveUserPermission( key, permissions[ action ] );\n\n\t\t\t\t// Mark related action resolutions as finished.\n\t\t\t\tif ( action !== requestedAction ) {\n\t\t\t\t\tdispatch.finishResolution( 'canUser', [\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tresource,\n\t\t\t\t\t\tid,\n\t\t\t\t\t] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t};\n\n/**\n * Checks whether the current user can perform the given action on the given\n * REST resource.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordId Record's id.\n */\nexport const canUserEditEntityRecord =\n\t( kind, name, recordId ) =>\n\tasync ( { dispatch } ) => {\n\t\tawait dispatch( canUser( 'update', { kind, name, id: recordId } ) );\n\t};\n\n/**\n * Request autosave data from the REST API.\n *\n * @param {string} postType The type of the parent post.\n * @param {number} postId The id of the parent post.\n */\nexport const getAutosaves =\n\t( postType, postId ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst {\n\t\t\trest_base: restBase,\n\t\t\trest_namespace: restNamespace = 'wp/v2',\n\t\t\tsupports,\n\t\t} = await resolveSelect.getPostType( postType );\n\t\tif ( ! supports?.autosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst autosaves = await apiFetch( {\n\t\t\tpath: `/${ restNamespace }/${ restBase }/${ postId }/autosaves?context=edit`,\n\t\t} );\n\n\t\tif ( autosaves && autosaves.length ) {\n\t\t\tdispatch.receiveAutosaves( postId, autosaves );\n\t\t}\n\t};\n\n/**\n * Request autosave data from the REST API.\n *\n * This resolver exists to ensure the underlying autosaves are fetched via\n * `getAutosaves` when a call to the `getAutosave` selector is made.\n *\n * @param {string} postType The type of the parent post.\n * @param {number} postId The id of the parent post.\n */\nexport const getAutosave =\n\t( postType, postId ) =>\n\tasync ( { resolveSelect } ) => {\n\t\tawait resolveSelect.getAutosaves( postType, postId );\n\t};\n\nexport const __experimentalGetCurrentGlobalStylesId =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst activeThemes = await resolveSelect.getEntityRecords(\n\t\t\t'root',\n\t\t\t'theme',\n\t\t\t{ status: 'active' }\n\t\t);\n\t\tconst globalStylesURL =\n\t\t\tactiveThemes?.[ 0 ]?._links?.[ 'wp:user-global-styles' ]?.[ 0 ]\n\t\t\t\t?.href;\n\t\tif ( ! globalStylesURL ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Regex matches the ID at the end of a URL or immediately before\n\t\t// the query string.\n\t\tconst matches = globalStylesURL.match( /\\/(\\d+)(?:\\?|$)/ );\n\t\tconst id = matches ? Number( matches[ 1 ] ) : null;\n\n\t\tif ( id ) {\n\t\t\tdispatch.__experimentalReceiveCurrentGlobalStylesId( id );\n\t\t}\n\t};\n\nexport const __experimentalGetCurrentThemeBaseGlobalStyles =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst currentTheme = await resolveSelect.getCurrentTheme();\n\t\t// Please adjust the preloaded requests if this changes!\n\t\tconst themeGlobalStyles = await apiFetch( {\n\t\t\tpath: `/wp/v2/global-styles/themes/${ currentTheme.stylesheet }?context=view`,\n\t\t} );\n\t\tdispatch.__experimentalReceiveThemeBaseGlobalStyles(\n\t\t\tcurrentTheme.stylesheet,\n\t\t\tthemeGlobalStyles\n\t\t);\n\t};\n\nexport const __experimentalGetCurrentThemeGlobalStylesVariations =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst currentTheme = await resolveSelect.getCurrentTheme();\n\t\t// Please adjust the preloaded requests if this changes!\n\t\tconst variations = await apiFetch( {\n\t\t\tpath: `/wp/v2/global-styles/themes/${ currentTheme.stylesheet }/variations?context=view`,\n\t\t} );\n\t\tdispatch.__experimentalReceiveThemeGlobalStyleVariations(\n\t\t\tcurrentTheme.stylesheet,\n\t\t\tvariations\n\t\t);\n\t};\n\n/**\n * Fetches and returns the revisions of the current global styles theme.\n */\nexport const getCurrentThemeGlobalStylesRevisions =\n\t() =>\n\tasync ( { resolveSelect, dispatch } ) => {\n\t\tconst globalStylesId =\n\t\t\tawait resolveSelect.__experimentalGetCurrentGlobalStylesId();\n\t\tconst record = globalStylesId\n\t\t\t? await resolveSelect.getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId\n\t\t\t )\n\t\t\t: undefined;\n\t\tconst revisionsURL = record?._links?.[ 'version-history' ]?.[ 0 ]?.href;\n\n\t\tif ( revisionsURL ) {\n\t\t\tconst resetRevisions = await apiFetch( {\n\t\t\t\turl: revisionsURL,\n\t\t\t} );\n\t\t\tconst revisions = resetRevisions?.map( ( revision ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( revision ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\t\t\tdispatch.receiveThemeGlobalStyleRevisions(\n\t\t\t\tglobalStylesId,\n\t\t\t\trevisions\n\t\t\t);\n\t\t}\n\t};\n\ngetCurrentThemeGlobalStylesRevisions.shouldInvalidate = ( action ) => {\n\treturn (\n\t\taction.type === 'SAVE_ENTITY_RECORD_FINISH' &&\n\t\taction.kind === 'root' &&\n\t\t! action.error &&\n\t\taction.name === 'globalStyles'\n\t);\n};\n\nexport const getBlockPatterns =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst patterns = await fetchBlockPatterns();\n\t\tdispatch( { type: 'RECEIVE_BLOCK_PATTERNS', patterns } );\n\t};\n\nexport const getBlockPatternCategories =\n\t() =>\n\tasync ( { dispatch } ) => {\n\t\tconst categories = await apiFetch( {\n\t\t\tpath: '/wp/v2/block-patterns/categories',\n\t\t} );\n\t\tdispatch( { type: 'RECEIVE_BLOCK_PATTERN_CATEGORIES', categories } );\n\t};\n\nexport const getUserPatternCategories =\n\t() =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst patternCategories = await resolveSelect.getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_pattern_category',\n\t\t\t{\n\t\t\t\tper_page: -1,\n\t\t\t\t_fields: 'id,name,description,slug',\n\t\t\t\tcontext: 'view',\n\t\t\t}\n\t\t);\n\n\t\tconst mappedPatternCategories =\n\t\t\tpatternCategories?.map( ( userCategory ) => ( {\n\t\t\t\t...userCategory,\n\t\t\t\tlabel: decodeEntities( userCategory.name ),\n\t\t\t\tname: userCategory.slug,\n\t\t\t} ) ) || [];\n\n\t\tdispatch( {\n\t\t\ttype: 'RECEIVE_USER_PATTERN_CATEGORIES',\n\t\t\tpatternCategories: mappedPatternCategories,\n\t\t} );\n\t};\n\nexport const getNavigationFallbackId =\n\t() =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst fallback = await apiFetch( {\n\t\t\tpath: addQueryArgs( '/wp-block-editor/v1/navigation-fallback', {\n\t\t\t\t_embed: true,\n\t\t\t} ),\n\t\t} );\n\n\t\tconst record = fallback?._embedded?.self;\n\n\t\tregistry.batch( () => {\n\t\t\tdispatch.receiveNavigationFallbackId( fallback?.id );\n\n\t\t\tif ( ! record ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the fallback is already in the store, don't invalidate navigation queries.\n\t\t\t// Otherwise, invalidate the cache for the scenario where there were no Navigation\n\t\t\t// posts in the state and the fallback created one.\n\t\t\tconst existingFallbackEntityRecord = select.getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\tfallback.id\n\t\t\t);\n\t\t\tconst invalidateNavigationQueries = ! existingFallbackEntityRecord;\n\t\t\tdispatch.receiveEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\trecord,\n\t\t\t\tundefined,\n\t\t\t\tinvalidateNavigationQueries\n\t\t\t);\n\n\t\t\t// Resolve to avoid further network requests.\n\t\t\tdispatch.finishResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'wp_navigation',\n\t\t\t\tfallback.id,\n\t\t\t] );\n\t\t} );\n\t};\n\nexport const getDefaultTemplateId =\n\t( query ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst template = await apiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', query ),\n\t\t} );\n\t\t// Wait for the the entities config to be loaded, otherwise receiving\n\t\t// the template as an entity will not work.\n\t\tawait resolveSelect.getEntitiesConfig( 'postType' );\n\t\t// Endpoint may return an empty object if no template is found.\n\t\tif ( template?.id ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveDefaultTemplateId( query, template.id );\n\t\t\t\tdispatch.receiveEntityRecords( 'postType', 'wp_template', [\n\t\t\t\t\ttemplate,\n\t\t\t\t] );\n\t\t\t\t// Avoid further network requests.\n\t\t\t\tdispatch.finishResolution( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\ttemplate.id,\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Requests an entity's revisions from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getRevisions =\n\t( kind, name, recordKey, query = {} ) =>\n\tasync ( { dispatch, registry, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\n\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( query._fields ) {\n\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t// the ID.\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\tentityConfig.revisionKey || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t};\n\t\t}\n\n\t\tconst path = addQueryArgs(\n\t\t\tentityConfig.getRevisionsUrl( recordKey ),\n\t\t\tquery\n\t\t);\n\n\t\tlet records, response;\n\t\tconst meta = {};\n\t\tconst isPaginated =\n\t\t\tentityConfig.supportsPagination && query.per_page !== -1;\n\t\ttry {\n\t\t\tresponse = await apiFetch( { path, parse: ! isPaginated } );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( response ) {\n\t\t\tif ( isPaginated ) {\n\t\t\t\trecords = Object.values( await response.json() );\n\t\t\t\tmeta.totalItems = parseInt(\n\t\t\t\t\tresponse.headers.get( 'X-WP-Total' )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\trecords = Object.values( response );\n\t\t\t}\n\n\t\t\t// If we request fields but the result doesn't contain the fields,\n\t\t\t// explicitly set these fields as \"undefined\"\n\t\t\t// that way we consider the query \"fulfilled\".\n\t\t\tif ( query._fields ) {\n\t\t\t\trecords = records.map( ( record ) => {\n\t\t\t\t\tquery._fields.split( ',' ).forEach( ( field ) => {\n\t\t\t\t\t\tif ( ! record.hasOwnProperty( field ) ) {\n\t\t\t\t\t\t\trecord[ field ] = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn record;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tregistry.batch( () => {\n\t\t\t\tdispatch.receiveRevisions(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\trecordKey,\n\t\t\t\t\trecords,\n\t\t\t\t\tquery,\n\t\t\t\t\tfalse,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\n\t\t\t\t// When requesting all fields, the list of results can be used to\n\t\t\t\t// resolve the `getRevision` selector in addition to `getRevisions`.\n\t\t\t\tif ( ! query?._fields && ! query.context ) {\n\t\t\t\t\tconst key = entityConfig.key || DEFAULT_ENTITY_KEY;\n\t\t\t\t\tconst resolutionsArgs = records\n\t\t\t\t\t\t.filter( ( record ) => record[ key ] )\n\t\t\t\t\t\t.map( ( record ) => [\n\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\trecordKey,\n\t\t\t\t\t\t\trecord[ key ],\n\t\t\t\t\t\t] );\n\n\t\t\t\t\tdispatch.finishResolutions(\n\t\t\t\t\t\t'getRevision',\n\t\t\t\t\t\tresolutionsArgs\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n// Invalidate cache when a new revision is created.\ngetRevisions.shouldInvalidate = ( action, kind, name, recordKey ) =>\n\taction.type === 'SAVE_ENTITY_RECORD_FINISH' &&\n\tname === action.name &&\n\tkind === action.kind &&\n\t! action.error &&\n\trecordKey === action.recordId;\n\n/**\n * Requests a specific Entity revision from the REST API.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.\n * @param {number|string} revisionKey The revision's key.\n * @param {Object|undefined} query Optional object of query parameters to\n * include with request. If requesting specific\n * fields, fields must always include the ID.\n */\nexport const getRevision =\n\t( kind, name, recordKey, revisionKey, query ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tconst configs = await resolveSelect.getEntitiesConfig( kind );\n\t\tconst entityConfig = configs.find(\n\t\t\t( config ) => config.name === name && config.kind === kind\n\t\t);\n\n\t\tif ( ! entityConfig ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( query !== undefined && query._fields ) {\n\t\t\t// If requesting specific fields, items and query association to said\n\t\t\t// records are stored by ID reference. Thus, fields must always include\n\t\t\t// the ID.\n\t\t\tquery = {\n\t\t\t\t...query,\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t...( getNormalizedCommaSeparable( query._fields ) ||\n\t\t\t\t\t\t\t[] ),\n\t\t\t\t\t\tentityConfig.revisionKey || DEFAULT_ENTITY_KEY,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t};\n\t\t}\n\t\tconst path = addQueryArgs(\n\t\t\tentityConfig.getRevisionsUrl( recordKey, revisionKey ),\n\t\t\tquery\n\t\t);\n\n\t\tlet record;\n\t\ttry {\n\t\t\trecord = await apiFetch( { path } );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if our request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( record ) {\n\t\t\tdispatch.receiveRevisions( kind, name, recordKey, record, query );\n\t\t}\n\t};\n\n/**\n * Requests a specific post type options from the REST API.\n *\n * @param {string} postType Post type slug.\n */\nexport const getRegisteredPostMeta =\n\t( postType ) =>\n\tasync ( { dispatch, resolveSelect } ) => {\n\t\tlet options;\n\t\ttry {\n\t\t\tconst {\n\t\t\t\trest_namespace: restNamespace = 'wp/v2',\n\t\t\t\trest_base: restBase,\n\t\t\t} = ( await resolveSelect.getPostType( postType ) ) || {};\n\t\t\toptions = await apiFetch( {\n\t\t\t\tpath: `${ restNamespace }/${ restBase }/?context=edit`,\n\t\t\t\tmethod: 'OPTIONS',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Do nothing if the request comes back with an API error.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( options ) {\n\t\t\tdispatch.receiveRegisteredPostMeta(\n\t\t\t\tpostType,\n\t\t\t\toptions?.schema?.properties?.meta?.properties\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Requests entity configs for the given kind from the REST API.\n *\n * @param {string} kind Entity kind.\n */\nexport const getEntitiesConfig =\n\t( kind ) =>\n\tasync ( { dispatch } ) => {\n\t\tconst loader = additionalEntityConfigLoaders.find(\n\t\t\t( l ) => l.kind === kind\n\t\t);\n\n\t\tif ( ! loader ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst configs = await loader.loadEntities();\n\t\t\tif ( ! configs.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch.addEntities( configs );\n\t\t} catch {\n\t\t\t// Do nothing if the request comes back with an API error.\n\t\t}\n\t};\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA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KAAM;EACxC,IAAIqL,OAAO;EACX,IAAI;IACH,MAAM;MACLjE,cAAc,EAAEC,aAAa,GAAG,OAAO;MACvCH,SAAS,EAAEC;IACZ,CAAC,GAAG,CAAE,MAAMnH,aAAa,CAACuH,WAAW,CAAEP,QAAS,CAAC,KAAM,CAAC,CAAC;IACzDqE,OAAO,GAAG,MAAM,IAAAjM,iBAAQ,EAAE;MACzBH,IAAI,EAAE,GAAIoI,aAAa,IAAMF,QAAQ,gBAAiB;MACtDR,MAAM,EAAE;IACT,CAAE,CAAC;EACJ,CAAC,CAAC,OAAQV,KAAK,EAAG;IACjB;IACA;EACD;EAEA,IAAKoF,OAAO,EAAG;IACdrM,QAAQ,CAACsM,yBAAyB,CACjCtE,QAAQ,EACRqE,OAAO,EAAEE,MAAM,EAAEC,UAAU,EAAE/J,IAAI,EAAE+J,UACpC,CAAC;EACF;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAlM,OAAA,CAAA8L,qBAAA,GAAAA,qBAAA;AAKO,MAAMlL,iBAAiB,GAC3BP,IAAI,IACN,OAAQ;EAAEX;AAAS,CAAC,KAAM;EACzB,MAAMyM,MAAM,GAAGC,uCAA6B,CAACtL,IAAI,CAC9CuL,CAAC,IAAMA,CAAC,CAAChM,IAAI,KAAKA,IACrB,CAAC;EAED,IAAK,CAAE8L,MAAM,EAAG;IACf;EACD;EAEA,IAAI;IACH,MAAMxL,OAAO,GAAG,MAAMwL,MAAM,CAACG,YAAY,CAAC,CAAC;IAC3C,IAAK,CAAE3L,OAAO,CAACyE,MAAM,EAAG;MACvB;IACD;IAEA1F,QAAQ,CAAC6M,WAAW,CAAE5L,OAAQ,CAAC;EAChC,CAAC,CAAC,MAAM;IACP;EAAA;AAEF,CAAC;AAACX,OAAA,CAAAY,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/attachment.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tMediaType,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\n\tCommentingStatus,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ninterface MediaDetails {\n\twidth: number;\n\theight: number;\n\tfile: string;\n\tfilesize: number;\n\tsizes: { [ key: string ]: Size };\n\timage_meta: ImageMeta;\n\toriginal_image?: string;\n}\ninterface ImageMeta {\n\taperture: string;\n\tcredit: string;\n\tcamera: string;\n\tcaption: string;\n\tcreated_timestamp: string;\n\tcopyright: string;\n\tfocal_length: string;\n\tiso: string;\n\tshutter_speed: string;\n\ttitle: string;\n\torientation: string;\n\tkeywords: any[];\n}\n\ninterface Size {\n\tfile: string;\n\twidth: number;\n\theight: number;\n\tfilesize?: number;\n\tmime_type: string;\n\tsource_url: string;\n\tuncropped?: boolean;\n}\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Attachment< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Alternative text to display when attachment is not displayed.\n\t\t\t */\n\t\t\talt_text: string;\n\t\t\t/**\n\t\t\t * The attachment caption.\n\t\t\t */\n\t\t\tcaption: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The attachment description.\n\t\t\t */\n\t\t\tdescription: ContextualField<\n\t\t\t\tRenderedText< C >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Attachment type.\n\t\t\t */\n\t\t\tmedia_type: MediaType;\n\t\t\t/**\n\t\t\t * The attachment MIME type.\n\t\t\t */\n\t\t\tmime_type: string;\n\t\t\t/**\n\t\t\t * Details about the media file, specific to its type.\n\t\t\t */\n\t\t\tmedia_details: MediaDetails;\n\t\t\t/**\n\t\t\t * The ID for the associated post of the attachment.\n\t\t\t */\n\t\t\tpost: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the original attachment file.\n\t\t\t */\n\t\t\tsource_url: string;\n\t\t\t/**\n\t\t\t * List of the missing image sizes of the attachment.\n\t\t\t */\n\t\t\tmissing_image_sizes: ContextualField< string[], 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Attachment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Attachment< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/attachment.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tMediaType,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\n\tCommentingStatus,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ninterface MediaDetails {\n\twidth: number;\n\theight: number;\n\tfile: string;\n\tfilesize: number;\n\tsizes: { [ key: string ]: Size };\n\timage_meta: ImageMeta;\n\toriginal_image?: string;\n}\ninterface ImageMeta {\n\taperture: string;\n\tcredit: string;\n\tcamera: string;\n\tcaption: string;\n\tcreated_timestamp: string;\n\tcopyright: string;\n\tfocal_length: string;\n\tiso: string;\n\tshutter_speed: string;\n\ttitle: string;\n\torientation: string;\n\tkeywords: any[];\n}\n\ninterface Size {\n\tfile: string;\n\twidth: number;\n\theight: number;\n\tfilesize?: number;\n\tmime_type: string;\n\tsource_url: string;\n\tuncropped?: boolean;\n}\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Attachment< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Alternative text to display when attachment is not displayed.\n\t\t\t */\n\t\t\talt_text: string;\n\t\t\t/**\n\t\t\t * The attachment caption.\n\t\t\t */\n\t\t\tcaption: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The attachment description.\n\t\t\t */\n\t\t\tdescription: ContextualField<\n\t\t\t\tRenderedText< C >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Attachment type.\n\t\t\t */\n\t\t\tmedia_type: MediaType;\n\t\t\t/**\n\t\t\t * The attachment MIME type.\n\t\t\t */\n\t\t\tmime_type: string;\n\t\t\t/**\n\t\t\t * Details about the media file, specific to its type.\n\t\t\t */\n\t\t\tmedia_details: MediaDetails;\n\t\t\t/**\n\t\t\t * The ID for the associated post of the attachment.\n\t\t\t */\n\t\t\tpost: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the original attachment file.\n\t\t\t */\n\t\t\tsource_url: string;\n\t\t\t/**\n\t\t\t * List of the missing image sizes of the attachment.\n\t\t\t */\n\t\t\tmissing_image_sizes: ContextualField< string[], 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Attachment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Attachment< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/comment.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tAvatarUrls,\n\tContext,\n\tContextualField,\n\tOmitNevers,\n\tRenderedText,\n} from './helpers';\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\nexport type CommentStatus = 'hold' | 'approve' | 'spam' | 'trash' | '1' | '0';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Comment< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the comment.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * The ID of the user object, if author was a user.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Email address for the comment author.\n\t\t\t */\n\t\t\tauthor_email: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * IP address for the comment author.\n\t\t\t */\n\t\t\tauthor_ip: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Display name for the comment author.\n\t\t\t */\n\t\t\tauthor_name: string;\n\t\t\t/**\n\t\t\t * URL for the comment author.\n\t\t\t */\n\t\t\tauthor_url: string;\n\t\t\t/**\n\t\t\t * User agent for the comment author.\n\t\t\t */\n\t\t\tauthor_user_agent: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The content for the comment.\n\t\t\t */\n\t\t\tcontent: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The date the comment was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string;\n\t\t\t/**\n\t\t\t * The date the comment was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the comment.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The ID for the parent of the comment.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * The ID of the associated post object.\n\t\t\t */\n\t\t\tpost: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * State of the comment.\n\t\t\t */\n\t\t\tstatus: ContextualField< CommentStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of the comment.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Avatar URLs for the comment author.\n\t\t\t */\n\t\t\tauthor_avatar_urls: AvatarUrls;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type Comment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Comment< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/comment.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tAvatarUrls,\n\tContext,\n\tContextualField,\n\tOmitNevers,\n\tRenderedText,\n} from './helpers';\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\nexport type CommentStatus = 'hold' | 'approve' | 'spam' | 'trash' | '1' | '0';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Comment< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the comment.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * The ID of the user object, if author was a user.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Email address for the comment author.\n\t\t\t */\n\t\t\tauthor_email: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * IP address for the comment author.\n\t\t\t */\n\t\t\tauthor_ip: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Display name for the comment author.\n\t\t\t */\n\t\t\tauthor_name: string;\n\t\t\t/**\n\t\t\t * URL for the comment author.\n\t\t\t */\n\t\t\tauthor_url: string;\n\t\t\t/**\n\t\t\t * User agent for the comment author.\n\t\t\t */\n\t\t\tauthor_user_agent: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The content for the comment.\n\t\t\t */\n\t\t\tcontent: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The date the comment was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string;\n\t\t\t/**\n\t\t\t * The date the comment was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the comment.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The ID for the parent of the comment.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * The ID of the associated post object.\n\t\t\t */\n\t\t\tpost: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * State of the comment.\n\t\t\t */\n\t\t\tstatus: ContextualField< CommentStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of the comment.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Avatar URLs for the comment author.\n\t\t\t */\n\t\t\tauthor_avatar_urls: AvatarUrls;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type Comment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Comment< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/nav-menu-item.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tRenderedText,\n\tContext,\n\tContextualField,\n\tOmitNevers,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\nexport type NavMenuItemType =\n\t| 'taxonomy'\n\t| 'post_type'\n\t| 'post_type_archive'\n\t| 'custom';\nexport type NavMenuItemStatus =\n\t| 'publish'\n\t| 'future'\n\t| 'draft'\n\t| 'pending'\n\t| 'private';\nexport type Target = '_blank' | '';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface NavMenuItem< C extends Context > {\n\t\t\t/**\n\t\t\t * The title for the object.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the object.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * The singular label used to describe this type of menu item.\n\t\t\t */\n\t\t\ttype_label: string;\n\t\t\t/**\n\t\t\t * The family of objects originally represented, such as \"post_type\" or \"taxonomy\".\n\t\t\t */\n\t\t\ttype: NavMenuItemType;\n\t\t\t/**\n\t\t\t * A named status for the object.\n\t\t\t */\n\t\t\tstatus: NavMenuItemStatus;\n\t\t\t/**\n\t\t\t * The ID for the parent of the object.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * Text for the title attribute of the link element for this menu item.\n\t\t\t */\n\t\t\tattr_title: string;\n\t\t\t/**\n\t\t\t * Class names for the link element of this menu item.\n\t\t\t */\n\t\t\tclasses: string[];\n\t\t\t/**\n\t\t\t * The description of this menu item.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.\n\t\t\t */\n\t\t\tmenu_order: number;\n\t\t\t/**\n\t\t\t * The type of object originally represented, such as \"category\", \"post\", or \"attachment\".\n\t\t\t */\n\t\t\tobject: string;\n\t\t\t/**\n\t\t\t * The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.\n\t\t\t */\n\t\t\tobject_id: number;\n\t\t\t/**\n\t\t\t * The target attribute of the link element for this menu item.\n\t\t\t */\n\t\t\ttarget: Target;\n\t\t\t/**\n\t\t\t * The URL to which this menu item points.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * The XFN relationship expressed in the link of this menu item.\n\t\t\t */\n\t\t\txfn: string[];\n\t\t\t/**\n\t\t\t * Whether the menu item represents an object that no longer exists.\n\t\t\t */\n\t\t\tinvalid: boolean;\n\t\t\t/**\n\t\t\t * The terms assigned to the object in the nav_menu taxonomy.\n\t\t\t */\n\t\t\tmenus: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type NavMenuItem< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.NavMenuItem< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/nav-menu-item.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tRenderedText,\n\tContext,\n\tContextualField,\n\tOmitNevers,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\nexport type NavMenuItemType =\n\t| 'taxonomy'\n\t| 'post_type'\n\t| 'post_type_archive'\n\t| 'custom';\nexport type NavMenuItemStatus =\n\t| 'publish'\n\t| 'future'\n\t| 'draft'\n\t| 'pending'\n\t| 'private';\nexport type Target = '_blank' | '';\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface NavMenuItem< C extends Context > {\n\t\t\t/**\n\t\t\t * The title for the object.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the object.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * The singular label used to describe this type of menu item.\n\t\t\t */\n\t\t\ttype_label: string;\n\t\t\t/**\n\t\t\t * The family of objects originally represented, such as \"post_type\" or \"taxonomy\".\n\t\t\t */\n\t\t\ttype: NavMenuItemType;\n\t\t\t/**\n\t\t\t * A named status for the object.\n\t\t\t */\n\t\t\tstatus: NavMenuItemStatus;\n\t\t\t/**\n\t\t\t * The ID for the parent of the object.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * Text for the title attribute of the link element for this menu item.\n\t\t\t */\n\t\t\tattr_title: string;\n\t\t\t/**\n\t\t\t * Class names for the link element of this menu item.\n\t\t\t */\n\t\t\tclasses: string[];\n\t\t\t/**\n\t\t\t * The description of this menu item.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.\n\t\t\t */\n\t\t\tmenu_order: number;\n\t\t\t/**\n\t\t\t * The type of object originally represented, such as \"category\", \"post\", or \"attachment\".\n\t\t\t */\n\t\t\tobject: string;\n\t\t\t/**\n\t\t\t * The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.\n\t\t\t */\n\t\t\tobject_id: number;\n\t\t\t/**\n\t\t\t * The target attribute of the link element for this menu item.\n\t\t\t */\n\t\t\ttarget: Target;\n\t\t\t/**\n\t\t\t * The URL to which this menu item points.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * The XFN relationship expressed in the link of this menu item.\n\t\t\t */\n\t\t\txfn: string[];\n\t\t\t/**\n\t\t\t * Whether the menu item represents an object that no longer exists.\n\t\t\t */\n\t\t\tinvalid: boolean;\n\t\t\t/**\n\t\t\t * The terms assigned to the object in the nav_menu taxonomy.\n\t\t\t */\n\t\t\tmenus: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type NavMenuItem< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.NavMenuItem< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/nav-menu.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, ContextualField, 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 NavMenu< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the term.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * HTML description of the term.\n\t\t\t */\n\t\t\tdescription: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * HTML title for the term.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the term unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The locations assigned to the menu.\n\t\t\t */\n\t\t\tlocations: ContextualField< string[], 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The DB ID of the original object this menu item represents, e . g . ID for posts and term_id for categories.\n\t\t\t */\n\t\t\tobject_id: number;\n\t\t\t/**\n\t\t\t * Whether to automatically add top level pages to this menu.\n\t\t\t */\n\t\t\tauto_add: ContextualField< boolean, 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type NavMenu< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.NavMenu< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/nav-menu.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, ContextualField, 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 NavMenu< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the term.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * HTML description of the term.\n\t\t\t */\n\t\t\tdescription: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * HTML title for the term.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the term unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The locations assigned to the menu.\n\t\t\t */\n\t\t\tlocations: ContextualField< string[], 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The DB ID of the original object this menu item represents, e . g . ID for posts and term_id for categories.\n\t\t\t */\n\t\t\tobject_id: number;\n\t\t\t/**\n\t\t\t * Whether to automatically add top level pages to this menu.\n\t\t\t */\n\t\t\tauto_add: ContextualField< boolean, 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type NavMenu< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.NavMenu< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/page.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tContextualField,\n\tPingStatus,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\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 Page< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * A password to protect access to the content and excerpt.\n\t\t\t */\n\t\t\tpassword: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The ID for the parent of the post.\n\t\t\t */\n\t\t\tparent: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the page.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The excerpt for the post.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The ID of the featured media for the post.\n\t\t\t */\n\t\t\tfeatured_media: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The order of the post in relation to other posts.\n\t\t\t */\n\t\t\tmenu_order: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Page< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Page< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/page.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tContextualField,\n\tPingStatus,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\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 Page< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * A password to protect access to the content and excerpt.\n\t\t\t */\n\t\t\tpassword: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The ID for the parent of the post.\n\t\t\t */\n\t\t\tparent: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the page.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The excerpt for the post.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The ID of the featured media for the post.\n\t\t\t */\n\t\t\tfeatured_media: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The order of the post in relation to other posts.\n\t\t\t */\n\t\t\tmenu_order: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Page< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Page< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/post-revision.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tRenderedText,\n\tOmitNevers,\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 PostRevision< C extends Context > {\n\t\t\t/**\n\t\t\t * The ID for the author of the post revision.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the post.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The excerpt for the post revision.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the revision.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post revision was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Identifier for the parent of the revision.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * The title for the post revision.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t}\n\t}\n}\n\nexport type PostRevision< C extends Context = 'view' > = OmitNevers<\n\t_BaseEntityRecords.PostRevision< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/post-revision.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tRenderedText,\n\tOmitNevers,\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 PostRevision< C extends Context > {\n\t\t\t/**\n\t\t\t * The ID for the author of the post revision.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the post.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The excerpt for the post revision.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the revision.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post revision was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Identifier for the parent of the revision.\n\t\t\t */\n\t\t\tparent: number;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * The title for the post revision.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t}\n\t}\n}\n\nexport type PostRevision< C extends Context = 'view' > = OmitNevers<\n\t_BaseEntityRecords.PostRevision< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/post.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tContextualField,\n\tPingStatus,\n\tPostFormat,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\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 Post< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * A password to protect access to the content and excerpt.\n\t\t\t */\n\t\t\tpassword: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the page.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The excerpt for the post.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The ID of the featured media for the post.\n\t\t\t */\n\t\t\tfeatured_media: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The format for the post.\n\t\t\t */\n\t\t\tformat: ContextualField< PostFormat, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post should be treated as sticky.\n\t\t\t */\n\t\t\tsticky: ContextualField< boolean, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The terms assigned to the post in the category taxonomy.\n\t\t\t */\n\t\t\tcategories: ContextualField< number[], 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The terms assigned to the post in the post_tag taxonomy.\n\t\t\t */\n\t\t\ttags: ContextualField< number[], 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Post< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Post< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/post.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tCommentingStatus,\n\tContext,\n\tContextualField,\n\tPingStatus,\n\tPostFormat,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\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 Post< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * A password to protect access to the content and excerpt.\n\t\t\t */\n\t\t\tpassword: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The content for the post.\n\t\t\t */\n\t\t\tcontent: ContextualField<\n\t\t\t\tRenderedText< C > & {\n\t\t\t\t\t/**\n\t\t\t\t\t * Whether the content is protected with a password.\n\t\t\t\t\t */\n\t\t\t\t\tis_protected: boolean;\n\t\t\t\t\t/**\n\t\t\t\t\t * Version of the content block format used by the page.\n\t\t\t\t\t */\n\t\t\t\t\tblock_version: ContextualField< string, 'edit', C >;\n\t\t\t\t},\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * The excerpt for the post.\n\t\t\t */\n\t\t\texcerpt: RenderedText< C > & {\n\t\t\t\tprotected: boolean;\n\t\t\t};\n\t\t\t/**\n\t\t\t * The ID of the featured media for the post.\n\t\t\t */\n\t\t\tfeatured_media: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The format for the post.\n\t\t\t */\n\t\t\tformat: ContextualField< PostFormat, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post should be treated as sticky.\n\t\t\t */\n\t\t\tsticky: ContextualField< boolean, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The terms assigned to the post in the category taxonomy.\n\t\t\t */\n\t\t\tcategories: ContextualField< number[], 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The terms assigned to the post in the post_tag taxonomy.\n\t\t\t */\n\t\t\ttags: ContextualField< number[], 'view' | 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Post< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Post< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/term.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, ContextualField, 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 Term< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the term.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Number of published posts for the term.\n\t\t\t */\n\t\t\tcount: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * HTML description of the term.\n\t\t\t */\n\t\t\tdescription: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL of the term.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * HTML title for the term.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the term unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Type attribution for the term.\n\t\t\t */\n\t\t\ttaxonomy: string;\n\t\t\t/**\n\t\t\t * The parent term ID. Only present for hierarchical taxonomies.\n\t\t\t */\n\t\t\tparent?: number;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type Term< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Term< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/term.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Context, ContextualField, 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 Term< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the term.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Number of published posts for the term.\n\t\t\t */\n\t\t\tcount: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * HTML description of the term.\n\t\t\t */\n\t\t\tdescription: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL of the term.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * HTML title for the term.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the term unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Type attribution for the term.\n\t\t\t */\n\t\t\ttaxonomy: string;\n\t\t\t/**\n\t\t\t * The parent term ID. Only present for hierarchical taxonomies.\n\t\t\t */\n\t\t\tparent?: number;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type Term< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Term< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/user.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tAvatarUrls,\n\tContext,\n\tContextualField,\n\tOmitNevers,\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 User< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the user.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Login name for the user.\n\t\t\t */\n\t\t\tusername: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Display name for the user.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * First name for the user.\n\t\t\t */\n\t\t\tfirst_name: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Last name for the user.\n\t\t\t */\n\t\t\tlast_name: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The email address for the user.\n\t\t\t */\n\t\t\temail: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * URL of the user.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * Description of the user.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Author URL of the user.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * Locale for the user.\n\t\t\t */\n\t\t\tlocale: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The nickname for the user.\n\t\t\t */\n\t\t\tnickname: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the user.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Registration date for the user.\n\t\t\t */\n\t\t\tregistered_date: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Roles assigned to the user.\n\t\t\t */\n\t\t\troles: ContextualField< string[], 'edit', C >;\n\t\t\t/**\n\t\t\t * Password for the user.\n\t\t\t *\n\t\t\t * This is never sent from the server to the client\n\t\t\t * but exists because we might send an update to the\n\t\t\t * server with a new password to set.\n\t\t\t */\n\t\t\tpassword?: string;\n\t\t\t/**\n\t\t\t * All capabilities assigned to the user.\n\t\t\t */\n\t\t\tcapabilities: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Any extra capabilities assigned to the user.\n\t\t\t */\n\t\t\textra_capabilities: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Avatar URLs for the user.\n\t\t\t */\n\t\t\tavatar_urls: AvatarUrls;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type User< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.User< C >\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/core-data/src/entity-types/user.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type {\n\tAvatarUrls,\n\tContext,\n\tContextualField,\n\tOmitNevers,\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 User< C extends Context > {\n\t\t\t/**\n\t\t\t * Unique identifier for the user.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * Login name for the user.\n\t\t\t */\n\t\t\tusername: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Display name for the user.\n\t\t\t */\n\t\t\tname: string;\n\t\t\t/**\n\t\t\t * First name for the user.\n\t\t\t */\n\t\t\tfirst_name: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Last name for the user.\n\t\t\t */\n\t\t\tlast_name: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The email address for the user.\n\t\t\t */\n\t\t\temail: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * URL of the user.\n\t\t\t */\n\t\t\turl: string;\n\t\t\t/**\n\t\t\t * Description of the user.\n\t\t\t */\n\t\t\tdescription: string;\n\t\t\t/**\n\t\t\t * Author URL of the user.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * Locale for the user.\n\t\t\t */\n\t\t\tlocale: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The nickname for the user.\n\t\t\t */\n\t\t\tnickname: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the user.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * Registration date for the user.\n\t\t\t */\n\t\t\tregistered_date: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Roles assigned to the user.\n\t\t\t */\n\t\t\troles: ContextualField< string[], 'edit', C >;\n\t\t\t/**\n\t\t\t * Password for the user.\n\t\t\t *\n\t\t\t * This is never sent from the server to the client\n\t\t\t * but exists because we might send an update to the\n\t\t\t * server with a new password to set.\n\t\t\t */\n\t\t\tpassword?: string;\n\t\t\t/**\n\t\t\t * All capabilities assigned to the user.\n\t\t\t */\n\t\t\tcapabilities: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Any extra capabilities assigned to the user.\n\t\t\t */\n\t\t\textra_capabilities: ContextualField<\n\t\t\t\tRecord< string, string >,\n\t\t\t\t'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Avatar URLs for the user.\n\t\t\t */\n\t\t\tavatar_urls: AvatarUrls;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t}\n\t}\n}\n\nexport type User< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.User< C >\n>;\n"],"mappings":"","ignoreList":[]}
@@ -12,6 +12,7 @@ import { useMemo } from '@wordpress/element';
12
12
  import useQuerySelect from './use-query-select';
13
13
  import { store as coreStore } from '../';
14
14
  import { unlock } from '../lock-unlock';
15
+ import { getNormalizedCommaSeparable } from '../utils';
15
16
  const EMPTY_ARRAY = [];
16
17
 
17
18
  /**
@@ -110,7 +111,13 @@ export function useEntityRecordsWithPermissions(kind, name, queryArgs = {}, opti
110
111
  const {
111
112
  records: data,
112
113
  ...ret
113
- } = useEntityRecords(kind, name, queryArgs, options);
114
+ } = useEntityRecords(kind, name, {
115
+ ...queryArgs,
116
+ // If _fields is provided, we need to include _links in the request for permission caching to work.
117
+ ...(queryArgs._fields ? {
118
+ _fields: [...new Set([...(getNormalizedCommaSeparable(queryArgs._fields) || []), '_links'])].join()
119
+ } : {})
120
+ }, options);
114
121
  const ids = useMemo(() => {
115
122
  var _data$map;
116
123
  return (_data$map = data?.map(
@@ -1 +1 @@
1
- {"version":3,"names":["addQueryArgs","deprecated","useSelect","useMemo","useQuerySelect","store","coreStore","unlock","EMPTY_ARRAY","useEntityRecords","kind","name","queryArgs","options","enabled","queryAsString","data","records","rest","query","getEntityRecords","totalItems","totalPages","select","getEntityRecordsTotalItems","getEntityRecordsTotalPages","__experimentalUseEntityRecords","alternative","since","useEntityRecordsWithPermissions","entityConfig","getEntityConfig","ret","ids","_data$map","map","record","_entityConfig$key","key","permissions","getEntityRecordsPermissions","dataWithPermissions","_data$map2","index"],"sources":["@wordpress/core-data/src/hooks/use-entity-records.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useQuerySelect from './use-query-select';\nimport { store as coreStore } from '../';\nimport type { Options } from './use-entity-record';\nimport type { Status } from './constants';\nimport { unlock } from '../lock-unlock';\n\ninterface EntityRecordsResolution< RecordType > {\n\t/** The requested entity record */\n\trecords: RecordType[] | null;\n\n\t/**\n\t * Is the record still being resolved?\n\t */\n\tisResolving: boolean;\n\n\t/**\n\t * Is the record resolved by now?\n\t */\n\thasResolved: boolean;\n\n\t/** Resolution status */\n\tstatus: Status;\n\n\t/**\n\t * The total number of available items (if not paginated).\n\t */\n\ttotalItems: number | null;\n\n\t/**\n\t * The total number of pages.\n\t */\n\ttotalPages: number | null;\n}\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Resolves the specified entity records.\n *\n * @since 6.1.0 Introduced in WordPress core.\n *\n * @param kind Kind of the entity, e.g. `root` or a `postType`. See rootEntitiesConfig in ../entities.ts for a list of available kinds.\n * @param name Name of the entity, e.g. `plugin` or a `post`. See rootEntitiesConfig in ../entities.ts for a list of available names.\n * @param queryArgs Optional HTTP query description for how to fetch the data, passed to the requested API endpoint.\n * @param options Optional hook options.\n * @example\n * ```js\n * import { useEntityRecords } from '@wordpress/core-data';\n *\n * function PageTitlesList() {\n * const { records, isResolving } = useEntityRecords( 'postType', 'page' );\n *\n * if ( isResolving ) {\n * return 'Loading...';\n * }\n *\n * return (\n * <ul>\n * {records.map(( page ) => (\n * <li>{ page.title }</li>\n * ))}\n * </ul>\n * );\n * }\n *\n * // Rendered in the application:\n * // <PageTitlesList />\n * ```\n *\n * In the above example, when `PageTitlesList` is rendered into an\n * application, the list of records and the resolution details will be retrieved from\n * the store state using `getEntityRecords()`, or resolved if missing.\n *\n * @return Entity records data.\n * @template RecordType\n */\nexport default function useEntityRecords< RecordType >(\n\tkind: string,\n\tname: string,\n\tqueryArgs: Record< string, unknown > = {},\n\toptions: Options = { enabled: true }\n): EntityRecordsResolution< RecordType > {\n\t// Serialize queryArgs to a string that can be safely used as a React dep.\n\t// We can't just pass queryArgs as one of the deps, because if it is passed\n\t// as an object literal, then it will be a different object on each call even\n\t// if the values remain the same.\n\tconst queryAsString = addQueryArgs( '', queryArgs );\n\n\tconst { data: records, ...rest } = useQuerySelect(\n\t\t( query ) => {\n\t\t\tif ( ! options.enabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t// Avoiding returning a new reference on every execution.\n\t\t\t\t\tdata: EMPTY_ARRAY,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn query( coreStore ).getEntityRecords( kind, name, queryArgs );\n\t\t},\n\t\t[ kind, name, queryAsString, options.enabled ]\n\t);\n\n\tconst { totalItems, totalPages } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! options.enabled ) {\n\t\t\t\treturn {\n\t\t\t\t\ttotalItems: null,\n\t\t\t\t\ttotalPages: null,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttotalItems: select( coreStore ).getEntityRecordsTotalItems(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\ttotalPages: select( coreStore ).getEntityRecordsTotalPages(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ kind, name, queryAsString, options.enabled ]\n\t);\n\n\treturn {\n\t\trecords,\n\t\ttotalItems,\n\t\ttotalPages,\n\t\t...rest,\n\t};\n}\n\nexport function __experimentalUseEntityRecords(\n\tkind: string,\n\tname: string,\n\tqueryArgs: any,\n\toptions: any\n) {\n\tdeprecated( `wp.data.__experimentalUseEntityRecords`, {\n\t\talternative: 'wp.data.useEntityRecords',\n\t\tsince: '6.1',\n\t} );\n\treturn useEntityRecords( kind, name, queryArgs, options );\n}\n\nexport function useEntityRecordsWithPermissions< RecordType >(\n\tkind: string,\n\tname: string,\n\tqueryArgs: Record< string, unknown > = {},\n\toptions: Options = { enabled: true }\n): EntityRecordsResolution< RecordType > {\n\tconst entityConfig = useSelect(\n\t\t( select ) => select( coreStore ).getEntityConfig( kind, name ),\n\t\t[ kind, name ]\n\t);\n\tconst { records: data, ...ret } = useEntityRecords(\n\t\tkind,\n\t\tname,\n\t\tqueryArgs,\n\t\toptions\n\t);\n\tconst ids = useMemo(\n\t\t() =>\n\t\t\tdata?.map(\n\t\t\t\t// @ts-ignore\n\t\t\t\t( record: RecordType ) => record[ entityConfig?.key ?? 'id' ]\n\t\t\t) ?? [],\n\t\t[ data, entityConfig?.key ]\n\t);\n\n\tconst permissions = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecordsPermissions } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\t\t\treturn getEntityRecordsPermissions( kind, name, ids );\n\t\t},\n\t\t[ ids, kind, name ]\n\t);\n\n\tconst dataWithPermissions = useMemo(\n\t\t() =>\n\t\t\tdata?.map( ( record, index ) => ( {\n\t\t\t\t// @ts-ignore\n\t\t\t\t...record,\n\t\t\t\tpermissions: permissions[ index ],\n\t\t\t} ) ) ?? [],\n\t\t[ data, permissions ]\n\t);\n\n\treturn { records: dataWithPermissions, ...ret };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SA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AA;IAAA,QAAAA,SAAA,GACClB,IAAI,EAAEmB,GAAG;IACR;IACEC,MAAkB;MAAA,IAAAC,iBAAA;MAAA,OAAMD,MAAM,EAAAC,iBAAA,GAAEP,YAAY,EAAEQ,GAAG,cAAAD,iBAAA,cAAAA,iBAAA,GAAI,IAAI,CAAE;IAAA,CAC9D,CAAC,cAAAH,SAAA,cAAAA,SAAA,GAAI,EAAE;EAAA,GACR,CAAElB,IAAI,EAAEc,YAAY,EAAEQ,GAAG,CAC1B,CAAC;EAED,MAAMC,WAAW,GAAGrC,SAAS,CAC1BqB,MAAM,IAAM;IACb,MAAM;MAAEiB;IAA4B,CAAC,GAAGjC,MAAM,CAC7CgB,MAAM,CAAEjB,SAAU,CACnB,CAAC;IACD,OAAOkC,2BAA2B,CAAE9B,IAAI,EAAEC,IAAI,EAAEsB,GAAI,CAAC;EACtD,CAAC,EACD,CAAEA,GAAG,EAAEvB,IAAI,EAAEC,IAAI,CAClB,CAAC;EAED,MAAM8B,mBAAmB,GAAGtC,OAAO,CAClC;IAAA,IAAAuC,UAAA;IAAA,QAAAA,UAAA,GACC1B,IAAI,EAAEmB,GAAG,CAAE,CAAEC,MAAM,EAAEO,KAAK,MAAQ;MACjC;MACA,GAAGP,MAAM;MACTG,WAAW,EAAEA,WAAW,CAAEI,KAAK;IAChC,CAAC,CAAG,CAAC,cAAAD,UAAA,cAAAA,UAAA,GAAI,EAAE;EAAA,GACZ,CAAE1B,IAAI,EAAEuB,WAAW,CACpB,CAAC;EAED,OAAO;IAAEtB,OAAO,EAAEwB,mBAAmB;IAAE,GAAGT;EAAI,CAAC;AAChD","ignoreList":[]}
1
+ {"version":3,"names":["addQueryArgs","deprecated","useSelect","useMemo","useQuerySelect","store","coreStore","unlock","getNormalizedCommaSeparable","EMPTY_ARRAY","useEntityRecords","kind","name","queryArgs","options","enabled","queryAsString","data","records","rest","query","getEntityRecords","totalItems","totalPages","select","getEntityRecordsTotalItems","getEntityRecordsTotalPages","__experimentalUseEntityRecords","alternative","since","useEntityRecordsWithPermissions","entityConfig","getEntityConfig","ret","_fields","Set","join","ids","_data$map","map","record","_entityConfig$key","key","permissions","getEntityRecordsPermissions","dataWithPermissions","_data$map2","index"],"sources":["@wordpress/core-data/src/hooks/use-entity-records.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useQuerySelect from './use-query-select';\nimport { store as coreStore } from '../';\nimport type { Options } from './use-entity-record';\nimport type { Status } from './constants';\nimport { unlock } from '../lock-unlock';\nimport { getNormalizedCommaSeparable } from '../utils';\n\ninterface EntityRecordsResolution< RecordType > {\n\t/** The requested entity record */\n\trecords: RecordType[] | null;\n\n\t/**\n\t * Is the record still being resolved?\n\t */\n\tisResolving: boolean;\n\n\t/**\n\t * Is the record resolved by now?\n\t */\n\thasResolved: boolean;\n\n\t/** Resolution status */\n\tstatus: Status;\n\n\t/**\n\t * The total number of available items (if not paginated).\n\t */\n\ttotalItems: number | null;\n\n\t/**\n\t * The total number of pages.\n\t */\n\ttotalPages: number | null;\n}\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Resolves the specified entity records.\n *\n * @since 6.1.0 Introduced in WordPress core.\n *\n * @param kind Kind of the entity, e.g. `root` or a `postType`. See rootEntitiesConfig in ../entities.ts for a list of available kinds.\n * @param name Name of the entity, e.g. `plugin` or a `post`. See rootEntitiesConfig in ../entities.ts for a list of available names.\n * @param queryArgs Optional HTTP query description for how to fetch the data, passed to the requested API endpoint.\n * @param options Optional hook options.\n * @example\n * ```js\n * import { useEntityRecords } from '@wordpress/core-data';\n *\n * function PageTitlesList() {\n * const { records, isResolving } = useEntityRecords( 'postType', 'page' );\n *\n * if ( isResolving ) {\n * return 'Loading...';\n * }\n *\n * return (\n * <ul>\n * {records.map(( page ) => (\n * <li>{ page.title }</li>\n * ))}\n * </ul>\n * );\n * }\n *\n * // Rendered in the application:\n * // <PageTitlesList />\n * ```\n *\n * In the above example, when `PageTitlesList` is rendered into an\n * application, the list of records and the resolution details will be retrieved from\n * the store state using `getEntityRecords()`, or resolved if missing.\n *\n * @return Entity records data.\n * @template RecordType\n */\nexport default function useEntityRecords< RecordType >(\n\tkind: string,\n\tname: string,\n\tqueryArgs: Record< string, unknown > = {},\n\toptions: Options = { enabled: true }\n): EntityRecordsResolution< RecordType > {\n\t// Serialize queryArgs to a string that can be safely used as a React dep.\n\t// We can't just pass queryArgs as one of the deps, because if it is passed\n\t// as an object literal, then it will be a different object on each call even\n\t// if the values remain the same.\n\tconst queryAsString = addQueryArgs( '', queryArgs );\n\n\tconst { data: records, ...rest } = useQuerySelect(\n\t\t( query ) => {\n\t\t\tif ( ! options.enabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t// Avoiding returning a new reference on every execution.\n\t\t\t\t\tdata: EMPTY_ARRAY,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn query( coreStore ).getEntityRecords( kind, name, queryArgs );\n\t\t},\n\t\t[ kind, name, queryAsString, options.enabled ]\n\t);\n\n\tconst { totalItems, totalPages } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! options.enabled ) {\n\t\t\t\treturn {\n\t\t\t\t\ttotalItems: null,\n\t\t\t\t\ttotalPages: null,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttotalItems: select( coreStore ).getEntityRecordsTotalItems(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\ttotalPages: select( coreStore ).getEntityRecordsTotalPages(\n\t\t\t\t\tkind,\n\t\t\t\t\tname,\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ kind, name, queryAsString, options.enabled ]\n\t);\n\n\treturn {\n\t\trecords,\n\t\ttotalItems,\n\t\ttotalPages,\n\t\t...rest,\n\t};\n}\n\nexport function __experimentalUseEntityRecords(\n\tkind: string,\n\tname: string,\n\tqueryArgs: any,\n\toptions: any\n) {\n\tdeprecated( `wp.data.__experimentalUseEntityRecords`, {\n\t\talternative: 'wp.data.useEntityRecords',\n\t\tsince: '6.1',\n\t} );\n\treturn useEntityRecords( kind, name, queryArgs, options );\n}\n\nexport function useEntityRecordsWithPermissions< RecordType >(\n\tkind: string,\n\tname: string,\n\tqueryArgs: Record< string, unknown > = {},\n\toptions: Options = { enabled: true }\n): EntityRecordsResolution< RecordType > {\n\tconst entityConfig = useSelect(\n\t\t( select ) => select( coreStore ).getEntityConfig( kind, name ),\n\t\t[ kind, name ]\n\t);\n\tconst { records: data, ...ret } = useEntityRecords(\n\t\tkind,\n\t\tname,\n\t\t{\n\t\t\t...queryArgs,\n\t\t\t// If _fields is provided, we need to include _links in the request for permission caching to work.\n\t\t\t...( queryArgs._fields\n\t\t\t\t? {\n\t\t\t\t\t\t_fields: [\n\t\t\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t\t\t...( getNormalizedCommaSeparable(\n\t\t\t\t\t\t\t\t\tqueryArgs._fields\n\t\t\t\t\t\t\t\t) || [] ),\n\t\t\t\t\t\t\t\t'_links',\n\t\t\t\t\t\t\t] ),\n\t\t\t\t\t\t].join(),\n\t\t\t\t }\n\t\t\t\t: {} ),\n\t\t},\n\t\toptions\n\t);\n\tconst ids = useMemo(\n\t\t() =>\n\t\t\tdata?.map(\n\t\t\t\t// @ts-ignore\n\t\t\t\t( record: RecordType ) => record[ entityConfig?.key ?? 'id' ]\n\t\t\t) ?? [],\n\t\t[ data, entityConfig?.key ]\n\t);\n\n\tconst permissions = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecordsPermissions } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\t\t\treturn getEntityRecordsPermissions( kind, name, ids );\n\t\t},\n\t\t[ ids, kind, name ]\n\t);\n\n\tconst dataWithPermissions = useMemo(\n\t\t() =>\n\t\t\tdata?.map( ( record, index ) => ( {\n\t\t\t\t// @ts-ignore\n\t\t\t\t...record,\n\t\t\t\tpermissions: permissions[ index ],\n\t\t\t} ) ) ?? [],\n\t\t[ data, permissions ]\n\t);\n\n\treturn { records: dataWithPermissions, ...ret };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,KAAK;AAGxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,2BAA2B,QAAQ,UAAU;AA8BtD,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,gBAAgBA,CACvCC,IAAY,EACZC,IAAY,EACZC,SAAoC,GAAG,CAAC,CAAC,EACzCC,OAAgB,GAAG;EAAEC,OAAO,EAAE;AAAK,CAAC,EACI;EACxC;EACA;EACA;EACA;EACA,MAAMC,aAAa,GAAGhB,YAAY,CAAE,EAAE,EAAEa,SAAU,CAAC;EAEnD,MAAM;IAAEI,IAAI,EAAEC,OAAO;IAAE,GAAGC;EAAK,CAAC,GAAGf,cAAc,CAC9CgB,KAAK,IAAM;IACZ,IAAK,CAAEN,OAAO,CAACC,OAAO,EAAG;MACxB,OAAO;QACN;QACAE,IAAI,EAAER;MACP,CAAC;IACF;IACA,OAAOW,KAAK,CAAEd,SAAU,CAAC,CAACe,gBAAgB,CAAEV,IAAI,EAAEC,IAAI,EAAEC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,KAAK,MAAQ;MACjC;MACA,GAAGP,MAAM;MACTG,WAAW,EAAEA,WAAW,CAAEI,KAAK;IAChC,CAAC,CAAG,CAAC,cAAAD,UAAA,cAAAA,UAAA,GAAI,EAAE;EAAA,GACZ,CAAE7B,IAAI,EAAE0B,WAAW,CACpB,CAAC;EAED,OAAO;IAAEzB,OAAO,EAAE2B,mBAAmB;IAAE,GAAGZ;EAAI,CAAC;AAChD","ignoreList":[]}
@@ -279,10 +279,11 @@ export const getEntityRecords = (kind, name, query = {}) => async ({
279
279
  // the `getEntityRecord` and `canUser` selectors in addition to `getEntityRecords`.
280
280
  // See https://github.com/WordPress/gutenberg/pull/26575
281
281
  // See https://github.com/WordPress/gutenberg/pull/64504
282
- if (!query?._fields && !query.context) {
283
- const targetHints = records.filter(record => record?.[key]).map(record => ({
282
+ // See https://github.com/WordPress/gutenberg/pull/70738
283
+ if (!query.context) {
284
+ const targetHints = records.filter(record => !!record?.[key] && !!record?._links?.self?.[0]?.targetHints?.allow).map(record => ({
284
285
  id: record[key],
285
- permissions: getUserPermissionsFromAllowHeader(record?._links?.self?.[0].targetHints.allow)
286
+ permissions: getUserPermissionsFromAllowHeader(record._links.self[0].targetHints.allow)
286
287
  }));
287
288
  const canUserResolutionsArgs = [];
288
289
  const receiveUserPermissionArgs = {};
@@ -300,9 +301,13 @@ export const getEntityRecords = (kind, name, query = {}) => async ({
300
301
  })] = targetHint.permissions[action];
301
302
  }
302
303
  }
303
- dispatch.receiveUserPermissions(receiveUserPermissionArgs);
304
- dispatch.finishResolutions('getEntityRecord', getResolutionsArgs(records));
305
- dispatch.finishResolutions('canUser', canUserResolutionsArgs);
304
+ if (targetHints.length > 0) {
305
+ dispatch.receiveUserPermissions(receiveUserPermissionArgs);
306
+ dispatch.finishResolutions('canUser', canUserResolutionsArgs);
307
+ }
308
+ if (!query?._fields) {
309
+ dispatch.finishResolutions('getEntityRecord', getResolutionsArgs(records));
310
+ }
306
311
  }
307
312
  dispatch.__unstableReleaseStoreLock(lock);
308
313
  });