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: components.js
let background = railColor || '';
[37000] Fix | Delete
if (disabled) {
[37001] Fix | Delete
background = COLORS.ui.backgroundDisabled;
[37002] Fix | Delete
}
[37003] Fix | Delete
return /*#__PURE__*/emotion_react_browser_esm_css({
[37004] Fix | Delete
background
[37005] Fix | Delete
}, true ? "" : 0, true ? "" : 0);
[37006] Fix | Delete
};
[37007] Fix | Delete
const Rail = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37008] Fix | Delete
target: "e1epgpqk10"
[37009] Fix | Delete
} : 0)("background-color:", COLORS.gray[300], ";left:0;pointer-events:none;right:0;display:block;height:", railHeight, "px;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;border-radius:", railHeight, "px;", railBackgroundColor, ";" + ( true ? "" : 0));
[37010] Fix | Delete
const trackBackgroundColor = ({
[37011] Fix | Delete
disabled,
[37012] Fix | Delete
trackColor
[37013] Fix | Delete
}) => {
[37014] Fix | Delete
let background = trackColor || 'currentColor';
[37015] Fix | Delete
if (disabled) {
[37016] Fix | Delete
background = COLORS.gray[400];
[37017] Fix | Delete
}
[37018] Fix | Delete
return /*#__PURE__*/emotion_react_browser_esm_css({
[37019] Fix | Delete
background
[37020] Fix | Delete
}, true ? "" : 0, true ? "" : 0);
[37021] Fix | Delete
};
[37022] Fix | Delete
const Track = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37023] Fix | Delete
target: "e1epgpqk9"
[37024] Fix | Delete
} : 0)("background-color:currentColor;border-radius:", railHeight, "px;height:", railHeight, "px;pointer-events:none;display:block;position:absolute;margin-top:", (rangeHeightValue - railHeight) / 2, "px;top:0;", trackBackgroundColor, ";" + ( true ? "" : 0));
[37025] Fix | Delete
const MarksWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37026] Fix | Delete
target: "e1epgpqk8"
[37027] Fix | Delete
} : 0)( true ? {
[37028] Fix | Delete
name: "l7tjj5",
[37029] Fix | Delete
styles: "display:block;pointer-events:none;position:relative;width:100%;user-select:none"
[37030] Fix | Delete
} : 0);
[37031] Fix | Delete
const markFill = ({
[37032] Fix | Delete
disabled,
[37033] Fix | Delete
isFilled
[37034] Fix | Delete
}) => {
[37035] Fix | Delete
let backgroundColor = isFilled ? 'currentColor' : COLORS.gray[300];
[37036] Fix | Delete
if (disabled) {
[37037] Fix | Delete
backgroundColor = COLORS.gray[400];
[37038] Fix | Delete
}
[37039] Fix | Delete
return /*#__PURE__*/emotion_react_browser_esm_css({
[37040] Fix | Delete
backgroundColor
[37041] Fix | Delete
}, true ? "" : 0, true ? "" : 0);
[37042] Fix | Delete
};
[37043] Fix | Delete
const Mark = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37044] Fix | Delete
target: "e1epgpqk7"
[37045] Fix | Delete
} : 0)("height:", thumbSize, "px;left:0;position:absolute;top:-4px;width:1px;", markFill, ";" + ( true ? "" : 0));
[37046] Fix | Delete
const markLabelFill = ({
[37047] Fix | Delete
isFilled
[37048] Fix | Delete
}) => {
[37049] Fix | Delete
return /*#__PURE__*/emotion_react_browser_esm_css({
[37050] Fix | Delete
color: isFilled ? COLORS.gray[700] : COLORS.gray[300]
[37051] Fix | Delete
}, true ? "" : 0, true ? "" : 0);
[37052] Fix | Delete
};
[37053] Fix | Delete
const MarkLabel = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37054] Fix | Delete
target: "e1epgpqk6"
[37055] Fix | Delete
} : 0)("color:", COLORS.gray[300], ";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;", markLabelFill, ";" + ( true ? "" : 0));
[37056] Fix | Delete
const thumbColor = ({
[37057] Fix | Delete
disabled
[37058] Fix | Delete
}) => disabled ? /*#__PURE__*/emotion_react_browser_esm_css("background-color:", COLORS.gray[400], ";" + ( true ? "" : 0), true ? "" : 0) : /*#__PURE__*/emotion_react_browser_esm_css("background-color:", COLORS.theme.accent, ";" + ( true ? "" : 0), true ? "" : 0);
[37059] Fix | Delete
const ThumbWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37060] Fix | Delete
target: "e1epgpqk5"
[37061] Fix | Delete
} : 0)("align-items:center;display:flex;height:", thumbSize, "px;justify-content:center;margin-top:", (rangeHeightValue - thumbSize) / 2, "px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:", thumbSize, "px;border-radius:50%;", thumbColor, ";", rtl({
[37062] Fix | Delete
marginLeft: -10
[37063] Fix | Delete
}), ";", rtl({
[37064] Fix | Delete
transform: 'translateX( 4.5px )'
[37065] Fix | Delete
}, {
[37066] Fix | Delete
transform: 'translateX( -4.5px )'
[37067] Fix | Delete
}), ";" + ( true ? "" : 0));
[37068] Fix | Delete
const thumbFocus = ({
[37069] Fix | Delete
isFocused
[37070] Fix | Delete
}) => {
[37071] Fix | Delete
return isFocused ? /*#__PURE__*/emotion_react_browser_esm_css("&::before{content:' ';position:absolute;background-color:", COLORS.theme.accent, ";opacity:0.4;border-radius:50%;height:", thumbSize + 8, "px;width:", thumbSize + 8, "px;top:-4px;left:-4px;}" + ( true ? "" : 0), true ? "" : 0) : '';
[37072] Fix | Delete
};
[37073] Fix | Delete
const Thumb = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37074] Fix | Delete
target: "e1epgpqk4"
[37075] Fix | Delete
} : 0)("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;", thumbColor, ";", thumbFocus, ";" + ( true ? "" : 0));
[37076] Fix | Delete
const InputRange = /*#__PURE__*/emotion_styled_base_browser_esm("input", true ? {
[37077] Fix | Delete
target: "e1epgpqk3"
[37078] Fix | Delete
} : 0)("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -", thumbSize / 2, "px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ", thumbSize, "px );" + ( true ? "" : 0));
[37079] Fix | Delete
const tooltipShow = ({
[37080] Fix | Delete
show
[37081] Fix | Delete
}) => {
[37082] Fix | Delete
return /*#__PURE__*/emotion_react_browser_esm_css({
[37083] Fix | Delete
opacity: show ? 1 : 0
[37084] Fix | Delete
}, true ? "" : 0, true ? "" : 0);
[37085] Fix | Delete
};
[37086] Fix | Delete
var range_control_styles_ref = true ? {
[37087] Fix | Delete
name: "1cypxip",
[37088] Fix | Delete
styles: "top:-80%"
[37089] Fix | Delete
} : 0;
[37090] Fix | Delete
var range_control_styles_ref2 = true ? {
[37091] Fix | Delete
name: "1lr98c4",
[37092] Fix | Delete
styles: "bottom:-80%"
[37093] Fix | Delete
} : 0;
[37094] Fix | Delete
const tooltipPosition = ({
[37095] Fix | Delete
position
[37096] Fix | Delete
}) => {
[37097] Fix | Delete
const isBottom = position === 'bottom';
[37098] Fix | Delete
if (isBottom) {
[37099] Fix | Delete
return range_control_styles_ref2;
[37100] Fix | Delete
}
[37101] Fix | Delete
return range_control_styles_ref;
[37102] Fix | Delete
};
[37103] Fix | Delete
const range_control_styles_Tooltip = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37104] Fix | Delete
target: "e1epgpqk2"
[37105] Fix | Delete
} : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;@media not ( prefers-reduced-motion ){transition:opacity 120ms ease;}", tooltipShow, ";", tooltipPosition, ";", rtl({
[37106] Fix | Delete
transform: 'translateX(-50%)'
[37107] Fix | Delete
}, {
[37108] Fix | Delete
transform: 'translateX(50%)'
[37109] Fix | Delete
}), ";" + ( true ? "" : 0));
[37110] Fix | Delete
[37111] Fix | Delete
// @todo Refactor RangeControl with latest HStack configuration
[37112] Fix | Delete
// @see: packages/components/src/h-stack
[37113] Fix | Delete
const InputNumber = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? {
[37114] Fix | Delete
target: "e1epgpqk1"
[37115] Fix | Delete
} : 0)("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{", rangeHeight, ";}", rtl({
[37116] Fix | Delete
marginLeft: `${space(4)} !important`
[37117] Fix | Delete
}), ";" + ( true ? "" : 0));
[37118] Fix | Delete
const ActionRightWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
[37119] Fix | Delete
target: "e1epgpqk0"
[37120] Fix | Delete
} : 0)("display:block;margin-top:0;button,button.is-small{margin-left:0;", rangeHeight, ";}", rtl({
[37121] Fix | Delete
marginLeft: 8
[37122] Fix | Delete
}), ";" + ( true ? "" : 0));
[37123] Fix | Delete
[37124] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/input-range.js
[37125] Fix | Delete
/**
[37126] Fix | Delete
* WordPress dependencies
[37127] Fix | Delete
*/
[37128] Fix | Delete
[37129] Fix | Delete
[37130] Fix | Delete
/**
[37131] Fix | Delete
* Internal dependencies
[37132] Fix | Delete
*/
[37133] Fix | Delete
[37134] Fix | Delete
[37135] Fix | Delete
function input_range_InputRange(props, ref) {
[37136] Fix | Delete
const {
[37137] Fix | Delete
describedBy,
[37138] Fix | Delete
label,
[37139] Fix | Delete
value,
[37140] Fix | Delete
...otherProps
[37141] Fix | Delete
} = props;
[37142] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputRange, {
[37143] Fix | Delete
...otherProps,
[37144] Fix | Delete
"aria-describedby": describedBy,
[37145] Fix | Delete
"aria-label": label,
[37146] Fix | Delete
"aria-hidden": false,
[37147] Fix | Delete
ref: ref,
[37148] Fix | Delete
tabIndex: 0,
[37149] Fix | Delete
type: "range",
[37150] Fix | Delete
value: value
[37151] Fix | Delete
});
[37152] Fix | Delete
}
[37153] Fix | Delete
const input_range_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(input_range_InputRange);
[37154] Fix | Delete
/* harmony default export */ const input_range = (input_range_ForwardedComponent);
[37155] Fix | Delete
[37156] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/mark.js
[37157] Fix | Delete
/**
[37158] Fix | Delete
* External dependencies
[37159] Fix | Delete
*/
[37160] Fix | Delete
[37161] Fix | Delete
[37162] Fix | Delete
/**
[37163] Fix | Delete
* Internal dependencies
[37164] Fix | Delete
*/
[37165] Fix | Delete
[37166] Fix | Delete
[37167] Fix | Delete
[37168] Fix | Delete
[37169] Fix | Delete
function RangeMark(props) {
[37170] Fix | Delete
const {
[37171] Fix | Delete
className,
[37172] Fix | Delete
isFilled = false,
[37173] Fix | Delete
label,
[37174] Fix | Delete
style = {},
[37175] Fix | Delete
...otherProps
[37176] Fix | Delete
} = props;
[37177] Fix | Delete
const classes = dist_clsx('components-range-control__mark', isFilled && 'is-filled', className);
[37178] Fix | Delete
const labelClasses = dist_clsx('components-range-control__mark-label', isFilled && 'is-filled');
[37179] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[37180] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Mark, {
[37181] Fix | Delete
...otherProps,
[37182] Fix | Delete
"aria-hidden": "true",
[37183] Fix | Delete
className: classes,
[37184] Fix | Delete
isFilled: isFilled,
[37185] Fix | Delete
style: style
[37186] Fix | Delete
}), label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MarkLabel, {
[37187] Fix | Delete
"aria-hidden": "true",
[37188] Fix | Delete
className: labelClasses,
[37189] Fix | Delete
isFilled: isFilled,
[37190] Fix | Delete
style: style,
[37191] Fix | Delete
children: label
[37192] Fix | Delete
})]
[37193] Fix | Delete
});
[37194] Fix | Delete
}
[37195] Fix | Delete
[37196] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/rail.js
[37197] Fix | Delete
/**
[37198] Fix | Delete
* WordPress dependencies
[37199] Fix | Delete
*/
[37200] Fix | Delete
[37201] Fix | Delete
[37202] Fix | Delete
/**
[37203] Fix | Delete
* Internal dependencies
[37204] Fix | Delete
*/
[37205] Fix | Delete
[37206] Fix | Delete
[37207] Fix | Delete
[37208] Fix | Delete
[37209] Fix | Delete
[37210] Fix | Delete
[37211] Fix | Delete
function RangeRail(props) {
[37212] Fix | Delete
const {
[37213] Fix | Delete
disabled = false,
[37214] Fix | Delete
marks = false,
[37215] Fix | Delete
min = 0,
[37216] Fix | Delete
max = 100,
[37217] Fix | Delete
step = 1,
[37218] Fix | Delete
value = 0,
[37219] Fix | Delete
...restProps
[37220] Fix | Delete
} = props;
[37221] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[37222] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Rail, {
[37223] Fix | Delete
disabled: disabled,
[37224] Fix | Delete
...restProps
[37225] Fix | Delete
}), marks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Marks, {
[37226] Fix | Delete
disabled: disabled,
[37227] Fix | Delete
marks: marks,
[37228] Fix | Delete
min: min,
[37229] Fix | Delete
max: max,
[37230] Fix | Delete
step: step,
[37231] Fix | Delete
value: value
[37232] Fix | Delete
})]
[37233] Fix | Delete
});
[37234] Fix | Delete
}
[37235] Fix | Delete
function Marks(props) {
[37236] Fix | Delete
const {
[37237] Fix | Delete
disabled = false,
[37238] Fix | Delete
marks = false,
[37239] Fix | Delete
min = 0,
[37240] Fix | Delete
max = 100,
[37241] Fix | Delete
step: stepProp = 1,
[37242] Fix | Delete
value = 0
[37243] Fix | Delete
} = props;
[37244] Fix | Delete
const step = stepProp === 'any' ? 1 : stepProp;
[37245] Fix | Delete
const marksData = useMarks({
[37246] Fix | Delete
marks,
[37247] Fix | Delete
min,
[37248] Fix | Delete
max,
[37249] Fix | Delete
step,
[37250] Fix | Delete
value
[37251] Fix | Delete
});
[37252] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MarksWrapper, {
[37253] Fix | Delete
"aria-hidden": "true",
[37254] Fix | Delete
className: "components-range-control__marks",
[37255] Fix | Delete
children: marksData.map(mark => /*#__PURE__*/(0,external_React_.createElement)(RangeMark, {
[37256] Fix | Delete
...mark,
[37257] Fix | Delete
key: mark.key,
[37258] Fix | Delete
"aria-hidden": "true",
[37259] Fix | Delete
disabled: disabled
[37260] Fix | Delete
}))
[37261] Fix | Delete
});
[37262] Fix | Delete
}
[37263] Fix | Delete
function useMarks({
[37264] Fix | Delete
marks,
[37265] Fix | Delete
min = 0,
[37266] Fix | Delete
max = 100,
[37267] Fix | Delete
step = 1,
[37268] Fix | Delete
value = 0
[37269] Fix | Delete
}) {
[37270] Fix | Delete
if (!marks) {
[37271] Fix | Delete
return [];
[37272] Fix | Delete
}
[37273] Fix | Delete
const range = max - min;
[37274] Fix | Delete
if (!Array.isArray(marks)) {
[37275] Fix | Delete
marks = [];
[37276] Fix | Delete
const count = 1 + Math.round(range / step);
[37277] Fix | Delete
while (count > marks.push({
[37278] Fix | Delete
value: step * marks.length + min
[37279] Fix | Delete
})) {}
[37280] Fix | Delete
}
[37281] Fix | Delete
const placedMarks = [];
[37282] Fix | Delete
marks.forEach((mark, index) => {
[37283] Fix | Delete
if (mark.value < min || mark.value > max) {
[37284] Fix | Delete
return;
[37285] Fix | Delete
}
[37286] Fix | Delete
const key = `mark-${index}`;
[37287] Fix | Delete
const isFilled = mark.value <= value;
[37288] Fix | Delete
const offset = `${(mark.value - min) / range * 100}%`;
[37289] Fix | Delete
const offsetStyle = {
[37290] Fix | Delete
[(0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left']: offset
[37291] Fix | Delete
};
[37292] Fix | Delete
placedMarks.push({
[37293] Fix | Delete
...mark,
[37294] Fix | Delete
isFilled,
[37295] Fix | Delete
key,
[37296] Fix | Delete
style: offsetStyle
[37297] Fix | Delete
});
[37298] Fix | Delete
});
[37299] Fix | Delete
return placedMarks;
[37300] Fix | Delete
}
[37301] Fix | Delete
[37302] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/tooltip.js
[37303] Fix | Delete
/**
[37304] Fix | Delete
* External dependencies
[37305] Fix | Delete
*/
[37306] Fix | Delete
[37307] Fix | Delete
[37308] Fix | Delete
/**
[37309] Fix | Delete
* WordPress dependencies
[37310] Fix | Delete
*/
[37311] Fix | Delete
[37312] Fix | Delete
[37313] Fix | Delete
/**
[37314] Fix | Delete
* Internal dependencies
[37315] Fix | Delete
*/
[37316] Fix | Delete
[37317] Fix | Delete
[37318] Fix | Delete
function SimpleTooltip(props) {
[37319] Fix | Delete
const {
[37320] Fix | Delete
className,
[37321] Fix | Delete
inputRef,
[37322] Fix | Delete
tooltipPosition,
[37323] Fix | Delete
show = false,
[37324] Fix | Delete
style = {},
[37325] Fix | Delete
value = 0,
[37326] Fix | Delete
renderTooltipContent = v => v,
[37327] Fix | Delete
zIndex = 100,
[37328] Fix | Delete
...restProps
[37329] Fix | Delete
} = props;
[37330] Fix | Delete
const position = useTooltipPosition({
[37331] Fix | Delete
inputRef,
[37332] Fix | Delete
tooltipPosition
[37333] Fix | Delete
});
[37334] Fix | Delete
const classes = dist_clsx('components-simple-tooltip', className);
[37335] Fix | Delete
const styles = {
[37336] Fix | Delete
...style,
[37337] Fix | Delete
zIndex
[37338] Fix | Delete
};
[37339] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(range_control_styles_Tooltip, {
[37340] Fix | Delete
...restProps,
[37341] Fix | Delete
"aria-hidden": show,
[37342] Fix | Delete
className: classes,
[37343] Fix | Delete
position: position,
[37344] Fix | Delete
show: show,
[37345] Fix | Delete
role: "tooltip",
[37346] Fix | Delete
style: styles,
[37347] Fix | Delete
children: renderTooltipContent(value)
[37348] Fix | Delete
});
[37349] Fix | Delete
}
[37350] Fix | Delete
function useTooltipPosition({
[37351] Fix | Delete
inputRef,
[37352] Fix | Delete
tooltipPosition
[37353] Fix | Delete
}) {
[37354] Fix | Delete
const [position, setPosition] = (0,external_wp_element_namespaceObject.useState)();
[37355] Fix | Delete
const setTooltipPosition = (0,external_wp_element_namespaceObject.useCallback)(() => {
[37356] Fix | Delete
if (inputRef && inputRef.current) {
[37357] Fix | Delete
setPosition(tooltipPosition);
[37358] Fix | Delete
}
[37359] Fix | Delete
}, [tooltipPosition, inputRef]);
[37360] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[37361] Fix | Delete
setTooltipPosition();
[37362] Fix | Delete
}, [setTooltipPosition]);
[37363] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[37364] Fix | Delete
window.addEventListener('resize', setTooltipPosition);
[37365] Fix | Delete
return () => {
[37366] Fix | Delete
window.removeEventListener('resize', setTooltipPosition);
[37367] Fix | Delete
};
[37368] Fix | Delete
});
[37369] Fix | Delete
return position;
[37370] Fix | Delete
}
[37371] Fix | Delete
[37372] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/index.js
[37373] Fix | Delete
/**
[37374] Fix | Delete
* External dependencies
[37375] Fix | Delete
*/
[37376] Fix | Delete
[37377] Fix | Delete
/**
[37378] Fix | Delete
* WordPress dependencies
[37379] Fix | Delete
*/
[37380] Fix | Delete
[37381] Fix | Delete
[37382] Fix | Delete
[37383] Fix | Delete
[37384] Fix | Delete
/**
[37385] Fix | Delete
* Internal dependencies
[37386] Fix | Delete
*/
[37387] Fix | Delete
[37388] Fix | Delete
[37389] Fix | Delete
[37390] Fix | Delete
[37391] Fix | Delete
[37392] Fix | Delete
[37393] Fix | Delete
[37394] Fix | Delete
[37395] Fix | Delete
[37396] Fix | Delete
[37397] Fix | Delete
[37398] Fix | Delete
[37399] Fix | Delete
[37400] Fix | Delete
const range_control_noop = () => {};
[37401] Fix | Delete
function UnforwardedRangeControl(props, forwardedRef) {
[37402] Fix | Delete
const {
[37403] Fix | Delete
__nextHasNoMarginBottom = false,
[37404] Fix | Delete
afterIcon,
[37405] Fix | Delete
allowReset = false,
[37406] Fix | Delete
beforeIcon,
[37407] Fix | Delete
className,
[37408] Fix | Delete
color: colorProp = COLORS.theme.accent,
[37409] Fix | Delete
currentInput,
[37410] Fix | Delete
disabled = false,
[37411] Fix | Delete
help,
[37412] Fix | Delete
hideLabelFromVision = false,
[37413] Fix | Delete
initialPosition,
[37414] Fix | Delete
isShiftStepEnabled = true,
[37415] Fix | Delete
label,
[37416] Fix | Delete
marks = false,
[37417] Fix | Delete
max = 100,
[37418] Fix | Delete
min = 0,
[37419] Fix | Delete
onBlur = range_control_noop,
[37420] Fix | Delete
onChange = range_control_noop,
[37421] Fix | Delete
onFocus = range_control_noop,
[37422] Fix | Delete
onMouseLeave = range_control_noop,
[37423] Fix | Delete
onMouseMove = range_control_noop,
[37424] Fix | Delete
railColor,
[37425] Fix | Delete
renderTooltipContent = v => v,
[37426] Fix | Delete
resetFallbackValue,
[37427] Fix | Delete
__next40pxDefaultSize = false,
[37428] Fix | Delete
shiftStep = 10,
[37429] Fix | Delete
showTooltip: showTooltipProp,
[37430] Fix | Delete
step = 1,
[37431] Fix | Delete
trackColor,
[37432] Fix | Delete
value: valueProp,
[37433] Fix | Delete
withInputField = true,
[37434] Fix | Delete
...otherProps
[37435] Fix | Delete
} = props;
[37436] Fix | Delete
const [value, setValue] = useControlledRangeValue({
[37437] Fix | Delete
min,
[37438] Fix | Delete
max,
[37439] Fix | Delete
value: valueProp !== null && valueProp !== void 0 ? valueProp : null,
[37440] Fix | Delete
initial: initialPosition
[37441] Fix | Delete
});
[37442] Fix | Delete
const isResetPendent = (0,external_wp_element_namespaceObject.useRef)(false);
[37443] Fix | Delete
let hasTooltip = showTooltipProp;
[37444] Fix | Delete
let hasInputField = withInputField;
[37445] Fix | Delete
if (step === 'any') {
[37446] Fix | Delete
// The tooltip and number input field are hidden when the step is "any"
[37447] Fix | Delete
// because the decimals get too lengthy to fit well.
[37448] Fix | Delete
hasTooltip = false;
[37449] Fix | Delete
hasInputField = false;
[37450] Fix | Delete
}
[37451] Fix | Delete
const [showTooltip, setShowTooltip] = (0,external_wp_element_namespaceObject.useState)(hasTooltip);
[37452] Fix | Delete
const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false);
[37453] Fix | Delete
const inputRef = (0,external_wp_element_namespaceObject.useRef)();
[37454] Fix | Delete
const isCurrentlyFocused = inputRef.current?.matches(':focus');
[37455] Fix | Delete
const isThumbFocused = !disabled && isFocused;
[37456] Fix | Delete
const isValueReset = value === null;
[37457] Fix | Delete
const currentValue = value !== undefined ? value : currentInput;
[37458] Fix | Delete
const inputSliderValue = isValueReset ? '' : currentValue;
[37459] Fix | Delete
const rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
[37460] Fix | Delete
const fillValue = isValueReset ? 50 : (value - min) / (max - min) * 100;
[37461] Fix | Delete
const fillValueOffset = `${math_clamp(fillValue, 0, 100)}%`;
[37462] Fix | Delete
const classes = dist_clsx('components-range-control', className);
[37463] Fix | Delete
const wrapperClasses = dist_clsx('components-range-control__wrapper', !!marks && 'is-marked');
[37464] Fix | Delete
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(UnforwardedRangeControl, 'inspector-range-control');
[37465] Fix | Delete
const describedBy = !!help ? `${id}__help` : undefined;
[37466] Fix | Delete
const enableTooltip = hasTooltip !== false && Number.isFinite(value);
[37467] Fix | Delete
const handleOnRangeChange = event => {
[37468] Fix | Delete
const nextValue = parseFloat(event.target.value);
[37469] Fix | Delete
setValue(nextValue);
[37470] Fix | Delete
onChange(nextValue);
[37471] Fix | Delete
};
[37472] Fix | Delete
const handleOnChange = next => {
[37473] Fix | Delete
// @ts-expect-error TODO: Investigate if it's problematic for setValue() to
[37474] Fix | Delete
// potentially receive a NaN when next is undefined.
[37475] Fix | Delete
let nextValue = parseFloat(next);
[37476] Fix | Delete
setValue(nextValue);
[37477] Fix | Delete
[37478] Fix | Delete
/*
[37479] Fix | Delete
* Calls onChange only when nextValue is numeric
[37480] Fix | Delete
* otherwise may queue a reset for the blur event.
[37481] Fix | Delete
*/
[37482] Fix | Delete
if (!isNaN(nextValue)) {
[37483] Fix | Delete
if (nextValue < min || nextValue > max) {
[37484] Fix | Delete
nextValue = floatClamp(nextValue, min, max);
[37485] Fix | Delete
}
[37486] Fix | Delete
onChange(nextValue);
[37487] Fix | Delete
isResetPendent.current = false;
[37488] Fix | Delete
} else if (allowReset) {
[37489] Fix | Delete
isResetPendent.current = true;
[37490] Fix | Delete
}
[37491] Fix | Delete
};
[37492] Fix | Delete
const handleOnInputNumberBlur = () => {
[37493] Fix | Delete
if (isResetPendent.current) {
[37494] Fix | Delete
handleOnReset();
[37495] Fix | Delete
isResetPendent.current = false;
[37496] Fix | Delete
}
[37497] Fix | Delete
};
[37498] Fix | Delete
const handleOnReset = () => {
[37499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function