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
(0,external_wp_element_namespaceObject.useEffect)(() => {
[31000] Fix | Delete
if (selfStretch === 'fixed' && !flexSize) {
[31001] Fix | Delete
onChange({
[31002] Fix | Delete
...childLayout,
[31003] Fix | Delete
selfStretch: 'fit'
[31004] Fix | Delete
});
[31005] Fix | Delete
}
[31006] Fix | Delete
}, []);
[31007] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[31008] Fix | Delete
children: [parentLayoutType === 'flex' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[31009] Fix | Delete
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
[31010] Fix | Delete
spacing: 2,
[31011] Fix | Delete
hasValue: hasFlexValue,
[31012] Fix | Delete
label: flexResetLabel,
[31013] Fix | Delete
onDeselect: resetFlex,
[31014] Fix | Delete
isShownByDefault: isShownByDefault,
[31015] Fix | Delete
panelId: panelId,
[31016] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
[31017] Fix | Delete
__nextHasNoMarginBottom: true,
[31018] Fix | Delete
size: "__unstable-large",
[31019] Fix | Delete
label: childLayoutOrientation(parentLayout),
[31020] Fix | Delete
value: selfStretch || 'fit',
[31021] Fix | Delete
help: helpText(selfStretch, parentLayout),
[31022] Fix | Delete
onChange: value => {
[31023] Fix | Delete
const newFlexSize = value !== 'fixed' ? null : flexSize;
[31024] Fix | Delete
onChange({
[31025] Fix | Delete
selfStretch: value,
[31026] Fix | Delete
flexSize: newFlexSize
[31027] Fix | Delete
});
[31028] Fix | Delete
},
[31029] Fix | Delete
isBlock: true,
[31030] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
[31031] Fix | Delete
value: "fit",
[31032] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Fit')
[31033] Fix | Delete
}, "fit"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
[31034] Fix | Delete
value: "fill",
[31035] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Fill')
[31036] Fix | Delete
}, "fill"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
[31037] Fix | Delete
value: "fixed",
[31038] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Fixed')
[31039] Fix | Delete
}, "fixed")]
[31040] Fix | Delete
}), selfStretch === 'fixed' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
[31041] Fix | Delete
size: "__unstable-large",
[31042] Fix | Delete
onChange: value => {
[31043] Fix | Delete
onChange({
[31044] Fix | Delete
selfStretch,
[31045] Fix | Delete
flexSize: value
[31046] Fix | Delete
});
[31047] Fix | Delete
},
[31048] Fix | Delete
value: flexSize
[31049] Fix | Delete
})]
[31050] Fix | Delete
}), parentLayoutType === 'grid' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[31051] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[31052] Fix | Delete
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
[31053] Fix | Delete
hasValue: hasSpanValue,
[31054] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Grid span'),
[31055] Fix | Delete
onDeselect: resetGridSpans,
[31056] Fix | Delete
isShownByDefault: isShownByDefault,
[31057] Fix | Delete
panelId: panelId,
[31058] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
[31059] Fix | Delete
size: "__unstable-large",
[31060] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Column span'),
[31061] Fix | Delete
type: "number",
[31062] Fix | Delete
onChange: value => {
[31063] Fix | Delete
onChange({
[31064] Fix | Delete
columnStart,
[31065] Fix | Delete
rowStart,
[31066] Fix | Delete
rowSpan,
[31067] Fix | Delete
columnSpan: value
[31068] Fix | Delete
});
[31069] Fix | Delete
},
[31070] Fix | Delete
value: columnSpan,
[31071] Fix | Delete
min: 1
[31072] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
[31073] Fix | Delete
size: "__unstable-large",
[31074] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Row span'),
[31075] Fix | Delete
type: "number",
[31076] Fix | Delete
onChange: value => {
[31077] Fix | Delete
onChange({
[31078] Fix | Delete
columnStart,
[31079] Fix | Delete
rowStart,
[31080] Fix | Delete
columnSpan,
[31081] Fix | Delete
rowSpan: value
[31082] Fix | Delete
});
[31083] Fix | Delete
},
[31084] Fix | Delete
value: rowSpan,
[31085] Fix | Delete
min: 1
[31086] Fix | Delete
})]
[31087] Fix | Delete
}), window.__experimentalEnableGridInteractivity &&
[31088] Fix | Delete
/*#__PURE__*/
[31089] Fix | Delete
// Use Flex with an explicit width on the FlexItem instead of HStack to
[31090] Fix | Delete
// work around an issue in webkit where inputs with a max attribute are
[31091] Fix | Delete
// sized incorrectly.
[31092] Fix | Delete
(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
[31093] Fix | Delete
as: external_wp_components_namespaceObject.__experimentalToolsPanelItem,
[31094] Fix | Delete
hasValue: hasStartValue,
[31095] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Grid placement'),
[31096] Fix | Delete
onDeselect: resetGridStarts,
[31097] Fix | Delete
isShownByDefault: false,
[31098] Fix | Delete
panelId: panelId,
[31099] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[31100] Fix | Delete
style: {
[31101] Fix | Delete
width: '50%'
[31102] Fix | Delete
},
[31103] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
[31104] Fix | Delete
size: "__unstable-large",
[31105] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Column'),
[31106] Fix | Delete
type: "number",
[31107] Fix | Delete
onChange: value => {
[31108] Fix | Delete
onChange({
[31109] Fix | Delete
columnStart: value,
[31110] Fix | Delete
rowStart,
[31111] Fix | Delete
columnSpan,
[31112] Fix | Delete
rowSpan
[31113] Fix | Delete
});
[31114] Fix | Delete
},
[31115] Fix | Delete
value: columnStart,
[31116] Fix | Delete
min: 1,
[31117] Fix | Delete
max: parentLayout?.columnCount ? parentLayout.columnCount - (columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1) + 1 : undefined
[31118] Fix | Delete
})
[31119] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[31120] Fix | Delete
style: {
[31121] Fix | Delete
width: '50%'
[31122] Fix | Delete
},
[31123] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, {
[31124] Fix | Delete
size: "__unstable-large",
[31125] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Row'),
[31126] Fix | Delete
type: "number",
[31127] Fix | Delete
onChange: value => {
[31128] Fix | Delete
onChange({
[31129] Fix | Delete
columnStart,
[31130] Fix | Delete
rowStart: value,
[31131] Fix | Delete
columnSpan,
[31132] Fix | Delete
rowSpan
[31133] Fix | Delete
});
[31134] Fix | Delete
},
[31135] Fix | Delete
value: rowStart,
[31136] Fix | Delete
min: 1,
[31137] Fix | Delete
max: parentLayout?.rowCount ? parentLayout.rowCount - (rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1) + 1 : undefined
[31138] Fix | Delete
})
[31139] Fix | Delete
})]
[31140] Fix | Delete
})]
[31141] Fix | Delete
})]
[31142] Fix | Delete
});
[31143] Fix | Delete
}
[31144] Fix | Delete
function childLayoutOrientation(parentLayout) {
[31145] Fix | Delete
const {
[31146] Fix | Delete
orientation = 'horizontal'
[31147] Fix | Delete
} = parentLayout;
[31148] Fix | Delete
return orientation === 'horizontal' ? (0,external_wp_i18n_namespaceObject.__)('Width') : (0,external_wp_i18n_namespaceObject.__)('Height');
[31149] Fix | Delete
}
[31150] Fix | Delete
[31151] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/aspect-ratio-tool.js
[31152] Fix | Delete
/**
[31153] Fix | Delete
* WordPress dependencies
[31154] Fix | Delete
*/
[31155] Fix | Delete
[31156] Fix | Delete
[31157] Fix | Delete
/**
[31158] Fix | Delete
* Internal dependencies
[31159] Fix | Delete
*/
[31160] Fix | Delete
[31161] Fix | Delete
[31162] Fix | Delete
/**
[31163] Fix | Delete
* @typedef {import('@wordpress/components/build-types/select-control/types').SelectControlProps} SelectControlProps
[31164] Fix | Delete
*/
[31165] Fix | Delete
[31166] Fix | Delete
/**
[31167] Fix | Delete
* @callback AspectRatioToolPropsOnChange
[31168] Fix | Delete
* @param {string} [value] New aspect ratio value.
[31169] Fix | Delete
* @return {void} No return.
[31170] Fix | Delete
*/
[31171] Fix | Delete
[31172] Fix | Delete
/**
[31173] Fix | Delete
* @typedef {Object} AspectRatioToolProps
[31174] Fix | Delete
* @property {string} [panelId] ID of the panel this tool is associated with.
[31175] Fix | Delete
* @property {string} [value] Current aspect ratio value.
[31176] Fix | Delete
* @property {AspectRatioToolPropsOnChange} [onChange] Callback to update the aspect ratio value.
[31177] Fix | Delete
* @property {SelectControlProps[]} [options] Aspect ratio options.
[31178] Fix | Delete
* @property {string} [defaultValue] Default aspect ratio value.
[31179] Fix | Delete
* @property {boolean} [isShownByDefault] Whether the tool is shown by default.
[31180] Fix | Delete
*/
[31181] Fix | Delete
[31182] Fix | Delete
function AspectRatioTool({
[31183] Fix | Delete
panelId,
[31184] Fix | Delete
value,
[31185] Fix | Delete
onChange = () => {},
[31186] Fix | Delete
options,
[31187] Fix | Delete
defaultValue = 'auto',
[31188] Fix | Delete
hasValue,
[31189] Fix | Delete
isShownByDefault = true
[31190] Fix | Delete
}) {
[31191] Fix | Delete
// Match the CSS default so if the value is used directly in CSS it will look correct in the control.
[31192] Fix | Delete
const displayValue = value !== null && value !== void 0 ? value : 'auto';
[31193] Fix | Delete
const [defaultRatios, themeRatios, showDefaultRatios] = use_settings_useSettings('dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios');
[31194] Fix | Delete
const themeOptions = themeRatios?.map(({
[31195] Fix | Delete
name,
[31196] Fix | Delete
ratio
[31197] Fix | Delete
}) => ({
[31198] Fix | Delete
label: name,
[31199] Fix | Delete
value: ratio
[31200] Fix | Delete
}));
[31201] Fix | Delete
const defaultOptions = defaultRatios?.map(({
[31202] Fix | Delete
name,
[31203] Fix | Delete
ratio
[31204] Fix | Delete
}) => ({
[31205] Fix | Delete
label: name,
[31206] Fix | Delete
value: ratio
[31207] Fix | Delete
}));
[31208] Fix | Delete
const aspectRatioOptions = [{
[31209] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Original', 'Aspect ratio option for dimensions control'),
[31210] Fix | Delete
value: 'auto'
[31211] Fix | Delete
}, ...(showDefaultRatios ? defaultOptions : []), ...(themeOptions ? themeOptions : []), {
[31212] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Aspect ratio option for dimensions control'),
[31213] Fix | Delete
value: 'custom',
[31214] Fix | Delete
disabled: true,
[31215] Fix | Delete
hidden: true
[31216] Fix | Delete
}];
[31217] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
[31218] Fix | Delete
hasValue: hasValue ? hasValue : () => displayValue !== defaultValue,
[31219] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'),
[31220] Fix | Delete
onDeselect: () => onChange(undefined),
[31221] Fix | Delete
isShownByDefault: isShownByDefault,
[31222] Fix | Delete
panelId: panelId,
[31223] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
[31224] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'),
[31225] Fix | Delete
value: displayValue,
[31226] Fix | Delete
options: options !== null && options !== void 0 ? options : aspectRatioOptions,
[31227] Fix | Delete
onChange: onChange,
[31228] Fix | Delete
size: "__unstable-large",
[31229] Fix | Delete
__nextHasNoMarginBottom: true
[31230] Fix | Delete
})
[31231] Fix | Delete
});
[31232] Fix | Delete
}
[31233] Fix | Delete
[31234] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/global-styles/dimensions-panel.js
[31235] Fix | Delete
/**
[31236] Fix | Delete
* External dependencies
[31237] Fix | Delete
*/
[31238] Fix | Delete
[31239] Fix | Delete
[31240] Fix | Delete
/**
[31241] Fix | Delete
* WordPress dependencies
[31242] Fix | Delete
*/
[31243] Fix | Delete
[31244] Fix | Delete
[31245] Fix | Delete
[31246] Fix | Delete
[31247] Fix | Delete
[31248] Fix | Delete
/**
[31249] Fix | Delete
* Internal dependencies
[31250] Fix | Delete
*/
[31251] Fix | Delete
[31252] Fix | Delete
[31253] Fix | Delete
[31254] Fix | Delete
[31255] Fix | Delete
[31256] Fix | Delete
[31257] Fix | Delete
[31258] Fix | Delete
[31259] Fix | Delete
[31260] Fix | Delete
const AXIAL_SIDES = ['horizontal', 'vertical'];
[31261] Fix | Delete
function useHasDimensionsPanel(settings) {
[31262] Fix | Delete
const hasContentSize = useHasContentSize(settings);
[31263] Fix | Delete
const hasWideSize = useHasWideSize(settings);
[31264] Fix | Delete
const hasPadding = useHasPadding(settings);
[31265] Fix | Delete
const hasMargin = useHasMargin(settings);
[31266] Fix | Delete
const hasGap = useHasGap(settings);
[31267] Fix | Delete
const hasMinHeight = useHasMinHeight(settings);
[31268] Fix | Delete
const hasAspectRatio = useHasAspectRatio(settings);
[31269] Fix | Delete
const hasChildLayout = useHasChildLayout(settings);
[31270] Fix | Delete
return external_wp_element_namespaceObject.Platform.OS === 'web' && (hasContentSize || hasWideSize || hasPadding || hasMargin || hasGap || hasMinHeight || hasAspectRatio || hasChildLayout);
[31271] Fix | Delete
}
[31272] Fix | Delete
function useHasContentSize(settings) {
[31273] Fix | Delete
return settings?.layout?.contentSize;
[31274] Fix | Delete
}
[31275] Fix | Delete
function useHasWideSize(settings) {
[31276] Fix | Delete
return settings?.layout?.wideSize;
[31277] Fix | Delete
}
[31278] Fix | Delete
function useHasPadding(settings) {
[31279] Fix | Delete
return settings?.spacing?.padding;
[31280] Fix | Delete
}
[31281] Fix | Delete
function useHasMargin(settings) {
[31282] Fix | Delete
return settings?.spacing?.margin;
[31283] Fix | Delete
}
[31284] Fix | Delete
function useHasGap(settings) {
[31285] Fix | Delete
return settings?.spacing?.blockGap;
[31286] Fix | Delete
}
[31287] Fix | Delete
function useHasMinHeight(settings) {
[31288] Fix | Delete
return settings?.dimensions?.minHeight;
[31289] Fix | Delete
}
[31290] Fix | Delete
function useHasAspectRatio(settings) {
[31291] Fix | Delete
return settings?.dimensions?.aspectRatio;
[31292] Fix | Delete
}
[31293] Fix | Delete
function useHasChildLayout(settings) {
[31294] Fix | Delete
var _settings$parentLayou;
[31295] Fix | Delete
const {
[31296] Fix | Delete
type: parentLayoutType = 'default',
[31297] Fix | Delete
default: {
[31298] Fix | Delete
type: defaultParentLayoutType = 'default'
[31299] Fix | Delete
} = {},
[31300] Fix | Delete
allowSizingOnChildren = false
[31301] Fix | Delete
} = (_settings$parentLayou = settings?.parentLayout) !== null && _settings$parentLayou !== void 0 ? _settings$parentLayou : {};
[31302] Fix | Delete
const support = (defaultParentLayoutType === 'flex' || parentLayoutType === 'flex' || defaultParentLayoutType === 'grid' || parentLayoutType === 'grid') && allowSizingOnChildren;
[31303] Fix | Delete
return !!settings?.layout && support;
[31304] Fix | Delete
}
[31305] Fix | Delete
function useHasSpacingPresets(settings) {
[31306] Fix | Delete
const {
[31307] Fix | Delete
defaultSpacingSizes,
[31308] Fix | Delete
spacingSizes
[31309] Fix | Delete
} = settings?.spacing || {};
[31310] Fix | Delete
return defaultSpacingSizes !== false && spacingSizes?.default?.length > 0 || spacingSizes?.theme?.length > 0 || spacingSizes?.custom?.length > 0;
[31311] Fix | Delete
}
[31312] Fix | Delete
function filterValuesBySides(values, sides) {
[31313] Fix | Delete
// If no custom side configuration, all sides are opted into by default.
[31314] Fix | Delete
// Without any values, we have nothing to filter either.
[31315] Fix | Delete
if (!sides || !values) {
[31316] Fix | Delete
return values;
[31317] Fix | Delete
}
[31318] Fix | Delete
[31319] Fix | Delete
// Only include sides opted into within filtered values.
[31320] Fix | Delete
const filteredValues = {};
[31321] Fix | Delete
sides.forEach(side => {
[31322] Fix | Delete
if (side === 'vertical') {
[31323] Fix | Delete
filteredValues.top = values.top;
[31324] Fix | Delete
filteredValues.bottom = values.bottom;
[31325] Fix | Delete
}
[31326] Fix | Delete
if (side === 'horizontal') {
[31327] Fix | Delete
filteredValues.left = values.left;
[31328] Fix | Delete
filteredValues.right = values.right;
[31329] Fix | Delete
}
[31330] Fix | Delete
filteredValues[side] = values?.[side];
[31331] Fix | Delete
});
[31332] Fix | Delete
return filteredValues;
[31333] Fix | Delete
}
[31334] Fix | Delete
function splitStyleValue(value) {
[31335] Fix | Delete
// Check for shorthand value (a string value).
[31336] Fix | Delete
if (value && typeof value === 'string') {
[31337] Fix | Delete
// Convert to value for individual sides for BoxControl.
[31338] Fix | Delete
return {
[31339] Fix | Delete
top: value,
[31340] Fix | Delete
right: value,
[31341] Fix | Delete
bottom: value,
[31342] Fix | Delete
left: value
[31343] Fix | Delete
};
[31344] Fix | Delete
}
[31345] Fix | Delete
return value;
[31346] Fix | Delete
}
[31347] Fix | Delete
function splitGapValue(value) {
[31348] Fix | Delete
// Check for shorthand value (a string value).
[31349] Fix | Delete
if (value && typeof value === 'string') {
[31350] Fix | Delete
// If the value is a string, treat it as a single side (top) for the spacing controls.
[31351] Fix | Delete
return {
[31352] Fix | Delete
top: value
[31353] Fix | Delete
};
[31354] Fix | Delete
}
[31355] Fix | Delete
if (value) {
[31356] Fix | Delete
return {
[31357] Fix | Delete
...value,
[31358] Fix | Delete
right: value?.left,
[31359] Fix | Delete
bottom: value?.top
[31360] Fix | Delete
};
[31361] Fix | Delete
}
[31362] Fix | Delete
return value;
[31363] Fix | Delete
}
[31364] Fix | Delete
function DimensionsToolsPanel({
[31365] Fix | Delete
resetAllFilter,
[31366] Fix | Delete
onChange,
[31367] Fix | Delete
value,
[31368] Fix | Delete
panelId,
[31369] Fix | Delete
children
[31370] Fix | Delete
}) {
[31371] Fix | Delete
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
[31372] Fix | Delete
const resetAll = () => {
[31373] Fix | Delete
const updatedValue = resetAllFilter(value);
[31374] Fix | Delete
onChange(updatedValue);
[31375] Fix | Delete
};
[31376] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
[31377] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Dimensions'),
[31378] Fix | Delete
resetAll: resetAll,
[31379] Fix | Delete
panelId: panelId,
[31380] Fix | Delete
dropdownMenuProps: dropdownMenuProps,
[31381] Fix | Delete
children: children
[31382] Fix | Delete
});
[31383] Fix | Delete
}
[31384] Fix | Delete
const dimensions_panel_DEFAULT_CONTROLS = {
[31385] Fix | Delete
contentSize: true,
[31386] Fix | Delete
wideSize: true,
[31387] Fix | Delete
padding: true,
[31388] Fix | Delete
margin: true,
[31389] Fix | Delete
blockGap: true,
[31390] Fix | Delete
minHeight: true,
[31391] Fix | Delete
aspectRatio: true,
[31392] Fix | Delete
childLayout: true
[31393] Fix | Delete
};
[31394] Fix | Delete
function DimensionsPanel({
[31395] Fix | Delete
as: Wrapper = DimensionsToolsPanel,
[31396] Fix | Delete
value,
[31397] Fix | Delete
onChange,
[31398] Fix | Delete
inheritedValue = value,
[31399] Fix | Delete
settings,
[31400] Fix | Delete
panelId,
[31401] Fix | Delete
defaultControls = dimensions_panel_DEFAULT_CONTROLS,
[31402] Fix | Delete
onVisualize = () => {},
[31403] Fix | Delete
// Special case because the layout controls are not part of the dimensions panel
[31404] Fix | Delete
// in global styles but not in block inspector.
[31405] Fix | Delete
includeLayoutControls = false
[31406] Fix | Delete
}) {
[31407] Fix | Delete
var _defaultControls$cont, _defaultControls$wide, _defaultControls$padd, _defaultControls$marg, _defaultControls$bloc, _defaultControls$chil, _defaultControls$minH, _defaultControls$aspe;
[31408] Fix | Delete
const {
[31409] Fix | Delete
dimensions,
[31410] Fix | Delete
spacing
[31411] Fix | Delete
} = settings;
[31412] Fix | Delete
const decodeValue = rawValue => {
[31413] Fix | Delete
if (rawValue && typeof rawValue === 'object') {
[31414] Fix | Delete
return Object.keys(rawValue).reduce((acc, key) => {
[31415] Fix | Delete
acc[key] = getValueFromVariable({
[31416] Fix | Delete
settings: {
[31417] Fix | Delete
dimensions,
[31418] Fix | Delete
spacing
[31419] Fix | Delete
}
[31420] Fix | Delete
}, '', rawValue[key]);
[31421] Fix | Delete
return acc;
[31422] Fix | Delete
}, {});
[31423] Fix | Delete
}
[31424] Fix | Delete
return getValueFromVariable({
[31425] Fix | Delete
settings: {
[31426] Fix | Delete
dimensions,
[31427] Fix | Delete
spacing
[31428] Fix | Delete
}
[31429] Fix | Delete
}, '', rawValue);
[31430] Fix | Delete
};
[31431] Fix | Delete
const showSpacingPresetsControl = useHasSpacingPresets(settings);
[31432] Fix | Delete
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
[31433] Fix | Delete
availableUnits: settings?.spacing?.units || ['%', 'px', 'em', 'rem', 'vw']
[31434] Fix | Delete
});
[31435] Fix | Delete
[31436] Fix | Delete
//Minimum Margin Value
[31437] Fix | Delete
const minimumMargin = -Infinity;
[31438] Fix | Delete
const [minMarginValue, setMinMarginValue] = (0,external_wp_element_namespaceObject.useState)(minimumMargin);
[31439] Fix | Delete
[31440] Fix | Delete
// Content Size
[31441] Fix | Delete
const showContentSizeControl = useHasContentSize(settings) && includeLayoutControls;
[31442] Fix | Delete
const contentSizeValue = decodeValue(inheritedValue?.layout?.contentSize);
[31443] Fix | Delete
const setContentSizeValue = newValue => {
[31444] Fix | Delete
onChange(setImmutably(value, ['layout', 'contentSize'], newValue || undefined));
[31445] Fix | Delete
};
[31446] Fix | Delete
const hasUserSetContentSizeValue = () => !!value?.layout?.contentSize;
[31447] Fix | Delete
const resetContentSizeValue = () => setContentSizeValue(undefined);
[31448] Fix | Delete
[31449] Fix | Delete
// Wide Size
[31450] Fix | Delete
const showWideSizeControl = useHasWideSize(settings) && includeLayoutControls;
[31451] Fix | Delete
const wideSizeValue = decodeValue(inheritedValue?.layout?.wideSize);
[31452] Fix | Delete
const setWideSizeValue = newValue => {
[31453] Fix | Delete
onChange(setImmutably(value, ['layout', 'wideSize'], newValue || undefined));
[31454] Fix | Delete
};
[31455] Fix | Delete
const hasUserSetWideSizeValue = () => !!value?.layout?.wideSize;
[31456] Fix | Delete
const resetWideSizeValue = () => setWideSizeValue(undefined);
[31457] Fix | Delete
[31458] Fix | Delete
// Padding
[31459] Fix | Delete
const showPaddingControl = useHasPadding(settings);
[31460] Fix | Delete
const rawPadding = decodeValue(inheritedValue?.spacing?.padding);
[31461] Fix | Delete
const paddingValues = splitStyleValue(rawPadding);
[31462] Fix | Delete
const paddingSides = Array.isArray(settings?.spacing?.padding) ? settings?.spacing?.padding : settings?.spacing?.padding?.sides;
[31463] Fix | Delete
const isAxialPadding = paddingSides && paddingSides.some(side => AXIAL_SIDES.includes(side));
[31464] Fix | Delete
const setPaddingValues = newPaddingValues => {
[31465] Fix | Delete
const padding = filterValuesBySides(newPaddingValues, paddingSides);
[31466] Fix | Delete
onChange(setImmutably(value, ['spacing', 'padding'], padding));
[31467] Fix | Delete
};
[31468] Fix | Delete
const hasPaddingValue = () => !!value?.spacing?.padding && Object.keys(value?.spacing?.padding).length;
[31469] Fix | Delete
const resetPaddingValue = () => setPaddingValues(undefined);
[31470] Fix | Delete
const onMouseOverPadding = () => onVisualize('padding');
[31471] Fix | Delete
[31472] Fix | Delete
// Margin
[31473] Fix | Delete
const showMarginControl = useHasMargin(settings);
[31474] Fix | Delete
const rawMargin = decodeValue(inheritedValue?.spacing?.margin);
[31475] Fix | Delete
const marginValues = splitStyleValue(rawMargin);
[31476] Fix | Delete
const marginSides = Array.isArray(settings?.spacing?.margin) ? settings?.spacing?.margin : settings?.spacing?.margin?.sides;
[31477] Fix | Delete
const isAxialMargin = marginSides && marginSides.some(side => AXIAL_SIDES.includes(side));
[31478] Fix | Delete
const setMarginValues = newMarginValues => {
[31479] Fix | Delete
const margin = filterValuesBySides(newMarginValues, marginSides);
[31480] Fix | Delete
onChange(setImmutably(value, ['spacing', 'margin'], margin));
[31481] Fix | Delete
};
[31482] Fix | Delete
const hasMarginValue = () => !!value?.spacing?.margin && Object.keys(value?.spacing?.margin).length;
[31483] Fix | Delete
const resetMarginValue = () => setMarginValues(undefined);
[31484] Fix | Delete
const onMouseOverMargin = () => onVisualize('margin');
[31485] Fix | Delete
[31486] Fix | Delete
// Block Gap
[31487] Fix | Delete
const showGapControl = useHasGap(settings);
[31488] Fix | Delete
const gapValue = decodeValue(inheritedValue?.spacing?.blockGap);
[31489] Fix | Delete
const gapValues = splitGapValue(gapValue);
[31490] Fix | Delete
const gapSides = Array.isArray(settings?.spacing?.blockGap) ? settings?.spacing?.blockGap : settings?.spacing?.blockGap?.sides;
[31491] Fix | Delete
const isAxialGap = gapSides && gapSides.some(side => AXIAL_SIDES.includes(side));
[31492] Fix | Delete
const setGapValue = newGapValue => {
[31493] Fix | Delete
onChange(setImmutably(value, ['spacing', 'blockGap'], newGapValue));
[31494] Fix | Delete
};
[31495] Fix | Delete
const setGapValues = nextBoxGapValue => {
[31496] Fix | Delete
if (!nextBoxGapValue) {
[31497] Fix | Delete
setGapValue(null);
[31498] Fix | Delete
}
[31499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function