@elementor/editor-controls 4.3.0 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2929,8 +2929,24 @@ var ToggleControl = createControl(
2929
2929
 
2930
2930
  // src/controls/number-control.tsx
2931
2931
  import * as React57 from "react";
2932
+ import { useRef as useRef9, useState as useState8 } from "react";
2932
2933
  import { numberPropTypeUtil } from "@elementor/editor-props";
2933
2934
  import { InputAdornment as InputAdornment3, Typography as Typography4 } from "@elementor/ui";
2935
+
2936
+ // src/utils/number-value.ts
2937
+ var isEmptyDraft = (raw) => raw.trim() === "";
2938
+ var parseNumberDraft = (raw, shouldForceInt = false) => {
2939
+ const trimmed = raw.trim();
2940
+ if (trimmed === "") {
2941
+ return null;
2942
+ }
2943
+ const parsed = shouldForceInt ? parseInt(trimmed, 10) : Number(trimmed);
2944
+ return Number.isFinite(parsed) ? parsed : null;
2945
+ };
2946
+ var isInRange = (value, min, max) => value >= min && value <= max;
2947
+ var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
2948
+
2949
+ // src/controls/number-control.tsx
2934
2950
  var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
2935
2951
  var renderSuffix = (propType) => {
2936
2952
  if (propType.meta?.suffix) {
@@ -2941,31 +2957,63 @@ var renderSuffix = (propType) => {
2941
2957
  var NumberControl = createControl(
2942
2958
  ({
2943
2959
  placeholder: labelPlaceholder,
2944
- max = Number.MAX_SAFE_INTEGER,
2945
- min = -Number.MAX_SAFE_INTEGER,
2946
- step = 1,
2960
+ max: maxProp,
2961
+ min: minProp,
2962
+ step: stepProp,
2947
2963
  shouldForceInt = false,
2948
2964
  startIcon,
2949
2965
  disabled: inputDisabled
2950
2966
  }) => {
2967
+ const max = maxProp ?? Number.MAX_SAFE_INTEGER;
2968
+ const min = minProp ?? -Number.MAX_SAFE_INTEGER;
2969
+ const step = stepProp ?? 1;
2951
2970
  const { value, setValue, placeholder, disabled, restoreValue, propType } = useBoundProp(numberPropTypeUtil);
2952
- const handleChange = (event) => {
2953
- const {
2954
- value: eventValue,
2955
- validity: { valid: isInputValid }
2956
- } = event.target;
2957
- let updatedValue;
2958
- if (isEmptyOrNaN(eventValue)) {
2959
- updatedValue = null;
2960
- } else {
2961
- const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
2962
- updatedValue = Math.min(
2963
- Math.max(formattedValue, min ?? Number.MIN_SAFE_INTEGER),
2964
- max ?? Number.MAX_SAFE_INTEGER
2965
- );
2971
+ const [draft, setDraft] = useState8(null);
2972
+ const committedNullOnInputRef = useRef9(false);
2973
+ const handleInput = (event) => {
2974
+ const raw = event.target.value;
2975
+ setDraft(raw);
2976
+ if (isEmptyDraft(raw)) {
2977
+ if (!propType.settings.required) {
2978
+ setValue(null);
2979
+ committedNullOnInputRef.current = true;
2980
+ }
2981
+ return;
2982
+ }
2983
+ committedNullOnInputRef.current = false;
2984
+ const parsed = parseNumberDraft(raw, shouldForceInt);
2985
+ if (parsed === null) {
2986
+ return;
2987
+ }
2988
+ if (isInRange(parsed, min, max)) {
2989
+ setValue(parsed);
2966
2990
  }
2967
- setValue(updatedValue, void 0, { validation: () => isInputValid });
2968
2991
  };
2992
+ const handleBlur = () => {
2993
+ const raw = draft;
2994
+ const committedNullOnInput = committedNullOnInputRef.current;
2995
+ committedNullOnInputRef.current = false;
2996
+ setDraft(null);
2997
+ restoreValue();
2998
+ if (raw === null) {
2999
+ return;
3000
+ }
3001
+ if (isEmptyDraft(raw)) {
3002
+ if (!propType.settings.required && !committedNullOnInput) {
3003
+ setValue(null);
3004
+ }
3005
+ return;
3006
+ }
3007
+ const parsed = parseNumberDraft(raw, shouldForceInt);
3008
+ if (parsed === null) {
3009
+ return;
3010
+ }
3011
+ if (isInRange(parsed, min, max)) {
3012
+ return;
3013
+ }
3014
+ setValue(clamp(parsed, min, max));
3015
+ };
3016
+ const displayValue = draft ?? (isEmptyOrNaN(value) ? "" : String(value));
2969
3017
  return /* @__PURE__ */ React57.createElement(ControlActions, null, /* @__PURE__ */ React57.createElement(
2970
3018
  NumberInput,
2971
3019
  {
@@ -2973,11 +3021,11 @@ var NumberControl = createControl(
2973
3021
  type: "number",
2974
3022
  fullWidth: true,
2975
3023
  disabled: inputDisabled ?? disabled,
2976
- value: isEmptyOrNaN(value) ? "" : value,
2977
- onInput: handleChange,
2978
- onBlur: restoreValue,
3024
+ value: displayValue,
3025
+ onInput: handleInput,
3026
+ onBlur: handleBlur,
2979
3027
  placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
2980
- inputProps: { step, min },
3028
+ inputProps: { step, min, ...maxProp !== null && maxProp !== void 0 && { max } },
2981
3029
  InputProps: {
2982
3030
  startAdornment: startIcon ? /* @__PURE__ */ React57.createElement(InputAdornment3, { position: "start", disabled: inputDisabled ?? disabled }, startIcon) : void 0,
2983
3031
  endAdornment: renderSuffix(propType)
@@ -2989,7 +3037,7 @@ var NumberControl = createControl(
2989
3037
 
2990
3038
  // src/controls/equal-unequal-sizes-control.tsx
2991
3039
  import * as React58 from "react";
2992
- import { useId as useId2, useRef as useRef9 } from "react";
3040
+ import { useId as useId2, useRef as useRef10 } from "react";
2993
3041
  import { bindPopover as bindPopover3, bindToggle, Box as Box7, Grid as Grid8, Popover as Popover3, Stack as Stack7, Tooltip as Tooltip5, usePopupState as usePopupState4 } from "@elementor/ui";
2994
3042
  import { __ as __18 } from "@wordpress/i18n";
2995
3043
  function EqualUnequalSizesControl({
@@ -3001,7 +3049,7 @@ function EqualUnequalSizesControl({
3001
3049
  }) {
3002
3050
  const popupId = useId2();
3003
3051
  const popupState = usePopupState4({ variant: "popover", popupId });
3004
- const rowRefs = [useRef9(null), useRef9(null)];
3052
+ const rowRefs = [useRef10(null), useRef10(null)];
3005
3053
  const { propType: multiSizePropType, disabled: multiSizeDisabled } = useBoundProp(multiSizePropTypeUtil);
3006
3054
  const { value: masterValue, setValue: setMasterValue, placeholder: masterPlaceholder } = useBoundProp();
3007
3055
  const getMultiSizeValues = (sourceValue) => {
@@ -3096,7 +3144,7 @@ var MultiSizeValueControl = ({ item, rowRef }) => {
3096
3144
 
3097
3145
  // src/controls/linked-dimensions-control.tsx
3098
3146
  import * as React65 from "react";
3099
- import { useLayoutEffect, useRef as useRef12, useState as useState9 } from "react";
3147
+ import { useLayoutEffect, useRef as useRef13, useState as useState10 } from "react";
3100
3148
  import {
3101
3149
  dimensionsPropTypeUtil,
3102
3150
  sizePropTypeUtil as sizePropTypeUtil5
@@ -3108,7 +3156,7 @@ import { __ as __20, sprintf as sprintf2 } from "@wordpress/i18n";
3108
3156
 
3109
3157
  // src/controls/size-control/unstable-size-control.tsx
3110
3158
  import * as React64 from "react";
3111
- import { useRef as useRef11 } from "react";
3159
+ import { useRef as useRef12 } from "react";
3112
3160
  import { sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
3113
3161
 
3114
3162
  // src/controls/size-control/size-component.tsx
@@ -3235,9 +3283,9 @@ var sanitizeSize = (size) => {
3235
3283
  };
3236
3284
 
3237
3285
  // src/controls/size-control/hooks/use-unit-sync.ts
3238
- import { useEffect as useEffect9, useState as useState8 } from "react";
3286
+ import { useEffect as useEffect9, useState as useState9 } from "react";
3239
3287
  var useUnitSync = ({ sizeValue, setUnit, persistWhen }) => {
3240
- const [state, setState] = useState8(sizeValue.unit);
3288
+ const [state, setState] = useState9(sizeValue.unit);
3241
3289
  useEffect9(() => {
3242
3290
  if (sizeValue.unit !== state) {
3243
3291
  setState(sizeValue.unit);
@@ -3500,14 +3548,14 @@ var shouldHighlightUnit = (value) => {
3500
3548
 
3501
3549
  // src/controls/size-control/ui/text-field-popover.tsx
3502
3550
  import * as React62 from "react";
3503
- import { useEffect as useEffect10, useRef as useRef10 } from "react";
3551
+ import { useEffect as useEffect10, useRef as useRef11 } from "react";
3504
3552
  import { PopoverHeader as PopoverHeader2 } from "@elementor/editor-ui";
3505
3553
  import { MathFunctionIcon as MathFunctionIcon4 } from "@elementor/icons";
3506
3554
  import { bindPopover as bindPopover4, Popover as Popover4, TextField as TextField6 } from "@elementor/ui";
3507
3555
  import { __ as __19 } from "@wordpress/i18n";
3508
3556
  var SIZE7 = "tiny";
3509
3557
  var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
3510
- const inputRef = useRef10(null);
3558
+ const inputRef = useRef11(null);
3511
3559
  useEffect10(() => {
3512
3560
  if (popupState.isOpen) {
3513
3561
  requestAnimationFrame(() => {
@@ -3707,7 +3755,7 @@ var UnstableSizeControl = createControl(
3707
3755
  placeholder: boundPropPlaceholder,
3708
3756
  restoreValue
3709
3757
  } = useBoundProp(sizePropTypeUtil4);
3710
- const lastNonAutoValue = useRef11(null);
3758
+ const lastNonAutoValue = useRef12(null);
3711
3759
  const { sizeValue, placeholder } = resolveBoundPropValue(
3712
3760
  value ?? lastNonAutoValue.current,
3713
3761
  boundPropPlaceholder,
@@ -3764,7 +3812,7 @@ var isTransitioningFromExtendedUnit = (nextValue, previousValue) => {
3764
3812
 
3765
3813
  // src/controls/linked-dimensions-control.tsx
3766
3814
  var LinkedDimensionsControl = ({ label, isSiteRtl = false, min }) => {
3767
- const gridRowRefs = [useRef12(null), useRef12(null)];
3815
+ const gridRowRefs = [useRef13(null), useRef13(null)];
3768
3816
  const { disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil5);
3769
3817
  const {
3770
3818
  value: dimensionsValue,
@@ -3783,7 +3831,7 @@ var LinkedDimensionsControl = ({ label, isSiteRtl = false, min }) => {
3783
3831
  }
3784
3832
  return true;
3785
3833
  };
3786
- const [isLinked, setIsLinked] = useState9(() => inferIsLinked());
3834
+ const [isLinked, setIsLinked] = useState10(() => inferIsLinked());
3787
3835
  const activeBreakpoint = useActiveBreakpoint4();
3788
3836
  const isCurrentlyDimensions = dimensionsPropTypeUtil.isValid(masterValue ?? masterPlaceholder);
3789
3837
  useLayoutEffect(() => {
@@ -3965,7 +4013,7 @@ import { __ as __22 } from "@wordpress/i18n";
3965
4013
 
3966
4014
  // src/components/item-selector.tsx
3967
4015
  import * as React66 from "react";
3968
- import { useCallback as useCallback3, useEffect as useEffect12, useState as useState10 } from "react";
4016
+ import { useCallback as useCallback3, useEffect as useEffect12, useState as useState11 } from "react";
3969
4017
  import { PopoverBody, PopoverHeader as PopoverHeader3, PopoverMenuList, SearchField } from "@elementor/editor-ui";
3970
4018
  import { Box as Box9, Divider as Divider2, Link, Stack as Stack9, Typography as Typography5 } from "@elementor/ui";
3971
4019
  import { debounce } from "@elementor/utils";
@@ -4004,7 +4052,7 @@ var ItemSelector = ({
4004
4052
  footer,
4005
4053
  categoryItemContentTemplate
4006
4054
  }) => {
4007
- const [searchValue, setSearchValue] = useState10("");
4055
+ const [searchValue, setSearchValue] = useState11("");
4008
4056
  const filteredItemsList = useFilteredItemsList(itemsList, searchValue, disabledItems);
4009
4057
  const IconComponent = icon;
4010
4058
  const handleSearch = (value) => {
@@ -4118,7 +4166,7 @@ var ItemList = ({
4118
4166
  );
4119
4167
  };
4120
4168
  var useDebounce = (fn, delay) => {
4121
- const [debouncedFn] = useState10(() => debounce(fn, delay));
4169
+ const [debouncedFn] = useState11(() => debounce(fn, delay));
4122
4170
  useEffect12(() => () => debouncedFn.cancel(), [debouncedFn]);
4123
4171
  return debouncedFn;
4124
4172
  };
@@ -4221,7 +4269,7 @@ var UrlControl = createControl(
4221
4269
 
4222
4270
  // src/controls/link-control.tsx
4223
4271
  import * as React73 from "react";
4224
- import { useEffect as useEffect14, useState as useState12 } from "react";
4272
+ import { useEffect as useEffect14, useState as useState13 } from "react";
4225
4273
  import { getLinkInLinkRestriction } from "@elementor/editor-elements";
4226
4274
  import { linkPropTypeUtil } from "@elementor/editor-props";
4227
4275
  import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
@@ -4449,7 +4497,7 @@ function factoryFilter(newValue, options, minInputLength) {
4449
4497
  }
4450
4498
 
4451
4499
  // src/hooks/use-query-autocomplete.ts
4452
- import { useEffect as useEffect13, useMemo as useMemo9, useState as useState11 } from "react";
4500
+ import { useEffect as useEffect13, useMemo as useMemo9, useState as useState12 } from "react";
4453
4501
  import { numberPropTypeUtil as numberPropTypeUtil2, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
4454
4502
  import { httpService as httpService2 } from "@elementor/http-client";
4455
4503
  import { debounce as debounce2 } from "@elementor/utils";
@@ -4461,7 +4509,7 @@ function useQueryAutocomplete({
4461
4509
  excludeIds
4462
4510
  }) {
4463
4511
  const excludeIdSet = useMemo9(() => new Set((excludeIds ?? []).map(String)), [excludeIds]);
4464
- const [options, setOptions] = useState11(
4512
+ const [options, setOptions] = useState12(
4465
4513
  generateFirstLoadedOption(initialQueryValue)
4466
4514
  );
4467
4515
  const debounceFetch = useMemo9(
@@ -4619,7 +4667,7 @@ var LinkControl = createControl((props) => {
4619
4667
  const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
4620
4668
  const linkPlaceholder = propContext.placeholder;
4621
4669
  const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
4622
- const [isActive, setIsActive] = useState12(!!value || !!linkPlaceholder);
4670
+ const [isActive, setIsActive] = useState13(!!value || !!linkPlaceholder);
4623
4671
  const {
4624
4672
  allowCustomValues = true,
4625
4673
  queryOptions,
@@ -4629,7 +4677,7 @@ var LinkControl = createControl((props) => {
4629
4677
  label = __25("Link", "elementor"),
4630
4678
  ariaLabel
4631
4679
  } = props || {};
4632
- const [linkInLinkRestriction, setLinkInLinkRestriction] = useState12(
4680
+ const [linkInLinkRestriction, setLinkInLinkRestriction] = useState13(
4633
4681
  getLinkInLinkRestriction(elementId, value ?? linkPlaceholder)
4634
4682
  );
4635
4683
  const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
@@ -4910,7 +4958,7 @@ function extractChips(value) {
4910
4958
 
4911
4959
  // src/controls/query-filter-repeater-control.tsx
4912
4960
  import * as React77 from "react";
4913
- import { useMemo as useMemo11, useRef as useRef13 } from "react";
4961
+ import { useMemo as useMemo11, useRef as useRef14 } from "react";
4914
4962
  import { useSelectedElementSettings } from "@elementor/editor-elements";
4915
4963
  import {
4916
4964
  extractValue,
@@ -5012,7 +5060,7 @@ var ItemContent = ({
5012
5060
  chipsPlaceholder
5013
5061
  }) => {
5014
5062
  const propContext = useBoundProp(queryFilterPropTypeUtil);
5015
- const snapshotsByKeyRef = useRef13({});
5063
+ const snapshotsByKeyRef = useRef14({});
5016
5064
  const handleValueChange = (nextValue, options, meta) => {
5017
5065
  if (meta?.bind !== "key") {
5018
5066
  propContext.setValue(nextValue, options, meta);
@@ -5084,7 +5132,7 @@ function getUsedKeys(items2) {
5084
5132
 
5085
5133
  // src/controls/gap-control.tsx
5086
5134
  import * as React78 from "react";
5087
- import { useLayoutEffect as useLayoutEffect2, useRef as useRef14, useState as useState13 } from "react";
5135
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef15, useState as useState14 } from "react";
5088
5136
  import {
5089
5137
  layoutDirectionPropTypeUtil,
5090
5138
  sizePropTypeUtil as sizePropTypeUtil6
@@ -5094,7 +5142,7 @@ import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/ico
5094
5142
  import { Grid as Grid12, Stack as Stack11, Tooltip as Tooltip7 } from "@elementor/ui";
5095
5143
  import { __ as __29 } from "@wordpress/i18n";
5096
5144
  var GapControl = ({ label }) => {
5097
- const stackRef = useRef14(null);
5145
+ const stackRef = useRef15(null);
5098
5146
  const { disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil6);
5099
5147
  const {
5100
5148
  value: directionValue,
@@ -5113,7 +5161,7 @@ var GapControl = ({ label }) => {
5113
5161
  }
5114
5162
  return true;
5115
5163
  };
5116
- const [isLinked, setIsLinked] = useState13(() => inferIsLinked());
5164
+ const [isLinked, setIsLinked] = useState14(() => inferIsLinked());
5117
5165
  const isCurrentlyDirection = layoutDirectionPropTypeUtil.isValid(masterValue ?? masterPlaceholder);
5118
5166
  const activeBreakpoint = useActiveBreakpoint5();
5119
5167
  useLayoutEffect2(() => {
@@ -5209,7 +5257,7 @@ var Control4 = ({
5209
5257
 
5210
5258
  // src/controls/aspect-ratio-control.tsx
5211
5259
  import * as React79 from "react";
5212
- import { useEffect as useEffect15, useState as useState14 } from "react";
5260
+ import { useEffect as useEffect15, useState as useState15 } from "react";
5213
5261
  import { stringPropTypeUtil as stringPropTypeUtil13 } from "@elementor/editor-props";
5214
5262
  import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
5215
5263
  import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
@@ -5236,10 +5284,10 @@ var AspectRatioControl = createControl(({ label }) => {
5236
5284
  const aspectRatioValue = currentPropValue ?? externalPlaceholder;
5237
5285
  const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
5238
5286
  const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
5239
- const [isCustom, setIsCustom] = useState14(isCustomSelected);
5240
- const [customWidth, setCustomWidth] = useState14(initialWidth);
5241
- const [customHeight, setCustomHeight] = useState14(initialHeight);
5242
- const [selectedValue, setSelectedValue] = useState14(
5287
+ const [isCustom, setIsCustom] = useState15(isCustomSelected);
5288
+ const [customWidth, setCustomWidth] = useState15(initialWidth);
5289
+ const [customHeight, setCustomHeight] = useState15(initialHeight);
5290
+ const [selectedValue, setSelectedValue] = useState15(
5243
5291
  isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
5244
5292
  );
5245
5293
  useEffect15(() => {
@@ -5329,7 +5377,7 @@ var AspectRatioControl = createControl(({ label }) => {
5329
5377
 
5330
5378
  // src/controls/svg-media-control.tsx
5331
5379
  import * as React88 from "react";
5332
- import { useEffect as useEffect16, useRef as useRef16, useState as useState18 } from "react";
5380
+ import { useEffect as useEffect16, useRef as useRef17, useState as useState19 } from "react";
5333
5381
  import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
5334
5382
  import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
5335
5383
  import { Box as Box20, Card as Card2, CardOverlay as CardOverlay2, Popover as Popover6, Stack as Stack17, styled as styled11, usePopupState as usePopupState10 } from "@elementor/ui";
@@ -5338,7 +5386,7 @@ import { __ as __38 } from "@wordpress/i18n";
5338
5386
 
5339
5387
  // src/components/enable-unfiltered-modal.tsx
5340
5388
  import * as React80 from "react";
5341
- import { useState as useState15 } from "react";
5389
+ import { useState as useState16 } from "react";
5342
5390
  import {
5343
5391
  Button as Button4,
5344
5392
  CircularProgress as CircularProgress2,
@@ -5364,7 +5412,7 @@ var ADMIN_FAILED_CONTENT_TEXT_PT2 = __31(
5364
5412
  var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
5365
5413
  var EnableUnfilteredModal = (props) => {
5366
5414
  const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
5367
- const [isError, setIsError] = useState15(false);
5415
+ const [isError, setIsError] = useState16(false);
5368
5416
  const onClose = (enabled) => {
5369
5417
  props.onClose(enabled);
5370
5418
  setTimeout(() => setIsError(false), WAIT_FOR_CLOSE_TIMEOUT_MS);
@@ -5413,7 +5461,7 @@ function measureIconLibraryAnchor(container, buttonGroup) {
5413
5461
 
5414
5462
  // src/controls/icon-library/icon-library-popover.tsx
5415
5463
  import * as React85 from "react";
5416
- import { useMemo as useMemo12, useState as useState17 } from "react";
5464
+ import { useMemo as useMemo12, useState as useState18 } from "react";
5417
5465
  import {
5418
5466
  PopoverBody as PopoverBody2,
5419
5467
  PopoverHeader as PopoverHeader4,
@@ -5829,7 +5877,7 @@ var renderFilterMenuItemContent = (label, Icon, selected) => /* @__PURE__ */ Rea
5829
5877
 
5830
5878
  // src/controls/icon-library/icon-library-grid.tsx
5831
5879
  import * as React83 from "react";
5832
- import { useLayoutEffect as useLayoutEffect3, useRef as useRef15, useState as useState16 } from "react";
5880
+ import { useLayoutEffect as useLayoutEffect3, useRef as useRef16, useState as useState17 } from "react";
5833
5881
  import { Box as Box16, Tooltip as Tooltip9, useTheme as useTheme3 } from "@elementor/ui";
5834
5882
  import { useVirtualizer } from "@tanstack/react-virtual";
5835
5883
  import { __ as __33 } from "@wordpress/i18n";
@@ -5867,12 +5915,12 @@ var IconLibraryGrid = ({
5867
5915
  noResultsComponent
5868
5916
  }) => {
5869
5917
  const theme = useTheme3();
5870
- const containerRef = useRef15(null);
5871
- const cellRefs = useRef15(/* @__PURE__ */ new Map());
5872
- const shouldRestoreFocusRef = useRef15(false);
5918
+ const containerRef = useRef16(null);
5919
+ const cellRefs = useRef16(/* @__PURE__ */ new Map());
5920
+ const shouldRestoreFocusRef = useRef16(false);
5873
5921
  const selectedIndex = items2.findIndex((item) => item.id === selectedValue);
5874
- const [focusedIndex, setFocusedIndex] = useState16(selectedIndex >= 0 ? selectedIndex : 0);
5875
- const [{ columnCount, cellSize }, setGridMetrics] = useState16(() => getGridMetrics(0, 0, 0));
5922
+ const [focusedIndex, setFocusedIndex] = useState17(selectedIndex >= 0 ? selectedIndex : 0);
5923
+ const [{ columnCount, cellSize }, setGridMetrics] = useState17(() => getGridMetrics(0, 0, 0));
5876
5924
  const rowCount = Math.ceil(items2.length / columnCount);
5877
5925
  const virtualizer = useVirtualizer({
5878
5926
  count: rowCount,
@@ -6248,7 +6296,7 @@ var IconLibraryPopover = ({
6248
6296
  handleChange: handleSearchChange,
6249
6297
  setImmediateValue: setSearchValue
6250
6298
  } = useDebounceState({ delay: ICON_LIBRARY_SEARCH_DEBOUNCE_DELAY });
6251
- const [activeLibraries, setActiveLibraries] = useState17([]);
6299
+ const [activeLibraries, setActiveLibraries] = useState18([]);
6252
6300
  const [storedView, setStoredView] = useSessionStorage2(
6253
6301
  ICON_LIBRARY_VIEW_STORAGE_KEY,
6254
6302
  ICON_LIBRARY_VIEW_STORAGE_PREFIX
@@ -6605,11 +6653,11 @@ var SvgMediaControl = createControl(({ showIconLibrary = false }) => {
6605
6653
  const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
6606
6654
  const src = attachment?.url ?? url?.value ?? null;
6607
6655
  const { data: allowSvgUpload } = useUnfilteredFilesUpload();
6608
- const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState18(false);
6656
+ const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState19(false);
6609
6657
  const iconLibraryPopoverState = usePopupState10({ variant: "popover" });
6610
- const controlContainerRef = useRef16(null);
6611
- const buttonGroupRef = useRef16(null);
6612
- const [iconLibraryAnchor, setIconLibraryAnchor] = useState18(null);
6658
+ const controlContainerRef = useRef17(null);
6659
+ const buttonGroupRef = useRef17(null);
6660
+ const [iconLibraryAnchor, setIconLibraryAnchor] = useState19(null);
6613
6661
  const { isAdmin } = useCurrentUserCapabilities();
6614
6662
  const selectedIconClass = showIconLibrary && typeof iconValue?.value?.value === "string" ? iconValue.value.value : null;
6615
6663
  const selectedIconLibrary = showIconLibrary && typeof iconValue?.library?.value === "string" ? iconValue.library.value : null;
@@ -6975,7 +7023,7 @@ var BackgroundImageOverlayAttachment = () => {
6975
7023
 
6976
7024
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
6977
7025
  import * as React92 from "react";
6978
- import { useRef as useRef17 } from "react";
7026
+ import { useRef as useRef18 } from "react";
6979
7027
  import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil16 } from "@elementor/editor-props";
6980
7028
  import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
6981
7029
  import { LetterXIcon, LetterYIcon } from "@elementor/icons";
@@ -6997,7 +7045,7 @@ var BackgroundImageOverlayPosition = () => {
6997
7045
  const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
6998
7046
  const stringPropContext = useBoundProp(stringPropTypeUtil16);
6999
7047
  const isCustom = !!backgroundImageOffsetContext.value;
7000
- const rowRef = useRef17(null);
7048
+ const rowRef = useRef18(null);
7001
7049
  const handlePositionChange = (event) => {
7002
7050
  const value = event.target.value || null;
7003
7051
  if (value === "custom") {
@@ -7070,7 +7118,7 @@ var BackgroundImageOverlayRepeat = () => {
7070
7118
 
7071
7119
  // src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
7072
7120
  import * as React94 from "react";
7073
- import { useRef as useRef18 } from "react";
7121
+ import { useRef as useRef19 } from "react";
7074
7122
  import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
7075
7123
  import {
7076
7124
  ArrowBarBothIcon,
@@ -7112,7 +7160,7 @@ var BackgroundImageOverlaySize = () => {
7112
7160
  const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
7113
7161
  const stringPropContext = useBoundProp(stringPropTypeUtil17);
7114
7162
  const isCustom = !!backgroundImageScaleContext.value;
7115
- const rowRef = useRef18(null);
7163
+ const rowRef = useRef19(null);
7116
7164
  const handleSizeChange = (size) => {
7117
7165
  if (size === "custom") {
7118
7166
  backgroundImageScaleContext.setValue({ width: null, height: null });
@@ -7147,7 +7195,7 @@ var BackgroundImageOverlaySize = () => {
7147
7195
  };
7148
7196
 
7149
7197
  // src/controls/background-control/background-overlay/use-background-tabs-history.ts
7150
- import { useRef as useRef19 } from "react";
7198
+ import { useRef as useRef20 } from "react";
7151
7199
  import {
7152
7200
  backgroundColorOverlayPropTypeUtil,
7153
7201
  backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
@@ -7172,7 +7220,7 @@ var useBackgroundTabsHistory = ({
7172
7220
  return "image";
7173
7221
  };
7174
7222
  const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
7175
- const valuesHistory = useRef19({
7223
+ const valuesHistory = useRef20({
7176
7224
  image: initialBackgroundImageOverlay,
7177
7225
  color: initialBackgroundColorOverlay2,
7178
7226
  gradient: initialBackgroundGradientOverlay2
@@ -7576,7 +7624,7 @@ var getAllProperties = (pattern) => {
7576
7624
 
7577
7625
  // src/controls/key-value-control.tsx
7578
7626
  import * as React98 from "react";
7579
- import { useMemo as useMemo14, useState as useState19 } from "react";
7627
+ import { useMemo as useMemo14, useState as useState20 } from "react";
7580
7628
  import {
7581
7629
  isTransformable,
7582
7630
  keyValuePropTypeUtil,
@@ -7607,9 +7655,9 @@ var getInitialFieldValue = (fieldValue) => {
7607
7655
  };
7608
7656
  var KeyValueControl = createControl((props = {}) => {
7609
7657
  const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
7610
- const [keyError, setKeyError] = useState19("");
7611
- const [valueError, setValueError] = useState19("");
7612
- const [sessionState, setSessionState] = useState19({
7658
+ const [keyError, setKeyError] = useState20("");
7659
+ const [valueError, setValueError] = useState20("");
7660
+ const [sessionState, setSessionState] = useState20({
7613
7661
  key: getInitialFieldValue(value?.key),
7614
7662
  value: getInitialFieldValue(value?.value)
7615
7663
  });
@@ -7751,7 +7799,7 @@ var PositionControl = () => {
7751
7799
 
7752
7800
  // src/controls/transform-control/transform-repeater-control.tsx
7753
7801
  import * as React112 from "react";
7754
- import { useRef as useRef27 } from "react";
7802
+ import { useRef as useRef28 } from "react";
7755
7803
  import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
7756
7804
  import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
7757
7805
  import { bindTrigger as bindTrigger5, Box as Box26, IconButton as IconButton8, Tooltip as Tooltip11, Typography as Typography11, usePopupState as usePopupState11 } from "@elementor/ui";
@@ -7815,7 +7863,7 @@ import { __ as __52 } from "@wordpress/i18n";
7815
7863
 
7816
7864
  // src/controls/transform-control/functions/move.tsx
7817
7865
  import * as React101 from "react";
7818
- import { useRef as useRef20 } from "react";
7866
+ import { useRef as useRef21 } from "react";
7819
7867
  import { moveTransformPropTypeUtil } from "@elementor/editor-props";
7820
7868
  import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
7821
7869
  import { Grid as Grid22 } from "@elementor/ui";
@@ -7862,7 +7910,7 @@ var moveAxisControls = [
7862
7910
  ];
7863
7911
  var Move = () => {
7864
7912
  const context = useBoundProp(moveTransformPropTypeUtil);
7865
- const rowRefs = [useRef20(null), useRef20(null), useRef20(null)];
7913
+ const rowRefs = [useRef21(null), useRef21(null), useRef21(null)];
7866
7914
  return /* @__PURE__ */ React101.createElement(Grid22, { container: true, spacing: 1.5 }, /* @__PURE__ */ React101.createElement(PropProvider, { ...context }, /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React101.createElement(
7867
7915
  AxisRow,
7868
7916
  {
@@ -7877,7 +7925,7 @@ var Move = () => {
7877
7925
 
7878
7926
  // src/controls/transform-control/functions/rotate.tsx
7879
7927
  import * as React102 from "react";
7880
- import { useRef as useRef21 } from "react";
7928
+ import { useRef as useRef22 } from "react";
7881
7929
  import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
7882
7930
  import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
7883
7931
  import { Grid as Grid23 } from "@elementor/ui";
@@ -7902,7 +7950,7 @@ var rotateAxisControls = [
7902
7950
  var rotateUnits = ["deg", "rad", "grad", "turn"];
7903
7951
  var Rotate = () => {
7904
7952
  const context = useBoundProp(rotateTransformPropTypeUtil2);
7905
- const rowRefs = [useRef21(null), useRef21(null), useRef21(null)];
7953
+ const rowRefs = [useRef22(null), useRef22(null), useRef22(null)];
7906
7954
  return /* @__PURE__ */ React102.createElement(Grid23, { container: true, spacing: 1.5 }, /* @__PURE__ */ React102.createElement(PropProvider, { ...context }, /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React102.createElement(
7907
7955
  AxisRow,
7908
7956
  {
@@ -7916,7 +7964,7 @@ var Rotate = () => {
7916
7964
 
7917
7965
  // src/controls/transform-control/functions/scale.tsx
7918
7966
  import * as React104 from "react";
7919
- import { useRef as useRef22 } from "react";
7967
+ import { useRef as useRef23 } from "react";
7920
7968
  import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
7921
7969
  import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
7922
7970
  import { Grid as Grid25 } from "@elementor/ui";
@@ -7949,13 +7997,13 @@ var scaleAxisControls = [
7949
7997
  ];
7950
7998
  var Scale = () => {
7951
7999
  const context = useBoundProp(scaleTransformPropTypeUtil2);
7952
- const rowRefs = [useRef22(null), useRef22(null), useRef22(null)];
8000
+ const rowRefs = [useRef23(null), useRef23(null), useRef23(null)];
7953
8001
  return /* @__PURE__ */ React104.createElement(Grid25, { container: true, spacing: 1.5 }, /* @__PURE__ */ React104.createElement(PropProvider, { ...context }, /* @__PURE__ */ React104.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React104.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
7954
8002
  };
7955
8003
 
7956
8004
  // src/controls/transform-control/functions/skew.tsx
7957
8005
  import * as React105 from "react";
7958
- import { useRef as useRef23 } from "react";
8006
+ import { useRef as useRef24 } from "react";
7959
8007
  import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
7960
8008
  import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
7961
8009
  import { Grid as Grid26 } from "@elementor/ui";
@@ -7975,7 +8023,7 @@ var skewAxisControls = [
7975
8023
  var skewUnits = ["deg", "rad", "grad", "turn"];
7976
8024
  var Skew = () => {
7977
8025
  const context = useBoundProp(skewTransformPropTypeUtil2);
7978
- const rowRefs = [useRef23(null), useRef23(null), useRef23(null)];
8026
+ const rowRefs = [useRef24(null), useRef24(null), useRef24(null)];
7979
8027
  return /* @__PURE__ */ React105.createElement(Grid26, { container: true, spacing: 1.5 }, /* @__PURE__ */ React105.createElement(PropProvider, { ...context }, /* @__PURE__ */ React105.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React105.createElement(
7980
8028
  AxisRow,
7981
8029
  {
@@ -7988,7 +8036,7 @@ var Skew = () => {
7988
8036
  };
7989
8037
 
7990
8038
  // src/controls/transform-control/use-transform-tabs-history.tsx
7991
- import { useRef as useRef24 } from "react";
8039
+ import { useRef as useRef25 } from "react";
7992
8040
  import {
7993
8041
  moveTransformPropTypeUtil as moveTransformPropTypeUtil2,
7994
8042
  rotateTransformPropTypeUtil as rotateTransformPropTypeUtil3,
@@ -8020,7 +8068,7 @@ var useTransformTabsHistory = ({
8020
8068
  }
8021
8069
  };
8022
8070
  const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2(getCurrentTransformType());
8023
- const valuesHistory = useRef24({
8071
+ const valuesHistory = useRef25({
8024
8072
  move: initialMove,
8025
8073
  scale: initialScale,
8026
8074
  rotate: initialRotate,
@@ -8164,7 +8212,7 @@ import { __ as __56 } from "@wordpress/i18n";
8164
8212
 
8165
8213
  // src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
8166
8214
  import * as React109 from "react";
8167
- import { useRef as useRef25 } from "react";
8215
+ import { useRef as useRef26 } from "react";
8168
8216
  import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
8169
8217
  import { Grid as Grid27, Stack as Stack19 } from "@elementor/ui";
8170
8218
  import { __ as __54 } from "@wordpress/i18n";
@@ -8196,13 +8244,13 @@ var PerspectiveOriginControlProvider = () => {
8196
8244
  return /* @__PURE__ */ React109.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React109.createElement(ControlFields, { control }))));
8197
8245
  };
8198
8246
  var ControlFields = ({ control }) => {
8199
- const rowRef = useRef25(null);
8247
+ const rowRef = useRef26(null);
8200
8248
  return /* @__PURE__ */ React109.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React109.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React109.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React109.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React109.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
8201
8249
  };
8202
8250
 
8203
8251
  // src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
8204
8252
  import * as React110 from "react";
8205
- import { useRef as useRef26 } from "react";
8253
+ import { useRef as useRef27 } from "react";
8206
8254
  import { transformOriginPropTypeUtil } from "@elementor/editor-props";
8207
8255
  import { Grid as Grid28, Stack as Stack20 } from "@elementor/ui";
8208
8256
  import { __ as __55 } from "@wordpress/i18n";
@@ -8230,7 +8278,7 @@ var TransformOriginControl = () => {
8230
8278
  };
8231
8279
  var ControlFields2 = ({ control }) => {
8232
8280
  const context = useBoundProp(transformOriginPropTypeUtil);
8233
- const rowRef = useRef26(null);
8281
+ const rowRef = useRef27(null);
8234
8282
  return /* @__PURE__ */ React110.createElement(PropProvider, { ...context }, /* @__PURE__ */ React110.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React110.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React110.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React110.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React110.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React110.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef })))));
8235
8283
  };
8236
8284
 
@@ -8278,7 +8326,7 @@ var SIZE11 = "tiny";
8278
8326
  var TransformRepeaterControl = createControl(
8279
8327
  ({ showChildrenPerspective }) => {
8280
8328
  const context = useBoundProp(transformPropTypeUtil);
8281
- const headerRef = useRef27(null);
8329
+ const headerRef = useRef28(null);
8282
8330
  const popupState = usePopupState11({ variant: "popover" });
8283
8331
  return /* @__PURE__ */ React112.createElement(PropProvider, { ...context }, /* @__PURE__ */ React112.createElement(
8284
8332
  TransformSettingsControl,
@@ -8358,7 +8406,7 @@ var TransformBasePopoverTrigger = ({
8358
8406
 
8359
8407
  // src/controls/transition-control/transition-repeater-control.tsx
8360
8408
  import * as React115 from "react";
8361
- import { useEffect as useEffect17, useMemo as useMemo17, useState as useState20 } from "react";
8409
+ import { useEffect as useEffect17, useMemo as useMemo17, useState as useState21 } from "react";
8362
8410
  import {
8363
8411
  createArrayPropUtils as createArrayPropUtils3,
8364
8412
  selectionSizePropTypeUtil as selectionSizePropTypeUtil2
@@ -8370,13 +8418,13 @@ import { __ as __60 } from "@wordpress/i18n";
8370
8418
 
8371
8419
  // src/controls/selection-size-control.tsx
8372
8420
  import * as React113 from "react";
8373
- import { useMemo as useMemo15, useRef as useRef28 } from "react";
8421
+ import { useMemo as useMemo15, useRef as useRef29 } from "react";
8374
8422
  import { selectionSizePropTypeUtil } from "@elementor/editor-props";
8375
8423
  import { Grid as Grid29 } from "@elementor/ui";
8376
8424
  var SelectionSizeControl = createControl(
8377
8425
  ({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
8378
8426
  const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
8379
- const rowRef = useRef28(null);
8427
+ const rowRef = useRef29(null);
8380
8428
  const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
8381
8429
  const currentSizeConfig = useMemo15(() => {
8382
8430
  switch (value.selection.$$type) {
@@ -8591,7 +8639,7 @@ function subscribeToTransitionEvent() {
8591
8639
 
8592
8640
  // src/controls/transition-control/transition-selector.tsx
8593
8641
  import * as React114 from "react";
8594
- import { useMemo as useMemo16, useRef as useRef29 } from "react";
8642
+ import { useMemo as useMemo16, useRef as useRef30 } from "react";
8595
8643
  import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
8596
8644
  import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
8597
8645
  import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
@@ -8677,7 +8725,7 @@ var TransitionSelector = ({
8677
8725
  const {
8678
8726
  key: { value: transitionLabel }
8679
8727
  } = value;
8680
- const defaultRef = useRef29(null);
8728
+ const defaultRef = useRef30(null);
8681
8729
  const popoverState = usePopupState12({ variant: "popover" });
8682
8730
  const disabledCategories = useMemo16(() => {
8683
8731
  return new Set(
@@ -8905,7 +8953,7 @@ var TransitionRepeaterControl = createControl(
8905
8953
  currentStyleState
8906
8954
  }) => {
8907
8955
  const currentStyleIsNormal = currentStyleState === null;
8908
- const [recentlyUsedList, setRecentlyUsedList] = useState20([]);
8956
+ const [recentlyUsedList, setRecentlyUsedList] = useState21([]);
8909
8957
  const proInstalled = hasProInstalled2();
8910
8958
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
8911
8959
  const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo17(
@@ -9221,13 +9269,13 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
9221
9269
 
9222
9270
  // src/controls/inline-editing-control.tsx
9223
9271
  import * as React124 from "react";
9224
- import { useCallback as useCallback4, useState as useState22 } from "react";
9272
+ import { useCallback as useCallback4, useState as useState23 } from "react";
9225
9273
  import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
9226
9274
  import { Box as Box32 } from "@elementor/ui";
9227
9275
 
9228
9276
  // src/components/inline-editor.tsx
9229
9277
  import * as React121 from "react";
9230
- import { useEffect as useEffect18, useRef as useRef30 } from "react";
9278
+ import { useEffect as useEffect18, useRef as useRef31 } from "react";
9231
9279
  import { Box as Box30 } from "@elementor/ui";
9232
9280
  import Bold from "@tiptap/extension-bold";
9233
9281
  import Document from "@tiptap/extension-document";
@@ -9290,8 +9338,8 @@ var InlineEditor = React121.forwardRef((props, ref) => {
9290
9338
  onSelectionEnd,
9291
9339
  mountElement = null
9292
9340
  } = props;
9293
- const containerRef = useRef30(null);
9294
- const onBlurRef = useRef30(onBlur);
9341
+ const containerRef = useRef31(null);
9342
+ const onBlurRef = useRef31(onBlur);
9295
9343
  onBlurRef.current = onBlur;
9296
9344
  const documentContentSettings = !!expectedTag ? "block+" : "inline*";
9297
9345
  const onUpdate = ({ editor: updatedEditor }) => {
@@ -9389,7 +9437,7 @@ var InlineEditor = React121.forwardRef((props, ref) => {
9389
9437
  return /* @__PURE__ */ React121.createElement(Box30, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React121.createElement(EditorContent, { ref, editor }));
9390
9438
  });
9391
9439
  var useOnUpdate = (callback, dependencies) => {
9392
- const hasMounted = useRef30(false);
9440
+ const hasMounted = useRef31(false);
9393
9441
  useEffect18(() => {
9394
9442
  if (hasMounted.current) {
9395
9443
  callback();
@@ -9401,7 +9449,7 @@ var useOnUpdate = (callback, dependencies) => {
9401
9449
 
9402
9450
  // src/components/inline-editor-toolbar.tsx
9403
9451
  import * as React123 from "react";
9404
- import { useEffect as useEffect20, useMemo as useMemo18, useRef as useRef32, useState as useState21 } from "react";
9452
+ import { useEffect as useEffect20, useMemo as useMemo18, useRef as useRef33, useState as useState22 } from "react";
9405
9453
  import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
9406
9454
  import {
9407
9455
  BoldIcon,
@@ -9427,7 +9475,7 @@ import { __ as __64 } from "@wordpress/i18n";
9427
9475
 
9428
9476
  // src/components/url-popover.tsx
9429
9477
  import * as React122 from "react";
9430
- import { useEffect as useEffect19, useRef as useRef31 } from "react";
9478
+ import { useEffect as useEffect19, useRef as useRef32 } from "react";
9431
9479
  import { ExternalLinkIcon } from "@elementor/icons";
9432
9480
  import { bindPopover as bindPopover8, Popover as Popover9, Stack as Stack23, TextField as TextField11, ToggleButton as ToggleButton4, Tooltip as Tooltip12 } from "@elementor/ui";
9433
9481
  import { __ as __63 } from "@wordpress/i18n";
@@ -9440,7 +9488,7 @@ var UrlPopover = ({
9440
9488
  openInNewTab,
9441
9489
  onToggleNewTab
9442
9490
  }) => {
9443
- const inputRef = useRef31(null);
9491
+ const inputRef = useRef32(null);
9444
9492
  useEffect19(() => {
9445
9493
  if (popupState.isOpen) {
9446
9494
  requestAnimationFrame(() => inputRef.current?.focus());
@@ -9496,9 +9544,9 @@ var InlineEditorToolbar = ({
9496
9544
  sx = {},
9497
9545
  inControlPanel = false
9498
9546
  }) => {
9499
- const [urlValue, setUrlValue] = useState21("");
9500
- const [openInNewTab, setOpenInNewTab] = useState21(false);
9501
- const toolbarRef = useRef32(null);
9547
+ const [urlValue, setUrlValue] = useState22("");
9548
+ const [openInNewTab, setOpenInNewTab] = useState22(false);
9549
+ const toolbarRef = useRef33(null);
9502
9550
  const linkPopupState = usePopupState13({ variant: "popover" });
9503
9551
  const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
9504
9552
  const editorState = useEditorState({
@@ -9723,7 +9771,7 @@ var InlineEditingControl = createControl(({ sx, attributes, props, context: { el
9723
9771
  const { setValue, placeholder, value } = useBoundProp(escapedHtmlPropTypeUtil2);
9724
9772
  const { value: rawValue } = usePropKeyContext();
9725
9773
  const content = value ?? extractInlineHtmlContent(rawValue);
9726
- const [editor, setEditor] = useState22(null);
9774
+ const [editor, setEditor] = useState23(null);
9727
9775
  const handleChange = useCallback4(
9728
9776
  (newValue) => {
9729
9777
  const html = newValue ?? "";
@@ -9906,7 +9954,7 @@ function useFormFieldSuggestions(options) {
9906
9954
 
9907
9955
  // src/controls/email-form-action-control/email-chips-field.tsx
9908
9956
  import * as React125 from "react";
9909
- import { useMemo as useMemo19, useState as useState23 } from "react";
9957
+ import { useMemo as useMemo19, useState as useState24 } from "react";
9910
9958
  import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil23 } from "@elementor/editor-props";
9911
9959
  import { Autocomplete as Autocomplete4, Grid as Grid32, TextField as TextField12 } from "@elementor/ui";
9912
9960
 
@@ -9944,7 +9992,7 @@ function resolveMention(raw, suggestions) {
9944
9992
  }
9945
9993
  var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
9946
9994
  const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
9947
- const [inputValue, setInputValue] = useState23("");
9995
+ const [inputValue, setInputValue] = useState24("");
9948
9996
  const items2 = value || [];
9949
9997
  const selectedValues = items2.map((item) => stringPropTypeUtil23.extract(item)).filter((val) => val !== null);
9950
9998
  const suggestionOptions = useMemo19(
@@ -10127,7 +10175,7 @@ var AttachmentTypeControl = createControl(({ label, options }) => {
10127
10175
 
10128
10176
  // src/controls/notice-control.tsx
10129
10177
  import * as React130 from "react";
10130
- import { useState as useState24 } from "react";
10178
+ import { useState as useState25 } from "react";
10131
10179
  import { ajax } from "@elementor/editor-v1-adapters";
10132
10180
  import { BulbIcon } from "@elementor/icons";
10133
10181
  import { Alert as Alert3, AlertAction as AlertAction2, AlertTitle as AlertTitle4, styled as styled13, Typography as Typography13 } from "@elementor/ui";
@@ -10145,7 +10193,7 @@ var markNoticeAsDismissedInSession = (dismissId) => {
10145
10193
  };
10146
10194
  var NoticeControl = createControl(
10147
10195
  ({ noticeType = "info", heading, content, dismissible, buttonText, buttonUrl }) => {
10148
- const [isDismissed, setIsDismissed] = useState24(false);
10196
+ const [isDismissed, setIsDismissed] = useState25(false);
10149
10197
  if (isDismissed || !content) {
10150
10198
  return null;
10151
10199
  }
@@ -10228,14 +10276,14 @@ var GridSpanControl = createControl(
10228
10276
 
10229
10277
  // src/components/promotions/display-conditions-control.tsx
10230
10278
  import * as React133 from "react";
10231
- import { useRef as useRef33 } from "react";
10279
+ import { useRef as useRef34 } from "react";
10232
10280
  import { SitemapIcon } from "@elementor/icons";
10233
10281
  import { IconButton as IconButton10, Stack as Stack26, Tooltip as Tooltip14 } from "@elementor/ui";
10234
10282
  import { __ as __68 } from "@wordpress/i18n";
10235
10283
 
10236
10284
  // src/components/promotions/promotion-trigger.tsx
10237
10285
  import * as React132 from "react";
10238
- import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState25 } from "react";
10286
+ import { forwardRef as forwardRef12, useCallback as useCallback5, useImperativeHandle, useState as useState26 } from "react";
10239
10287
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
10240
10288
  import { Box as Box34 } from "@elementor/ui";
10241
10289
  function getV4Promotion(key) {
@@ -10243,7 +10291,7 @@ function getV4Promotion(key) {
10243
10291
  }
10244
10292
  var PromotionTrigger = forwardRef12(
10245
10293
  ({ promotionKey, children, trackingData }, ref) => {
10246
- const [isOpen, setIsOpen] = useState25(false);
10294
+ const [isOpen, setIsOpen] = useState26(false);
10247
10295
  const promotion = getV4Promotion(promotionKey);
10248
10296
  const toggle = useCallback5(() => {
10249
10297
  setIsOpen((prev) => {
@@ -10287,7 +10335,7 @@ var PromotionTrigger = forwardRef12(
10287
10335
  var ARIA_LABEL = __68("Display Conditions", "elementor");
10288
10336
  var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
10289
10337
  var DisplayConditionsControl = createControl(() => {
10290
- const triggerRef = useRef33(null);
10338
+ const triggerRef = useRef34(null);
10291
10339
  return /* @__PURE__ */ React133.createElement(
10292
10340
  Stack26,
10293
10341
  {
@@ -10319,14 +10367,14 @@ var DisplayConditionsControl = createControl(() => {
10319
10367
 
10320
10368
  // src/components/promotions/attributes-control.tsx
10321
10369
  import * as React134 from "react";
10322
- import { useRef as useRef34 } from "react";
10370
+ import { useRef as useRef35 } from "react";
10323
10371
  import { PlusIcon as PlusIcon4 } from "@elementor/icons";
10324
10372
  import { Stack as Stack27, Tooltip as Tooltip15 } from "@elementor/ui";
10325
10373
  import { __ as __69 } from "@wordpress/i18n";
10326
10374
  var ARIA_LABEL2 = __69("Attributes", "elementor");
10327
10375
  var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
10328
10376
  var AttributesControl = createControl(() => {
10329
- const triggerRef = useRef34(null);
10377
+ const triggerRef = useRef35(null);
10330
10378
  return /* @__PURE__ */ React134.createElement(
10331
10379
  Stack27,
10332
10380
  {
@@ -10363,7 +10411,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
10363
10411
 
10364
10412
  // src/components/repeater/repeater.tsx
10365
10413
  import * as React136 from "react";
10366
- import { useEffect as useEffect21, useState as useState26 } from "react";
10414
+ import { useEffect as useEffect21, useState as useState27 } from "react";
10367
10415
  import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
10368
10416
  import {
10369
10417
  bindPopover as bindPopover9,
@@ -10393,7 +10441,7 @@ var Repeater3 = ({
10393
10441
  isSortable = true,
10394
10442
  adornment = ControlAdornments
10395
10443
  }) => {
10396
- const [openItem, setOpenItem] = useState26(initialOpenItem);
10444
+ const [openItem, setOpenItem] = useState27(initialOpenItem);
10397
10445
  const uniqueKeys = items2.map(
10398
10446
  (item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
10399
10447
  );
@@ -10569,7 +10617,7 @@ var RepeaterItem = ({
10569
10617
  ), /* @__PURE__ */ React136.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React136.createElement(Box35, null, children({ anchorEl: ref }))));
10570
10618
  };
10571
10619
  var usePopover = (openOnMount, onOpen, onPopoverClose) => {
10572
- const [ref, setRef] = useState26(null);
10620
+ const [ref, setRef] = useState27(null);
10573
10621
  const popoverState = usePopupState14({ variant: "popover" });
10574
10622
  const popoverProps = bindPopover9(popoverState);
10575
10623
  useEffect21(() => {