@wordpress/block-editor 12.19.3 → 12.19.4
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/build/components/block-edit/context.js +2 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +8 -3
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-preview/index.js +4 -0
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +21 -8
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/index.js +6 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +80 -23
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/link-control/link-preview.js +4 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/rich-text/index.js +45 -25
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-enter.js +3 -0
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/hooks/block-hooks.js +8 -6
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/border.js +6 -4
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +2 -4
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +0 -10
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -8
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -16
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +9 -4
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -5
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +4 -0
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +22 -10
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +82 -24
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +5 -2
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/rich-text/index.js +45 -26
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +3 -0
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/hooks/block-hooks.js +8 -6
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/border.js +7 -5
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +3 -5
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +0 -9
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +47 -14
- package/build-style/style.css +47 -14
- package/package.json +7 -7
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +5 -1
- package/src/components/block-inspector/index.js +7 -5
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-toolbar/style.scss +11 -6
- package/src/components/global-styles/border-panel.js +33 -22
- package/src/components/global-styles/index.js +5 -1
- package/src/components/global-styles/shadow-panel-components.js +92 -23
- package/src/components/global-styles/style.scss +33 -10
- package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
- package/src/components/link-control/link-preview.js +9 -2
- package/src/components/link-control/style.scss +9 -0
- package/src/components/rich-text/index.js +74 -51
- package/src/components/rich-text/use-enter.js +4 -0
- package/src/components/url-popover/style.scss +1 -0
- package/src/hooks/block-hooks.js +10 -5
- package/src/hooks/block-hooks.scss +6 -0
- package/src/hooks/border.js +16 -4
- package/src/hooks/use-bindings-attributes.js +5 -7
- package/src/private-apis.js +2 -0
- package/src/store/private-actions.js +0 -10
- package/src/store/private-selectors.js +0 -8
- package/src/store/reducer.js +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_rememo","_interopRequireDefault","require","_data","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","styleOverrides","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","createRegistrySelector","select","getAllPatterns","__experimentalGetParsedPattern","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","inserter","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","_state$settings$selec","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","userPatterns","userPattern","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","selectBlockPatternsKey","x","index","arr","findIndex","y","getLastFocus","lastFocus","getAllBlockBindingsSources","blockBindingsSources","getBlockBindingsSource","sourceName","isDragging"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n} from './selectors';\nimport { checkAllowListRecursive, getAllPatternsDependants } from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport { selectBlockPatternsKey } from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * @param {Object} state Global application state.\n *\n * @return {Map} A map of style IDs to style overrides.\n */\nexport function getStyleOverrides( state ) {\n\treturn state.styleOverrides;\n}\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns, __experimentalGetParsedPattern } = unlock(\n\t\t\t\tselect( STORE_NAME )\n\t\t\t);\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( { name, inserter = true } ) => {\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst { blocks } = __experimentalGetParsedPattern( name );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( blocks, allowedBlockTypes ) &&\n\t\t\t\t\tblocks.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetAllPatternsDependants( select )( state ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\t// This setting is left for back compat.\n\t\tconst {\n\t\t\t__experimentalBlockPatterns = [],\n\t\t\t__experimentalUserPatternCategories = [],\n\t\t\t__experimentalReusableBlocks = [],\n\t\t} = state.settings;\n\t\tconst userPatterns = ( __experimentalReusableBlocks ?? [] ).map(\n\t\t\t( userPattern ) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: `core/block/${ userPattern.id }`,\n\t\t\t\t\tid: userPattern.id,\n\t\t\t\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\t\t\t\ttitle: userPattern.title.raw,\n\t\t\t\t\tcategories: userPattern.wp_pattern_category.map(\n\t\t\t\t\t\t( catId ) => {\n\t\t\t\t\t\t\tconst category = (\n\t\t\t\t\t\t\t\t__experimentalUserPatternCategories ?? []\n\t\t\t\t\t\t\t).find( ( { id } ) => id === catId );\n\t\t\t\t\t\t\treturn category ? category.slug : catId;\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tcontent: userPattern.content.raw,\n\t\t\t\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\t\treturn [\n\t\t\t...userPatterns,\n\t\t\t...__experimentalBlockPatterns,\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\nexport function getAllBlockBindingsSources( state ) {\n\treturn state.blockBindingsSources;\n}\n\nexport function getBlockBindingsSource( state, sourceName ) {\n\treturn state.blockBindingsSources[ sourceName ];\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AAOA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAEA,IAAAQ,iBAAA,GAAAR,OAAA;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS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,CAAC;EACF,CACD,CAAC;EACD,OAAO,CACN,GAAGf,YAAY,EACf,GAAGH,2BAA2B,EAC9B,KAAAD,qBAAA,GAAK7E,KAAK,CAAC0B,QAAQ,CAAEuE,mCAAsB,CAAE,GAAIjC,MAAO,CAAC,cAAAa,qBAAA,cAAAA,qBAAA,GAAI,EAAE,CAAE,CACjE,CAAC7C,MAAM,CACP,CAAEkE,CAAC,EAAEC,KAAK,EAAEC,GAAG,KACdD,KAAK,KAAKC,GAAG,CAACC,SAAS,CAAIC,CAAC,IAAMJ,CAAC,CAAC9C,IAAI,KAAKkD,CAAC,CAAClD,IAAK,CACtD,CAAC;AACF,CAAC,EAAE,IAAAwB,+BAAwB,EAAEZ,MAAO,CAAE,CACvC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuC,YAAYA,CAAEvG,KAAK,EAAG;EACrC,OAAOA,KAAK,CAACwG,SAAS;AACvB;AAEO,SAASC,0BAA0BA,CAAEzG,KAAK,EAAG;EACnD,OAAOA,KAAK,CAAC0G,oBAAoB;AAClC;AAEO,SAASC,sBAAsBA,CAAE3G,KAAK,EAAE4G,UAAU,EAAG;EAC3D,OAAO5G,KAAK,CAAC0G,oBAAoB,CAAEE,UAAU,CAAE;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAE7G,KAAK,EAAG;EACnC,OAAOA,KAAK,CAAC6G,UAAU;AACxB"}
|
|
1
|
+
{"version":3,"names":["_rememo","_interopRequireDefault","require","_data","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","styleOverrides","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","createRegistrySelector","select","getAllPatterns","__experimentalGetParsedPattern","unlock","STORE_NAME","patterns","allowedBlockTypes","getSettings","inserter","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","_state$settings$selec","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","userPatterns","userPattern","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","selectBlockPatternsKey","x","index","arr","findIndex","y","getLastFocus","lastFocus","isDragging"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n} from './selectors';\nimport { checkAllowListRecursive, getAllPatternsDependants } from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport { selectBlockPatternsKey } from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createSelector(\n\tgetEnabledClientIdsTreeUnmemoized,\n\t( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * @param {Object} state Global application state.\n *\n * @return {Map} A map of style IDs to style overrides.\n */\nexport function getStyleOverrides( state ) {\n\treturn state.styleOverrides;\n}\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns, __experimentalGetParsedPattern } = unlock(\n\t\t\t\tselect( STORE_NAME )\n\t\t\t);\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( { name, inserter = true } ) => {\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst { blocks } = __experimentalGetParsedPattern( name );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( blocks, allowedBlockTypes ) &&\n\t\t\t\t\tblocks.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\tgetAllPatternsDependants( select )( state ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\t// This setting is left for back compat.\n\t\tconst {\n\t\t\t__experimentalBlockPatterns = [],\n\t\t\t__experimentalUserPatternCategories = [],\n\t\t\t__experimentalReusableBlocks = [],\n\t\t} = state.settings;\n\t\tconst userPatterns = ( __experimentalReusableBlocks ?? [] ).map(\n\t\t\t( userPattern ) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: `core/block/${ userPattern.id }`,\n\t\t\t\t\tid: userPattern.id,\n\t\t\t\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\t\t\t\ttitle: userPattern.title.raw,\n\t\t\t\t\tcategories: userPattern.wp_pattern_category.map(\n\t\t\t\t\t\t( catId ) => {\n\t\t\t\t\t\t\tconst category = (\n\t\t\t\t\t\t\t\t__experimentalUserPatternCategories ?? []\n\t\t\t\t\t\t\t).find( ( { id } ) => id === catId );\n\t\t\t\t\t\t\treturn category ? category.slug : catId;\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tcontent: userPattern.content.raw,\n\t\t\t\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\t\treturn [\n\t\t\t...userPatterns,\n\t\t\t...__experimentalBlockPatterns,\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AAOA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAA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,QAAQ,GAAG,CAChBwB,mCAAmC,aAAnCA,mCAAmC,cAAnCA,mCAAmC,GAAI,EAAE,EACxCa,IAAI,CAAE,CAAE;UAAET;QAAG,CAAC,KAAMA,EAAE,KAAKQ,KAAM,CAAC;QACpC,OAAOpC,QAAQ,GAAGA,QAAQ,CAACsC,IAAI,GAAGF,KAAK;MACxC,CACD,CAAC;MACDG,OAAO,EAAEZ,WAAW,CAACY,OAAO,CAACN,GAAG;MAChCO,UAAU,EAAEb,WAAW,CAACc;IACzB,CAAC;EACF,CACD,CAAC;EACD,OAAO,CACN,GAAGf,YAAY,EACf,GAAGH,2BAA2B,EAC9B,KAAAD,qBAAA,GAAK7E,KAAK,CAAC0B,QAAQ,CAAEuE,mCAAsB,CAAE,GAAIjC,MAAO,CAAC,cAAAa,qBAAA,cAAAA,qBAAA,GAAI,EAAE,CAAE,CACjE,CAAC7C,MAAM,CACP,CAAEkE,CAAC,EAAEC,KAAK,EAAEC,GAAG,KACdD,KAAK,KAAKC,GAAG,CAACC,SAAS,CAAIC,CAAC,IAAMJ,CAAC,CAAC9C,IAAI,KAAKkD,CAAC,CAAClD,IAAK,CACtD,CAAC;AACF,CAAC,EAAE,IAAAwB,+BAAwB,EAAEZ,MAAO,CAAE,CACvC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuC,YAAYA,CAAEvG,KAAK,EAAG;EACrC,OAAOA,KAAK,CAACwG,SAAS;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEzG,KAAK,EAAG;EACnC,OAAOA,KAAK,CAACyG,UAAU;AACxB"}
|
package/build/store/reducer.js
CHANGED
|
@@ -1846,20 +1846,6 @@ function lastFocus(state = false, action) {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
return state;
|
|
1848
1848
|
}
|
|
1849
|
-
function blockBindingsSources(state = {}, action) {
|
|
1850
|
-
if (action.type === 'REGISTER_BLOCK_BINDINGS_SOURCE') {
|
|
1851
|
-
var _action$lockAttribute;
|
|
1852
|
-
return {
|
|
1853
|
-
...state,
|
|
1854
|
-
[action.sourceName]: {
|
|
1855
|
-
label: action.sourceLabel,
|
|
1856
|
-
useSource: action.useSource,
|
|
1857
|
-
lockAttributesEditing: (_action$lockAttribute = action.lockAttributesEditing) !== null && _action$lockAttribute !== void 0 ? _action$lockAttribute : true
|
|
1858
|
-
}
|
|
1859
|
-
};
|
|
1860
|
-
}
|
|
1861
|
-
return state;
|
|
1862
|
-
}
|
|
1863
1849
|
const combinedReducers = (0, _data.combineReducers)({
|
|
1864
1850
|
blocks,
|
|
1865
1851
|
isDragging,
|
|
@@ -1890,8 +1876,7 @@ const combinedReducers = (0, _data.combineReducers)({
|
|
|
1890
1876
|
removalPromptData,
|
|
1891
1877
|
blockRemovalRules,
|
|
1892
1878
|
openedBlockSettingsMenu,
|
|
1893
|
-
registeredInserterMediaCategories
|
|
1894
|
-
blockBindingsSources
|
|
1879
|
+
registeredInserterMediaCategories
|
|
1895
1880
|
});
|
|
1896
1881
|
function withAutomaticChangeReset(reducer) {
|
|
1897
1882
|
return (state, action) => {
|