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
* @return {JSX.Element} Icon component
[19500] Fix | Delete
*/
[19501] Fix | Delete
function Icon({
[19502] Fix | Delete
icon,
[19503] Fix | Delete
size = 24,
[19504] Fix | Delete
...props
[19505] Fix | Delete
}, ref) {
[19506] Fix | Delete
return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
[19507] Fix | Delete
width: size,
[19508] Fix | Delete
height: size,
[19509] Fix | Delete
...props,
[19510] Fix | Delete
ref
[19511] Fix | Delete
});
[19512] Fix | Delete
}
[19513] Fix | Delete
/* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon));
[19514] Fix | Delete
[19515] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js
[19516] Fix | Delete
/**
[19517] Fix | Delete
* WordPress dependencies
[19518] Fix | Delete
*/
[19519] Fix | Delete
[19520] Fix | Delete
[19521] Fix | Delete
const positionCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[19522] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[19523] Fix | Delete
viewBox: "0 0 24 24",
[19524] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[19525] Fix | Delete
d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"
[19526] Fix | Delete
})
[19527] Fix | Delete
});
[19528] Fix | Delete
/* harmony default export */ const position_center = (positionCenter);
[19529] Fix | Delete
[19530] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js
[19531] Fix | Delete
/**
[19532] Fix | Delete
* WordPress dependencies
[19533] Fix | Delete
*/
[19534] Fix | Delete
[19535] Fix | Delete
[19536] Fix | Delete
const stretchWide = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[19537] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[19538] Fix | Delete
viewBox: "0 0 24 24",
[19539] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[19540] Fix | Delete
d: "M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"
[19541] Fix | Delete
})
[19542] Fix | Delete
});
[19543] Fix | Delete
/* harmony default export */ const stretch_wide = (stretchWide);
[19544] Fix | Delete
[19545] Fix | Delete
;// CONCATENATED MODULE: external ["wp","styleEngine"]
[19546] Fix | Delete
const external_wp_styleEngine_namespaceObject = window["wp"]["styleEngine"];
[19547] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/constrained.js
[19548] Fix | Delete
/**
[19549] Fix | Delete
* WordPress dependencies
[19550] Fix | Delete
*/
[19551] Fix | Delete
[19552] Fix | Delete
[19553] Fix | Delete
[19554] Fix | Delete
[19555] Fix | Delete
[19556] Fix | Delete
/**
[19557] Fix | Delete
* Internal dependencies
[19558] Fix | Delete
*/
[19559] Fix | Delete
[19560] Fix | Delete
[19561] Fix | Delete
[19562] Fix | Delete
[19563] Fix | Delete
[19564] Fix | Delete
[19565] Fix | Delete
[19566] Fix | Delete
[19567] Fix | Delete
/* harmony default export */ const constrained = ({
[19568] Fix | Delete
name: 'constrained',
[19569] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Constrained'),
[19570] Fix | Delete
inspectorControls: function DefaultLayoutInspectorControls({
[19571] Fix | Delete
layout,
[19572] Fix | Delete
onChange,
[19573] Fix | Delete
layoutBlockSupport = {}
[19574] Fix | Delete
}) {
[19575] Fix | Delete
const {
[19576] Fix | Delete
wideSize,
[19577] Fix | Delete
contentSize,
[19578] Fix | Delete
justifyContent = 'center'
[19579] Fix | Delete
} = layout;
[19580] Fix | Delete
const {
[19581] Fix | Delete
allowJustification = true,
[19582] Fix | Delete
allowCustomContentAndWideSize = true
[19583] Fix | Delete
} = layoutBlockSupport;
[19584] Fix | Delete
const onJustificationChange = value => {
[19585] Fix | Delete
onChange({
[19586] Fix | Delete
...layout,
[19587] Fix | Delete
justifyContent: value
[19588] Fix | Delete
});
[19589] Fix | Delete
};
[19590] Fix | Delete
const justificationOptions = [{
[19591] Fix | Delete
value: 'left',
[19592] Fix | Delete
icon: justify_left,
[19593] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Justify items left')
[19594] Fix | Delete
}, {
[19595] Fix | Delete
value: 'center',
[19596] Fix | Delete
icon: justify_center,
[19597] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Justify items center')
[19598] Fix | Delete
}, {
[19599] Fix | Delete
value: 'right',
[19600] Fix | Delete
icon: justify_right,
[19601] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Justify items right')
[19602] Fix | Delete
}];
[19603] Fix | Delete
const [availableUnits] = use_settings_useSettings('spacing.units');
[19604] Fix | Delete
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
[19605] Fix | Delete
availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw']
[19606] Fix | Delete
});
[19607] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[19608] Fix | Delete
children: [allowCustomContentAndWideSize && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[19609] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[19610] Fix | Delete
className: "block-editor-hooks__layout-controls",
[19611] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[19612] Fix | Delete
className: "block-editor-hooks__layout-controls-unit",
[19613] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[19614] Fix | Delete
className: "block-editor-hooks__layout-controls-unit-input",
[19615] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Content'),
[19616] Fix | Delete
labelPosition: "top",
[19617] Fix | Delete
__unstableInputWidth: "80px",
[19618] Fix | Delete
value: contentSize || wideSize || '',
[19619] Fix | Delete
onChange: nextWidth => {
[19620] Fix | Delete
nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
[19621] Fix | Delete
onChange({
[19622] Fix | Delete
...layout,
[19623] Fix | Delete
contentSize: nextWidth
[19624] Fix | Delete
});
[19625] Fix | Delete
},
[19626] Fix | Delete
units: units
[19627] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[19628] Fix | Delete
icon: position_center
[19629] Fix | Delete
})]
[19630] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[19631] Fix | Delete
className: "block-editor-hooks__layout-controls-unit",
[19632] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[19633] Fix | Delete
className: "block-editor-hooks__layout-controls-unit-input",
[19634] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Wide'),
[19635] Fix | Delete
labelPosition: "top",
[19636] Fix | Delete
__unstableInputWidth: "80px",
[19637] Fix | Delete
value: wideSize || contentSize || '',
[19638] Fix | Delete
onChange: nextWidth => {
[19639] Fix | Delete
nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
[19640] Fix | Delete
onChange({
[19641] Fix | Delete
...layout,
[19642] Fix | Delete
wideSize: nextWidth
[19643] Fix | Delete
});
[19644] Fix | Delete
},
[19645] Fix | Delete
units: units
[19646] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[19647] Fix | Delete
icon: stretch_wide
[19648] Fix | Delete
})]
[19649] Fix | Delete
})]
[19650] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[19651] Fix | Delete
className: "block-editor-hooks__layout-controls-helptext",
[19652] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Customize the width for all elements that are assigned to the center or wide columns.')
[19653] Fix | Delete
})]
[19654] Fix | Delete
}), allowJustification && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
[19655] Fix | Delete
__nextHasNoMarginBottom: true,
[19656] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Justification'),
[19657] Fix | Delete
value: justifyContent,
[19658] Fix | Delete
onChange: onJustificationChange,
[19659] Fix | Delete
children: justificationOptions.map(({
[19660] Fix | Delete
value,
[19661] Fix | Delete
icon,
[19662] Fix | Delete
label
[19663] Fix | Delete
}) => {
[19664] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, {
[19665] Fix | Delete
value: value,
[19666] Fix | Delete
icon: icon,
[19667] Fix | Delete
label: label
[19668] Fix | Delete
}, value);
[19669] Fix | Delete
})
[19670] Fix | Delete
})]
[19671] Fix | Delete
});
[19672] Fix | Delete
},
[19673] Fix | Delete
toolBarControls: function DefaultLayoutToolbarControls() {
[19674] Fix | Delete
return null;
[19675] Fix | Delete
},
[19676] Fix | Delete
getLayoutStyle: function getLayoutStyle({
[19677] Fix | Delete
selector,
[19678] Fix | Delete
layout = {},
[19679] Fix | Delete
style,
[19680] Fix | Delete
blockName,
[19681] Fix | Delete
hasBlockGapSupport,
[19682] Fix | Delete
layoutDefinitions = LAYOUT_DEFINITIONS
[19683] Fix | Delete
}) {
[19684] Fix | Delete
const {
[19685] Fix | Delete
contentSize,
[19686] Fix | Delete
wideSize,
[19687] Fix | Delete
justifyContent
[19688] Fix | Delete
} = layout;
[19689] Fix | Delete
const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap);
[19690] Fix | Delete
[19691] Fix | Delete
// If a block's block.json skips serialization for spacing or
[19692] Fix | Delete
// spacing.blockGap, don't apply the user-defined value to the styles.
[19693] Fix | Delete
let blockGapValue = '';
[19694] Fix | Delete
if (!shouldSkipSerialization(blockName, 'spacing', 'blockGap')) {
[19695] Fix | Delete
// If an object is provided only use the 'top' value for this kind of gap.
[19696] Fix | Delete
if (blockGapStyleValue?.top) {
[19697] Fix | Delete
blockGapValue = getGapCSSValue(blockGapStyleValue?.top);
[19698] Fix | Delete
} else if (typeof blockGapStyleValue === 'string') {
[19699] Fix | Delete
blockGapValue = getGapCSSValue(blockGapStyleValue);
[19700] Fix | Delete
}
[19701] Fix | Delete
}
[19702] Fix | Delete
const marginLeft = justifyContent === 'left' ? '0 !important' : 'auto !important';
[19703] Fix | Delete
const marginRight = justifyContent === 'right' ? '0 !important' : 'auto !important';
[19704] Fix | Delete
let output = !!contentSize || !!wideSize ? `
[19705] Fix | Delete
${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')} {
[19706] Fix | Delete
max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
[19707] Fix | Delete
margin-left: ${marginLeft};
[19708] Fix | Delete
margin-right: ${marginRight};
[19709] Fix | Delete
}
[19710] Fix | Delete
${appendSelectors(selector, '> .alignwide')} {
[19711] Fix | Delete
max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize};
[19712] Fix | Delete
}
[19713] Fix | Delete
${appendSelectors(selector, '> .alignfull')} {
[19714] Fix | Delete
max-width: none;
[19715] Fix | Delete
}
[19716] Fix | Delete
` : '';
[19717] Fix | Delete
if (justifyContent === 'left') {
[19718] Fix | Delete
output += `${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')}
[19719] Fix | Delete
{ margin-left: ${marginLeft}; }`;
[19720] Fix | Delete
} else if (justifyContent === 'right') {
[19721] Fix | Delete
output += `${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')}
[19722] Fix | Delete
{ margin-right: ${marginRight}; }`;
[19723] Fix | Delete
}
[19724] Fix | Delete
[19725] Fix | Delete
// If there is custom padding, add negative margins for alignfull blocks.
[19726] Fix | Delete
if (style?.spacing?.padding) {
[19727] Fix | Delete
// The style object might be storing a preset so we need to make sure we get a usable value.
[19728] Fix | Delete
const paddingValues = (0,external_wp_styleEngine_namespaceObject.getCSSRules)(style);
[19729] Fix | Delete
paddingValues.forEach(rule => {
[19730] Fix | Delete
if (rule.key === 'paddingRight') {
[19731] Fix | Delete
// Add unit if 0, to avoid calc(0 * -1) which is invalid.
[19732] Fix | Delete
const paddingRightValue = rule.value === '0' ? '0px' : rule.value;
[19733] Fix | Delete
output += `
[19734] Fix | Delete
${appendSelectors(selector, '> .alignfull')} {
[19735] Fix | Delete
margin-right: calc(${paddingRightValue} * -1);
[19736] Fix | Delete
}
[19737] Fix | Delete
`;
[19738] Fix | Delete
} else if (rule.key === 'paddingLeft') {
[19739] Fix | Delete
// Add unit if 0, to avoid calc(0 * -1) which is invalid.
[19740] Fix | Delete
const paddingLeftValue = rule.value === '0' ? '0px' : rule.value;
[19741] Fix | Delete
output += `
[19742] Fix | Delete
${appendSelectors(selector, '> .alignfull')} {
[19743] Fix | Delete
margin-left: calc(${paddingLeftValue} * -1);
[19744] Fix | Delete
}
[19745] Fix | Delete
`;
[19746] Fix | Delete
}
[19747] Fix | Delete
});
[19748] Fix | Delete
}
[19749] Fix | Delete
[19750] Fix | Delete
// Output blockGap styles based on rules contained in layout definitions in theme.json.
[19751] Fix | Delete
if (hasBlockGapSupport && blockGapValue) {
[19752] Fix | Delete
output += getBlockGapCSS(selector, layoutDefinitions, 'constrained', blockGapValue);
[19753] Fix | Delete
}
[19754] Fix | Delete
return output;
[19755] Fix | Delete
},
[19756] Fix | Delete
getOrientation() {
[19757] Fix | Delete
return 'vertical';
[19758] Fix | Delete
},
[19759] Fix | Delete
getAlignments(layout) {
[19760] Fix | Delete
const alignmentInfo = getAlignmentsInfo(layout);
[19761] Fix | Delete
if (layout.alignments !== undefined) {
[19762] Fix | Delete
if (!layout.alignments.includes('none')) {
[19763] Fix | Delete
layout.alignments.unshift('none');
[19764] Fix | Delete
}
[19765] Fix | Delete
return layout.alignments.map(alignment => ({
[19766] Fix | Delete
name: alignment,
[19767] Fix | Delete
info: alignmentInfo[alignment]
[19768] Fix | Delete
}));
[19769] Fix | Delete
}
[19770] Fix | Delete
const {
[19771] Fix | Delete
contentSize,
[19772] Fix | Delete
wideSize
[19773] Fix | Delete
} = layout;
[19774] Fix | Delete
const alignments = [{
[19775] Fix | Delete
name: 'left'
[19776] Fix | Delete
}, {
[19777] Fix | Delete
name: 'center'
[19778] Fix | Delete
}, {
[19779] Fix | Delete
name: 'right'
[19780] Fix | Delete
}];
[19781] Fix | Delete
if (contentSize) {
[19782] Fix | Delete
alignments.unshift({
[19783] Fix | Delete
name: 'full'
[19784] Fix | Delete
});
[19785] Fix | Delete
}
[19786] Fix | Delete
if (wideSize) {
[19787] Fix | Delete
alignments.unshift({
[19788] Fix | Delete
name: 'wide',
[19789] Fix | Delete
info: alignmentInfo.wide
[19790] Fix | Delete
});
[19791] Fix | Delete
}
[19792] Fix | Delete
alignments.unshift({
[19793] Fix | Delete
name: 'none',
[19794] Fix | Delete
info: alignmentInfo.none
[19795] Fix | Delete
});
[19796] Fix | Delete
return alignments;
[19797] Fix | Delete
}
[19798] Fix | Delete
});
[19799] Fix | Delete
[19800] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js
[19801] Fix | Delete
/**
[19802] Fix | Delete
* WordPress dependencies
[19803] Fix | Delete
*/
[19804] Fix | Delete
[19805] Fix | Delete
[19806] Fix | Delete
[19807] Fix | Delete
const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({
[19808] Fix | Delete
refsMap: (0,external_wp_compose_namespaceObject.observableMap)()
[19809] Fix | Delete
});
[19810] Fix | Delete
function BlockRefsProvider({
[19811] Fix | Delete
children
[19812] Fix | Delete
}) {
[19813] Fix | Delete
const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[19814] Fix | Delete
refsMap: (0,external_wp_compose_namespaceObject.observableMap)()
[19815] Fix | Delete
}), []);
[19816] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefs.Provider, {
[19817] Fix | Delete
value: value,
[19818] Fix | Delete
children: children
[19819] Fix | Delete
});
[19820] Fix | Delete
}
[19821] Fix | Delete
[19822] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js
[19823] Fix | Delete
/**
[19824] Fix | Delete
* WordPress dependencies
[19825] Fix | Delete
*/
[19826] Fix | Delete
[19827] Fix | Delete
[19828] Fix | Delete
[19829] Fix | Delete
/**
[19830] Fix | Delete
* Internal dependencies
[19831] Fix | Delete
*/
[19832] Fix | Delete
[19833] Fix | Delete
[19834] Fix | Delete
/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
[19835] Fix | Delete
/** @typedef {import('@wordpress/element').RefObject} RefObject */
[19836] Fix | Delete
[19837] Fix | Delete
/**
[19838] Fix | Delete
* Provides a ref to the BlockRefs context.
[19839] Fix | Delete
*
[19840] Fix | Delete
* @param {string} clientId The client ID of the element ref.
[19841] Fix | Delete
*
[19842] Fix | Delete
* @return {RefCallback} Ref callback.
[19843] Fix | Delete
*/
[19844] Fix | Delete
function useBlockRefProvider(clientId) {
[19845] Fix | Delete
const {
[19846] Fix | Delete
refsMap
[19847] Fix | Delete
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
[19848] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
[19849] Fix | Delete
refsMap.set(clientId, element);
[19850] Fix | Delete
return () => refsMap.delete(clientId);
[19851] Fix | Delete
}, [clientId]);
[19852] Fix | Delete
}
[19853] Fix | Delete
[19854] Fix | Delete
/**
[19855] Fix | Delete
* Gets a ref pointing to the current block element. Continues to return the same
[19856] Fix | Delete
* stable ref object even if the `clientId` argument changes. This hook is not
[19857] Fix | Delete
* reactive, i.e., it won't trigger a rerender of the calling component if the
[19858] Fix | Delete
* ref value changes. For reactive use cases there is the `useBlockElement` hook.
[19859] Fix | Delete
*
[19860] Fix | Delete
* @param {string} clientId The client ID to get a ref for.
[19861] Fix | Delete
*
[19862] Fix | Delete
* @return {RefObject} A ref containing the element.
[19863] Fix | Delete
*/
[19864] Fix | Delete
function useBlockRef(clientId) {
[19865] Fix | Delete
const {
[19866] Fix | Delete
refsMap
[19867] Fix | Delete
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
[19868] Fix | Delete
const latestClientId = (0,external_wp_element_namespaceObject.useRef)();
[19869] Fix | Delete
latestClientId.current = clientId;
[19870] Fix | Delete
[19871] Fix | Delete
// Always return an object, even if no ref exists for a given client ID, so
[19872] Fix | Delete
// that `current` works at a later point.
[19873] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => ({
[19874] Fix | Delete
get current() {
[19875] Fix | Delete
var _refsMap$get;
[19876] Fix | Delete
return (_refsMap$get = refsMap.get(latestClientId.current)) !== null && _refsMap$get !== void 0 ? _refsMap$get : null;
[19877] Fix | Delete
}
[19878] Fix | Delete
}), [refsMap]);
[19879] Fix | Delete
}
[19880] Fix | Delete
[19881] Fix | Delete
/**
[19882] Fix | Delete
* Return the element for a given client ID. Updates whenever the element
[19883] Fix | Delete
* changes, becomes available, or disappears.
[19884] Fix | Delete
*
[19885] Fix | Delete
* @param {string} clientId The client ID to an element for.
[19886] Fix | Delete
*
[19887] Fix | Delete
* @return {Element|null} The block's wrapper element.
[19888] Fix | Delete
*/
[19889] Fix | Delete
function useBlockElement(clientId) {
[19890] Fix | Delete
const {
[19891] Fix | Delete
refsMap
[19892] Fix | Delete
} = (0,external_wp_element_namespaceObject.useContext)(BlockRefs);
[19893] Fix | Delete
const [blockElement, setBlockElement] = (0,external_wp_element_namespaceObject.useState)(null);
[19894] Fix | Delete
// Delay setting the resulting `blockElement` until an effect. If the block element
[19895] Fix | Delete
// changes (i.e., the block is unmounted and re-mounted), this allows enough time
[19896] Fix | Delete
// for the ref callbacks to clean up the old element and set the new one.
[19897] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[19898] Fix | Delete
setBlockElement(refsMap.get(clientId));
[19899] Fix | Delete
return refsMap.subscribe(clientId, () => setBlockElement(refsMap.get(clientId)));
[19900] Fix | Delete
}, [refsMap, clientId]);
[19901] Fix | Delete
return blockElement;
[19902] Fix | Delete
}
[19903] Fix | Delete
[19904] Fix | Delete
[19905] Fix | Delete
[19906] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-popover/use-popover-scroll.js
[19907] Fix | Delete
/**
[19908] Fix | Delete
* WordPress dependencies
[19909] Fix | Delete
*/
[19910] Fix | Delete
[19911] Fix | Delete
[19912] Fix | Delete
/**
[19913] Fix | Delete
* Allow scrolling "through" popovers over the canvas. This is only called for
[19914] Fix | Delete
* as long as the pointer is over a popover. Do not use React events because it
[19915] Fix | Delete
* will bubble through portals.
[19916] Fix | Delete
*
[19917] Fix | Delete
* @param {Object} scrollableRef
[19918] Fix | Delete
*/
[19919] Fix | Delete
function usePopoverScroll(scrollableRef) {
[19920] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[19921] Fix | Delete
if (!scrollableRef) {
[19922] Fix | Delete
return;
[19923] Fix | Delete
}
[19924] Fix | Delete
function onWheel(event) {
[19925] Fix | Delete
const {
[19926] Fix | Delete
deltaX,
[19927] Fix | Delete
deltaY
[19928] Fix | Delete
} = event;
[19929] Fix | Delete
scrollableRef.current.scrollBy(deltaX, deltaY);
[19930] Fix | Delete
}
[19931] Fix | Delete
// Tell the browser that we do not call event.preventDefault
[19932] Fix | Delete
// See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
[19933] Fix | Delete
const options = {
[19934] Fix | Delete
passive: true
[19935] Fix | Delete
};
[19936] Fix | Delete
node.addEventListener('wheel', onWheel, options);
[19937] Fix | Delete
return () => {
[19938] Fix | Delete
node.removeEventListener('wheel', onWheel, options);
[19939] Fix | Delete
};
[19940] Fix | Delete
}, [scrollableRef]);
[19941] Fix | Delete
}
[19942] Fix | Delete
/* harmony default export */ const use_popover_scroll = (usePopoverScroll);
[19943] Fix | Delete
[19944] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-popover/index.js
[19945] Fix | Delete
/**
[19946] Fix | Delete
* External dependencies
[19947] Fix | Delete
*/
[19948] Fix | Delete
[19949] Fix | Delete
[19950] Fix | Delete
/**
[19951] Fix | Delete
* WordPress dependencies
[19952] Fix | Delete
*/
[19953] Fix | Delete
[19954] Fix | Delete
[19955] Fix | Delete
[19956] Fix | Delete
[19957] Fix | Delete
/**
[19958] Fix | Delete
* Internal dependencies
[19959] Fix | Delete
*/
[19960] Fix | Delete
[19961] Fix | Delete
[19962] Fix | Delete
[19963] Fix | Delete
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
[19964] Fix | Delete
function BlockPopover({
[19965] Fix | Delete
clientId,
[19966] Fix | Delete
bottomClientId,
[19967] Fix | Delete
children,
[19968] Fix | Delete
__unstablePopoverSlot,
[19969] Fix | Delete
__unstableContentRef,
[19970] Fix | Delete
shift = true,
[19971] Fix | Delete
...props
[19972] Fix | Delete
}, ref) {
[19973] Fix | Delete
const selectedElement = useBlockElement(clientId);
[19974] Fix | Delete
const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
[19975] Fix | Delete
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, use_popover_scroll(__unstableContentRef)]);
[19976] Fix | Delete
const [popoverDimensionsRecomputeCounter, forceRecomputePopoverDimensions] = (0,external_wp_element_namespaceObject.useReducer)(
[19977] Fix | Delete
// Module is there to make sure that the counter doesn't overflow.
[19978] Fix | Delete
s => (s + 1) % MAX_POPOVER_RECOMPUTE_COUNTER, 0);
[19979] Fix | Delete
[19980] Fix | Delete
// When blocks are moved up/down, they are animated to their new position by
[19981] Fix | Delete
// updating the `transform` property manually (i.e. without using CSS
[19982] Fix | Delete
// transitions or animations). The animation, which can also scroll the block
[19983] Fix | Delete
// editor, can sometimes cause the position of the Popover to get out of sync.
[19984] Fix | Delete
// A MutationObserver is therefore used to make sure that changes to the
[19985] Fix | Delete
// selectedElement's attribute (i.e. `transform`) can be tracked and used to
[19986] Fix | Delete
// trigger the Popover to rerender.
[19987] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[19988] Fix | Delete
if (!selectedElement) {
[19989] Fix | Delete
return;
[19990] Fix | Delete
}
[19991] Fix | Delete
const observer = new window.MutationObserver(forceRecomputePopoverDimensions);
[19992] Fix | Delete
observer.observe(selectedElement, {
[19993] Fix | Delete
attributes: true
[19994] Fix | Delete
});
[19995] Fix | Delete
return () => {
[19996] Fix | Delete
observer.disconnect();
[19997] Fix | Delete
};
[19998] Fix | Delete
}, [selectedElement]);
[19999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function