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
[44500] Fix | Delete
const block_preview_EMPTY_ADDITIONAL_STYLES = [];
[44501] Fix | Delete
function BlockPreview({
[44502] Fix | Delete
blocks,
[44503] Fix | Delete
viewportWidth = 1200,
[44504] Fix | Delete
minHeight,
[44505] Fix | Delete
additionalStyles = block_preview_EMPTY_ADDITIONAL_STYLES,
[44506] Fix | Delete
// Deprecated props:
[44507] Fix | Delete
__experimentalMinHeight,
[44508] Fix | Delete
__experimentalPadding
[44509] Fix | Delete
}) {
[44510] Fix | Delete
if (__experimentalMinHeight) {
[44511] Fix | Delete
minHeight = __experimentalMinHeight;
[44512] Fix | Delete
external_wp_deprecated_default()('The __experimentalMinHeight prop', {
[44513] Fix | Delete
since: '6.2',
[44514] Fix | Delete
version: '6.4',
[44515] Fix | Delete
alternative: 'minHeight'
[44516] Fix | Delete
});
[44517] Fix | Delete
}
[44518] Fix | Delete
if (__experimentalPadding) {
[44519] Fix | Delete
additionalStyles = [...additionalStyles, {
[44520] Fix | Delete
css: `body { padding: ${__experimentalPadding}px; }`
[44521] Fix | Delete
}];
[44522] Fix | Delete
external_wp_deprecated_default()('The __experimentalPadding prop of BlockPreview', {
[44523] Fix | Delete
since: '6.2',
[44524] Fix | Delete
version: '6.4',
[44525] Fix | Delete
alternative: 'additionalStyles'
[44526] Fix | Delete
});
[44527] Fix | Delete
}
[44528] Fix | Delete
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
[44529] Fix | Delete
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[44530] Fix | Delete
...originalSettings,
[44531] Fix | Delete
focusMode: false,
[44532] Fix | Delete
// Disable "Spotlight mode".
[44533] Fix | Delete
__unstableIsPreviewMode: true
[44534] Fix | Delete
}), [originalSettings]);
[44535] Fix | Delete
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
[44536] Fix | Delete
if (!blocks || blocks.length === 0) {
[44537] Fix | Delete
return null;
[44538] Fix | Delete
}
[44539] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, {
[44540] Fix | Delete
value: renderedBlocks,
[44541] Fix | Delete
settings: settings,
[44542] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AutoBlockPreview, {
[44543] Fix | Delete
viewportWidth: viewportWidth,
[44544] Fix | Delete
minHeight: minHeight,
[44545] Fix | Delete
additionalStyles: additionalStyles
[44546] Fix | Delete
})
[44547] Fix | Delete
});
[44548] Fix | Delete
}
[44549] Fix | Delete
[44550] Fix | Delete
/**
[44551] Fix | Delete
* BlockPreview renders a preview of a block or array of blocks.
[44552] Fix | Delete
*
[44553] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md
[44554] Fix | Delete
*
[44555] Fix | Delete
* @param {Object} preview options for how the preview should be shown
[44556] Fix | Delete
* @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed.
[44557] Fix | Delete
* @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.
[44558] Fix | Delete
*
[44559] Fix | Delete
* @return {Component} The component to be rendered.
[44560] Fix | Delete
*/
[44561] Fix | Delete
/* harmony default export */ const block_preview = ((0,external_wp_element_namespaceObject.memo)(BlockPreview));
[44562] Fix | Delete
[44563] Fix | Delete
/**
[44564] Fix | Delete
* This hook is used to lightly mark an element as a block preview wrapper
[44565] Fix | Delete
* element. Call this hook and pass the returned props to the element to mark as
[44566] Fix | Delete
* a block preview wrapper, automatically rendering inner blocks as children. If
[44567] Fix | Delete
* you define a ref for the element, it is important to pass the ref to this
[44568] Fix | Delete
* hook, which the hook in turn will pass to the component through the props it
[44569] Fix | Delete
* returns. Optionally, you can also pass any other props through this hook, and
[44570] Fix | Delete
* they will be merged and returned.
[44571] Fix | Delete
*
[44572] Fix | Delete
* @param {Object} options Preview options.
[44573] Fix | Delete
* @param {WPBlock[]} options.blocks Block objects.
[44574] Fix | Delete
* @param {Object} options.props Optional. Props to pass to the element. Must contain
[44575] Fix | Delete
* the ref if one is defined.
[44576] Fix | Delete
* @param {Object} options.layout Layout settings to be used in the preview.
[44577] Fix | Delete
*/
[44578] Fix | Delete
function useBlockPreview({
[44579] Fix | Delete
blocks,
[44580] Fix | Delete
props = {},
[44581] Fix | Delete
layout
[44582] Fix | Delete
}) {
[44583] Fix | Delete
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
[44584] Fix | Delete
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[44585] Fix | Delete
...originalSettings,
[44586] Fix | Delete
styles: undefined,
[44587] Fix | Delete
// Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
[44588] Fix | Delete
focusMode: false,
[44589] Fix | Delete
// Disable "Spotlight mode".
[44590] Fix | Delete
__unstableIsPreviewMode: true
[44591] Fix | Delete
}), [originalSettings]);
[44592] Fix | Delete
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
[44593] Fix | Delete
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]);
[44594] Fix | Delete
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
[44595] Fix | Delete
const children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, {
[44596] Fix | Delete
value: renderedBlocks,
[44597] Fix | Delete
settings: settings,
[44598] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, {
[44599] Fix | Delete
renderAppender: false,
[44600] Fix | Delete
layout: layout
[44601] Fix | Delete
})]
[44602] Fix | Delete
});
[44603] Fix | Delete
return {
[44604] Fix | Delete
...props,
[44605] Fix | Delete
ref,
[44606] Fix | Delete
className: dist_clsx(props.className, 'block-editor-block-preview__live-content', 'components-disabled'),
[44607] Fix | Delete
children: blocks?.length ? children : null
[44608] Fix | Delete
};
[44609] Fix | Delete
}
[44610] Fix | Delete
[44611] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js
[44612] Fix | Delete
/**
[44613] Fix | Delete
* WordPress dependencies
[44614] Fix | Delete
*/
[44615] Fix | Delete
[44616] Fix | Delete
[44617] Fix | Delete
[44618] Fix | Delete
[44619] Fix | Delete
/**
[44620] Fix | Delete
* Internal dependencies
[44621] Fix | Delete
*/
[44622] Fix | Delete
[44623] Fix | Delete
[44624] Fix | Delete
[44625] Fix | Delete
[44626] Fix | Delete
function InserterPreviewPanel({
[44627] Fix | Delete
item
[44628] Fix | Delete
}) {
[44629] Fix | Delete
var _example$viewportWidt;
[44630] Fix | Delete
const {
[44631] Fix | Delete
name,
[44632] Fix | Delete
title,
[44633] Fix | Delete
icon,
[44634] Fix | Delete
description,
[44635] Fix | Delete
initialAttributes,
[44636] Fix | Delete
example
[44637] Fix | Delete
} = item;
[44638] Fix | Delete
const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item);
[44639] Fix | Delete
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
[44640] Fix | Delete
if (!example) {
[44641] Fix | Delete
return (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes);
[44642] Fix | Delete
}
[44643] Fix | Delete
return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, {
[44644] Fix | Delete
attributes: {
[44645] Fix | Delete
...example.attributes,
[44646] Fix | Delete
...initialAttributes
[44647] Fix | Delete
},
[44648] Fix | Delete
innerBlocks: example.innerBlocks
[44649] Fix | Delete
});
[44650] Fix | Delete
}, [name, example, initialAttributes]);
[44651] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[44652] Fix | Delete
className: "block-editor-inserter__preview-container",
[44653] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44654] Fix | Delete
className: "block-editor-inserter__preview",
[44655] Fix | Delete
children: isReusable || example ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44656] Fix | Delete
className: "block-editor-inserter__preview-content",
[44657] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, {
[44658] Fix | Delete
blocks: blocks,
[44659] Fix | Delete
viewportWidth: (_example$viewportWidt = example?.viewportWidth) !== null && _example$viewportWidt !== void 0 ? _example$viewportWidt : 500,
[44660] Fix | Delete
additionalStyles: [{
[44661] Fix | Delete
css: 'body { padding: 24px; }'
[44662] Fix | Delete
}]
[44663] Fix | Delete
})
[44664] Fix | Delete
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44665] Fix | Delete
className: "block-editor-inserter__preview-content-missing",
[44666] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('No preview available.')
[44667] Fix | Delete
})
[44668] Fix | Delete
}), !isReusable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_card, {
[44669] Fix | Delete
title: title,
[44670] Fix | Delete
icon: icon,
[44671] Fix | Delete
description: description
[44672] Fix | Delete
})]
[44673] Fix | Delete
});
[44674] Fix | Delete
}
[44675] Fix | Delete
/* harmony default export */ const preview_panel = (InserterPreviewPanel);
[44676] Fix | Delete
[44677] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/item.js
[44678] Fix | Delete
/**
[44679] Fix | Delete
* WordPress dependencies
[44680] Fix | Delete
*/
[44681] Fix | Delete
[44682] Fix | Delete
[44683] Fix | Delete
[44684] Fix | Delete
/**
[44685] Fix | Delete
* Internal dependencies
[44686] Fix | Delete
*/
[44687] Fix | Delete
[44688] Fix | Delete
[44689] Fix | Delete
const {
[44690] Fix | Delete
CompositeItemV2: item_CompositeItem
[44691] Fix | Delete
} = unlock(external_wp_components_namespaceObject.privateApis);
[44692] Fix | Delete
function InserterListboxItem({
[44693] Fix | Delete
isFirst,
[44694] Fix | Delete
as: Component,
[44695] Fix | Delete
children,
[44696] Fix | Delete
...props
[44697] Fix | Delete
}, ref) {
[44698] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(item_CompositeItem, {
[44699] Fix | Delete
ref: ref,
[44700] Fix | Delete
role: "option"
[44701] Fix | Delete
// Use the CompositeItem `accessibleWhenDisabled` prop
[44702] Fix | Delete
// over Button's `isFocusable`. The latter was shown to
[44703] Fix | Delete
// cause an issue with tab order in the inserter list.
[44704] Fix | Delete
,
[44705] Fix | Delete
accessibleWhenDisabled: true,
[44706] Fix | Delete
...props,
[44707] Fix | Delete
render: htmlProps => {
[44708] Fix | Delete
const propsWithTabIndex = {
[44709] Fix | Delete
...htmlProps,
[44710] Fix | Delete
tabIndex: isFirst ? 0 : htmlProps.tabIndex
[44711] Fix | Delete
};
[44712] Fix | Delete
if (Component) {
[44713] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
[44714] Fix | Delete
...propsWithTabIndex,
[44715] Fix | Delete
children: children
[44716] Fix | Delete
});
[44717] Fix | Delete
}
[44718] Fix | Delete
if (typeof children === 'function') {
[44719] Fix | Delete
return children(propsWithTabIndex);
[44720] Fix | Delete
}
[44721] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[44722] Fix | Delete
...propsWithTabIndex,
[44723] Fix | Delete
children: children
[44724] Fix | Delete
});
[44725] Fix | Delete
}
[44726] Fix | Delete
});
[44727] Fix | Delete
}
[44728] Fix | Delete
/* harmony default export */ const inserter_listbox_item = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxItem));
[44729] Fix | Delete
[44730] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drag-handle.js
[44731] Fix | Delete
/**
[44732] Fix | Delete
* WordPress dependencies
[44733] Fix | Delete
*/
[44734] Fix | Delete
[44735] Fix | Delete
[44736] Fix | Delete
const dragHandle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[44737] Fix | Delete
width: "24",
[44738] Fix | Delete
height: "24",
[44739] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[44740] Fix | Delete
viewBox: "0 0 24 24",
[44741] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[44742] Fix | Delete
d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"
[44743] Fix | Delete
})
[44744] Fix | Delete
});
[44745] Fix | Delete
/* harmony default export */ const drag_handle = (dragHandle);
[44746] Fix | Delete
[44747] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js
[44748] Fix | Delete
/**
[44749] Fix | Delete
* WordPress dependencies
[44750] Fix | Delete
*/
[44751] Fix | Delete
[44752] Fix | Delete
[44753] Fix | Delete
[44754] Fix | Delete
[44755] Fix | Delete
/**
[44756] Fix | Delete
* Internal dependencies
[44757] Fix | Delete
*/
[44758] Fix | Delete
[44759] Fix | Delete
[44760] Fix | Delete
[44761] Fix | Delete
function BlockDraggableChip({
[44762] Fix | Delete
count,
[44763] Fix | Delete
icon,
[44764] Fix | Delete
isPattern,
[44765] Fix | Delete
fadeWhenDisabled
[44766] Fix | Delete
}) {
[44767] Fix | Delete
const patternLabel = isPattern && (0,external_wp_i18n_namespaceObject.__)('Pattern');
[44768] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44769] Fix | Delete
className: "block-editor-block-draggable-chip-wrapper",
[44770] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44771] Fix | Delete
className: "block-editor-block-draggable-chip",
[44772] Fix | Delete
"data-testid": "block-draggable-chip",
[44773] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
[44774] Fix | Delete
justify: "center",
[44775] Fix | Delete
className: "block-editor-block-draggable-chip__content",
[44776] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[44777] Fix | Delete
children: icon ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
[44778] Fix | Delete
icon: icon
[44779] Fix | Delete
}) : patternLabel || (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: Number of blocks. */
[44780] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', count), count)
[44781] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[44782] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
[44783] Fix | Delete
icon: drag_handle
[44784] Fix | Delete
})
[44785] Fix | Delete
}), fadeWhenDisabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[44786] Fix | Delete
className: "block-editor-block-draggable-chip__disabled",
[44787] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[44788] Fix | Delete
className: "block-editor-block-draggable-chip__disabled-icon"
[44789] Fix | Delete
})
[44790] Fix | Delete
})]
[44791] Fix | Delete
})
[44792] Fix | Delete
})
[44793] Fix | Delete
});
[44794] Fix | Delete
}
[44795] Fix | Delete
[44796] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js
[44797] Fix | Delete
/**
[44798] Fix | Delete
* WordPress dependencies
[44799] Fix | Delete
*/
[44800] Fix | Delete
[44801] Fix | Delete
[44802] Fix | Delete
[44803] Fix | Delete
[44804] Fix | Delete
/**
[44805] Fix | Delete
* Internal dependencies
[44806] Fix | Delete
*/
[44807] Fix | Delete
[44808] Fix | Delete
[44809] Fix | Delete
[44810] Fix | Delete
[44811] Fix | Delete
[44812] Fix | Delete
const InserterDraggableBlocks = ({
[44813] Fix | Delete
isEnabled,
[44814] Fix | Delete
blocks,
[44815] Fix | Delete
icon,
[44816] Fix | Delete
children,
[44817] Fix | Delete
pattern
[44818] Fix | Delete
}) => {
[44819] Fix | Delete
const transferData = {
[44820] Fix | Delete
type: 'inserter',
[44821] Fix | Delete
blocks
[44822] Fix | Delete
};
[44823] Fix | Delete
const blockTypeIcon = (0,external_wp_data_namespaceObject.useSelect)(select => {
[44824] Fix | Delete
const {
[44825] Fix | Delete
getBlockType
[44826] Fix | Delete
} = select(external_wp_blocks_namespaceObject.store);
[44827] Fix | Delete
return blocks.length === 1 && getBlockType(blocks[0].name)?.icon;
[44828] Fix | Delete
}, [blocks]);
[44829] Fix | Delete
const {
[44830] Fix | Delete
startDragging,
[44831] Fix | Delete
stopDragging
[44832] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[44833] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Draggable, {
[44834] Fix | Delete
__experimentalTransferDataType: "wp-blocks",
[44835] Fix | Delete
transferData: transferData,
[44836] Fix | Delete
onDragStart: event => {
[44837] Fix | Delete
startDragging();
[44838] Fix | Delete
const parsedBlocks = pattern?.type === INSERTER_PATTERN_TYPES.user && pattern?.syncStatus !== 'unsynced' ? [(0,external_wp_blocks_namespaceObject.createBlock)('core/block', {
[44839] Fix | Delete
ref: pattern.id
[44840] Fix | Delete
})] : blocks;
[44841] Fix | Delete
event.dataTransfer.setData('text/html', (0,external_wp_blocks_namespaceObject.serialize)(parsedBlocks));
[44842] Fix | Delete
},
[44843] Fix | Delete
onDragEnd: () => {
[44844] Fix | Delete
stopDragging();
[44845] Fix | Delete
},
[44846] Fix | Delete
__experimentalDragComponent: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockDraggableChip, {
[44847] Fix | Delete
count: blocks.length,
[44848] Fix | Delete
icon: icon || !pattern && blockTypeIcon,
[44849] Fix | Delete
isPattern: !!pattern
[44850] Fix | Delete
}),
[44851] Fix | Delete
children: ({
[44852] Fix | Delete
onDraggableStart,
[44853] Fix | Delete
onDraggableEnd
[44854] Fix | Delete
}) => {
[44855] Fix | Delete
return children({
[44856] Fix | Delete
draggable: isEnabled,
[44857] Fix | Delete
onDragStart: isEnabled ? onDraggableStart : undefined,
[44858] Fix | Delete
onDragEnd: isEnabled ? onDraggableEnd : undefined
[44859] Fix | Delete
});
[44860] Fix | Delete
}
[44861] Fix | Delete
});
[44862] Fix | Delete
};
[44863] Fix | Delete
/* harmony default export */ const inserter_draggable_blocks = (InserterDraggableBlocks);
[44864] Fix | Delete
[44865] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-list-item/index.js
[44866] Fix | Delete
/**
[44867] Fix | Delete
* External dependencies
[44868] Fix | Delete
*/
[44869] Fix | Delete
[44870] Fix | Delete
[44871] Fix | Delete
/**
[44872] Fix | Delete
* WordPress dependencies
[44873] Fix | Delete
*/
[44874] Fix | Delete
[44875] Fix | Delete
[44876] Fix | Delete
[44877] Fix | Delete
[44878] Fix | Delete
[44879] Fix | Delete
/**
[44880] Fix | Delete
* Internal dependencies
[44881] Fix | Delete
*/
[44882] Fix | Delete
[44883] Fix | Delete
[44884] Fix | Delete
[44885] Fix | Delete
[44886] Fix | Delete
[44887] Fix | Delete
function InserterListItem({
[44888] Fix | Delete
className,
[44889] Fix | Delete
isFirst,
[44890] Fix | Delete
item,
[44891] Fix | Delete
onSelect,
[44892] Fix | Delete
onHover,
[44893] Fix | Delete
isDraggable,
[44894] Fix | Delete
...props
[44895] Fix | Delete
}) {
[44896] Fix | Delete
const isDragging = (0,external_wp_element_namespaceObject.useRef)(false);
[44897] Fix | Delete
const itemIconStyle = item.icon ? {
[44898] Fix | Delete
backgroundColor: item.icon.background,
[44899] Fix | Delete
color: item.icon.foreground
[44900] Fix | Delete
} : {};
[44901] Fix | Delete
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => [(0,external_wp_blocks_namespaceObject.createBlock)(item.name, item.initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(item.innerBlocks))], [item.name, item.initialAttributes, item.innerBlocks]);
[44902] Fix | Delete
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item) && item.syncStatus !== 'unsynced' || (0,external_wp_blocks_namespaceObject.isTemplatePart)(item);
[44903] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_draggable_blocks, {
[44904] Fix | Delete
isEnabled: isDraggable && !item.isDisabled,
[44905] Fix | Delete
blocks: blocks,
[44906] Fix | Delete
icon: item.icon,
[44907] Fix | Delete
children: ({
[44908] Fix | Delete
draggable,
[44909] Fix | Delete
onDragStart,
[44910] Fix | Delete
onDragEnd
[44911] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44912] Fix | Delete
className: dist_clsx('block-editor-block-types-list__list-item', {
[44913] Fix | Delete
'is-synced': isSynced
[44914] Fix | Delete
}),
[44915] Fix | Delete
draggable: draggable,
[44916] Fix | Delete
onDragStart: event => {
[44917] Fix | Delete
isDragging.current = true;
[44918] Fix | Delete
if (onDragStart) {
[44919] Fix | Delete
onHover(null);
[44920] Fix | Delete
onDragStart(event);
[44921] Fix | Delete
}
[44922] Fix | Delete
},
[44923] Fix | Delete
onDragEnd: event => {
[44924] Fix | Delete
isDragging.current = false;
[44925] Fix | Delete
if (onDragEnd) {
[44926] Fix | Delete
onDragEnd(event);
[44927] Fix | Delete
}
[44928] Fix | Delete
},
[44929] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(inserter_listbox_item, {
[44930] Fix | Delete
isFirst: isFirst,
[44931] Fix | Delete
className: dist_clsx('block-editor-block-types-list__item', className),
[44932] Fix | Delete
disabled: item.isDisabled,
[44933] Fix | Delete
onClick: event => {
[44934] Fix | Delete
event.preventDefault();
[44935] Fix | Delete
onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey);
[44936] Fix | Delete
onHover(null);
[44937] Fix | Delete
},
[44938] Fix | Delete
onKeyDown: event => {
[44939] Fix | Delete
const {
[44940] Fix | Delete
keyCode
[44941] Fix | Delete
} = event;
[44942] Fix | Delete
if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
[44943] Fix | Delete
event.preventDefault();
[44944] Fix | Delete
onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey);
[44945] Fix | Delete
onHover(null);
[44946] Fix | Delete
}
[44947] Fix | Delete
},
[44948] Fix | Delete
onMouseEnter: () => {
[44949] Fix | Delete
if (isDragging.current) {
[44950] Fix | Delete
return;
[44951] Fix | Delete
}
[44952] Fix | Delete
onHover(item);
[44953] Fix | Delete
},
[44954] Fix | Delete
onMouseLeave: () => onHover(null),
[44955] Fix | Delete
...props,
[44956] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[44957] Fix | Delete
className: "block-editor-block-types-list__item-icon",
[44958] Fix | Delete
style: itemIconStyle,
[44959] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
[44960] Fix | Delete
icon: item.icon,
[44961] Fix | Delete
showColors: true
[44962] Fix | Delete
})
[44963] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[44964] Fix | Delete
className: "block-editor-block-types-list__item-title",
[44965] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
[44966] Fix | Delete
numberOfLines: 3,
[44967] Fix | Delete
children: item.title
[44968] Fix | Delete
})
[44969] Fix | Delete
})]
[44970] Fix | Delete
})
[44971] Fix | Delete
})
[44972] Fix | Delete
});
[44973] Fix | Delete
}
[44974] Fix | Delete
/* harmony default export */ const inserter_list_item = ((0,external_wp_element_namespaceObject.memo)(InserterListItem));
[44975] Fix | Delete
[44976] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js
[44977] Fix | Delete
/**
[44978] Fix | Delete
* WordPress dependencies
[44979] Fix | Delete
*/
[44980] Fix | Delete
[44981] Fix | Delete
[44982] Fix | Delete
[44983] Fix | Delete
[44984] Fix | Delete
function InserterListboxGroup(props, ref) {
[44985] Fix | Delete
const [shouldSpeak, setShouldSpeak] = (0,external_wp_element_namespaceObject.useState)(false);
[44986] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[44987] Fix | Delete
if (shouldSpeak) {
[44988] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to move through blocks'));
[44989] Fix | Delete
}
[44990] Fix | Delete
}, [shouldSpeak]);
[44991] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[44992] Fix | Delete
ref: ref,
[44993] Fix | Delete
role: "listbox",
[44994] Fix | Delete
"aria-orientation": "horizontal",
[44995] Fix | Delete
onFocus: () => {
[44996] Fix | Delete
setShouldSpeak(true);
[44997] Fix | Delete
},
[44998] Fix | Delete
onBlur: event => {
[44999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function