@elementor/editor-controls 4.0.0-manual → 4.0.0

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.
Files changed (37) hide show
  1. package/dist/index.d.mts +137 -64
  2. package/dist/index.d.ts +137 -64
  3. package/dist/index.js +890 -202
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +872 -188
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +15 -15
  8. package/src/components/promotions/attributes-control.tsx +2 -1
  9. package/src/components/promotions/display-conditions-control.tsx +2 -1
  10. package/src/components/promotions/promotion-trigger.tsx +14 -4
  11. package/src/controls/chips-control.tsx +1 -1
  12. package/src/controls/email-form-action-control.tsx +5 -5
  13. package/src/controls/number-control.tsx +8 -2
  14. package/src/controls/size-control/hooks/use-size-unit-keyboard.tsx +66 -0
  15. package/src/controls/size-control/hooks/use-size-value.ts +71 -0
  16. package/src/controls/size-control/size-component.tsx +94 -0
  17. package/src/controls/size-control/size-field.tsx +113 -0
  18. package/src/controls/size-control/sync/get-units.ts +17 -0
  19. package/src/controls/size-control/types.ts +17 -0
  20. package/src/controls/size-control/ui/size-input.tsx +68 -0
  21. package/src/controls/size-control/ui/text-field-popover.tsx +78 -0
  22. package/src/controls/size-control/ui/unit-selector.tsx +80 -0
  23. package/src/controls/size-control/unstable-size-control.tsx +86 -0
  24. package/src/controls/size-control/utils/has-size-value.ts +5 -0
  25. package/src/controls/size-control/utils/is-extended-unit.ts +8 -0
  26. package/src/controls/size-control/utils/resolve-bound-prop-value.ts +72 -0
  27. package/src/controls/size-control/utils/resolve-size-value.ts +85 -0
  28. package/src/controls/size-control/utils/settings/get-default-unit.ts +7 -0
  29. package/src/controls/size-control/utils/settings/get-prop-type-settings.ts +12 -0
  30. package/src/controls/size-control/utils/settings/get-size-units.ts +23 -0
  31. package/src/controls/size-control/utils/should-nullify-value.ts +15 -0
  32. package/src/controls/transition-control/data.ts +3 -3
  33. package/src/controls/transition-control/transition-repeater-control.tsx +8 -2
  34. package/src/controls/transition-control/transition-selector.tsx +7 -0
  35. package/src/hooks/use-font-families.ts +22 -25
  36. package/src/index.ts +4 -0
  37. package/src/utils/tracking.ts +61 -0
package/dist/index.mjs CHANGED
@@ -653,14 +653,14 @@ var TextFieldInnerSelection = forwardRef2(
653
653
  id
654
654
  }, ref) => {
655
655
  const { placeholder: boundPropPlaceholder } = useBoundProp(sizePropTypeUtil);
656
- const getCursorStyle2 = () => ({
656
+ const getCursorStyle3 = () => ({
657
657
  input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
658
658
  });
659
659
  return /* @__PURE__ */ React17.createElement(
660
660
  NumberInput,
661
661
  {
662
662
  ref,
663
- sx: getCursorStyle2(),
663
+ sx: getCursorStyle3(),
664
664
  size: "tiny",
665
665
  fullWidth: true,
666
666
  type,
@@ -2246,7 +2246,7 @@ var ChipsControl = createControl(({ options }) => {
2246
2246
  const selectedOptions = selectedValues.map((val) => options.find((opt) => opt.value === val)).filter((opt) => opt !== void 0);
2247
2247
  const handleChange = (_, newValue) => {
2248
2248
  const values = newValue.map((option) => stringPropTypeUtil4.create(option.value));
2249
- setValue(values.length > 0 ? values : null);
2249
+ setValue(values);
2250
2250
  };
2251
2251
  return /* @__PURE__ */ React50.createElement(ControlActions, null, /* @__PURE__ */ React50.createElement(
2252
2252
  Autocomplete,
@@ -2600,11 +2600,11 @@ var ToggleControl = createControl(
2600
2600
  // src/controls/number-control.tsx
2601
2601
  import * as React55 from "react";
2602
2602
  import { numberPropTypeUtil } from "@elementor/editor-props";
2603
- import { InputAdornment as InputAdornment3 } from "@elementor/ui";
2603
+ import { InputAdornment as InputAdornment3, Typography as Typography4 } from "@elementor/ui";
2604
2604
  var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
2605
2605
  var renderSuffix = (propType) => {
2606
2606
  if (propType.meta?.suffix) {
2607
- return /* @__PURE__ */ React55.createElement(InputAdornment3, { position: "end" }, propType.meta.suffix);
2607
+ return /* @__PURE__ */ React55.createElement(InputAdornment3, { position: "end" }, /* @__PURE__ */ React55.createElement(Typography4, { variant: "caption", color: "text.secondary" }, propType.meta.suffix));
2608
2608
  }
2609
2609
  return /* @__PURE__ */ React55.createElement(React55.Fragment, null);
2610
2610
  };
@@ -2953,7 +2953,7 @@ import { __ as __20 } from "@wordpress/i18n";
2953
2953
  import * as React58 from "react";
2954
2954
  import { useCallback as useCallback2, useEffect as useEffect8, useState as useState8 } from "react";
2955
2955
  import { PopoverBody, PopoverHeader as PopoverHeader2, PopoverMenuList, SearchField } from "@elementor/editor-ui";
2956
- import { Box as Box8, Divider as Divider2, Link, Stack as Stack9, Typography as Typography4 } from "@elementor/ui";
2956
+ import { Box as Box8, Divider as Divider2, Link, Stack as Stack9, Typography as Typography5 } from "@elementor/ui";
2957
2957
  import { debounce } from "@elementor/utils";
2958
2958
  import { __ as __19 } from "@wordpress/i18n";
2959
2959
 
@@ -3030,8 +3030,8 @@ var ItemSelector = ({
3030
3030
  overflow: "hidden"
3031
3031
  },
3032
3032
  /* @__PURE__ */ React58.createElement(IconComponent, { fontSize: "large" }),
3033
- /* @__PURE__ */ React58.createElement(Box8, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __19("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React58.createElement(
3034
- Typography4,
3033
+ /* @__PURE__ */ React58.createElement(Box8, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React58.createElement(Typography5, { align: "center", variant: "subtitle2", color: "text.secondary" }, __19("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React58.createElement(
3034
+ Typography5,
3035
3035
  {
3036
3036
  variant: "subtitle2",
3037
3037
  color: "text.secondary",
@@ -3049,7 +3049,7 @@ var ItemSelector = ({
3049
3049
  /* @__PURE__ */ React58.createElement("span", null, "\u201D.")
3050
3050
  )),
3051
3051
  /* @__PURE__ */ React58.createElement(
3052
- Typography4,
3052
+ Typography5,
3053
3053
  {
3054
3054
  align: "center",
3055
3055
  variant: "caption",
@@ -3655,7 +3655,7 @@ import * as React67 from "react";
3655
3655
  import { getElementLabel } from "@elementor/editor-elements";
3656
3656
  import { stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
3657
3657
  import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
3658
- import { Select as Select2, styled as styled6, Typography as Typography5 } from "@elementor/ui";
3658
+ import { Select as Select2, styled as styled6, Typography as Typography6 } from "@elementor/ui";
3659
3659
  import { __ as __24 } from "@wordpress/i18n";
3660
3660
 
3661
3661
  // src/components/conditional-control-infotip.tsx
@@ -3730,7 +3730,7 @@ var HtmlTagControl = createControl(({ options, onChange, fallbackLabels = {} })
3730
3730
  }
3731
3731
  const placeholderOption = findOptionByValue(placeholder);
3732
3732
  const displayText = placeholderOption?.label || placeholder;
3733
- return /* @__PURE__ */ React67.createElement(Typography5, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
3733
+ return /* @__PURE__ */ React67.createElement(Typography6, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
3734
3734
  };
3735
3735
  const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
3736
3736
  return /* @__PURE__ */ React67.createElement(ControlActions, null, /* @__PURE__ */ React67.createElement(ConditionalControlInfotip, { ...infoTipProps }, /* @__PURE__ */ React67.createElement(
@@ -5132,7 +5132,7 @@ import * as React95 from "react";
5132
5132
  import { useRef as useRef21 } from "react";
5133
5133
  import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
5134
5134
  import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
5135
- import { bindTrigger as bindTrigger4, Box as Box18, IconButton as IconButton7, Tooltip as Tooltip8, Typography as Typography6, usePopupState as usePopupState6 } from "@elementor/ui";
5135
+ import { bindTrigger as bindTrigger4, Box as Box18, IconButton as IconButton7, Tooltip as Tooltip8, Typography as Typography7, usePopupState as usePopupState6 } from "@elementor/ui";
5136
5136
  import { __ as __47 } from "@wordpress/i18n";
5137
5137
 
5138
5138
  // src/controls/transform-control/initial-values.ts
@@ -5674,7 +5674,7 @@ var ToolTip = /* @__PURE__ */ React95.createElement(
5674
5674
  sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
5675
5675
  },
5676
5676
  /* @__PURE__ */ React95.createElement(InfoCircleFilledIcon2, { sx: { color: "secondary.main" } }),
5677
- /* @__PURE__ */ React95.createElement(Typography6, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __47("You can use each kind of transform only once per element.", "elementor"))
5677
+ /* @__PURE__ */ React95.createElement(Typography7, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __47("You can use each kind of transform only once per element.", "elementor"))
5678
5678
  );
5679
5679
  var Repeater2 = ({
5680
5680
  headerRef,
@@ -5740,7 +5740,8 @@ import {
5740
5740
  selectionSizePropTypeUtil as selectionSizePropTypeUtil2
5741
5741
  } from "@elementor/editor-props";
5742
5742
  import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
5743
- import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography7 } from "@elementor/ui";
5743
+ import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography8 } from "@elementor/ui";
5744
+ import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
5744
5745
  import { __ as __50 } from "@wordpress/i18n";
5745
5746
 
5746
5747
  // src/controls/selection-size-control.tsx
@@ -5794,9 +5795,9 @@ var MIN_PRO_VERSION = "3.35";
5794
5795
  var getIsSiteRtl = () => {
5795
5796
  return !!window.elementorFrontend?.config?.is_rtl;
5796
5797
  };
5797
- var shouldExtendTransitionProperties = () => {
5798
+ var shouldShowAllTransitionProperties = () => {
5798
5799
  if (!hasProInstalled()) {
5799
- return false;
5800
+ return true;
5800
5801
  }
5801
5802
  const proVersion = window.elementorPro?.config?.version;
5802
5803
  if (!proVersion) {
@@ -5933,7 +5934,7 @@ var createTransitionPropertiesList = () => {
5933
5934
  ]
5934
5935
  }
5935
5936
  ];
5936
- return shouldExtendTransitionProperties() ? baseProperties : [baseProperties[0]];
5937
+ return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
5937
5938
  };
5938
5939
  var transitionProperties = createTransitionPropertiesList();
5939
5940
  var transitionsItemsList = transitionProperties.map((category) => ({
@@ -5972,6 +5973,47 @@ import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
5972
5973
  import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
5973
5974
  import { bindPopover as bindPopover6, bindTrigger as bindTrigger5, Box as Box19, Popover as Popover6, UnstableTag as UnstableTag3, usePopupState as usePopupState7 } from "@elementor/ui";
5974
5975
  import { __ as __49 } from "@wordpress/i18n";
5976
+
5977
+ // src/utils/tracking.ts
5978
+ import { getSelectedElements as getSelectedElements2 } from "@elementor/editor-elements";
5979
+ import { getMixpanel } from "@elementor/events";
5980
+ var getBaseEventProperties = (data, config) => ({
5981
+ app_type: config?.appTypes?.editor ?? "editor",
5982
+ window_name: config?.appTypes?.editor ?? "editor",
5983
+ interaction_type: config?.triggers?.click ?? "Click",
5984
+ target_name: data.target_name,
5985
+ target_location: data.target_location ?? "widget_panel",
5986
+ location_l1: data.location_l1 ?? getSelectedElements2()[0]?.type ?? "",
5987
+ ...data.location_l2 && { location_l2: data.location_l2 }
5988
+ });
5989
+ var dispatchPromotionEvent = (data, resolveOptions) => {
5990
+ const { dispatchEvent, config } = getMixpanel();
5991
+ const { eventName, interactionResult, interactionDescription } = resolveOptions(config);
5992
+ if (!eventName) {
5993
+ return;
5994
+ }
5995
+ dispatchEvent?.(eventName, {
5996
+ ...getBaseEventProperties(data, config),
5997
+ interaction_result: interactionResult,
5998
+ interaction_description: interactionDescription
5999
+ });
6000
+ };
6001
+ var trackViewPromotion = (data) => {
6002
+ dispatchPromotionEvent(data, (config) => ({
6003
+ eventName: config?.names?.promotions?.viewPromotion,
6004
+ interactionResult: config?.interactionResults?.promotionViewed ?? "promotion_viewed",
6005
+ interactionDescription: "user_viewed_promotion"
6006
+ }));
6007
+ };
6008
+ var trackUpgradePromotionClick = (data) => {
6009
+ dispatchPromotionEvent(data, (config) => ({
6010
+ eventName: config?.names?.promotions?.upgradePromotionClick,
6011
+ interactionResult: config?.interactionResults?.upgradeNow ?? "upgrade_now",
6012
+ interactionDescription: "user_clicked_upgrade_now"
6013
+ }));
6014
+ };
6015
+
6016
+ // src/controls/transition-control/transition-selector.tsx
5975
6017
  var toTransitionSelectorValue = (label) => {
5976
6018
  for (const category of transitionProperties) {
5977
6019
  const property = category.properties.find((prop) => prop.label === label);
@@ -6109,7 +6151,11 @@ var TransitionSelector = ({
6109
6151
  "Upgrade to customize transition properties and control effects.",
6110
6152
  "elementor"
6111
6153
  ),
6112
- upgradeUrl: PRO_UPGRADE_URL
6154
+ upgradeUrl: PRO_UPGRADE_URL,
6155
+ onCtaClick: () => trackUpgradePromotionClick({
6156
+ target_name: "transition_property",
6157
+ location_l2: "style"
6158
+ })
6113
6159
  }
6114
6160
  ) : null
6115
6161
  }
@@ -6228,7 +6274,7 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React98.createElement(
6228
6274
  icon: /* @__PURE__ */ React98.createElement(InfoCircleFilledIcon3, null)
6229
6275
  },
6230
6276
  /* @__PURE__ */ React98.createElement(AlertTitle3, null, __50("Transitions", "elementor")),
6231
- /* @__PURE__ */ React98.createElement(Box20, { component: "span" }, /* @__PURE__ */ React98.createElement(Typography7, { variant: "body2" }, __50("Switch to 'Normal' state to add a transition.", "elementor")))
6277
+ /* @__PURE__ */ React98.createElement(Box20, { component: "span" }, /* @__PURE__ */ React98.createElement(Typography8, { variant: "body2" }, __50("Switch to 'Normal' state to add a transition.", "elementor")))
6232
6278
  );
6233
6279
  var TransitionRepeaterControl = createControl(
6234
6280
  ({
@@ -6237,6 +6283,7 @@ var TransitionRepeaterControl = createControl(
6237
6283
  }) => {
6238
6284
  const currentStyleIsNormal = currentStyleState === null;
6239
6285
  const [recentlyUsedList, setRecentlyUsedList] = useState16([]);
6286
+ const proInstalled = hasProInstalled2();
6240
6287
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
6241
6288
  const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo13(
6242
6289
  () => getDisabledItemLabels(value),
@@ -6245,10 +6292,14 @@ var TransitionRepeaterControl = createControl(
6245
6292
  const allowedTransitionSet = useMemo13(() => {
6246
6293
  const set = /* @__PURE__ */ new Set();
6247
6294
  transitionProperties.forEach((category) => {
6248
- category.properties.forEach((prop) => set.add(prop.value));
6295
+ category.properties.forEach((prop) => {
6296
+ if (!prop.isDisabled || proInstalled) {
6297
+ set.add(prop.value);
6298
+ }
6299
+ });
6249
6300
  });
6250
6301
  return set;
6251
- }, []);
6302
+ }, [proInstalled]);
6252
6303
  useEffect11(() => {
6253
6304
  if (!value || value.length === 0) {
6254
6305
  return;
@@ -6634,7 +6685,7 @@ var SendToField = () => /* @__PURE__ */ React102.createElement(
6634
6685
  EmailField,
6635
6686
  {
6636
6687
  bind: "to",
6637
- label: __51("Send To", "elementor"),
6688
+ label: __51("Send to", "elementor"),
6638
6689
  placeholder: __51("Where should we send new submissions?", "elementor")
6639
6690
  }
6640
6691
  );
@@ -6642,7 +6693,7 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
6642
6693
  EmailField,
6643
6694
  {
6644
6695
  bind: "subject",
6645
- label: __51("Email Subject", "elementor"),
6696
+ label: __51("Email subject", "elementor"),
6646
6697
  placeholder: __51("New form submission", "elementor")
6647
6698
  }
6648
6699
  );
@@ -6660,7 +6711,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
6660
6711
  {
6661
6712
  bind: "from",
6662
6713
  label: __51("From email", "elementor"),
6663
- placeholder: __51("What email address should appear as the sender?", "elementor")
6714
+ placeholder: __51("What email should appear as the sender?", "elementor")
6664
6715
  }
6665
6716
  );
6666
6717
  var FromNameField = () => /* @__PURE__ */ React102.createElement(
@@ -6674,7 +6725,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
6674
6725
  var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: __51("Reply-to", "elementor") });
6675
6726
  var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: __51("Cc", "elementor") });
6676
6727
  var BccField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "bcc", label: __51("Bcc", "elementor") });
6677
- var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("Meta data", "elementor")), /* @__PURE__ */ React102.createElement(
6728
+ var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("Metadata", "elementor")), /* @__PURE__ */ React102.createElement(
6678
6729
  ChipsControl,
6679
6730
  {
6680
6731
  options: [
@@ -6698,31 +6749,663 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
6698
6749
  var AdvancedSettings = () => /* @__PURE__ */ React102.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React102.createElement(Box24, { sx: { pt: 2 } }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(FromNameField, null), /* @__PURE__ */ React102.createElement(ReplyToField, null), /* @__PURE__ */ React102.createElement(CcField, null), /* @__PURE__ */ React102.createElement(BccField, null), /* @__PURE__ */ React102.createElement(Divider5, null), /* @__PURE__ */ React102.createElement(MetaDataField, null), /* @__PURE__ */ React102.createElement(SendAsField, null))));
6699
6750
  var EmailFormActionControl = createControl(() => {
6700
6751
  const { value, setValue, ...propContext } = useBoundProp(emailPropTypeUtil);
6701
- return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlFormLabel, null, __51("Email settings", "elementor")), /* @__PURE__ */ React102.createElement(SendToField, null), /* @__PURE__ */ React102.createElement(SubjectField, null), /* @__PURE__ */ React102.createElement(MessageField, null), /* @__PURE__ */ React102.createElement(FromEmailField, null), /* @__PURE__ */ React102.createElement(AdvancedSettings, null)));
6752
+ return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("Email settings", "elementor")), /* @__PURE__ */ React102.createElement(SendToField, null), /* @__PURE__ */ React102.createElement(SubjectField, null), /* @__PURE__ */ React102.createElement(MessageField, null), /* @__PURE__ */ React102.createElement(FromEmailField, null), /* @__PURE__ */ React102.createElement(AdvancedSettings, null)));
6702
6753
  });
6703
6754
 
6704
- // src/components/promotions/display-conditions-control.tsx
6755
+ // src/controls/size-control/unstable-size-control.tsx
6756
+ import * as React108 from "react";
6757
+ import { sizePropTypeUtil as sizePropTypeUtil6 } from "@elementor/editor-props";
6758
+
6759
+ // src/controls/size-control/size-component.tsx
6760
+ import * as React107 from "react";
6761
+ import { useEffect as useEffect15 } from "react";
6762
+ import { useActiveBreakpoint as useActiveBreakpoint4 } from "@elementor/editor-responsive";
6763
+ import { Box as Box25, usePopupState as usePopupState9 } from "@elementor/ui";
6764
+
6765
+ // src/controls/size-control/size-field.tsx
6766
+ import * as React105 from "react";
6767
+ import { MathFunctionIcon as MathFunctionIcon3 } from "@elementor/icons";
6768
+ import { InputAdornment as InputAdornment5 } from "@elementor/ui";
6769
+
6770
+ // src/controls/size-control/sync/get-units.ts
6771
+ var getLengthUnits = () => {
6772
+ return window.elementor?.config?.size_units?.length ?? [];
6773
+ };
6774
+ var getAngleUnits = () => {
6775
+ return window.elementor?.config?.size_units?.angle ?? [];
6776
+ };
6777
+ var getTimeUnits = () => {
6778
+ return window.elementor?.config?.size_units?.time ?? [];
6779
+ };
6780
+ var getExtendedUnits = () => {
6781
+ return window.elementor?.config?.size_units?.extended_units ?? [];
6782
+ };
6783
+
6784
+ // src/controls/size-control/utils/is-extended-unit.ts
6785
+ var isExtendedUnit = (unit) => {
6786
+ const extendedUnits = getExtendedUnits();
6787
+ return extendedUnits.includes(unit);
6788
+ };
6789
+
6790
+ // src/controls/size-control/hooks/use-size-unit-keyboard.tsx
6791
+ var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
6792
+ var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
6793
+ const { appendKey, startsWith } = useTypingBuffer();
6794
+ const onUnitKeyDown = (event) => {
6795
+ if (units2.length === 0) {
6796
+ return;
6797
+ }
6798
+ const { key, altKey, ctrlKey, metaKey } = event;
6799
+ if (altKey || ctrlKey || metaKey) {
6800
+ return;
6801
+ }
6802
+ if (isExtendedUnit(unit) && isNumericValue(key)) {
6803
+ const [defaultUnit] = units2;
6804
+ if (defaultUnit) {
6805
+ onUnitChange(defaultUnit);
6806
+ }
6807
+ return;
6808
+ }
6809
+ if (!UNIT_KEY_PATTERN.test(key)) {
6810
+ return;
6811
+ }
6812
+ event.preventDefault();
6813
+ const updatedBuffer = appendKey(key.toLowerCase());
6814
+ const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
6815
+ if (matchedUnit) {
6816
+ onUnitChange(matchedUnit);
6817
+ }
6818
+ };
6819
+ return { onUnitKeyDown };
6820
+ };
6821
+ var isNumericValue = (value) => {
6822
+ if (typeof value === "number") {
6823
+ return !isNaN(value);
6824
+ }
6825
+ if (typeof value === "string") {
6826
+ return value.trim() !== "" && !isNaN(Number(value));
6827
+ }
6828
+ return false;
6829
+ };
6830
+
6831
+ // src/controls/size-control/hooks/use-size-value.ts
6832
+ import { useMemo as useMemo15 } from "react";
6833
+
6834
+ // src/controls/size-control/utils/resolve-size-value.ts
6835
+ var DEFAULT_SIZE2 = "";
6836
+ var EXTENDED_UNITS = {
6837
+ auto: "auto",
6838
+ custom: "custom"
6839
+ };
6840
+ var resolveSizeValue = (value, context) => {
6841
+ if (!value) {
6842
+ return value;
6843
+ }
6844
+ const { units: units2, defaultUnit } = context;
6845
+ const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
6846
+ if (unit === EXTENDED_UNITS.auto) {
6847
+ return { size: DEFAULT_SIZE2, unit };
6848
+ }
6849
+ if (unit === EXTENDED_UNITS.custom) {
6850
+ return { size: String(value.size ?? DEFAULT_SIZE2), unit };
6851
+ }
6852
+ return {
6853
+ size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
6854
+ unit
6855
+ };
6856
+ };
6857
+ var resolveSizeOnUnitChange = (size, unit) => {
6858
+ return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
6859
+ };
6860
+ var createDefaultSizeValue = (units2, defaultUnit) => {
6861
+ let [unit] = units2;
6862
+ if (defaultUnit !== void 0) {
6863
+ unit = resolveFallbackUnit(defaultUnit, units2);
6864
+ }
6865
+ return { size: DEFAULT_SIZE2, unit };
6866
+ };
6867
+ var resolveFallbackUnit = (unit, units2, defaultUnit) => {
6868
+ if (units2.includes(unit)) {
6869
+ return unit;
6870
+ }
6871
+ if (defaultUnit && units2.includes(defaultUnit)) {
6872
+ return defaultUnit;
6873
+ }
6874
+ return units2[0] ?? "";
6875
+ };
6876
+ var sanitizeSize = (size) => {
6877
+ if (typeof size === "number" && isNaN(size)) {
6878
+ return DEFAULT_SIZE2;
6879
+ }
6880
+ return size;
6881
+ };
6882
+
6883
+ // src/controls/size-control/hooks/use-size-value.ts
6884
+ var useSizeValue = ({
6885
+ value,
6886
+ setValue,
6887
+ units: units2,
6888
+ defaultUnit
6889
+ }) => {
6890
+ const resolvedValue = useMemo15(
6891
+ () => resolveSizeValue(value, { units: units2, defaultUnit }),
6892
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6893
+ [value?.size, value?.unit, defaultUnit]
6894
+ );
6895
+ const [sizeValue, setSizeValue] = useSyncExternalState({
6896
+ external: resolvedValue,
6897
+ setExternal: (newState, options, meta) => {
6898
+ if (newState !== null) {
6899
+ setValue(newState, options, meta);
6900
+ }
6901
+ },
6902
+ persistWhen: (next) => hasChanged(next, resolvedValue),
6903
+ fallback: () => createDefaultSizeValue(units2, defaultUnit)
6904
+ });
6905
+ const setSize = (newSize, isInputValid = true) => {
6906
+ if (isExtendedUnit(sizeValue.unit)) {
6907
+ return;
6908
+ }
6909
+ const trimmed = newSize.trim();
6910
+ const parsed = Number(trimmed);
6911
+ const newState = {
6912
+ ...sizeValue,
6913
+ size: trimmed && !isNaN(parsed) ? parsed : ""
6914
+ };
6915
+ setSizeValue(newState, void 0, { validation: () => isInputValid });
6916
+ };
6917
+ const setUnit = (unit) => {
6918
+ setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
6919
+ };
6920
+ return {
6921
+ size: sizeValue.size,
6922
+ unit: sizeValue.unit,
6923
+ setSize,
6924
+ setUnit
6925
+ };
6926
+ };
6927
+ var hasChanged = (next, current) => {
6928
+ return next?.size !== current?.size || next?.unit !== current?.unit;
6929
+ };
6930
+
6931
+ // src/controls/size-control/ui/size-input.tsx
6932
+ import * as React103 from "react";
6933
+ import { forwardRef as forwardRef11 } from "react";
6934
+ var SizeInput2 = forwardRef11(
6935
+ ({
6936
+ id,
6937
+ type,
6938
+ value,
6939
+ onBlur,
6940
+ onKeyUp,
6941
+ focused,
6942
+ disabled,
6943
+ onChange,
6944
+ onKeyDown,
6945
+ InputProps,
6946
+ inputProps,
6947
+ placeholder
6948
+ }, ref) => {
6949
+ return /* @__PURE__ */ React103.createElement(
6950
+ NumberInput,
6951
+ {
6952
+ id,
6953
+ ref,
6954
+ size: "tiny",
6955
+ fullWidth: true,
6956
+ type,
6957
+ value,
6958
+ placeholder,
6959
+ onKeyUp,
6960
+ focused,
6961
+ disabled,
6962
+ onKeyDown,
6963
+ onInput: onChange,
6964
+ onBlur,
6965
+ InputProps,
6966
+ inputProps,
6967
+ sx: getCursorStyle(InputProps?.readOnly ?? false)
6968
+ }
6969
+ );
6970
+ }
6971
+ );
6972
+ var getCursorStyle = (readOnly) => ({
6973
+ input: { cursor: readOnly ? "default !important" : void 0 }
6974
+ });
6975
+
6976
+ // src/controls/size-control/ui/unit-selector.tsx
6705
6977
  import * as React104 from "react";
6706
- import { useRef as useRef25 } from "react";
6978
+ import { useId as useId3 } from "react";
6979
+ import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
6980
+ import { bindMenu as bindMenu2, bindTrigger as bindTrigger6, Button as Button6, Menu as Menu3, styled as styled9, usePopupState as usePopupState8 } from "@elementor/ui";
6981
+ var menuItemContentStyles = {
6982
+ display: "flex",
6983
+ flexDirection: "column",
6984
+ justifyContent: "center"
6985
+ };
6986
+ var UnitSelector = ({
6987
+ value,
6988
+ isActive,
6989
+ onSelect,
6990
+ options,
6991
+ disabled,
6992
+ menuItemsAttributes = {},
6993
+ optionLabelOverrides = {}
6994
+ }) => {
6995
+ const popupState = usePopupState8({
6996
+ variant: "popover",
6997
+ popupId: useId3()
6998
+ });
6999
+ const handleMenuItemClick = (option) => {
7000
+ onSelect(option);
7001
+ popupState.close();
7002
+ };
7003
+ return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(StyledButton2, { isActive, disabled, size: "small", ...bindTrigger6(popupState) }, optionLabelOverrides[value] ?? value), /* @__PURE__ */ React104.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
7004
+ MenuListItem7,
7005
+ {
7006
+ key: option,
7007
+ onClick: () => handleMenuItemClick(option),
7008
+ ...menuItemsAttributes?.[option],
7009
+ primaryTypographyProps: {
7010
+ variant: "caption",
7011
+ sx: {
7012
+ ...menuItemContentStyles,
7013
+ lineHeight: "1"
7014
+ }
7015
+ },
7016
+ menuItemTextProps: {
7017
+ sx: menuItemContentStyles
7018
+ }
7019
+ },
7020
+ optionLabelOverrides[option] ?? option.toUpperCase()
7021
+ ))));
7022
+ };
7023
+ var StyledButton2 = styled9(Button6, {
7024
+ shouldForwardProp: (prop) => prop !== "isActive"
7025
+ })(({ isActive, theme }) => ({
7026
+ color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
7027
+ font: "inherit",
7028
+ minWidth: "initial",
7029
+ textTransform: "uppercase"
7030
+ }));
7031
+
7032
+ // src/controls/size-control/utils/has-size-value.ts
7033
+ var hasSizeValue = (size) => {
7034
+ return Boolean(size) || size === 0;
7035
+ };
7036
+
7037
+ // src/controls/size-control/size-field.tsx
7038
+ var UNIT_DISPLAY_LABELS_OVERRIDES = {
7039
+ custom: /* @__PURE__ */ React105.createElement(MathFunctionIcon3, { fontSize: "tiny" })
7040
+ };
7041
+ var SizeField = ({
7042
+ value,
7043
+ focused,
7044
+ disabled,
7045
+ InputProps,
7046
+ defaultUnit,
7047
+ placeholder,
7048
+ onUnitChange,
7049
+ startIcon,
7050
+ ariaLabel,
7051
+ onKeyDown,
7052
+ setValue,
7053
+ onBlur,
7054
+ units: units2,
7055
+ min,
7056
+ unitSelectorProps
7057
+ }) => {
7058
+ const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
7059
+ const handleUnitChange = (newUnit) => {
7060
+ setUnit(newUnit);
7061
+ onUnitChange?.(newUnit);
7062
+ };
7063
+ const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
7064
+ const handleKeyDown = (event) => {
7065
+ onUnitKeyDown(event);
7066
+ onKeyDown?.(event);
7067
+ };
7068
+ const handleChange = (event) => {
7069
+ const newSize = event.target.value;
7070
+ const isInputValid = event.target.validity.valid;
7071
+ setSize(newSize, isInputValid);
7072
+ };
7073
+ const inputType = isExtendedUnit(unit) ? "text" : "number";
7074
+ return /* @__PURE__ */ React105.createElement(
7075
+ SizeInput2,
7076
+ {
7077
+ disabled,
7078
+ focused,
7079
+ type: inputType,
7080
+ value: size,
7081
+ placeholder,
7082
+ onBlur,
7083
+ onKeyDown: handleKeyDown,
7084
+ onChange: handleChange,
7085
+ InputProps: {
7086
+ ...InputProps,
7087
+ autoComplete: "off",
7088
+ readOnly: isExtendedUnit(unit),
7089
+ startAdornment: startIcon && /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "start", disabled }, startIcon),
7090
+ endAdornment: /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React105.createElement(
7091
+ UnitSelector,
7092
+ {
7093
+ options: units2,
7094
+ value: unit,
7095
+ onSelect: handleUnitChange,
7096
+ isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
7097
+ ...unitSelectorProps,
7098
+ optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
7099
+ }
7100
+ ))
7101
+ },
7102
+ inputProps: { min, step: "any", "arial-label": ariaLabel }
7103
+ }
7104
+ );
7105
+ };
7106
+
7107
+ // src/controls/size-control/ui/text-field-popover.tsx
7108
+ import * as React106 from "react";
7109
+ import { useEffect as useEffect14, useRef as useRef25 } from "react";
7110
+ import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
7111
+ import { MathFunctionIcon as MathFunctionIcon4 } from "@elementor/icons";
7112
+ import { bindPopover as bindPopover7, Popover as Popover7, TextField as TextField9 } from "@elementor/ui";
7113
+ import { __ as __52 } from "@wordpress/i18n";
7114
+ var SIZE10 = "tiny";
7115
+ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
7116
+ const inputRef = useRef25(null);
7117
+ useEffect14(() => {
7118
+ if (popupState.isOpen) {
7119
+ requestAnimationFrame(() => {
7120
+ if (inputRef.current) {
7121
+ inputRef.current.focus();
7122
+ }
7123
+ });
7124
+ }
7125
+ }, [popupState.isOpen]);
7126
+ const handleKeyDown = (event) => {
7127
+ if (event.key.toLowerCase() === "enter") {
7128
+ handleClose();
7129
+ }
7130
+ };
7131
+ const handleClose = () => {
7132
+ onClose?.();
7133
+ popupState.close();
7134
+ };
7135
+ return /* @__PURE__ */ React106.createElement(
7136
+ Popover7,
7137
+ {
7138
+ disablePortal: true,
7139
+ slotProps: {
7140
+ paper: {
7141
+ sx: {
7142
+ borderRadius: 2,
7143
+ width: anchorRef.current?.offsetWidth + "px"
7144
+ }
7145
+ }
7146
+ },
7147
+ ...bindPopover7(popupState),
7148
+ anchorOrigin: { vertical: "bottom", horizontal: "center" },
7149
+ transformOrigin: { vertical: "top", horizontal: "center" },
7150
+ onClose: handleClose
7151
+ },
7152
+ /* @__PURE__ */ React106.createElement(
7153
+ PopoverHeader4,
7154
+ {
7155
+ title: __52("CSS function", "elementor"),
7156
+ onClose: handleClose,
7157
+ icon: /* @__PURE__ */ React106.createElement(MathFunctionIcon4, { fontSize: SIZE10 })
7158
+ }
7159
+ ),
7160
+ /* @__PURE__ */ React106.createElement(
7161
+ TextField9,
7162
+ {
7163
+ value,
7164
+ onChange,
7165
+ onKeyDown: handleKeyDown,
7166
+ size: "tiny",
7167
+ type: "text",
7168
+ fullWidth: true,
7169
+ inputProps: {
7170
+ ref: inputRef
7171
+ },
7172
+ sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
7173
+ }
7174
+ )
7175
+ );
7176
+ };
7177
+
7178
+ // src/controls/size-control/size-component.tsx
7179
+ var SizeComponent = ({
7180
+ anchorRef,
7181
+ isUnitActive,
7182
+ SizeFieldWrapper = React107.Fragment,
7183
+ ...sizeFieldProps
7184
+ }) => {
7185
+ const popupState = usePopupState9({ variant: "popover" });
7186
+ const activeBreakpoint = useActiveBreakpoint4();
7187
+ const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
7188
+ const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
7189
+ useEffect15(() => {
7190
+ if (popupState && popupState.isOpen) {
7191
+ popupState.close();
7192
+ }
7193
+ }, [activeBreakpoint]);
7194
+ const handleCustomSizeChange = (event) => {
7195
+ sizeFieldProps.setValue({
7196
+ size: event.target.value,
7197
+ unit: EXTENDED_UNITS.custom
7198
+ });
7199
+ };
7200
+ const handleSizeFieldClick = (event) => {
7201
+ if (event.target.closest("input") && isCustomUnit) {
7202
+ popupState.open(anchorRef?.current);
7203
+ }
7204
+ };
7205
+ const handleUnitChange = (unit) => {
7206
+ if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
7207
+ popupState.open(anchorRef.current);
7208
+ }
7209
+ };
7210
+ const popupAttributes = {
7211
+ "aria-controls": popupState.isOpen ? popupState.popupId : void 0,
7212
+ "aria-haspopup": true
7213
+ };
7214
+ return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(Box25, null, /* @__PURE__ */ React107.createElement(
7215
+ SizeField,
7216
+ {
7217
+ focused: popupState.isOpen ? true : void 0,
7218
+ onUnitChange: handleUnitChange,
7219
+ InputProps: {
7220
+ ...popupAttributes,
7221
+ onClick: handleSizeFieldClick
7222
+ },
7223
+ unitSelectorProps: {
7224
+ menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
7225
+ isActive: isUnitActive
7226
+ },
7227
+ ...sizeFieldProps
7228
+ }
7229
+ ))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
7230
+ TextFieldPopover2,
7231
+ {
7232
+ popupState,
7233
+ anchorRef,
7234
+ value: String(sizeFieldProps?.value?.size ?? ""),
7235
+ onChange: handleCustomSizeChange,
7236
+ onClose: () => {
7237
+ }
7238
+ }
7239
+ ));
7240
+ };
7241
+
7242
+ // src/controls/size-control/utils/resolve-bound-prop-value.ts
7243
+ import { sizePropTypeUtil as sizePropTypeUtil5 } from "@elementor/editor-props";
7244
+ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
7245
+ let sizeValue = null;
7246
+ if (validateSizeValue(value)) {
7247
+ sizeValue = value;
7248
+ } else if (validateSizeValue(boundPropPlaceholder)) {
7249
+ sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
7250
+ }
7251
+ return {
7252
+ sizeValue,
7253
+ isUnitHighlighted: shouldHighlightUnit(value),
7254
+ placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
7255
+ };
7256
+ };
7257
+ var validateSizeValue = (value) => {
7258
+ if (!value) {
7259
+ return false;
7260
+ }
7261
+ const sizePropValue = sizePropTypeUtil5.create(value);
7262
+ return sizePropTypeUtil5.isValid(sizePropValue);
7263
+ };
7264
+ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
7265
+ if (propPlaceholder) {
7266
+ return propPlaceholder;
7267
+ }
7268
+ const size = boundPropPlaceholder?.size;
7269
+ if (size === void 0) {
7270
+ return void 0;
7271
+ }
7272
+ if (typeof size === "number") {
7273
+ return size.toString();
7274
+ }
7275
+ return size;
7276
+ };
7277
+ var shouldHighlightUnit = (value) => {
7278
+ if (!value) {
7279
+ return false;
7280
+ }
7281
+ if (value.unit === EXTENDED_UNITS.auto) {
7282
+ return true;
7283
+ }
7284
+ return hasSizeValue(value.size);
7285
+ };
7286
+
7287
+ // src/controls/size-control/utils/settings/get-prop-type-settings.ts
7288
+ var getPropTypeSettings = (propType) => {
7289
+ return propType.settings;
7290
+ };
7291
+
7292
+ // src/controls/size-control/utils/settings/get-default-unit.ts
7293
+ var getDefaultUnit = (propType) => {
7294
+ return getPropTypeSettings(propType)?.default_unit;
7295
+ };
7296
+
7297
+ // src/controls/size-control/utils/settings/get-size-units.ts
7298
+ var getVariantUnits = (variant) => {
7299
+ const map = {
7300
+ length: getLengthUnits,
7301
+ angle: getAngleUnits,
7302
+ time: getTimeUnits
7303
+ };
7304
+ return map[variant]();
7305
+ };
7306
+ var getSettingsUnits = (propType) => {
7307
+ return getPropTypeSettings(propType)?.units;
7308
+ };
7309
+ var getSizeUnits = (propType, variant) => {
7310
+ return getSettingsUnits(propType) ?? getVariantUnits(variant);
7311
+ };
7312
+
7313
+ // src/controls/size-control/utils/should-nullify-value.ts
7314
+ var conditions = [
7315
+ (value) => value?.size === null || value?.size === void 0 || value?.size === "",
7316
+ (value) => value?.unit !== EXTENDED_UNITS.auto,
7317
+ (value) => value?.unit !== EXTENDED_UNITS.custom
7318
+ ];
7319
+ var shouldNullifyValue = (value) => {
7320
+ return conditions.every((condition) => condition(value));
7321
+ };
7322
+
7323
+ // src/controls/size-control/unstable-size-control.tsx
7324
+ var UnstableSizeControl = createControl(
7325
+ ({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
7326
+ const {
7327
+ value,
7328
+ setValue,
7329
+ propType,
7330
+ placeholder: boundPropPlaceholder,
7331
+ restoreValue
7332
+ } = useBoundProp(sizePropTypeUtil6);
7333
+ const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
7334
+ value,
7335
+ boundPropPlaceholder,
7336
+ propPlaceholder
7337
+ );
7338
+ const units2 = getSizeUnits(propType, variant);
7339
+ const defaultUnit = getDefaultUnit(propType);
7340
+ const handleBlur = () => {
7341
+ const isRequired = propType.settings.required;
7342
+ if (shouldNullifyValue(value) && !isRequired) {
7343
+ setValue(null);
7344
+ }
7345
+ if (isRequired) {
7346
+ restoreValue();
7347
+ }
7348
+ };
7349
+ const handleChange = (newValue, options, meta) => {
7350
+ setValue(newValue, options, {
7351
+ ...meta,
7352
+ validation: () => {
7353
+ if (propType.settings.required) {
7354
+ return newValue.size !== "";
7355
+ }
7356
+ return meta?.validation ? meta.validation(newValue) : true;
7357
+ }
7358
+ });
7359
+ };
7360
+ return /* @__PURE__ */ React108.createElement(
7361
+ SizeComponent,
7362
+ {
7363
+ units: units2,
7364
+ value: sizeValue,
7365
+ anchorRef,
7366
+ placeholder,
7367
+ defaultUnit,
7368
+ isUnitActive: isUnitHighlighted,
7369
+ onBlur: handleBlur,
7370
+ setValue: handleChange,
7371
+ SizeFieldWrapper: ControlActions,
7372
+ startIcon,
7373
+ ariaLabel,
7374
+ min
7375
+ }
7376
+ );
7377
+ }
7378
+ );
7379
+
7380
+ // src/components/promotions/display-conditions-control.tsx
7381
+ import * as React110 from "react";
7382
+ import { useRef as useRef26 } from "react";
6707
7383
  import { SitemapIcon } from "@elementor/icons";
6708
7384
  import { IconButton as IconButton8, Stack as Stack18, Tooltip as Tooltip9 } from "@elementor/ui";
6709
- import { __ as __52 } from "@wordpress/i18n";
7385
+ import { __ as __53 } from "@wordpress/i18n";
6710
7386
 
6711
7387
  // src/components/promotions/promotion-trigger.tsx
6712
- import * as React103 from "react";
6713
- import { forwardRef as forwardRef11, useImperativeHandle, useState as useState17 } from "react";
7388
+ import * as React109 from "react";
7389
+ import { forwardRef as forwardRef12, useCallback as useCallback4, useImperativeHandle, useState as useState17 } from "react";
6714
7390
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
6715
- import { Box as Box25 } from "@elementor/ui";
7391
+ import { Box as Box26 } from "@elementor/ui";
6716
7392
  function getV4Promotion(key) {
6717
7393
  return window.elementor?.config?.v4Promotions?.[key];
6718
7394
  }
6719
- var PromotionTrigger = forwardRef11(
6720
- ({ promotionKey, children }, ref) => {
7395
+ var PromotionTrigger = forwardRef12(
7396
+ ({ promotionKey, children, trackingData }, ref) => {
6721
7397
  const [isOpen, setIsOpen] = useState17(false);
6722
7398
  const promotion = getV4Promotion(promotionKey);
6723
- const toggle = () => setIsOpen((prev) => !prev);
6724
- useImperativeHandle(ref, () => ({ toggle }), []);
6725
- return /* @__PURE__ */ React103.createElement(React103.Fragment, null, promotion && /* @__PURE__ */ React103.createElement(
7399
+ const toggle = useCallback4(() => {
7400
+ setIsOpen((prev) => {
7401
+ if (!prev) {
7402
+ trackViewPromotion(trackingData);
7403
+ }
7404
+ return !prev;
7405
+ });
7406
+ }, [trackingData]);
7407
+ useImperativeHandle(ref, () => ({ toggle }), [toggle]);
7408
+ return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
6726
7409
  PromotionInfotip,
6727
7410
  {
6728
7411
  title: promotion.title,
@@ -6733,10 +7416,11 @@ var PromotionTrigger = forwardRef11(
6733
7416
  onClose: (e) => {
6734
7417
  e.stopPropagation();
6735
7418
  setIsOpen(false);
6736
- }
7419
+ },
7420
+ onCtaClick: () => trackUpgradePromotionClick(trackingData)
6737
7421
  },
6738
- /* @__PURE__ */ React103.createElement(
6739
- Box25,
7422
+ /* @__PURE__ */ React109.createElement(
7423
+ Box26,
6740
7424
  {
6741
7425
  onClick: (e) => {
6742
7426
  e.stopPropagation();
@@ -6744,17 +7428,18 @@ var PromotionTrigger = forwardRef11(
6744
7428
  },
6745
7429
  sx: { cursor: "pointer", display: "inline-flex" }
6746
7430
  },
6747
- children ?? /* @__PURE__ */ React103.createElement(PromotionChip2, null)
7431
+ children ?? /* @__PURE__ */ React109.createElement(PromotionChip2, null)
6748
7432
  )
6749
7433
  ));
6750
7434
  }
6751
7435
  );
6752
7436
 
6753
7437
  // src/components/promotions/display-conditions-control.tsx
6754
- var ARIA_LABEL = __52("Display Conditions", "elementor");
7438
+ var ARIA_LABEL = __53("Display Conditions", "elementor");
7439
+ var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
6755
7440
  var DisplayConditionsControl = createControl(() => {
6756
- const triggerRef = useRef25(null);
6757
- return /* @__PURE__ */ React104.createElement(
7441
+ const triggerRef = useRef26(null);
7442
+ return /* @__PURE__ */ React110.createElement(
6758
7443
  Stack18,
6759
7444
  {
6760
7445
  direction: "row",
@@ -6764,8 +7449,8 @@ var DisplayConditionsControl = createControl(() => {
6764
7449
  alignItems: "center"
6765
7450
  }
6766
7451
  },
6767
- /* @__PURE__ */ React104.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
6768
- /* @__PURE__ */ React104.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React104.createElement(
7452
+ /* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
7453
+ /* @__PURE__ */ React110.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
6769
7454
  IconButton8,
6770
7455
  {
6771
7456
  size: "tiny",
@@ -6778,21 +7463,22 @@ var DisplayConditionsControl = createControl(() => {
6778
7463
  borderRadius: 1
6779
7464
  }
6780
7465
  },
6781
- /* @__PURE__ */ React104.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
7466
+ /* @__PURE__ */ React110.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
6782
7467
  ))
6783
7468
  );
6784
7469
  });
6785
7470
 
6786
7471
  // src/components/promotions/attributes-control.tsx
6787
- import * as React105 from "react";
6788
- import { useRef as useRef26 } from "react";
7472
+ import * as React111 from "react";
7473
+ import { useRef as useRef27 } from "react";
6789
7474
  import { PlusIcon as PlusIcon3 } from "@elementor/icons";
6790
7475
  import { Stack as Stack19, Tooltip as Tooltip10 } from "@elementor/ui";
6791
- import { __ as __53 } from "@wordpress/i18n";
6792
- var ARIA_LABEL2 = __53("Attributes", "elementor");
7476
+ import { __ as __54 } from "@wordpress/i18n";
7477
+ var ARIA_LABEL2 = __54("Attributes", "elementor");
7478
+ var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
6793
7479
  var AttributesControl = createControl(() => {
6794
- const triggerRef = useRef26(null);
6795
- return /* @__PURE__ */ React105.createElement(
7480
+ const triggerRef = useRef27(null);
7481
+ return /* @__PURE__ */ React111.createElement(
6796
7482
  Stack19,
6797
7483
  {
6798
7484
  direction: "row",
@@ -6802,8 +7488,8 @@ var AttributesControl = createControl(() => {
6802
7488
  alignItems: "center"
6803
7489
  }
6804
7490
  },
6805
- /* @__PURE__ */ React105.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
6806
- /* @__PURE__ */ React105.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React105.createElement(
7491
+ /* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
7492
+ /* @__PURE__ */ React111.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
6807
7493
  PlusIcon3,
6808
7494
  {
6809
7495
  "aria-label": ARIA_LABEL2,
@@ -6817,30 +7503,30 @@ var AttributesControl = createControl(() => {
6817
7503
  });
6818
7504
 
6819
7505
  // src/components/icon-buttons/clear-icon-button.tsx
6820
- import * as React106 from "react";
7506
+ import * as React112 from "react";
6821
7507
  import { BrushBigIcon } from "@elementor/icons";
6822
- import { IconButton as IconButton9, styled as styled9, Tooltip as Tooltip11 } from "@elementor/ui";
6823
- var CustomIconButton = styled9(IconButton9)(({ theme }) => ({
7508
+ import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip11 } from "@elementor/ui";
7509
+ var CustomIconButton = styled10(IconButton9)(({ theme }) => ({
6824
7510
  width: theme.spacing(2.5),
6825
7511
  height: theme.spacing(2.5)
6826
7512
  }));
6827
- var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React106.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React106.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React106.createElement(BrushBigIcon, { fontSize: size })));
7513
+ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React112.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React112.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React112.createElement(BrushBigIcon, { fontSize: size })));
6828
7514
 
6829
7515
  // src/components/repeater/repeater.tsx
6830
- import * as React107 from "react";
6831
- import { useEffect as useEffect14, useState as useState18 } from "react";
7516
+ import * as React113 from "react";
7517
+ import { useEffect as useEffect16, useState as useState18 } from "react";
6832
7518
  import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon4, XIcon as XIcon4 } from "@elementor/icons";
6833
7519
  import {
6834
- bindPopover as bindPopover7,
6835
- bindTrigger as bindTrigger6,
6836
- Box as Box26,
7520
+ bindPopover as bindPopover8,
7521
+ bindTrigger as bindTrigger7,
7522
+ Box as Box27,
6837
7523
  IconButton as IconButton10,
6838
7524
  Infotip as Infotip4,
6839
7525
  Tooltip as Tooltip12,
6840
- usePopupState as usePopupState8
7526
+ usePopupState as usePopupState10
6841
7527
  } from "@elementor/ui";
6842
- import { __ as __54 } from "@wordpress/i18n";
6843
- var SIZE10 = "tiny";
7528
+ import { __ as __55 } from "@wordpress/i18n";
7529
+ var SIZE11 = "tiny";
6844
7530
  var EMPTY_OPEN_ITEM2 = -1;
6845
7531
  var Repeater3 = ({
6846
7532
  label,
@@ -6920,20 +7606,20 @@ var Repeater3 = ({
6920
7606
  };
6921
7607
  const isButtonDisabled = disabled || disableAddItemButton;
6922
7608
  const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
6923
- const addButton = /* @__PURE__ */ React107.createElement(
7609
+ const addButton = /* @__PURE__ */ React113.createElement(
6924
7610
  IconButton10,
6925
7611
  {
6926
- size: SIZE10,
7612
+ size: SIZE11,
6927
7613
  sx: {
6928
7614
  ml: "auto"
6929
7615
  },
6930
7616
  disabled: isButtonDisabled,
6931
7617
  onClick: addRepeaterItem,
6932
- "aria-label": __54("Add item", "elementor")
7618
+ "aria-label": __55("Add item", "elementor")
6933
7619
  },
6934
- /* @__PURE__ */ React107.createElement(PlusIcon4, { fontSize: SIZE10 })
7620
+ /* @__PURE__ */ React113.createElement(PlusIcon4, { fontSize: SIZE11 })
6935
7621
  );
6936
- return /* @__PURE__ */ React107.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React107.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React107.createElement(
7622
+ return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
6937
7623
  Infotip4,
6938
7624
  {
6939
7625
  placement: "right",
@@ -6941,20 +7627,20 @@ var Repeater3 = ({
6941
7627
  color: "secondary",
6942
7628
  slotProps: { popper: { sx: { width: 300 } } }
6943
7629
  },
6944
- /* @__PURE__ */ React107.createElement(Box26, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
6945
- ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React107.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
7630
+ /* @__PURE__ */ React113.createElement(Box27, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
7631
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6946
7632
  const index = uniqueKeys.indexOf(key);
6947
7633
  const value = items2[index];
6948
7634
  if (!value) {
6949
7635
  return null;
6950
7636
  }
6951
- return /* @__PURE__ */ React107.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React107.createElement(
7637
+ return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
6952
7638
  RepeaterItem,
6953
7639
  {
6954
7640
  disabled,
6955
7641
  propDisabled: value?.disabled,
6956
- label: /* @__PURE__ */ React107.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React107.createElement(itemSettings.Label, { value, index })),
6957
- startIcon: /* @__PURE__ */ React107.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React107.createElement(itemSettings.Icon, { value })),
7642
+ label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
7643
+ startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
6958
7644
  removeItem: () => removeRepeaterItem(index),
6959
7645
  duplicateItem: () => duplicateRepeaterItem(index),
6960
7646
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
@@ -6966,7 +7652,7 @@ var Repeater3 = ({
6966
7652
  actions: itemSettings.actions,
6967
7653
  value
6968
7654
  },
6969
- (props) => /* @__PURE__ */ React107.createElement(
7655
+ (props) => /* @__PURE__ */ React113.createElement(
6970
7656
  itemSettings.Content,
6971
7657
  {
6972
7658
  ...props,
@@ -6996,27 +7682,27 @@ var RepeaterItem = ({
6996
7682
  value
6997
7683
  }) => {
6998
7684
  const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
6999
- const duplicateLabel = __54("Duplicate", "elementor");
7000
- const toggleLabel = propDisabled ? __54("Show", "elementor") : __54("Hide", "elementor");
7001
- const removeLabel = __54("Remove", "elementor");
7002
- return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
7685
+ const duplicateLabel = __55("Duplicate", "elementor");
7686
+ const toggleLabel = propDisabled ? __55("Show", "elementor") : __55("Hide", "elementor");
7687
+ const removeLabel = __55("Remove", "elementor");
7688
+ return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
7003
7689
  RepeaterTag,
7004
7690
  {
7005
7691
  disabled,
7006
7692
  label,
7007
7693
  ref: setRef,
7008
- "aria-label": __54("Open item", "elementor"),
7009
- ...bindTrigger6(popoverState),
7694
+ "aria-label": __55("Open item", "elementor"),
7695
+ ...bindTrigger7(popoverState),
7010
7696
  startIcon,
7011
- actions: /* @__PURE__ */ React107.createElement(React107.Fragment, null, showDuplicate && /* @__PURE__ */ React107.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(IconButton10, { size: SIZE10, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React107.createElement(CopyIcon2, { fontSize: SIZE10 }))), showToggle && /* @__PURE__ */ React107.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(IconButton10, { size: SIZE10, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React107.createElement(EyeOffIcon2, { fontSize: SIZE10 }) : /* @__PURE__ */ React107.createElement(EyeIcon2, { fontSize: SIZE10 }))), actions?.(value), showRemove && /* @__PURE__ */ React107.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(IconButton10, { size: SIZE10, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React107.createElement(XIcon4, { fontSize: SIZE10 }))))
7697
+ actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(CopyIcon2, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(EyeOffIcon2, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(EyeIcon2, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(XIcon4, { fontSize: SIZE11 }))))
7012
7698
  }
7013
- ), /* @__PURE__ */ React107.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React107.createElement(Box26, null, children({ anchorEl: ref }))));
7699
+ ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(Box27, null, children({ anchorEl: ref }))));
7014
7700
  };
7015
7701
  var usePopover = (openOnMount, onOpen) => {
7016
7702
  const [ref, setRef] = useState18(null);
7017
- const popoverState = usePopupState8({ variant: "popover" });
7018
- const popoverProps = bindPopover7(popoverState);
7019
- useEffect14(() => {
7703
+ const popoverState = usePopupState10({ variant: "popover" });
7704
+ const popoverProps = bindPopover8(popoverState);
7705
+ useEffect16(() => {
7020
7706
  if (openOnMount && ref) {
7021
7707
  popoverState.open(ref);
7022
7708
  onOpen?.();
@@ -7031,8 +7717,8 @@ var usePopover = (openOnMount, onOpen) => {
7031
7717
  };
7032
7718
 
7033
7719
  // src/components/inline-editor-toolbar.tsx
7034
- import * as React109 from "react";
7035
- import { useMemo as useMemo15, useRef as useRef28, useState as useState19 } from "react";
7720
+ import * as React115 from "react";
7721
+ import { useMemo as useMemo16, useRef as useRef29, useState as useState19 } from "react";
7036
7722
  import { getContainer, getElementSetting } from "@elementor/editor-elements";
7037
7723
  import {
7038
7724
  BoldIcon,
@@ -7045,23 +7731,23 @@ import {
7045
7731
  UnderlineIcon
7046
7732
  } from "@elementor/icons";
7047
7733
  import {
7048
- Box as Box27,
7734
+ Box as Box28,
7049
7735
  IconButton as IconButton11,
7050
7736
  ToggleButton as ToggleButton3,
7051
7737
  ToggleButtonGroup as ToggleButtonGroup2,
7052
7738
  toggleButtonGroupClasses,
7053
7739
  Tooltip as Tooltip14,
7054
- usePopupState as usePopupState9
7740
+ usePopupState as usePopupState11
7055
7741
  } from "@elementor/ui";
7056
7742
  import { useEditorState } from "@tiptap/react";
7057
- import { __ as __56 } from "@wordpress/i18n";
7743
+ import { __ as __57 } from "@wordpress/i18n";
7058
7744
 
7059
7745
  // src/components/url-popover.tsx
7060
- import * as React108 from "react";
7061
- import { useEffect as useEffect15, useRef as useRef27 } from "react";
7746
+ import * as React114 from "react";
7747
+ import { useEffect as useEffect17, useRef as useRef28 } from "react";
7062
7748
  import { ExternalLinkIcon } from "@elementor/icons";
7063
- import { bindPopover as bindPopover8, Popover as Popover7, Stack as Stack20, TextField as TextField9, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
7064
- import { __ as __55 } from "@wordpress/i18n";
7749
+ import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack20, TextField as TextField10, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
7750
+ import { __ as __56 } from "@wordpress/i18n";
7065
7751
  var UrlPopover = ({
7066
7752
  popupState,
7067
7753
  restoreValue,
@@ -7071,8 +7757,8 @@ var UrlPopover = ({
7071
7757
  openInNewTab,
7072
7758
  onToggleNewTab
7073
7759
  }) => {
7074
- const inputRef = useRef27(null);
7075
- useEffect15(() => {
7760
+ const inputRef = useRef28(null);
7761
+ useEffect17(() => {
7076
7762
  if (popupState.isOpen) {
7077
7763
  requestAnimationFrame(() => inputRef.current?.focus());
7078
7764
  }
@@ -7081,41 +7767,41 @@ var UrlPopover = ({
7081
7767
  restoreValue();
7082
7768
  popupState.close();
7083
7769
  };
7084
- return /* @__PURE__ */ React108.createElement(
7085
- Popover7,
7770
+ return /* @__PURE__ */ React114.createElement(
7771
+ Popover8,
7086
7772
  {
7087
7773
  slotProps: {
7088
7774
  paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
7089
7775
  },
7090
- ...bindPopover8(popupState),
7776
+ ...bindPopover9(popupState),
7091
7777
  anchorOrigin: { vertical: "top", horizontal: "left" },
7092
7778
  transformOrigin: { vertical: "top", horizontal: "left" },
7093
7779
  onClose: handleClose
7094
7780
  },
7095
- /* @__PURE__ */ React108.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React108.createElement(
7096
- TextField9,
7781
+ /* @__PURE__ */ React114.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
7782
+ TextField10,
7097
7783
  {
7098
7784
  value,
7099
7785
  onChange,
7100
7786
  size: "tiny",
7101
7787
  fullWidth: true,
7102
- placeholder: __55("Type a URL", "elementor"),
7788
+ placeholder: __56("Type a URL", "elementor"),
7103
7789
  inputProps: { ref: inputRef },
7104
7790
  color: "secondary",
7105
7791
  InputProps: { sx: { borderRadius: "8px" } },
7106
7792
  onKeyUp: (event) => event.key === "Enter" && handleClose()
7107
7793
  }
7108
- ), /* @__PURE__ */ React108.createElement(Tooltip13, { title: __55("Open in a new tab", "elementor") }, /* @__PURE__ */ React108.createElement(
7794
+ ), /* @__PURE__ */ React114.createElement(Tooltip13, { title: __56("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
7109
7795
  ToggleButton2,
7110
7796
  {
7111
7797
  size: "tiny",
7112
7798
  value: "newTab",
7113
7799
  selected: openInNewTab,
7114
7800
  onClick: onToggleNewTab,
7115
- "aria-label": __55("Open in a new tab", "elementor"),
7801
+ "aria-label": __56("Open in a new tab", "elementor"),
7116
7802
  sx: { borderRadius: "8px" }
7117
7803
  },
7118
- /* @__PURE__ */ React108.createElement(ExternalLinkIcon, { fontSize: "tiny" })
7804
+ /* @__PURE__ */ React114.createElement(ExternalLinkIcon, { fontSize: "tiny" })
7119
7805
  )))
7120
7806
  );
7121
7807
  };
@@ -7124,14 +7810,14 @@ var UrlPopover = ({
7124
7810
  var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7125
7811
  const [urlValue, setUrlValue] = useState19("");
7126
7812
  const [openInNewTab, setOpenInNewTab] = useState19(false);
7127
- const toolbarRef = useRef28(null);
7128
- const linkPopupState = usePopupState9({ variant: "popover" });
7813
+ const toolbarRef = useRef29(null);
7814
+ const linkPopupState = usePopupState11({ variant: "popover" });
7129
7815
  const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
7130
7816
  const editorState = useEditorState({
7131
7817
  editor,
7132
7818
  selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
7133
7819
  });
7134
- const formatButtonsList = useMemo15(() => {
7820
+ const formatButtonsList = useMemo16(() => {
7135
7821
  const buttons = Object.values(formatButtons);
7136
7822
  if (isElementClickable) {
7137
7823
  return buttons.filter((button) => button.action !== "link");
@@ -7168,11 +7854,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7168
7854
  }
7169
7855
  linkPopupState.close();
7170
7856
  };
7171
- React109.useEffect(() => {
7857
+ React115.useEffect(() => {
7172
7858
  editor?.commands?.focus();
7173
7859
  }, [editor]);
7174
- return /* @__PURE__ */ React109.createElement(
7175
- Box27,
7860
+ return /* @__PURE__ */ React115.createElement(
7861
+ Box28,
7176
7862
  {
7177
7863
  ref: toolbarRef,
7178
7864
  sx: {
@@ -7188,8 +7874,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7188
7874
  ...sx
7189
7875
  }
7190
7876
  },
7191
- /* @__PURE__ */ React109.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React109.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
7192
- /* @__PURE__ */ React109.createElement(
7877
+ /* @__PURE__ */ React115.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React115.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
7878
+ /* @__PURE__ */ React115.createElement(
7193
7879
  ToggleButtonGroup2,
7194
7880
  {
7195
7881
  value: editorState,
@@ -7211,7 +7897,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7211
7897
  }
7212
7898
  }
7213
7899
  },
7214
- formatButtonsList.map((button) => /* @__PURE__ */ React109.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React109.createElement(
7900
+ formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
7215
7901
  ToggleButton3,
7216
7902
  {
7217
7903
  value: button.action,
@@ -7229,7 +7915,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7229
7915
  button.icon
7230
7916
  )))
7231
7917
  ),
7232
- /* @__PURE__ */ React109.createElement(
7918
+ /* @__PURE__ */ React115.createElement(
7233
7919
  UrlPopover,
7234
7920
  {
7235
7921
  popupState: linkPopupState,
@@ -7252,64 +7938,64 @@ var checkIfElementIsClickable = (elementId) => {
7252
7938
  };
7253
7939
  var toolbarButtons = {
7254
7940
  clear: {
7255
- label: __56("Clear", "elementor"),
7256
- icon: /* @__PURE__ */ React109.createElement(MinusIcon2, { fontSize: "tiny" }),
7941
+ label: __57("Clear", "elementor"),
7942
+ icon: /* @__PURE__ */ React115.createElement(MinusIcon2, { fontSize: "tiny" }),
7257
7943
  action: "clear",
7258
7944
  method: (editor) => {
7259
7945
  editor.chain().focus().clearNodes().unsetAllMarks().run();
7260
7946
  }
7261
7947
  },
7262
7948
  bold: {
7263
- label: __56("Bold", "elementor"),
7264
- icon: /* @__PURE__ */ React109.createElement(BoldIcon, { fontSize: "tiny" }),
7949
+ label: __57("Bold", "elementor"),
7950
+ icon: /* @__PURE__ */ React115.createElement(BoldIcon, { fontSize: "tiny" }),
7265
7951
  action: "bold",
7266
7952
  method: (editor) => {
7267
7953
  editor.chain().focus().toggleBold().run();
7268
7954
  }
7269
7955
  },
7270
7956
  italic: {
7271
- label: __56("Italic", "elementor"),
7272
- icon: /* @__PURE__ */ React109.createElement(ItalicIcon, { fontSize: "tiny" }),
7957
+ label: __57("Italic", "elementor"),
7958
+ icon: /* @__PURE__ */ React115.createElement(ItalicIcon, { fontSize: "tiny" }),
7273
7959
  action: "italic",
7274
7960
  method: (editor) => {
7275
7961
  editor.chain().focus().toggleItalic().run();
7276
7962
  }
7277
7963
  },
7278
7964
  underline: {
7279
- label: __56("Underline", "elementor"),
7280
- icon: /* @__PURE__ */ React109.createElement(UnderlineIcon, { fontSize: "tiny" }),
7965
+ label: __57("Underline", "elementor"),
7966
+ icon: /* @__PURE__ */ React115.createElement(UnderlineIcon, { fontSize: "tiny" }),
7281
7967
  action: "underline",
7282
7968
  method: (editor) => {
7283
7969
  editor.chain().focus().toggleUnderline().run();
7284
7970
  }
7285
7971
  },
7286
7972
  strike: {
7287
- label: __56("Strikethrough", "elementor"),
7288
- icon: /* @__PURE__ */ React109.createElement(StrikethroughIcon, { fontSize: "tiny" }),
7973
+ label: __57("Strikethrough", "elementor"),
7974
+ icon: /* @__PURE__ */ React115.createElement(StrikethroughIcon, { fontSize: "tiny" }),
7289
7975
  action: "strike",
7290
7976
  method: (editor) => {
7291
7977
  editor.chain().focus().toggleStrike().run();
7292
7978
  }
7293
7979
  },
7294
7980
  superscript: {
7295
- label: __56("Superscript", "elementor"),
7296
- icon: /* @__PURE__ */ React109.createElement(SuperscriptIcon, { fontSize: "tiny" }),
7981
+ label: __57("Superscript", "elementor"),
7982
+ icon: /* @__PURE__ */ React115.createElement(SuperscriptIcon, { fontSize: "tiny" }),
7297
7983
  action: "superscript",
7298
7984
  method: (editor) => {
7299
7985
  editor.chain().focus().toggleSuperscript().run();
7300
7986
  }
7301
7987
  },
7302
7988
  subscript: {
7303
- label: __56("Subscript", "elementor"),
7304
- icon: /* @__PURE__ */ React109.createElement(SubscriptIcon, { fontSize: "tiny" }),
7989
+ label: __57("Subscript", "elementor"),
7990
+ icon: /* @__PURE__ */ React115.createElement(SubscriptIcon, { fontSize: "tiny" }),
7305
7991
  action: "subscript",
7306
7992
  method: (editor) => {
7307
7993
  editor.chain().focus().toggleSubscript().run();
7308
7994
  }
7309
7995
  },
7310
7996
  link: {
7311
- label: __56("Link", "elementor"),
7312
- icon: /* @__PURE__ */ React109.createElement(LinkIcon3, { fontSize: "tiny" }),
7997
+ label: __57("Link", "elementor"),
7998
+ icon: /* @__PURE__ */ React115.createElement(LinkIcon3, { fontSize: "tiny" }),
7313
7999
  action: "link",
7314
8000
  method: null
7315
8001
  }
@@ -7318,13 +8004,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
7318
8004
  var possibleFormats = Object.keys(formatButtons);
7319
8005
 
7320
8006
  // src/components/size/unstable-size-field.tsx
7321
- import * as React112 from "react";
7322
- import { InputAdornment as InputAdornment5 } from "@elementor/ui";
8007
+ import * as React118 from "react";
8008
+ import { InputAdornment as InputAdornment6 } from "@elementor/ui";
7323
8009
 
7324
8010
  // src/hooks/use-size-value.ts
7325
8011
  var DEFAULT_UNIT2 = "px";
7326
- var DEFAULT_SIZE2 = "";
7327
- var useSizeValue = (externalValue, onChange, defaultUnit) => {
8012
+ var DEFAULT_SIZE3 = "";
8013
+ var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
7328
8014
  const [sizeValue, setSizeValue] = useSyncExternalState({
7329
8015
  external: externalValue,
7330
8016
  setExternal: (newState) => {
@@ -7333,7 +8019,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
7333
8019
  }
7334
8020
  },
7335
8021
  persistWhen: (newState) => differsFromExternal(newState, externalValue),
7336
- fallback: () => ({ size: DEFAULT_SIZE2, unit: defaultUnit ?? DEFAULT_UNIT2 })
8022
+ fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
7337
8023
  });
7338
8024
  const setSize = (value) => {
7339
8025
  const newState = {
@@ -7361,44 +8047,44 @@ var differsFromExternal = (newState, externalState) => {
7361
8047
  };
7362
8048
 
7363
8049
  // src/components/size/unit-select.tsx
7364
- import * as React110 from "react";
7365
- import { useId as useId3 } from "react";
7366
- import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
7367
- import { bindMenu as bindMenu2, bindTrigger as bindTrigger7, Button as Button6, Menu as Menu3, styled as styled10, usePopupState as usePopupState10 } from "@elementor/ui";
7368
- var menuItemContentStyles = {
8050
+ import * as React116 from "react";
8051
+ import { useId as useId4 } from "react";
8052
+ import { MenuListItem as MenuListItem8 } from "@elementor/editor-ui";
8053
+ import { bindMenu as bindMenu3, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu4, styled as styled11, usePopupState as usePopupState12 } from "@elementor/ui";
8054
+ var menuItemContentStyles2 = {
7369
8055
  display: "flex",
7370
8056
  flexDirection: "column",
7371
8057
  justifyContent: "center"
7372
8058
  };
7373
8059
  var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
7374
- const popupState = usePopupState10({
8060
+ const popupState = usePopupState12({
7375
8061
  variant: "popover",
7376
- popupId: useId3()
8062
+ popupId: useId4()
7377
8063
  });
7378
8064
  const handleMenuItemClick = (index) => {
7379
8065
  onClick(options[index]);
7380
8066
  popupState.close();
7381
8067
  };
7382
- return /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement(StyledButton2, { isPrimaryColor: showPrimaryColor, size: "small", ...bindTrigger7(popupState) }, value), /* @__PURE__ */ React110.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option, index) => /* @__PURE__ */ React110.createElement(
7383
- MenuListItem7,
8068
+ return /* @__PURE__ */ React116.createElement(React116.Fragment, null, /* @__PURE__ */ React116.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...bindTrigger8(popupState) }, value), /* @__PURE__ */ React116.createElement(Menu4, { MenuListProps: { dense: true }, ...bindMenu3(popupState) }, options.map((option, index) => /* @__PURE__ */ React116.createElement(
8069
+ MenuListItem8,
7384
8070
  {
7385
8071
  key: option,
7386
8072
  onClick: () => handleMenuItemClick(index),
7387
8073
  primaryTypographyProps: {
7388
8074
  variant: "caption",
7389
8075
  sx: {
7390
- ...menuItemContentStyles,
8076
+ ...menuItemContentStyles2,
7391
8077
  lineHeight: "1"
7392
8078
  }
7393
8079
  },
7394
8080
  menuItemTextProps: {
7395
- sx: menuItemContentStyles
8081
+ sx: menuItemContentStyles2
7396
8082
  }
7397
8083
  },
7398
8084
  option.toUpperCase()
7399
8085
  ))));
7400
8086
  };
7401
- var StyledButton2 = styled10(Button6, {
8087
+ var StyledButton3 = styled11(Button7, {
7402
8088
  shouldForwardProp: (prop) => prop !== "isPrimaryColor"
7403
8089
  })(({ isPrimaryColor, theme }) => ({
7404
8090
  color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
@@ -7408,11 +8094,11 @@ var StyledButton2 = styled10(Button6, {
7408
8094
  }));
7409
8095
 
7410
8096
  // src/components/size/unstable-size-input.tsx
7411
- import * as React111 from "react";
7412
- import { forwardRef as forwardRef12 } from "react";
7413
- var UnstableSizeInput = forwardRef12(
8097
+ import * as React117 from "react";
8098
+ import { forwardRef as forwardRef13 } from "react";
8099
+ var UnstableSizeInput = forwardRef13(
7414
8100
  ({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
7415
- return /* @__PURE__ */ React111.createElement(
8101
+ return /* @__PURE__ */ React117.createElement(
7416
8102
  NumberInput,
7417
8103
  {
7418
8104
  ref,
@@ -7427,12 +8113,12 @@ var UnstableSizeInput = forwardRef12(
7427
8113
  onInput: onChange,
7428
8114
  onBlur,
7429
8115
  InputProps,
7430
- sx: getCursorStyle(InputProps?.readOnly ?? false)
8116
+ sx: getCursorStyle2(InputProps?.readOnly ?? false)
7431
8117
  }
7432
8118
  );
7433
8119
  }
7434
8120
  );
7435
- var getCursorStyle = (readOnly) => ({
8121
+ var getCursorStyle2 = (readOnly) => ({
7436
8122
  input: { cursor: readOnly ? "default !important" : void 0 }
7437
8123
  });
7438
8124
 
@@ -7446,11 +8132,11 @@ var UnstableSizeField = ({
7446
8132
  defaultUnit,
7447
8133
  startIcon
7448
8134
  }) => {
7449
- const { size, unit, setSize, setUnit } = useSizeValue(value, onChange, defaultUnit);
7450
- const shouldHighlightUnit = () => {
8135
+ const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
8136
+ const shouldHighlightUnit2 = () => {
7451
8137
  return hasValue(size);
7452
8138
  };
7453
- return /* @__PURE__ */ React112.createElement(
8139
+ return /* @__PURE__ */ React118.createElement(
7454
8140
  UnstableSizeInput,
7455
8141
  {
7456
8142
  type: "number",
@@ -7459,14 +8145,14 @@ var UnstableSizeField = ({
7459
8145
  onChange: (event) => setSize(event.target.value),
7460
8146
  InputProps: {
7461
8147
  ...InputProps,
7462
- startAdornment: startIcon && /* @__PURE__ */ React112.createElement(InputAdornment5, { position: "start" }, startIcon),
7463
- endAdornment: /* @__PURE__ */ React112.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React112.createElement(
8148
+ startAdornment: startIcon && /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "start" }, startIcon),
8149
+ endAdornment: /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React118.createElement(
7464
8150
  UnitSelect,
7465
8151
  {
7466
8152
  options: units2,
7467
8153
  value: unit,
7468
8154
  onClick: setUnit,
7469
- showPrimaryColor: shouldHighlightUnit()
8155
+ showPrimaryColor: shouldHighlightUnit2()
7470
8156
  }
7471
8157
  ))
7472
8158
  }
@@ -7478,41 +8164,35 @@ var hasValue = (value) => {
7478
8164
  };
7479
8165
 
7480
8166
  // src/hooks/use-font-families.ts
7481
- import { useMemo as useMemo16 } from "react";
8167
+ import { useMemo as useMemo17 } from "react";
7482
8168
  import { getElementorConfig } from "@elementor/editor-v1-adapters";
7483
- import { __ as __57 } from "@wordpress/i18n";
7484
- var supportedCategories = {
7485
- system: __57("System", "elementor"),
7486
- custom: __57("Custom Fonts", "elementor"),
7487
- googlefonts: __57("Google Fonts", "elementor")
7488
- };
7489
- var getFontFamilies = () => {
8169
+ var getFontControlConfig = () => {
7490
8170
  const { controls } = getElementorConfig();
7491
- const options = controls?.font?.options;
7492
- if (!options) {
7493
- return null;
7494
- }
7495
- return options;
8171
+ return controls?.font ?? {};
7496
8172
  };
7497
8173
  var useFontFamilies = () => {
7498
- const fontFamilies = getFontFamilies();
7499
- return useMemo16(() => {
7500
- const categoriesOrder = ["system", "custom", "googlefonts"];
7501
- return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
7502
- if (!supportedCategories[category]) {
8174
+ const { groups, options } = getFontControlConfig();
8175
+ return useMemo17(() => {
8176
+ if (!groups || !options) {
8177
+ return [];
8178
+ }
8179
+ const groupKeys = Object.keys(groups);
8180
+ const groupIndexMap = new Map(groupKeys.map((key, index) => [key, index]));
8181
+ return Object.entries(options).reduce((acc, [font, category]) => {
8182
+ const groupIndex = groupIndexMap.get(category);
8183
+ if (groupIndex === void 0) {
7503
8184
  return acc;
7504
8185
  }
7505
- const categoryIndex = categoriesOrder.indexOf(category);
7506
- if (!acc[categoryIndex]) {
7507
- acc[categoryIndex] = {
7508
- label: supportedCategories[category],
8186
+ if (!acc[groupIndex]) {
8187
+ acc[groupIndex] = {
8188
+ label: groups[category],
7509
8189
  fonts: []
7510
8190
  };
7511
8191
  }
7512
- acc[categoryIndex].fonts.push(font);
8192
+ acc[groupIndex].fonts.push(font);
7513
8193
  return acc;
7514
8194
  }, []).filter(Boolean);
7515
- }, [fontFamilies]);
8195
+ }, [groups, options]);
7516
8196
  };
7517
8197
  export {
7518
8198
  AspectRatioControl,
@@ -7557,6 +8237,7 @@ export {
7557
8237
  Repeater3 as Repeater,
7558
8238
  SelectControl,
7559
8239
  SelectControlWrapper,
8240
+ SizeComponent,
7560
8241
  SizeControl,
7561
8242
  StrokeControl,
7562
8243
  SvgMediaControl,
@@ -7568,6 +8249,7 @@ export {
7568
8249
  TransformRepeaterControl,
7569
8250
  TransformSettingsControl,
7570
8251
  TransitionRepeaterControl,
8252
+ UnstableSizeControl,
7571
8253
  UnstableSizeField,
7572
8254
  UrlControl,
7573
8255
  VideoMediaControl,
@@ -7580,6 +8262,8 @@ export {
7580
8262
  injectIntoRepeaterItemLabel,
7581
8263
  isUnitExtendedOption,
7582
8264
  registerControlReplacement,
8265
+ trackUpgradePromotionClick,
8266
+ trackViewPromotion,
7583
8267
  transitionProperties,
7584
8268
  transitionsItemsList,
7585
8269
  useBoundProp,