Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/tooltip.js
[32500] Fix | Delete
[32501] Fix | Delete
[32502] Fix | Delete
[32503] Fix | Delete
[32504] Fix | Delete
[32505] Fix | Delete
[32506] Fix | Delete
function tooltip_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[32507] Fix | Delete
[32508] Fix | Delete
function tooltip_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { tooltip_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { tooltip_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[32509] Fix | Delete
[32510] Fix | Delete
/**
[32511] Fix | Delete
* External dependencies
[32512] Fix | Delete
*/
[32513] Fix | Delete
[32514] Fix | Delete
/**
[32515] Fix | Delete
* WordPress dependencies
[32516] Fix | Delete
*/
[32517] Fix | Delete
[32518] Fix | Delete
[32519] Fix | Delete
/**
[32520] Fix | Delete
* Internal dependencies
[32521] Fix | Delete
*/
[32522] Fix | Delete
[32523] Fix | Delete
[32524] Fix | Delete
var TOOLTIP_OFFSET_HEIGHT = 32;
[32525] Fix | Delete
function SimpleTooltip(_ref) {
[32526] Fix | Delete
var className = _ref.className,
[32527] Fix | Delete
inputRef = _ref.inputRef,
[32528] Fix | Delete
_ref$position = _ref.position,
[32529] Fix | Delete
positionProp = _ref$position === void 0 ? 'auto' : _ref$position,
[32530] Fix | Delete
_ref$show = _ref.show,
[32531] Fix | Delete
show = _ref$show === void 0 ? false : _ref$show,
[32532] Fix | Delete
_ref$style = _ref.style,
[32533] Fix | Delete
style = _ref$style === void 0 ? {} : _ref$style,
[32534] Fix | Delete
_ref$value = _ref.value,
[32535] Fix | Delete
value = _ref$value === void 0 ? 0 : _ref$value,
[32536] Fix | Delete
_ref$renderTooltipCon = _ref.renderTooltipContent,
[32537] Fix | Delete
renderTooltipContent = _ref$renderTooltipCon === void 0 ? function (v) {
[32538] Fix | Delete
return v;
[32539] Fix | Delete
} : _ref$renderTooltipCon,
[32540] Fix | Delete
_ref$zIndex = _ref.zIndex,
[32541] Fix | Delete
zIndex = _ref$zIndex === void 0 ? 100 : _ref$zIndex,
[32542] Fix | Delete
restProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "inputRef", "position", "show", "style", "value", "renderTooltipContent", "zIndex"]);
[32543] Fix | Delete
[32544] Fix | Delete
var position = useTooltipPosition({
[32545] Fix | Delete
inputRef: inputRef,
[32546] Fix | Delete
position: positionProp
[32547] Fix | Delete
});
[32548] Fix | Delete
var classes = classnames_default()('components-simple-tooltip', className);
[32549] Fix | Delete
[32550] Fix | Delete
var styles = tooltip_objectSpread(tooltip_objectSpread({}, style), {}, {
[32551] Fix | Delete
zIndex: zIndex
[32552] Fix | Delete
});
[32553] Fix | Delete
[32554] Fix | Delete
return Object(external_wp_element_["createElement"])(range_control_styles_Tooltip, Object(esm_extends["a" /* default */])({}, restProps, {
[32555] Fix | Delete
"aria-hidden": show,
[32556] Fix | Delete
className: classes,
[32557] Fix | Delete
position: position,
[32558] Fix | Delete
show: show,
[32559] Fix | Delete
role: "tooltip",
[32560] Fix | Delete
style: styles
[32561] Fix | Delete
}), renderTooltipContent(value));
[32562] Fix | Delete
}
[32563] Fix | Delete
[32564] Fix | Delete
function useTooltipPosition(_ref2) {
[32565] Fix | Delete
var inputRef = _ref2.inputRef,
[32566] Fix | Delete
positionProp = _ref2.position;
[32567] Fix | Delete
[32568] Fix | Delete
var _useState = Object(external_wp_element_["useState"])('top'),
[32569] Fix | Delete
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
[32570] Fix | Delete
position = _useState2[0],
[32571] Fix | Delete
setPosition = _useState2[1];
[32572] Fix | Delete
[32573] Fix | Delete
var calculatePosition = Object(external_wp_element_["useCallback"])(function () {
[32574] Fix | Delete
if (inputRef && inputRef.current) {
[32575] Fix | Delete
var nextPosition = positionProp;
[32576] Fix | Delete
[32577] Fix | Delete
if (positionProp === 'auto') {
[32578] Fix | Delete
var _inputRef$current$get = inputRef.current.getBoundingClientRect(),
[32579] Fix | Delete
top = _inputRef$current$get.top;
[32580] Fix | Delete
[32581] Fix | Delete
var isOffscreenTop = top - TOOLTIP_OFFSET_HEIGHT < 0;
[32582] Fix | Delete
nextPosition = isOffscreenTop ? 'bottom' : 'top';
[32583] Fix | Delete
}
[32584] Fix | Delete
[32585] Fix | Delete
setPosition(nextPosition);
[32586] Fix | Delete
}
[32587] Fix | Delete
}, [positionProp]);
[32588] Fix | Delete
Object(external_wp_element_["useEffect"])(function () {
[32589] Fix | Delete
calculatePosition();
[32590] Fix | Delete
}, [calculatePosition]);
[32591] Fix | Delete
Object(external_wp_element_["useEffect"])(function () {
[32592] Fix | Delete
window.addEventListener('resize', calculatePosition);
[32593] Fix | Delete
return function () {
[32594] Fix | Delete
window.removeEventListener('resize', calculatePosition);
[32595] Fix | Delete
};
[32596] Fix | Delete
});
[32597] Fix | Delete
return position;
[32598] Fix | Delete
}
[32599] Fix | Delete
[32600] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/index.js
[32601] Fix | Delete
[32602] Fix | Delete
[32603] Fix | Delete
[32604] Fix | Delete
[32605] Fix | Delete
[32606] Fix | Delete
[32607] Fix | Delete
/**
[32608] Fix | Delete
* External dependencies
[32609] Fix | Delete
*/
[32610] Fix | Delete
[32611] Fix | Delete
[32612] Fix | Delete
/**
[32613] Fix | Delete
* WordPress dependencies
[32614] Fix | Delete
*/
[32615] Fix | Delete
[32616] Fix | Delete
[32617] Fix | Delete
[32618] Fix | Delete
[32619] Fix | Delete
/**
[32620] Fix | Delete
* Internal dependencies
[32621] Fix | Delete
*/
[32622] Fix | Delete
[32623] Fix | Delete
[32624] Fix | Delete
[32625] Fix | Delete
[32626] Fix | Delete
[32627] Fix | Delete
[32628] Fix | Delete
[32629] Fix | Delete
[32630] Fix | Delete
[32631] Fix | Delete
[32632] Fix | Delete
[32633] Fix | Delete
function RangeControl(_ref, ref) {
[32634] Fix | Delete
var _inputRef$current;
[32635] Fix | Delete
[32636] Fix | Delete
var afterIcon = _ref.afterIcon,
[32637] Fix | Delete
_ref$allowReset = _ref.allowReset,
[32638] Fix | Delete
allowReset = _ref$allowReset === void 0 ? false : _ref$allowReset,
[32639] Fix | Delete
beforeIcon = _ref.beforeIcon,
[32640] Fix | Delete
className = _ref.className,
[32641] Fix | Delete
currentInput = _ref.currentInput,
[32642] Fix | Delete
_ref$color = _ref.color,
[32643] Fix | Delete
colorProp = _ref$color === void 0 ? colors_color('ui.theme') : _ref$color,
[32644] Fix | Delete
_ref$disabled = _ref.disabled,
[32645] Fix | Delete
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
[32646] Fix | Delete
help = _ref.help,
[32647] Fix | Delete
initialPosition = _ref.initialPosition,
[32648] Fix | Delete
_ref$isShiftStepEnabl = _ref.isShiftStepEnabled,
[32649] Fix | Delete
isShiftStepEnabled = _ref$isShiftStepEnabl === void 0 ? true : _ref$isShiftStepEnabl,
[32650] Fix | Delete
label = _ref.label,
[32651] Fix | Delete
_ref$marks = _ref.marks,
[32652] Fix | Delete
marks = _ref$marks === void 0 ? false : _ref$marks,
[32653] Fix | Delete
_ref$max = _ref.max,
[32654] Fix | Delete
max = _ref$max === void 0 ? 100 : _ref$max,
[32655] Fix | Delete
_ref$min = _ref.min,
[32656] Fix | Delete
min = _ref$min === void 0 ? 0 : _ref$min,
[32657] Fix | Delete
_ref$onBlur = _ref.onBlur,
[32658] Fix | Delete
onBlur = _ref$onBlur === void 0 ? external_lodash_["noop"] : _ref$onBlur,
[32659] Fix | Delete
_ref$onChange = _ref.onChange,
[32660] Fix | Delete
onChange = _ref$onChange === void 0 ? external_lodash_["noop"] : _ref$onChange,
[32661] Fix | Delete
_ref$onFocus = _ref.onFocus,
[32662] Fix | Delete
onFocus = _ref$onFocus === void 0 ? external_lodash_["noop"] : _ref$onFocus,
[32663] Fix | Delete
_ref$onMouseMove = _ref.onMouseMove,
[32664] Fix | Delete
onMouseMove = _ref$onMouseMove === void 0 ? external_lodash_["noop"] : _ref$onMouseMove,
[32665] Fix | Delete
_ref$onMouseLeave = _ref.onMouseLeave,
[32666] Fix | Delete
onMouseLeave = _ref$onMouseLeave === void 0 ? external_lodash_["noop"] : _ref$onMouseLeave,
[32667] Fix | Delete
railColor = _ref.railColor,
[32668] Fix | Delete
resetFallbackValue = _ref.resetFallbackValue,
[32669] Fix | Delete
_ref$renderTooltipCon = _ref.renderTooltipContent,
[32670] Fix | Delete
renderTooltipContent = _ref$renderTooltipCon === void 0 ? function (v) {
[32671] Fix | Delete
return v;
[32672] Fix | Delete
} : _ref$renderTooltipCon,
[32673] Fix | Delete
showTooltipProp = _ref.showTooltip,
[32674] Fix | Delete
_ref$shiftStep = _ref.shiftStep,
[32675] Fix | Delete
shiftStep = _ref$shiftStep === void 0 ? 10 : _ref$shiftStep,
[32676] Fix | Delete
_ref$step = _ref.step,
[32677] Fix | Delete
step = _ref$step === void 0 ? 1 : _ref$step,
[32678] Fix | Delete
trackColor = _ref.trackColor,
[32679] Fix | Delete
valueProp = _ref.value,
[32680] Fix | Delete
_ref$withInputField = _ref.withInputField,
[32681] Fix | Delete
withInputField = _ref$withInputField === void 0 ? true : _ref$withInputField,
[32682] Fix | Delete
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["afterIcon", "allowReset", "beforeIcon", "className", "currentInput", "color", "disabled", "help", "initialPosition", "isShiftStepEnabled", "label", "marks", "max", "min", "onBlur", "onChange", "onFocus", "onMouseMove", "onMouseLeave", "railColor", "resetFallbackValue", "renderTooltipContent", "showTooltip", "shiftStep", "step", "trackColor", "value", "withInputField"]);
[32683] Fix | Delete
[32684] Fix | Delete
var _useControlledRangeVa = useControlledRangeValue({
[32685] Fix | Delete
min: min,
[32686] Fix | Delete
max: max,
[32687] Fix | Delete
value: valueProp,
[32688] Fix | Delete
initial: initialPosition
[32689] Fix | Delete
}),
[32690] Fix | Delete
_useControlledRangeVa2 = Object(slicedToArray["a" /* default */])(_useControlledRangeVa, 2),
[32691] Fix | Delete
value = _useControlledRangeVa2[0],
[32692] Fix | Delete
setValue = _useControlledRangeVa2[1];
[32693] Fix | Delete
[32694] Fix | Delete
var isResetPendent = Object(external_wp_element_["useRef"])(false);
[32695] Fix | Delete
[32696] Fix | Delete
var _useState = Object(external_wp_element_["useState"])(showTooltipProp),
[32697] Fix | Delete
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
[32698] Fix | Delete
showTooltip = _useState2[0],
[32699] Fix | Delete
setShowTooltip = _useState2[1];
[32700] Fix | Delete
[32701] Fix | Delete
var _useState3 = Object(external_wp_element_["useState"])(false),
[32702] Fix | Delete
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
[32703] Fix | Delete
isFocused = _useState4[0],
[32704] Fix | Delete
setIsFocused = _useState4[1];
[32705] Fix | Delete
[32706] Fix | Delete
var inputRef = Object(external_wp_element_["useRef"])();
[32707] Fix | Delete
[32708] Fix | Delete
var setRef = function setRef(nodeRef) {
[32709] Fix | Delete
inputRef.current = nodeRef;
[32710] Fix | Delete
[32711] Fix | Delete
if (ref) {
[32712] Fix | Delete
ref(nodeRef);
[32713] Fix | Delete
}
[32714] Fix | Delete
};
[32715] Fix | Delete
[32716] Fix | Delete
var isCurrentlyFocused = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.matches(':focus');
[32717] Fix | Delete
var isThumbFocused = !disabled && isFocused;
[32718] Fix | Delete
var isValueReset = value === null;
[32719] Fix | Delete
var currentValue = value !== undefined ? value : currentInput;
[32720] Fix | Delete
var inputSliderValue = isValueReset ? '' : currentValue;
[32721] Fix | Delete
var rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
[32722] Fix | Delete
var calculatedFillValue = (value - min) / (max - min) * 100;
[32723] Fix | Delete
var fillValue = isValueReset ? 50 : calculatedFillValue;
[32724] Fix | Delete
var fillValueOffset = "".concat(Object(external_lodash_["clamp"])(fillValue, 0, 100), "%");
[32725] Fix | Delete
var classes = classnames_default()('components-range-control', className);
[32726] Fix | Delete
var wrapperClasses = classnames_default()('components-range-control__wrapper', !!marks && 'is-marked');
[32727] Fix | Delete
var id = Object(external_wp_compose_["useInstanceId"])(RangeControl, 'inspector-range-control');
[32728] Fix | Delete
var describedBy = !!help ? "".concat(id, "__help") : undefined;
[32729] Fix | Delete
var enableTooltip = showTooltipProp !== false && Object(external_lodash_["isFinite"])(value);
[32730] Fix | Delete
[32731] Fix | Delete
var handleOnRangeChange = function handleOnRangeChange(event) {
[32732] Fix | Delete
var nextValue = parseFloat(event.target.value);
[32733] Fix | Delete
setValue(nextValue);
[32734] Fix | Delete
onChange(nextValue);
[32735] Fix | Delete
};
[32736] Fix | Delete
[32737] Fix | Delete
var handleOnChange = function handleOnChange(nextValue) {
[32738] Fix | Delete
nextValue = parseFloat(nextValue);
[32739] Fix | Delete
setValue(nextValue);
[32740] Fix | Delete
/*
[32741] Fix | Delete
* Calls onChange only when nextValue is numeric
[32742] Fix | Delete
* otherwise may queue a reset for the blur event.
[32743] Fix | Delete
*/
[32744] Fix | Delete
[32745] Fix | Delete
if (!isNaN(nextValue)) {
[32746] Fix | Delete
if (nextValue < min || nextValue > max) {
[32747] Fix | Delete
nextValue = floatClamp(nextValue, min, max);
[32748] Fix | Delete
}
[32749] Fix | Delete
[32750] Fix | Delete
onChange(nextValue);
[32751] Fix | Delete
isResetPendent.current = false;
[32752] Fix | Delete
} else if (allowReset) {
[32753] Fix | Delete
isResetPendent.current = true;
[32754] Fix | Delete
}
[32755] Fix | Delete
};
[32756] Fix | Delete
[32757] Fix | Delete
var handleOnInputNumberBlur = function handleOnInputNumberBlur() {
[32758] Fix | Delete
if (isResetPendent.current) {
[32759] Fix | Delete
handleOnReset();
[32760] Fix | Delete
isResetPendent.current = false;
[32761] Fix | Delete
}
[32762] Fix | Delete
};
[32763] Fix | Delete
[32764] Fix | Delete
var handleOnReset = function handleOnReset() {
[32765] Fix | Delete
var resetValue = parseFloat(resetFallbackValue);
[32766] Fix | Delete
var onChangeResetValue = resetValue;
[32767] Fix | Delete
[32768] Fix | Delete
if (isNaN(resetValue)) {
[32769] Fix | Delete
resetValue = null;
[32770] Fix | Delete
onChangeResetValue = undefined;
[32771] Fix | Delete
}
[32772] Fix | Delete
[32773] Fix | Delete
setValue(resetValue);
[32774] Fix | Delete
/**
[32775] Fix | Delete
* Previously, this callback would always receive undefined as
[32776] Fix | Delete
* an argument. This behavior is unexpected, specifically
[32777] Fix | Delete
* when resetFallbackValue is defined.
[32778] Fix | Delete
*
[32779] Fix | Delete
* The value of undefined is not ideal. Passing it through
[32780] Fix | Delete
* to internal <input /> elements would change it from a
[32781] Fix | Delete
* controlled component to an uncontrolled component.
[32782] Fix | Delete
*
[32783] Fix | Delete
* For now, to minimize unexpected regressions, we're going to
[32784] Fix | Delete
* preserve the undefined callback argument, except when a
[32785] Fix | Delete
* resetFallbackValue is defined.
[32786] Fix | Delete
*/
[32787] Fix | Delete
[32788] Fix | Delete
onChange(onChangeResetValue);
[32789] Fix | Delete
};
[32790] Fix | Delete
[32791] Fix | Delete
var handleShowTooltip = function handleShowTooltip() {
[32792] Fix | Delete
return setShowTooltip(true);
[32793] Fix | Delete
};
[32794] Fix | Delete
[32795] Fix | Delete
var handleHideTooltip = function handleHideTooltip() {
[32796] Fix | Delete
return setShowTooltip(false);
[32797] Fix | Delete
};
[32798] Fix | Delete
[32799] Fix | Delete
var handleOnBlur = function handleOnBlur(event) {
[32800] Fix | Delete
onBlur(event);
[32801] Fix | Delete
setIsFocused(false);
[32802] Fix | Delete
handleHideTooltip();
[32803] Fix | Delete
};
[32804] Fix | Delete
[32805] Fix | Delete
var handleOnFocus = function handleOnFocus(event) {
[32806] Fix | Delete
onFocus(event);
[32807] Fix | Delete
setIsFocused(true);
[32808] Fix | Delete
handleShowTooltip();
[32809] Fix | Delete
};
[32810] Fix | Delete
[32811] Fix | Delete
var offsetStyle = Object(esm_defineProperty["a" /* default */])({}, Object(external_wp_i18n_["isRTL"])() ? 'right' : 'left', fillValueOffset);
[32812] Fix | Delete
[32813] Fix | Delete
return Object(external_wp_element_["createElement"])(base_control, {
[32814] Fix | Delete
className: classes,
[32815] Fix | Delete
label: label,
[32816] Fix | Delete
id: id,
[32817] Fix | Delete
help: help
[32818] Fix | Delete
}, Object(external_wp_element_["createElement"])(range_control_styles_Root, {
[32819] Fix | Delete
className: "components-range-control__root"
[32820] Fix | Delete
}, beforeIcon && Object(external_wp_element_["createElement"])(BeforeIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
[32821] Fix | Delete
icon: beforeIcon
[32822] Fix | Delete
})), Object(external_wp_element_["createElement"])(range_control_styles_Wrapper, {
[32823] Fix | Delete
className: wrapperClasses,
[32824] Fix | Delete
color: colorProp,
[32825] Fix | Delete
marks: !!marks
[32826] Fix | Delete
}, Object(external_wp_element_["createElement"])(input_range, Object(esm_extends["a" /* default */])({}, props, {
[32827] Fix | Delete
className: "components-range-control__slider",
[32828] Fix | Delete
describedBy: describedBy,
[32829] Fix | Delete
disabled: disabled,
[32830] Fix | Delete
id: id,
[32831] Fix | Delete
isShiftStepEnabled: isShiftStepEnabled,
[32832] Fix | Delete
label: label,
[32833] Fix | Delete
max: max,
[32834] Fix | Delete
min: min,
[32835] Fix | Delete
onBlur: handleOnBlur,
[32836] Fix | Delete
onChange: handleOnRangeChange,
[32837] Fix | Delete
onFocus: handleOnFocus,
[32838] Fix | Delete
onMouseMove: onMouseMove,
[32839] Fix | Delete
onMouseLeave: onMouseLeave,
[32840] Fix | Delete
ref: setRef,
[32841] Fix | Delete
shiftStep: shiftStep,
[32842] Fix | Delete
step: step,
[32843] Fix | Delete
value: inputSliderValue
[32844] Fix | Delete
})), Object(external_wp_element_["createElement"])(RangeRail, {
[32845] Fix | Delete
"aria-hidden": true,
[32846] Fix | Delete
disabled: disabled,
[32847] Fix | Delete
marks: marks,
[32848] Fix | Delete
max: max,
[32849] Fix | Delete
min: min,
[32850] Fix | Delete
railColor: railColor,
[32851] Fix | Delete
step: step,
[32852] Fix | Delete
value: rangeFillValue
[32853] Fix | Delete
}), Object(external_wp_element_["createElement"])(Track, {
[32854] Fix | Delete
"aria-hidden": true,
[32855] Fix | Delete
className: "components-range-control__track",
[32856] Fix | Delete
disabled: disabled,
[32857] Fix | Delete
style: {
[32858] Fix | Delete
width: fillValueOffset
[32859] Fix | Delete
},
[32860] Fix | Delete
trackColor: trackColor
[32861] Fix | Delete
}), Object(external_wp_element_["createElement"])(ThumbWrapper, {
[32862] Fix | Delete
style: offsetStyle
[32863] Fix | Delete
}, Object(external_wp_element_["createElement"])(Thumb, {
[32864] Fix | Delete
"aria-hidden": true,
[32865] Fix | Delete
isFocused: isThumbFocused
[32866] Fix | Delete
})), enableTooltip && Object(external_wp_element_["createElement"])(SimpleTooltip, {
[32867] Fix | Delete
className: "components-range-control__tooltip",
[32868] Fix | Delete
inputRef: inputRef,
[32869] Fix | Delete
renderTooltipContent: renderTooltipContent,
[32870] Fix | Delete
show: isCurrentlyFocused || showTooltip,
[32871] Fix | Delete
style: offsetStyle,
[32872] Fix | Delete
value: value
[32873] Fix | Delete
})), afterIcon && Object(external_wp_element_["createElement"])(AfterIconWrapper, null, Object(external_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
[32874] Fix | Delete
icon: afterIcon
[32875] Fix | Delete
})), withInputField && Object(external_wp_element_["createElement"])(InputNumber, {
[32876] Fix | Delete
"aria-label": label,
[32877] Fix | Delete
className: "components-range-control__number",
[32878] Fix | Delete
disabled: disabled,
[32879] Fix | Delete
inputMode: "decimal",
[32880] Fix | Delete
isShiftStepEnabled: isShiftStepEnabled,
[32881] Fix | Delete
max: max,
[32882] Fix | Delete
min: min,
[32883] Fix | Delete
onBlur: handleOnInputNumberBlur,
[32884] Fix | Delete
onChange: handleOnChange,
[32885] Fix | Delete
shiftStep: shiftStep,
[32886] Fix | Delete
step: step,
[32887] Fix | Delete
value: inputSliderValue
[32888] Fix | Delete
}), allowReset && Object(external_wp_element_["createElement"])(ActionRightWrapper, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[32889] Fix | Delete
className: "components-range-control__reset",
[32890] Fix | Delete
disabled: disabled || value === undefined,
[32891] Fix | Delete
isSecondary: true,
[32892] Fix | Delete
isSmall: true,
[32893] Fix | Delete
onClick: handleOnReset
[32894] Fix | Delete
}, Object(external_wp_i18n_["__"])('Reset')))));
[32895] Fix | Delete
}
[32896] Fix | Delete
[32897] Fix | Delete
var range_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(RangeControl);
[32898] Fix | Delete
/* harmony default export */ var range_control = (range_control_ForwardedComponent);
[32899] Fix | Delete
[32900] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/next.js
[32901] Fix | Delete
[32902] Fix | Delete
[32903] Fix | Delete
[32904] Fix | Delete
/**
[32905] Fix | Delete
* Internal dependencies
[32906] Fix | Delete
*/
[32907] Fix | Delete
[32908] Fix | Delete
[32909] Fix | Delete
var FontSizePicker = false ? undefined : undefined;
[32910] Fix | Delete
function next_withNextComponent(current) {
[32911] Fix | Delete
return withNext(current, FontSizePicker, 'WPComponentsFontSizePicker');
[32912] Fix | Delete
}
[32913] Fix | Delete
[32914] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/index.js
[32915] Fix | Delete
[32916] Fix | Delete
[32917] Fix | Delete
[32918] Fix | Delete
[32919] Fix | Delete
/**
[32920] Fix | Delete
* External dependencies
[32921] Fix | Delete
*/
[32922] Fix | Delete
[32923] Fix | Delete
/**
[32924] Fix | Delete
* WordPress dependencies
[32925] Fix | Delete
*/
[32926] Fix | Delete
[32927] Fix | Delete
[32928] Fix | Delete
[32929] Fix | Delete
[32930] Fix | Delete
[32931] Fix | Delete
/**
[32932] Fix | Delete
* Internal dependencies
[32933] Fix | Delete
*/
[32934] Fix | Delete
[32935] Fix | Delete
[32936] Fix | Delete
[32937] Fix | Delete
[32938] Fix | Delete
[32939] Fix | Delete
[32940] Fix | Delete
var DEFAULT_FONT_SIZE = 'default';
[32941] Fix | Delete
var CUSTOM_FONT_SIZE = 'custom';
[32942] Fix | Delete
var MAX_FONT_SIZE_DISPLAY = '25px';
[32943] Fix | Delete
[32944] Fix | Delete
function getSelectValueFromFontSize(fontSizes, value) {
[32945] Fix | Delete
if (value) {
[32946] Fix | Delete
var fontSizeValue = fontSizes.find(function (font) {
[32947] Fix | Delete
return font.size === value;
[32948] Fix | Delete
});
[32949] Fix | Delete
return fontSizeValue ? fontSizeValue.slug : CUSTOM_FONT_SIZE;
[32950] Fix | Delete
}
[32951] Fix | Delete
[32952] Fix | Delete
return DEFAULT_FONT_SIZE;
[32953] Fix | Delete
}
[32954] Fix | Delete
[32955] Fix | Delete
function getSelectOptions(optionsArray, disableCustomFontSizes) {
[32956] Fix | Delete
if (disableCustomFontSizes && !optionsArray.length) {
[32957] Fix | Delete
return null;
[32958] Fix | Delete
}
[32959] Fix | Delete
[32960] Fix | Delete
optionsArray = [{
[32961] Fix | Delete
slug: DEFAULT_FONT_SIZE,
[32962] Fix | Delete
name: Object(external_wp_i18n_["__"])('Default')
[32963] Fix | Delete
}].concat(Object(toConsumableArray["a" /* default */])(optionsArray), Object(toConsumableArray["a" /* default */])(disableCustomFontSizes ? [] : [{
[32964] Fix | Delete
slug: CUSTOM_FONT_SIZE,
[32965] Fix | Delete
name: Object(external_wp_i18n_["__"])('Custom')
[32966] Fix | Delete
}]));
[32967] Fix | Delete
return optionsArray.map(function (option) {
[32968] Fix | Delete
return {
[32969] Fix | Delete
key: option.slug,
[32970] Fix | Delete
name: option.name,
[32971] Fix | Delete
size: option.size,
[32972] Fix | Delete
style: {
[32973] Fix | Delete
fontSize: "min( ".concat(option.size, ", ").concat(MAX_FONT_SIZE_DISPLAY, " )")
[32974] Fix | Delete
}
[32975] Fix | Delete
};
[32976] Fix | Delete
});
[32977] Fix | Delete
}
[32978] Fix | Delete
[32979] Fix | Delete
function font_size_picker_FontSizePicker(_ref, ref) {
[32980] Fix | Delete
var fallbackFontSize = _ref.fallbackFontSize,
[32981] Fix | Delete
_ref$fontSizes = _ref.fontSizes,
[32982] Fix | Delete
fontSizes = _ref$fontSizes === void 0 ? [] : _ref$fontSizes,
[32983] Fix | Delete
_ref$disableCustomFon = _ref.disableCustomFontSizes,
[32984] Fix | Delete
disableCustomFontSizes = _ref$disableCustomFon === void 0 ? false : _ref$disableCustomFon,
[32985] Fix | Delete
_onChange = _ref.onChange,
[32986] Fix | Delete
value = _ref.value,
[32987] Fix | Delete
_ref$withSlider = _ref.withSlider,
[32988] Fix | Delete
withSlider = _ref$withSlider === void 0 ? false : _ref$withSlider;
[32989] Fix | Delete
var hasUnits = Object(external_lodash_["isString"])(value) || fontSizes[0] && Object(external_lodash_["isString"])(fontSizes[0].size);
[32990] Fix | Delete
var noUnitsValue;
[32991] Fix | Delete
[32992] Fix | Delete
if (!hasUnits) {
[32993] Fix | Delete
noUnitsValue = value;
[32994] Fix | Delete
} else {
[32995] Fix | Delete
noUnitsValue = parseInt(value);
[32996] Fix | Delete
}
[32997] Fix | Delete
[32998] Fix | Delete
var isPixelValue = Object(external_lodash_["isNumber"])(value) || Object(external_lodash_["isString"])(value) && value.endsWith('px');
[32999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function