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: block-editor.js
[52500] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/utils.js
[52501] Fix | Delete
/**
[52502] Fix | Delete
* WordPress dependencies
[52503] Fix | Delete
*/
[52504] Fix | Delete
[52505] Fix | Delete
[52506] Fix | Delete
[52507] Fix | Delete
/**
[52508] Fix | Delete
* Returns the active style from the given className.
[52509] Fix | Delete
*
[52510] Fix | Delete
* @param {Array} styles Block styles.
[52511] Fix | Delete
* @param {string} className Class name
[52512] Fix | Delete
*
[52513] Fix | Delete
* @return {Object?} The active style.
[52514] Fix | Delete
*/
[52515] Fix | Delete
function getActiveStyle(styles, className) {
[52516] Fix | Delete
for (const style of new (external_wp_tokenList_default())(className).values()) {
[52517] Fix | Delete
if (style.indexOf('is-style-') === -1) {
[52518] Fix | Delete
continue;
[52519] Fix | Delete
}
[52520] Fix | Delete
const potentialStyleName = style.substring(9);
[52521] Fix | Delete
const activeStyle = styles?.find(({
[52522] Fix | Delete
name
[52523] Fix | Delete
}) => name === potentialStyleName);
[52524] Fix | Delete
if (activeStyle) {
[52525] Fix | Delete
return activeStyle;
[52526] Fix | Delete
}
[52527] Fix | Delete
}
[52528] Fix | Delete
return getDefaultStyle(styles);
[52529] Fix | Delete
}
[52530] Fix | Delete
[52531] Fix | Delete
/**
[52532] Fix | Delete
* Replaces the active style in the block's className.
[52533] Fix | Delete
*
[52534] Fix | Delete
* @param {string} className Class name.
[52535] Fix | Delete
* @param {Object?} activeStyle The replaced style.
[52536] Fix | Delete
* @param {Object} newStyle The replacing style.
[52537] Fix | Delete
*
[52538] Fix | Delete
* @return {string} The updated className.
[52539] Fix | Delete
*/
[52540] Fix | Delete
function replaceActiveStyle(className, activeStyle, newStyle) {
[52541] Fix | Delete
const list = new (external_wp_tokenList_default())(className);
[52542] Fix | Delete
if (activeStyle) {
[52543] Fix | Delete
list.remove('is-style-' + activeStyle.name);
[52544] Fix | Delete
}
[52545] Fix | Delete
list.add('is-style-' + newStyle.name);
[52546] Fix | Delete
return list.value;
[52547] Fix | Delete
}
[52548] Fix | Delete
[52549] Fix | Delete
/**
[52550] Fix | Delete
* Returns a collection of styles that can be represented on the frontend.
[52551] Fix | Delete
* The function checks a style collection for a default style. If none is found, it adds one to
[52552] Fix | Delete
* act as a fallback for when there is no active style applied to a block. The default item also serves
[52553] Fix | Delete
* as a switch on the frontend to deactivate non-default styles.
[52554] Fix | Delete
*
[52555] Fix | Delete
* @param {Array} styles Block styles.
[52556] Fix | Delete
*
[52557] Fix | Delete
* @return {Array<Object?>} The style collection.
[52558] Fix | Delete
*/
[52559] Fix | Delete
function getRenderedStyles(styles) {
[52560] Fix | Delete
if (!styles || styles.length === 0) {
[52561] Fix | Delete
return [];
[52562] Fix | Delete
}
[52563] Fix | Delete
return getDefaultStyle(styles) ? styles : [{
[52564] Fix | Delete
name: 'default',
[52565] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Default', 'block style'),
[52566] Fix | Delete
isDefault: true
[52567] Fix | Delete
}, ...styles];
[52568] Fix | Delete
}
[52569] Fix | Delete
[52570] Fix | Delete
/**
[52571] Fix | Delete
* Returns a style object from a collection of styles where that style object is the default block style.
[52572] Fix | Delete
*
[52573] Fix | Delete
* @param {Array} styles Block styles.
[52574] Fix | Delete
*
[52575] Fix | Delete
* @return {Object?} The default style object, if found.
[52576] Fix | Delete
*/
[52577] Fix | Delete
function getDefaultStyle(styles) {
[52578] Fix | Delete
return styles?.find(style => style.isDefault);
[52579] Fix | Delete
}
[52580] Fix | Delete
[52581] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/use-styles-for-block.js
[52582] Fix | Delete
/**
[52583] Fix | Delete
* WordPress dependencies
[52584] Fix | Delete
*/
[52585] Fix | Delete
[52586] Fix | Delete
[52587] Fix | Delete
[52588] Fix | Delete
[52589] Fix | Delete
/**
[52590] Fix | Delete
* Internal dependencies
[52591] Fix | Delete
*/
[52592] Fix | Delete
[52593] Fix | Delete
[52594] Fix | Delete
[52595] Fix | Delete
/**
[52596] Fix | Delete
*
[52597] Fix | Delete
* @param {WPBlock} block Block object.
[52598] Fix | Delete
* @param {WPBlockType} type Block type settings.
[52599] Fix | Delete
* @return {WPBlock} A generic block ready for styles preview.
[52600] Fix | Delete
*/
[52601] Fix | Delete
function useGenericPreviewBlock(block, type) {
[52602] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => {
[52603] Fix | Delete
const example = type?.example;
[52604] Fix | Delete
const blockName = type?.name;
[52605] Fix | Delete
if (example && blockName) {
[52606] Fix | Delete
return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, {
[52607] Fix | Delete
attributes: example.attributes,
[52608] Fix | Delete
innerBlocks: example.innerBlocks
[52609] Fix | Delete
});
[52610] Fix | Delete
}
[52611] Fix | Delete
if (block) {
[52612] Fix | Delete
return (0,external_wp_blocks_namespaceObject.cloneBlock)(block);
[52613] Fix | Delete
}
[52614] Fix | Delete
}, [type?.example ? block?.name : block, type]);
[52615] Fix | Delete
}
[52616] Fix | Delete
[52617] Fix | Delete
/**
[52618] Fix | Delete
* @typedef useStylesForBlocksArguments
[52619] Fix | Delete
* @property {string} clientId Block client ID.
[52620] Fix | Delete
* @property {() => void} onSwitch Block style switch callback function.
[52621] Fix | Delete
*/
[52622] Fix | Delete
[52623] Fix | Delete
/**
[52624] Fix | Delete
*
[52625] Fix | Delete
* @param {useStylesForBlocksArguments} useStylesForBlocks arguments.
[52626] Fix | Delete
* @return {Object} Results of the select methods.
[52627] Fix | Delete
*/
[52628] Fix | Delete
function useStylesForBlocks({
[52629] Fix | Delete
clientId,
[52630] Fix | Delete
onSwitch
[52631] Fix | Delete
}) {
[52632] Fix | Delete
const selector = select => {
[52633] Fix | Delete
const {
[52634] Fix | Delete
getBlock
[52635] Fix | Delete
} = select(store);
[52636] Fix | Delete
const block = getBlock(clientId);
[52637] Fix | Delete
if (!block) {
[52638] Fix | Delete
return {};
[52639] Fix | Delete
}
[52640] Fix | Delete
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
[52641] Fix | Delete
const {
[52642] Fix | Delete
getBlockStyles
[52643] Fix | Delete
} = select(external_wp_blocks_namespaceObject.store);
[52644] Fix | Delete
return {
[52645] Fix | Delete
block,
[52646] Fix | Delete
blockType,
[52647] Fix | Delete
styles: getBlockStyles(block.name),
[52648] Fix | Delete
className: block.attributes.className || ''
[52649] Fix | Delete
};
[52650] Fix | Delete
};
[52651] Fix | Delete
const {
[52652] Fix | Delete
styles,
[52653] Fix | Delete
block,
[52654] Fix | Delete
blockType,
[52655] Fix | Delete
className
[52656] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]);
[52657] Fix | Delete
const {
[52658] Fix | Delete
updateBlockAttributes
[52659] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[52660] Fix | Delete
const stylesToRender = getRenderedStyles(styles);
[52661] Fix | Delete
const activeStyle = getActiveStyle(stylesToRender, className);
[52662] Fix | Delete
const genericPreviewBlock = useGenericPreviewBlock(block, blockType);
[52663] Fix | Delete
const onSelect = style => {
[52664] Fix | Delete
const styleClassName = replaceActiveStyle(className, activeStyle, style);
[52665] Fix | Delete
updateBlockAttributes(clientId, {
[52666] Fix | Delete
className: styleClassName
[52667] Fix | Delete
});
[52668] Fix | Delete
onSwitch();
[52669] Fix | Delete
};
[52670] Fix | Delete
return {
[52671] Fix | Delete
onSelect,
[52672] Fix | Delete
stylesToRender,
[52673] Fix | Delete
activeStyle,
[52674] Fix | Delete
genericPreviewBlock,
[52675] Fix | Delete
className
[52676] Fix | Delete
};
[52677] Fix | Delete
}
[52678] Fix | Delete
[52679] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/menu-items.js
[52680] Fix | Delete
/**
[52681] Fix | Delete
* WordPress dependencies
[52682] Fix | Delete
*/
[52683] Fix | Delete
[52684] Fix | Delete
[52685] Fix | Delete
[52686] Fix | Delete
/**
[52687] Fix | Delete
* Internal dependencies
[52688] Fix | Delete
*/
[52689] Fix | Delete
[52690] Fix | Delete
[52691] Fix | Delete
[52692] Fix | Delete
const menu_items_noop = () => {};
[52693] Fix | Delete
function BlockStylesMenuItems({
[52694] Fix | Delete
clientId,
[52695] Fix | Delete
onSwitch = menu_items_noop
[52696] Fix | Delete
}) {
[52697] Fix | Delete
const {
[52698] Fix | Delete
onSelect,
[52699] Fix | Delete
stylesToRender,
[52700] Fix | Delete
activeStyle
[52701] Fix | Delete
} = useStylesForBlocks({
[52702] Fix | Delete
clientId,
[52703] Fix | Delete
onSwitch
[52704] Fix | Delete
});
[52705] Fix | Delete
if (!stylesToRender || stylesToRender.length === 0) {
[52706] Fix | Delete
return null;
[52707] Fix | Delete
}
[52708] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[52709] Fix | Delete
children: stylesToRender.map(style => {
[52710] Fix | Delete
const menuItemText = style.label || style.name;
[52711] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[52712] Fix | Delete
icon: activeStyle.name === style.name ? library_check : null,
[52713] Fix | Delete
onClick: () => onSelect(style),
[52714] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[52715] Fix | Delete
as: "span",
[52716] Fix | Delete
limit: 18,
[52717] Fix | Delete
ellipsizeMode: "tail",
[52718] Fix | Delete
truncate: true,
[52719] Fix | Delete
children: menuItemText
[52720] Fix | Delete
})
[52721] Fix | Delete
}, style.name);
[52722] Fix | Delete
})
[52723] Fix | Delete
});
[52724] Fix | Delete
}
[52725] Fix | Delete
[52726] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js
[52727] Fix | Delete
/**
[52728] Fix | Delete
* WordPress dependencies
[52729] Fix | Delete
*/
[52730] Fix | Delete
[52731] Fix | Delete
[52732] Fix | Delete
[52733] Fix | Delete
/**
[52734] Fix | Delete
* Internal dependencies
[52735] Fix | Delete
*/
[52736] Fix | Delete
[52737] Fix | Delete
[52738] Fix | Delete
function BlockStylesMenu({
[52739] Fix | Delete
hoveredBlock,
[52740] Fix | Delete
onSwitch
[52741] Fix | Delete
}) {
[52742] Fix | Delete
const {
[52743] Fix | Delete
clientId
[52744] Fix | Delete
} = hoveredBlock;
[52745] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
[52746] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Styles'),
[52747] Fix | Delete
className: "block-editor-block-switcher__styles__menugroup",
[52748] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesMenuItems, {
[52749] Fix | Delete
clientId: clientId,
[52750] Fix | Delete
onSwitch: onSwitch
[52751] Fix | Delete
})
[52752] Fix | Delete
});
[52753] Fix | Delete
}
[52754] Fix | Delete
[52755] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js
[52756] Fix | Delete
/**
[52757] Fix | Delete
* WordPress dependencies
[52758] Fix | Delete
*/
[52759] Fix | Delete
[52760] Fix | Delete
[52761] Fix | Delete
/**
[52762] Fix | Delete
* Try to find a matching block by a block's name in a provided
[52763] Fix | Delete
* block. We recurse through InnerBlocks and return the reference
[52764] Fix | Delete
* of the matched block (it could be an InnerBlock).
[52765] Fix | Delete
* If no match is found return nothing.
[52766] Fix | Delete
*
[52767] Fix | Delete
* @param {WPBlock} block The block to try to find a match.
[52768] Fix | Delete
* @param {string} selectedBlockName The block's name to use for matching condition.
[52769] Fix | Delete
* @param {Set} consumedBlocks A set holding the previously matched/consumed blocks.
[52770] Fix | Delete
*
[52771] Fix | Delete
* @return {WPBlock | undefined} The matched block if found or nothing(`undefined`).
[52772] Fix | Delete
*/
[52773] Fix | Delete
const getMatchingBlockByName = (block, selectedBlockName, consumedBlocks = new Set()) => {
[52774] Fix | Delete
const {
[52775] Fix | Delete
clientId,
[52776] Fix | Delete
name,
[52777] Fix | Delete
innerBlocks = []
[52778] Fix | Delete
} = block;
[52779] Fix | Delete
// Check if block has been consumed already.
[52780] Fix | Delete
if (consumedBlocks.has(clientId)) {
[52781] Fix | Delete
return;
[52782] Fix | Delete
}
[52783] Fix | Delete
if (name === selectedBlockName) {
[52784] Fix | Delete
return block;
[52785] Fix | Delete
}
[52786] Fix | Delete
// Try to find a matching block from InnerBlocks recursively.
[52787] Fix | Delete
for (const innerBlock of innerBlocks) {
[52788] Fix | Delete
const match = getMatchingBlockByName(innerBlock, selectedBlockName, consumedBlocks);
[52789] Fix | Delete
if (match) {
[52790] Fix | Delete
return match;
[52791] Fix | Delete
}
[52792] Fix | Delete
}
[52793] Fix | Delete
};
[52794] Fix | Delete
[52795] Fix | Delete
/**
[52796] Fix | Delete
* Find and return the block attributes to retain through
[52797] Fix | Delete
* the transformation, based on Block Type's `role:content`
[52798] Fix | Delete
* attributes. If no `role:content` attributes exist,
[52799] Fix | Delete
* return selected block's attributes.
[52800] Fix | Delete
*
[52801] Fix | Delete
* @param {string} name Block type's namespaced name.
[52802] Fix | Delete
* @param {Object} attributes Selected block's attributes.
[52803] Fix | Delete
* @return {Object} The block's attributes to retain.
[52804] Fix | Delete
*/
[52805] Fix | Delete
const getRetainedBlockAttributes = (name, attributes) => {
[52806] Fix | Delete
const contentAttributes = (0,external_wp_blocks_namespaceObject.__experimentalGetBlockAttributesNamesByRole)(name, 'content');
[52807] Fix | Delete
if (!contentAttributes?.length) {
[52808] Fix | Delete
return attributes;
[52809] Fix | Delete
}
[52810] Fix | Delete
return contentAttributes.reduce((_accumulator, attribute) => {
[52811] Fix | Delete
if (attributes[attribute]) {
[52812] Fix | Delete
_accumulator[attribute] = attributes[attribute];
[52813] Fix | Delete
}
[52814] Fix | Delete
return _accumulator;
[52815] Fix | Delete
}, {});
[52816] Fix | Delete
};
[52817] Fix | Delete
[52818] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js
[52819] Fix | Delete
/**
[52820] Fix | Delete
* WordPress dependencies
[52821] Fix | Delete
*/
[52822] Fix | Delete
[52823] Fix | Delete
[52824] Fix | Delete
[52825] Fix | Delete
/**
[52826] Fix | Delete
* Internal dependencies
[52827] Fix | Delete
*/
[52828] Fix | Delete
[52829] Fix | Delete
[52830] Fix | Delete
/**
[52831] Fix | Delete
* Mutate the matched block's attributes by getting
[52832] Fix | Delete
* which block type's attributes to retain and prioritize
[52833] Fix | Delete
* them in the merging of the attributes.
[52834] Fix | Delete
*
[52835] Fix | Delete
* @param {WPBlock} match The matched block.
[52836] Fix | Delete
* @param {WPBlock} selectedBlock The selected block.
[52837] Fix | Delete
* @return {void}
[52838] Fix | Delete
*/
[52839] Fix | Delete
const transformMatchingBlock = (match, selectedBlock) => {
[52840] Fix | Delete
// Get the block attributes to retain through the transformation.
[52841] Fix | Delete
const retainedBlockAttributes = getRetainedBlockAttributes(selectedBlock.name, selectedBlock.attributes);
[52842] Fix | Delete
match.attributes = {
[52843] Fix | Delete
...match.attributes,
[52844] Fix | Delete
...retainedBlockAttributes
[52845] Fix | Delete
};
[52846] Fix | Delete
};
[52847] Fix | Delete
[52848] Fix | Delete
/**
[52849] Fix | Delete
* By providing the selected blocks and pattern's blocks
[52850] Fix | Delete
* find the matching blocks, transform them and return them.
[52851] Fix | Delete
* If not all selected blocks are matched, return nothing.
[52852] Fix | Delete
*
[52853] Fix | Delete
* @param {WPBlock[]} selectedBlocks The selected blocks.
[52854] Fix | Delete
* @param {WPBlock[]} patternBlocks The pattern's blocks.
[52855] Fix | Delete
* @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched.
[52856] Fix | Delete
*/
[52857] Fix | Delete
const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => {
[52858] Fix | Delete
// Clone Pattern's blocks to produce new clientIds and be able to mutate the matches.
[52859] Fix | Delete
const _patternBlocks = patternBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
[52860] Fix | Delete
/**
[52861] Fix | Delete
* Keep track of the consumed pattern blocks.
[52862] Fix | Delete
* This is needed because we loop the selected blocks
[52863] Fix | Delete
* and for example we may have selected two paragraphs and
[52864] Fix | Delete
* the pattern's blocks could have more `paragraphs`.
[52865] Fix | Delete
*/
[52866] Fix | Delete
const consumedBlocks = new Set();
[52867] Fix | Delete
for (const selectedBlock of selectedBlocks) {
[52868] Fix | Delete
let isMatch = false;
[52869] Fix | Delete
for (const patternBlock of _patternBlocks) {
[52870] Fix | Delete
const match = getMatchingBlockByName(patternBlock, selectedBlock.name, consumedBlocks);
[52871] Fix | Delete
if (!match) {
[52872] Fix | Delete
continue;
[52873] Fix | Delete
}
[52874] Fix | Delete
isMatch = true;
[52875] Fix | Delete
consumedBlocks.add(match.clientId);
[52876] Fix | Delete
// We update (mutate) the matching pattern block.
[52877] Fix | Delete
transformMatchingBlock(match, selectedBlock);
[52878] Fix | Delete
// No need to loop through other pattern's blocks.
[52879] Fix | Delete
break;
[52880] Fix | Delete
}
[52881] Fix | Delete
// Bail eary if a selected block has not been matched.
[52882] Fix | Delete
if (!isMatch) {
[52883] Fix | Delete
return;
[52884] Fix | Delete
}
[52885] Fix | Delete
}
[52886] Fix | Delete
return _patternBlocks;
[52887] Fix | Delete
};
[52888] Fix | Delete
[52889] Fix | Delete
/**
[52890] Fix | Delete
* @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern
[52891] Fix | Delete
*/
[52892] Fix | Delete
[52893] Fix | Delete
/**
[52894] Fix | Delete
* Custom hook that accepts patterns from state and the selected
[52895] Fix | Delete
* blocks and tries to match these with the pattern's blocks.
[52896] Fix | Delete
* If all selected blocks are matched with a Pattern's block,
[52897] Fix | Delete
* we transform them by retaining block's attributes with `role:content`.
[52898] Fix | Delete
* The transformed pattern's blocks are set to a new pattern
[52899] Fix | Delete
* property `transformedBlocks`.
[52900] Fix | Delete
*
[52901] Fix | Delete
* @param {WPBlockPattern[]} patterns Patterns from state.
[52902] Fix | Delete
* @param {WPBlock[]} selectedBlocks The currently selected blocks.
[52903] Fix | Delete
* @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks.
[52904] Fix | Delete
*/
[52905] Fix | Delete
const useTransformedPatterns = (patterns, selectedBlocks) => {
[52906] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => patterns.reduce((accumulator, _pattern) => {
[52907] Fix | Delete
const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks);
[52908] Fix | Delete
if (transformedBlocks) {
[52909] Fix | Delete
accumulator.push({
[52910] Fix | Delete
..._pattern,
[52911] Fix | Delete
transformedBlocks
[52912] Fix | Delete
});
[52913] Fix | Delete
}
[52914] Fix | Delete
return accumulator;
[52915] Fix | Delete
}, []), [patterns, selectedBlocks]);
[52916] Fix | Delete
};
[52917] Fix | Delete
/* harmony default export */ const use_transformed_patterns = (useTransformedPatterns);
[52918] Fix | Delete
[52919] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js
[52920] Fix | Delete
/**
[52921] Fix | Delete
* WordPress dependencies
[52922] Fix | Delete
*/
[52923] Fix | Delete
[52924] Fix | Delete
[52925] Fix | Delete
[52926] Fix | Delete
[52927] Fix | Delete
[52928] Fix | Delete
[52929] Fix | Delete
/**
[52930] Fix | Delete
* Internal dependencies
[52931] Fix | Delete
*/
[52932] Fix | Delete
[52933] Fix | Delete
[52934] Fix | Delete
[52935] Fix | Delete
[52936] Fix | Delete
[52937] Fix | Delete
const {
[52938] Fix | Delete
CompositeV2: pattern_transformations_menu_Composite,
[52939] Fix | Delete
CompositeItemV2: pattern_transformations_menu_CompositeItem,
[52940] Fix | Delete
useCompositeStoreV2: pattern_transformations_menu_useCompositeStore
[52941] Fix | Delete
} = unlock(external_wp_components_namespaceObject.privateApis);
[52942] Fix | Delete
function PatternTransformationsMenu({
[52943] Fix | Delete
blocks,
[52944] Fix | Delete
patterns: statePatterns,
[52945] Fix | Delete
onSelect
[52946] Fix | Delete
}) {
[52947] Fix | Delete
const [showTransforms, setShowTransforms] = (0,external_wp_element_namespaceObject.useState)(false);
[52948] Fix | Delete
const patterns = use_transformed_patterns(statePatterns, blocks);
[52949] Fix | Delete
if (!patterns.length) {
[52950] Fix | Delete
return null;
[52951] Fix | Delete
}
[52952] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
[52953] Fix | Delete
className: "block-editor-block-switcher__pattern__transforms__menugroup",
[52954] Fix | Delete
children: [showTransforms && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewPatternsPopover, {
[52955] Fix | Delete
patterns: patterns,
[52956] Fix | Delete
onSelect: onSelect
[52957] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[52958] Fix | Delete
onClick: event => {
[52959] Fix | Delete
event.preventDefault();
[52960] Fix | Delete
setShowTransforms(!showTransforms);
[52961] Fix | Delete
},
[52962] Fix | Delete
icon: chevron_right,
[52963] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Patterns')
[52964] Fix | Delete
})]
[52965] Fix | Delete
});
[52966] Fix | Delete
}
[52967] Fix | Delete
function PreviewPatternsPopover({
[52968] Fix | Delete
patterns,
[52969] Fix | Delete
onSelect
[52970] Fix | Delete
}) {
[52971] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[52972] Fix | Delete
className: "block-editor-block-switcher__popover__preview__parent",
[52973] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[52974] Fix | Delete
className: "block-editor-block-switcher__popover__preview__container",
[52975] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
[52976] Fix | Delete
className: "block-editor-block-switcher__preview__popover",
[52977] Fix | Delete
position: "bottom right",
[52978] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[52979] Fix | Delete
className: "block-editor-block-switcher__preview is-pattern-list-preview",
[52980] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu_BlockPatternsList, {
[52981] Fix | Delete
patterns: patterns,
[52982] Fix | Delete
onSelect: onSelect
[52983] Fix | Delete
})
[52984] Fix | Delete
})
[52985] Fix | Delete
})
[52986] Fix | Delete
})
[52987] Fix | Delete
});
[52988] Fix | Delete
}
[52989] Fix | Delete
function pattern_transformations_menu_BlockPatternsList({
[52990] Fix | Delete
patterns,
[52991] Fix | Delete
onSelect
[52992] Fix | Delete
}) {
[52993] Fix | Delete
const composite = pattern_transformations_menu_useCompositeStore();
[52994] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu_Composite, {
[52995] Fix | Delete
store: composite,
[52996] Fix | Delete
role: "listbox",
[52997] Fix | Delete
className: "block-editor-block-switcher__preview-patterns-container",
[52998] Fix | Delete
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list'),
[52999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function