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
// If axial gap is not enabled, treat the 'top' value as the shorthand gap value.
[31500] Fix | Delete
if (!isAxialGap && nextBoxGapValue?.hasOwnProperty('top')) {
[31501] Fix | Delete
setGapValue(nextBoxGapValue.top);
[31502] Fix | Delete
} else {
[31503] Fix | Delete
setGapValue({
[31504] Fix | Delete
top: nextBoxGapValue?.top,
[31505] Fix | Delete
left: nextBoxGapValue?.left
[31506] Fix | Delete
});
[31507] Fix | Delete
}
[31508] Fix | Delete
};
[31509] Fix | Delete
const resetGapValue = () => setGapValue(undefined);
[31510] Fix | Delete
const hasGapValue = () => !!value?.spacing?.blockGap;
[31511] Fix | Delete
[31512] Fix | Delete
// Min Height
[31513] Fix | Delete
const showMinHeightControl = useHasMinHeight(settings);
[31514] Fix | Delete
const minHeightValue = decodeValue(inheritedValue?.dimensions?.minHeight);
[31515] Fix | Delete
const setMinHeightValue = newValue => {
[31516] Fix | Delete
const tempValue = setImmutably(value, ['dimensions', 'minHeight'], newValue);
[31517] Fix | Delete
// Apply min-height, while removing any applied aspect ratio.
[31518] Fix | Delete
onChange(setImmutably(tempValue, ['dimensions', 'aspectRatio'], undefined));
[31519] Fix | Delete
};
[31520] Fix | Delete
const resetMinHeightValue = () => {
[31521] Fix | Delete
setMinHeightValue(undefined);
[31522] Fix | Delete
};
[31523] Fix | Delete
const hasMinHeightValue = () => !!value?.dimensions?.minHeight;
[31524] Fix | Delete
[31525] Fix | Delete
// Aspect Ratio
[31526] Fix | Delete
const showAspectRatioControl = useHasAspectRatio(settings);
[31527] Fix | Delete
const aspectRatioValue = decodeValue(inheritedValue?.dimensions?.aspectRatio);
[31528] Fix | Delete
const setAspectRatioValue = newValue => {
[31529] Fix | Delete
const tempValue = setImmutably(value, ['dimensions', 'aspectRatio'], newValue);
[31530] Fix | Delete
// Apply aspect-ratio, while removing any applied min-height.
[31531] Fix | Delete
onChange(setImmutably(tempValue, ['dimensions', 'minHeight'], undefined));
[31532] Fix | Delete
};
[31533] Fix | Delete
const hasAspectRatioValue = () => !!value?.dimensions?.aspectRatio;
[31534] Fix | Delete
[31535] Fix | Delete
// Child Layout
[31536] Fix | Delete
const showChildLayoutControl = useHasChildLayout(settings);
[31537] Fix | Delete
const childLayout = inheritedValue?.layout;
[31538] Fix | Delete
const setChildLayout = newChildLayout => {
[31539] Fix | Delete
onChange({
[31540] Fix | Delete
...value,
[31541] Fix | Delete
layout: {
[31542] Fix | Delete
...newChildLayout
[31543] Fix | Delete
}
[31544] Fix | Delete
});
[31545] Fix | Delete
};
[31546] Fix | Delete
const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => {
[31547] Fix | Delete
return {
[31548] Fix | Delete
...previousValue,
[31549] Fix | Delete
layout: utils_cleanEmptyObject({
[31550] Fix | Delete
...previousValue?.layout,
[31551] Fix | Delete
contentSize: undefined,
[31552] Fix | Delete
wideSize: undefined,
[31553] Fix | Delete
selfStretch: undefined,
[31554] Fix | Delete
flexSize: undefined,
[31555] Fix | Delete
columnStart: undefined,
[31556] Fix | Delete
rowStart: undefined,
[31557] Fix | Delete
columnSpan: undefined,
[31558] Fix | Delete
rowSpan: undefined
[31559] Fix | Delete
}),
[31560] Fix | Delete
spacing: {
[31561] Fix | Delete
...previousValue?.spacing,
[31562] Fix | Delete
padding: undefined,
[31563] Fix | Delete
margin: undefined,
[31564] Fix | Delete
blockGap: undefined
[31565] Fix | Delete
},
[31566] Fix | Delete
dimensions: {
[31567] Fix | Delete
...previousValue?.dimensions,
[31568] Fix | Delete
minHeight: undefined,
[31569] Fix | Delete
aspectRatio: undefined
[31570] Fix | Delete
}
[31571] Fix | Delete
};
[31572] Fix | Delete
}, []);
[31573] Fix | Delete
const onMouseLeaveControls = () => onVisualize(false);
[31574] Fix | Delete
const inputProps = {
[31575] Fix | Delete
min: minMarginValue,
[31576] Fix | Delete
onDragStart: () => {
[31577] Fix | Delete
//Reset to 0 in case the value was negative.
[31578] Fix | Delete
setMinMarginValue(0);
[31579] Fix | Delete
},
[31580] Fix | Delete
onDragEnd: () => {
[31581] Fix | Delete
setMinMarginValue(minimumMargin);
[31582] Fix | Delete
}
[31583] Fix | Delete
};
[31584] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, {
[31585] Fix | Delete
resetAllFilter: resetAllFilter,
[31586] Fix | Delete
value: value,
[31587] Fix | Delete
onChange: onChange,
[31588] Fix | Delete
panelId: panelId,
[31589] Fix | Delete
children: [(showContentSizeControl || showWideSizeControl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[31590] Fix | Delete
className: "span-columns",
[31591] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Set the width of the main content area.')
[31592] Fix | Delete
}), showContentSizeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31593] Fix | Delete
className: "single-column",
[31594] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Content size'),
[31595] Fix | Delete
hasValue: hasUserSetContentSizeValue,
[31596] Fix | Delete
onDeselect: resetContentSizeValue,
[31597] Fix | Delete
isShownByDefault: (_defaultControls$cont = defaultControls.contentSize) !== null && _defaultControls$cont !== void 0 ? _defaultControls$cont : dimensions_panel_DEFAULT_CONTROLS.contentSize,
[31598] Fix | Delete
panelId: panelId,
[31599] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[31600] Fix | Delete
alignment: "flex-end",
[31601] Fix | Delete
justify: "flex-start",
[31602] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[31603] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Content'),
[31604] Fix | Delete
labelPosition: "top",
[31605] Fix | Delete
__unstableInputWidth: "80px",
[31606] Fix | Delete
value: contentSizeValue || '',
[31607] Fix | Delete
onChange: nextContentSize => {
[31608] Fix | Delete
setContentSizeValue(nextContentSize);
[31609] Fix | Delete
},
[31610] Fix | Delete
units: units
[31611] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, {
[31612] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[31613] Fix | Delete
icon: position_center
[31614] Fix | Delete
})
[31615] Fix | Delete
})]
[31616] Fix | Delete
})
[31617] Fix | Delete
}), showWideSizeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31618] Fix | Delete
className: "single-column",
[31619] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Wide size'),
[31620] Fix | Delete
hasValue: hasUserSetWideSizeValue,
[31621] Fix | Delete
onDeselect: resetWideSizeValue,
[31622] Fix | Delete
isShownByDefault: (_defaultControls$wide = defaultControls.wideSize) !== null && _defaultControls$wide !== void 0 ? _defaultControls$wide : dimensions_panel_DEFAULT_CONTROLS.wideSize,
[31623] Fix | Delete
panelId: panelId,
[31624] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[31625] Fix | Delete
alignment: "flex-end",
[31626] Fix | Delete
justify: "flex-start",
[31627] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[31628] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Wide'),
[31629] Fix | Delete
labelPosition: "top",
[31630] Fix | Delete
__unstableInputWidth: "80px",
[31631] Fix | Delete
value: wideSizeValue || '',
[31632] Fix | Delete
onChange: nextWideSize => {
[31633] Fix | Delete
setWideSizeValue(nextWideSize);
[31634] Fix | Delete
},
[31635] Fix | Delete
units: units
[31636] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, {
[31637] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[31638] Fix | Delete
icon: stretch_wide
[31639] Fix | Delete
})
[31640] Fix | Delete
})]
[31641] Fix | Delete
})
[31642] Fix | Delete
}), showPaddingControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31643] Fix | Delete
hasValue: hasPaddingValue,
[31644] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
[31645] Fix | Delete
onDeselect: resetPaddingValue,
[31646] Fix | Delete
isShownByDefault: (_defaultControls$padd = defaultControls.padding) !== null && _defaultControls$padd !== void 0 ? _defaultControls$padd : dimensions_panel_DEFAULT_CONTROLS.padding,
[31647] Fix | Delete
className: dist_clsx({
[31648] Fix | Delete
'tools-panel-item-spacing': showSpacingPresetsControl
[31649] Fix | Delete
}),
[31650] Fix | Delete
panelId: panelId,
[31651] Fix | Delete
children: [!showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalBoxControl, {
[31652] Fix | Delete
values: paddingValues,
[31653] Fix | Delete
onChange: setPaddingValues,
[31654] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
[31655] Fix | Delete
sides: paddingSides,
[31656] Fix | Delete
units: units,
[31657] Fix | Delete
allowReset: false,
[31658] Fix | Delete
splitOnAxis: isAxialPadding,
[31659] Fix | Delete
onMouseOver: onMouseOverPadding,
[31660] Fix | Delete
onMouseOut: onMouseLeaveControls
[31661] Fix | Delete
}), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, {
[31662] Fix | Delete
values: paddingValues,
[31663] Fix | Delete
onChange: setPaddingValues,
[31664] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
[31665] Fix | Delete
sides: paddingSides,
[31666] Fix | Delete
units: units,
[31667] Fix | Delete
allowReset: false,
[31668] Fix | Delete
onMouseOver: onMouseOverPadding,
[31669] Fix | Delete
onMouseOut: onMouseLeaveControls
[31670] Fix | Delete
})]
[31671] Fix | Delete
}), showMarginControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31672] Fix | Delete
hasValue: hasMarginValue,
[31673] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
[31674] Fix | Delete
onDeselect: resetMarginValue,
[31675] Fix | Delete
isShownByDefault: (_defaultControls$marg = defaultControls.margin) !== null && _defaultControls$marg !== void 0 ? _defaultControls$marg : dimensions_panel_DEFAULT_CONTROLS.margin,
[31676] Fix | Delete
className: dist_clsx({
[31677] Fix | Delete
'tools-panel-item-spacing': showSpacingPresetsControl
[31678] Fix | Delete
}),
[31679] Fix | Delete
panelId: panelId,
[31680] Fix | Delete
children: [!showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalBoxControl, {
[31681] Fix | Delete
values: marginValues,
[31682] Fix | Delete
onChange: setMarginValues,
[31683] Fix | Delete
inputProps: inputProps,
[31684] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
[31685] Fix | Delete
sides: marginSides,
[31686] Fix | Delete
units: units,
[31687] Fix | Delete
allowReset: false,
[31688] Fix | Delete
splitOnAxis: isAxialMargin,
[31689] Fix | Delete
onMouseOver: onMouseOverMargin,
[31690] Fix | Delete
onMouseOut: onMouseLeaveControls
[31691] Fix | Delete
}), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, {
[31692] Fix | Delete
values: marginValues,
[31693] Fix | Delete
onChange: setMarginValues,
[31694] Fix | Delete
minimumCustomValue: -Infinity,
[31695] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
[31696] Fix | Delete
sides: marginSides,
[31697] Fix | Delete
units: units,
[31698] Fix | Delete
allowReset: false,
[31699] Fix | Delete
onMouseOver: onMouseOverMargin,
[31700] Fix | Delete
onMouseOut: onMouseLeaveControls
[31701] Fix | Delete
})]
[31702] Fix | Delete
}), showGapControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31703] Fix | Delete
hasValue: hasGapValue,
[31704] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
[31705] Fix | Delete
onDeselect: resetGapValue,
[31706] Fix | Delete
isShownByDefault: (_defaultControls$bloc = defaultControls.blockGap) !== null && _defaultControls$bloc !== void 0 ? _defaultControls$bloc : dimensions_panel_DEFAULT_CONTROLS.blockGap,
[31707] Fix | Delete
className: dist_clsx({
[31708] Fix | Delete
'tools-panel-item-spacing': showSpacingPresetsControl
[31709] Fix | Delete
}),
[31710] Fix | Delete
panelId: panelId,
[31711] Fix | Delete
children: [!showSpacingPresetsControl && (isAxialGap ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalBoxControl, {
[31712] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
[31713] Fix | Delete
min: 0,
[31714] Fix | Delete
onChange: setGapValues,
[31715] Fix | Delete
units: units,
[31716] Fix | Delete
sides: gapSides,
[31717] Fix | Delete
values: gapValues,
[31718] Fix | Delete
allowReset: false,
[31719] Fix | Delete
splitOnAxis: isAxialGap
[31720] Fix | Delete
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[31721] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
[31722] Fix | Delete
__unstableInputWidth: "80px",
[31723] Fix | Delete
min: 0,
[31724] Fix | Delete
onChange: setGapValue,
[31725] Fix | Delete
units: units,
[31726] Fix | Delete
value: gapValue
[31727] Fix | Delete
})), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, {
[31728] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'),
[31729] Fix | Delete
min: 0,
[31730] Fix | Delete
onChange: setGapValues,
[31731] Fix | Delete
showSideInLabel: false,
[31732] Fix | Delete
sides: isAxialGap ? gapSides : ['top'] // Use 'top' as the shorthand property in non-axial configurations.
[31733] Fix | Delete
,
[31734] Fix | Delete
values: gapValues,
[31735] Fix | Delete
allowReset: false
[31736] Fix | Delete
})]
[31737] Fix | Delete
}), showChildLayoutControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ChildLayoutControl, {
[31738] Fix | Delete
value: childLayout,
[31739] Fix | Delete
onChange: setChildLayout,
[31740] Fix | Delete
parentLayout: settings?.parentLayout,
[31741] Fix | Delete
panelId: panelId,
[31742] Fix | Delete
isShownByDefault: (_defaultControls$chil = defaultControls.childLayout) !== null && _defaultControls$chil !== void 0 ? _defaultControls$chil : dimensions_panel_DEFAULT_CONTROLS.childLayout
[31743] Fix | Delete
}), showMinHeightControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31744] Fix | Delete
hasValue: hasMinHeightValue,
[31745] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
[31746] Fix | Delete
onDeselect: resetMinHeightValue,
[31747] Fix | Delete
isShownByDefault: (_defaultControls$minH = defaultControls.minHeight) !== null && _defaultControls$minH !== void 0 ? _defaultControls$minH : dimensions_panel_DEFAULT_CONTROLS.minHeight,
[31748] Fix | Delete
panelId: panelId,
[31749] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HeightControl, {
[31750] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'),
[31751] Fix | Delete
value: minHeightValue,
[31752] Fix | Delete
onChange: setMinHeightValue
[31753] Fix | Delete
})
[31754] Fix | Delete
}), showAspectRatioControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioTool, {
[31755] Fix | Delete
hasValue: hasAspectRatioValue,
[31756] Fix | Delete
value: aspectRatioValue,
[31757] Fix | Delete
onChange: setAspectRatioValue,
[31758] Fix | Delete
panelId: panelId,
[31759] Fix | Delete
isShownByDefault: (_defaultControls$aspe = defaultControls.aspectRatio) !== null && _defaultControls$aspe !== void 0 ? _defaultControls$aspe : dimensions_panel_DEFAULT_CONTROLS.aspectRatio
[31760] Fix | Delete
})]
[31761] Fix | Delete
});
[31762] Fix | Delete
}
[31763] Fix | Delete
[31764] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/spacing-visualizer.js
[31765] Fix | Delete
/**
[31766] Fix | Delete
* WordPress dependencies
[31767] Fix | Delete
*/
[31768] Fix | Delete
[31769] Fix | Delete
[31770] Fix | Delete
[31771] Fix | Delete
/**
[31772] Fix | Delete
* Internal dependencies
[31773] Fix | Delete
*/
[31774] Fix | Delete
[31775] Fix | Delete
[31776] Fix | Delete
[31777] Fix | Delete
function SpacingVisualizer({
[31778] Fix | Delete
clientId,
[31779] Fix | Delete
value,
[31780] Fix | Delete
computeStyle,
[31781] Fix | Delete
forceShow
[31782] Fix | Delete
}) {
[31783] Fix | Delete
const blockElement = useBlockElement(clientId);
[31784] Fix | Delete
const [style, updateStyle] = (0,external_wp_element_namespaceObject.useReducer)(() => computeStyle(blockElement));
[31785] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[31786] Fix | Delete
if (!blockElement) {
[31787] Fix | Delete
return;
[31788] Fix | Delete
}
[31789] Fix | Delete
// It's not sufficient to read the computed spacing value when value.spacing changes as
[31790] Fix | Delete
// useEffect may run before the browser recomputes CSS. We therefore combine
[31791] Fix | Delete
// useLayoutEffect and two rAF calls to ensure that we read the spacing after the current
[31792] Fix | Delete
// paint but before the next paint.
[31793] Fix | Delete
// See https://github.com/WordPress/gutenberg/pull/59227.
[31794] Fix | Delete
window.requestAnimationFrame(() => window.requestAnimationFrame(updateStyle));
[31795] Fix | Delete
}, [blockElement, value]);
[31796] Fix | Delete
const previousValue = (0,external_wp_element_namespaceObject.useRef)(value);
[31797] Fix | Delete
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
[31798] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[31799] Fix | Delete
if (external_wp_isShallowEqual_default()(value, previousValue.current) || forceShow) {
[31800] Fix | Delete
return;
[31801] Fix | Delete
}
[31802] Fix | Delete
setIsActive(true);
[31803] Fix | Delete
previousValue.current = value;
[31804] Fix | Delete
const timeout = setTimeout(() => {
[31805] Fix | Delete
setIsActive(false);
[31806] Fix | Delete
}, 400);
[31807] Fix | Delete
return () => {
[31808] Fix | Delete
setIsActive(false);
[31809] Fix | Delete
clearTimeout(timeout);
[31810] Fix | Delete
};
[31811] Fix | Delete
}, [value, forceShow]);
[31812] Fix | Delete
if (!isActive && !forceShow) {
[31813] Fix | Delete
return null;
[31814] Fix | Delete
}
[31815] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, {
[31816] Fix | Delete
clientId: clientId,
[31817] Fix | Delete
__unstablePopoverSlot: "block-toolbar",
[31818] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[31819] Fix | Delete
className: "block-editor__spacing-visualizer",
[31820] Fix | Delete
style: style
[31821] Fix | Delete
})
[31822] Fix | Delete
});
[31823] Fix | Delete
}
[31824] Fix | Delete
function spacing_visualizer_getComputedCSS(element, property) {
[31825] Fix | Delete
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
[31826] Fix | Delete
}
[31827] Fix | Delete
function MarginVisualizer({
[31828] Fix | Delete
clientId,
[31829] Fix | Delete
value,
[31830] Fix | Delete
forceShow
[31831] Fix | Delete
}) {
[31832] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingVisualizer, {
[31833] Fix | Delete
clientId: clientId,
[31834] Fix | Delete
value: value?.spacing?.margin,
[31835] Fix | Delete
computeStyle: blockElement => {
[31836] Fix | Delete
const top = spacing_visualizer_getComputedCSS(blockElement, 'margin-top');
[31837] Fix | Delete
const right = spacing_visualizer_getComputedCSS(blockElement, 'margin-right');
[31838] Fix | Delete
const bottom = spacing_visualizer_getComputedCSS(blockElement, 'margin-bottom');
[31839] Fix | Delete
const left = spacing_visualizer_getComputedCSS(blockElement, 'margin-left');
[31840] Fix | Delete
return {
[31841] Fix | Delete
borderTopWidth: top,
[31842] Fix | Delete
borderRightWidth: right,
[31843] Fix | Delete
borderBottomWidth: bottom,
[31844] Fix | Delete
borderLeftWidth: left,
[31845] Fix | Delete
top: top ? `-${top}` : 0,
[31846] Fix | Delete
right: right ? `-${right}` : 0,
[31847] Fix | Delete
bottom: bottom ? `-${bottom}` : 0,
[31848] Fix | Delete
left: left ? `-${left}` : 0
[31849] Fix | Delete
};
[31850] Fix | Delete
},
[31851] Fix | Delete
forceShow: forceShow
[31852] Fix | Delete
});
[31853] Fix | Delete
}
[31854] Fix | Delete
function PaddingVisualizer({
[31855] Fix | Delete
clientId,
[31856] Fix | Delete
value,
[31857] Fix | Delete
forceShow
[31858] Fix | Delete
}) {
[31859] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingVisualizer, {
[31860] Fix | Delete
clientId: clientId,
[31861] Fix | Delete
value: value?.spacing?.padding,
[31862] Fix | Delete
computeStyle: blockElement => ({
[31863] Fix | Delete
borderTopWidth: spacing_visualizer_getComputedCSS(blockElement, 'padding-top'),
[31864] Fix | Delete
borderRightWidth: spacing_visualizer_getComputedCSS(blockElement, 'padding-right'),
[31865] Fix | Delete
borderBottomWidth: spacing_visualizer_getComputedCSS(blockElement, 'padding-bottom'),
[31866] Fix | Delete
borderLeftWidth: spacing_visualizer_getComputedCSS(blockElement, 'padding-left')
[31867] Fix | Delete
}),
[31868] Fix | Delete
forceShow: forceShow
[31869] Fix | Delete
});
[31870] Fix | Delete
}
[31871] Fix | Delete
[31872] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/dimensions.js
[31873] Fix | Delete
/**
[31874] Fix | Delete
* External dependencies
[31875] Fix | Delete
*/
[31876] Fix | Delete
[31877] Fix | Delete
[31878] Fix | Delete
/**
[31879] Fix | Delete
* WordPress dependencies
[31880] Fix | Delete
*/
[31881] Fix | Delete
[31882] Fix | Delete
[31883] Fix | Delete
[31884] Fix | Delete
[31885] Fix | Delete
[31886] Fix | Delete
/**
[31887] Fix | Delete
* Internal dependencies
[31888] Fix | Delete
*/
[31889] Fix | Delete
[31890] Fix | Delete
[31891] Fix | Delete
[31892] Fix | Delete
[31893] Fix | Delete
[31894] Fix | Delete
[31895] Fix | Delete
[31896] Fix | Delete
[31897] Fix | Delete
[31898] Fix | Delete
const DIMENSIONS_SUPPORT_KEY = 'dimensions';
[31899] Fix | Delete
const SPACING_SUPPORT_KEY = 'spacing';
[31900] Fix | Delete
const dimensions_ALL_SIDES = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
[31901] Fix | Delete
const dimensions_AXIAL_SIDES = (/* unused pure expression or super */ null && (['vertical', 'horizontal']));
[31902] Fix | Delete
function useVisualizer() {
[31903] Fix | Delete
const [property, setProperty] = (0,external_wp_element_namespaceObject.useState)(false);
[31904] Fix | Delete
const {
[31905] Fix | Delete
hideBlockInterface,
[31906] Fix | Delete
showBlockInterface
[31907] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[31908] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[31909] Fix | Delete
if (!property) {
[31910] Fix | Delete
showBlockInterface();
[31911] Fix | Delete
} else {
[31912] Fix | Delete
hideBlockInterface();
[31913] Fix | Delete
}
[31914] Fix | Delete
}, [property, showBlockInterface, hideBlockInterface]);
[31915] Fix | Delete
return [property, setProperty];
[31916] Fix | Delete
}
[31917] Fix | Delete
function DimensionsInspectorControl({
[31918] Fix | Delete
children,
[31919] Fix | Delete
resetAllFilter
[31920] Fix | Delete
}) {
[31921] Fix | Delete
const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => {
[31922] Fix | Delete
const existingStyle = attributes.style;
[31923] Fix | Delete
const updatedStyle = resetAllFilter(existingStyle);
[31924] Fix | Delete
return {
[31925] Fix | Delete
...attributes,
[31926] Fix | Delete
style: updatedStyle
[31927] Fix | Delete
};
[31928] Fix | Delete
}, [resetAllFilter]);
[31929] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, {
[31930] Fix | Delete
group: "dimensions",
[31931] Fix | Delete
resetAllFilter: attributesResetAllFilter,
[31932] Fix | Delete
children: children
[31933] Fix | Delete
});
[31934] Fix | Delete
}
[31935] Fix | Delete
function dimensions_DimensionsPanel({
[31936] Fix | Delete
clientId,
[31937] Fix | Delete
name,
[31938] Fix | Delete
setAttributes,
[31939] Fix | Delete
settings
[31940] Fix | Delete
}) {
[31941] Fix | Delete
const isEnabled = useHasDimensionsPanel(settings);
[31942] Fix | Delete
const value = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockAttributes(clientId)?.style, [clientId]);
[31943] Fix | Delete
const [visualizedProperty, setVisualizedProperty] = useVisualizer();
[31944] Fix | Delete
const onChange = newStyle => {
[31945] Fix | Delete
setAttributes({
[31946] Fix | Delete
style: utils_cleanEmptyObject(newStyle)
[31947] Fix | Delete
});
[31948] Fix | Delete
};
[31949] Fix | Delete
if (!isEnabled) {
[31950] Fix | Delete
return null;
[31951] Fix | Delete
}
[31952] Fix | Delete
const defaultDimensionsControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [DIMENSIONS_SUPPORT_KEY, '__experimentalDefaultControls']);
[31953] Fix | Delete
const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
[31954] Fix | Delete
const defaultControls = {
[31955] Fix | Delete
...defaultDimensionsControls,
[31956] Fix | Delete
...defaultSpacingControls
[31957] Fix | Delete
};
[31958] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[31959] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsPanel, {
[31960] Fix | Delete
as: DimensionsInspectorControl,
[31961] Fix | Delete
panelId: clientId,
[31962] Fix | Delete
settings: settings,
[31963] Fix | Delete
value: value,
[31964] Fix | Delete
onChange: onChange,
[31965] Fix | Delete
defaultControls: defaultControls,
[31966] Fix | Delete
onVisualize: setVisualizedProperty
[31967] Fix | Delete
}), !!settings?.spacing?.padding && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaddingVisualizer, {
[31968] Fix | Delete
forceShow: visualizedProperty === 'padding',
[31969] Fix | Delete
clientId: clientId,
[31970] Fix | Delete
value: value
[31971] Fix | Delete
}), !!settings?.spacing?.margin && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MarginVisualizer, {
[31972] Fix | Delete
forceShow: visualizedProperty === 'margin',
[31973] Fix | Delete
clientId: clientId,
[31974] Fix | Delete
value: value
[31975] Fix | Delete
})]
[31976] Fix | Delete
});
[31977] Fix | Delete
}
[31978] Fix | Delete
[31979] Fix | Delete
/**
[31980] Fix | Delete
* Determine whether there is block support for dimensions.
[31981] Fix | Delete
*
[31982] Fix | Delete
* @param {string} blockName Block name.
[31983] Fix | Delete
* @param {string} feature Background image feature to check for.
[31984] Fix | Delete
*
[31985] Fix | Delete
* @return {boolean} Whether there is support.
[31986] Fix | Delete
*/
[31987] Fix | Delete
function hasDimensionsSupport(blockName, feature = 'any') {
[31988] Fix | Delete
if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
[31989] Fix | Delete
return false;
[31990] Fix | Delete
}
[31991] Fix | Delete
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, DIMENSIONS_SUPPORT_KEY);
[31992] Fix | Delete
if (support === true) {
[31993] Fix | Delete
return true;
[31994] Fix | Delete
}
[31995] Fix | Delete
if (feature === 'any') {
[31996] Fix | Delete
return !!(support?.aspectRatio || !!support?.minHeight);
[31997] Fix | Delete
}
[31998] Fix | Delete
return !!support?.[feature];
[31999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function