@wordpress/block-editor 15.6.1-next.36001005c.0 → 15.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-list/block.js +3 -3
- package/build/components/block-list/block.js.map +2 -2
- package/build/components/block-list/index.js +2 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +2 -5
- package/build/components/block-toolbar/switch-section-style.js.map +2 -2
- package/build/components/global-styles/hooks.js +0 -107
- package/build/components/global-styles/hooks.js.map +3 -3
- package/build/components/global-styles/index.js +0 -15
- package/build/components/global-styles/index.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +18 -1
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/global-styles/utils.js +0 -19
- package/build/components/global-styles/utils.js.map +3 -3
- package/build/components/inserter/media-tab/media-tab.js +33 -1
- package/build/components/inserter/media-tab/media-tab.js.map +3 -3
- package/build/components/inserter/tips.js +0 -2
- package/build/components/inserter/tips.js.map +2 -2
- package/build/components/media-placeholder/index.js +31 -1
- package/build/components/media-placeholder/index.js.map +3 -3
- package/build/components/media-replace-flow/index.js +29 -1
- package/build/components/media-replace-flow/index.js.map +3 -3
- package/build/components/{global-styles/context.js → media-upload-modal/index.js} +8 -23
- package/build/components/media-upload-modal/index.js.map +7 -0
- package/build/components/rich-text/index.js +8 -7
- package/build/components/rich-text/index.js.map +2 -2
- package/build/hooks/allowed-blocks.js +3 -8
- package/build/hooks/allowed-blocks.js.map +3 -3
- package/build/hooks/block-bindings.js +111 -170
- package/build/hooks/block-bindings.js.map +2 -2
- package/build/hooks/block-style-variation.js +4 -13
- package/build/hooks/block-style-variation.js.map +2 -2
- package/build/hooks/custom-class-name.js +1 -1
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/fit-text.js +33 -20
- package/build/hooks/fit-text.js.map +2 -2
- package/build/hooks/font-size.js +4 -3
- package/build/hooks/font-size.js.map +2 -2
- package/build/hooks/metadata.js +48 -2
- package/build/hooks/metadata.js.map +2 -2
- package/build/hooks/typography.js +11 -4
- package/build/hooks/typography.js.map +3 -3
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +3 -3
- package/build/store/private-selectors.js +3 -3
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/selectors.js +38 -13
- package/build/store/selectors.js.map +2 -2
- package/build/store/utils.js +2 -1
- package/build/store/utils.js.map +2 -2
- package/build/utils/fit-text-utils.js +4 -4
- package/build/utils/fit-text-utils.js.map +2 -2
- package/build-module/components/block-list/block.js +3 -3
- package/build-module/components/block-list/block.js.map +2 -2
- package/build-module/components/block-list/index.js +2 -2
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +2 -5
- package/build-module/components/block-toolbar/switch-section-style.js.map +2 -2
- package/build-module/components/global-styles/hooks.js +1 -99
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/index.js +1 -15
- package/build-module/components/global-styles/index.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +18 -1
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/global-styles/utils.js +0 -8
- package/build-module/components/global-styles/utils.js.map +2 -2
- package/build-module/components/inserter/media-tab/media-tab.js +34 -2
- package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
- package/build-module/components/inserter/tips.js +0 -2
- package/build-module/components/inserter/tips.js.map +2 -2
- package/build-module/components/media-placeholder/index.js +31 -1
- package/build-module/components/media-placeholder/index.js.map +2 -2
- package/build-module/components/media-replace-flow/index.js +29 -1
- package/build-module/components/media-replace-flow/index.js.map +2 -2
- package/build-module/components/media-upload-modal/index.js +7 -0
- package/build-module/components/media-upload-modal/index.js.map +7 -0
- package/build-module/components/rich-text/index.js +8 -7
- package/build-module/components/rich-text/index.js.map +2 -2
- package/build-module/hooks/allowed-blocks.js +3 -8
- package/build-module/hooks/allowed-blocks.js.map +2 -2
- package/build-module/hooks/block-bindings.js +112 -172
- package/build-module/hooks/block-bindings.js.map +2 -2
- package/build-module/hooks/block-style-variation.js +5 -14
- package/build-module/hooks/block-style-variation.js.map +2 -2
- package/build-module/hooks/custom-class-name.js +1 -1
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/fit-text.js +34 -21
- package/build-module/hooks/fit-text.js.map +2 -2
- package/build-module/hooks/font-size.js +4 -3
- package/build-module/hooks/font-size.js.map +2 -2
- package/build-module/hooks/metadata.js +46 -1
- package/build-module/hooks/metadata.js.map +2 -2
- package/build-module/hooks/typography.js +11 -4
- package/build-module/hooks/typography.js.map +3 -3
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +2 -2
- package/build-module/store/private-selectors.js +2 -2
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/selectors.js +39 -14
- package/build-module/store/selectors.js.map +2 -2
- package/build-module/store/utils.js +3 -2
- package/build-module/store/utils.js.map +2 -2
- package/build-module/utils/fit-text-utils.js +4 -4
- package/build-module/utils/fit-text-utils.js.map +2 -2
- package/package.json +36 -36
- package/src/components/block-list/block.js +1 -1
- package/src/components/block-list/index.js +2 -2
- package/src/components/block-toolbar/switch-section-style.js +2 -5
- package/src/components/global-styles/hooks.js +1 -121
- package/src/components/global-styles/index.js +1 -9
- package/src/components/global-styles/typography-panel.js +26 -1
- package/src/components/global-styles/utils.js +0 -31
- package/src/components/inserter/media-tab/media-tab.js +44 -2
- package/src/components/inserter/tips.js +0 -2
- package/src/components/media-placeholder/index.js +41 -1
- package/src/components/media-replace-flow/index.js +39 -1
- package/src/components/media-upload-modal/index.js +18 -0
- package/src/components/rich-text/index.js +8 -14
- package/src/hooks/allowed-blocks.js +3 -11
- package/src/hooks/block-bindings.js +79 -153
- package/src/hooks/block-style-variation.js +5 -17
- package/src/hooks/custom-class-name.js +1 -1
- package/src/hooks/fit-text.js +39 -30
- package/src/hooks/font-size.js +7 -3
- package/src/hooks/metadata.js +89 -0
- package/src/hooks/test/metadata.js +316 -0
- package/src/hooks/typography.js +15 -4
- package/src/private-apis.js +2 -0
- package/src/store/private-selectors.js +2 -2
- package/src/store/selectors.js +59 -21
- package/src/store/test/selectors.js +1 -1
- package/src/store/utils.js +2 -1
- package/src/utils/fit-text-utils.js +4 -16
- package/tsconfig.json +1 -0
- package/build/components/global-styles/context.js.map +0 -7
- package/build/components/global-styles/get-global-styles-changes.js +0 -216
- package/build/components/global-styles/get-global-styles-changes.js.map +0 -7
- package/build-module/components/global-styles/context.js +0 -17
- package/build-module/components/global-styles/context.js.map +0 -7
- package/build-module/components/global-styles/get-global-styles-changes.js +0 -182
- package/build-module/components/global-styles/get-global-styles-changes.js.map +0 -7
- package/src/components/global-styles/README.md +0 -190
- package/src/components/global-styles/context.js +0 -16
- package/src/components/global-styles/get-global-styles-changes.js +0 -252
- package/src/components/global-styles/test/get-global-styles-changes.js +0 -290
- package/src/components/global-styles/test/utils.js +0 -58
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockVariations,\n\thasBlockSupport,\n\tgetPossibleBlockTransformations,\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\nimport { symbol } from '@wordpress/icons';\nimport { create, remove, toHTMLString } from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tisFiltered,\n\tcheckAllowListRecursive,\n\tcheckAllowList,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetParsedPattern,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { orderBy } from '../utils/sorting';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nimport {\n\tgetContentLockingParent,\n\tgetTemporarilyEditingAsBlocks,\n\tgetTemporarilyEditingFocusModeToRevert,\n\tgetSectionRootClientId,\n\tisSectionBlock,\n\tgetParentSectionBlock,\n\tisZoomOut,\n\tisContainerInsertableToInWriteMode,\n} from './private-selectors';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\n/**\n * A block selection object.\n *\n * @typedef {Object} WPBlockSelection\n *\n * @property {string} clientId A block client ID.\n * @property {string} attributeKey A block attribute key.\n * @property {number} offset An attribute value offset, based on the rich\n * text value. See `wp.richText.create`.\n */\n\n// Module constants.\nconst MILLISECONDS_PER_HOUR = 3600 * 1000;\nconst MILLISECONDS_PER_DAY = 24 * 3600 * 1000;\nconst MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Shared reference to an empty Set for cases where it is important to avoid\n * returning a new Set reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Set}\n */\nconst EMPTY_SET = new Set();\n\nconst DEFAULT_INSERTER_OPTIONS = {\n\t[ isFiltered ]: true,\n};\n\n/**\n * Returns a block's name given its client ID, or null if no block exists with\n * the client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {string} Block name.\n */\nexport function getBlockName( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\tconst socialLinkName = 'core/social-link';\n\n\tif ( Platform.OS !== 'web' && block?.name === socialLinkName ) {\n\t\tconst attributes = state.blocks.attributes.get( clientId );\n\t\tconst { service } = attributes ?? {};\n\n\t\treturn service ? `${ socialLinkName }-${ service }` : socialLinkName;\n\t}\n\treturn block ? block.name : null;\n}\n\n/**\n * Returns whether a block is valid or not.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Is Valid.\n */\nexport function isBlockValid( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\treturn !! block && block.isValid;\n}\n\n/**\n * Returns a block's attributes given its client ID, or null if no block exists with\n * the client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {?Object} Block attributes.\n */\nexport function getBlockAttributes( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\treturn state.blocks.attributes.get( clientId );\n}\n\n/**\n * Returns a block given its client ID. This is a parsed copy of the block,\n * containing its `blockName`, `clientId`, and current `attributes` state. This\n * is not the block's registration settings, which must be retrieved from the\n * blocks module registration store.\n *\n * getBlock recurses through its inner blocks until all its children blocks have\n * been retrieved. Note that getBlock will not return the child inner blocks of\n * an inner block controller. This is because an inner block controller syncs\n * itself with its own entity, and should therefore not be included with the\n * blocks of a different entity. For example, say you call `getBlocks( TP )` to\n * get the blocks of a template part. If another template part is a child of TP,\n * then the nested template part's child blocks will not be returned. This way,\n * the template block itself is considered part of the parent, but the children\n * are not.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {Object} Parsed block object.\n */\nexport function getBlock( state, clientId ) {\n\tif ( ! state.blocks.byClientId.has( clientId ) ) {\n\t\treturn null;\n\t}\n\n\treturn state.blocks.tree.get( clientId );\n}\n\nexport const __unstableGetBlockWithoutInnerBlocks = createSelector(\n\t( state, clientId ) => {\n\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\tif ( ! block ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\t...block,\n\t\t\tattributes: getBlockAttributes( state, clientId ),\n\t\t};\n\t},\n\t( state, clientId ) => [\n\t\tstate.blocks.byClientId.get( clientId ),\n\t\tstate.blocks.attributes.get( clientId ),\n\t]\n);\n\n/**\n * Returns all block objects for the current post being edited as an array in\n * the order they appear in the post. Note that this will exclude child blocks\n * of nested inner block controllers.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Post blocks.\n */\nexport function getBlocks( state, rootClientId ) {\n\tconst treeKey =\n\t\t! rootClientId || ! areInnerBlocksControlled( state, rootClientId )\n\t\t\t? rootClientId || ''\n\t\t\t: 'controlled||' + rootClientId;\n\treturn state.blocks.tree.get( treeKey )?.innerBlocks || EMPTY_ARRAY;\n}\n\n/**\n * Returns a stripped down block object containing only its client ID,\n * and its inner blocks' client IDs.\n *\n * @deprecated\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Client ID of the block to get.\n *\n * @return {Object} Client IDs of the post blocks.\n */\nexport const __unstableGetClientIdWithClientIdsTree = createSelector(\n\t( state, clientId ) => {\n\t\tdeprecated(\n\t\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree\",\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\tversion: '6.5',\n\t\t\t}\n\t\t);\n\t\treturn {\n\t\t\tclientId,\n\t\t\tinnerBlocks: __unstableGetClientIdsTree( state, clientId ),\n\t\t};\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns the block tree represented in the block-editor store from the\n * given root, consisting of stripped down block objects containing only\n * their client IDs, and their inner blocks' client IDs.\n *\n * @deprecated\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Client IDs of the post blocks.\n */\nexport const __unstableGetClientIdsTree = createSelector(\n\t( state, rootClientId = '' ) => {\n\t\tdeprecated(\n\t\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree\",\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\tversion: '6.5',\n\t\t\t}\n\t\t);\n\t\treturn getBlockOrder( state, rootClientId ).map( ( clientId ) =>\n\t\t\t__unstableGetClientIdWithClientIdsTree( state, clientId )\n\t\t);\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns an array containing the clientIds of all descendants of the blocks\n * given. Returned ids are ordered first by the order of the ids given, then\n * by the order that they appear in the editor.\n *\n * @param {Object} state Global application state.\n * @param {string|string[]} rootIds Client ID(s) for which descendant blocks are to be returned.\n *\n * @return {Array} Client IDs of descendants.\n */\nexport const getClientIdsOfDescendants = createSelector(\n\t( state, rootIds ) => {\n\t\trootIds = Array.isArray( rootIds ) ? [ ...rootIds ] : [ rootIds ];\n\t\tconst ids = [];\n\n\t\t// Add the descendants of the root blocks first.\n\t\tfor ( const rootId of rootIds ) {\n\t\t\tconst order = state.blocks.order.get( rootId );\n\t\t\tif ( order ) {\n\t\t\t\tids.push( ...order );\n\t\t\t}\n\t\t}\n\n\t\tlet index = 0;\n\n\t\t// Add the descendants of the descendants, recursively.\n\t\twhile ( index < ids.length ) {\n\t\t\tconst id = ids[ index ];\n\t\t\tconst order = state.blocks.order.get( id );\n\t\t\tif ( order ) {\n\t\t\t\tids.splice( index + 1, 0, ...order );\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\n\t\treturn ids;\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns an array containing the clientIds of the top-level blocks and\n * their descendants of any depth (for nested blocks). Ids are returned\n * in the same order that they appear in the editor.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} ids of top-level and descendant blocks.\n */\nexport const getClientIdsWithDescendants = ( state ) =>\n\tgetClientIdsOfDescendants( state, '' );\n\n/**\n * Returns the total number of blocks, or the total number of blocks with a specific name in a post.\n * The number returned includes nested blocks.\n *\n * @param {Object} state Global application state.\n * @param {?string} blockName Optional block name, if specified only blocks of that type will be counted.\n *\n * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName.\n */\nexport const getGlobalBlockCount = createSelector(\n\t( state, blockName ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tif ( ! blockName ) {\n\t\t\treturn clientIds.length;\n\t\t}\n\t\tlet count = 0;\n\t\tfor ( const clientId of clientIds ) {\n\t\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\t\tif ( block.name === blockName ) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t},\n\t( state ) => [ state.blocks.order, state.blocks.byClientId ]\n);\n\n/**\n * Returns all blocks that match a blockName. Results include nested blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} blockName Block name(s) for which clientIds are to be returned.\n *\n * @return {Array} Array of clientIds of blocks with name equal to blockName.\n */\nexport const getBlocksByName = createSelector(\n\t( state, blockName ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst blockNames = Array.isArray( blockName )\n\t\t\t? blockName\n\t\t\t: [ blockName ];\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst foundBlocks = clientIds.filter( ( clientId ) => {\n\t\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\t\treturn blockNames.includes( block.name );\n\t\t} );\n\t\treturn foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY;\n\t},\n\t( state ) => [ state.blocks.order, state.blocks.byClientId ]\n);\n\n/**\n * Returns all global blocks that match a blockName. Results include nested blocks.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string[]} blockName Block name(s) for which clientIds are to be returned.\n *\n * @return {Array} Array of clientIds of blocks with name equal to blockName.\n */\nexport function __experimentalGetGlobalBlocksByName( state, blockName ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\talternative: `wp.data.select( 'core/block-editor' ).getBlocksByName`,\n\t\t}\n\t);\n\treturn getBlocksByName( state, blockName );\n}\n\n/**\n * Given an array of block client IDs, returns the corresponding array of block\n * objects.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds Client IDs for which blocks are to be returned.\n *\n * @return {WPBlock[]} Block objects.\n */\nexport const getBlocksByClientId = createSelector(\n\t( state, clientIds ) =>\n\t\t( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(\n\t\t\t( clientId ) => getBlock( state, clientId )\n\t\t),\n\t( state, clientIds ) =>\n\t\t( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(\n\t\t\t( clientId ) => state.blocks.tree.get( clientId )\n\t\t)\n);\n\n/**\n * Given an array of block client IDs, returns the corresponding array of block\n * names.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds Client IDs for which block names are to be returned.\n *\n * @return {string[]} Block names.\n */\nexport const getBlockNamesByClientId = createSelector(\n\t( state, clientIds ) =>\n\t\tgetBlocksByClientId( state, clientIds )\n\t\t\t.filter( Boolean )\n\t\t\t.map( ( block ) => block.name ),\n\t( state, clientIds ) => getBlocksByClientId( state, clientIds )\n);\n\n/**\n * Returns the number of blocks currently present in the post.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {number} Number of blocks in the post.\n */\nexport function getBlockCount( state, rootClientId ) {\n\treturn getBlockOrder( state, rootClientId ).length;\n}\n\n/**\n * Returns the current selection start block client ID, attribute key and text\n * offset.\n *\n * @param {Object} state Block editor state.\n *\n * @return {WPBlockSelection} Selection start information.\n */\nexport function getSelectionStart( state ) {\n\treturn state.selection.selectionStart;\n}\n\n/**\n * Returns the current selection end block client ID, attribute key and text\n * offset.\n *\n * @param {Object} state Block editor state.\n *\n * @return {WPBlockSelection} Selection end information.\n */\nexport function getSelectionEnd( state ) {\n\treturn state.selection.selectionEnd;\n}\n\n/**\n * Returns the current block selection start. This value may be null, and it\n * may represent either a singular block selection or multi-selection start.\n * A selection is singular if its start and end match.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Client ID of block selection start.\n */\nexport function getBlockSelectionStart( state ) {\n\treturn state.selection.selectionStart.clientId;\n}\n\n/**\n * Returns the current block selection end. This value may be null, and it\n * may represent either a singular block selection or multi-selection end.\n * A selection is singular if its start and end match.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Client ID of block selection end.\n */\nexport function getBlockSelectionEnd( state ) {\n\treturn state.selection.selectionEnd.clientId;\n}\n\n/**\n * Returns the number of blocks currently selected in the post.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} Number of blocks selected in the post.\n */\nexport function getSelectedBlockCount( state ) {\n\tconst multiSelectedBlockCount =\n\t\tgetMultiSelectedBlockClientIds( state ).length;\n\n\tif ( multiSelectedBlockCount ) {\n\t\treturn multiSelectedBlockCount;\n\t}\n\n\treturn state.selection.selectionStart.clientId ? 1 : 0;\n}\n\n/**\n * Returns true if there is a single selected block, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether a single block is selected.\n */\nexport function hasSelectedBlock( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\treturn (\n\t\t!! selectionStart.clientId &&\n\t\tselectionStart.clientId === selectionEnd.clientId\n\t);\n}\n\n/**\n * Returns the currently selected block client ID, or null if there is no\n * selected block.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Selected block client ID.\n */\nexport function getSelectedBlockClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\tconst { clientId } = selectionStart;\n\n\tif ( ! clientId || clientId !== selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn clientId;\n}\n\n/**\n * Returns the currently selected block, or null if there is no selected block.\n *\n * @param {Object} state Global application state.\n *\n * @example\n *\n *```js\n * import { select } from '@wordpress/data'\n * import { store as blockEditorStore } from '@wordpress/block-editor'\n *\n * // Set initial active block client ID\n * let activeBlockClientId = null\n *\n * const getActiveBlockData = () => {\n * \tconst activeBlock = select(blockEditorStore).getSelectedBlock()\n *\n * \tif (activeBlock && activeBlock.clientId !== activeBlockClientId) {\n * \t\tactiveBlockClientId = activeBlock.clientId\n *\n * \t\t// Get active block name and attributes\n * \t\tconst activeBlockName = activeBlock.name\n * \t\tconst activeBlockAttributes = activeBlock.attributes\n *\n * \t\t// Log active block name and attributes\n * \t\tconsole.log(activeBlockName, activeBlockAttributes)\n * \t\t}\n * \t}\n *\n * \t// Subscribe to changes in the editor\n * \t// wp.data.subscribe(() => {\n * \t\t// getActiveBlockData()\n * \t// })\n *\n * \t// Update active block data on click\n * \t// onclick=\"getActiveBlockData()\"\n *```\n *\n * @return {?Object} Selected block.\n */\nexport function getSelectedBlock( state ) {\n\tconst clientId = getSelectedBlockClientId( state );\n\treturn clientId ? getBlock( state, clientId ) : null;\n}\n\n/**\n * Given a block client ID, returns the root block from which the block is\n * nested, an empty string for top-level blocks, or null if the block does not\n * exist.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n *\n * @return {?string} Root client ID, if exists\n */\nexport function getBlockRootClientId( state, clientId ) {\n\treturn state.blocks.parents.get( clientId ) ?? null;\n}\n\n/**\n * Given a block client ID, returns the list of all its parents from top to bottom.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false).\n *\n * @return {Array} ClientIDs of the parent blocks.\n */\nexport const getBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\tconst parents = [];\n\t\tlet current = clientId;\n\t\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\t\tparents.push( current );\n\t\t}\n\n\t\tif ( ! parents.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\treturn ascending ? parents : parents.reverse();\n\t},\n\t( state ) => [ state.blocks.parents ]\n);\n\n/**\n * Given a block client ID and a block name, returns the list of all its parents\n * from top to bottom, filtered by the given name(s). For example, if passed\n * 'core/group' as the blockName, it will only return parents which are group\n * blocks. If passed `[ 'core/group', 'core/cover']`, as the blockName, it will\n * return parents which are group blocks and parents which are cover blocks.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n * @param {string|string[]} blockName Block name(s) to filter.\n * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false).\n *\n * @return {Array} ClientIDs of the parent blocks.\n */\nexport const getBlockParentsByBlockName = createSelector(\n\t( state, clientId, blockName, ascending = false ) => {\n\t\tconst parents = getBlockParents( state, clientId, ascending );\n\t\tconst hasName = Array.isArray( blockName )\n\t\t\t? ( name ) => blockName.includes( name )\n\t\t\t: ( name ) => blockName === name;\n\t\treturn parents.filter( ( id ) => hasName( getBlockName( state, id ) ) );\n\t},\n\t( state ) => [ state.blocks.parents ]\n);\n/**\n * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n *\n * @return {string} Root client ID\n */\nexport function getBlockHierarchyRootClientId( state, clientId ) {\n\tlet current = clientId;\n\tlet parent;\n\tdo {\n\t\tparent = current;\n\t\tcurrent = state.blocks.parents.get( current );\n\t} while ( current );\n\treturn parent;\n}\n\n/**\n * Given a block client ID, returns the lowest common ancestor with selected client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find common ancestor client ID.\n *\n * @return {string} Common ancestor client ID or undefined\n */\nexport function getLowestCommonAncestorWithSelectedBlock( state, clientId ) {\n\tconst selectedId = getSelectedBlockClientId( state );\n\tconst clientParents = [ ...getBlockParents( state, clientId ), clientId ];\n\tconst selectedParents = [\n\t\t...getBlockParents( state, selectedId ),\n\t\tselectedId,\n\t];\n\n\tlet lowestCommonAncestor;\n\n\tconst maxDepth = Math.min( clientParents.length, selectedParents.length );\n\tfor ( let index = 0; index < maxDepth; index++ ) {\n\t\tif ( clientParents[ index ] === selectedParents[ index ] ) {\n\t\t\tlowestCommonAncestor = clientParents[ index ];\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn lowestCommonAncestor;\n}\n\n/**\n * Returns the client ID of the block adjacent one at the given reference\n * startClientId and modifier directionality. Defaults start startClientId to\n * the selected block, and direction as next block. Returns null if there is no\n * adjacent block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n * @param {?number} modifier Directionality multiplier (1 next, -1\n * previous).\n *\n * @return {?string} Return the client ID of the block, or null if none exists.\n */\nexport function getAdjacentBlockClientId( state, startClientId, modifier = 1 ) {\n\t// Default to selected block.\n\tif ( startClientId === undefined ) {\n\t\tstartClientId = getSelectedBlockClientId( state );\n\t}\n\n\t// Try multi-selection starting at extent based on modifier.\n\tif ( startClientId === undefined ) {\n\t\tif ( modifier < 0 ) {\n\t\t\tstartClientId = getFirstMultiSelectedBlockClientId( state );\n\t\t} else {\n\t\t\tstartClientId = getLastMultiSelectedBlockClientId( state );\n\t\t}\n\t}\n\n\t// Validate working start client ID.\n\tif ( ! startClientId ) {\n\t\treturn null;\n\t}\n\n\t// Retrieve start block root client ID, being careful to allow the falsey\n\t// empty string top-level root by explicitly testing against null.\n\tconst rootClientId = getBlockRootClientId( state, startClientId );\n\tif ( rootClientId === null ) {\n\t\treturn null;\n\t}\n\n\tconst { order } = state.blocks;\n\tconst orderSet = order.get( rootClientId );\n\tconst index = orderSet.indexOf( startClientId );\n\tconst nextIndex = index + 1 * modifier;\n\n\t// Block was first in set and we're attempting to get previous.\n\tif ( nextIndex < 0 ) {\n\t\treturn null;\n\t}\n\n\t// Block was last in set and we're attempting to get next.\n\tif ( nextIndex === orderSet.length ) {\n\t\treturn null;\n\t}\n\n\t// Assume incremented index is within the set.\n\treturn orderSet[ nextIndex ];\n}\n\n/**\n * Returns the previous block's client ID from the given reference start ID.\n * Defaults start to the selected block. Returns null if there is no previous\n * block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n *\n * @return {?string} Adjacent block's client ID, or null if none exists.\n */\nexport function getPreviousBlockClientId( state, startClientId ) {\n\treturn getAdjacentBlockClientId( state, startClientId, -1 );\n}\n\n/**\n * Returns the next block's client ID from the given reference start ID.\n * Defaults start to the selected block. Returns null if there is no next\n * block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n *\n * @return {?string} Adjacent block's client ID, or null if none exists.\n */\nexport function getNextBlockClientId( state, startClientId ) {\n\treturn getAdjacentBlockClientId( state, startClientId, 1 );\n}\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Returns the initial caret position for the selected block.\n * This position is to used to position the caret properly when the selected block changes.\n * If the current block is not a RichText, having initial position set to 0 means \"focus block\"\n *\n * @param {Object} state Global application state.\n *\n * @return {0|-1|null} Initial position.\n */\nexport function getSelectedBlocksInitialCaretPosition( state ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn state.initialPosition;\n}\n\n/**\n * Returns the current selection set of block client IDs (multiselection or single selection).\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block client IDs.\n */\nexport const getSelectedBlockClientIds = createSelector(\n\t( state ) => {\n\t\tconst { selectionStart, selectionEnd } = state.selection;\n\n\t\tif ( ! selectionStart.clientId || ! selectionEnd.clientId ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\t\treturn [ selectionStart.clientId ];\n\t\t}\n\n\t\t// Retrieve root client ID to aid in retrieving relevant nested block\n\t\t// order, being careful to allow the falsey empty string top-level root\n\t\t// by explicitly testing against null.\n\t\tconst rootClientId = getBlockRootClientId(\n\t\t\tstate,\n\t\t\tselectionStart.clientId\n\t\t);\n\n\t\tif ( rootClientId === null ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tconst blockOrder = getBlockOrder( state, rootClientId );\n\t\tconst startIndex = blockOrder.indexOf( selectionStart.clientId );\n\t\tconst endIndex = blockOrder.indexOf( selectionEnd.clientId );\n\n\t\tif ( startIndex > endIndex ) {\n\t\t\treturn blockOrder.slice( endIndex, startIndex + 1 );\n\t\t}\n\n\t\treturn blockOrder.slice( startIndex, endIndex + 1 );\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t]\n);\n\n/**\n * Returns the current multi-selection set of block client IDs, or an empty\n * array if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block client IDs.\n */\nexport function getMultiSelectedBlockClientIds( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\treturn getSelectedBlockClientIds( state );\n}\n\n/**\n * Returns the current multi-selection set of blocks, or an empty array if\n * there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block objects.\n */\nexport const getMultiSelectedBlocks = createSelector(\n\t( state ) => {\n\t\tconst multiSelectedBlockClientIds =\n\t\t\tgetMultiSelectedBlockClientIds( state );\n\t\tif ( ! multiSelectedBlockClientIds.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\treturn multiSelectedBlockClientIds.map( ( clientId ) =>\n\t\t\tgetBlock( state, clientId )\n\t\t);\n\t},\n\t( state ) => [\n\t\t...getSelectedBlockClientIds.getDependants( state ),\n\t\tstate.blocks.byClientId,\n\t\tstate.blocks.order,\n\t\tstate.blocks.attributes,\n\t]\n);\n\n/**\n * Returns the client ID of the first block in the multi-selection set, or null\n * if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} First block client ID in the multi-selection set.\n */\nexport function getFirstMultiSelectedBlockClientId( state ) {\n\treturn getMultiSelectedBlockClientIds( state )[ 0 ] || null;\n}\n\n/**\n * Returns the client ID of the last block in the multi-selection set, or null\n * if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Last block client ID in the multi-selection set.\n */\nexport function getLastMultiSelectedBlockClientId( state ) {\n\tconst selectedClientIds = getMultiSelectedBlockClientIds( state );\n\treturn selectedClientIds[ selectedClientIds.length - 1 ] || null;\n}\n\n/**\n * Returns true if a multi-selection exists, and the block corresponding to the\n * specified client ID is the first block of the multi-selection set, or false\n * otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is first in multi-selection.\n */\nexport function isFirstMultiSelectedBlock( state, clientId ) {\n\treturn getFirstMultiSelectedBlockClientId( state ) === clientId;\n}\n\n/**\n * Returns true if the client ID occurs within the block multi-selection, or\n * false otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is in multi-selection set.\n */\nexport function isBlockMultiSelected( state, clientId ) {\n\treturn getMultiSelectedBlockClientIds( state ).indexOf( clientId ) !== -1;\n}\n\n/**\n * Returns true if an ancestor of the block is multi-selected, or false\n * otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether an ancestor of the block is in multi-selection\n * set.\n */\nexport const isAncestorMultiSelected = createSelector(\n\t( state, clientId ) => {\n\t\tlet ancestorClientId = clientId;\n\t\tlet isMultiSelected = false;\n\t\twhile ( ancestorClientId && ! isMultiSelected ) {\n\t\t\tancestorClientId = getBlockRootClientId( state, ancestorClientId );\n\t\t\tisMultiSelected = isBlockMultiSelected( state, ancestorClientId );\n\t\t}\n\t\treturn isMultiSelected;\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t]\n);\n\n/**\n * Returns the client ID of the block which begins the multi-selection set, or\n * null if there is no multi-selection.\n *\n * This is not necessarily the first client ID in the selection.\n *\n * @see getFirstMultiSelectedBlockClientId\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Client ID of block beginning multi-selection.\n */\nexport function getMultiSelectedBlocksStartClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn selectionStart.clientId || null;\n}\n\n/**\n * Returns the client ID of the block which ends the multi-selection set, or\n * null if there is no multi-selection.\n *\n * This is not necessarily the last client ID in the selection.\n *\n * @see getLastMultiSelectedBlockClientId\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Client ID of block ending multi-selection.\n */\nexport function getMultiSelectedBlocksEndClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn selectionEnd.clientId || null;\n}\n\n/**\n * Returns true if the selection is not partial.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the selection is mergeable.\n */\nexport function __unstableIsFullySelected( state ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\treturn (\n\t\t! selectionAnchor.attributeKey &&\n\t\t! selectionFocus.attributeKey &&\n\t\ttypeof selectionAnchor.offset === 'undefined' &&\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t);\n}\n\n/**\n * Returns true if the selection is collapsed.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the selection is collapsed.\n */\nexport function __unstableIsSelectionCollapsed( state ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\treturn (\n\t\t!! selectionAnchor &&\n\t\t!! selectionFocus &&\n\t\tselectionAnchor.clientId === selectionFocus.clientId &&\n\t\tselectionAnchor.attributeKey === selectionFocus.attributeKey &&\n\t\tselectionAnchor.offset === selectionFocus.offset\n\t);\n}\n\nexport function __unstableSelectionHasUnmergeableBlock( state ) {\n\treturn getSelectedBlockClientIds( state ).some( ( clientId ) => {\n\t\tconst blockName = getBlockName( state, clientId );\n\t\tconst blockType = getBlockType( blockName );\n\t\treturn ! blockType.merge;\n\t} );\n}\n\n/**\n * Check whether the selection is mergeable.\n *\n * @param {Object} state Editor state.\n * @param {boolean} isForward Whether to merge forwards.\n *\n * @return {boolean} Whether the selection is mergeable.\n */\nexport function __unstableIsSelectionMergeable( state, isForward ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\n\t// It's not mergeable if the start and end are within the same block.\n\tif ( selectionAnchor.clientId === selectionFocus.clientId ) {\n\t\treturn false;\n\t}\n\n\t// It's not mergeable if there's no rich text selection.\n\tif (\n\t\t! selectionAnchor.attributeKey ||\n\t\t! selectionFocus.attributeKey ||\n\t\ttypeof selectionAnchor.offset === 'undefined' ||\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t) {\n\t\treturn false;\n\t}\n\n\tconst anchorRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionAnchor.clientId\n\t);\n\tconst focusRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionFocus.clientId\n\t);\n\n\t// It's not mergeable if the selection doesn't start and end in the same\n\t// block list. Maybe in the future it should be allowed.\n\tif ( anchorRootClientId !== focusRootClientId ) {\n\t\treturn false;\n\t}\n\n\tconst blockOrder = getBlockOrder( state, anchorRootClientId );\n\tconst anchorIndex = blockOrder.indexOf( selectionAnchor.clientId );\n\tconst focusIndex = blockOrder.indexOf( selectionFocus.clientId );\n\n\t// Reassign selection start and end based on order.\n\tlet selectionStart, selectionEnd;\n\n\tif ( anchorIndex > focusIndex ) {\n\t\tselectionStart = selectionFocus;\n\t\tselectionEnd = selectionAnchor;\n\t} else {\n\t\tselectionStart = selectionAnchor;\n\t\tselectionEnd = selectionFocus;\n\t}\n\n\tconst targetBlockClientId = isForward\n\t\t? selectionEnd.clientId\n\t\t: selectionStart.clientId;\n\tconst blockToMergeClientId = isForward\n\t\t? selectionStart.clientId\n\t\t: selectionEnd.clientId;\n\n\tconst targetBlockName = getBlockName( state, targetBlockClientId );\n\tconst targetBlockType = getBlockType( targetBlockName );\n\n\tif ( ! targetBlockType.merge ) {\n\t\treturn false;\n\t}\n\n\tconst blockToMerge = getBlock( state, blockToMergeClientId );\n\n\t// It's mergeable if the blocks are of the same type.\n\tif ( blockToMerge.name === targetBlockName ) {\n\t\treturn true;\n\t}\n\n\t// If the blocks are of a different type, try to transform the block being\n\t// merged into the same type of block.\n\tconst blocksToMerge = switchToBlockType( blockToMerge, targetBlockName );\n\n\treturn blocksToMerge && blocksToMerge.length;\n}\n\n/**\n * Get partial selected blocks with their content updated\n * based on the selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object[]} Updated partial selected blocks.\n */\nexport const __unstableGetSelectedBlocksWithPartialSelection = ( state ) => {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\n\tif ( selectionAnchor.clientId === selectionFocus.clientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\t// Can't split if the selection is not set.\n\tif (\n\t\t! selectionAnchor.attributeKey ||\n\t\t! selectionFocus.attributeKey ||\n\t\ttypeof selectionAnchor.offset === 'undefined' ||\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst anchorRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionAnchor.clientId\n\t);\n\tconst focusRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionFocus.clientId\n\t);\n\n\t// It's not splittable if the selection doesn't start and end in the same\n\t// block list. Maybe in the future it should be allowed.\n\tif ( anchorRootClientId !== focusRootClientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst blockOrder = getBlockOrder( state, anchorRootClientId );\n\tconst anchorIndex = blockOrder.indexOf( selectionAnchor.clientId );\n\tconst focusIndex = blockOrder.indexOf( selectionFocus.clientId );\n\n\t// Reassign selection start and end based on order.\n\tconst [ selectionStart, selectionEnd ] =\n\t\tanchorIndex > focusIndex\n\t\t\t? [ selectionFocus, selectionAnchor ]\n\t\t\t: [ selectionAnchor, selectionFocus ];\n\n\tconst blockA = getBlock( state, selectionStart.clientId );\n\tconst blockB = getBlock( state, selectionEnd.clientId );\n\n\tconst htmlA = blockA.attributes[ selectionStart.attributeKey ];\n\tconst htmlB = blockB.attributes[ selectionEnd.attributeKey ];\n\n\tlet valueA = create( { html: htmlA } );\n\tlet valueB = create( { html: htmlB } );\n\n\tvalueA = remove( valueA, 0, selectionStart.offset );\n\tvalueB = remove( valueB, selectionEnd.offset, valueB.text.length );\n\n\treturn [\n\t\t{\n\t\t\t...blockA,\n\t\t\tattributes: {\n\t\t\t\t...blockA.attributes,\n\t\t\t\t[ selectionStart.attributeKey ]: toHTMLString( {\n\t\t\t\t\tvalue: valueA,\n\t\t\t\t} ),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...blockB,\n\t\t\tattributes: {\n\t\t\t\t...blockB.attributes,\n\t\t\t\t[ selectionEnd.attributeKey ]: toHTMLString( {\n\t\t\t\t\tvalue: valueB,\n\t\t\t\t} ),\n\t\t\t},\n\t\t},\n\t];\n};\n\n/**\n * Returns an array containing all block client IDs in the editor in the order\n * they appear. Optionally accepts a root client ID of the block list for which\n * the order should be returned, defaulting to the top-level block order.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Array} Ordered client IDs of editor blocks.\n */\nexport function getBlockOrder( state, rootClientId ) {\n\treturn state.blocks.order.get( rootClientId || '' ) || EMPTY_ARRAY;\n}\n\n/**\n * Returns the index at which the block corresponding to the specified client\n * ID occurs within the block order, or `-1` if the block does not exist.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {number} Index at which block exists in order.\n */\nexport function getBlockIndex( state, clientId ) {\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\treturn getBlockOrder( state, rootClientId ).indexOf( clientId );\n}\n\n/**\n * Returns true if the block corresponding to the specified client ID is\n * currently selected and no multi-selection exists, or false otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is selected and multi-selection exists.\n */\nexport function isBlockSelected( state, clientId ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId !== selectionEnd.clientId ) {\n\t\treturn false;\n\t}\n\n\treturn selectionStart.clientId === clientId;\n}\n\n/**\n * Returns true if one of the block's inner blocks is selected.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n * @param {boolean} deep Perform a deep check.\n *\n * @return {boolean} Whether the block has an inner block selected\n */\nexport function hasSelectedInnerBlock( state, clientId, deep = false ) {\n\tconst selectedBlockClientIds = getSelectedBlockClientIds( state );\n\n\tif ( ! selectedBlockClientIds.length ) {\n\t\treturn false;\n\t}\n\n\tif ( deep ) {\n\t\treturn selectedBlockClientIds.some( ( id ) =>\n\t\t\t// Pass true because we don't care about order and it's more\n\t\t\t// performant.\n\t\t\tgetBlockParents( state, id, true ).includes( clientId )\n\t\t);\n\t}\n\n\treturn selectedBlockClientIds.some(\n\t\t( id ) => getBlockRootClientId( state, id ) === clientId\n\t);\n}\n\n/**\n * Returns true if one of the block's inner blocks is dragged.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n * @param {boolean} deep Perform a deep check.\n *\n * @return {boolean} Whether the block has an inner block dragged\n */\nexport function hasDraggedInnerBlock( state, clientId, deep = false ) {\n\treturn getBlockOrder( state, clientId ).some(\n\t\t( innerClientId ) =>\n\t\t\tisBlockBeingDragged( state, innerClientId ) ||\n\t\t\t( deep && hasDraggedInnerBlock( state, innerClientId, deep ) )\n\t);\n}\n\n/**\n * Returns true if the block corresponding to the specified client ID is\n * currently selected but isn't the last of the selected blocks. Here \"last\"\n * refers to the block sequence in the document, _not_ the sequence of\n * multi-selection, which is why `state.selectionEnd` isn't used.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is selected and not the last in the\n * selection.\n */\nexport function isBlockWithinSelection( state, clientId ) {\n\tif ( ! clientId ) {\n\t\treturn false;\n\t}\n\n\tconst clientIds = getMultiSelectedBlockClientIds( state );\n\tconst index = clientIds.indexOf( clientId );\n\treturn index > -1 && index < clientIds.length - 1;\n}\n\n/**\n * Returns true if a multi-selection has been made, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether multi-selection has been made.\n */\nexport function hasMultiSelection( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\treturn selectionStart.clientId !== selectionEnd.clientId;\n}\n\n/**\n * Whether in the process of multi-selecting or not. This flag is only true\n * while the multi-selection is being selected (by mouse move), and is false\n * once the multi-selection has been settled.\n *\n * @see hasMultiSelection\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if multi-selecting, false if not.\n */\nexport function isMultiSelecting( state ) {\n\treturn state.isMultiSelecting;\n}\n\n/**\n * Selector that returns if multi-selection is enabled or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled.\n */\nexport function isSelectionEnabled( state ) {\n\treturn state.isSelectionEnabled;\n}\n\n/**\n * Returns the block's editing mode, defaulting to \"visual\" if not explicitly\n * assigned.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {Object} Block editing mode.\n */\nexport function getBlockMode( state, clientId ) {\n\treturn state.blocksMode[ clientId ] || 'visual';\n}\n\n/**\n * Returns true if the user is typing, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is typing.\n */\nexport function isTyping( state ) {\n\treturn state.isTyping;\n}\n\n/**\n * Returns true if the user is dragging blocks, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging blocks.\n */\nexport function isDraggingBlocks( state ) {\n\treturn !! state.draggedBlocks.length;\n}\n\n/**\n * Returns the client ids of any blocks being directly dragged.\n *\n * This does not include children of a parent being dragged.\n *\n * @param {Object} state Global application state.\n *\n * @return {string[]} Array of dragged block client ids.\n */\nexport function getDraggedBlockClientIds( state ) {\n\treturn state.draggedBlocks;\n}\n\n/**\n * Returns whether the block is being dragged.\n *\n * Only returns true if the block is being directly dragged,\n * not if the block is a child of a parent being dragged.\n * See `isAncestorBeingDragged` for child blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client id for block to check.\n *\n * @return {boolean} Whether the block is being dragged.\n */\nexport function isBlockBeingDragged( state, clientId ) {\n\treturn state.draggedBlocks.includes( clientId );\n}\n\n/**\n * Returns whether a parent/ancestor of the block is being dragged.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client id for block to check.\n *\n * @return {boolean} Whether the block's ancestor is being dragged.\n */\nexport function isAncestorBeingDragged( state, clientId ) {\n\t// Return early if no blocks are being dragged rather than\n\t// the more expensive check for parents.\n\tif ( ! isDraggingBlocks( state ) ) {\n\t\treturn false;\n\t}\n\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentClientId ) =>\n\t\tisBlockBeingDragged( state, parentClientId )\n\t);\n}\n\n/**\n * Returns true if the caret is within formatted text, or false otherwise.\n *\n * @deprecated\n *\n * @return {boolean} Whether the caret is within formatted text.\n */\nexport function isCaretWithinFormattedText() {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).isCaretWithinFormattedText',\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t}\n\t);\n\n\treturn false;\n}\n\n/**\n * Returns the location of the insertion cue. Defaults to the last index.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} Insertion point object with `rootClientId`, `index`.\n */\nexport const getBlockInsertionPoint = createSelector(\n\t( state ) => {\n\t\tlet rootClientId, index;\n\n\t\tconst {\n\t\t\tinsertionCue,\n\t\t\tselection: { selectionEnd },\n\t\t} = state;\n\t\tif ( insertionCue !== null ) {\n\t\t\treturn insertionCue;\n\t\t}\n\n\t\tconst { clientId } = selectionEnd;\n\n\t\tif ( clientId ) {\n\t\t\trootClientId = getBlockRootClientId( state, clientId ) || undefined;\n\t\t\tindex = getBlockIndex( state, selectionEnd.clientId ) + 1;\n\t\t} else {\n\t\t\tindex = getBlockOrder( state ).length;\n\t\t}\n\n\t\treturn { rootClientId, index };\n\t},\n\t( state ) => [\n\t\tstate.insertionCue,\n\t\tstate.selection.selectionEnd.clientId,\n\t\tstate.blocks.parents,\n\t\tstate.blocks.order,\n\t]\n);\n\n/**\n * Returns true if the block insertion point is visible.\n *\n * @param {Object} state Global application state.\n *\n * @return {?boolean} Whether the insertion point is visible or not.\n */\nexport function isBlockInsertionPointVisible( state ) {\n\treturn state.insertionCue !== null;\n}\n\n/**\n * Returns whether the blocks matches the template or not.\n *\n * @param {boolean} state\n * @return {?boolean} Whether the template is valid or not.\n */\nexport function isValidTemplate( state ) {\n\treturn state.template.isValid;\n}\n\n/**\n * Returns the defined block template\n *\n * @param {boolean} state\n *\n * @return {?Array} Block Template.\n */\nexport function getTemplate( state ) {\n\treturn state.settings.template;\n}\n\n/**\n * Returns the defined block template lock. Optionally accepts a root block\n * client ID as context, otherwise defaulting to the global context.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional block root client ID.\n *\n * @return {string|false} Block Template Lock\n */\nexport function getTemplateLock( state, rootClientId ) {\n\tif ( ! rootClientId ) {\n\t\treturn state.settings.templateLock ?? false;\n\t}\n\n\treturn getBlockListSettings( state, rootClientId )?.templateLock ?? false;\n}\n\n/**\n * Determines if the given block type is visible in the inserter.\n * Note that this is different than whether a block is allowed to be inserted.\n * In some cases, the block is not allowed in a given position but\n * it should still be visible in the inserter to be able to add it\n * to a different position.\n *\n * @param {Object} state Editor state.\n * @param {string|Object} blockNameOrType The block type object, e.g., the response\n * from the block directory; or a string name of\n * an installed block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nconst isBlockVisibleInTheInserter = (\n\tstate,\n\tblockNameOrType,\n\trootClientId = null\n) => {\n\tlet blockType;\n\tlet blockName;\n\n\tif ( blockNameOrType && 'object' === typeof blockNameOrType ) {\n\t\tblockType = blockNameOrType;\n\t\tblockName = blockNameOrType.name;\n\t} else {\n\t\tblockType = getBlockType( blockNameOrType );\n\t\tblockName = blockNameOrType;\n\t}\n\n\tif ( ! blockType ) {\n\t\treturn false;\n\t}\n\n\tconst { allowedBlockTypes } = getSettings( state );\n\n\tconst isBlockAllowedInEditor = checkAllowList(\n\t\tallowedBlockTypes,\n\t\tblockName,\n\t\ttrue\n\t);\n\tif ( ! isBlockAllowedInEditor ) {\n\t\treturn false;\n\t}\n\n\t// If parent blocks are not visible, child blocks should be hidden too.\n\tconst parents = (\n\t\tArray.isArray( blockType.parent ) ? blockType.parent : []\n\t).concat( Array.isArray( blockType.ancestor ) ? blockType.ancestor : [] );\n\tif ( parents.length > 0 ) {\n\t\t// This is an exception to the rule that says that all blocks are visible in the inserter.\n\t\t// Blocks that require a given parent or ancestor are only visible if we're within that parent.\n\t\tif ( parents.includes( 'core/post-content' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet current = rootClientId;\n\t\tlet hasParent = false;\n\t\tdo {\n\t\t\tif ( parents.includes( getBlockName( state, current ) ) ) {\n\t\t\t\thasParent = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent = state.blocks.parents.get( current );\n\t\t} while ( current );\n\n\t\treturn hasParent;\n\t}\n\n\treturn true;\n};\n\n/**\n * Determines if the given block type is allowed to be inserted into the block list.\n * This function is not exported and not memoized because using a memoized selector\n * inside another memoized selector is just a waste of time.\n *\n * @param {Object} state Editor state.\n * @param {string|Object} blockName The block type object, e.g., the response\n * from the block directory; or a string name of\n * an installed block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nconst canInsertBlockTypeUnmemoized = (\n\tstate,\n\tblockName,\n\trootClientId = null\n) => {\n\tif ( ! isBlockVisibleInTheInserter( state, blockName, rootClientId ) ) {\n\t\treturn false;\n\t}\n\n\tlet blockType;\n\tif ( blockName && 'object' === typeof blockName ) {\n\t\tblockType = blockName;\n\t\tblockName = blockType.name;\n\t} else {\n\t\tblockType = getBlockType( blockName );\n\t}\n\n\tconst isLocked = !! getTemplateLock( state, rootClientId );\n\tif ( isLocked ) {\n\t\treturn false;\n\t}\n\tconst isContentRoleBlock = isContentBlock( blockName );\n\tconst isParentSectionBlock = !! isSectionBlock( state, rootClientId );\n\t// It shouldn't be possible to insert inside a section block unless in\n\t// some cases when the block is a content block.\n\tif ( isParentSectionBlock && ! isContentRoleBlock ) {\n\t\treturn false;\n\t}\n\n\tconst blockEditingMode = getBlockEditingMode( state, rootClientId ?? '' );\n\tif ( blockEditingMode === 'disabled' ) {\n\t\treturn false;\n\t}\n\n\tconst parentBlockListSettings = getBlockListSettings( state, rootClientId );\n\n\t// The parent block doesn't have settings indicating it doesn't support\n\t// inner blocks, return false.\n\tif ( rootClientId && parentBlockListSettings === undefined ) {\n\t\treturn false;\n\t}\n\n\t// In write mode, check if this container allows insertion.\n\tif (\n\t\tblockEditingMode === 'contentOnly' &&\n\t\t! isContainerInsertableToInWriteMode( state, blockName, rootClientId )\n\t) {\n\t\treturn false;\n\t}\n\n\tconst parentName = getBlockName( state, rootClientId );\n\n\tconst parentBlockType = getBlockType( parentName );\n\n\t// Look at the `blockType.allowedBlocks` field to determine whether this is an allowed child block.\n\tconst parentAllowedChildBlocks = parentBlockType?.allowedBlocks;\n\n\tlet hasParentAllowedBlock = checkAllowList(\n\t\tparentAllowedChildBlocks,\n\t\tblockName\n\t);\n\n\t// The `allowedBlocks` block list setting can further limit which blocks are allowed children.\n\tif ( hasParentAllowedBlock !== false ) {\n\t\tconst parentAllowedBlocks = parentBlockListSettings?.allowedBlocks;\n\t\tconst hasParentListAllowedBlock = checkAllowList(\n\t\t\tparentAllowedBlocks,\n\t\t\tblockName\n\t\t);\n\t\t// Never downgrade the result from `true` to `null`\n\t\tif ( hasParentListAllowedBlock !== null ) {\n\t\t\thasParentAllowedBlock = hasParentListAllowedBlock;\n\t\t}\n\t}\n\n\tconst blockAllowedParentBlocks = blockType.parent;\n\tconst hasBlockAllowedParent = checkAllowList(\n\t\tblockAllowedParentBlocks,\n\t\tparentName\n\t);\n\n\tlet hasBlockAllowedAncestor = true;\n\tconst blockAllowedAncestorBlocks = blockType.ancestor;\n\tif ( blockAllowedAncestorBlocks ) {\n\t\tconst ancestors = [\n\t\t\trootClientId,\n\t\t\t...getBlockParents( state, rootClientId ),\n\t\t];\n\n\t\thasBlockAllowedAncestor = ancestors.some( ( ancestorClientId ) =>\n\t\t\tcheckAllowList(\n\t\t\t\tblockAllowedAncestorBlocks,\n\t\t\t\tgetBlockName( state, ancestorClientId )\n\t\t\t)\n\t\t);\n\t}\n\n\tconst canInsert =\n\t\thasBlockAllowedAncestor &&\n\t\t( ( hasParentAllowedBlock === null &&\n\t\t\thasBlockAllowedParent === null ) ||\n\t\t\thasParentAllowedBlock === true ||\n\t\t\thasBlockAllowedParent === true );\n\n\tif ( ! canInsert ) {\n\t\treturn canInsert;\n\t}\n\n\t/**\n\t * This filter is an ad-hoc solution to prevent adding template parts inside post content.\n\t * Conceptually, having a filter inside a selector is bad pattern so this code will be\n\t * replaced by a declarative API that doesn't the following drawbacks:\n\t *\n\t * Filters are not reactive: Upon switching between \"template mode\" and non \"template mode\",\n\t * the filter and selector won't necessarily be executed again. For now, it doesn't matter much\n\t * because you can't switch between the two modes while the inserter stays open.\n\t *\n\t * Filters are global: Once they're defined, they will affect all editor instances and all registries.\n\t * An ideal API would only affect specific editor instances.\n\t */\n\treturn applyFilters(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\tcanInsert,\n\t\tblockType,\n\t\trootClientId,\n\t\t{\n\t\t\t// Pass bound selectors of the current registry. If we're in a nested\n\t\t\t// context, the data will differ from the one selected from the root\n\t\t\t// registry.\n\t\t\tgetBlock: getBlock.bind( null, state ),\n\t\t\tgetBlockParentsByBlockName: getBlockParentsByBlockName.bind(\n\t\t\t\tnull,\n\t\t\t\tstate\n\t\t\t),\n\t\t}\n\t);\n};\n\n/**\n * Determines if the given block type is allowed to be inserted into the block list.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The name of the block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nexport const canInsertBlockType = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\tcanInsertBlockTypeUnmemoized,\n\t\t( state, blockName, rootClientId ) =>\n\t\t\tgetInsertBlockTypeDependants( select )( state, rootClientId )\n\t)\n);\n\n/**\n * Determines if the given blocks are allowed to be inserted into the block\n * list.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds The block client IDs to be inserted.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given blocks are allowed to be inserted.\n */\nexport function canInsertBlocks( state, clientIds, rootClientId = null ) {\n\treturn clientIds.every( ( id ) =>\n\t\tcanInsertBlockType( state, getBlockName( state, id ), rootClientId )\n\t);\n}\n\n/**\n * Determines if the given block is allowed to be deleted.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be removed.\n */\nexport function canRemoveBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\tif ( attributes.lock?.remove !== undefined ) {\n\t\treturn ! attributes.lock.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tif ( getTemplateLock( state, rootClientId ) ) {\n\t\treturn false;\n\t}\n\n\tconst isBlockWithinSection = !! getParentSectionBlock( state, clientId );\n\tconst isContentRoleBlock = isContentBlock(\n\t\tgetBlockName( state, clientId )\n\t);\n\tif ( isBlockWithinSection && ! isContentRoleBlock ) {\n\t\treturn false;\n\t}\n\n\tconst blockEditingMode = getBlockEditingMode( state, rootClientId );\n\n\t// Check if the parent container allows insertion/removal in write mode\n\tif (\n\t\tblockEditingMode === 'contentOnly' &&\n\t\t! isContainerInsertableToInWriteMode(\n\t\t\tstate,\n\t\t\tgetBlockName( state, rootClientId ),\n\t\t\trootClientId\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn blockEditingMode !== 'disabled';\n}\n\n/**\n * Determines if the given blocks are allowed to be removed.\n *\n * @param {Object} state Editor state.\n * @param {string} clientIds The block client IDs to be removed.\n *\n * @return {boolean} Whether the given blocks are allowed to be removed.\n */\nexport function canRemoveBlocks( state, clientIds ) {\n\treturn clientIds.every( ( clientId ) => canRemoveBlock( state, clientId ) );\n}\n\n/**\n * Determines if the given block is allowed to be moved.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be moved.\n */\nexport function canMoveBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\tif ( attributes.lock?.move !== undefined ) {\n\t\treturn ! attributes.lock.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tif ( getTemplateLock( state, rootClientId ) === 'all' ) {\n\t\treturn false;\n\t}\n\treturn getBlockEditingMode( state, rootClientId ) !== 'disabled';\n}\n\n/**\n * Determines if the given blocks are allowed to be moved.\n *\n * @param {Object} state Editor state.\n * @param {string} clientIds The block client IDs to be moved.\n *\n * @return {boolean} Whether the given blocks are allowed to be moved.\n */\nexport function canMoveBlocks( state, clientIds ) {\n\treturn clientIds.every( ( clientId ) => canMoveBlock( state, clientId ) );\n}\n\n/**\n * Determines if the given block is allowed to be edited.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be edited.\n */\nexport function canEditBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\n\tconst { lock } = attributes;\n\n\t// When the edit is true, we cannot edit the block.\n\treturn ! lock?.edit;\n}\n\n/**\n * Determines if the given block type can be locked/unlocked by a user.\n *\n * @param {Object} state Editor state.\n * @param {(string|Object)} nameOrType Block name or type object.\n *\n * @return {boolean} Whether a given block type can be locked/unlocked.\n */\nexport function canLockBlockType( state, nameOrType ) {\n\tif ( ! hasBlockSupport( nameOrType, 'lock', true ) ) {\n\t\treturn false;\n\t}\n\n\t// Use block editor settings as the default value.\n\treturn !! state.settings?.canLockBlocks;\n}\n\n/**\n * Returns information about how recently and frequently a block has been inserted.\n *\n * @param {Object} state Global application state.\n * @param {string} id A string which identifies the insert, e.g. 'core/block/12'\n *\n * @return {?{ time: number, count: number }} An object containing `time` which is when the last\n * insert occurred as a UNIX epoch, and `count` which is\n * the number of inserts that have occurred.\n */\nfunction getInsertUsage( state, id ) {\n\treturn state.preferences.insertUsage?.[ id ] ?? null;\n}\n\n/**\n * Returns whether we can show a block type in the inserter\n *\n * @param {Object} state Global State\n * @param {Object} blockType BlockType\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be shown in the inserter.\n */\nconst canIncludeBlockTypeInInserter = ( state, blockType, rootClientId ) => {\n\tif ( ! hasBlockSupport( blockType, 'inserter', true ) ) {\n\t\treturn false;\n\t}\n\n\treturn canInsertBlockTypeUnmemoized( state, blockType.name, rootClientId );\n};\n\n/**\n * Return a function to be used to transform a block variation to an inserter item\n *\n * @param {Object} state Global State\n * @param {Object} item Denormalized inserter item\n * @return {Function} Function to transform a block variation to inserter item\n */\nconst getItemFromVariation = ( state, item ) => ( variation ) => {\n\tconst variationId = `${ item.id }/${ variation.name }`;\n\tconst { time, count = 0 } = getInsertUsage( state, variationId ) || {};\n\treturn {\n\t\t...item,\n\t\tid: variationId,\n\t\ticon: variation.icon || item.icon,\n\t\ttitle: variation.title || item.title,\n\t\tdescription: variation.description || item.description,\n\t\tcategory: variation.category || item.category,\n\t\t// If `example` is explicitly undefined for the variation, the preview will not be shown.\n\t\texample: variation.hasOwnProperty( 'example' )\n\t\t\t? variation.example\n\t\t\t: item.example,\n\t\tinitialAttributes: {\n\t\t\t...item.initialAttributes,\n\t\t\t...variation.attributes,\n\t\t},\n\t\tinnerBlocks: variation.innerBlocks,\n\t\tkeywords: variation.keywords || item.keywords,\n\t\tfrecency: calculateFrecency( time, count ),\n\t};\n};\n\n/**\n * Returns the calculated frecency.\n *\n * 'frecency' is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * @param {number} time When the last insert occurred as a UNIX epoch\n * @param {number} count The number of inserts that have occurred.\n *\n * @return {number} The calculated frecency.\n */\nconst calculateFrecency = ( time, count ) => {\n\tif ( ! time ) {\n\t\treturn count;\n\t}\n\t// The selector is cached, which means Date.now() is the last time that the\n\t// relevant state changed. This suits our needs.\n\tconst duration = Date.now() - time;\n\tswitch ( true ) {\n\t\tcase duration < MILLISECONDS_PER_HOUR:\n\t\t\treturn count * 4;\n\t\tcase duration < MILLISECONDS_PER_DAY:\n\t\t\treturn count * 2;\n\t\tcase duration < MILLISECONDS_PER_WEEK:\n\t\t\treturn count / 2;\n\t\tdefault:\n\t\t\treturn count / 4;\n\t}\n};\n\n/**\n * Returns a function that accepts a block type and builds an item to be shown\n * in a specific context. It's used for building items for Inserter and available\n * block Transforms list.\n *\n * @param {Object} state Editor state.\n * @param {Object} options Options object for handling the building of a block type.\n * @param {string} options.buildScope The scope for which the item is going to be used.\n * @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list).\n */\nconst buildBlockTypeItem =\n\t( state, { buildScope = 'inserter' } ) =>\n\t( blockType ) => {\n\t\tconst id = blockType.name;\n\n\t\tlet isDisabled = false;\n\t\tif ( ! hasBlockSupport( blockType.name, 'multiple', true ) ) {\n\t\t\tisDisabled = getBlocksByClientId(\n\t\t\t\tstate,\n\t\t\t\tgetClientIdsWithDescendants( state )\n\t\t\t).some( ( { name } ) => name === blockType.name );\n\t\t}\n\n\t\tconst { time, count = 0 } = getInsertUsage( state, id ) || {};\n\t\tconst blockItemBase = {\n\t\t\tid,\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\ticon: blockType.icon,\n\t\t\tisDisabled,\n\t\t\tfrecency: calculateFrecency( time, count ),\n\t\t};\n\t\tif ( buildScope === 'transform' ) {\n\t\t\treturn blockItemBase;\n\t\t}\n\n\t\tconst inserterVariations = getBlockVariations(\n\t\t\tblockType.name,\n\t\t\t'inserter'\n\t\t);\n\t\treturn {\n\t\t\t...blockItemBase,\n\t\t\tinitialAttributes: {},\n\t\t\tdescription: blockType.description,\n\t\t\tcategory: blockType.category,\n\t\t\tkeywords: blockType.keywords,\n\t\t\tparent: blockType.parent,\n\t\t\tancestor: blockType.ancestor,\n\t\t\tvariations: inserterVariations,\n\t\t\texample: blockType.example,\n\t\t\tutility: 1, // Deprecated.\n\t\t};\n\t};\n\n/**\n * Determines the items that appear in the inserter. Includes both static\n * items (e.g. a regular block type) and dynamic items (e.g. a reusable block).\n *\n * Each item object contains what's necessary to display a button in the\n * inserter and handle its selection.\n *\n * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * Items are returned ordered descendingly by their 'utility' and 'frecency'.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPEditorInserterItem[]} Items that appear in inserter.\n *\n * @typedef {Object} WPEditorInserterItem\n * @property {string} id Unique identifier for the item.\n * @property {string} name The type of block to create.\n * @property {Object} initialAttributes Attributes to pass to the newly created block.\n * @property {string} title Title of the item, as it appears in the inserter.\n * @property {string} icon Dashicon for the item, as it appears in the inserter.\n * @property {string} category Block category that the item is associated with.\n * @property {string[]} keywords Keywords that can be searched to find this item.\n * @property {boolean} isDisabled Whether or not the user should be prevented from inserting\n * this item.\n * @property {number} frecency Heuristic that combines frequency and recency.\n */\nexport const getInserterItems = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS ) => {\n\t\t\tconst buildReusableBlockInserterItem = ( reusableBlock ) => {\n\t\t\t\tconst icon = ! reusableBlock.wp_pattern_sync_status\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsrc: symbol,\n\t\t\t\t\t\t\tforeground: 'var(--wp-block-synced-color)',\n\t\t\t\t\t }\n\t\t\t\t\t: symbol;\n\t\t\t\tconst userPattern = mapUserPattern( reusableBlock );\n\t\t\t\tconst { time, count = 0 } =\n\t\t\t\t\tgetInsertUsage( state, userPattern.name ) || {};\n\t\t\t\tconst frecency = calculateFrecency( time, count );\n\n\t\t\t\treturn {\n\t\t\t\t\tid: userPattern.name,\n\t\t\t\t\tname: 'core/block',\n\t\t\t\t\tinitialAttributes: { ref: reusableBlock.id },\n\t\t\t\t\ttitle: userPattern.title,\n\t\t\t\t\ticon,\n\t\t\t\t\tcategory: 'reusable',\n\t\t\t\t\tkeywords: [ 'reusable' ],\n\t\t\t\t\tisDisabled: false,\n\t\t\t\t\tutility: 1, // Deprecated.\n\t\t\t\t\tfrecency,\n\t\t\t\t\tcontent: userPattern.content,\n\t\t\t\t\tget blocks() {\n\t\t\t\t\t\treturn getParsedPattern( userPattern ).blocks;\n\t\t\t\t\t},\n\t\t\t\t\tsyncStatus: userPattern.syncStatus,\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tconst patternInserterItems = canInsertBlockTypeUnmemoized(\n\t\t\t\tstate,\n\t\t\t\t'core/block',\n\t\t\t\trootClientId\n\t\t\t)\n\t\t\t\t? unlock( select( STORE_NAME ) )\n\t\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t\t.map( buildReusableBlockInserterItem )\n\t\t\t\t: [];\n\n\t\t\tconst buildBlockTypeInserterItem = buildBlockTypeItem( state, {\n\t\t\t\tbuildScope: 'inserter',\n\t\t\t} );\n\n\t\t\tlet blockTypeInserterItems = getBlockTypes()\n\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\thasBlockSupport( blockType, 'inserter', true )\n\t\t\t\t)\n\t\t\t\t.map( buildBlockTypeInserterItem );\n\n\t\t\tif ( options[ isFiltered ] !== false ) {\n\t\t\t\tblockTypeInserterItems = blockTypeInserterItems.filter(\n\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\tcanIncludeBlockTypeInInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tblockTypeInserterItems = blockTypeInserterItems\n\t\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\t\tisBlockVisibleInTheInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( blockType ) => ( {\n\t\t\t\t\t\t...blockType,\n\t\t\t\t\t\tisAllowedInCurrentRoot: canIncludeBlockTypeInInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t),\n\t\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tconst items = blockTypeInserterItems.reduce(\n\t\t\t\t( accumulator, item ) => {\n\t\t\t\t\tconst { variations = [] } = item;\n\t\t\t\t\t// Exclude any block type item that is to be replaced by a default variation.\n\t\t\t\t\tif ( ! variations.some( ( { isDefault } ) => isDefault ) ) {\n\t\t\t\t\t\taccumulator.push( item );\n\t\t\t\t\t}\n\t\t\t\t\tif ( variations.length ) {\n\t\t\t\t\t\tconst variationMapper = getItemFromVariation(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\titem\n\t\t\t\t\t\t);\n\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t...variations.map( variationMapper )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t[]\n\t\t\t);\n\n\t\t\t// Ensure core blocks are prioritized in the returned results,\n\t\t\t// because third party blocks can be registered earlier than\n\t\t\t// the core blocks (usually by using the `init` action),\n\t\t\t// thus affecting the display order.\n\t\t\t// We don't sort reusable blocks as they are handled differently.\n\t\t\tconst groupByType = ( blocks, block ) => {\n\t\t\t\tconst { core, noncore } = blocks;\n\t\t\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\n\t\t\t\ttype.push( block );\n\t\t\t\treturn blocks;\n\t\t\t};\n\t\t\tconst { core: coreItems, noncore: nonCoreItems } = items.reduce(\n\t\t\t\tgroupByType,\n\t\t\t\t{ core: [], noncore: [] }\n\t\t\t);\n\t\t\tconst sortedBlockTypes = [ ...coreItems, ...nonCoreItems ];\n\t\t\treturn [ ...sortedBlockTypes, ...patternInserterItems ];\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\tstate.blocks.order,\n\t\t\tstate.preferences.insertUsage,\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\n/**\n * Determines the items that appear in the available block transforms list.\n *\n * Each item object contains what's necessary to display a menu item in the\n * transform list and handle its selection.\n *\n * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * Items are returned ordered descendingly by their 'frecency'.\n *\n * @param {Object} state Editor state.\n * @param {Object|Object[]} blocks Block object or array objects.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPEditorTransformItem[]} Items that appear in inserter.\n *\n * @typedef {Object} WPEditorTransformItem\n * @property {string} id Unique identifier for the item.\n * @property {string} name The type of block to create.\n * @property {string} title Title of the item, as it appears in the inserter.\n * @property {string} icon Dashicon for the item, as it appears in the inserter.\n * @property {boolean} isDisabled Whether or not the user should be prevented from inserting\n * this item.\n * @property {number} frecency Heuristic that combines frequency and recency.\n */\nexport const getBlockTransformItems = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blocks, rootClientId = null ) => {\n\t\t\tconst normalizedBlocks = Array.isArray( blocks )\n\t\t\t\t? blocks\n\t\t\t\t: [ blocks ];\n\t\t\tconst buildBlockTypeTransformItem = buildBlockTypeItem( state, {\n\t\t\t\tbuildScope: 'transform',\n\t\t\t} );\n\t\t\tconst blockTypeTransformItems = getBlockTypes()\n\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\tcanIncludeBlockTypeInInserter(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\tblockType,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( buildBlockTypeTransformItem );\n\n\t\t\tconst itemsByName = Object.fromEntries(\n\t\t\t\tObject.entries( blockTypeTransformItems ).map(\n\t\t\t\t\t( [ , value ] ) => [ value.name, value ]\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tconst possibleTransforms = getPossibleBlockTransformations(\n\t\t\t\tnormalizedBlocks\n\t\t\t).reduce( ( accumulator, block ) => {\n\t\t\t\tif ( itemsByName[ block?.name ] ) {\n\t\t\t\t\taccumulator.push( itemsByName[ block.name ] );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] );\n\t\t\treturn orderBy(\n\t\t\t\tpossibleTransforms,\n\t\t\t\t( block ) => itemsByName[ block.name ].frecency,\n\t\t\t\t'desc'\n\t\t\t);\n\t\t},\n\t\t( state, blocks, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\tstate.preferences.insertUsage,\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\n/**\n * Determines whether there are items to show in the inserter.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Items that appear in inserter.\n */\nexport const hasInserterItems = ( state, rootClientId = null ) => {\n\tconst hasBlockType = getBlockTypes().some( ( blockType ) =>\n\t\tcanIncludeBlockTypeInInserter( state, blockType, rootClientId )\n\t);\n\tif ( hasBlockType ) {\n\t\treturn true;\n\t}\n\tconst hasReusableBlock = canInsertBlockTypeUnmemoized(\n\t\tstate,\n\t\t'core/block',\n\t\trootClientId\n\t);\n\n\treturn hasReusableBlock;\n};\n\n/**\n * Returns the list of allowed inserter blocks for inner blocks children.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Array?} The list of allowed block types.\n */\nexport const getAllowedBlocks = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tif ( ! rootClientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blockTypes = getBlockTypes().filter( ( blockType ) =>\n\t\t\t\tcanIncludeBlockTypeInInserter( state, blockType, rootClientId )\n\t\t\t);\n\n\t\t\tconst hasReusableBlock = canInsertBlockTypeUnmemoized(\n\t\t\t\tstate,\n\t\t\t\t'core/block',\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\tif ( hasReusableBlock ) {\n\t\t\t\tblockTypes.push( 'core/block' );\n\t\t\t}\n\n\t\t\treturn blockTypes;\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const __experimentalGetAllowedBlocks = createSelector(\n\t( state, rootClientId = null ) => {\n\t\tdeprecated(\n\t\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetAllowedBlocks',\n\t\t\t{\n\t\t\t\talternative:\n\t\t\t\t\t'wp.data.select( \"core/block-editor\" ).getAllowedBlocks',\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t}\n\t\t);\n\t\treturn getAllowedBlocks( state, rootClientId );\n\t},\n\t( state, rootClientId ) =>\n\t\tgetAllowedBlocks.getDependants( state, rootClientId )\n);\n\n/**\n * Returns the block to be directly inserted by the block appender.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPDirectInsertBlock|undefined} The block type to be directly inserted.\n *\n * @typedef {Object} WPDirectInsertBlock\n * @property {string} name The type of block.\n * @property {?Object} attributes Attributes to pass to the newly created block.\n * @property {?Array<string>} attributesToCopy Attributes to be copied from adjacent blocks when inserted.\n */\nexport function getDirectInsertBlock( state, rootClientId = null ) {\n\tif ( ! rootClientId ) {\n\t\treturn;\n\t}\n\tconst { defaultBlock, directInsert } =\n\t\tstate.blockListSettings[ rootClientId ] ?? {};\n\tif ( ! defaultBlock || ! directInsert ) {\n\t\treturn;\n\t}\n\n\treturn defaultBlock;\n}\n\nexport function __experimentalGetDirectInsertBlock(\n\tstate,\n\trootClientId = null\n) {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetDirectInsertBlock',\n\t\t{\n\t\t\talternative:\n\t\t\t\t'wp.data.select( \"core/block-editor\" ).getDirectInsertBlock',\n\t\t\tsince: '6.3',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n\treturn getDirectInsertBlock( state, rootClientId );\n}\n\nexport const __experimentalGetParsedPattern = createRegistrySelector(\n\t( select ) => ( state, patternName ) => {\n\t\tconst pattern = unlock( select( STORE_NAME ) ).getPatternBySlug(\n\t\t\tpatternName\n\t\t);\n\t\treturn pattern ? getParsedPattern( pattern ) : null;\n\t}\n);\n\nconst getAllowedPatternsDependants = ( select ) => ( state, rootClientId ) => [\n\t...getAllPatternsDependants( select )( state ),\n\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n];\n\nconst patternsWithParsedBlocks = new WeakMap();\nfunction enhancePatternWithParsedBlocks( pattern ) {\n\tlet enhancedPattern = patternsWithParsedBlocks.get( pattern );\n\tif ( ! enhancedPattern ) {\n\t\tenhancedPattern = {\n\t\t\t...pattern,\n\t\t\tget blocks() {\n\t\t\t\treturn getParsedPattern( pattern ).blocks;\n\t\t\t},\n\t\t};\n\t\tpatternsWithParsedBlocks.set( pattern, enhancedPattern );\n\t}\n\treturn enhancedPattern;\n}\n\n/**\n * Returns the list of allowed patterns for inner blocks children.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional target root client ID.\n *\n * @return {Array?} The list of allowed patterns.\n */\nexport const __experimentalGetAllowedPatterns = createRegistrySelector(\n\t( select ) => {\n\t\treturn createSelector(\n\t\t\t(\n\t\t\t\tstate,\n\t\t\t\trootClientId = null,\n\t\t\t\toptions = DEFAULT_INSERTER_OPTIONS\n\t\t\t) => {\n\t\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\t\tconst patterns = getAllPatterns();\n\t\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\t\tconst parsedPatterns = patterns\n\t\t\t\t\t.filter( ( { inserter = true } ) => !! inserter )\n\t\t\t\t\t.map( enhancePatternWithParsedBlocks );\n\n\t\t\t\tconst availableParsedPatterns = parsedPatterns.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\tcheckAllowListRecursive(\n\t\t\t\t\t\t\tgetGrammar( pattern ),\n\t\t\t\t\t\t\tallowedBlockTypes\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst patternsAllowed = availableParsedPatterns.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\tgetGrammar( pattern ).every( ( { blockName: name } ) =>\n\t\t\t\t\t\t\toptions[ isFiltered ] !== false\n\t\t\t\t\t\t\t\t? canInsertBlockType(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: isBlockVisibleInTheInserter(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\treturn patternsAllowed;\n\t\t\t},\n\t\t\tgetAllowedPatternsDependants( select )\n\t\t);\n\t}\n);\n\n/**\n * Returns the list of patterns based on their declared `blockTypes`\n * and a block's name.\n * Patterns can use `blockTypes` to integrate in work flows like\n * suggesting appropriate patterns in a Placeholder state(during insertion)\n * or blocks transformations.\n *\n * @param {Object} state Editor state.\n * @param {string|string[]} blockNames Block's name or array of block names to find matching patterns.\n * @param {?string} rootClientId Optional target root client ID.\n *\n * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.\n */\nexport const getPatternsByBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blockNames, rootClientId = null ) => {\n\t\t\tif ( ! blockNames ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst patterns =\n\t\t\t\tselect( STORE_NAME ).__experimentalGetAllowedPatterns(\n\t\t\t\t\trootClientId\n\t\t\t\t);\n\t\t\tconst normalizedBlockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst filteredPatterns = patterns.filter( ( pattern ) =>\n\t\t\t\tpattern?.blockTypes?.some?.( ( blockName ) =>\n\t\t\t\t\tnormalizedBlockNames.includes( blockName )\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( filteredPatterns.length === 0 ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\treturn filteredPatterns;\n\t\t},\n\t\t( state, blockNames, rootClientId ) =>\n\t\t\tgetAllowedPatternsDependants( select )( state, rootClientId )\n\t)\n);\n\nexport const __experimentalGetPatternsByBlockTypes = createRegistrySelector(\n\t( select ) => {\n\t\tdeprecated(\n\t\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetPatternsByBlockTypes',\n\t\t\t{\n\t\t\t\talternative:\n\t\t\t\t\t'wp.data.select( \"core/block-editor\" ).getPatternsByBlockTypes',\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t}\n\t\t);\n\t\treturn select( STORE_NAME ).getPatternsByBlockTypes;\n\t}\n);\n\n/**\n * Determines the items that appear in the available pattern transforms list.\n *\n * For now we only handle blocks without InnerBlocks and take into account\n * the `role` property of blocks' attributes for the transformation.\n *\n * We return the first set of possible eligible block patterns,\n * by checking the `blockTypes` property. We still have to recurse through\n * block pattern's blocks and try to find matches from the selected blocks.\n * Now this happens in the consumer to avoid heavy operations in the selector.\n *\n * @param {Object} state Editor state.\n * @param {Object[]} blocks The selected blocks.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPBlockPattern[]} Items that are eligible for a pattern transformation.\n */\nexport const __experimentalGetPatternTransformItems = createRegistrySelector(\n\t( select ) =>\n\t\tcreateSelector(\n\t\t\t( state, blocks, rootClientId = null ) => {\n\t\t\t\tif ( ! blocks ) {\n\t\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * For now we only handle blocks without InnerBlocks and take into account\n\t\t\t\t * the `role` property of blocks' attributes for the transformation.\n\t\t\t\t * Note that the blocks have been retrieved through `getBlock`, which doesn't\n\t\t\t\t * return the inner blocks of an inner block controller, so we still need\n\t\t\t\t * to check for this case too.\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\tblocks.some(\n\t\t\t\t\t\t( { clientId, innerBlocks } ) =>\n\t\t\t\t\t\t\tinnerBlocks.length ||\n\t\t\t\t\t\t\tareInnerBlocksControlled( state, clientId )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t\t}\n\n\t\t\t\t// Create a Set of the selected block names that is used in patterns filtering.\n\t\t\t\tconst selectedBlockNames = Array.from(\n\t\t\t\t\tnew Set( blocks.map( ( { name } ) => name ) )\n\t\t\t\t);\n\t\t\t\t/**\n\t\t\t\t * Here we will return first set of possible eligible block patterns,\n\t\t\t\t * by checking the `blockTypes` property. We still have to recurse through\n\t\t\t\t * block pattern's blocks and try to find matches from the selected blocks.\n\t\t\t\t * Now this happens in the consumer to avoid heavy operations in the selector.\n\t\t\t\t */\n\t\t\t\treturn select( STORE_NAME ).getPatternsByBlockTypes(\n\t\t\t\t\tselectedBlockNames,\n\t\t\t\t\trootClientId\n\t\t\t\t);\n\t\t\t},\n\t\t\t( state, blocks, rootClientId ) =>\n\t\t\t\tgetAllowedPatternsDependants( select )( state, rootClientId )\n\t\t)\n);\n\n/**\n * Returns the Block List settings of a block, if any exist.\n *\n * @param {Object} state Editor state.\n * @param {?string} clientId Block client ID.\n *\n * @return {?Object} Block settings of the block if set.\n */\nexport function getBlockListSettings( state, clientId ) {\n\treturn state.blockListSettings[ clientId ];\n}\n\n/**\n * Returns the editor settings.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} The editor settings object.\n */\nexport function getSettings( state ) {\n\treturn state.settings;\n}\n\n/**\n * Returns true if the most recent block change is be considered persistent, or\n * false otherwise. A persistent change is one committed by BlockEditorProvider\n * via its `onChange` callback, in addition to `onInput`.\n *\n * @param {Object} state Block editor state.\n *\n * @return {boolean} Whether the most recent block change was persistent.\n */\nexport function isLastBlockChangePersistent( state ) {\n\treturn state.blocks.isPersistentChange;\n}\n\n/**\n * Returns the block list settings for an array of blocks, if any exist.\n *\n * @param {Object} state Editor state.\n * @param {Array} clientIds Block client IDs.\n *\n * @return {Object} An object where the keys are client ids and the values are\n * a block list setting object.\n */\nexport const __experimentalGetBlockListSettingsForBlocks = createSelector(\n\t( state, clientIds = [] ) => {\n\t\treturn clientIds.reduce( ( blockListSettingsForBlocks, clientId ) => {\n\t\t\tif ( ! state.blockListSettings[ clientId ] ) {\n\t\t\t\treturn blockListSettingsForBlocks;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...blockListSettingsForBlocks,\n\t\t\t\t[ clientId ]: state.blockListSettings[ clientId ],\n\t\t\t};\n\t\t}, {} );\n\t},\n\t( state ) => [ state.blockListSettings ]\n);\n\n/**\n * Returns the title of a given reusable block\n *\n * @param {Object} state Global application state.\n * @param {number|string} ref The shared block's ID.\n *\n * @return {string} The reusable block saved title.\n */\nexport const __experimentalGetReusableBlockTitle = createRegistrySelector(\n\t( select ) =>\n\t\tcreateSelector(\n\t\t\t( state, ref ) => {\n\t\t\t\tdeprecated(\n\t\t\t\t\t\"wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle\",\n\t\t\t\t\t{\n\t\t\t\t\t\tsince: '6.6',\n\t\t\t\t\t\tversion: '6.8',\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst reusableBlock = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( block ) => block.id === ref );\n\t\t\t\tif ( ! reusableBlock ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn reusableBlock.title?.raw;\n\t\t\t},\n\t\t\t() => [ unlock( select( STORE_NAME ) ).getReusableBlocks() ]\n\t\t)\n);\n\n/**\n * Returns true if the most recent block change is be considered ignored, or\n * false otherwise. An ignored change is one not to be committed by\n * BlockEditorProvider, neither via `onChange` nor `onInput`.\n *\n * @param {Object} state Block editor state.\n *\n * @return {boolean} Whether the most recent block change was ignored.\n */\nexport function __unstableIsLastBlockChangeIgnored( state ) {\n\t// TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be\n\t// ignored if in-fact they result in a change in blocks state. The current\n\t// need to ignore changes not a result of user interaction should be\n\t// accounted for in the refactoring of reusable blocks as occurring within\n\t// their own separate block editor / state (#7119).\n\treturn state.blocks.isIgnoredChange;\n}\n\n/**\n * Returns the block attributes changed as a result of the last dispatched\n * action.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object<string,Object>} Subsets of block attributes changed, keyed\n * by block client ID.\n */\nexport function __experimentalGetLastBlockAttributeChanges( state ) {\n\treturn state.lastBlockAttributesChange;\n}\n\n/**\n * Returns whether block moving mode is enabled.\n *\n * @deprecated\n */\nexport function hasBlockMovingClientId() {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).hasBlockMovingClientId',\n\t\t{\n\t\t\tsince: '6.7',\n\t\t\thint: 'Block moving mode feature has been removed',\n\t\t}\n\t);\n\treturn false;\n}\n\n/**\n * Returns true if the last change was an automatic change, false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the last change was automatic.\n */\nexport function didAutomaticChange( state ) {\n\treturn !! state.automaticChangeStatus;\n}\n\n/**\n * Returns true if the current highlighted block matches the block clientId.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block to check.\n *\n * @return {boolean} Whether the block is currently highlighted.\n */\nexport function isBlockHighlighted( state, clientId ) {\n\treturn state.highlightedBlock === clientId;\n}\n\n/**\n * Checks if a given block has controlled inner blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block to check.\n *\n * @return {boolean} True if the block has controlled inner blocks.\n */\nexport function areInnerBlocksControlled( state, clientId ) {\n\treturn !! state.blocks.controlledInnerBlocks[ clientId ];\n}\n\n/**\n * Returns the clientId for the first 'active' block of a given array of block names.\n * A block is 'active' if it (or a child) is the selected block.\n * Returns the first match moving up the DOM from the selected block.\n *\n * @param {Object} state Global application state.\n * @param {string[]} validBlocksNames The names of block types to check for.\n *\n * @return {string} The matching block's clientId.\n */\nexport const __experimentalGetActiveBlockIdByBlockNames = createSelector(\n\t( state, validBlockNames ) => {\n\t\tif ( ! validBlockNames.length ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Check if selected block is a valid entity area.\n\t\tconst selectedBlockClientId = getSelectedBlockClientId( state );\n\t\tif (\n\t\t\tvalidBlockNames.includes(\n\t\t\t\tgetBlockName( state, selectedBlockClientId )\n\t\t\t)\n\t\t) {\n\t\t\treturn selectedBlockClientId;\n\t\t}\n\t\t// Check if first selected block is a child of a valid entity area.\n\t\tconst multiSelectedBlockClientIds =\n\t\t\tgetMultiSelectedBlockClientIds( state );\n\t\tconst entityAreaParents = getBlockParentsByBlockName(\n\t\t\tstate,\n\t\t\tselectedBlockClientId || multiSelectedBlockClientIds[ 0 ],\n\t\t\tvalidBlockNames\n\t\t);\n\t\tif ( entityAreaParents ) {\n\t\t\t// Last parent closest/most interior.\n\t\t\treturn entityAreaParents[ entityAreaParents.length - 1 ];\n\t\t}\n\t\treturn null;\n\t},\n\t( state, validBlockNames ) => [\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t\tvalidBlockNames,\n\t]\n);\n\n/**\n * Tells if the block with the passed clientId was just inserted.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n * @param {?string} source Optional insertion source of the block.\n * @return {boolean} True if the block matches the last block inserted from the specified source.\n */\nexport function wasBlockJustInserted( state, clientId, source ) {\n\tconst { lastBlockInserted } = state;\n\treturn (\n\t\tlastBlockInserted.clientIds?.includes( clientId ) &&\n\t\tlastBlockInserted.source === source\n\t);\n}\n\n/**\n * Tells if the block is visible on the canvas or not.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n * @return {boolean} True if the block is visible.\n */\nexport function isBlockVisible( state, clientId ) {\n\treturn state.blockVisibility?.[ clientId ] ?? true;\n}\n\n/**\n * Returns the currently hovered block.\n *\n * @deprecated\n */\nexport function getHoveredBlockClientId() {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).getHoveredBlockClientId\",\n\t\t{\n\t\t\tsince: '6.9',\n\t\t\tversion: '7.1',\n\t\t}\n\t);\n\treturn undefined;\n}\n\n/**\n * Returns the list of all hidden blocks.\n *\n * @param {Object} state Global application state.\n * @return {[string]} List of hidden blocks.\n */\nexport const __unstableGetVisibleBlocks = createSelector(\n\t( state ) => {\n\t\tconst visibleBlocks = new Set(\n\t\t\tObject.keys( state.blockVisibility ).filter(\n\t\t\t\t( key ) => state.blockVisibility[ key ]\n\t\t\t)\n\t\t);\n\t\tif ( visibleBlocks.size === 0 ) {\n\t\t\treturn EMPTY_SET;\n\t\t}\n\t\treturn visibleBlocks;\n\t},\n\t( state ) => [ state.blockVisibility ]\n);\n\nexport function __unstableHasActiveBlockOverlayActive( state, clientId ) {\n\t// Prevent overlay on blocks with a non-default editing mode. If the mode is\n\t// 'disabled' then the overlay is redundant since the block can't be\n\t// selected. If the mode is 'contentOnly' then the overlay is redundant\n\t// since there will be no controls to interact with once selected.\n\tif ( getBlockEditingMode( state, clientId ) !== 'default' ) {\n\t\treturn false;\n\t}\n\n\t// If the block editing is locked, the block overlay is always active.\n\tif ( ! canEditBlock( state, clientId ) ) {\n\t\treturn true;\n\t}\n\n\t// In zoom-out mode, the block overlay is always active for section level blocks.\n\tif ( isZoomOut( state ) ) {\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif ( sectionRootClientId ) {\n\t\t\tconst sectionClientIds = getBlockOrder(\n\t\t\t\tstate,\n\t\t\t\tsectionRootClientId\n\t\t\t);\n\t\t\tif ( sectionClientIds?.includes( clientId ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if ( clientId && ! getBlockRootClientId( state, clientId ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// In navigation mode, the block overlay is active when the block is not\n\t// selected (and doesn't contain a selected child). The same behavior is\n\t// also enabled in all modes for blocks that have controlled children\n\t// (reusable block, template part, navigation), unless explicitly disabled\n\t// with `supports.__experimentalDisableBlockOverlay`.\n\tconst blockSupportDisable = hasBlockSupport(\n\t\tgetBlockName( state, clientId ),\n\t\t'__experimentalDisableBlockOverlay',\n\t\tfalse\n\t);\n\tconst shouldEnableIfUnselected = blockSupportDisable\n\t\t? false\n\t\t: areInnerBlocksControlled( state, clientId );\n\n\treturn (\n\t\tshouldEnableIfUnselected &&\n\t\t! isBlockSelected( state, clientId ) &&\n\t\t! hasSelectedInnerBlock( state, clientId, true )\n\t);\n}\n\nexport function __unstableIsWithinBlockOverlay( state, clientId ) {\n\tlet parent = state.blocks.parents.get( clientId );\n\twhile ( !! parent ) {\n\t\tif ( __unstableHasActiveBlockOverlayActive( state, parent ) ) {\n\t\t\treturn true;\n\t\t}\n\t\tparent = state.blocks.parents.get( parent );\n\t}\n\treturn false;\n}\n\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Returns the block editing mode for a given block.\n *\n * The mode can be one of three options:\n *\n * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be\n * selected.\n * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the\n * toolbar, the block movers, block settings.\n * - `'default'`: Allows editing the block as normal.\n *\n * Blocks can set a mode using the `useBlockEditingMode` hook.\n *\n * The mode is inherited by all of the block's inner blocks, unless they have\n * their own mode.\n *\n * A template lock can also set a mode. If the template lock is `'contentOnly'`,\n * the block's mode is overridden to `'contentOnly'` if the block has a content\n * role attribute, or `'disabled'` otherwise.\n *\n * @see useBlockEditingMode\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n */\nexport function getBlockEditingMode( state, clientId = '' ) {\n\t// Some selectors that call this provide `null` as the default\n\t// rootClientId, but the default rootClientId is actually `''`.\n\tif ( clientId === null ) {\n\t\tclientId = '';\n\t}\n\n\t// Check if the clientId has an editing mode set in the regular derived map.\n\t// There may be an editing mode set here for synced patterns or in zoomed out\n\t// mode.\n\tif ( state.derivedBlockEditingModes?.has( clientId ) ) {\n\t\treturn state.derivedBlockEditingModes.get( clientId );\n\t}\n\n\t// In normal mode, consider that an explicitly set editing mode takes over.\n\tif ( state.blockEditingModes.has( clientId ) ) {\n\t\treturn state.blockEditingModes.get( clientId );\n\t}\n\n\treturn 'default';\n}\n\n/**\n * Indicates if a block is ungroupable.\n * A block is ungroupable if it is a single grouping block with inner blocks.\n * If a block has an `ungroup` transform, it is also ungroupable, without the\n * requirement of being the default grouping block.\n * Additionally a block can only be ungrouped if it has inner blocks and can\n * be removed.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block. If not passed the selected block's client id will be used.\n * @return {boolean} True if the block is ungroupable.\n */\nexport const isUngroupable = createRegistrySelector(\n\t( select ) =>\n\t\t( state, clientId = '' ) => {\n\t\t\tconst _clientId = clientId || getSelectedBlockClientId( state );\n\t\t\tif ( ! _clientId ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getGroupingBlockName } = select( blocksStore );\n\t\t\tconst block = getBlock( state, _clientId );\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\tconst _isUngroupable =\n\t\t\t\tblock &&\n\t\t\t\t( block.name === groupingBlockName ||\n\t\t\t\t\tgetBlockType( block.name )?.transforms?.ungroup ) &&\n\t\t\t\t!! block.innerBlocks.length;\n\n\t\t\treturn _isUngroupable && canRemoveBlock( state, _clientId );\n\t\t}\n);\n\n/**\n * Indicates if the provided blocks(by client ids) are groupable.\n * We need to have at least one block, have a grouping block name set and\n * be able to remove these blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds Block client ids. If not passed the selected blocks client ids will be used.\n * @return {boolean} True if the blocks are groupable.\n */\nexport const isGroupable = createRegistrySelector(\n\t( select ) =>\n\t\t( state, clientIds = EMPTY_ARRAY ) => {\n\t\t\tconst { getGroupingBlockName } = select( blocksStore );\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\tconst _clientIds = clientIds?.length\n\t\t\t\t? clientIds\n\t\t\t\t: getSelectedBlockClientIds( state );\n\t\t\tconst rootClientId = _clientIds?.length\n\t\t\t\t? getBlockRootClientId( state, _clientIds[ 0 ] )\n\t\t\t\t: undefined;\n\t\t\tconst groupingBlockAvailable = canInsertBlockType(\n\t\t\t\tstate,\n\t\t\t\tgroupingBlockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\tconst _isGroupable = groupingBlockAvailable && _clientIds.length;\n\t\t\treturn _isGroupable && canRemoveBlocks( state, _clientIds );\n\t\t}\n);\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const __unstableGetContentLockingParent = ( state, clientId ) => {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent\",\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getContentLockingParent( state, clientId );\n};\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n */\nexport function __unstableGetTemporarilyEditingAsBlocks( state ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks\",\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getTemporarilyEditingAsBlocks( state );\n}\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n */\nexport function __unstableGetTemporarilyEditingFocusModeToRevert( state ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getTemporarilyEditingFocusModeToRevert( state );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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,IACA;AAAA,MACC,OAAO;AAAA,MACP,SAAS;AAAA,IACV;AAAA,EACD;AACA,aAAO,kDAAyB,OAAO,QAAS;AACjD;AAWO,SAAS,wCAAyC,OAAQ;AAChE,wBAAAA;AAAA,IACC;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,SAAS;AAAA,IACV;AAAA,EACD;AACA,aAAO,wDAA+B,KAAM;AAC7C;AAWO,SAAS,iDAAkD,OAAQ;AACzE,wBAAAA;AAAA,IACC;AAAA,IACA;AAAA,MACC,OAAO;AAAA,MACP,SAAS;AAAA,IACV;AAAA,EACD;AACA,aAAO,iEAAwC,KAAM;AACtD;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockVariations,\n\thasBlockSupport,\n\tgetPossibleBlockTransformations,\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\nimport { symbol } from '@wordpress/icons';\nimport { create, remove, toHTMLString } from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tisFiltered,\n\tcheckAllowListRecursive,\n\tcheckAllowList,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetParsedPattern,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { orderBy } from '../utils/sorting';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nimport {\n\tgetContentLockingParent,\n\tgetTemporarilyEditingAsBlocks,\n\tgetTemporarilyEditingFocusModeToRevert,\n\tgetSectionRootClientId,\n\tisSectionBlock,\n\tgetParentSectionBlock,\n\tisZoomOut,\n\tisContainerInsertableToInContentOnlyMode,\n} from './private-selectors';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\n/**\n * A block selection object.\n *\n * @typedef {Object} WPBlockSelection\n *\n * @property {string} clientId A block client ID.\n * @property {string} attributeKey A block attribute key.\n * @property {number} offset An attribute value offset, based on the rich\n * text value. See `wp.richText.create`.\n */\n\n// Module constants.\nconst MILLISECONDS_PER_HOUR = 3600 * 1000;\nconst MILLISECONDS_PER_DAY = 24 * 3600 * 1000;\nconst MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Shared reference to an empty Set for cases where it is important to avoid\n * returning a new Set reference on every invocation, as in a connected or\n * other pure component which performs `shouldComponentUpdate` check on props.\n * This should be used as a last resort, since the normalized data should be\n * maintained by the reducer result in state.\n *\n * @type {Set}\n */\nconst EMPTY_SET = new Set();\n\nconst DEFAULT_INSERTER_OPTIONS = {\n\t[ isFiltered ]: true,\n};\n\n/**\n * Returns a block's name given its client ID, or null if no block exists with\n * the client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {string} Block name.\n */\nexport function getBlockName( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\tconst socialLinkName = 'core/social-link';\n\n\tif ( Platform.OS !== 'web' && block?.name === socialLinkName ) {\n\t\tconst attributes = state.blocks.attributes.get( clientId );\n\t\tconst { service } = attributes ?? {};\n\n\t\treturn service ? `${ socialLinkName }-${ service }` : socialLinkName;\n\t}\n\treturn block ? block.name : null;\n}\n\n/**\n * Returns whether a block is valid or not.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Is Valid.\n */\nexport function isBlockValid( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\treturn !! block && block.isValid;\n}\n\n/**\n * Returns a block's attributes given its client ID, or null if no block exists with\n * the client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {?Object} Block attributes.\n */\nexport function getBlockAttributes( state, clientId ) {\n\tconst block = state.blocks.byClientId.get( clientId );\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\treturn state.blocks.attributes.get( clientId );\n}\n\n/**\n * Returns a block given its client ID. This is a parsed copy of the block,\n * containing its `blockName`, `clientId`, and current `attributes` state. This\n * is not the block's registration settings, which must be retrieved from the\n * blocks module registration store.\n *\n * getBlock recurses through its inner blocks until all its children blocks have\n * been retrieved. Note that getBlock will not return the child inner blocks of\n * an inner block controller. This is because an inner block controller syncs\n * itself with its own entity, and should therefore not be included with the\n * blocks of a different entity. For example, say you call `getBlocks( TP )` to\n * get the blocks of a template part. If another template part is a child of TP,\n * then the nested template part's child blocks will not be returned. This way,\n * the template block itself is considered part of the parent, but the children\n * are not.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {Object} Parsed block object.\n */\nexport function getBlock( state, clientId ) {\n\tif ( ! state.blocks.byClientId.has( clientId ) ) {\n\t\treturn null;\n\t}\n\n\treturn state.blocks.tree.get( clientId );\n}\n\nexport const __unstableGetBlockWithoutInnerBlocks = createSelector(\n\t( state, clientId ) => {\n\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\tif ( ! block ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn {\n\t\t\t...block,\n\t\t\tattributes: getBlockAttributes( state, clientId ),\n\t\t};\n\t},\n\t( state, clientId ) => [\n\t\tstate.blocks.byClientId.get( clientId ),\n\t\tstate.blocks.attributes.get( clientId ),\n\t]\n);\n\n/**\n * Returns all block objects for the current post being edited as an array in\n * the order they appear in the post. Note that this will exclude child blocks\n * of nested inner block controllers.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Post blocks.\n */\nexport function getBlocks( state, rootClientId ) {\n\tconst treeKey =\n\t\t! rootClientId || ! areInnerBlocksControlled( state, rootClientId )\n\t\t\t? rootClientId || ''\n\t\t\t: 'controlled||' + rootClientId;\n\treturn state.blocks.tree.get( treeKey )?.innerBlocks || EMPTY_ARRAY;\n}\n\n/**\n * Returns a stripped down block object containing only its client ID,\n * and its inner blocks' client IDs.\n *\n * @deprecated\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Client ID of the block to get.\n *\n * @return {Object} Client IDs of the post blocks.\n */\nexport const __unstableGetClientIdWithClientIdsTree = createSelector(\n\t( state, clientId ) => {\n\t\tdeprecated(\n\t\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree\",\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\tversion: '6.5',\n\t\t\t}\n\t\t);\n\t\treturn {\n\t\t\tclientId,\n\t\t\tinnerBlocks: __unstableGetClientIdsTree( state, clientId ),\n\t\t};\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns the block tree represented in the block-editor store from the\n * given root, consisting of stripped down block objects containing only\n * their client IDs, and their inner blocks' client IDs.\n *\n * @deprecated\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Client IDs of the post blocks.\n */\nexport const __unstableGetClientIdsTree = createSelector(\n\t( state, rootClientId = '' ) => {\n\t\tdeprecated(\n\t\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree\",\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\tversion: '6.5',\n\t\t\t}\n\t\t);\n\t\treturn getBlockOrder( state, rootClientId ).map( ( clientId ) =>\n\t\t\t__unstableGetClientIdWithClientIdsTree( state, clientId )\n\t\t);\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns an array containing the clientIds of all descendants of the blocks\n * given. Returned ids are ordered first by the order of the ids given, then\n * by the order that they appear in the editor.\n *\n * @param {Object} state Global application state.\n * @param {string|string[]} rootIds Client ID(s) for which descendant blocks are to be returned.\n *\n * @return {Array} Client IDs of descendants.\n */\nexport const getClientIdsOfDescendants = createSelector(\n\t( state, rootIds ) => {\n\t\trootIds = Array.isArray( rootIds ) ? [ ...rootIds ] : [ rootIds ];\n\t\tconst ids = [];\n\n\t\t// Add the descendants of the root blocks first.\n\t\tfor ( const rootId of rootIds ) {\n\t\t\tconst order = state.blocks.order.get( rootId );\n\t\t\tif ( order ) {\n\t\t\t\tids.push( ...order );\n\t\t\t}\n\t\t}\n\n\t\tlet index = 0;\n\n\t\t// Add the descendants of the descendants, recursively.\n\t\twhile ( index < ids.length ) {\n\t\t\tconst id = ids[ index ];\n\t\t\tconst order = state.blocks.order.get( id );\n\t\t\tif ( order ) {\n\t\t\t\tids.splice( index + 1, 0, ...order );\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\n\t\treturn ids;\n\t},\n\t( state ) => [ state.blocks.order ]\n);\n\n/**\n * Returns an array containing the clientIds of the top-level blocks and\n * their descendants of any depth (for nested blocks). Ids are returned\n * in the same order that they appear in the editor.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} ids of top-level and descendant blocks.\n */\nexport const getClientIdsWithDescendants = ( state ) =>\n\tgetClientIdsOfDescendants( state, '' );\n\n/**\n * Returns the total number of blocks, or the total number of blocks with a specific name in a post.\n * The number returned includes nested blocks.\n *\n * @param {Object} state Global application state.\n * @param {?string} blockName Optional block name, if specified only blocks of that type will be counted.\n *\n * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName.\n */\nexport const getGlobalBlockCount = createSelector(\n\t( state, blockName ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tif ( ! blockName ) {\n\t\t\treturn clientIds.length;\n\t\t}\n\t\tlet count = 0;\n\t\tfor ( const clientId of clientIds ) {\n\t\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\t\tif ( block.name === blockName ) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t},\n\t( state ) => [ state.blocks.order, state.blocks.byClientId ]\n);\n\n/**\n * Returns all blocks that match a blockName. Results include nested blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} blockName Block name(s) for which clientIds are to be returned.\n *\n * @return {Array} Array of clientIds of blocks with name equal to blockName.\n */\nexport const getBlocksByName = createSelector(\n\t( state, blockName ) => {\n\t\tif ( ! blockName ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst blockNames = Array.isArray( blockName )\n\t\t\t? blockName\n\t\t\t: [ blockName ];\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst foundBlocks = clientIds.filter( ( clientId ) => {\n\t\t\tconst block = state.blocks.byClientId.get( clientId );\n\t\t\treturn blockNames.includes( block.name );\n\t\t} );\n\t\treturn foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY;\n\t},\n\t( state ) => [ state.blocks.order, state.blocks.byClientId ]\n);\n\n/**\n * Returns all global blocks that match a blockName. Results include nested blocks.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string[]} blockName Block name(s) for which clientIds are to be returned.\n *\n * @return {Array} Array of clientIds of blocks with name equal to blockName.\n */\nexport function __experimentalGetGlobalBlocksByName( state, blockName ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\talternative: `wp.data.select( 'core/block-editor' ).getBlocksByName`,\n\t\t}\n\t);\n\treturn getBlocksByName( state, blockName );\n}\n\n/**\n * Given an array of block client IDs, returns the corresponding array of block\n * objects.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds Client IDs for which blocks are to be returned.\n *\n * @return {WPBlock[]} Block objects.\n */\nexport const getBlocksByClientId = createSelector(\n\t( state, clientIds ) =>\n\t\t( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(\n\t\t\t( clientId ) => getBlock( state, clientId )\n\t\t),\n\t( state, clientIds ) =>\n\t\t( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(\n\t\t\t( clientId ) => state.blocks.tree.get( clientId )\n\t\t)\n);\n\n/**\n * Given an array of block client IDs, returns the corresponding array of block\n * names.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds Client IDs for which block names are to be returned.\n *\n * @return {string[]} Block names.\n */\nexport const getBlockNamesByClientId = createSelector(\n\t( state, clientIds ) =>\n\t\tgetBlocksByClientId( state, clientIds )\n\t\t\t.filter( Boolean )\n\t\t\t.map( ( block ) => block.name ),\n\t( state, clientIds ) => getBlocksByClientId( state, clientIds )\n);\n\n/**\n * Returns the number of blocks currently present in the post.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {number} Number of blocks in the post.\n */\nexport function getBlockCount( state, rootClientId ) {\n\treturn getBlockOrder( state, rootClientId ).length;\n}\n\n/**\n * Returns the current selection start block client ID, attribute key and text\n * offset.\n *\n * @param {Object} state Block editor state.\n *\n * @return {WPBlockSelection} Selection start information.\n */\nexport function getSelectionStart( state ) {\n\treturn state.selection.selectionStart;\n}\n\n/**\n * Returns the current selection end block client ID, attribute key and text\n * offset.\n *\n * @param {Object} state Block editor state.\n *\n * @return {WPBlockSelection} Selection end information.\n */\nexport function getSelectionEnd( state ) {\n\treturn state.selection.selectionEnd;\n}\n\n/**\n * Returns the current block selection start. This value may be null, and it\n * may represent either a singular block selection or multi-selection start.\n * A selection is singular if its start and end match.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Client ID of block selection start.\n */\nexport function getBlockSelectionStart( state ) {\n\treturn state.selection.selectionStart.clientId;\n}\n\n/**\n * Returns the current block selection end. This value may be null, and it\n * may represent either a singular block selection or multi-selection end.\n * A selection is singular if its start and end match.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Client ID of block selection end.\n */\nexport function getBlockSelectionEnd( state ) {\n\treturn state.selection.selectionEnd.clientId;\n}\n\n/**\n * Returns the number of blocks currently selected in the post.\n *\n * @param {Object} state Global application state.\n *\n * @return {number} Number of blocks selected in the post.\n */\nexport function getSelectedBlockCount( state ) {\n\tconst multiSelectedBlockCount =\n\t\tgetMultiSelectedBlockClientIds( state ).length;\n\n\tif ( multiSelectedBlockCount ) {\n\t\treturn multiSelectedBlockCount;\n\t}\n\n\treturn state.selection.selectionStart.clientId ? 1 : 0;\n}\n\n/**\n * Returns true if there is a single selected block, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether a single block is selected.\n */\nexport function hasSelectedBlock( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\treturn (\n\t\t!! selectionStart.clientId &&\n\t\tselectionStart.clientId === selectionEnd.clientId\n\t);\n}\n\n/**\n * Returns the currently selected block client ID, or null if there is no\n * selected block.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Selected block client ID.\n */\nexport function getSelectedBlockClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\tconst { clientId } = selectionStart;\n\n\tif ( ! clientId || clientId !== selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn clientId;\n}\n\n/**\n * Returns the currently selected block, or null if there is no selected block.\n *\n * @param {Object} state Global application state.\n *\n * @example\n *\n *```js\n * import { select } from '@wordpress/data'\n * import { store as blockEditorStore } from '@wordpress/block-editor'\n *\n * // Set initial active block client ID\n * let activeBlockClientId = null\n *\n * const getActiveBlockData = () => {\n * \tconst activeBlock = select(blockEditorStore).getSelectedBlock()\n *\n * \tif (activeBlock && activeBlock.clientId !== activeBlockClientId) {\n * \t\tactiveBlockClientId = activeBlock.clientId\n *\n * \t\t// Get active block name and attributes\n * \t\tconst activeBlockName = activeBlock.name\n * \t\tconst activeBlockAttributes = activeBlock.attributes\n *\n * \t\t// Log active block name and attributes\n * \t\tconsole.log(activeBlockName, activeBlockAttributes)\n * \t\t}\n * \t}\n *\n * \t// Subscribe to changes in the editor\n * \t// wp.data.subscribe(() => {\n * \t\t// getActiveBlockData()\n * \t// })\n *\n * \t// Update active block data on click\n * \t// onclick=\"getActiveBlockData()\"\n *```\n *\n * @return {?Object} Selected block.\n */\nexport function getSelectedBlock( state ) {\n\tconst clientId = getSelectedBlockClientId( state );\n\treturn clientId ? getBlock( state, clientId ) : null;\n}\n\n/**\n * Given a block client ID, returns the root block from which the block is\n * nested, an empty string for top-level blocks, or null if the block does not\n * exist.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n *\n * @return {?string} Root client ID, if exists\n */\nexport function getBlockRootClientId( state, clientId ) {\n\treturn state.blocks.parents.get( clientId ) ?? null;\n}\n\n/**\n * Given a block client ID, returns the list of all its parents from top to bottom.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false).\n *\n * @return {Array} ClientIDs of the parent blocks.\n */\nexport const getBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\tconst parents = [];\n\t\tlet current = clientId;\n\t\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\t\tparents.push( current );\n\t\t}\n\n\t\tif ( ! parents.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\treturn ascending ? parents : parents.reverse();\n\t},\n\t( state ) => [ state.blocks.parents ]\n);\n\n/**\n * Given a block client ID and a block name, returns the list of all its parents\n * from top to bottom, filtered by the given name(s). For example, if passed\n * 'core/group' as the blockName, it will only return parents which are group\n * blocks. If passed `[ 'core/group', 'core/cover']`, as the blockName, it will\n * return parents which are group blocks and parents which are cover blocks.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n * @param {string|string[]} blockName Block name(s) to filter.\n * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false).\n *\n * @return {Array} ClientIDs of the parent blocks.\n */\nexport const getBlockParentsByBlockName = createSelector(\n\t( state, clientId, blockName, ascending = false ) => {\n\t\tconst parents = getBlockParents( state, clientId, ascending );\n\t\tconst hasName = Array.isArray( blockName )\n\t\t\t? ( name ) => blockName.includes( name )\n\t\t\t: ( name ) => blockName === name;\n\t\treturn parents.filter( ( id ) => hasName( getBlockName( state, id ) ) );\n\t},\n\t( state ) => [ state.blocks.parents ]\n);\n/**\n * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find root client ID.\n *\n * @return {string} Root client ID\n */\nexport function getBlockHierarchyRootClientId( state, clientId ) {\n\tlet current = clientId;\n\tlet parent;\n\tdo {\n\t\tparent = current;\n\t\tcurrent = state.blocks.parents.get( current );\n\t} while ( current );\n\treturn parent;\n}\n\n/**\n * Given a block client ID, returns the lowest common ancestor with selected client ID.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block from which to find common ancestor client ID.\n *\n * @return {string} Common ancestor client ID or undefined\n */\nexport function getLowestCommonAncestorWithSelectedBlock( state, clientId ) {\n\tconst selectedId = getSelectedBlockClientId( state );\n\tconst clientParents = [ ...getBlockParents( state, clientId ), clientId ];\n\tconst selectedParents = [\n\t\t...getBlockParents( state, selectedId ),\n\t\tselectedId,\n\t];\n\n\tlet lowestCommonAncestor;\n\n\tconst maxDepth = Math.min( clientParents.length, selectedParents.length );\n\tfor ( let index = 0; index < maxDepth; index++ ) {\n\t\tif ( clientParents[ index ] === selectedParents[ index ] ) {\n\t\t\tlowestCommonAncestor = clientParents[ index ];\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn lowestCommonAncestor;\n}\n\n/**\n * Returns the client ID of the block adjacent one at the given reference\n * startClientId and modifier directionality. Defaults start startClientId to\n * the selected block, and direction as next block. Returns null if there is no\n * adjacent block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n * @param {?number} modifier Directionality multiplier (1 next, -1\n * previous).\n *\n * @return {?string} Return the client ID of the block, or null if none exists.\n */\nexport function getAdjacentBlockClientId( state, startClientId, modifier = 1 ) {\n\t// Default to selected block.\n\tif ( startClientId === undefined ) {\n\t\tstartClientId = getSelectedBlockClientId( state );\n\t}\n\n\t// Try multi-selection starting at extent based on modifier.\n\tif ( startClientId === undefined ) {\n\t\tif ( modifier < 0 ) {\n\t\t\tstartClientId = getFirstMultiSelectedBlockClientId( state );\n\t\t} else {\n\t\t\tstartClientId = getLastMultiSelectedBlockClientId( state );\n\t\t}\n\t}\n\n\t// Validate working start client ID.\n\tif ( ! startClientId ) {\n\t\treturn null;\n\t}\n\n\t// Retrieve start block root client ID, being careful to allow the falsey\n\t// empty string top-level root by explicitly testing against null.\n\tconst rootClientId = getBlockRootClientId( state, startClientId );\n\tif ( rootClientId === null ) {\n\t\treturn null;\n\t}\n\n\tconst { order } = state.blocks;\n\tconst orderSet = order.get( rootClientId );\n\tconst index = orderSet.indexOf( startClientId );\n\tconst nextIndex = index + 1 * modifier;\n\n\t// Block was first in set and we're attempting to get previous.\n\tif ( nextIndex < 0 ) {\n\t\treturn null;\n\t}\n\n\t// Block was last in set and we're attempting to get next.\n\tif ( nextIndex === orderSet.length ) {\n\t\treturn null;\n\t}\n\n\t// Assume incremented index is within the set.\n\treturn orderSet[ nextIndex ];\n}\n\n/**\n * Returns the previous block's client ID from the given reference start ID.\n * Defaults start to the selected block. Returns null if there is no previous\n * block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n *\n * @return {?string} Adjacent block's client ID, or null if none exists.\n */\nexport function getPreviousBlockClientId( state, startClientId ) {\n\treturn getAdjacentBlockClientId( state, startClientId, -1 );\n}\n\n/**\n * Returns the next block's client ID from the given reference start ID.\n * Defaults start to the selected block. Returns null if there is no next\n * block.\n *\n * @param {Object} state Editor state.\n * @param {?string} startClientId Optional client ID of block from which to\n * search.\n *\n * @return {?string} Adjacent block's client ID, or null if none exists.\n */\nexport function getNextBlockClientId( state, startClientId ) {\n\treturn getAdjacentBlockClientId( state, startClientId, 1 );\n}\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Returns the initial caret position for the selected block.\n * This position is to used to position the caret properly when the selected block changes.\n * If the current block is not a RichText, having initial position set to 0 means \"focus block\"\n *\n * @param {Object} state Global application state.\n *\n * @return {0|-1|null} Initial position.\n */\nexport function getSelectedBlocksInitialCaretPosition( state ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn state.initialPosition;\n}\n\n/**\n * Returns the current selection set of block client IDs (multiselection or single selection).\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block client IDs.\n */\nexport const getSelectedBlockClientIds = createSelector(\n\t( state ) => {\n\t\tconst { selectionStart, selectionEnd } = state.selection;\n\n\t\tif ( ! selectionStart.clientId || ! selectionEnd.clientId ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\t\treturn [ selectionStart.clientId ];\n\t\t}\n\n\t\t// Retrieve root client ID to aid in retrieving relevant nested block\n\t\t// order, being careful to allow the falsey empty string top-level root\n\t\t// by explicitly testing against null.\n\t\tconst rootClientId = getBlockRootClientId(\n\t\t\tstate,\n\t\t\tselectionStart.clientId\n\t\t);\n\n\t\tif ( rootClientId === null ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tconst blockOrder = getBlockOrder( state, rootClientId );\n\t\tconst startIndex = blockOrder.indexOf( selectionStart.clientId );\n\t\tconst endIndex = blockOrder.indexOf( selectionEnd.clientId );\n\n\t\tif ( startIndex > endIndex ) {\n\t\t\treturn blockOrder.slice( endIndex, startIndex + 1 );\n\t\t}\n\n\t\treturn blockOrder.slice( startIndex, endIndex + 1 );\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t]\n);\n\n/**\n * Returns the current multi-selection set of block client IDs, or an empty\n * array if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block client IDs.\n */\nexport function getMultiSelectedBlockClientIds( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\treturn getSelectedBlockClientIds( state );\n}\n\n/**\n * Returns the current multi-selection set of blocks, or an empty array if\n * there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Array} Multi-selected block objects.\n */\nexport const getMultiSelectedBlocks = createSelector(\n\t( state ) => {\n\t\tconst multiSelectedBlockClientIds =\n\t\t\tgetMultiSelectedBlockClientIds( state );\n\t\tif ( ! multiSelectedBlockClientIds.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\treturn multiSelectedBlockClientIds.map( ( clientId ) =>\n\t\t\tgetBlock( state, clientId )\n\t\t);\n\t},\n\t( state ) => [\n\t\t...getSelectedBlockClientIds.getDependants( state ),\n\t\tstate.blocks.byClientId,\n\t\tstate.blocks.order,\n\t\tstate.blocks.attributes,\n\t]\n);\n\n/**\n * Returns the client ID of the first block in the multi-selection set, or null\n * if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} First block client ID in the multi-selection set.\n */\nexport function getFirstMultiSelectedBlockClientId( state ) {\n\treturn getMultiSelectedBlockClientIds( state )[ 0 ] || null;\n}\n\n/**\n * Returns the client ID of the last block in the multi-selection set, or null\n * if there is no multi-selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Last block client ID in the multi-selection set.\n */\nexport function getLastMultiSelectedBlockClientId( state ) {\n\tconst selectedClientIds = getMultiSelectedBlockClientIds( state );\n\treturn selectedClientIds[ selectedClientIds.length - 1 ] || null;\n}\n\n/**\n * Returns true if a multi-selection exists, and the block corresponding to the\n * specified client ID is the first block of the multi-selection set, or false\n * otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is first in multi-selection.\n */\nexport function isFirstMultiSelectedBlock( state, clientId ) {\n\treturn getFirstMultiSelectedBlockClientId( state ) === clientId;\n}\n\n/**\n * Returns true if the client ID occurs within the block multi-selection, or\n * false otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is in multi-selection set.\n */\nexport function isBlockMultiSelected( state, clientId ) {\n\treturn getMultiSelectedBlockClientIds( state ).indexOf( clientId ) !== -1;\n}\n\n/**\n * Returns true if an ancestor of the block is multi-selected, or false\n * otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether an ancestor of the block is in multi-selection\n * set.\n */\nexport const isAncestorMultiSelected = createSelector(\n\t( state, clientId ) => {\n\t\tlet ancestorClientId = clientId;\n\t\tlet isMultiSelected = false;\n\t\twhile ( ancestorClientId && ! isMultiSelected ) {\n\t\t\tancestorClientId = getBlockRootClientId( state, ancestorClientId );\n\t\t\tisMultiSelected = isBlockMultiSelected( state, ancestorClientId );\n\t\t}\n\t\treturn isMultiSelected;\n\t},\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t]\n);\n\n/**\n * Returns the client ID of the block which begins the multi-selection set, or\n * null if there is no multi-selection.\n *\n * This is not necessarily the first client ID in the selection.\n *\n * @see getFirstMultiSelectedBlockClientId\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Client ID of block beginning multi-selection.\n */\nexport function getMultiSelectedBlocksStartClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn selectionStart.clientId || null;\n}\n\n/**\n * Returns the client ID of the block which ends the multi-selection set, or\n * null if there is no multi-selection.\n *\n * This is not necessarily the last client ID in the selection.\n *\n * @see getLastMultiSelectedBlockClientId\n *\n * @param {Object} state Editor state.\n *\n * @return {?string} Client ID of block ending multi-selection.\n */\nexport function getMultiSelectedBlocksEndClientId( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId === selectionEnd.clientId ) {\n\t\treturn null;\n\t}\n\n\treturn selectionEnd.clientId || null;\n}\n\n/**\n * Returns true if the selection is not partial.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the selection is mergeable.\n */\nexport function __unstableIsFullySelected( state ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\treturn (\n\t\t! selectionAnchor.attributeKey &&\n\t\t! selectionFocus.attributeKey &&\n\t\ttypeof selectionAnchor.offset === 'undefined' &&\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t);\n}\n\n/**\n * Returns true if the selection is collapsed.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether the selection is collapsed.\n */\nexport function __unstableIsSelectionCollapsed( state ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\treturn (\n\t\t!! selectionAnchor &&\n\t\t!! selectionFocus &&\n\t\tselectionAnchor.clientId === selectionFocus.clientId &&\n\t\tselectionAnchor.attributeKey === selectionFocus.attributeKey &&\n\t\tselectionAnchor.offset === selectionFocus.offset\n\t);\n}\n\nexport function __unstableSelectionHasUnmergeableBlock( state ) {\n\treturn getSelectedBlockClientIds( state ).some( ( clientId ) => {\n\t\tconst blockName = getBlockName( state, clientId );\n\t\tconst blockType = getBlockType( blockName );\n\t\treturn ! blockType.merge;\n\t} );\n}\n\n/**\n * Check whether the selection is mergeable.\n *\n * @param {Object} state Editor state.\n * @param {boolean} isForward Whether to merge forwards.\n *\n * @return {boolean} Whether the selection is mergeable.\n */\nexport function __unstableIsSelectionMergeable( state, isForward ) {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\n\t// It's not mergeable if the start and end are within the same block.\n\tif ( selectionAnchor.clientId === selectionFocus.clientId ) {\n\t\treturn false;\n\t}\n\n\t// It's not mergeable if there's no rich text selection.\n\tif (\n\t\t! selectionAnchor.attributeKey ||\n\t\t! selectionFocus.attributeKey ||\n\t\ttypeof selectionAnchor.offset === 'undefined' ||\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t) {\n\t\treturn false;\n\t}\n\n\tconst anchorRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionAnchor.clientId\n\t);\n\tconst focusRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionFocus.clientId\n\t);\n\n\t// It's not mergeable if the selection doesn't start and end in the same\n\t// block list. Maybe in the future it should be allowed.\n\tif ( anchorRootClientId !== focusRootClientId ) {\n\t\treturn false;\n\t}\n\n\tconst blockOrder = getBlockOrder( state, anchorRootClientId );\n\tconst anchorIndex = blockOrder.indexOf( selectionAnchor.clientId );\n\tconst focusIndex = blockOrder.indexOf( selectionFocus.clientId );\n\n\t// Reassign selection start and end based on order.\n\tlet selectionStart, selectionEnd;\n\n\tif ( anchorIndex > focusIndex ) {\n\t\tselectionStart = selectionFocus;\n\t\tselectionEnd = selectionAnchor;\n\t} else {\n\t\tselectionStart = selectionAnchor;\n\t\tselectionEnd = selectionFocus;\n\t}\n\n\tconst targetBlockClientId = isForward\n\t\t? selectionEnd.clientId\n\t\t: selectionStart.clientId;\n\tconst blockToMergeClientId = isForward\n\t\t? selectionStart.clientId\n\t\t: selectionEnd.clientId;\n\n\tconst targetBlockName = getBlockName( state, targetBlockClientId );\n\tconst targetBlockType = getBlockType( targetBlockName );\n\n\tif ( ! targetBlockType.merge ) {\n\t\treturn false;\n\t}\n\n\tconst blockToMerge = getBlock( state, blockToMergeClientId );\n\n\t// It's mergeable if the blocks are of the same type.\n\tif ( blockToMerge.name === targetBlockName ) {\n\t\treturn true;\n\t}\n\n\t// If the blocks are of a different type, try to transform the block being\n\t// merged into the same type of block.\n\tconst blocksToMerge = switchToBlockType( blockToMerge, targetBlockName );\n\n\treturn blocksToMerge && blocksToMerge.length;\n}\n\n/**\n * Get partial selected blocks with their content updated\n * based on the selection.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object[]} Updated partial selected blocks.\n */\nexport const __unstableGetSelectedBlocksWithPartialSelection = ( state ) => {\n\tconst selectionAnchor = getSelectionStart( state );\n\tconst selectionFocus = getSelectionEnd( state );\n\n\tif ( selectionAnchor.clientId === selectionFocus.clientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\t// Can't split if the selection is not set.\n\tif (\n\t\t! selectionAnchor.attributeKey ||\n\t\t! selectionFocus.attributeKey ||\n\t\ttypeof selectionAnchor.offset === 'undefined' ||\n\t\ttypeof selectionFocus.offset === 'undefined'\n\t) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst anchorRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionAnchor.clientId\n\t);\n\tconst focusRootClientId = getBlockRootClientId(\n\t\tstate,\n\t\tselectionFocus.clientId\n\t);\n\n\t// It's not splittable if the selection doesn't start and end in the same\n\t// block list. Maybe in the future it should be allowed.\n\tif ( anchorRootClientId !== focusRootClientId ) {\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\tconst blockOrder = getBlockOrder( state, anchorRootClientId );\n\tconst anchorIndex = blockOrder.indexOf( selectionAnchor.clientId );\n\tconst focusIndex = blockOrder.indexOf( selectionFocus.clientId );\n\n\t// Reassign selection start and end based on order.\n\tconst [ selectionStart, selectionEnd ] =\n\t\tanchorIndex > focusIndex\n\t\t\t? [ selectionFocus, selectionAnchor ]\n\t\t\t: [ selectionAnchor, selectionFocus ];\n\n\tconst blockA = getBlock( state, selectionStart.clientId );\n\tconst blockB = getBlock( state, selectionEnd.clientId );\n\n\tconst htmlA = blockA.attributes[ selectionStart.attributeKey ];\n\tconst htmlB = blockB.attributes[ selectionEnd.attributeKey ];\n\n\tlet valueA = create( { html: htmlA } );\n\tlet valueB = create( { html: htmlB } );\n\n\tvalueA = remove( valueA, 0, selectionStart.offset );\n\tvalueB = remove( valueB, selectionEnd.offset, valueB.text.length );\n\n\treturn [\n\t\t{\n\t\t\t...blockA,\n\t\t\tattributes: {\n\t\t\t\t...blockA.attributes,\n\t\t\t\t[ selectionStart.attributeKey ]: toHTMLString( {\n\t\t\t\t\tvalue: valueA,\n\t\t\t\t} ),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...blockB,\n\t\t\tattributes: {\n\t\t\t\t...blockB.attributes,\n\t\t\t\t[ selectionEnd.attributeKey ]: toHTMLString( {\n\t\t\t\t\tvalue: valueB,\n\t\t\t\t} ),\n\t\t\t},\n\t\t},\n\t];\n};\n\n/**\n * Returns an array containing all block client IDs in the editor in the order\n * they appear. Optionally accepts a root client ID of the block list for which\n * the order should be returned, defaulting to the top-level block order.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Array} Ordered client IDs of editor blocks.\n */\nexport function getBlockOrder( state, rootClientId ) {\n\treturn state.blocks.order.get( rootClientId || '' ) || EMPTY_ARRAY;\n}\n\n/**\n * Returns the index at which the block corresponding to the specified client\n * ID occurs within the block order, or `-1` if the block does not exist.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {number} Index at which block exists in order.\n */\nexport function getBlockIndex( state, clientId ) {\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\treturn getBlockOrder( state, rootClientId ).indexOf( clientId );\n}\n\n/**\n * Returns true if the block corresponding to the specified client ID is\n * currently selected and no multi-selection exists, or false otherwise.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is selected and multi-selection exists.\n */\nexport function isBlockSelected( state, clientId ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\n\tif ( selectionStart.clientId !== selectionEnd.clientId ) {\n\t\treturn false;\n\t}\n\n\treturn selectionStart.clientId === clientId;\n}\n\n/**\n * Returns true if one of the block's inner blocks is selected.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n * @param {boolean} deep Perform a deep check.\n *\n * @return {boolean} Whether the block has an inner block selected\n */\nexport function hasSelectedInnerBlock( state, clientId, deep = false ) {\n\tconst selectedBlockClientIds = getSelectedBlockClientIds( state );\n\n\tif ( ! selectedBlockClientIds.length ) {\n\t\treturn false;\n\t}\n\n\tif ( deep ) {\n\t\treturn selectedBlockClientIds.some( ( id ) =>\n\t\t\t// Pass true because we don't care about order and it's more\n\t\t\t// performant.\n\t\t\tgetBlockParents( state, id, true ).includes( clientId )\n\t\t);\n\t}\n\n\treturn selectedBlockClientIds.some(\n\t\t( id ) => getBlockRootClientId( state, id ) === clientId\n\t);\n}\n\n/**\n * Returns true if one of the block's inner blocks is dragged.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n * @param {boolean} deep Perform a deep check.\n *\n * @return {boolean} Whether the block has an inner block dragged\n */\nexport function hasDraggedInnerBlock( state, clientId, deep = false ) {\n\treturn getBlockOrder( state, clientId ).some(\n\t\t( innerClientId ) =>\n\t\t\tisBlockBeingDragged( state, innerClientId ) ||\n\t\t\t( deep && hasDraggedInnerBlock( state, innerClientId, deep ) )\n\t);\n}\n\n/**\n * Returns true if the block corresponding to the specified client ID is\n * currently selected but isn't the last of the selected blocks. Here \"last\"\n * refers to the block sequence in the document, _not_ the sequence of\n * multi-selection, which is why `state.selectionEnd` isn't used.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {boolean} Whether block is selected and not the last in the\n * selection.\n */\nexport function isBlockWithinSelection( state, clientId ) {\n\tif ( ! clientId ) {\n\t\treturn false;\n\t}\n\n\tconst clientIds = getMultiSelectedBlockClientIds( state );\n\tconst index = clientIds.indexOf( clientId );\n\treturn index > -1 && index < clientIds.length - 1;\n}\n\n/**\n * Returns true if a multi-selection has been made, or false otherwise.\n *\n * @param {Object} state Editor state.\n *\n * @return {boolean} Whether multi-selection has been made.\n */\nexport function hasMultiSelection( state ) {\n\tconst { selectionStart, selectionEnd } = state.selection;\n\treturn selectionStart.clientId !== selectionEnd.clientId;\n}\n\n/**\n * Whether in the process of multi-selecting or not. This flag is only true\n * while the multi-selection is being selected (by mouse move), and is false\n * once the multi-selection has been settled.\n *\n * @see hasMultiSelection\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if multi-selecting, false if not.\n */\nexport function isMultiSelecting( state ) {\n\treturn state.isMultiSelecting;\n}\n\n/**\n * Selector that returns if multi-selection is enabled or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled.\n */\nexport function isSelectionEnabled( state ) {\n\treturn state.isSelectionEnabled;\n}\n\n/**\n * Returns the block's editing mode, defaulting to \"visual\" if not explicitly\n * assigned.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId Block client ID.\n *\n * @return {Object} Block editing mode.\n */\nexport function getBlockMode( state, clientId ) {\n\treturn state.blocksMode[ clientId ] || 'visual';\n}\n\n/**\n * Returns true if the user is typing, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is typing.\n */\nexport function isTyping( state ) {\n\treturn state.isTyping;\n}\n\n/**\n * Returns true if the user is dragging blocks, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging blocks.\n */\nexport function isDraggingBlocks( state ) {\n\treturn !! state.draggedBlocks.length;\n}\n\n/**\n * Returns the client ids of any blocks being directly dragged.\n *\n * This does not include children of a parent being dragged.\n *\n * @param {Object} state Global application state.\n *\n * @return {string[]} Array of dragged block client ids.\n */\nexport function getDraggedBlockClientIds( state ) {\n\treturn state.draggedBlocks;\n}\n\n/**\n * Returns whether the block is being dragged.\n *\n * Only returns true if the block is being directly dragged,\n * not if the block is a child of a parent being dragged.\n * See `isAncestorBeingDragged` for child blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client id for block to check.\n *\n * @return {boolean} Whether the block is being dragged.\n */\nexport function isBlockBeingDragged( state, clientId ) {\n\treturn state.draggedBlocks.includes( clientId );\n}\n\n/**\n * Returns whether a parent/ancestor of the block is being dragged.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client id for block to check.\n *\n * @return {boolean} Whether the block's ancestor is being dragged.\n */\nexport function isAncestorBeingDragged( state, clientId ) {\n\t// Return early if no blocks are being dragged rather than\n\t// the more expensive check for parents.\n\tif ( ! isDraggingBlocks( state ) ) {\n\t\treturn false;\n\t}\n\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentClientId ) =>\n\t\tisBlockBeingDragged( state, parentClientId )\n\t);\n}\n\n/**\n * Returns true if the caret is within formatted text, or false otherwise.\n *\n * @deprecated\n *\n * @return {boolean} Whether the caret is within formatted text.\n */\nexport function isCaretWithinFormattedText() {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).isCaretWithinFormattedText',\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t}\n\t);\n\n\treturn false;\n}\n\n/**\n * Returns the location of the insertion cue. Defaults to the last index.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} Insertion point object with `rootClientId`, `index`.\n */\nexport const getBlockInsertionPoint = createSelector(\n\t( state ) => {\n\t\tlet rootClientId, index;\n\n\t\tconst {\n\t\t\tinsertionCue,\n\t\t\tselection: { selectionEnd },\n\t\t} = state;\n\t\tif ( insertionCue !== null ) {\n\t\t\treturn insertionCue;\n\t\t}\n\n\t\tconst { clientId } = selectionEnd;\n\n\t\tif ( clientId ) {\n\t\t\trootClientId = getBlockRootClientId( state, clientId ) || undefined;\n\t\t\tindex = getBlockIndex( state, selectionEnd.clientId ) + 1;\n\t\t} else {\n\t\t\tindex = getBlockOrder( state ).length;\n\t\t}\n\n\t\treturn { rootClientId, index };\n\t},\n\t( state ) => [\n\t\tstate.insertionCue,\n\t\tstate.selection.selectionEnd.clientId,\n\t\tstate.blocks.parents,\n\t\tstate.blocks.order,\n\t]\n);\n\n/**\n * Returns true if the block insertion point is visible.\n *\n * @param {Object} state Global application state.\n *\n * @return {?boolean} Whether the insertion point is visible or not.\n */\nexport function isBlockInsertionPointVisible( state ) {\n\treturn state.insertionCue !== null;\n}\n\n/**\n * Returns whether the blocks matches the template or not.\n *\n * @param {boolean} state\n * @return {?boolean} Whether the template is valid or not.\n */\nexport function isValidTemplate( state ) {\n\treturn state.template.isValid;\n}\n\n/**\n * Returns the defined block template\n *\n * @param {boolean} state\n *\n * @return {?Array} Block Template.\n */\nexport function getTemplate( state ) {\n\treturn state.settings.template;\n}\n\n/**\n * Returns the defined block template lock. Optionally accepts a root block\n * client ID as context, otherwise defaulting to the global context.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional block root client ID.\n *\n * @return {string|false} Block Template Lock\n */\nexport function getTemplateLock( state, rootClientId ) {\n\tif ( ! rootClientId ) {\n\t\treturn state.settings.templateLock ?? false;\n\t}\n\n\treturn getBlockListSettings( state, rootClientId )?.templateLock ?? false;\n}\n\n/**\n * Determines if the given block type is visible in the inserter.\n * Note that this is different than whether a block is allowed to be inserted.\n * In some cases, the block is not allowed in a given position but\n * it should still be visible in the inserter to be able to add it\n * to a different position.\n *\n * @param {Object} state Editor state.\n * @param {string|Object} blockNameOrType The block type object, e.g., the response\n * from the block directory; or a string name of\n * an installed block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nconst isBlockVisibleInTheInserter = (\n\tstate,\n\tblockNameOrType,\n\trootClientId = null\n) => {\n\tlet blockType;\n\tlet blockName;\n\n\tif ( blockNameOrType && 'object' === typeof blockNameOrType ) {\n\t\tblockType = blockNameOrType;\n\t\tblockName = blockNameOrType.name;\n\t} else {\n\t\tblockType = getBlockType( blockNameOrType );\n\t\tblockName = blockNameOrType;\n\t}\n\n\tif ( ! blockType ) {\n\t\treturn false;\n\t}\n\n\tconst { allowedBlockTypes } = getSettings( state );\n\n\tconst isBlockAllowedInEditor = checkAllowList(\n\t\tallowedBlockTypes,\n\t\tblockName,\n\t\ttrue\n\t);\n\tif ( ! isBlockAllowedInEditor ) {\n\t\treturn false;\n\t}\n\n\t// If parent blocks are not visible, child blocks should be hidden too.\n\tconst parents = (\n\t\tArray.isArray( blockType.parent ) ? blockType.parent : []\n\t).concat( Array.isArray( blockType.ancestor ) ? blockType.ancestor : [] );\n\tif ( parents.length > 0 ) {\n\t\t// This is an exception to the rule that says that all blocks are visible in the inserter.\n\t\t// Blocks that require a given parent or ancestor are only visible if we're within that parent.\n\t\tif ( parents.includes( 'core/post-content' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet current = rootClientId;\n\t\tlet hasParent = false;\n\t\tdo {\n\t\t\tif ( parents.includes( getBlockName( state, current ) ) ) {\n\t\t\t\thasParent = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent = state.blocks.parents.get( current );\n\t\t} while ( current );\n\n\t\treturn hasParent;\n\t}\n\n\treturn true;\n};\n\n/**\n * Determines if the given block type is allowed to be inserted into the block list.\n * This function is not exported and not memoized because using a memoized selector\n * inside another memoized selector is just a waste of time.\n *\n * @param {Object} state Editor state.\n * @param {string|Object} blockName The block type object, e.g., the response\n * from the block directory; or a string name of\n * an installed block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nconst canInsertBlockTypeUnmemoized = (\n\tstate,\n\tblockName,\n\trootClientId = null\n) => {\n\tif ( ! isBlockVisibleInTheInserter( state, blockName, rootClientId ) ) {\n\t\treturn false;\n\t}\n\n\tlet blockType;\n\tif ( blockName && 'object' === typeof blockName ) {\n\t\tblockType = blockName;\n\t\tblockName = blockType.name;\n\t} else {\n\t\tblockType = getBlockType( blockName );\n\t}\n\n\tif ( getTemplateLock( state, rootClientId ) ) {\n\t\treturn false;\n\t}\n\n\tconst blockEditingMode = getBlockEditingMode( state, rootClientId ?? '' );\n\tif ( blockEditingMode === 'disabled' ) {\n\t\treturn false;\n\t}\n\n\tconst parentBlockListSettings = getBlockListSettings( state, rootClientId );\n\n\t// The parent block doesn't have settings indicating it doesn't support\n\t// inner blocks, return false.\n\tif ( rootClientId && parentBlockListSettings === undefined ) {\n\t\treturn false;\n\t}\n\n\t// It shouldn't be possible to insert inside a section block unless in\n\t// some cases when the block is a content block.\n\tconst isContentRoleBlock = isContentBlock( blockName );\n\tconst isParentSectionBlock = !! isSectionBlock( state, rootClientId );\n\tconst isBlockWithinSection = !! getParentSectionBlock(\n\t\tstate,\n\t\trootClientId\n\t);\n\tif (\n\t\t( isParentSectionBlock || isBlockWithinSection ) &&\n\t\t! isContentRoleBlock\n\t) {\n\t\treturn false;\n\t}\n\n\t// In content only mode, check if this container allows insertion.\n\tif (\n\t\t( isParentSectionBlock || blockEditingMode === 'contentOnly' ) &&\n\t\t! isContainerInsertableToInContentOnlyMode(\n\t\t\tstate,\n\t\t\tblockName,\n\t\t\trootClientId\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\tconst parentName = getBlockName( state, rootClientId );\n\n\tconst parentBlockType = getBlockType( parentName );\n\n\t// Look at the `blockType.allowedBlocks` field to determine whether this is an allowed child block.\n\tconst parentAllowedChildBlocks = parentBlockType?.allowedBlocks;\n\n\tlet hasParentAllowedBlock = checkAllowList(\n\t\tparentAllowedChildBlocks,\n\t\tblockName\n\t);\n\n\t// The `allowedBlocks` block list setting can further limit which blocks are allowed children.\n\tif ( hasParentAllowedBlock !== false ) {\n\t\tconst parentAllowedBlocks = parentBlockListSettings?.allowedBlocks;\n\t\tconst hasParentListAllowedBlock = checkAllowList(\n\t\t\tparentAllowedBlocks,\n\t\t\tblockName\n\t\t);\n\t\t// Never downgrade the result from `true` to `null`\n\t\tif ( hasParentListAllowedBlock !== null ) {\n\t\t\thasParentAllowedBlock = hasParentListAllowedBlock;\n\t\t}\n\t}\n\n\tconst blockAllowedParentBlocks = blockType.parent;\n\tconst hasBlockAllowedParent = checkAllowList(\n\t\tblockAllowedParentBlocks,\n\t\tparentName\n\t);\n\n\tlet hasBlockAllowedAncestor = true;\n\tconst blockAllowedAncestorBlocks = blockType.ancestor;\n\tif ( blockAllowedAncestorBlocks ) {\n\t\tconst ancestors = [\n\t\t\trootClientId,\n\t\t\t...getBlockParents( state, rootClientId ),\n\t\t];\n\n\t\thasBlockAllowedAncestor = ancestors.some( ( ancestorClientId ) =>\n\t\t\tcheckAllowList(\n\t\t\t\tblockAllowedAncestorBlocks,\n\t\t\t\tgetBlockName( state, ancestorClientId )\n\t\t\t)\n\t\t);\n\t}\n\n\tconst canInsert =\n\t\thasBlockAllowedAncestor &&\n\t\t( ( hasParentAllowedBlock === null &&\n\t\t\thasBlockAllowedParent === null ) ||\n\t\t\thasParentAllowedBlock === true ||\n\t\t\thasBlockAllowedParent === true );\n\n\tif ( ! canInsert ) {\n\t\treturn canInsert;\n\t}\n\n\t/**\n\t * This filter is an ad-hoc solution to prevent adding template parts inside post content.\n\t * Conceptually, having a filter inside a selector is bad pattern so this code will be\n\t * replaced by a declarative API that doesn't the following drawbacks:\n\t *\n\t * Filters are not reactive: Upon switching between \"template mode\" and non \"template mode\",\n\t * the filter and selector won't necessarily be executed again. For now, it doesn't matter much\n\t * because you can't switch between the two modes while the inserter stays open.\n\t *\n\t * Filters are global: Once they're defined, they will affect all editor instances and all registries.\n\t * An ideal API would only affect specific editor instances.\n\t */\n\treturn applyFilters(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\tcanInsert,\n\t\tblockType,\n\t\trootClientId,\n\t\t{\n\t\t\t// Pass bound selectors of the current registry. If we're in a nested\n\t\t\t// context, the data will differ from the one selected from the root\n\t\t\t// registry.\n\t\t\tgetBlock: getBlock.bind( null, state ),\n\t\t\tgetBlockParentsByBlockName: getBlockParentsByBlockName.bind(\n\t\t\t\tnull,\n\t\t\t\tstate\n\t\t\t),\n\t\t}\n\t);\n};\n\n/**\n * Determines if the given block type is allowed to be inserted into the block list.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The name of the block type, e.g.' core/paragraph'.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be inserted.\n */\nexport const canInsertBlockType = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\tcanInsertBlockTypeUnmemoized,\n\t\t( state, blockName, rootClientId ) =>\n\t\t\tgetInsertBlockTypeDependants( select )( state, rootClientId )\n\t)\n);\n\n/**\n * Determines if the given blocks are allowed to be inserted into the block\n * list.\n *\n * @param {Object} state Editor state.\n * @param {string[]} clientIds The block client IDs to be inserted.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given blocks are allowed to be inserted.\n */\nexport function canInsertBlocks( state, clientIds, rootClientId = null ) {\n\treturn clientIds.every( ( id ) =>\n\t\tcanInsertBlockType( state, getBlockName( state, id ), rootClientId )\n\t);\n}\n\n/**\n * Determines if the given block is allowed to be deleted.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be removed.\n */\nexport function canRemoveBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\tif ( attributes.lock?.remove !== undefined ) {\n\t\treturn ! attributes.lock.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tif ( getTemplateLock( state, rootClientId ) ) {\n\t\treturn false;\n\t}\n\n\t// It shouldn't be possible to move in a section block unless in\n\t// some cases when the block is a content block.\n\tconst isBlockWithinSection = !! getParentSectionBlock( state, clientId );\n\tconst isContentRoleBlock = isContentBlock(\n\t\tgetBlockName( state, clientId )\n\t);\n\tif ( isBlockWithinSection && ! isContentRoleBlock ) {\n\t\treturn false;\n\t}\n\n\tconst isParentSectionBlock = !! isSectionBlock( state, rootClientId );\n\tconst rootBlockEditingMode = getBlockEditingMode( state, rootClientId );\n\t// Check if the parent container allows insertion/removal in contentOnly mode\n\tif (\n\t\t( isParentSectionBlock || rootBlockEditingMode === 'contentOnly' ) &&\n\t\t! isContainerInsertableToInContentOnlyMode(\n\t\t\tstate,\n\t\t\tgetBlockName( state, clientId ),\n\t\t\trootClientId\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn rootBlockEditingMode !== 'disabled';\n}\n\n/**\n * Determines if the given blocks are allowed to be removed.\n *\n * @param {Object} state Editor state.\n * @param {string} clientIds The block client IDs to be removed.\n *\n * @return {boolean} Whether the given blocks are allowed to be removed.\n */\nexport function canRemoveBlocks( state, clientIds ) {\n\treturn clientIds.every( ( clientId ) => canRemoveBlock( state, clientId ) );\n}\n\n/**\n * Determines if the given block is allowed to be moved.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be moved.\n */\nexport function canMoveBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\tif ( attributes.lock?.move !== undefined ) {\n\t\treturn ! attributes.lock.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\tif ( templateLock === 'all' || templateLock === 'contentOnly' ) {\n\t\treturn false;\n\t}\n\n\tconst isBlockWithinSection = !! getParentSectionBlock( state, clientId );\n\tconst isContentRoleBlock = isContentBlock(\n\t\tgetBlockName( state, clientId )\n\t);\n\tif ( isBlockWithinSection && ! isContentRoleBlock ) {\n\t\treturn false;\n\t}\n\n\t// If the parent is a section or is `contentOnly`, then check is the inner block\n\t// should be allowed to move.\n\tconst isParentSectionBlock = !! isSectionBlock( state, rootClientId );\n\tconst rootBlockEditingMode = getBlockEditingMode( state, rootClientId );\n\tif (\n\t\t( isParentSectionBlock || rootBlockEditingMode === 'contentOnly' ) &&\n\t\t! isContainerInsertableToInContentOnlyMode(\n\t\t\tstate,\n\t\t\tgetBlockName( state, clientId ),\n\t\t\trootClientId\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn getBlockEditingMode( state, rootClientId ) !== 'disabled';\n}\n\n/**\n * Determines if the given blocks are allowed to be moved.\n *\n * @param {Object} state Editor state.\n * @param {string} clientIds The block client IDs to be moved.\n *\n * @return {boolean} Whether the given blocks are allowed to be moved.\n */\nexport function canMoveBlocks( state, clientIds ) {\n\treturn clientIds.every( ( clientId ) => canMoveBlock( state, clientId ) );\n}\n\n/**\n * Determines if the given block is allowed to be edited.\n *\n * @param {Object} state Editor state.\n * @param {string} clientId The block client Id.\n *\n * @return {boolean} Whether the given block is allowed to be edited.\n */\nexport function canEditBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes === null ) {\n\t\treturn true;\n\t}\n\n\tconst { lock } = attributes;\n\n\t// When the edit is true, we cannot edit the block.\n\treturn ! lock?.edit;\n}\n\n/**\n * Determines if the given block type can be locked/unlocked by a user.\n *\n * @param {Object} state Editor state.\n * @param {(string|Object)} nameOrType Block name or type object.\n *\n * @return {boolean} Whether a given block type can be locked/unlocked.\n */\nexport function canLockBlockType( state, nameOrType ) {\n\tif ( ! hasBlockSupport( nameOrType, 'lock', true ) ) {\n\t\treturn false;\n\t}\n\n\t// Use block editor settings as the default value.\n\treturn !! state.settings?.canLockBlocks;\n}\n\n/**\n * Returns information about how recently and frequently a block has been inserted.\n *\n * @param {Object} state Global application state.\n * @param {string} id A string which identifies the insert, e.g. 'core/block/12'\n *\n * @return {?{ time: number, count: number }} An object containing `time` which is when the last\n * insert occurred as a UNIX epoch, and `count` which is\n * the number of inserts that have occurred.\n */\nfunction getInsertUsage( state, id ) {\n\treturn state.preferences.insertUsage?.[ id ] ?? null;\n}\n\n/**\n * Returns whether we can show a block type in the inserter\n *\n * @param {Object} state Global State\n * @param {Object} blockType BlockType\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Whether the given block type is allowed to be shown in the inserter.\n */\nconst canIncludeBlockTypeInInserter = ( state, blockType, rootClientId ) => {\n\tif ( ! hasBlockSupport( blockType, 'inserter', true ) ) {\n\t\treturn false;\n\t}\n\n\treturn canInsertBlockTypeUnmemoized( state, blockType.name, rootClientId );\n};\n\n/**\n * Return a function to be used to transform a block variation to an inserter item\n *\n * @param {Object} state Global State\n * @param {Object} item Denormalized inserter item\n * @return {Function} Function to transform a block variation to inserter item\n */\nconst getItemFromVariation = ( state, item ) => ( variation ) => {\n\tconst variationId = `${ item.id }/${ variation.name }`;\n\tconst { time, count = 0 } = getInsertUsage( state, variationId ) || {};\n\treturn {\n\t\t...item,\n\t\tid: variationId,\n\t\ticon: variation.icon || item.icon,\n\t\ttitle: variation.title || item.title,\n\t\tdescription: variation.description || item.description,\n\t\tcategory: variation.category || item.category,\n\t\t// If `example` is explicitly undefined for the variation, the preview will not be shown.\n\t\texample: variation.hasOwnProperty( 'example' )\n\t\t\t? variation.example\n\t\t\t: item.example,\n\t\tinitialAttributes: {\n\t\t\t...item.initialAttributes,\n\t\t\t...variation.attributes,\n\t\t},\n\t\tinnerBlocks: variation.innerBlocks,\n\t\tkeywords: variation.keywords || item.keywords,\n\t\tfrecency: calculateFrecency( time, count ),\n\t};\n};\n\n/**\n * Returns the calculated frecency.\n *\n * 'frecency' is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * @param {number} time When the last insert occurred as a UNIX epoch\n * @param {number} count The number of inserts that have occurred.\n *\n * @return {number} The calculated frecency.\n */\nconst calculateFrecency = ( time, count ) => {\n\tif ( ! time ) {\n\t\treturn count;\n\t}\n\t// The selector is cached, which means Date.now() is the last time that the\n\t// relevant state changed. This suits our needs.\n\tconst duration = Date.now() - time;\n\tswitch ( true ) {\n\t\tcase duration < MILLISECONDS_PER_HOUR:\n\t\t\treturn count * 4;\n\t\tcase duration < MILLISECONDS_PER_DAY:\n\t\t\treturn count * 2;\n\t\tcase duration < MILLISECONDS_PER_WEEK:\n\t\t\treturn count / 2;\n\t\tdefault:\n\t\t\treturn count / 4;\n\t}\n};\n\n/**\n * Returns a function that accepts a block type and builds an item to be shown\n * in a specific context. It's used for building items for Inserter and available\n * block Transforms list.\n *\n * @param {Object} state Editor state.\n * @param {Object} options Options object for handling the building of a block type.\n * @param {string} options.buildScope The scope for which the item is going to be used.\n * @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list).\n */\nconst buildBlockTypeItem =\n\t( state, { buildScope = 'inserter' } ) =>\n\t( blockType ) => {\n\t\tconst id = blockType.name;\n\n\t\tlet isDisabled = false;\n\t\tif ( ! hasBlockSupport( blockType.name, 'multiple', true ) ) {\n\t\t\tisDisabled = getBlocksByClientId(\n\t\t\t\tstate,\n\t\t\t\tgetClientIdsWithDescendants( state )\n\t\t\t).some( ( { name } ) => name === blockType.name );\n\t\t}\n\n\t\tconst { time, count = 0 } = getInsertUsage( state, id ) || {};\n\t\tconst blockItemBase = {\n\t\t\tid,\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\ticon: blockType.icon,\n\t\t\tisDisabled,\n\t\t\tfrecency: calculateFrecency( time, count ),\n\t\t};\n\t\tif ( buildScope === 'transform' ) {\n\t\t\treturn blockItemBase;\n\t\t}\n\n\t\tconst inserterVariations = getBlockVariations(\n\t\t\tblockType.name,\n\t\t\t'inserter'\n\t\t);\n\t\treturn {\n\t\t\t...blockItemBase,\n\t\t\tinitialAttributes: {},\n\t\t\tdescription: blockType.description,\n\t\t\tcategory: blockType.category,\n\t\t\tkeywords: blockType.keywords,\n\t\t\tparent: blockType.parent,\n\t\t\tancestor: blockType.ancestor,\n\t\t\tvariations: inserterVariations,\n\t\t\texample: blockType.example,\n\t\t\tutility: 1, // Deprecated.\n\t\t};\n\t};\n\n/**\n * Determines the items that appear in the inserter. Includes both static\n * items (e.g. a regular block type) and dynamic items (e.g. a reusable block).\n *\n * Each item object contains what's necessary to display a button in the\n * inserter and handle its selection.\n *\n * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * Items are returned ordered descendingly by their 'utility' and 'frecency'.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPEditorInserterItem[]} Items that appear in inserter.\n *\n * @typedef {Object} WPEditorInserterItem\n * @property {string} id Unique identifier for the item.\n * @property {string} name The type of block to create.\n * @property {Object} initialAttributes Attributes to pass to the newly created block.\n * @property {string} title Title of the item, as it appears in the inserter.\n * @property {string} icon Dashicon for the item, as it appears in the inserter.\n * @property {string} category Block category that the item is associated with.\n * @property {string[]} keywords Keywords that can be searched to find this item.\n * @property {boolean} isDisabled Whether or not the user should be prevented from inserting\n * this item.\n * @property {number} frecency Heuristic that combines frequency and recency.\n */\nexport const getInserterItems = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS ) => {\n\t\t\tconst buildReusableBlockInserterItem = ( reusableBlock ) => {\n\t\t\t\tconst icon = ! reusableBlock.wp_pattern_sync_status\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsrc: symbol,\n\t\t\t\t\t\t\tforeground: 'var(--wp-block-synced-color)',\n\t\t\t\t\t }\n\t\t\t\t\t: symbol;\n\t\t\t\tconst userPattern = mapUserPattern( reusableBlock );\n\t\t\t\tconst { time, count = 0 } =\n\t\t\t\t\tgetInsertUsage( state, userPattern.name ) || {};\n\t\t\t\tconst frecency = calculateFrecency( time, count );\n\n\t\t\t\treturn {\n\t\t\t\t\tid: userPattern.name,\n\t\t\t\t\tname: 'core/block',\n\t\t\t\t\tinitialAttributes: { ref: reusableBlock.id },\n\t\t\t\t\ttitle: userPattern.title,\n\t\t\t\t\ticon,\n\t\t\t\t\tcategory: 'reusable',\n\t\t\t\t\tkeywords: [ 'reusable' ],\n\t\t\t\t\tisDisabled: false,\n\t\t\t\t\tutility: 1, // Deprecated.\n\t\t\t\t\tfrecency,\n\t\t\t\t\tcontent: userPattern.content,\n\t\t\t\t\tget blocks() {\n\t\t\t\t\t\treturn getParsedPattern( userPattern ).blocks;\n\t\t\t\t\t},\n\t\t\t\t\tsyncStatus: userPattern.syncStatus,\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tconst patternInserterItems = canInsertBlockTypeUnmemoized(\n\t\t\t\tstate,\n\t\t\t\t'core/block',\n\t\t\t\trootClientId\n\t\t\t)\n\t\t\t\t? unlock( select( STORE_NAME ) )\n\t\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t\t.map( buildReusableBlockInserterItem )\n\t\t\t\t: [];\n\n\t\t\tconst buildBlockTypeInserterItem = buildBlockTypeItem( state, {\n\t\t\t\tbuildScope: 'inserter',\n\t\t\t} );\n\n\t\t\tlet blockTypeInserterItems = getBlockTypes()\n\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\thasBlockSupport( blockType, 'inserter', true )\n\t\t\t\t)\n\t\t\t\t.map( buildBlockTypeInserterItem );\n\n\t\t\tif ( options[ isFiltered ] !== false ) {\n\t\t\t\tblockTypeInserterItems = blockTypeInserterItems.filter(\n\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\tcanIncludeBlockTypeInInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tblockTypeInserterItems = blockTypeInserterItems\n\t\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\t\tisBlockVisibleInTheInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( blockType ) => ( {\n\t\t\t\t\t\t...blockType,\n\t\t\t\t\t\tisAllowedInCurrentRoot: canIncludeBlockTypeInInserter(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t),\n\t\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tconst items = blockTypeInserterItems.reduce(\n\t\t\t\t( accumulator, item ) => {\n\t\t\t\t\tconst { variations = [] } = item;\n\t\t\t\t\t// Exclude any block type item that is to be replaced by a default variation.\n\t\t\t\t\tif ( ! variations.some( ( { isDefault } ) => isDefault ) ) {\n\t\t\t\t\t\taccumulator.push( item );\n\t\t\t\t\t}\n\t\t\t\t\tif ( variations.length ) {\n\t\t\t\t\t\tconst variationMapper = getItemFromVariation(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\titem\n\t\t\t\t\t\t);\n\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t...variations.map( variationMapper )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t[]\n\t\t\t);\n\n\t\t\t// Ensure core blocks are prioritized in the returned results,\n\t\t\t// because third party blocks can be registered earlier than\n\t\t\t// the core blocks (usually by using the `init` action),\n\t\t\t// thus affecting the display order.\n\t\t\t// We don't sort reusable blocks as they are handled differently.\n\t\t\tconst groupByType = ( blocks, block ) => {\n\t\t\t\tconst { core, noncore } = blocks;\n\t\t\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\n\t\t\t\ttype.push( block );\n\t\t\t\treturn blocks;\n\t\t\t};\n\t\t\tconst { core: coreItems, noncore: nonCoreItems } = items.reduce(\n\t\t\t\tgroupByType,\n\t\t\t\t{ core: [], noncore: [] }\n\t\t\t);\n\t\t\tconst sortedBlockTypes = [ ...coreItems, ...nonCoreItems ];\n\t\t\treturn [ ...sortedBlockTypes, ...patternInserterItems ];\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\tstate.blocks.order,\n\t\t\tstate.preferences.insertUsage,\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\n/**\n * Determines the items that appear in the available block transforms list.\n *\n * Each item object contains what's necessary to display a menu item in the\n * transform list and handle its selection.\n *\n * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency)\n * that combines block usage frequency and recency.\n *\n * Items are returned ordered descendingly by their 'frecency'.\n *\n * @param {Object} state Editor state.\n * @param {Object|Object[]} blocks Block object or array objects.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPEditorTransformItem[]} Items that appear in inserter.\n *\n * @typedef {Object} WPEditorTransformItem\n * @property {string} id Unique identifier for the item.\n * @property {string} name The type of block to create.\n * @property {string} title Title of the item, as it appears in the inserter.\n * @property {string} icon Dashicon for the item, as it appears in the inserter.\n * @property {boolean} isDisabled Whether or not the user should be prevented from inserting\n * this item.\n * @property {number} frecency Heuristic that combines frequency and recency.\n */\nexport const getBlockTransformItems = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blocks, rootClientId = null ) => {\n\t\t\tconst normalizedBlocks = Array.isArray( blocks )\n\t\t\t\t? blocks\n\t\t\t\t: [ blocks ];\n\t\t\tconst buildBlockTypeTransformItem = buildBlockTypeItem( state, {\n\t\t\t\tbuildScope: 'transform',\n\t\t\t} );\n\t\t\tconst blockTypeTransformItems = getBlockTypes()\n\t\t\t\t.filter( ( blockType ) =>\n\t\t\t\t\tcanIncludeBlockTypeInInserter(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\tblockType,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( buildBlockTypeTransformItem );\n\n\t\t\tconst itemsByName = Object.fromEntries(\n\t\t\t\tObject.entries( blockTypeTransformItems ).map(\n\t\t\t\t\t( [ , value ] ) => [ value.name, value ]\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tconst possibleTransforms = getPossibleBlockTransformations(\n\t\t\t\tnormalizedBlocks\n\t\t\t).reduce( ( accumulator, block ) => {\n\t\t\t\tif ( itemsByName[ block?.name ] ) {\n\t\t\t\t\taccumulator.push( itemsByName[ block.name ] );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] );\n\t\t\treturn orderBy(\n\t\t\t\tpossibleTransforms,\n\t\t\t\t( block ) => itemsByName[ block.name ].frecency,\n\t\t\t\t'desc'\n\t\t\t);\n\t\t},\n\t\t( state, blocks, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\tstate.preferences.insertUsage,\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\n/**\n * Determines whether there are items to show in the inserter.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {boolean} Items that appear in inserter.\n */\nexport const hasInserterItems = ( state, rootClientId = null ) => {\n\tconst hasBlockType = getBlockTypes().some( ( blockType ) =>\n\t\tcanIncludeBlockTypeInInserter( state, blockType, rootClientId )\n\t);\n\tif ( hasBlockType ) {\n\t\treturn true;\n\t}\n\tconst hasReusableBlock = canInsertBlockTypeUnmemoized(\n\t\tstate,\n\t\t'core/block',\n\t\trootClientId\n\t);\n\n\treturn hasReusableBlock;\n};\n\n/**\n * Returns the list of allowed inserter blocks for inner blocks children.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Array?} The list of allowed block types.\n */\nexport const getAllowedBlocks = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tif ( ! rootClientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blockTypes = getBlockTypes().filter( ( blockType ) =>\n\t\t\t\tcanIncludeBlockTypeInInserter( state, blockType, rootClientId )\n\t\t\t);\n\n\t\t\tconst hasReusableBlock = canInsertBlockTypeUnmemoized(\n\t\t\t\tstate,\n\t\t\t\t'core/block',\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\tif ( hasReusableBlock ) {\n\t\t\t\tblockTypes.push( 'core/block' );\n\t\t\t}\n\n\t\t\treturn blockTypes;\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetBlockTypes(),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const __experimentalGetAllowedBlocks = createSelector(\n\t( state, rootClientId = null ) => {\n\t\tdeprecated(\n\t\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetAllowedBlocks',\n\t\t\t{\n\t\t\t\talternative:\n\t\t\t\t\t'wp.data.select( \"core/block-editor\" ).getAllowedBlocks',\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t}\n\t\t);\n\t\treturn getAllowedBlocks( state, rootClientId );\n\t},\n\t( state, rootClientId ) =>\n\t\tgetAllowedBlocks.getDependants( state, rootClientId )\n);\n\n/**\n * Returns the block to be directly inserted by the block appender.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPDirectInsertBlock|undefined} The block type to be directly inserted.\n *\n * @typedef {Object} WPDirectInsertBlock\n * @property {string} name The type of block.\n * @property {?Object} attributes Attributes to pass to the newly created block.\n * @property {?Array<string>} attributesToCopy Attributes to be copied from adjacent blocks when inserted.\n */\nexport function getDirectInsertBlock( state, rootClientId = null ) {\n\tif ( ! rootClientId ) {\n\t\treturn;\n\t}\n\tconst { defaultBlock, directInsert } =\n\t\tstate.blockListSettings[ rootClientId ] ?? {};\n\tif ( ! defaultBlock || ! directInsert ) {\n\t\treturn;\n\t}\n\n\treturn defaultBlock;\n}\n\nexport function __experimentalGetDirectInsertBlock(\n\tstate,\n\trootClientId = null\n) {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetDirectInsertBlock',\n\t\t{\n\t\t\talternative:\n\t\t\t\t'wp.data.select( \"core/block-editor\" ).getDirectInsertBlock',\n\t\t\tsince: '6.3',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n\treturn getDirectInsertBlock( state, rootClientId );\n}\n\nexport const __experimentalGetParsedPattern = createRegistrySelector(\n\t( select ) => ( state, patternName ) => {\n\t\tconst pattern = unlock( select( STORE_NAME ) ).getPatternBySlug(\n\t\t\tpatternName\n\t\t);\n\t\treturn pattern ? getParsedPattern( pattern ) : null;\n\t}\n);\n\nconst getAllowedPatternsDependants = ( select ) => ( state, rootClientId ) => [\n\t...getAllPatternsDependants( select )( state ),\n\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n];\n\nconst patternsWithParsedBlocks = new WeakMap();\nfunction enhancePatternWithParsedBlocks( pattern ) {\n\tlet enhancedPattern = patternsWithParsedBlocks.get( pattern );\n\tif ( ! enhancedPattern ) {\n\t\tenhancedPattern = {\n\t\t\t...pattern,\n\t\t\tget blocks() {\n\t\t\t\treturn getParsedPattern( pattern ).blocks;\n\t\t\t},\n\t\t};\n\t\tpatternsWithParsedBlocks.set( pattern, enhancedPattern );\n\t}\n\treturn enhancedPattern;\n}\n\n/**\n * Returns the list of allowed patterns for inner blocks children.\n *\n * @param {Object} state Editor state.\n * @param {?string} rootClientId Optional target root client ID.\n *\n * @return {Array?} The list of allowed patterns.\n */\nexport const __experimentalGetAllowedPatterns = createRegistrySelector(\n\t( select ) => {\n\t\treturn createSelector(\n\t\t\t(\n\t\t\t\tstate,\n\t\t\t\trootClientId = null,\n\t\t\t\toptions = DEFAULT_INSERTER_OPTIONS\n\t\t\t) => {\n\t\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\t\tconst patterns = getAllPatterns();\n\t\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\t\tconst parsedPatterns = patterns\n\t\t\t\t\t.filter( ( { inserter = true } ) => !! inserter )\n\t\t\t\t\t.map( enhancePatternWithParsedBlocks );\n\n\t\t\t\tconst availableParsedPatterns = parsedPatterns.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\tcheckAllowListRecursive(\n\t\t\t\t\t\t\tgetGrammar( pattern ),\n\t\t\t\t\t\t\tallowedBlockTypes\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst patternsAllowed = availableParsedPatterns.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\tgetGrammar( pattern ).every( ( { blockName: name } ) =>\n\t\t\t\t\t\t\toptions[ isFiltered ] !== false\n\t\t\t\t\t\t\t\t? canInsertBlockType(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: isBlockVisibleInTheInserter(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\treturn patternsAllowed;\n\t\t\t},\n\t\t\tgetAllowedPatternsDependants( select )\n\t\t);\n\t}\n);\n\n/**\n * Returns the list of patterns based on their declared `blockTypes`\n * and a block's name.\n * Patterns can use `blockTypes` to integrate in work flows like\n * suggesting appropriate patterns in a Placeholder state(during insertion)\n * or blocks transformations.\n *\n * @param {Object} state Editor state.\n * @param {string|string[]} blockNames Block's name or array of block names to find matching patterns.\n * @param {?string} rootClientId Optional target root client ID.\n *\n * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.\n */\nexport const getPatternsByBlockTypes = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, blockNames, rootClientId = null ) => {\n\t\t\tif ( ! blockNames ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst patterns =\n\t\t\t\tselect( STORE_NAME ).__experimentalGetAllowedPatterns(\n\t\t\t\t\trootClientId\n\t\t\t\t);\n\t\t\tconst normalizedBlockNames = Array.isArray( blockNames )\n\t\t\t\t? blockNames\n\t\t\t\t: [ blockNames ];\n\t\t\tconst filteredPatterns = patterns.filter( ( pattern ) =>\n\t\t\t\tpattern?.blockTypes?.some?.( ( blockName ) =>\n\t\t\t\t\tnormalizedBlockNames.includes( blockName )\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( filteredPatterns.length === 0 ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\treturn filteredPatterns;\n\t\t},\n\t\t( state, blockNames, rootClientId ) =>\n\t\t\tgetAllowedPatternsDependants( select )( state, rootClientId )\n\t)\n);\n\nexport const __experimentalGetPatternsByBlockTypes = createRegistrySelector(\n\t( select ) => {\n\t\tdeprecated(\n\t\t\t'wp.data.select( \"core/block-editor\" ).__experimentalGetPatternsByBlockTypes',\n\t\t\t{\n\t\t\t\talternative:\n\t\t\t\t\t'wp.data.select( \"core/block-editor\" ).getPatternsByBlockTypes',\n\t\t\t\tsince: '6.2',\n\t\t\t\tversion: '6.4',\n\t\t\t}\n\t\t);\n\t\treturn select( STORE_NAME ).getPatternsByBlockTypes;\n\t}\n);\n\n/**\n * Determines the items that appear in the available pattern transforms list.\n *\n * For now we only handle blocks without InnerBlocks and take into account\n * the `role` property of blocks' attributes for the transformation.\n *\n * We return the first set of possible eligible block patterns,\n * by checking the `blockTypes` property. We still have to recurse through\n * block pattern's blocks and try to find matches from the selected blocks.\n * Now this happens in the consumer to avoid heavy operations in the selector.\n *\n * @param {Object} state Editor state.\n * @param {Object[]} blocks The selected blocks.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {WPBlockPattern[]} Items that are eligible for a pattern transformation.\n */\nexport const __experimentalGetPatternTransformItems = createRegistrySelector(\n\t( select ) =>\n\t\tcreateSelector(\n\t\t\t( state, blocks, rootClientId = null ) => {\n\t\t\t\tif ( ! blocks ) {\n\t\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * For now we only handle blocks without InnerBlocks and take into account\n\t\t\t\t * the `role` property of blocks' attributes for the transformation.\n\t\t\t\t * Note that the blocks have been retrieved through `getBlock`, which doesn't\n\t\t\t\t * return the inner blocks of an inner block controller, so we still need\n\t\t\t\t * to check for this case too.\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\tblocks.some(\n\t\t\t\t\t\t( { clientId, innerBlocks } ) =>\n\t\t\t\t\t\t\tinnerBlocks.length ||\n\t\t\t\t\t\t\tareInnerBlocksControlled( state, clientId )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t\t}\n\n\t\t\t\t// Create a Set of the selected block names that is used in patterns filtering.\n\t\t\t\tconst selectedBlockNames = Array.from(\n\t\t\t\t\tnew Set( blocks.map( ( { name } ) => name ) )\n\t\t\t\t);\n\t\t\t\t/**\n\t\t\t\t * Here we will return first set of possible eligible block patterns,\n\t\t\t\t * by checking the `blockTypes` property. We still have to recurse through\n\t\t\t\t * block pattern's blocks and try to find matches from the selected blocks.\n\t\t\t\t * Now this happens in the consumer to avoid heavy operations in the selector.\n\t\t\t\t */\n\t\t\t\treturn select( STORE_NAME ).getPatternsByBlockTypes(\n\t\t\t\t\tselectedBlockNames,\n\t\t\t\t\trootClientId\n\t\t\t\t);\n\t\t\t},\n\t\t\t( state, blocks, rootClientId ) =>\n\t\t\t\tgetAllowedPatternsDependants( select )( state, rootClientId )\n\t\t)\n);\n\n/**\n * Returns the Block List settings of a block, if any exist.\n *\n * @param {Object} state Editor state.\n * @param {?string} clientId Block client ID.\n *\n * @return {?Object} Block settings of the block if set.\n */\nexport function getBlockListSettings( state, clientId ) {\n\treturn state.blockListSettings[ clientId ];\n}\n\n/**\n * Returns the editor settings.\n *\n * @param {Object} state Editor state.\n *\n * @return {Object} The editor settings object.\n */\nexport function getSettings( state ) {\n\treturn state.settings;\n}\n\n/**\n * Returns true if the most recent block change is be considered persistent, or\n * false otherwise. A persistent change is one committed by BlockEditorProvider\n * via its `onChange` callback, in addition to `onInput`.\n *\n * @param {Object} state Block editor state.\n *\n * @return {boolean} Whether the most recent block change was persistent.\n */\nexport function isLastBlockChangePersistent( state ) {\n\treturn state.blocks.isPersistentChange;\n}\n\n/**\n * Returns the block list settings for an array of blocks, if any exist.\n *\n * @param {Object} state Editor state.\n * @param {Array} clientIds Block client IDs.\n *\n * @return {Object} An object where the keys are client ids and the values are\n * a block list setting object.\n */\nexport const __experimentalGetBlockListSettingsForBlocks = createSelector(\n\t( state, clientIds = [] ) => {\n\t\treturn clientIds.reduce( ( blockListSettingsForBlocks, clientId ) => {\n\t\t\tif ( ! state.blockListSettings[ clientId ] ) {\n\t\t\t\treturn blockListSettingsForBlocks;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...blockListSettingsForBlocks,\n\t\t\t\t[ clientId ]: state.blockListSettings[ clientId ],\n\t\t\t};\n\t\t}, {} );\n\t},\n\t( state ) => [ state.blockListSettings ]\n);\n\n/**\n * Returns the title of a given reusable block\n *\n * @param {Object} state Global application state.\n * @param {number|string} ref The shared block's ID.\n *\n * @return {string} The reusable block saved title.\n */\nexport const __experimentalGetReusableBlockTitle = createRegistrySelector(\n\t( select ) =>\n\t\tcreateSelector(\n\t\t\t( state, ref ) => {\n\t\t\t\tdeprecated(\n\t\t\t\t\t\"wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle\",\n\t\t\t\t\t{\n\t\t\t\t\t\tsince: '6.6',\n\t\t\t\t\t\tversion: '6.8',\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst reusableBlock = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( block ) => block.id === ref );\n\t\t\t\tif ( ! reusableBlock ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn reusableBlock.title?.raw;\n\t\t\t},\n\t\t\t() => [ unlock( select( STORE_NAME ) ).getReusableBlocks() ]\n\t\t)\n);\n\n/**\n * Returns true if the most recent block change is be considered ignored, or\n * false otherwise. An ignored change is one not to be committed by\n * BlockEditorProvider, neither via `onChange` nor `onInput`.\n *\n * @param {Object} state Block editor state.\n *\n * @return {boolean} Whether the most recent block change was ignored.\n */\nexport function __unstableIsLastBlockChangeIgnored( state ) {\n\t// TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be\n\t// ignored if in-fact they result in a change in blocks state. The current\n\t// need to ignore changes not a result of user interaction should be\n\t// accounted for in the refactoring of reusable blocks as occurring within\n\t// their own separate block editor / state (#7119).\n\treturn state.blocks.isIgnoredChange;\n}\n\n/**\n * Returns the block attributes changed as a result of the last dispatched\n * action.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object<string,Object>} Subsets of block attributes changed, keyed\n * by block client ID.\n */\nexport function __experimentalGetLastBlockAttributeChanges( state ) {\n\treturn state.lastBlockAttributesChange;\n}\n\n/**\n * Returns whether block moving mode is enabled.\n *\n * @deprecated\n */\nexport function hasBlockMovingClientId() {\n\tdeprecated(\n\t\t'wp.data.select( \"core/block-editor\" ).hasBlockMovingClientId',\n\t\t{\n\t\t\tsince: '6.7',\n\t\t\thint: 'Block moving mode feature has been removed',\n\t\t}\n\t);\n\treturn false;\n}\n\n/**\n * Returns true if the last change was an automatic change, false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the last change was automatic.\n */\nexport function didAutomaticChange( state ) {\n\treturn !! state.automaticChangeStatus;\n}\n\n/**\n * Returns true if the current highlighted block matches the block clientId.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block to check.\n *\n * @return {boolean} Whether the block is currently highlighted.\n */\nexport function isBlockHighlighted( state, clientId ) {\n\treturn state.highlightedBlock === clientId;\n}\n\n/**\n * Checks if a given block has controlled inner blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block to check.\n *\n * @return {boolean} True if the block has controlled inner blocks.\n */\nexport function areInnerBlocksControlled( state, clientId ) {\n\treturn !! state.blocks.controlledInnerBlocks[ clientId ];\n}\n\n/**\n * Returns the clientId for the first 'active' block of a given array of block names.\n * A block is 'active' if it (or a child) is the selected block.\n * Returns the first match moving up the DOM from the selected block.\n *\n * @param {Object} state Global application state.\n * @param {string[]} validBlocksNames The names of block types to check for.\n *\n * @return {string} The matching block's clientId.\n */\nexport const __experimentalGetActiveBlockIdByBlockNames = createSelector(\n\t( state, validBlockNames ) => {\n\t\tif ( ! validBlockNames.length ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Check if selected block is a valid entity area.\n\t\tconst selectedBlockClientId = getSelectedBlockClientId( state );\n\t\tif (\n\t\t\tvalidBlockNames.includes(\n\t\t\t\tgetBlockName( state, selectedBlockClientId )\n\t\t\t)\n\t\t) {\n\t\t\treturn selectedBlockClientId;\n\t\t}\n\t\t// Check if first selected block is a child of a valid entity area.\n\t\tconst multiSelectedBlockClientIds =\n\t\t\tgetMultiSelectedBlockClientIds( state );\n\t\tconst entityAreaParents = getBlockParentsByBlockName(\n\t\t\tstate,\n\t\t\tselectedBlockClientId || multiSelectedBlockClientIds[ 0 ],\n\t\t\tvalidBlockNames\n\t\t);\n\t\tif ( entityAreaParents ) {\n\t\t\t// Last parent closest/most interior.\n\t\t\treturn entityAreaParents[ entityAreaParents.length - 1 ];\n\t\t}\n\t\treturn null;\n\t},\n\t( state, validBlockNames ) => [\n\t\tstate.selection.selectionStart.clientId,\n\t\tstate.selection.selectionEnd.clientId,\n\t\tvalidBlockNames,\n\t]\n);\n\n/**\n * Tells if the block with the passed clientId was just inserted.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n * @param {?string} source Optional insertion source of the block.\n * @return {boolean} True if the block matches the last block inserted from the specified source.\n */\nexport function wasBlockJustInserted( state, clientId, source ) {\n\tconst { lastBlockInserted } = state;\n\treturn (\n\t\tlastBlockInserted.clientIds?.includes( clientId ) &&\n\t\tlastBlockInserted.source === source\n\t);\n}\n\n/**\n * Tells if the block is visible on the canvas or not.\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n * @return {boolean} True if the block is visible.\n */\nexport function isBlockVisible( state, clientId ) {\n\treturn state.blockVisibility?.[ clientId ] ?? true;\n}\n\n/**\n * Returns the currently hovered block.\n *\n * @deprecated\n */\nexport function getHoveredBlockClientId() {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).getHoveredBlockClientId\",\n\t\t{\n\t\t\tsince: '6.9',\n\t\t\tversion: '7.1',\n\t\t}\n\t);\n\treturn undefined;\n}\n\n/**\n * Returns the list of all hidden blocks.\n *\n * @param {Object} state Global application state.\n * @return {[string]} List of hidden blocks.\n */\nexport const __unstableGetVisibleBlocks = createSelector(\n\t( state ) => {\n\t\tconst visibleBlocks = new Set(\n\t\t\tObject.keys( state.blockVisibility ).filter(\n\t\t\t\t( key ) => state.blockVisibility[ key ]\n\t\t\t)\n\t\t);\n\t\tif ( visibleBlocks.size === 0 ) {\n\t\t\treturn EMPTY_SET;\n\t\t}\n\t\treturn visibleBlocks;\n\t},\n\t( state ) => [ state.blockVisibility ]\n);\n\nexport function __unstableHasActiveBlockOverlayActive( state, clientId ) {\n\t// Prevent overlay on blocks with a non-default editing mode. If the mode is\n\t// 'disabled' then the overlay is redundant since the block can't be\n\t// selected. If the mode is 'contentOnly' then the overlay is redundant\n\t// since there will be no controls to interact with once selected.\n\tif ( getBlockEditingMode( state, clientId ) !== 'default' ) {\n\t\treturn false;\n\t}\n\n\t// If the block editing is locked, the block overlay is always active.\n\tif ( ! canEditBlock( state, clientId ) ) {\n\t\treturn true;\n\t}\n\n\t// In zoom-out mode, the block overlay is always active for section level blocks.\n\tif ( isZoomOut( state ) ) {\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif ( sectionRootClientId ) {\n\t\t\tconst sectionClientIds = getBlockOrder(\n\t\t\t\tstate,\n\t\t\t\tsectionRootClientId\n\t\t\t);\n\t\t\tif ( sectionClientIds?.includes( clientId ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if ( clientId && ! getBlockRootClientId( state, clientId ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// In navigation mode, the block overlay is active when the block is not\n\t// selected (and doesn't contain a selected child). The same behavior is\n\t// also enabled in all modes for blocks that have controlled children\n\t// (reusable block, template part, navigation), unless explicitly disabled\n\t// with `supports.__experimentalDisableBlockOverlay`.\n\tconst blockSupportDisable = hasBlockSupport(\n\t\tgetBlockName( state, clientId ),\n\t\t'__experimentalDisableBlockOverlay',\n\t\tfalse\n\t);\n\tconst shouldEnableIfUnselected = blockSupportDisable\n\t\t? false\n\t\t: areInnerBlocksControlled( state, clientId );\n\n\treturn (\n\t\tshouldEnableIfUnselected &&\n\t\t! isBlockSelected( state, clientId ) &&\n\t\t! hasSelectedInnerBlock( state, clientId, true )\n\t);\n}\n\nexport function __unstableIsWithinBlockOverlay( state, clientId ) {\n\tlet parent = state.blocks.parents.get( clientId );\n\twhile ( !! parent ) {\n\t\tif ( __unstableHasActiveBlockOverlayActive( state, parent ) ) {\n\t\t\treturn true;\n\t\t}\n\t\tparent = state.blocks.parents.get( parent );\n\t}\n\treturn false;\n}\n\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Returns the block editing mode for a given block.\n *\n * The mode can be one of three options:\n *\n * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be\n * selected.\n * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the\n * toolbar, the block movers, block settings.\n * - `'default'`: Allows editing the block as normal.\n *\n * Blocks can set a mode using the `useBlockEditingMode` hook.\n *\n * The mode is inherited by all of the block's inner blocks, unless they have\n * their own mode.\n *\n * A template lock can also set a mode. If the template lock is `'contentOnly'`,\n * the block's mode is overridden to `'contentOnly'` if the block has a content\n * role attribute, or `'disabled'` otherwise.\n *\n * @see useBlockEditingMode\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n */\nexport function getBlockEditingMode( state, clientId = '' ) {\n\t// Some selectors that call this provide `null` as the default\n\t// rootClientId, but the default rootClientId is actually `''`.\n\tif ( clientId === null ) {\n\t\tclientId = '';\n\t}\n\n\t// Check if the clientId has an editing mode set in the regular derived map.\n\t// There may be an editing mode set here for synced patterns or in zoomed out\n\t// mode.\n\tif ( state.derivedBlockEditingModes?.has( clientId ) ) {\n\t\treturn state.derivedBlockEditingModes.get( clientId );\n\t}\n\n\t// In normal mode, consider that an explicitly set editing mode takes over.\n\tif ( state.blockEditingModes.has( clientId ) ) {\n\t\treturn state.blockEditingModes.get( clientId );\n\t}\n\n\treturn 'default';\n}\n\n/**\n * Indicates if a block is ungroupable.\n * A block is ungroupable if it is a single grouping block with inner blocks.\n * If a block has an `ungroup` transform, it is also ungroupable, without the\n * requirement of being the default grouping block.\n * Additionally a block can only be ungrouped if it has inner blocks and can\n * be removed.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block. If not passed the selected block's client id will be used.\n * @return {boolean} True if the block is ungroupable.\n */\nexport const isUngroupable = createRegistrySelector(\n\t( select ) =>\n\t\t( state, clientId = '' ) => {\n\t\t\tconst _clientId = clientId || getSelectedBlockClientId( state );\n\t\t\tif ( ! _clientId ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getGroupingBlockName } = select( blocksStore );\n\t\t\tconst block = getBlock( state, _clientId );\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\tconst _isUngroupable =\n\t\t\t\tblock &&\n\t\t\t\t( block.name === groupingBlockName ||\n\t\t\t\t\tgetBlockType( block.name )?.transforms?.ungroup ) &&\n\t\t\t\t!! block.innerBlocks.length;\n\n\t\t\treturn _isUngroupable && canRemoveBlock( state, _clientId );\n\t\t}\n);\n\n/**\n * Indicates if the provided blocks(by client ids) are groupable.\n * We need to have at least one block, have a grouping block name set and\n * be able to remove these blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds Block client ids. If not passed the selected blocks client ids will be used.\n * @return {boolean} True if the blocks are groupable.\n */\nexport const isGroupable = createRegistrySelector(\n\t( select ) =>\n\t\t( state, clientIds = EMPTY_ARRAY ) => {\n\t\t\tconst { getGroupingBlockName } = select( blocksStore );\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\tconst _clientIds = clientIds?.length\n\t\t\t\t? clientIds\n\t\t\t\t: getSelectedBlockClientIds( state );\n\t\t\tconst rootClientId = _clientIds?.length\n\t\t\t\t? getBlockRootClientId( state, _clientIds[ 0 ] )\n\t\t\t\t: undefined;\n\t\t\tconst groupingBlockAvailable = canInsertBlockType(\n\t\t\t\tstate,\n\t\t\t\tgroupingBlockName,\n\t\t\t\trootClientId\n\t\t\t);\n\t\t\tconst _isGroupable = groupingBlockAvailable && _clientIds.length;\n\t\t\treturn _isGroupable && canRemoveBlocks( state, _clientIds );\n\t\t}\n);\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {Object} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const __unstableGetContentLockingParent = ( state, clientId ) => {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent\",\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getContentLockingParent( state, clientId );\n};\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n */\nexport function __unstableGetTemporarilyEditingAsBlocks( state ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks\",\n\t\t{\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getTemporarilyEditingAsBlocks( state );\n}\n\n/**\n * DO-NOT-USE in production.\n * This selector is created for internal/experimental only usage and may be\n * removed anytime without any warning, causing breakage on any plugin or theme invoking it.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n */\nexport function __unstableGetTemporarilyEditingFocusModeToRevert( state ) {\n\tdeprecated(\n\t\t\"wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.7',\n\t\t}\n\t);\n\treturn getTemporarilyEditingFocusModeToRevert( state );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBASO;AACP,qBAAyB;AACzB,mBAA6B;AAC7B,mBAAuB;AACvB,uBAA6C;AAC7C,wBAAuB;AACvB,kBAAuD;AAKvD,mBASO;AACP,qBAAwB;AACxB,uBAA2B;AAC3B,yBAAuB;AAEvB,+BASO;AAEP,MAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAA,WAAkB;AAcrD,MAAM,wBAAwB,OAAO;AACrC,MAAM,uBAAuB,KAAK,OAAO;AACzC,MAAM,wBAAwB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