Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: blocks.js
const variations = selectors_getBlockVariations(state, blockName, scope);
[8500] Fix | Delete
const defaultVariation = [...variations].reverse().find(({
[8501] Fix | Delete
isDefault
[8502] Fix | Delete
}) => !!isDefault);
[8503] Fix | Delete
return defaultVariation || variations[0];
[8504] Fix | Delete
}
[8505] Fix | Delete
[8506] Fix | Delete
/**
[8507] Fix | Delete
* Returns all the available block categories.
[8508] Fix | Delete
*
[8509] Fix | Delete
* @param {Object} state Data state.
[8510] Fix | Delete
*
[8511] Fix | Delete
* @example
[8512] Fix | Delete
* ```js
[8513] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8514] Fix | Delete
* import { useSelect, } from '@wordpress/data';
[8515] Fix | Delete
*
[8516] Fix | Delete
* const ExampleComponent = () => {
[8517] Fix | Delete
* const blockCategories = useSelect( ( select ) =>
[8518] Fix | Delete
* select( blocksStore ).getCategories(),
[8519] Fix | Delete
* []
[8520] Fix | Delete
* );
[8521] Fix | Delete
*
[8522] Fix | Delete
* return (
[8523] Fix | Delete
* <ul>
[8524] Fix | Delete
* { blockCategories.map( ( category ) => (
[8525] Fix | Delete
* <li key={ category.slug }>{ category.title }</li>
[8526] Fix | Delete
* ) ) }
[8527] Fix | Delete
* </ul>
[8528] Fix | Delete
* );
[8529] Fix | Delete
* };
[8530] Fix | Delete
* ```
[8531] Fix | Delete
*
[8532] Fix | Delete
* @return {WPBlockCategory[]} Categories list.
[8533] Fix | Delete
*/
[8534] Fix | Delete
function getCategories(state) {
[8535] Fix | Delete
return state.categories;
[8536] Fix | Delete
}
[8537] Fix | Delete
[8538] Fix | Delete
/**
[8539] Fix | Delete
* Returns all the available collections.
[8540] Fix | Delete
*
[8541] Fix | Delete
* @param {Object} state Data state.
[8542] Fix | Delete
*
[8543] Fix | Delete
* @example
[8544] Fix | Delete
* ```js
[8545] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8546] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8547] Fix | Delete
*
[8548] Fix | Delete
* const ExampleComponent = () => {
[8549] Fix | Delete
* const blockCollections = useSelect( ( select ) =>
[8550] Fix | Delete
* select( blocksStore ).getCollections(),
[8551] Fix | Delete
* []
[8552] Fix | Delete
* );
[8553] Fix | Delete
*
[8554] Fix | Delete
* return (
[8555] Fix | Delete
* <ul>
[8556] Fix | Delete
* { Object.values( blockCollections ).length > 0 &&
[8557] Fix | Delete
* Object.values( blockCollections ).map( ( collection ) => (
[8558] Fix | Delete
* <li key={ collection.title }>{ collection.title }</li>
[8559] Fix | Delete
* ) ) }
[8560] Fix | Delete
* </ul>
[8561] Fix | Delete
* );
[8562] Fix | Delete
* };
[8563] Fix | Delete
* ```
[8564] Fix | Delete
*
[8565] Fix | Delete
* @return {Object} Collections list.
[8566] Fix | Delete
*/
[8567] Fix | Delete
function getCollections(state) {
[8568] Fix | Delete
return state.collections;
[8569] Fix | Delete
}
[8570] Fix | Delete
[8571] Fix | Delete
/**
[8572] Fix | Delete
* Returns the name of the default block name.
[8573] Fix | Delete
*
[8574] Fix | Delete
* @param {Object} state Data state.
[8575] Fix | Delete
*
[8576] Fix | Delete
* @example
[8577] Fix | Delete
* ```js
[8578] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8579] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8580] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8581] Fix | Delete
*
[8582] Fix | Delete
* const ExampleComponent = () => {
[8583] Fix | Delete
* const defaultBlockName = useSelect( ( select ) =>
[8584] Fix | Delete
* select( blocksStore ).getDefaultBlockName(),
[8585] Fix | Delete
* []
[8586] Fix | Delete
* );
[8587] Fix | Delete
*
[8588] Fix | Delete
* return (
[8589] Fix | Delete
* defaultBlockName && (
[8590] Fix | Delete
* <p>
[8591] Fix | Delete
* { sprintf( __( 'Default block name: %s' ), defaultBlockName ) }
[8592] Fix | Delete
* </p>
[8593] Fix | Delete
* )
[8594] Fix | Delete
* );
[8595] Fix | Delete
* };
[8596] Fix | Delete
* ```
[8597] Fix | Delete
*
[8598] Fix | Delete
* @return {string?} Default block name.
[8599] Fix | Delete
*/
[8600] Fix | Delete
function selectors_getDefaultBlockName(state) {
[8601] Fix | Delete
return state.defaultBlockName;
[8602] Fix | Delete
}
[8603] Fix | Delete
[8604] Fix | Delete
/**
[8605] Fix | Delete
* Returns the name of the block for handling non-block content.
[8606] Fix | Delete
*
[8607] Fix | Delete
* @param {Object} state Data state.
[8608] Fix | Delete
*
[8609] Fix | Delete
* @example
[8610] Fix | Delete
* ```js
[8611] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8612] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8613] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8614] Fix | Delete
*
[8615] Fix | Delete
* const ExampleComponent = () => {
[8616] Fix | Delete
* const freeformFallbackBlockName = useSelect( ( select ) =>
[8617] Fix | Delete
* select( blocksStore ).getFreeformFallbackBlockName(),
[8618] Fix | Delete
* []
[8619] Fix | Delete
* );
[8620] Fix | Delete
*
[8621] Fix | Delete
* return (
[8622] Fix | Delete
* freeformFallbackBlockName && (
[8623] Fix | Delete
* <p>
[8624] Fix | Delete
* { sprintf( __(
[8625] Fix | Delete
* 'Freeform fallback block name: %s' ),
[8626] Fix | Delete
* freeformFallbackBlockName
[8627] Fix | Delete
* ) }
[8628] Fix | Delete
* </p>
[8629] Fix | Delete
* )
[8630] Fix | Delete
* );
[8631] Fix | Delete
* };
[8632] Fix | Delete
* ```
[8633] Fix | Delete
*
[8634] Fix | Delete
* @return {string?} Name of the block for handling non-block content.
[8635] Fix | Delete
*/
[8636] Fix | Delete
function getFreeformFallbackBlockName(state) {
[8637] Fix | Delete
return state.freeformFallbackBlockName;
[8638] Fix | Delete
}
[8639] Fix | Delete
[8640] Fix | Delete
/**
[8641] Fix | Delete
* Returns the name of the block for handling unregistered blocks.
[8642] Fix | Delete
*
[8643] Fix | Delete
* @param {Object} state Data state.
[8644] Fix | Delete
*
[8645] Fix | Delete
* @example
[8646] Fix | Delete
* ```js
[8647] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8648] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8649] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8650] Fix | Delete
*
[8651] Fix | Delete
* const ExampleComponent = () => {
[8652] Fix | Delete
* const unregisteredFallbackBlockName = useSelect( ( select ) =>
[8653] Fix | Delete
* select( blocksStore ).getUnregisteredFallbackBlockName(),
[8654] Fix | Delete
* []
[8655] Fix | Delete
* );
[8656] Fix | Delete
*
[8657] Fix | Delete
* return (
[8658] Fix | Delete
* unregisteredFallbackBlockName && (
[8659] Fix | Delete
* <p>
[8660] Fix | Delete
* { sprintf( __(
[8661] Fix | Delete
* 'Unregistered fallback block name: %s' ),
[8662] Fix | Delete
* unregisteredFallbackBlockName
[8663] Fix | Delete
* ) }
[8664] Fix | Delete
* </p>
[8665] Fix | Delete
* )
[8666] Fix | Delete
* );
[8667] Fix | Delete
* };
[8668] Fix | Delete
* ```
[8669] Fix | Delete
*
[8670] Fix | Delete
* @return {string?} Name of the block for handling unregistered blocks.
[8671] Fix | Delete
*/
[8672] Fix | Delete
function getUnregisteredFallbackBlockName(state) {
[8673] Fix | Delete
return state.unregisteredFallbackBlockName;
[8674] Fix | Delete
}
[8675] Fix | Delete
[8676] Fix | Delete
/**
[8677] Fix | Delete
* Returns the name of the block for handling the grouping of blocks.
[8678] Fix | Delete
*
[8679] Fix | Delete
* @param {Object} state Data state.
[8680] Fix | Delete
*
[8681] Fix | Delete
* @example
[8682] Fix | Delete
* ```js
[8683] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8684] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8685] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8686] Fix | Delete
*
[8687] Fix | Delete
* const ExampleComponent = () => {
[8688] Fix | Delete
* const groupingBlockName = useSelect( ( select ) =>
[8689] Fix | Delete
* select( blocksStore ).getGroupingBlockName(),
[8690] Fix | Delete
* []
[8691] Fix | Delete
* );
[8692] Fix | Delete
*
[8693] Fix | Delete
* return (
[8694] Fix | Delete
* groupingBlockName && (
[8695] Fix | Delete
* <p>
[8696] Fix | Delete
* { sprintf(
[8697] Fix | Delete
* __( 'Default grouping block name: %s' ),
[8698] Fix | Delete
* groupingBlockName
[8699] Fix | Delete
* ) }
[8700] Fix | Delete
* </p>
[8701] Fix | Delete
* )
[8702] Fix | Delete
* );
[8703] Fix | Delete
* };
[8704] Fix | Delete
* ```
[8705] Fix | Delete
*
[8706] Fix | Delete
* @return {string?} Name of the block for handling the grouping of blocks.
[8707] Fix | Delete
*/
[8708] Fix | Delete
function selectors_getGroupingBlockName(state) {
[8709] Fix | Delete
return state.groupingBlockName;
[8710] Fix | Delete
}
[8711] Fix | Delete
[8712] Fix | Delete
/**
[8713] Fix | Delete
* Returns an array with the child blocks of a given block.
[8714] Fix | Delete
*
[8715] Fix | Delete
* @param {Object} state Data state.
[8716] Fix | Delete
* @param {string} blockName Block type name.
[8717] Fix | Delete
*
[8718] Fix | Delete
* @example
[8719] Fix | Delete
* ```js
[8720] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8721] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8722] Fix | Delete
*
[8723] Fix | Delete
* const ExampleComponent = () => {
[8724] Fix | Delete
* const childBlockNames = useSelect( ( select ) =>
[8725] Fix | Delete
* select( blocksStore ).getChildBlockNames( 'core/navigation' ),
[8726] Fix | Delete
* []
[8727] Fix | Delete
* );
[8728] Fix | Delete
*
[8729] Fix | Delete
* return (
[8730] Fix | Delete
* <ul>
[8731] Fix | Delete
* { childBlockNames &&
[8732] Fix | Delete
* childBlockNames.map( ( child ) => (
[8733] Fix | Delete
* <li key={ child }>{ child }</li>
[8734] Fix | Delete
* ) ) }
[8735] Fix | Delete
* </ul>
[8736] Fix | Delete
* );
[8737] Fix | Delete
* };
[8738] Fix | Delete
* ```
[8739] Fix | Delete
*
[8740] Fix | Delete
* @return {Array} Array of child block names.
[8741] Fix | Delete
*/
[8742] Fix | Delete
const selectors_getChildBlockNames = (0,external_wp_data_namespaceObject.createSelector)((state, blockName) => {
[8743] Fix | Delete
return selectors_getBlockTypes(state).filter(blockType => {
[8744] Fix | Delete
return blockType.parent?.includes(blockName);
[8745] Fix | Delete
}).map(({
[8746] Fix | Delete
name
[8747] Fix | Delete
}) => name);
[8748] Fix | Delete
}, state => [state.blockTypes]);
[8749] Fix | Delete
[8750] Fix | Delete
/**
[8751] Fix | Delete
* Returns the block support value for a feature, if defined.
[8752] Fix | Delete
*
[8753] Fix | Delete
* @param {Object} state Data state.
[8754] Fix | Delete
* @param {(string|Object)} nameOrType Block name or type object
[8755] Fix | Delete
* @param {Array|string} feature Feature to retrieve
[8756] Fix | Delete
* @param {*} defaultSupports Default value to return if not
[8757] Fix | Delete
* explicitly defined
[8758] Fix | Delete
*
[8759] Fix | Delete
* @example
[8760] Fix | Delete
* ```js
[8761] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8762] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8763] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8764] Fix | Delete
*
[8765] Fix | Delete
* const ExampleComponent = () => {
[8766] Fix | Delete
* const paragraphBlockSupportValue = useSelect( ( select ) =>
[8767] Fix | Delete
* select( blocksStore ).getBlockSupport( 'core/paragraph', 'anchor' ),
[8768] Fix | Delete
* []
[8769] Fix | Delete
* );
[8770] Fix | Delete
*
[8771] Fix | Delete
* return (
[8772] Fix | Delete
* <p>
[8773] Fix | Delete
* { sprintf(
[8774] Fix | Delete
* __( 'core/paragraph supports.anchor value: %s' ),
[8775] Fix | Delete
* paragraphBlockSupportValue
[8776] Fix | Delete
* ) }
[8777] Fix | Delete
* </p>
[8778] Fix | Delete
* );
[8779] Fix | Delete
* };
[8780] Fix | Delete
* ```
[8781] Fix | Delete
*
[8782] Fix | Delete
* @return {?*} Block support value
[8783] Fix | Delete
*/
[8784] Fix | Delete
const selectors_getBlockSupport = (state, nameOrType, feature, defaultSupports) => {
[8785] Fix | Delete
const blockType = getNormalizedBlockType(state, nameOrType);
[8786] Fix | Delete
if (!blockType?.supports) {
[8787] Fix | Delete
return defaultSupports;
[8788] Fix | Delete
}
[8789] Fix | Delete
return getValueFromObjectPath(blockType.supports, feature, defaultSupports);
[8790] Fix | Delete
};
[8791] Fix | Delete
[8792] Fix | Delete
/**
[8793] Fix | Delete
* Returns true if the block defines support for a feature, or false otherwise.
[8794] Fix | Delete
*
[8795] Fix | Delete
* @param {Object} state Data state.
[8796] Fix | Delete
* @param {(string|Object)} nameOrType Block name or type object.
[8797] Fix | Delete
* @param {string} feature Feature to test.
[8798] Fix | Delete
* @param {boolean} defaultSupports Whether feature is supported by
[8799] Fix | Delete
* default if not explicitly defined.
[8800] Fix | Delete
*
[8801] Fix | Delete
* @example
[8802] Fix | Delete
* ```js
[8803] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8804] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8805] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8806] Fix | Delete
*
[8807] Fix | Delete
* const ExampleComponent = () => {
[8808] Fix | Delete
* const paragraphBlockSupportClassName = useSelect( ( select ) =>
[8809] Fix | Delete
* select( blocksStore ).hasBlockSupport( 'core/paragraph', 'className' ),
[8810] Fix | Delete
* []
[8811] Fix | Delete
* );
[8812] Fix | Delete
*
[8813] Fix | Delete
* return (
[8814] Fix | Delete
* <p>
[8815] Fix | Delete
* { sprintf(
[8816] Fix | Delete
* __( 'core/paragraph supports custom class name?: %s' ),
[8817] Fix | Delete
* paragraphBlockSupportClassName
[8818] Fix | Delete
* ) }
[8819] Fix | Delete
* /p>
[8820] Fix | Delete
* );
[8821] Fix | Delete
* };
[8822] Fix | Delete
* ```
[8823] Fix | Delete
*
[8824] Fix | Delete
* @return {boolean} Whether block supports feature.
[8825] Fix | Delete
*/
[8826] Fix | Delete
function selectors_hasBlockSupport(state, nameOrType, feature, defaultSupports) {
[8827] Fix | Delete
return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports);
[8828] Fix | Delete
}
[8829] Fix | Delete
[8830] Fix | Delete
/**
[8831] Fix | Delete
* Normalizes a search term string: removes accents, converts to lowercase, removes extra whitespace.
[8832] Fix | Delete
*
[8833] Fix | Delete
* @param {string|null|undefined} term Search term to normalize.
[8834] Fix | Delete
* @return {string} Normalized search term.
[8835] Fix | Delete
*/
[8836] Fix | Delete
function getNormalizedSearchTerm(term) {
[8837] Fix | Delete
return remove_accents_default()(term !== null && term !== void 0 ? term : '').toLowerCase().trim();
[8838] Fix | Delete
}
[8839] Fix | Delete
[8840] Fix | Delete
/**
[8841] Fix | Delete
* Returns true if the block type by the given name or object value matches a
[8842] Fix | Delete
* search term, or false otherwise.
[8843] Fix | Delete
*
[8844] Fix | Delete
* @param {Object} state Blocks state.
[8845] Fix | Delete
* @param {(string|Object)} nameOrType Block name or type object.
[8846] Fix | Delete
* @param {string} searchTerm Search term by which to filter.
[8847] Fix | Delete
*
[8848] Fix | Delete
* @example
[8849] Fix | Delete
* ```js
[8850] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8851] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8852] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8853] Fix | Delete
*
[8854] Fix | Delete
* const ExampleComponent = () => {
[8855] Fix | Delete
* const termFound = useSelect(
[8856] Fix | Delete
* ( select ) =>
[8857] Fix | Delete
* select( blocksStore ).isMatchingSearchTerm(
[8858] Fix | Delete
* 'core/navigation',
[8859] Fix | Delete
* 'theme'
[8860] Fix | Delete
* ),
[8861] Fix | Delete
* []
[8862] Fix | Delete
* );
[8863] Fix | Delete
*
[8864] Fix | Delete
* return (
[8865] Fix | Delete
* <p>
[8866] Fix | Delete
* { sprintf(
[8867] Fix | Delete
* __(
[8868] Fix | Delete
* 'Search term was found in the title, keywords, category or description in block.json: %s'
[8869] Fix | Delete
* ),
[8870] Fix | Delete
* termFound
[8871] Fix | Delete
* ) }
[8872] Fix | Delete
* </p>
[8873] Fix | Delete
* );
[8874] Fix | Delete
* };
[8875] Fix | Delete
* ```
[8876] Fix | Delete
*
[8877] Fix | Delete
* @return {Object[]} Whether block type matches search term.
[8878] Fix | Delete
*/
[8879] Fix | Delete
function isMatchingSearchTerm(state, nameOrType, searchTerm = '') {
[8880] Fix | Delete
const blockType = getNormalizedBlockType(state, nameOrType);
[8881] Fix | Delete
const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
[8882] Fix | Delete
const isSearchMatch = candidate => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm);
[8883] Fix | Delete
return isSearchMatch(blockType.title) || blockType.keywords?.some(isSearchMatch) || isSearchMatch(blockType.category) || typeof blockType.description === 'string' && isSearchMatch(blockType.description);
[8884] Fix | Delete
}
[8885] Fix | Delete
[8886] Fix | Delete
/**
[8887] Fix | Delete
* Returns a boolean indicating if a block has child blocks or not.
[8888] Fix | Delete
*
[8889] Fix | Delete
* @param {Object} state Data state.
[8890] Fix | Delete
* @param {string} blockName Block type name.
[8891] Fix | Delete
*
[8892] Fix | Delete
* @example
[8893] Fix | Delete
* ```js
[8894] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8895] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8896] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8897] Fix | Delete
*
[8898] Fix | Delete
* const ExampleComponent = () => {
[8899] Fix | Delete
* const navigationBlockHasChildBlocks = useSelect( ( select ) =>
[8900] Fix | Delete
* select( blocksStore ).hasChildBlocks( 'core/navigation' ),
[8901] Fix | Delete
* []
[8902] Fix | Delete
* );
[8903] Fix | Delete
*
[8904] Fix | Delete
* return (
[8905] Fix | Delete
* <p>
[8906] Fix | Delete
* { sprintf(
[8907] Fix | Delete
* __( 'core/navigation has child blocks: %s' ),
[8908] Fix | Delete
* navigationBlockHasChildBlocks
[8909] Fix | Delete
* ) }
[8910] Fix | Delete
* </p>
[8911] Fix | Delete
* );
[8912] Fix | Delete
* };
[8913] Fix | Delete
* ```
[8914] Fix | Delete
*
[8915] Fix | Delete
* @return {boolean} True if a block contains child blocks and false otherwise.
[8916] Fix | Delete
*/
[8917] Fix | Delete
const selectors_hasChildBlocks = (state, blockName) => {
[8918] Fix | Delete
return selectors_getChildBlockNames(state, blockName).length > 0;
[8919] Fix | Delete
};
[8920] Fix | Delete
[8921] Fix | Delete
/**
[8922] Fix | Delete
* Returns a boolean indicating if a block has at least one child block with inserter support.
[8923] Fix | Delete
*
[8924] Fix | Delete
* @param {Object} state Data state.
[8925] Fix | Delete
* @param {string} blockName Block type name.
[8926] Fix | Delete
*
[8927] Fix | Delete
* @example
[8928] Fix | Delete
* ```js
[8929] Fix | Delete
* import { __, sprintf } from '@wordpress/i18n';
[8930] Fix | Delete
* import { store as blocksStore } from '@wordpress/blocks';
[8931] Fix | Delete
* import { useSelect } from '@wordpress/data';
[8932] Fix | Delete
*
[8933] Fix | Delete
* const ExampleComponent = () => {
[8934] Fix | Delete
* const navigationBlockHasChildBlocksWithInserterSupport = useSelect( ( select ) =>
[8935] Fix | Delete
* select( blocksStore ).hasChildBlocksWithInserterSupport(
[8936] Fix | Delete
* 'core/navigation'
[8937] Fix | Delete
* ),
[8938] Fix | Delete
* []
[8939] Fix | Delete
* );
[8940] Fix | Delete
*
[8941] Fix | Delete
* return (
[8942] Fix | Delete
* <p>
[8943] Fix | Delete
* { sprintf(
[8944] Fix | Delete
* __( 'core/navigation has child blocks with inserter support: %s' ),
[8945] Fix | Delete
* navigationBlockHasChildBlocksWithInserterSupport
[8946] Fix | Delete
* ) }
[8947] Fix | Delete
* </p>
[8948] Fix | Delete
* );
[8949] Fix | Delete
* };
[8950] Fix | Delete
* ```
[8951] Fix | Delete
*
[8952] Fix | Delete
* @return {boolean} True if a block contains at least one child blocks with inserter support
[8953] Fix | Delete
* and false otherwise.
[8954] Fix | Delete
*/
[8955] Fix | Delete
const selectors_hasChildBlocksWithInserterSupport = (state, blockName) => {
[8956] Fix | Delete
return selectors_getChildBlockNames(state, blockName).some(childBlockName => {
[8957] Fix | Delete
return selectors_hasBlockSupport(state, childBlockName, 'inserter', true);
[8958] Fix | Delete
});
[8959] Fix | Delete
};
[8960] Fix | Delete
[8961] Fix | Delete
/**
[8962] Fix | Delete
* DO-NOT-USE in production.
[8963] Fix | Delete
* This selector is created for internal/experimental only usage and may be
[8964] Fix | Delete
* removed anytime without any warning, causing breakage on any plugin or theme invoking it.
[8965] Fix | Delete
*/
[8966] Fix | Delete
const __experimentalHasContentRoleAttribute = (0,external_wp_data_namespaceObject.createSelector)((state, blockTypeName) => {
[8967] Fix | Delete
const blockType = selectors_getBlockType(state, blockTypeName);
[8968] Fix | Delete
if (!blockType) {
[8969] Fix | Delete
return false;
[8970] Fix | Delete
}
[8971] Fix | Delete
return Object.entries(blockType.attributes).some(([, {
[8972] Fix | Delete
__experimentalRole
[8973] Fix | Delete
}]) => __experimentalRole === 'content');
[8974] Fix | Delete
}, (state, blockTypeName) => [state.blockTypes[blockTypeName]?.attributes]);
[8975] Fix | Delete
[8976] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/private-selectors.js
[8977] Fix | Delete
/**
[8978] Fix | Delete
* WordPress dependencies
[8979] Fix | Delete
*/
[8980] Fix | Delete
[8981] Fix | Delete
[8982] Fix | Delete
/**
[8983] Fix | Delete
* Internal dependencies
[8984] Fix | Delete
*/
[8985] Fix | Delete
[8986] Fix | Delete
[8987] Fix | Delete
[8988] Fix | Delete
const ROOT_BLOCK_SUPPORTS = ['background', 'backgroundColor', 'color', 'linkColor', 'captionColor', 'buttonColor', 'headingColor', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'lineHeight', 'padding', 'contentSize', 'wideSize', 'blockGap', 'textDecoration', 'textTransform', 'letterSpacing'];
[8989] Fix | Delete
[8990] Fix | Delete
/**
[8991] Fix | Delete
* Filters the list of supported styles for a given element.
[8992] Fix | Delete
*
[8993] Fix | Delete
* @param {string[]} blockSupports list of supported styles.
[8994] Fix | Delete
* @param {string|undefined} name block name.
[8995] Fix | Delete
* @param {string|undefined} element element name.
[8996] Fix | Delete
*
[8997] Fix | Delete
* @return {string[]} filtered list of supported styles.
[8998] Fix | Delete
*/
[8999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function