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
clientIds
[54500] Fix | Delete
}) {
[54501] Fix | Delete
// Edit visually only works for single block selection.
[54502] Fix | Delete
const clientId = clientIds.length === 1 ? clientIds[0] : undefined;
[54503] Fix | Delete
const canEditVisually = (0,external_wp_data_namespaceObject.useSelect)(select => !!clientId && select(store).getBlockMode(clientId) === 'html', [clientId]);
[54504] Fix | Delete
const {
[54505] Fix | Delete
toggleBlockMode
[54506] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[54507] Fix | Delete
if (!canEditVisually) {
[54508] Fix | Delete
return null;
[54509] Fix | Delete
}
[54510] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
[54511] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
[54512] Fix | Delete
onClick: () => {
[54513] Fix | Delete
toggleBlockMode(clientId);
[54514] Fix | Delete
},
[54515] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Edit visually')
[54516] Fix | Delete
})
[54517] Fix | Delete
});
[54518] Fix | Delete
}
[54519] Fix | Delete
[54520] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-name-context.js
[54521] Fix | Delete
/**
[54522] Fix | Delete
* WordPress dependencies
[54523] Fix | Delete
*/
[54524] Fix | Delete
[54525] Fix | Delete
const __unstableBlockNameContext = (0,external_wp_element_namespaceObject.createContext)('');
[54526] Fix | Delete
/* harmony default export */ const block_name_context = (__unstableBlockNameContext);
[54527] Fix | Delete
[54528] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js
[54529] Fix | Delete
/**
[54530] Fix | Delete
* WordPress dependencies
[54531] Fix | Delete
*/
[54532] Fix | Delete
[54533] Fix | Delete
[54534] Fix | Delete
[54535] Fix | Delete
[54536] Fix | Delete
[54537] Fix | Delete
[54538] Fix | Delete
[54539] Fix | Delete
[54540] Fix | Delete
/**
[54541] Fix | Delete
* Internal dependencies
[54542] Fix | Delete
*/
[54543] Fix | Delete
[54544] Fix | Delete
[54545] Fix | Delete
[54546] Fix | Delete
function hasOnlyToolbarItem(elements) {
[54547] Fix | Delete
const dataProp = 'toolbarItem';
[54548] Fix | Delete
return !elements.some(element => !(dataProp in element.dataset));
[54549] Fix | Delete
}
[54550] Fix | Delete
function getAllFocusableToolbarItemsIn(container) {
[54551] Fix | Delete
return Array.from(container.querySelectorAll('[data-toolbar-item]:not([disabled])'));
[54552] Fix | Delete
}
[54553] Fix | Delete
function hasFocusWithin(container) {
[54554] Fix | Delete
return container.contains(container.ownerDocument.activeElement);
[54555] Fix | Delete
}
[54556] Fix | Delete
function focusFirstTabbableIn(container) {
[54557] Fix | Delete
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(container);
[54558] Fix | Delete
if (firstTabbable) {
[54559] Fix | Delete
firstTabbable.focus({
[54560] Fix | Delete
// When focusing newly mounted toolbars,
[54561] Fix | Delete
// the position of the popover is often not right on the first render
[54562] Fix | Delete
// This prevents the layout shifts when focusing the dialogs.
[54563] Fix | Delete
preventScroll: true
[54564] Fix | Delete
});
[54565] Fix | Delete
}
[54566] Fix | Delete
}
[54567] Fix | Delete
function useIsAccessibleToolbar(toolbarRef) {
[54568] Fix | Delete
/*
[54569] Fix | Delete
* By default, we'll assume the starting accessible state of the Toolbar
[54570] Fix | Delete
* is true, as it seems to be the most common case.
[54571] Fix | Delete
*
[54572] Fix | Delete
* Transitioning from an (initial) false to true state causes the
[54573] Fix | Delete
* <Toolbar /> component to mount twice, which is causing undesired
[54574] Fix | Delete
* side-effects. These side-effects appear to only affect certain
[54575] Fix | Delete
* E2E tests.
[54576] Fix | Delete
*
[54577] Fix | Delete
* This was initial discovered in this pull-request:
[54578] Fix | Delete
* https://github.com/WordPress/gutenberg/pull/23425
[54579] Fix | Delete
*/
[54580] Fix | Delete
const initialAccessibleToolbarState = true;
[54581] Fix | Delete
[54582] Fix | Delete
// By default, it's gonna render NavigableMenu. If all the tabbable elements
[54583] Fix | Delete
// inside the toolbar are ToolbarItem components (or derived components like
[54584] Fix | Delete
// ToolbarButton), then we can wrap them with the accessible Toolbar
[54585] Fix | Delete
// component.
[54586] Fix | Delete
const [isAccessibleToolbar, setIsAccessibleToolbar] = (0,external_wp_element_namespaceObject.useState)(initialAccessibleToolbarState);
[54587] Fix | Delete
const determineIsAccessibleToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
[54588] Fix | Delete
const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(toolbarRef.current);
[54589] Fix | Delete
const onlyToolbarItem = hasOnlyToolbarItem(tabbables);
[54590] Fix | Delete
if (!onlyToolbarItem) {
[54591] Fix | Delete
external_wp_deprecated_default()('Using custom components as toolbar controls', {
[54592] Fix | Delete
since: '5.6',
[54593] Fix | Delete
alternative: 'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components',
[54594] Fix | Delete
link: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols'
[54595] Fix | Delete
});
[54596] Fix | Delete
}
[54597] Fix | Delete
setIsAccessibleToolbar(onlyToolbarItem);
[54598] Fix | Delete
}, [toolbarRef]);
[54599] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[54600] Fix | Delete
// Toolbar buttons may be rendered asynchronously, so we use
[54601] Fix | Delete
// MutationObserver to check if the toolbar subtree has been modified.
[54602] Fix | Delete
const observer = new window.MutationObserver(determineIsAccessibleToolbar);
[54603] Fix | Delete
observer.observe(toolbarRef.current, {
[54604] Fix | Delete
childList: true,
[54605] Fix | Delete
subtree: true
[54606] Fix | Delete
});
[54607] Fix | Delete
return () => observer.disconnect();
[54608] Fix | Delete
}, [determineIsAccessibleToolbar, isAccessibleToolbar, toolbarRef]);
[54609] Fix | Delete
return isAccessibleToolbar;
[54610] Fix | Delete
}
[54611] Fix | Delete
function useToolbarFocus({
[54612] Fix | Delete
toolbarRef,
[54613] Fix | Delete
focusOnMount,
[54614] Fix | Delete
isAccessibleToolbar,
[54615] Fix | Delete
defaultIndex,
[54616] Fix | Delete
onIndexChange,
[54617] Fix | Delete
shouldUseKeyboardFocusShortcut,
[54618] Fix | Delete
focusEditorOnEscape
[54619] Fix | Delete
}) {
[54620] Fix | Delete
// Make sure we don't use modified versions of this prop.
[54621] Fix | Delete
const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount);
[54622] Fix | Delete
const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex);
[54623] Fix | Delete
const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => {
[54624] Fix | Delete
focusFirstTabbableIn(toolbarRef.current);
[54625] Fix | Delete
}, [toolbarRef]);
[54626] Fix | Delete
const focusToolbarViaShortcut = () => {
[54627] Fix | Delete
if (shouldUseKeyboardFocusShortcut) {
[54628] Fix | Delete
focusToolbar();
[54629] Fix | Delete
}
[54630] Fix | Delete
};
[54631] Fix | Delete
[54632] Fix | Delete
// Focus on toolbar when pressing alt+F10 when the toolbar is visible.
[54633] Fix | Delete
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', focusToolbarViaShortcut);
[54634] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[54635] Fix | Delete
if (initialFocusOnMount) {
[54636] Fix | Delete
focusToolbar();
[54637] Fix | Delete
}
[54638] Fix | Delete
}, [isAccessibleToolbar, initialFocusOnMount, focusToolbar]);
[54639] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[54640] Fix | Delete
// Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing
[54641] Fix | Delete
const navigableToolbarRef = toolbarRef.current;
[54642] Fix | Delete
// If initialIndex is passed, we focus on that toolbar item when the
[54643] Fix | Delete
// toolbar gets mounted and initial focus is not forced.
[54644] Fix | Delete
// We have to wait for the next browser paint because block controls aren't
[54645] Fix | Delete
// rendered right away when the toolbar gets mounted.
[54646] Fix | Delete
let raf = 0;
[54647] Fix | Delete
[54648] Fix | Delete
// If the toolbar already had focus before the render, we don't want to move it.
[54649] Fix | Delete
// https://github.com/WordPress/gutenberg/issues/58511
[54650] Fix | Delete
if (!initialFocusOnMount && !hasFocusWithin(navigableToolbarRef)) {
[54651] Fix | Delete
raf = window.requestAnimationFrame(() => {
[54652] Fix | Delete
const items = getAllFocusableToolbarItemsIn(navigableToolbarRef);
[54653] Fix | Delete
const index = initialIndex || 0;
[54654] Fix | Delete
if (items[index] && hasFocusWithin(navigableToolbarRef)) {
[54655] Fix | Delete
items[index].focus({
[54656] Fix | Delete
// When focusing newly mounted toolbars,
[54657] Fix | Delete
// the position of the popover is often not right on the first render
[54658] Fix | Delete
// This prevents the layout shifts when focusing the dialogs.
[54659] Fix | Delete
preventScroll: true
[54660] Fix | Delete
});
[54661] Fix | Delete
}
[54662] Fix | Delete
});
[54663] Fix | Delete
}
[54664] Fix | Delete
return () => {
[54665] Fix | Delete
window.cancelAnimationFrame(raf);
[54666] Fix | Delete
if (!onIndexChange || !navigableToolbarRef) {
[54667] Fix | Delete
return;
[54668] Fix | Delete
}
[54669] Fix | Delete
// When the toolbar element is unmounted and onIndexChange is passed, we
[54670] Fix | Delete
// pass the focused toolbar item index so it can be hydrated later.
[54671] Fix | Delete
const items = getAllFocusableToolbarItemsIn(navigableToolbarRef);
[54672] Fix | Delete
const index = items.findIndex(item => item.tabIndex === 0);
[54673] Fix | Delete
onIndexChange(index);
[54674] Fix | Delete
};
[54675] Fix | Delete
}, [initialIndex, initialFocusOnMount, onIndexChange, toolbarRef]);
[54676] Fix | Delete
const {
[54677] Fix | Delete
getLastFocus
[54678] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
[54679] Fix | Delete
/**
[54680] Fix | Delete
* Handles returning focus to the block editor canvas when pressing escape.
[54681] Fix | Delete
*/
[54682] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[54683] Fix | Delete
const navigableToolbarRef = toolbarRef.current;
[54684] Fix | Delete
if (focusEditorOnEscape) {
[54685] Fix | Delete
const handleKeyDown = event => {
[54686] Fix | Delete
const lastFocus = getLastFocus();
[54687] Fix | Delete
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && lastFocus?.current) {
[54688] Fix | Delete
// Focus the last focused element when pressing escape.
[54689] Fix | Delete
event.preventDefault();
[54690] Fix | Delete
lastFocus.current.focus();
[54691] Fix | Delete
}
[54692] Fix | Delete
};
[54693] Fix | Delete
navigableToolbarRef.addEventListener('keydown', handleKeyDown);
[54694] Fix | Delete
return () => {
[54695] Fix | Delete
navigableToolbarRef.removeEventListener('keydown', handleKeyDown);
[54696] Fix | Delete
};
[54697] Fix | Delete
}
[54698] Fix | Delete
}, [focusEditorOnEscape, getLastFocus, toolbarRef]);
[54699] Fix | Delete
}
[54700] Fix | Delete
function NavigableToolbar({
[54701] Fix | Delete
children,
[54702] Fix | Delete
focusOnMount,
[54703] Fix | Delete
focusEditorOnEscape = false,
[54704] Fix | Delete
shouldUseKeyboardFocusShortcut = true,
[54705] Fix | Delete
__experimentalInitialIndex: initialIndex,
[54706] Fix | Delete
__experimentalOnIndexChange: onIndexChange,
[54707] Fix | Delete
...props
[54708] Fix | Delete
}) {
[54709] Fix | Delete
const toolbarRef = (0,external_wp_element_namespaceObject.useRef)();
[54710] Fix | Delete
const isAccessibleToolbar = useIsAccessibleToolbar(toolbarRef);
[54711] Fix | Delete
useToolbarFocus({
[54712] Fix | Delete
toolbarRef,
[54713] Fix | Delete
focusOnMount,
[54714] Fix | Delete
defaultIndex: initialIndex,
[54715] Fix | Delete
onIndexChange,
[54716] Fix | Delete
isAccessibleToolbar,
[54717] Fix | Delete
shouldUseKeyboardFocusShortcut,
[54718] Fix | Delete
focusEditorOnEscape
[54719] Fix | Delete
});
[54720] Fix | Delete
if (isAccessibleToolbar) {
[54721] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Toolbar, {
[54722] Fix | Delete
label: props['aria-label'],
[54723] Fix | Delete
ref: toolbarRef,
[54724] Fix | Delete
...props,
[54725] Fix | Delete
children: children
[54726] Fix | Delete
});
[54727] Fix | Delete
}
[54728] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NavigableMenu, {
[54729] Fix | Delete
orientation: "horizontal",
[54730] Fix | Delete
role: "toolbar",
[54731] Fix | Delete
ref: toolbarRef,
[54732] Fix | Delete
...props,
[54733] Fix | Delete
children: children
[54734] Fix | Delete
});
[54735] Fix | Delete
}
[54736] Fix | Delete
[54737] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shuffle.js
[54738] Fix | Delete
/**
[54739] Fix | Delete
* WordPress dependencies
[54740] Fix | Delete
*/
[54741] Fix | Delete
[54742] Fix | Delete
[54743] Fix | Delete
const shuffle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[54744] Fix | Delete
viewBox: "0 0 24 24",
[54745] Fix | Delete
xmlns: "http://www.w3.org/2000/SVG",
[54746] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[54747] Fix | Delete
d: "M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"
[54748] Fix | Delete
})
[54749] Fix | Delete
});
[54750] Fix | Delete
/* harmony default export */ const library_shuffle = (shuffle);
[54751] Fix | Delete
[54752] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/shuffle.js
[54753] Fix | Delete
/**
[54754] Fix | Delete
* WordPress dependencies
[54755] Fix | Delete
*/
[54756] Fix | Delete
[54757] Fix | Delete
[54758] Fix | Delete
[54759] Fix | Delete
[54760] Fix | Delete
[54761] Fix | Delete
[54762] Fix | Delete
/**
[54763] Fix | Delete
* Internal dependencies
[54764] Fix | Delete
*/
[54765] Fix | Delete
[54766] Fix | Delete
[54767] Fix | Delete
const shuffle_EMPTY_ARRAY = [];
[54768] Fix | Delete
function shuffle_Container(props) {
[54769] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
[54770] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
[54771] Fix | Delete
...props
[54772] Fix | Delete
})
[54773] Fix | Delete
});
[54774] Fix | Delete
}
[54775] Fix | Delete
function Shuffle({
[54776] Fix | Delete
clientId,
[54777] Fix | Delete
as = shuffle_Container
[54778] Fix | Delete
}) {
[54779] Fix | Delete
const {
[54780] Fix | Delete
categories,
[54781] Fix | Delete
patterns,
[54782] Fix | Delete
patternName
[54783] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[54784] Fix | Delete
const {
[54785] Fix | Delete
getBlockAttributes,
[54786] Fix | Delete
getBlockRootClientId,
[54787] Fix | Delete
__experimentalGetAllowedPatterns
[54788] Fix | Delete
} = select(store);
[54789] Fix | Delete
const attributes = getBlockAttributes(clientId);
[54790] Fix | Delete
const _categories = attributes?.metadata?.categories || shuffle_EMPTY_ARRAY;
[54791] Fix | Delete
const _patternName = attributes?.metadata?.patternName;
[54792] Fix | Delete
const rootBlock = getBlockRootClientId(clientId);
[54793] Fix | Delete
const _patterns = __experimentalGetAllowedPatterns(rootBlock);
[54794] Fix | Delete
return {
[54795] Fix | Delete
categories: _categories,
[54796] Fix | Delete
patterns: _patterns,
[54797] Fix | Delete
patternName: _patternName
[54798] Fix | Delete
};
[54799] Fix | Delete
}, [clientId]);
[54800] Fix | Delete
const {
[54801] Fix | Delete
replaceBlocks
[54802] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[54803] Fix | Delete
const sameCategoryPatternsWithSingleWrapper = (0,external_wp_element_namespaceObject.useMemo)(() => {
[54804] Fix | Delete
if (!categories || categories.length === 0 || !patterns || patterns.length === 0) {
[54805] Fix | Delete
return shuffle_EMPTY_ARRAY;
[54806] Fix | Delete
}
[54807] Fix | Delete
return patterns.filter(pattern => {
[54808] Fix | Delete
return (
[54809] Fix | Delete
// Check if the pattern has only one top level block,
[54810] Fix | Delete
// otherwise we may shuffle to pattern that will not allow to continue shuffling.
[54811] Fix | Delete
pattern.blocks.length === 1 && pattern.categories?.some(category => {
[54812] Fix | Delete
return categories.includes(category);
[54813] Fix | Delete
}) && (
[54814] Fix | Delete
// Check if the pattern is not a synced pattern.
[54815] Fix | Delete
pattern.syncStatus === 'unsynced' || !pattern.id)
[54816] Fix | Delete
);
[54817] Fix | Delete
});
[54818] Fix | Delete
}, [categories, patterns]);
[54819] Fix | Delete
if (sameCategoryPatternsWithSingleWrapper.length < 2) {
[54820] Fix | Delete
return null;
[54821] Fix | Delete
}
[54822] Fix | Delete
function getNextPattern() {
[54823] Fix | Delete
const numberOfPatterns = sameCategoryPatternsWithSingleWrapper.length;
[54824] Fix | Delete
const patternIndex = sameCategoryPatternsWithSingleWrapper.findIndex(({
[54825] Fix | Delete
name
[54826] Fix | Delete
}) => name === patternName);
[54827] Fix | Delete
const nextPatternIndex = patternIndex + 1 < numberOfPatterns ? patternIndex + 1 : 0;
[54828] Fix | Delete
return sameCategoryPatternsWithSingleWrapper[nextPatternIndex];
[54829] Fix | Delete
}
[54830] Fix | Delete
const ComponentToUse = as;
[54831] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentToUse, {
[54832] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Shuffle'),
[54833] Fix | Delete
icon: library_shuffle,
[54834] Fix | Delete
onClick: () => {
[54835] Fix | Delete
const nextPattern = getNextPattern();
[54836] Fix | Delete
nextPattern.blocks[0].attributes = {
[54837] Fix | Delete
...nextPattern.blocks[0].attributes,
[54838] Fix | Delete
metadata: {
[54839] Fix | Delete
...nextPattern.blocks[0].attributes.metadata,
[54840] Fix | Delete
categories
[54841] Fix | Delete
}
[54842] Fix | Delete
};
[54843] Fix | Delete
replaceBlocks(clientId, nextPattern.blocks);
[54844] Fix | Delete
}
[54845] Fix | Delete
});
[54846] Fix | Delete
}
[54847] Fix | Delete
[54848] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/use-has-block-controls.js
[54849] Fix | Delete
/**
[54850] Fix | Delete
* WordPress dependencies
[54851] Fix | Delete
*/
[54852] Fix | Delete
[54853] Fix | Delete
[54854] Fix | Delete
[54855] Fix | Delete
/**
[54856] Fix | Delete
* Internal dependencies
[54857] Fix | Delete
*/
[54858] Fix | Delete
[54859] Fix | Delete
function useHasAnyBlockControls() {
[54860] Fix | Delete
let hasAnyBlockControls = false;
[54861] Fix | Delete
for (const group in block_controls_groups) {
[54862] Fix | Delete
// It is safe to violate the rules of hooks here as the `groups` object
[54863] Fix | Delete
// is static and will not change length between renders. Do not return
[54864] Fix | Delete
// early as that will cause the hook to be called a different number of
[54865] Fix | Delete
// times between renders.
[54866] Fix | Delete
// eslint-disable-next-line react-hooks/rules-of-hooks
[54867] Fix | Delete
if (useHasBlockControls(group)) {
[54868] Fix | Delete
hasAnyBlockControls = true;
[54869] Fix | Delete
}
[54870] Fix | Delete
}
[54871] Fix | Delete
return hasAnyBlockControls;
[54872] Fix | Delete
}
[54873] Fix | Delete
function useHasBlockControls(group = 'default') {
[54874] Fix | Delete
const Slot = block_controls_groups[group]?.Slot;
[54875] Fix | Delete
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(Slot?.__unstableName);
[54876] Fix | Delete
if (!Slot) {
[54877] Fix | Delete
true ? external_wp_warning_default()(`Unknown BlockControls group "${group}" provided.`) : 0;
[54878] Fix | Delete
return null;
[54879] Fix | Delete
}
[54880] Fix | Delete
return !!fills?.length;
[54881] Fix | Delete
}
[54882] Fix | Delete
[54883] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/use-has-block-toolbar.js
[54884] Fix | Delete
/**
[54885] Fix | Delete
* WordPress dependencies
[54886] Fix | Delete
*/
[54887] Fix | Delete
[54888] Fix | Delete
[54889] Fix | Delete
/**
[54890] Fix | Delete
* Internal dependencies
[54891] Fix | Delete
*/
[54892] Fix | Delete
[54893] Fix | Delete
[54894] Fix | Delete
[54895] Fix | Delete
/**
[54896] Fix | Delete
* Returns true if the block toolbar should be shown.
[54897] Fix | Delete
*
[54898] Fix | Delete
* @return {boolean} Whether the block toolbar component will be rendered.
[54899] Fix | Delete
*/
[54900] Fix | Delete
function useHasBlockToolbar() {
[54901] Fix | Delete
const {
[54902] Fix | Delete
isToolbarEnabled,
[54903] Fix | Delete
isDefaultEditingMode
[54904] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[54905] Fix | Delete
const {
[54906] Fix | Delete
getBlockEditingMode,
[54907] Fix | Delete
getBlockName,
[54908] Fix | Delete
getBlockSelectionStart
[54909] Fix | Delete
} = select(store);
[54910] Fix | Delete
[54911] Fix | Delete
// we only care about the 1st selected block
[54912] Fix | Delete
// for the toolbar, so we use getBlockSelectionStart
[54913] Fix | Delete
// instead of getSelectedBlockClientIds
[54914] Fix | Delete
const selectedBlockClientId = getBlockSelectionStart();
[54915] Fix | Delete
const blockType = selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId));
[54916] Fix | Delete
return {
[54917] Fix | Delete
isToolbarEnabled: blockType && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalToolbar', true),
[54918] Fix | Delete
isDefaultEditingMode: getBlockEditingMode(selectedBlockClientId) === 'default'
[54919] Fix | Delete
};
[54920] Fix | Delete
}, []);
[54921] Fix | Delete
const hasAnyBlockControls = useHasAnyBlockControls();
[54922] Fix | Delete
if (!isToolbarEnabled || !isDefaultEditingMode && !hasAnyBlockControls) {
[54923] Fix | Delete
return false;
[54924] Fix | Delete
}
[54925] Fix | Delete
return true;
[54926] Fix | Delete
}
[54927] Fix | Delete
[54928] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js
[54929] Fix | Delete
/**
[54930] Fix | Delete
* External dependencies
[54931] Fix | Delete
*/
[54932] Fix | Delete
[54933] Fix | Delete
[54934] Fix | Delete
/**
[54935] Fix | Delete
* WordPress dependencies
[54936] Fix | Delete
*/
[54937] Fix | Delete
[54938] Fix | Delete
[54939] Fix | Delete
[54940] Fix | Delete
[54941] Fix | Delete
[54942] Fix | Delete
[54943] Fix | Delete
[54944] Fix | Delete
/**
[54945] Fix | Delete
* Internal dependencies
[54946] Fix | Delete
*/
[54947] Fix | Delete
[54948] Fix | Delete
[54949] Fix | Delete
[54950] Fix | Delete
[54951] Fix | Delete
[54952] Fix | Delete
[54953] Fix | Delete
[54954] Fix | Delete
[54955] Fix | Delete
[54956] Fix | Delete
[54957] Fix | Delete
[54958] Fix | Delete
[54959] Fix | Delete
[54960] Fix | Delete
[54961] Fix | Delete
[54962] Fix | Delete
[54963] Fix | Delete
/**
[54964] Fix | Delete
* Renders the block toolbar.
[54965] Fix | Delete
*
[54966] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md
[54967] Fix | Delete
*
[54968] Fix | Delete
* @param {Object} props Components props.
[54969] Fix | Delete
* @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.
[54970] Fix | Delete
* @param {boolean} props.focusOnMount Focus the toolbar when mounted.
[54971] Fix | Delete
* @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus.
[54972] Fix | Delete
* @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes.
[54973] Fix | Delete
* @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.
[54974] Fix | Delete
*/
[54975] Fix | Delete
[54976] Fix | Delete
[54977] Fix | Delete
[54978] Fix | Delete
function PrivateBlockToolbar({
[54979] Fix | Delete
hideDragHandle,
[54980] Fix | Delete
focusOnMount,
[54981] Fix | Delete
__experimentalInitialIndex,
[54982] Fix | Delete
__experimentalOnIndexChange,
[54983] Fix | Delete
variant = 'unstyled'
[54984] Fix | Delete
}) {
[54985] Fix | Delete
const {
[54986] Fix | Delete
blockClientId,
[54987] Fix | Delete
blockClientIds,
[54988] Fix | Delete
isDefaultEditingMode,
[54989] Fix | Delete
blockType,
[54990] Fix | Delete
toolbarKey,
[54991] Fix | Delete
shouldShowVisualToolbar,
[54992] Fix | Delete
showParentSelector,
[54993] Fix | Delete
isUsingBindings
[54994] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[54995] Fix | Delete
const {
[54996] Fix | Delete
getBlockName,
[54997] Fix | Delete
getBlockMode,
[54998] Fix | Delete
getBlockParents,
[54999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function