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
"aria-expanded": !hasSingleBlockType ? isOpen : false,
[48000] Fix | Delete
disabled: disabled,
[48001] Fix | Delete
...rest
[48002] Fix | Delete
});
[48003] Fix | Delete
};
[48004] Fix | Delete
class PrivateInserter extends external_wp_element_namespaceObject.Component {
[48005] Fix | Delete
constructor() {
[48006] Fix | Delete
super(...arguments);
[48007] Fix | Delete
this.onToggle = this.onToggle.bind(this);
[48008] Fix | Delete
this.renderToggle = this.renderToggle.bind(this);
[48009] Fix | Delete
this.renderContent = this.renderContent.bind(this);
[48010] Fix | Delete
}
[48011] Fix | Delete
onToggle(isOpen) {
[48012] Fix | Delete
const {
[48013] Fix | Delete
onToggle
[48014] Fix | Delete
} = this.props;
[48015] Fix | Delete
[48016] Fix | Delete
// Surface toggle callback to parent component.
[48017] Fix | Delete
if (onToggle) {
[48018] Fix | Delete
onToggle(isOpen);
[48019] Fix | Delete
}
[48020] Fix | Delete
}
[48021] Fix | Delete
[48022] Fix | Delete
/**
[48023] Fix | Delete
* Render callback to display Dropdown toggle element.
[48024] Fix | Delete
*
[48025] Fix | Delete
* @param {Object} options
[48026] Fix | Delete
* @param {Function} options.onToggle Callback to invoke when toggle is
[48027] Fix | Delete
* pressed.
[48028] Fix | Delete
* @param {boolean} options.isOpen Whether dropdown is currently open.
[48029] Fix | Delete
*
[48030] Fix | Delete
* @return {Element} Dropdown toggle element.
[48031] Fix | Delete
*/
[48032] Fix | Delete
renderToggle({
[48033] Fix | Delete
onToggle,
[48034] Fix | Delete
isOpen
[48035] Fix | Delete
}) {
[48036] Fix | Delete
const {
[48037] Fix | Delete
disabled,
[48038] Fix | Delete
blockTitle,
[48039] Fix | Delete
hasSingleBlockType,
[48040] Fix | Delete
directInsertBlock,
[48041] Fix | Delete
toggleProps,
[48042] Fix | Delete
hasItems,
[48043] Fix | Delete
renderToggle = defaultRenderToggle,
[48044] Fix | Delete
prioritizePatterns
[48045] Fix | Delete
} = this.props;
[48046] Fix | Delete
return renderToggle({
[48047] Fix | Delete
onToggle,
[48048] Fix | Delete
isOpen,
[48049] Fix | Delete
disabled: disabled || !hasItems,
[48050] Fix | Delete
blockTitle,
[48051] Fix | Delete
hasSingleBlockType,
[48052] Fix | Delete
directInsertBlock,
[48053] Fix | Delete
toggleProps,
[48054] Fix | Delete
prioritizePatterns
[48055] Fix | Delete
});
[48056] Fix | Delete
}
[48057] Fix | Delete
[48058] Fix | Delete
/**
[48059] Fix | Delete
* Render callback to display Dropdown content element.
[48060] Fix | Delete
*
[48061] Fix | Delete
* @param {Object} options
[48062] Fix | Delete
* @param {Function} options.onClose Callback to invoke when dropdown is
[48063] Fix | Delete
* closed.
[48064] Fix | Delete
*
[48065] Fix | Delete
* @return {Element} Dropdown content element.
[48066] Fix | Delete
*/
[48067] Fix | Delete
renderContent({
[48068] Fix | Delete
onClose
[48069] Fix | Delete
}) {
[48070] Fix | Delete
const {
[48071] Fix | Delete
rootClientId,
[48072] Fix | Delete
clientId,
[48073] Fix | Delete
isAppender,
[48074] Fix | Delete
showInserterHelpPanel,
[48075] Fix | Delete
// This prop is experimental to give some time for the quick inserter to mature
[48076] Fix | Delete
// Feel free to make them stable after a few releases.
[48077] Fix | Delete
__experimentalIsQuick: isQuick,
[48078] Fix | Delete
prioritizePatterns,
[48079] Fix | Delete
onSelectOrClose,
[48080] Fix | Delete
selectBlockOnInsert
[48081] Fix | Delete
} = this.props;
[48082] Fix | Delete
if (isQuick) {
[48083] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QuickInserter, {
[48084] Fix | Delete
onSelect: blocks => {
[48085] Fix | Delete
const firstBlock = Array.isArray(blocks) && blocks?.length ? blocks[0] : blocks;
[48086] Fix | Delete
if (onSelectOrClose && typeof onSelectOrClose === 'function') {
[48087] Fix | Delete
onSelectOrClose(firstBlock);
[48088] Fix | Delete
}
[48089] Fix | Delete
onClose();
[48090] Fix | Delete
},
[48091] Fix | Delete
rootClientId: rootClientId,
[48092] Fix | Delete
clientId: clientId,
[48093] Fix | Delete
isAppender: isAppender,
[48094] Fix | Delete
prioritizePatterns: prioritizePatterns,
[48095] Fix | Delete
selectBlockOnInsert: selectBlockOnInsert
[48096] Fix | Delete
});
[48097] Fix | Delete
}
[48098] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu, {
[48099] Fix | Delete
onSelect: () => {
[48100] Fix | Delete
onClose();
[48101] Fix | Delete
},
[48102] Fix | Delete
rootClientId: rootClientId,
[48103] Fix | Delete
clientId: clientId,
[48104] Fix | Delete
isAppender: isAppender,
[48105] Fix | Delete
showInserterHelpPanel: showInserterHelpPanel
[48106] Fix | Delete
});
[48107] Fix | Delete
}
[48108] Fix | Delete
render() {
[48109] Fix | Delete
const {
[48110] Fix | Delete
position,
[48111] Fix | Delete
hasSingleBlockType,
[48112] Fix | Delete
directInsertBlock,
[48113] Fix | Delete
insertOnlyAllowedBlock,
[48114] Fix | Delete
__experimentalIsQuick: isQuick,
[48115] Fix | Delete
onSelectOrClose
[48116] Fix | Delete
} = this.props;
[48117] Fix | Delete
if (hasSingleBlockType || directInsertBlock) {
[48118] Fix | Delete
return this.renderToggle({
[48119] Fix | Delete
onToggle: insertOnlyAllowedBlock
[48120] Fix | Delete
});
[48121] Fix | Delete
}
[48122] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
[48123] Fix | Delete
className: "block-editor-inserter",
[48124] Fix | Delete
contentClassName: dist_clsx('block-editor-inserter__popover', {
[48125] Fix | Delete
'is-quick': isQuick
[48126] Fix | Delete
}),
[48127] Fix | Delete
popoverProps: {
[48128] Fix | Delete
position,
[48129] Fix | Delete
shift: true
[48130] Fix | Delete
},
[48131] Fix | Delete
onToggle: this.onToggle,
[48132] Fix | Delete
expandOnMobile: true,
[48133] Fix | Delete
headerTitle: (0,external_wp_i18n_namespaceObject.__)('Add a block'),
[48134] Fix | Delete
renderToggle: this.renderToggle,
[48135] Fix | Delete
renderContent: this.renderContent,
[48136] Fix | Delete
onClose: onSelectOrClose
[48137] Fix | Delete
});
[48138] Fix | Delete
}
[48139] Fix | Delete
}
[48140] Fix | Delete
const ComposedPrivateInserter = (0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, {
[48141] Fix | Delete
clientId,
[48142] Fix | Delete
rootClientId,
[48143] Fix | Delete
shouldDirectInsert = true
[48144] Fix | Delete
}) => {
[48145] Fix | Delete
const {
[48146] Fix | Delete
getBlockRootClientId,
[48147] Fix | Delete
hasInserterItems,
[48148] Fix | Delete
getAllowedBlocks,
[48149] Fix | Delete
getDirectInsertBlock,
[48150] Fix | Delete
getSettings
[48151] Fix | Delete
} = select(store);
[48152] Fix | Delete
const {
[48153] Fix | Delete
getBlockVariations
[48154] Fix | Delete
} = select(external_wp_blocks_namespaceObject.store);
[48155] Fix | Delete
rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined;
[48156] Fix | Delete
const allowedBlocks = getAllowedBlocks(rootClientId);
[48157] Fix | Delete
const directInsertBlock = shouldDirectInsert && getDirectInsertBlock(rootClientId);
[48158] Fix | Delete
const settings = getSettings();
[48159] Fix | Delete
const hasSingleBlockType = allowedBlocks?.length === 1 && getBlockVariations(allowedBlocks[0].name, 'inserter')?.length === 0;
[48160] Fix | Delete
let allowedBlockType = false;
[48161] Fix | Delete
if (hasSingleBlockType) {
[48162] Fix | Delete
allowedBlockType = allowedBlocks[0];
[48163] Fix | Delete
}
[48164] Fix | Delete
return {
[48165] Fix | Delete
hasItems: hasInserterItems(rootClientId),
[48166] Fix | Delete
hasSingleBlockType,
[48167] Fix | Delete
blockTitle: allowedBlockType ? allowedBlockType.title : '',
[48168] Fix | Delete
allowedBlockType,
[48169] Fix | Delete
directInsertBlock,
[48170] Fix | Delete
rootClientId,
[48171] Fix | Delete
prioritizePatterns: settings.__experimentalPreferPatternsOnRoot && !rootClientId
[48172] Fix | Delete
};
[48173] Fix | Delete
}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, {
[48174] Fix | Delete
select
[48175] Fix | Delete
}) => {
[48176] Fix | Delete
return {
[48177] Fix | Delete
insertOnlyAllowedBlock() {
[48178] Fix | Delete
const {
[48179] Fix | Delete
rootClientId,
[48180] Fix | Delete
clientId,
[48181] Fix | Delete
isAppender,
[48182] Fix | Delete
hasSingleBlockType,
[48183] Fix | Delete
allowedBlockType,
[48184] Fix | Delete
directInsertBlock,
[48185] Fix | Delete
onSelectOrClose,
[48186] Fix | Delete
selectBlockOnInsert
[48187] Fix | Delete
} = ownProps;
[48188] Fix | Delete
if (!hasSingleBlockType && !directInsertBlock) {
[48189] Fix | Delete
return;
[48190] Fix | Delete
}
[48191] Fix | Delete
function getAdjacentBlockAttributes(attributesToCopy) {
[48192] Fix | Delete
const {
[48193] Fix | Delete
getBlock,
[48194] Fix | Delete
getPreviousBlockClientId
[48195] Fix | Delete
} = select(store);
[48196] Fix | Delete
if (!attributesToCopy || !clientId && !rootClientId) {
[48197] Fix | Delete
return {};
[48198] Fix | Delete
}
[48199] Fix | Delete
const result = {};
[48200] Fix | Delete
let adjacentAttributes = {};
[48201] Fix | Delete
[48202] Fix | Delete
// If there is no clientId, then attempt to get attributes
[48203] Fix | Delete
// from the last block within innerBlocks of the root block.
[48204] Fix | Delete
if (!clientId) {
[48205] Fix | Delete
const parentBlock = getBlock(rootClientId);
[48206] Fix | Delete
if (parentBlock?.innerBlocks?.length) {
[48207] Fix | Delete
const lastInnerBlock = parentBlock.innerBlocks[parentBlock.innerBlocks.length - 1];
[48208] Fix | Delete
if (directInsertBlock && directInsertBlock?.name === lastInnerBlock.name) {
[48209] Fix | Delete
adjacentAttributes = lastInnerBlock.attributes;
[48210] Fix | Delete
}
[48211] Fix | Delete
}
[48212] Fix | Delete
} else {
[48213] Fix | Delete
// Otherwise, attempt to get attributes from the
[48214] Fix | Delete
// previous block relative to the current clientId.
[48215] Fix | Delete
const currentBlock = getBlock(clientId);
[48216] Fix | Delete
const previousBlock = getBlock(getPreviousBlockClientId(clientId));
[48217] Fix | Delete
if (currentBlock?.name === previousBlock?.name) {
[48218] Fix | Delete
adjacentAttributes = previousBlock?.attributes || {};
[48219] Fix | Delete
}
[48220] Fix | Delete
}
[48221] Fix | Delete
[48222] Fix | Delete
// Copy over only those attributes flagged to be copied.
[48223] Fix | Delete
attributesToCopy.forEach(attribute => {
[48224] Fix | Delete
if (adjacentAttributes.hasOwnProperty(attribute)) {
[48225] Fix | Delete
result[attribute] = adjacentAttributes[attribute];
[48226] Fix | Delete
}
[48227] Fix | Delete
});
[48228] Fix | Delete
return result;
[48229] Fix | Delete
}
[48230] Fix | Delete
function getInsertionIndex() {
[48231] Fix | Delete
const {
[48232] Fix | Delete
getBlockIndex,
[48233] Fix | Delete
getBlockSelectionEnd,
[48234] Fix | Delete
getBlockOrder,
[48235] Fix | Delete
getBlockRootClientId
[48236] Fix | Delete
} = select(store);
[48237] Fix | Delete
[48238] Fix | Delete
// If the clientId is defined, we insert at the position of the block.
[48239] Fix | Delete
if (clientId) {
[48240] Fix | Delete
return getBlockIndex(clientId);
[48241] Fix | Delete
}
[48242] Fix | Delete
[48243] Fix | Delete
// If there a selected block, we insert after the selected block.
[48244] Fix | Delete
const end = getBlockSelectionEnd();
[48245] Fix | Delete
if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
[48246] Fix | Delete
return getBlockIndex(end) + 1;
[48247] Fix | Delete
}
[48248] Fix | Delete
[48249] Fix | Delete
// Otherwise, we insert at the end of the current rootClientId.
[48250] Fix | Delete
return getBlockOrder(rootClientId).length;
[48251] Fix | Delete
}
[48252] Fix | Delete
const {
[48253] Fix | Delete
insertBlock
[48254] Fix | Delete
} = dispatch(store);
[48255] Fix | Delete
let blockToInsert;
[48256] Fix | Delete
[48257] Fix | Delete
// Attempt to augment the directInsertBlock with attributes from an adjacent block.
[48258] Fix | Delete
// This ensures styling from nearby blocks is preserved in the newly inserted block.
[48259] Fix | Delete
// See: https://github.com/WordPress/gutenberg/issues/37904
[48260] Fix | Delete
if (directInsertBlock) {
[48261] Fix | Delete
const newAttributes = getAdjacentBlockAttributes(directInsertBlock.attributesToCopy);
[48262] Fix | Delete
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, {
[48263] Fix | Delete
...(directInsertBlock.attributes || {}),
[48264] Fix | Delete
...newAttributes
[48265] Fix | Delete
});
[48266] Fix | Delete
} else {
[48267] Fix | Delete
blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(allowedBlockType.name);
[48268] Fix | Delete
}
[48269] Fix | Delete
insertBlock(blockToInsert, getInsertionIndex(), rootClientId, selectBlockOnInsert);
[48270] Fix | Delete
if (onSelectOrClose) {
[48271] Fix | Delete
onSelectOrClose({
[48272] Fix | Delete
clientId: blockToInsert?.clientId
[48273] Fix | Delete
});
[48274] Fix | Delete
}
[48275] Fix | Delete
const message = (0,external_wp_i18n_namespaceObject.sprintf)(
[48276] Fix | Delete
// translators: %s: the name of the block that has been added
[48277] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('%s block added'), allowedBlockType.title);
[48278] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(message);
[48279] Fix | Delete
}
[48280] Fix | Delete
};
[48281] Fix | Delete
}),
[48282] Fix | Delete
// The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as
[48283] Fix | Delete
// a way to detect the global Inserter.
[48284] Fix | Delete
(0,external_wp_compose_namespaceObject.ifCondition)(({
[48285] Fix | Delete
hasItems,
[48286] Fix | Delete
isAppender,
[48287] Fix | Delete
rootClientId,
[48288] Fix | Delete
clientId
[48289] Fix | Delete
}) => hasItems || !isAppender && !rootClientId && !clientId)])(PrivateInserter);
[48290] Fix | Delete
const Inserter = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
[48291] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComposedPrivateInserter, {
[48292] Fix | Delete
ref: ref,
[48293] Fix | Delete
...props
[48294] Fix | Delete
});
[48295] Fix | Delete
});
[48296] Fix | Delete
/* harmony default export */ const inserter = (Inserter);
[48297] Fix | Delete
[48298] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
[48299] Fix | Delete
/**
[48300] Fix | Delete
* External dependencies
[48301] Fix | Delete
*/
[48302] Fix | Delete
[48303] Fix | Delete
[48304] Fix | Delete
/**
[48305] Fix | Delete
* WordPress dependencies
[48306] Fix | Delete
*/
[48307] Fix | Delete
[48308] Fix | Delete
[48309] Fix | Delete
[48310] Fix | Delete
[48311] Fix | Delete
[48312] Fix | Delete
/**
[48313] Fix | Delete
* Internal dependencies
[48314] Fix | Delete
*/
[48315] Fix | Delete
[48316] Fix | Delete
[48317] Fix | Delete
[48318] Fix | Delete
/**
[48319] Fix | Delete
* Zero width non-breaking space, used as padding for the paragraph when it is
[48320] Fix | Delete
* empty.
[48321] Fix | Delete
*/
[48322] Fix | Delete
[48323] Fix | Delete
[48324] Fix | Delete
const ZWNBSP = '\ufeff';
[48325] Fix | Delete
function DefaultBlockAppender({
[48326] Fix | Delete
rootClientId
[48327] Fix | Delete
}) {
[48328] Fix | Delete
const {
[48329] Fix | Delete
showPrompt,
[48330] Fix | Delete
isLocked,
[48331] Fix | Delete
placeholder
[48332] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[48333] Fix | Delete
const {
[48334] Fix | Delete
getBlockCount,
[48335] Fix | Delete
getSettings,
[48336] Fix | Delete
getTemplateLock
[48337] Fix | Delete
} = select(store);
[48338] Fix | Delete
const isEmpty = !getBlockCount(rootClientId);
[48339] Fix | Delete
const {
[48340] Fix | Delete
bodyPlaceholder
[48341] Fix | Delete
} = getSettings();
[48342] Fix | Delete
return {
[48343] Fix | Delete
showPrompt: isEmpty,
[48344] Fix | Delete
isLocked: !!getTemplateLock(rootClientId),
[48345] Fix | Delete
placeholder: bodyPlaceholder
[48346] Fix | Delete
};
[48347] Fix | Delete
}, [rootClientId]);
[48348] Fix | Delete
const {
[48349] Fix | Delete
insertDefaultBlock,
[48350] Fix | Delete
startTyping
[48351] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[48352] Fix | Delete
if (isLocked) {
[48353] Fix | Delete
return null;
[48354] Fix | Delete
}
[48355] Fix | Delete
const value = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block');
[48356] Fix | Delete
const onAppend = () => {
[48357] Fix | Delete
insertDefaultBlock(undefined, rootClientId);
[48358] Fix | Delete
startTyping();
[48359] Fix | Delete
};
[48360] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[48361] Fix | Delete
"data-root-client-id": rootClientId || '',
[48362] Fix | Delete
className: dist_clsx('block-editor-default-block-appender', {
[48363] Fix | Delete
'has-visible-prompt': showPrompt
[48364] Fix | Delete
}),
[48365] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[48366] Fix | Delete
tabIndex: "0"
[48367] Fix | Delete
// We want this element to be styled as a paragraph by themes.
[48368] Fix | Delete
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
[48369] Fix | Delete
,
[48370] Fix | Delete
role: "button",
[48371] Fix | Delete
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Add default block')
[48372] Fix | Delete
// A wrapping container for this one already has the wp-block className.
[48373] Fix | Delete
,
[48374] Fix | Delete
className: "block-editor-default-block-appender__content",
[48375] Fix | Delete
onKeyDown: event => {
[48376] Fix | Delete
if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) {
[48377] Fix | Delete
onAppend();
[48378] Fix | Delete
}
[48379] Fix | Delete
},
[48380] Fix | Delete
onClick: () => onAppend(),
[48381] Fix | Delete
onFocus: () => {
[48382] Fix | Delete
if (showPrompt) {
[48383] Fix | Delete
onAppend();
[48384] Fix | Delete
}
[48385] Fix | Delete
},
[48386] Fix | Delete
children: showPrompt ? value : ZWNBSP
[48387] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, {
[48388] Fix | Delete
rootClientId: rootClientId,
[48389] Fix | Delete
position: "bottom right",
[48390] Fix | Delete
isAppender: true,
[48391] Fix | Delete
__experimentalIsQuick: true
[48392] Fix | Delete
})]
[48393] Fix | Delete
});
[48394] Fix | Delete
}
[48395] Fix | Delete
[48396] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js
[48397] Fix | Delete
/**
[48398] Fix | Delete
* External dependencies
[48399] Fix | Delete
*/
[48400] Fix | Delete
[48401] Fix | Delete
[48402] Fix | Delete
/**
[48403] Fix | Delete
* WordPress dependencies
[48404] Fix | Delete
*/
[48405] Fix | Delete
[48406] Fix | Delete
[48407] Fix | Delete
[48408] Fix | Delete
[48409] Fix | Delete
[48410] Fix | Delete
[48411] Fix | Delete
/**
[48412] Fix | Delete
* Internal dependencies
[48413] Fix | Delete
*/
[48414] Fix | Delete
[48415] Fix | Delete
[48416] Fix | Delete
[48417] Fix | Delete
function ButtonBlockAppender({
[48418] Fix | Delete
rootClientId,
[48419] Fix | Delete
className,
[48420] Fix | Delete
onFocus,
[48421] Fix | Delete
tabIndex
[48422] Fix | Delete
}, ref) {
[48423] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, {
[48424] Fix | Delete
position: "bottom center",
[48425] Fix | Delete
rootClientId: rootClientId,
[48426] Fix | Delete
__experimentalIsQuick: true,
[48427] Fix | Delete
renderToggle: ({
[48428] Fix | Delete
onToggle,
[48429] Fix | Delete
disabled,
[48430] Fix | Delete
isOpen,
[48431] Fix | Delete
blockTitle,
[48432] Fix | Delete
hasSingleBlockType
[48433] Fix | Delete
}) => {
[48434] Fix | Delete
let label;
[48435] Fix | Delete
if (hasSingleBlockType) {
[48436] Fix | Delete
label = (0,external_wp_i18n_namespaceObject.sprintf)(
[48437] Fix | Delete
// translators: %s: the name of the block when there is only one
[48438] Fix | Delete
(0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle);
[48439] Fix | Delete
} else {
[48440] Fix | Delete
label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button');
[48441] Fix | Delete
}
[48442] Fix | Delete
const isToggleButton = !hasSingleBlockType;
[48443] Fix | Delete
let inserterButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
[48444] Fix | Delete
ref: ref,
[48445] Fix | Delete
onFocus: onFocus,
[48446] Fix | Delete
tabIndex: tabIndex,
[48447] Fix | Delete
className: dist_clsx(className, 'block-editor-button-block-appender'),
[48448] Fix | Delete
onClick: onToggle,
[48449] Fix | Delete
"aria-haspopup": isToggleButton ? 'true' : undefined,
[48450] Fix | Delete
"aria-expanded": isToggleButton ? isOpen : undefined
[48451] Fix | Delete
// Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.
[48452] Fix | Delete
// eslint-disable-next-line no-restricted-syntax
[48453] Fix | Delete
,
[48454] Fix | Delete
disabled: disabled,
[48455] Fix | Delete
label: label,
[48456] Fix | Delete
children: [!hasSingleBlockType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
[48457] Fix | Delete
as: "span",
[48458] Fix | Delete
children: label
[48459] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[48460] Fix | Delete
icon: library_plus
[48461] Fix | Delete
})]
[48462] Fix | Delete
});
[48463] Fix | Delete
if (isToggleButton || hasSingleBlockType) {
[48464] Fix | Delete
inserterButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
[48465] Fix | Delete
text: label,
[48466] Fix | Delete
children: inserterButton
[48467] Fix | Delete
});
[48468] Fix | Delete
}
[48469] Fix | Delete
return inserterButton;
[48470] Fix | Delete
},
[48471] Fix | Delete
isAppender: true
[48472] Fix | Delete
});
[48473] Fix | Delete
}
[48474] Fix | Delete
[48475] Fix | Delete
/**
[48476] Fix | Delete
* Use `ButtonBlockAppender` instead.
[48477] Fix | Delete
*
[48478] Fix | Delete
* @deprecated
[48479] Fix | Delete
*/
[48480] Fix | Delete
const ButtonBlockerAppender = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
[48481] Fix | Delete
external_wp_deprecated_default()(`wp.blockEditor.ButtonBlockerAppender`, {
[48482] Fix | Delete
alternative: 'wp.blockEditor.ButtonBlockAppender',
[48483] Fix | Delete
since: '5.9'
[48484] Fix | Delete
});
[48485] Fix | Delete
return ButtonBlockAppender(props, ref);
[48486] Fix | Delete
});
[48487] Fix | Delete
[48488] Fix | Delete
/**
[48489] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md
[48490] Fix | Delete
*/
[48491] Fix | Delete
/* harmony default export */ const button_block_appender = ((0,external_wp_element_namespaceObject.forwardRef)(ButtonBlockAppender));
[48492] Fix | Delete
[48493] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js
[48494] Fix | Delete
/**
[48495] Fix | Delete
* External dependencies
[48496] Fix | Delete
*/
[48497] Fix | Delete
[48498] Fix | Delete
[48499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function