@elementor/editor-controls 4.0.0-manual → 4.0.1

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 (39) hide show
  1. package/dist/index.d.mts +138 -64
  2. package/dist/index.d.ts +138 -64
  3. package/dist/index.js +905 -233
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +890 -225
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +15 -15
  8. package/src/components/inline-editor.tsx +16 -57
  9. package/src/components/promotions/attributes-control.tsx +2 -1
  10. package/src/components/promotions/display-conditions-control.tsx +2 -1
  11. package/src/components/promotions/promotion-trigger.tsx +14 -4
  12. package/src/controls/chips-control.tsx +1 -1
  13. package/src/controls/email-form-action-control.tsx +5 -5
  14. package/src/controls/number-control.tsx +8 -2
  15. package/src/controls/size-control/hooks/use-size-unit-keyboard.tsx +66 -0
  16. package/src/controls/size-control/hooks/use-size-value.ts +71 -0
  17. package/src/controls/size-control/size-component.tsx +94 -0
  18. package/src/controls/size-control/size-field.tsx +113 -0
  19. package/src/controls/size-control/sync/get-units.ts +17 -0
  20. package/src/controls/size-control/types.ts +17 -0
  21. package/src/controls/size-control/ui/size-input.tsx +68 -0
  22. package/src/controls/size-control/ui/text-field-popover.tsx +78 -0
  23. package/src/controls/size-control/ui/unit-selector.tsx +80 -0
  24. package/src/controls/size-control/unstable-size-control.tsx +86 -0
  25. package/src/controls/size-control/utils/has-size-value.ts +5 -0
  26. package/src/controls/size-control/utils/is-extended-unit.ts +8 -0
  27. package/src/controls/size-control/utils/resolve-bound-prop-value.ts +72 -0
  28. package/src/controls/size-control/utils/resolve-size-value.ts +85 -0
  29. package/src/controls/size-control/utils/settings/get-default-unit.ts +7 -0
  30. package/src/controls/size-control/utils/settings/get-prop-type-settings.ts +12 -0
  31. package/src/controls/size-control/utils/settings/get-size-units.ts +23 -0
  32. package/src/controls/size-control/utils/should-nullify-value.ts +15 -0
  33. package/src/controls/svg-media-control.tsx +5 -4
  34. package/src/controls/transition-control/data.ts +3 -3
  35. package/src/controls/transition-control/transition-repeater-control.tsx +8 -2
  36. package/src/controls/transition-control/transition-selector.tsx +7 -0
  37. package/src/hooks/use-font-families.ts +22 -25
  38. package/src/index.ts +4 -0
  39. 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(
@@ -3980,7 +3980,7 @@ var AspectRatioControl = createControl(({ label }) => {
3980
3980
  import * as React71 from "react";
3981
3981
  import { useState as useState14 } from "react";
3982
3982
  import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
3983
- import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
3983
+ import { svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil3 } from "@elementor/editor-props";
3984
3984
  import { UploadIcon as UploadIcon2 } from "@elementor/icons";
3985
3985
  import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled7, ThemeProvider } from "@elementor/ui";
3986
3986
  import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
@@ -4072,8 +4072,9 @@ var StyledCardMediaContainer = styled7(Stack13)`
4072
4072
  var MODE_BROWSE = { mode: "browse" };
4073
4073
  var MODE_UPLOAD = { mode: "upload" };
4074
4074
  var SvgMediaControl = createControl(() => {
4075
- const { value, setValue } = useBoundProp(imageSrcPropTypeUtil2);
4076
- const { id, url } = value ?? {};
4075
+ const { value, setValue } = useBoundProp(svgSrcPropTypeUtil);
4076
+ const id = value?.id;
4077
+ const url = value?.url;
4077
4078
  const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
4078
4079
  const src = attachment?.url ?? url?.value ?? null;
4079
4080
  const { data: allowSvgUpload } = useUnfilteredFilesUpload();
@@ -4089,7 +4090,7 @@ var SvgMediaControl = createControl(() => {
4089
4090
  $$type: "image-attachment-id",
4090
4091
  value: selectedAttachment.id
4091
4092
  },
4092
- url: null
4093
+ url: urlPropTypeUtil3.create(selectedAttachment.url)
4093
4094
  });
4094
4095
  }
4095
4096
  });
@@ -5132,7 +5133,7 @@ import * as React95 from "react";
5132
5133
  import { useRef as useRef21 } from "react";
5133
5134
  import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
5134
5135
  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";
5136
+ import { bindTrigger as bindTrigger4, Box as Box18, IconButton as IconButton7, Tooltip as Tooltip8, Typography as Typography7, usePopupState as usePopupState6 } from "@elementor/ui";
5136
5137
  import { __ as __47 } from "@wordpress/i18n";
5137
5138
 
5138
5139
  // src/controls/transform-control/initial-values.ts
@@ -5674,7 +5675,7 @@ var ToolTip = /* @__PURE__ */ React95.createElement(
5674
5675
  sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
5675
5676
  },
5676
5677
  /* @__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"))
5678
+ /* @__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
5679
  );
5679
5680
  var Repeater2 = ({
5680
5681
  headerRef,
@@ -5740,7 +5741,8 @@ import {
5740
5741
  selectionSizePropTypeUtil as selectionSizePropTypeUtil2
5741
5742
  } from "@elementor/editor-props";
5742
5743
  import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
5743
- import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography7 } from "@elementor/ui";
5744
+ import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography8 } from "@elementor/ui";
5745
+ import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
5744
5746
  import { __ as __50 } from "@wordpress/i18n";
5745
5747
 
5746
5748
  // src/controls/selection-size-control.tsx
@@ -5794,9 +5796,9 @@ var MIN_PRO_VERSION = "3.35";
5794
5796
  var getIsSiteRtl = () => {
5795
5797
  return !!window.elementorFrontend?.config?.is_rtl;
5796
5798
  };
5797
- var shouldExtendTransitionProperties = () => {
5799
+ var shouldShowAllTransitionProperties = () => {
5798
5800
  if (!hasProInstalled()) {
5799
- return false;
5801
+ return true;
5800
5802
  }
5801
5803
  const proVersion = window.elementorPro?.config?.version;
5802
5804
  if (!proVersion) {
@@ -5933,7 +5935,7 @@ var createTransitionPropertiesList = () => {
5933
5935
  ]
5934
5936
  }
5935
5937
  ];
5936
- return shouldExtendTransitionProperties() ? baseProperties : [baseProperties[0]];
5938
+ return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
5937
5939
  };
5938
5940
  var transitionProperties = createTransitionPropertiesList();
5939
5941
  var transitionsItemsList = transitionProperties.map((category) => ({
@@ -5972,6 +5974,47 @@ import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
5972
5974
  import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
5973
5975
  import { bindPopover as bindPopover6, bindTrigger as bindTrigger5, Box as Box19, Popover as Popover6, UnstableTag as UnstableTag3, usePopupState as usePopupState7 } from "@elementor/ui";
5974
5976
  import { __ as __49 } from "@wordpress/i18n";
5977
+
5978
+ // src/utils/tracking.ts
5979
+ import { getSelectedElements as getSelectedElements2 } from "@elementor/editor-elements";
5980
+ import { getMixpanel } from "@elementor/events";
5981
+ var getBaseEventProperties = (data, config) => ({
5982
+ app_type: config?.appTypes?.editor ?? "editor",
5983
+ window_name: config?.appTypes?.editor ?? "editor",
5984
+ interaction_type: config?.triggers?.click ?? "Click",
5985
+ target_name: data.target_name,
5986
+ target_location: data.target_location ?? "widget_panel",
5987
+ location_l1: data.location_l1 ?? getSelectedElements2()[0]?.type ?? "",
5988
+ ...data.location_l2 && { location_l2: data.location_l2 }
5989
+ });
5990
+ var dispatchPromotionEvent = (data, resolveOptions) => {
5991
+ const { dispatchEvent, config } = getMixpanel();
5992
+ const { eventName, interactionResult, interactionDescription } = resolveOptions(config);
5993
+ if (!eventName) {
5994
+ return;
5995
+ }
5996
+ dispatchEvent?.(eventName, {
5997
+ ...getBaseEventProperties(data, config),
5998
+ interaction_result: interactionResult,
5999
+ interaction_description: interactionDescription
6000
+ });
6001
+ };
6002
+ var trackViewPromotion = (data) => {
6003
+ dispatchPromotionEvent(data, (config) => ({
6004
+ eventName: config?.names?.promotions?.viewPromotion,
6005
+ interactionResult: config?.interactionResults?.promotionViewed ?? "promotion_viewed",
6006
+ interactionDescription: "user_viewed_promotion"
6007
+ }));
6008
+ };
6009
+ var trackUpgradePromotionClick = (data) => {
6010
+ dispatchPromotionEvent(data, (config) => ({
6011
+ eventName: config?.names?.promotions?.upgradePromotionClick,
6012
+ interactionResult: config?.interactionResults?.upgradeNow ?? "upgrade_now",
6013
+ interactionDescription: "user_clicked_upgrade_now"
6014
+ }));
6015
+ };
6016
+
6017
+ // src/controls/transition-control/transition-selector.tsx
5975
6018
  var toTransitionSelectorValue = (label) => {
5976
6019
  for (const category of transitionProperties) {
5977
6020
  const property = category.properties.find((prop) => prop.label === label);
@@ -6109,7 +6152,11 @@ var TransitionSelector = ({
6109
6152
  "Upgrade to customize transition properties and control effects.",
6110
6153
  "elementor"
6111
6154
  ),
6112
- upgradeUrl: PRO_UPGRADE_URL
6155
+ upgradeUrl: PRO_UPGRADE_URL,
6156
+ onCtaClick: () => trackUpgradePromotionClick({
6157
+ target_name: "transition_property",
6158
+ location_l2: "style"
6159
+ })
6113
6160
  }
6114
6161
  ) : null
6115
6162
  }
@@ -6228,7 +6275,7 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React98.createElement(
6228
6275
  icon: /* @__PURE__ */ React98.createElement(InfoCircleFilledIcon3, null)
6229
6276
  },
6230
6277
  /* @__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")))
6278
+ /* @__PURE__ */ React98.createElement(Box20, { component: "span" }, /* @__PURE__ */ React98.createElement(Typography8, { variant: "body2" }, __50("Switch to 'Normal' state to add a transition.", "elementor")))
6232
6279
  );
6233
6280
  var TransitionRepeaterControl = createControl(
6234
6281
  ({
@@ -6237,6 +6284,7 @@ var TransitionRepeaterControl = createControl(
6237
6284
  }) => {
6238
6285
  const currentStyleIsNormal = currentStyleState === null;
6239
6286
  const [recentlyUsedList, setRecentlyUsedList] = useState16([]);
6287
+ const proInstalled = hasProInstalled2();
6240
6288
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
6241
6289
  const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo13(
6242
6290
  () => getDisabledItemLabels(value),
@@ -6245,10 +6293,14 @@ var TransitionRepeaterControl = createControl(
6245
6293
  const allowedTransitionSet = useMemo13(() => {
6246
6294
  const set = /* @__PURE__ */ new Set();
6247
6295
  transitionProperties.forEach((category) => {
6248
- category.properties.forEach((prop) => set.add(prop.value));
6296
+ category.properties.forEach((prop) => {
6297
+ if (!prop.isDisabled || proInstalled) {
6298
+ set.add(prop.value);
6299
+ }
6300
+ });
6249
6301
  });
6250
6302
  return set;
6251
- }, []);
6303
+ }, [proInstalled]);
6252
6304
  useEffect11(() => {
6253
6305
  if (!value || value.length === 0) {
6254
6306
  return;
@@ -6377,11 +6429,8 @@ import { debounce as debounce4 } from "@elementor/utils";
6377
6429
 
6378
6430
  // src/components/inline-editor.tsx
6379
6431
  import * as React100 from "react";
6380
- import {
6381
- useEffect as useEffect12,
6382
- useRef as useRef24
6383
- } from "react";
6384
- import { Box as Box22, ClickAwayListener } from "@elementor/ui";
6432
+ import { useEffect as useEffect12, useRef as useRef24 } from "react";
6433
+ import { Box as Box22 } from "@elementor/ui";
6385
6434
  import Bold from "@tiptap/extension-bold";
6386
6435
  import Document from "@tiptap/extension-document";
6387
6436
  import HardBreak from "@tiptap/extension-hard-break";
@@ -6422,9 +6471,12 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6422
6471
  expectedTag = null,
6423
6472
  onEditorCreate,
6424
6473
  wrapperClassName,
6425
- onSelectionEnd
6474
+ onSelectionEnd,
6475
+ mountElement = null
6426
6476
  } = props;
6427
6477
  const containerRef = useRef24(null);
6478
+ const onBlurRef = useRef24(onBlur);
6479
+ onBlurRef.current = onBlur;
6428
6480
  const documentContentSettings = !!expectedTag ? "block+" : "inline*";
6429
6481
  const onUpdate = ({ editor: updatedEditor }) => {
6430
6482
  const newValue = updatedEditor.getHTML();
@@ -6432,7 +6484,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6432
6484
  };
6433
6485
  const onKeyDown = (_, event) => {
6434
6486
  if (event.key === "Escape") {
6435
- onBlur?.();
6487
+ onBlurRef.current?.();
6436
6488
  }
6437
6489
  if (!event.metaKey && !event.ctrlKey || event.altKey) {
6438
6490
  return;
@@ -6446,6 +6498,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6446
6498
  class: elementClasses
6447
6499
  });
6448
6500
  const editor = useEditor({
6501
+ ...mountElement ? { element: mountElement } : {},
6449
6502
  extensions: [
6450
6503
  Document.extend({
6451
6504
  content: documentContentSettings
@@ -6499,6 +6552,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6499
6552
  }
6500
6553
  },
6501
6554
  onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
6555
+ onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
6502
6556
  onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
6503
6557
  });
6504
6558
  useOnUpdate(() => {
@@ -6510,33 +6564,11 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6510
6564
  editor.commands.setContent(value, { emitUpdate: false });
6511
6565
  }
6512
6566
  }, [editor, value]);
6513
- return /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(
6514
- Wrapper,
6515
- {
6516
- containerRef,
6517
- editor,
6518
- sx,
6519
- onBlur,
6520
- className: wrapperClassName
6521
- },
6522
- /* @__PURE__ */ React100.createElement(EditorContent, { ref, editor })
6523
- ));
6567
+ if (mountElement) {
6568
+ return null;
6569
+ }
6570
+ return /* @__PURE__ */ React100.createElement(Box22, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React100.createElement(EditorContent, { ref, editor }));
6524
6571
  });
6525
- var Wrapper = ({ children, containerRef, editor, sx, onBlur, className }) => {
6526
- const wrappedChildren = /* @__PURE__ */ React100.createElement(Box22, { ref: containerRef, ...sx, className }, children);
6527
- return onBlur ? /* @__PURE__ */ React100.createElement(
6528
- ClickAwayListener,
6529
- {
6530
- onClickAway: (event) => {
6531
- if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
6532
- return;
6533
- }
6534
- onBlur?.();
6535
- }
6536
- },
6537
- wrappedChildren
6538
- ) : /* @__PURE__ */ React100.createElement(React100.Fragment, null, wrappedChildren);
6539
- };
6540
6572
  var useOnUpdate = (callback, dependencies) => {
6541
6573
  const hasMounted = useRef24(false);
6542
6574
  useEffect12(() => {
@@ -6634,7 +6666,7 @@ var SendToField = () => /* @__PURE__ */ React102.createElement(
6634
6666
  EmailField,
6635
6667
  {
6636
6668
  bind: "to",
6637
- label: __51("Send To", "elementor"),
6669
+ label: __51("Send to", "elementor"),
6638
6670
  placeholder: __51("Where should we send new submissions?", "elementor")
6639
6671
  }
6640
6672
  );
@@ -6642,7 +6674,7 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
6642
6674
  EmailField,
6643
6675
  {
6644
6676
  bind: "subject",
6645
- label: __51("Email Subject", "elementor"),
6677
+ label: __51("Email subject", "elementor"),
6646
6678
  placeholder: __51("New form submission", "elementor")
6647
6679
  }
6648
6680
  );
@@ -6660,7 +6692,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
6660
6692
  {
6661
6693
  bind: "from",
6662
6694
  label: __51("From email", "elementor"),
6663
- placeholder: __51("What email address should appear as the sender?", "elementor")
6695
+ placeholder: __51("What email should appear as the sender?", "elementor")
6664
6696
  }
6665
6697
  );
6666
6698
  var FromNameField = () => /* @__PURE__ */ React102.createElement(
@@ -6674,7 +6706,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
6674
6706
  var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: __51("Reply-to", "elementor") });
6675
6707
  var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: __51("Cc", "elementor") });
6676
6708
  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(
6709
+ 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
6710
  ChipsControl,
6679
6711
  {
6680
6712
  options: [
@@ -6698,31 +6730,663 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
6698
6730
  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
6731
  var EmailFormActionControl = createControl(() => {
6700
6732
  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)));
6733
+ 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
6734
  });
6703
6735
 
6704
- // src/components/promotions/display-conditions-control.tsx
6736
+ // src/controls/size-control/unstable-size-control.tsx
6737
+ import * as React108 from "react";
6738
+ import { sizePropTypeUtil as sizePropTypeUtil6 } from "@elementor/editor-props";
6739
+
6740
+ // src/controls/size-control/size-component.tsx
6741
+ import * as React107 from "react";
6742
+ import { useEffect as useEffect15 } from "react";
6743
+ import { useActiveBreakpoint as useActiveBreakpoint4 } from "@elementor/editor-responsive";
6744
+ import { Box as Box25, usePopupState as usePopupState9 } from "@elementor/ui";
6745
+
6746
+ // src/controls/size-control/size-field.tsx
6747
+ import * as React105 from "react";
6748
+ import { MathFunctionIcon as MathFunctionIcon3 } from "@elementor/icons";
6749
+ import { InputAdornment as InputAdornment5 } from "@elementor/ui";
6750
+
6751
+ // src/controls/size-control/sync/get-units.ts
6752
+ var getLengthUnits = () => {
6753
+ return window.elementor?.config?.size_units?.length ?? [];
6754
+ };
6755
+ var getAngleUnits = () => {
6756
+ return window.elementor?.config?.size_units?.angle ?? [];
6757
+ };
6758
+ var getTimeUnits = () => {
6759
+ return window.elementor?.config?.size_units?.time ?? [];
6760
+ };
6761
+ var getExtendedUnits = () => {
6762
+ return window.elementor?.config?.size_units?.extended_units ?? [];
6763
+ };
6764
+
6765
+ // src/controls/size-control/utils/is-extended-unit.ts
6766
+ var isExtendedUnit = (unit) => {
6767
+ const extendedUnits = getExtendedUnits();
6768
+ return extendedUnits.includes(unit);
6769
+ };
6770
+
6771
+ // src/controls/size-control/hooks/use-size-unit-keyboard.tsx
6772
+ var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
6773
+ var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
6774
+ const { appendKey, startsWith } = useTypingBuffer();
6775
+ const onUnitKeyDown = (event) => {
6776
+ if (units2.length === 0) {
6777
+ return;
6778
+ }
6779
+ const { key, altKey, ctrlKey, metaKey } = event;
6780
+ if (altKey || ctrlKey || metaKey) {
6781
+ return;
6782
+ }
6783
+ if (isExtendedUnit(unit) && isNumericValue(key)) {
6784
+ const [defaultUnit] = units2;
6785
+ if (defaultUnit) {
6786
+ onUnitChange(defaultUnit);
6787
+ }
6788
+ return;
6789
+ }
6790
+ if (!UNIT_KEY_PATTERN.test(key)) {
6791
+ return;
6792
+ }
6793
+ event.preventDefault();
6794
+ const updatedBuffer = appendKey(key.toLowerCase());
6795
+ const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
6796
+ if (matchedUnit) {
6797
+ onUnitChange(matchedUnit);
6798
+ }
6799
+ };
6800
+ return { onUnitKeyDown };
6801
+ };
6802
+ var isNumericValue = (value) => {
6803
+ if (typeof value === "number") {
6804
+ return !isNaN(value);
6805
+ }
6806
+ if (typeof value === "string") {
6807
+ return value.trim() !== "" && !isNaN(Number(value));
6808
+ }
6809
+ return false;
6810
+ };
6811
+
6812
+ // src/controls/size-control/hooks/use-size-value.ts
6813
+ import { useMemo as useMemo15 } from "react";
6814
+
6815
+ // src/controls/size-control/utils/resolve-size-value.ts
6816
+ var DEFAULT_SIZE2 = "";
6817
+ var EXTENDED_UNITS = {
6818
+ auto: "auto",
6819
+ custom: "custom"
6820
+ };
6821
+ var resolveSizeValue = (value, context) => {
6822
+ if (!value) {
6823
+ return value;
6824
+ }
6825
+ const { units: units2, defaultUnit } = context;
6826
+ const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
6827
+ if (unit === EXTENDED_UNITS.auto) {
6828
+ return { size: DEFAULT_SIZE2, unit };
6829
+ }
6830
+ if (unit === EXTENDED_UNITS.custom) {
6831
+ return { size: String(value.size ?? DEFAULT_SIZE2), unit };
6832
+ }
6833
+ return {
6834
+ size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
6835
+ unit
6836
+ };
6837
+ };
6838
+ var resolveSizeOnUnitChange = (size, unit) => {
6839
+ return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
6840
+ };
6841
+ var createDefaultSizeValue = (units2, defaultUnit) => {
6842
+ let [unit] = units2;
6843
+ if (defaultUnit !== void 0) {
6844
+ unit = resolveFallbackUnit(defaultUnit, units2);
6845
+ }
6846
+ return { size: DEFAULT_SIZE2, unit };
6847
+ };
6848
+ var resolveFallbackUnit = (unit, units2, defaultUnit) => {
6849
+ if (units2.includes(unit)) {
6850
+ return unit;
6851
+ }
6852
+ if (defaultUnit && units2.includes(defaultUnit)) {
6853
+ return defaultUnit;
6854
+ }
6855
+ return units2[0] ?? "";
6856
+ };
6857
+ var sanitizeSize = (size) => {
6858
+ if (typeof size === "number" && isNaN(size)) {
6859
+ return DEFAULT_SIZE2;
6860
+ }
6861
+ return size;
6862
+ };
6863
+
6864
+ // src/controls/size-control/hooks/use-size-value.ts
6865
+ var useSizeValue = ({
6866
+ value,
6867
+ setValue,
6868
+ units: units2,
6869
+ defaultUnit
6870
+ }) => {
6871
+ const resolvedValue = useMemo15(
6872
+ () => resolveSizeValue(value, { units: units2, defaultUnit }),
6873
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6874
+ [value?.size, value?.unit, defaultUnit]
6875
+ );
6876
+ const [sizeValue, setSizeValue] = useSyncExternalState({
6877
+ external: resolvedValue,
6878
+ setExternal: (newState, options, meta) => {
6879
+ if (newState !== null) {
6880
+ setValue(newState, options, meta);
6881
+ }
6882
+ },
6883
+ persistWhen: (next) => hasChanged(next, resolvedValue),
6884
+ fallback: () => createDefaultSizeValue(units2, defaultUnit)
6885
+ });
6886
+ const setSize = (newSize, isInputValid = true) => {
6887
+ if (isExtendedUnit(sizeValue.unit)) {
6888
+ return;
6889
+ }
6890
+ const trimmed = newSize.trim();
6891
+ const parsed = Number(trimmed);
6892
+ const newState = {
6893
+ ...sizeValue,
6894
+ size: trimmed && !isNaN(parsed) ? parsed : ""
6895
+ };
6896
+ setSizeValue(newState, void 0, { validation: () => isInputValid });
6897
+ };
6898
+ const setUnit = (unit) => {
6899
+ setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
6900
+ };
6901
+ return {
6902
+ size: sizeValue.size,
6903
+ unit: sizeValue.unit,
6904
+ setSize,
6905
+ setUnit
6906
+ };
6907
+ };
6908
+ var hasChanged = (next, current) => {
6909
+ return next?.size !== current?.size || next?.unit !== current?.unit;
6910
+ };
6911
+
6912
+ // src/controls/size-control/ui/size-input.tsx
6913
+ import * as React103 from "react";
6914
+ import { forwardRef as forwardRef11 } from "react";
6915
+ var SizeInput2 = forwardRef11(
6916
+ ({
6917
+ id,
6918
+ type,
6919
+ value,
6920
+ onBlur,
6921
+ onKeyUp,
6922
+ focused,
6923
+ disabled,
6924
+ onChange,
6925
+ onKeyDown,
6926
+ InputProps,
6927
+ inputProps,
6928
+ placeholder
6929
+ }, ref) => {
6930
+ return /* @__PURE__ */ React103.createElement(
6931
+ NumberInput,
6932
+ {
6933
+ id,
6934
+ ref,
6935
+ size: "tiny",
6936
+ fullWidth: true,
6937
+ type,
6938
+ value,
6939
+ placeholder,
6940
+ onKeyUp,
6941
+ focused,
6942
+ disabled,
6943
+ onKeyDown,
6944
+ onInput: onChange,
6945
+ onBlur,
6946
+ InputProps,
6947
+ inputProps,
6948
+ sx: getCursorStyle(InputProps?.readOnly ?? false)
6949
+ }
6950
+ );
6951
+ }
6952
+ );
6953
+ var getCursorStyle = (readOnly) => ({
6954
+ input: { cursor: readOnly ? "default !important" : void 0 }
6955
+ });
6956
+
6957
+ // src/controls/size-control/ui/unit-selector.tsx
6705
6958
  import * as React104 from "react";
6706
- import { useRef as useRef25 } from "react";
6959
+ import { useId as useId3 } from "react";
6960
+ import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
6961
+ import { bindMenu as bindMenu2, bindTrigger as bindTrigger6, Button as Button6, Menu as Menu3, styled as styled9, usePopupState as usePopupState8 } from "@elementor/ui";
6962
+ var menuItemContentStyles = {
6963
+ display: "flex",
6964
+ flexDirection: "column",
6965
+ justifyContent: "center"
6966
+ };
6967
+ var UnitSelector = ({
6968
+ value,
6969
+ isActive,
6970
+ onSelect,
6971
+ options,
6972
+ disabled,
6973
+ menuItemsAttributes = {},
6974
+ optionLabelOverrides = {}
6975
+ }) => {
6976
+ const popupState = usePopupState8({
6977
+ variant: "popover",
6978
+ popupId: useId3()
6979
+ });
6980
+ const handleMenuItemClick = (option) => {
6981
+ onSelect(option);
6982
+ popupState.close();
6983
+ };
6984
+ 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(
6985
+ MenuListItem7,
6986
+ {
6987
+ key: option,
6988
+ onClick: () => handleMenuItemClick(option),
6989
+ ...menuItemsAttributes?.[option],
6990
+ primaryTypographyProps: {
6991
+ variant: "caption",
6992
+ sx: {
6993
+ ...menuItemContentStyles,
6994
+ lineHeight: "1"
6995
+ }
6996
+ },
6997
+ menuItemTextProps: {
6998
+ sx: menuItemContentStyles
6999
+ }
7000
+ },
7001
+ optionLabelOverrides[option] ?? option.toUpperCase()
7002
+ ))));
7003
+ };
7004
+ var StyledButton2 = styled9(Button6, {
7005
+ shouldForwardProp: (prop) => prop !== "isActive"
7006
+ })(({ isActive, theme }) => ({
7007
+ color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
7008
+ font: "inherit",
7009
+ minWidth: "initial",
7010
+ textTransform: "uppercase"
7011
+ }));
7012
+
7013
+ // src/controls/size-control/utils/has-size-value.ts
7014
+ var hasSizeValue = (size) => {
7015
+ return Boolean(size) || size === 0;
7016
+ };
7017
+
7018
+ // src/controls/size-control/size-field.tsx
7019
+ var UNIT_DISPLAY_LABELS_OVERRIDES = {
7020
+ custom: /* @__PURE__ */ React105.createElement(MathFunctionIcon3, { fontSize: "tiny" })
7021
+ };
7022
+ var SizeField = ({
7023
+ value,
7024
+ focused,
7025
+ disabled,
7026
+ InputProps,
7027
+ defaultUnit,
7028
+ placeholder,
7029
+ onUnitChange,
7030
+ startIcon,
7031
+ ariaLabel,
7032
+ onKeyDown,
7033
+ setValue,
7034
+ onBlur,
7035
+ units: units2,
7036
+ min,
7037
+ unitSelectorProps
7038
+ }) => {
7039
+ const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
7040
+ const handleUnitChange = (newUnit) => {
7041
+ setUnit(newUnit);
7042
+ onUnitChange?.(newUnit);
7043
+ };
7044
+ const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
7045
+ const handleKeyDown = (event) => {
7046
+ onUnitKeyDown(event);
7047
+ onKeyDown?.(event);
7048
+ };
7049
+ const handleChange = (event) => {
7050
+ const newSize = event.target.value;
7051
+ const isInputValid = event.target.validity.valid;
7052
+ setSize(newSize, isInputValid);
7053
+ };
7054
+ const inputType = isExtendedUnit(unit) ? "text" : "number";
7055
+ return /* @__PURE__ */ React105.createElement(
7056
+ SizeInput2,
7057
+ {
7058
+ disabled,
7059
+ focused,
7060
+ type: inputType,
7061
+ value: size,
7062
+ placeholder,
7063
+ onBlur,
7064
+ onKeyDown: handleKeyDown,
7065
+ onChange: handleChange,
7066
+ InputProps: {
7067
+ ...InputProps,
7068
+ autoComplete: "off",
7069
+ readOnly: isExtendedUnit(unit),
7070
+ startAdornment: startIcon && /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "start", disabled }, startIcon),
7071
+ endAdornment: /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React105.createElement(
7072
+ UnitSelector,
7073
+ {
7074
+ options: units2,
7075
+ value: unit,
7076
+ onSelect: handleUnitChange,
7077
+ isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
7078
+ ...unitSelectorProps,
7079
+ optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
7080
+ }
7081
+ ))
7082
+ },
7083
+ inputProps: { min, step: "any", "arial-label": ariaLabel }
7084
+ }
7085
+ );
7086
+ };
7087
+
7088
+ // src/controls/size-control/ui/text-field-popover.tsx
7089
+ import * as React106 from "react";
7090
+ import { useEffect as useEffect14, useRef as useRef25 } from "react";
7091
+ import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
7092
+ import { MathFunctionIcon as MathFunctionIcon4 } from "@elementor/icons";
7093
+ import { bindPopover as bindPopover7, Popover as Popover7, TextField as TextField9 } from "@elementor/ui";
7094
+ import { __ as __52 } from "@wordpress/i18n";
7095
+ var SIZE10 = "tiny";
7096
+ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
7097
+ const inputRef = useRef25(null);
7098
+ useEffect14(() => {
7099
+ if (popupState.isOpen) {
7100
+ requestAnimationFrame(() => {
7101
+ if (inputRef.current) {
7102
+ inputRef.current.focus();
7103
+ }
7104
+ });
7105
+ }
7106
+ }, [popupState.isOpen]);
7107
+ const handleKeyDown = (event) => {
7108
+ if (event.key.toLowerCase() === "enter") {
7109
+ handleClose();
7110
+ }
7111
+ };
7112
+ const handleClose = () => {
7113
+ onClose?.();
7114
+ popupState.close();
7115
+ };
7116
+ return /* @__PURE__ */ React106.createElement(
7117
+ Popover7,
7118
+ {
7119
+ disablePortal: true,
7120
+ slotProps: {
7121
+ paper: {
7122
+ sx: {
7123
+ borderRadius: 2,
7124
+ width: anchorRef.current?.offsetWidth + "px"
7125
+ }
7126
+ }
7127
+ },
7128
+ ...bindPopover7(popupState),
7129
+ anchorOrigin: { vertical: "bottom", horizontal: "center" },
7130
+ transformOrigin: { vertical: "top", horizontal: "center" },
7131
+ onClose: handleClose
7132
+ },
7133
+ /* @__PURE__ */ React106.createElement(
7134
+ PopoverHeader4,
7135
+ {
7136
+ title: __52("CSS function", "elementor"),
7137
+ onClose: handleClose,
7138
+ icon: /* @__PURE__ */ React106.createElement(MathFunctionIcon4, { fontSize: SIZE10 })
7139
+ }
7140
+ ),
7141
+ /* @__PURE__ */ React106.createElement(
7142
+ TextField9,
7143
+ {
7144
+ value,
7145
+ onChange,
7146
+ onKeyDown: handleKeyDown,
7147
+ size: "tiny",
7148
+ type: "text",
7149
+ fullWidth: true,
7150
+ inputProps: {
7151
+ ref: inputRef
7152
+ },
7153
+ sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
7154
+ }
7155
+ )
7156
+ );
7157
+ };
7158
+
7159
+ // src/controls/size-control/size-component.tsx
7160
+ var SizeComponent = ({
7161
+ anchorRef,
7162
+ isUnitActive,
7163
+ SizeFieldWrapper = React107.Fragment,
7164
+ ...sizeFieldProps
7165
+ }) => {
7166
+ const popupState = usePopupState9({ variant: "popover" });
7167
+ const activeBreakpoint = useActiveBreakpoint4();
7168
+ const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
7169
+ const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
7170
+ useEffect15(() => {
7171
+ if (popupState && popupState.isOpen) {
7172
+ popupState.close();
7173
+ }
7174
+ }, [activeBreakpoint]);
7175
+ const handleCustomSizeChange = (event) => {
7176
+ sizeFieldProps.setValue({
7177
+ size: event.target.value,
7178
+ unit: EXTENDED_UNITS.custom
7179
+ });
7180
+ };
7181
+ const handleSizeFieldClick = (event) => {
7182
+ if (event.target.closest("input") && isCustomUnit) {
7183
+ popupState.open(anchorRef?.current);
7184
+ }
7185
+ };
7186
+ const handleUnitChange = (unit) => {
7187
+ if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
7188
+ popupState.open(anchorRef.current);
7189
+ }
7190
+ };
7191
+ const popupAttributes = {
7192
+ "aria-controls": popupState.isOpen ? popupState.popupId : void 0,
7193
+ "aria-haspopup": true
7194
+ };
7195
+ return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(Box25, null, /* @__PURE__ */ React107.createElement(
7196
+ SizeField,
7197
+ {
7198
+ focused: popupState.isOpen ? true : void 0,
7199
+ onUnitChange: handleUnitChange,
7200
+ InputProps: {
7201
+ ...popupAttributes,
7202
+ onClick: handleSizeFieldClick
7203
+ },
7204
+ unitSelectorProps: {
7205
+ menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
7206
+ isActive: isUnitActive
7207
+ },
7208
+ ...sizeFieldProps
7209
+ }
7210
+ ))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
7211
+ TextFieldPopover2,
7212
+ {
7213
+ popupState,
7214
+ anchorRef,
7215
+ value: String(sizeFieldProps?.value?.size ?? ""),
7216
+ onChange: handleCustomSizeChange,
7217
+ onClose: () => {
7218
+ }
7219
+ }
7220
+ ));
7221
+ };
7222
+
7223
+ // src/controls/size-control/utils/resolve-bound-prop-value.ts
7224
+ import { sizePropTypeUtil as sizePropTypeUtil5 } from "@elementor/editor-props";
7225
+ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
7226
+ let sizeValue = null;
7227
+ if (validateSizeValue(value)) {
7228
+ sizeValue = value;
7229
+ } else if (validateSizeValue(boundPropPlaceholder)) {
7230
+ sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
7231
+ }
7232
+ return {
7233
+ sizeValue,
7234
+ isUnitHighlighted: shouldHighlightUnit(value),
7235
+ placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
7236
+ };
7237
+ };
7238
+ var validateSizeValue = (value) => {
7239
+ if (!value) {
7240
+ return false;
7241
+ }
7242
+ const sizePropValue = sizePropTypeUtil5.create(value);
7243
+ return sizePropTypeUtil5.isValid(sizePropValue);
7244
+ };
7245
+ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
7246
+ if (propPlaceholder) {
7247
+ return propPlaceholder;
7248
+ }
7249
+ const size = boundPropPlaceholder?.size;
7250
+ if (size === void 0) {
7251
+ return void 0;
7252
+ }
7253
+ if (typeof size === "number") {
7254
+ return size.toString();
7255
+ }
7256
+ return size;
7257
+ };
7258
+ var shouldHighlightUnit = (value) => {
7259
+ if (!value) {
7260
+ return false;
7261
+ }
7262
+ if (value.unit === EXTENDED_UNITS.auto) {
7263
+ return true;
7264
+ }
7265
+ return hasSizeValue(value.size);
7266
+ };
7267
+
7268
+ // src/controls/size-control/utils/settings/get-prop-type-settings.ts
7269
+ var getPropTypeSettings = (propType) => {
7270
+ return propType.settings;
7271
+ };
7272
+
7273
+ // src/controls/size-control/utils/settings/get-default-unit.ts
7274
+ var getDefaultUnit = (propType) => {
7275
+ return getPropTypeSettings(propType)?.default_unit;
7276
+ };
7277
+
7278
+ // src/controls/size-control/utils/settings/get-size-units.ts
7279
+ var getVariantUnits = (variant) => {
7280
+ const map = {
7281
+ length: getLengthUnits,
7282
+ angle: getAngleUnits,
7283
+ time: getTimeUnits
7284
+ };
7285
+ return map[variant]();
7286
+ };
7287
+ var getSettingsUnits = (propType) => {
7288
+ return getPropTypeSettings(propType)?.units;
7289
+ };
7290
+ var getSizeUnits = (propType, variant) => {
7291
+ return getSettingsUnits(propType) ?? getVariantUnits(variant);
7292
+ };
7293
+
7294
+ // src/controls/size-control/utils/should-nullify-value.ts
7295
+ var conditions = [
7296
+ (value) => value?.size === null || value?.size === void 0 || value?.size === "",
7297
+ (value) => value?.unit !== EXTENDED_UNITS.auto,
7298
+ (value) => value?.unit !== EXTENDED_UNITS.custom
7299
+ ];
7300
+ var shouldNullifyValue = (value) => {
7301
+ return conditions.every((condition) => condition(value));
7302
+ };
7303
+
7304
+ // src/controls/size-control/unstable-size-control.tsx
7305
+ var UnstableSizeControl = createControl(
7306
+ ({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
7307
+ const {
7308
+ value,
7309
+ setValue,
7310
+ propType,
7311
+ placeholder: boundPropPlaceholder,
7312
+ restoreValue
7313
+ } = useBoundProp(sizePropTypeUtil6);
7314
+ const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
7315
+ value,
7316
+ boundPropPlaceholder,
7317
+ propPlaceholder
7318
+ );
7319
+ const units2 = getSizeUnits(propType, variant);
7320
+ const defaultUnit = getDefaultUnit(propType);
7321
+ const handleBlur = () => {
7322
+ const isRequired = propType.settings.required;
7323
+ if (shouldNullifyValue(value) && !isRequired) {
7324
+ setValue(null);
7325
+ }
7326
+ if (isRequired) {
7327
+ restoreValue();
7328
+ }
7329
+ };
7330
+ const handleChange = (newValue, options, meta) => {
7331
+ setValue(newValue, options, {
7332
+ ...meta,
7333
+ validation: () => {
7334
+ if (propType.settings.required) {
7335
+ return newValue.size !== "";
7336
+ }
7337
+ return meta?.validation ? meta.validation(newValue) : true;
7338
+ }
7339
+ });
7340
+ };
7341
+ return /* @__PURE__ */ React108.createElement(
7342
+ SizeComponent,
7343
+ {
7344
+ units: units2,
7345
+ value: sizeValue,
7346
+ anchorRef,
7347
+ placeholder,
7348
+ defaultUnit,
7349
+ isUnitActive: isUnitHighlighted,
7350
+ onBlur: handleBlur,
7351
+ setValue: handleChange,
7352
+ SizeFieldWrapper: ControlActions,
7353
+ startIcon,
7354
+ ariaLabel,
7355
+ min
7356
+ }
7357
+ );
7358
+ }
7359
+ );
7360
+
7361
+ // src/components/promotions/display-conditions-control.tsx
7362
+ import * as React110 from "react";
7363
+ import { useRef as useRef26 } from "react";
6707
7364
  import { SitemapIcon } from "@elementor/icons";
6708
7365
  import { IconButton as IconButton8, Stack as Stack18, Tooltip as Tooltip9 } from "@elementor/ui";
6709
- import { __ as __52 } from "@wordpress/i18n";
7366
+ import { __ as __53 } from "@wordpress/i18n";
6710
7367
 
6711
7368
  // src/components/promotions/promotion-trigger.tsx
6712
- import * as React103 from "react";
6713
- import { forwardRef as forwardRef11, useImperativeHandle, useState as useState17 } from "react";
7369
+ import * as React109 from "react";
7370
+ import { forwardRef as forwardRef12, useCallback as useCallback4, useImperativeHandle, useState as useState17 } from "react";
6714
7371
  import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
6715
- import { Box as Box25 } from "@elementor/ui";
7372
+ import { Box as Box26 } from "@elementor/ui";
6716
7373
  function getV4Promotion(key) {
6717
7374
  return window.elementor?.config?.v4Promotions?.[key];
6718
7375
  }
6719
- var PromotionTrigger = forwardRef11(
6720
- ({ promotionKey, children }, ref) => {
7376
+ var PromotionTrigger = forwardRef12(
7377
+ ({ promotionKey, children, trackingData }, ref) => {
6721
7378
  const [isOpen, setIsOpen] = useState17(false);
6722
7379
  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(
7380
+ const toggle = useCallback4(() => {
7381
+ setIsOpen((prev) => {
7382
+ if (!prev) {
7383
+ trackViewPromotion(trackingData);
7384
+ }
7385
+ return !prev;
7386
+ });
7387
+ }, [trackingData]);
7388
+ useImperativeHandle(ref, () => ({ toggle }), [toggle]);
7389
+ return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
6726
7390
  PromotionInfotip,
6727
7391
  {
6728
7392
  title: promotion.title,
@@ -6733,10 +7397,11 @@ var PromotionTrigger = forwardRef11(
6733
7397
  onClose: (e) => {
6734
7398
  e.stopPropagation();
6735
7399
  setIsOpen(false);
6736
- }
7400
+ },
7401
+ onCtaClick: () => trackUpgradePromotionClick(trackingData)
6737
7402
  },
6738
- /* @__PURE__ */ React103.createElement(
6739
- Box25,
7403
+ /* @__PURE__ */ React109.createElement(
7404
+ Box26,
6740
7405
  {
6741
7406
  onClick: (e) => {
6742
7407
  e.stopPropagation();
@@ -6744,17 +7409,18 @@ var PromotionTrigger = forwardRef11(
6744
7409
  },
6745
7410
  sx: { cursor: "pointer", display: "inline-flex" }
6746
7411
  },
6747
- children ?? /* @__PURE__ */ React103.createElement(PromotionChip2, null)
7412
+ children ?? /* @__PURE__ */ React109.createElement(PromotionChip2, null)
6748
7413
  )
6749
7414
  ));
6750
7415
  }
6751
7416
  );
6752
7417
 
6753
7418
  // src/components/promotions/display-conditions-control.tsx
6754
- var ARIA_LABEL = __52("Display Conditions", "elementor");
7419
+ var ARIA_LABEL = __53("Display Conditions", "elementor");
7420
+ var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
6755
7421
  var DisplayConditionsControl = createControl(() => {
6756
- const triggerRef = useRef25(null);
6757
- return /* @__PURE__ */ React104.createElement(
7422
+ const triggerRef = useRef26(null);
7423
+ return /* @__PURE__ */ React110.createElement(
6758
7424
  Stack18,
6759
7425
  {
6760
7426
  direction: "row",
@@ -6764,8 +7430,8 @@ var DisplayConditionsControl = createControl(() => {
6764
7430
  alignItems: "center"
6765
7431
  }
6766
7432
  },
6767
- /* @__PURE__ */ React104.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
6768
- /* @__PURE__ */ React104.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React104.createElement(
7433
+ /* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
7434
+ /* @__PURE__ */ React110.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
6769
7435
  IconButton8,
6770
7436
  {
6771
7437
  size: "tiny",
@@ -6778,21 +7444,22 @@ var DisplayConditionsControl = createControl(() => {
6778
7444
  borderRadius: 1
6779
7445
  }
6780
7446
  },
6781
- /* @__PURE__ */ React104.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
7447
+ /* @__PURE__ */ React110.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
6782
7448
  ))
6783
7449
  );
6784
7450
  });
6785
7451
 
6786
7452
  // src/components/promotions/attributes-control.tsx
6787
- import * as React105 from "react";
6788
- import { useRef as useRef26 } from "react";
7453
+ import * as React111 from "react";
7454
+ import { useRef as useRef27 } from "react";
6789
7455
  import { PlusIcon as PlusIcon3 } from "@elementor/icons";
6790
7456
  import { Stack as Stack19, Tooltip as Tooltip10 } from "@elementor/ui";
6791
- import { __ as __53 } from "@wordpress/i18n";
6792
- var ARIA_LABEL2 = __53("Attributes", "elementor");
7457
+ import { __ as __54 } from "@wordpress/i18n";
7458
+ var ARIA_LABEL2 = __54("Attributes", "elementor");
7459
+ var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
6793
7460
  var AttributesControl = createControl(() => {
6794
- const triggerRef = useRef26(null);
6795
- return /* @__PURE__ */ React105.createElement(
7461
+ const triggerRef = useRef27(null);
7462
+ return /* @__PURE__ */ React111.createElement(
6796
7463
  Stack19,
6797
7464
  {
6798
7465
  direction: "row",
@@ -6802,8 +7469,8 @@ var AttributesControl = createControl(() => {
6802
7469
  alignItems: "center"
6803
7470
  }
6804
7471
  },
6805
- /* @__PURE__ */ React105.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
6806
- /* @__PURE__ */ React105.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React105.createElement(
7472
+ /* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
7473
+ /* @__PURE__ */ React111.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
6807
7474
  PlusIcon3,
6808
7475
  {
6809
7476
  "aria-label": ARIA_LABEL2,
@@ -6817,30 +7484,30 @@ var AttributesControl = createControl(() => {
6817
7484
  });
6818
7485
 
6819
7486
  // src/components/icon-buttons/clear-icon-button.tsx
6820
- import * as React106 from "react";
7487
+ import * as React112 from "react";
6821
7488
  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 }) => ({
7489
+ import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip11 } from "@elementor/ui";
7490
+ var CustomIconButton = styled10(IconButton9)(({ theme }) => ({
6824
7491
  width: theme.spacing(2.5),
6825
7492
  height: theme.spacing(2.5)
6826
7493
  }));
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 })));
7494
+ 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
7495
 
6829
7496
  // src/components/repeater/repeater.tsx
6830
- import * as React107 from "react";
6831
- import { useEffect as useEffect14, useState as useState18 } from "react";
7497
+ import * as React113 from "react";
7498
+ import { useEffect as useEffect16, useState as useState18 } from "react";
6832
7499
  import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon4, XIcon as XIcon4 } from "@elementor/icons";
6833
7500
  import {
6834
- bindPopover as bindPopover7,
6835
- bindTrigger as bindTrigger6,
6836
- Box as Box26,
7501
+ bindPopover as bindPopover8,
7502
+ bindTrigger as bindTrigger7,
7503
+ Box as Box27,
6837
7504
  IconButton as IconButton10,
6838
7505
  Infotip as Infotip4,
6839
7506
  Tooltip as Tooltip12,
6840
- usePopupState as usePopupState8
7507
+ usePopupState as usePopupState10
6841
7508
  } from "@elementor/ui";
6842
- import { __ as __54 } from "@wordpress/i18n";
6843
- var SIZE10 = "tiny";
7509
+ import { __ as __55 } from "@wordpress/i18n";
7510
+ var SIZE11 = "tiny";
6844
7511
  var EMPTY_OPEN_ITEM2 = -1;
6845
7512
  var Repeater3 = ({
6846
7513
  label,
@@ -6920,20 +7587,20 @@ var Repeater3 = ({
6920
7587
  };
6921
7588
  const isButtonDisabled = disabled || disableAddItemButton;
6922
7589
  const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
6923
- const addButton = /* @__PURE__ */ React107.createElement(
7590
+ const addButton = /* @__PURE__ */ React113.createElement(
6924
7591
  IconButton10,
6925
7592
  {
6926
- size: SIZE10,
7593
+ size: SIZE11,
6927
7594
  sx: {
6928
7595
  ml: "auto"
6929
7596
  },
6930
7597
  disabled: isButtonDisabled,
6931
7598
  onClick: addRepeaterItem,
6932
- "aria-label": __54("Add item", "elementor")
7599
+ "aria-label": __55("Add item", "elementor")
6933
7600
  },
6934
- /* @__PURE__ */ React107.createElement(PlusIcon4, { fontSize: SIZE10 })
7601
+ /* @__PURE__ */ React113.createElement(PlusIcon4, { fontSize: SIZE11 })
6935
7602
  );
6936
- return /* @__PURE__ */ React107.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React107.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React107.createElement(
7603
+ return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
6937
7604
  Infotip4,
6938
7605
  {
6939
7606
  placement: "right",
@@ -6941,20 +7608,20 @@ var Repeater3 = ({
6941
7608
  color: "secondary",
6942
7609
  slotProps: { popper: { sx: { width: 300 } } }
6943
7610
  },
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) => {
7611
+ /* @__PURE__ */ React113.createElement(Box27, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
7612
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6946
7613
  const index = uniqueKeys.indexOf(key);
6947
7614
  const value = items2[index];
6948
7615
  if (!value) {
6949
7616
  return null;
6950
7617
  }
6951
- return /* @__PURE__ */ React107.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React107.createElement(
7618
+ return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
6952
7619
  RepeaterItem,
6953
7620
  {
6954
7621
  disabled,
6955
7622
  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 })),
7623
+ label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
7624
+ startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
6958
7625
  removeItem: () => removeRepeaterItem(index),
6959
7626
  duplicateItem: () => duplicateRepeaterItem(index),
6960
7627
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
@@ -6966,7 +7633,7 @@ var Repeater3 = ({
6966
7633
  actions: itemSettings.actions,
6967
7634
  value
6968
7635
  },
6969
- (props) => /* @__PURE__ */ React107.createElement(
7636
+ (props) => /* @__PURE__ */ React113.createElement(
6970
7637
  itemSettings.Content,
6971
7638
  {
6972
7639
  ...props,
@@ -6996,27 +7663,27 @@ var RepeaterItem = ({
6996
7663
  value
6997
7664
  }) => {
6998
7665
  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(
7666
+ const duplicateLabel = __55("Duplicate", "elementor");
7667
+ const toggleLabel = propDisabled ? __55("Show", "elementor") : __55("Hide", "elementor");
7668
+ const removeLabel = __55("Remove", "elementor");
7669
+ return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
7003
7670
  RepeaterTag,
7004
7671
  {
7005
7672
  disabled,
7006
7673
  label,
7007
7674
  ref: setRef,
7008
- "aria-label": __54("Open item", "elementor"),
7009
- ...bindTrigger6(popoverState),
7675
+ "aria-label": __55("Open item", "elementor"),
7676
+ ...bindTrigger7(popoverState),
7010
7677
  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 }))))
7678
+ 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
7679
  }
7013
- ), /* @__PURE__ */ React107.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React107.createElement(Box26, null, children({ anchorEl: ref }))));
7680
+ ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(Box27, null, children({ anchorEl: ref }))));
7014
7681
  };
7015
7682
  var usePopover = (openOnMount, onOpen) => {
7016
7683
  const [ref, setRef] = useState18(null);
7017
- const popoverState = usePopupState8({ variant: "popover" });
7018
- const popoverProps = bindPopover7(popoverState);
7019
- useEffect14(() => {
7684
+ const popoverState = usePopupState10({ variant: "popover" });
7685
+ const popoverProps = bindPopover8(popoverState);
7686
+ useEffect16(() => {
7020
7687
  if (openOnMount && ref) {
7021
7688
  popoverState.open(ref);
7022
7689
  onOpen?.();
@@ -7031,8 +7698,8 @@ var usePopover = (openOnMount, onOpen) => {
7031
7698
  };
7032
7699
 
7033
7700
  // 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";
7701
+ import * as React115 from "react";
7702
+ import { useMemo as useMemo16, useRef as useRef29, useState as useState19 } from "react";
7036
7703
  import { getContainer, getElementSetting } from "@elementor/editor-elements";
7037
7704
  import {
7038
7705
  BoldIcon,
@@ -7045,23 +7712,23 @@ import {
7045
7712
  UnderlineIcon
7046
7713
  } from "@elementor/icons";
7047
7714
  import {
7048
- Box as Box27,
7715
+ Box as Box28,
7049
7716
  IconButton as IconButton11,
7050
7717
  ToggleButton as ToggleButton3,
7051
7718
  ToggleButtonGroup as ToggleButtonGroup2,
7052
7719
  toggleButtonGroupClasses,
7053
7720
  Tooltip as Tooltip14,
7054
- usePopupState as usePopupState9
7721
+ usePopupState as usePopupState11
7055
7722
  } from "@elementor/ui";
7056
7723
  import { useEditorState } from "@tiptap/react";
7057
- import { __ as __56 } from "@wordpress/i18n";
7724
+ import { __ as __57 } from "@wordpress/i18n";
7058
7725
 
7059
7726
  // src/components/url-popover.tsx
7060
- import * as React108 from "react";
7061
- import { useEffect as useEffect15, useRef as useRef27 } from "react";
7727
+ import * as React114 from "react";
7728
+ import { useEffect as useEffect17, useRef as useRef28 } from "react";
7062
7729
  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";
7730
+ import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack20, TextField as TextField10, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
7731
+ import { __ as __56 } from "@wordpress/i18n";
7065
7732
  var UrlPopover = ({
7066
7733
  popupState,
7067
7734
  restoreValue,
@@ -7071,8 +7738,8 @@ var UrlPopover = ({
7071
7738
  openInNewTab,
7072
7739
  onToggleNewTab
7073
7740
  }) => {
7074
- const inputRef = useRef27(null);
7075
- useEffect15(() => {
7741
+ const inputRef = useRef28(null);
7742
+ useEffect17(() => {
7076
7743
  if (popupState.isOpen) {
7077
7744
  requestAnimationFrame(() => inputRef.current?.focus());
7078
7745
  }
@@ -7081,41 +7748,41 @@ var UrlPopover = ({
7081
7748
  restoreValue();
7082
7749
  popupState.close();
7083
7750
  };
7084
- return /* @__PURE__ */ React108.createElement(
7085
- Popover7,
7751
+ return /* @__PURE__ */ React114.createElement(
7752
+ Popover8,
7086
7753
  {
7087
7754
  slotProps: {
7088
7755
  paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
7089
7756
  },
7090
- ...bindPopover8(popupState),
7757
+ ...bindPopover9(popupState),
7091
7758
  anchorOrigin: { vertical: "top", horizontal: "left" },
7092
7759
  transformOrigin: { vertical: "top", horizontal: "left" },
7093
7760
  onClose: handleClose
7094
7761
  },
7095
- /* @__PURE__ */ React108.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React108.createElement(
7096
- TextField9,
7762
+ /* @__PURE__ */ React114.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
7763
+ TextField10,
7097
7764
  {
7098
7765
  value,
7099
7766
  onChange,
7100
7767
  size: "tiny",
7101
7768
  fullWidth: true,
7102
- placeholder: __55("Type a URL", "elementor"),
7769
+ placeholder: __56("Type a URL", "elementor"),
7103
7770
  inputProps: { ref: inputRef },
7104
7771
  color: "secondary",
7105
7772
  InputProps: { sx: { borderRadius: "8px" } },
7106
7773
  onKeyUp: (event) => event.key === "Enter" && handleClose()
7107
7774
  }
7108
- ), /* @__PURE__ */ React108.createElement(Tooltip13, { title: __55("Open in a new tab", "elementor") }, /* @__PURE__ */ React108.createElement(
7775
+ ), /* @__PURE__ */ React114.createElement(Tooltip13, { title: __56("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
7109
7776
  ToggleButton2,
7110
7777
  {
7111
7778
  size: "tiny",
7112
7779
  value: "newTab",
7113
7780
  selected: openInNewTab,
7114
7781
  onClick: onToggleNewTab,
7115
- "aria-label": __55("Open in a new tab", "elementor"),
7782
+ "aria-label": __56("Open in a new tab", "elementor"),
7116
7783
  sx: { borderRadius: "8px" }
7117
7784
  },
7118
- /* @__PURE__ */ React108.createElement(ExternalLinkIcon, { fontSize: "tiny" })
7785
+ /* @__PURE__ */ React114.createElement(ExternalLinkIcon, { fontSize: "tiny" })
7119
7786
  )))
7120
7787
  );
7121
7788
  };
@@ -7124,14 +7791,14 @@ var UrlPopover = ({
7124
7791
  var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7125
7792
  const [urlValue, setUrlValue] = useState19("");
7126
7793
  const [openInNewTab, setOpenInNewTab] = useState19(false);
7127
- const toolbarRef = useRef28(null);
7128
- const linkPopupState = usePopupState9({ variant: "popover" });
7794
+ const toolbarRef = useRef29(null);
7795
+ const linkPopupState = usePopupState11({ variant: "popover" });
7129
7796
  const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
7130
7797
  const editorState = useEditorState({
7131
7798
  editor,
7132
7799
  selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
7133
7800
  });
7134
- const formatButtonsList = useMemo15(() => {
7801
+ const formatButtonsList = useMemo16(() => {
7135
7802
  const buttons = Object.values(formatButtons);
7136
7803
  if (isElementClickable) {
7137
7804
  return buttons.filter((button) => button.action !== "link");
@@ -7168,11 +7835,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7168
7835
  }
7169
7836
  linkPopupState.close();
7170
7837
  };
7171
- React109.useEffect(() => {
7838
+ React115.useEffect(() => {
7172
7839
  editor?.commands?.focus();
7173
7840
  }, [editor]);
7174
- return /* @__PURE__ */ React109.createElement(
7175
- Box27,
7841
+ return /* @__PURE__ */ React115.createElement(
7842
+ Box28,
7176
7843
  {
7177
7844
  ref: toolbarRef,
7178
7845
  sx: {
@@ -7188,8 +7855,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7188
7855
  ...sx
7189
7856
  }
7190
7857
  },
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(
7858
+ /* @__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)),
7859
+ /* @__PURE__ */ React115.createElement(
7193
7860
  ToggleButtonGroup2,
7194
7861
  {
7195
7862
  value: editorState,
@@ -7211,7 +7878,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7211
7878
  }
7212
7879
  }
7213
7880
  },
7214
- formatButtonsList.map((button) => /* @__PURE__ */ React109.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React109.createElement(
7881
+ formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
7215
7882
  ToggleButton3,
7216
7883
  {
7217
7884
  value: button.action,
@@ -7229,7 +7896,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7229
7896
  button.icon
7230
7897
  )))
7231
7898
  ),
7232
- /* @__PURE__ */ React109.createElement(
7899
+ /* @__PURE__ */ React115.createElement(
7233
7900
  UrlPopover,
7234
7901
  {
7235
7902
  popupState: linkPopupState,
@@ -7252,64 +7919,64 @@ var checkIfElementIsClickable = (elementId) => {
7252
7919
  };
7253
7920
  var toolbarButtons = {
7254
7921
  clear: {
7255
- label: __56("Clear", "elementor"),
7256
- icon: /* @__PURE__ */ React109.createElement(MinusIcon2, { fontSize: "tiny" }),
7922
+ label: __57("Clear", "elementor"),
7923
+ icon: /* @__PURE__ */ React115.createElement(MinusIcon2, { fontSize: "tiny" }),
7257
7924
  action: "clear",
7258
7925
  method: (editor) => {
7259
7926
  editor.chain().focus().clearNodes().unsetAllMarks().run();
7260
7927
  }
7261
7928
  },
7262
7929
  bold: {
7263
- label: __56("Bold", "elementor"),
7264
- icon: /* @__PURE__ */ React109.createElement(BoldIcon, { fontSize: "tiny" }),
7930
+ label: __57("Bold", "elementor"),
7931
+ icon: /* @__PURE__ */ React115.createElement(BoldIcon, { fontSize: "tiny" }),
7265
7932
  action: "bold",
7266
7933
  method: (editor) => {
7267
7934
  editor.chain().focus().toggleBold().run();
7268
7935
  }
7269
7936
  },
7270
7937
  italic: {
7271
- label: __56("Italic", "elementor"),
7272
- icon: /* @__PURE__ */ React109.createElement(ItalicIcon, { fontSize: "tiny" }),
7938
+ label: __57("Italic", "elementor"),
7939
+ icon: /* @__PURE__ */ React115.createElement(ItalicIcon, { fontSize: "tiny" }),
7273
7940
  action: "italic",
7274
7941
  method: (editor) => {
7275
7942
  editor.chain().focus().toggleItalic().run();
7276
7943
  }
7277
7944
  },
7278
7945
  underline: {
7279
- label: __56("Underline", "elementor"),
7280
- icon: /* @__PURE__ */ React109.createElement(UnderlineIcon, { fontSize: "tiny" }),
7946
+ label: __57("Underline", "elementor"),
7947
+ icon: /* @__PURE__ */ React115.createElement(UnderlineIcon, { fontSize: "tiny" }),
7281
7948
  action: "underline",
7282
7949
  method: (editor) => {
7283
7950
  editor.chain().focus().toggleUnderline().run();
7284
7951
  }
7285
7952
  },
7286
7953
  strike: {
7287
- label: __56("Strikethrough", "elementor"),
7288
- icon: /* @__PURE__ */ React109.createElement(StrikethroughIcon, { fontSize: "tiny" }),
7954
+ label: __57("Strikethrough", "elementor"),
7955
+ icon: /* @__PURE__ */ React115.createElement(StrikethroughIcon, { fontSize: "tiny" }),
7289
7956
  action: "strike",
7290
7957
  method: (editor) => {
7291
7958
  editor.chain().focus().toggleStrike().run();
7292
7959
  }
7293
7960
  },
7294
7961
  superscript: {
7295
- label: __56("Superscript", "elementor"),
7296
- icon: /* @__PURE__ */ React109.createElement(SuperscriptIcon, { fontSize: "tiny" }),
7962
+ label: __57("Superscript", "elementor"),
7963
+ icon: /* @__PURE__ */ React115.createElement(SuperscriptIcon, { fontSize: "tiny" }),
7297
7964
  action: "superscript",
7298
7965
  method: (editor) => {
7299
7966
  editor.chain().focus().toggleSuperscript().run();
7300
7967
  }
7301
7968
  },
7302
7969
  subscript: {
7303
- label: __56("Subscript", "elementor"),
7304
- icon: /* @__PURE__ */ React109.createElement(SubscriptIcon, { fontSize: "tiny" }),
7970
+ label: __57("Subscript", "elementor"),
7971
+ icon: /* @__PURE__ */ React115.createElement(SubscriptIcon, { fontSize: "tiny" }),
7305
7972
  action: "subscript",
7306
7973
  method: (editor) => {
7307
7974
  editor.chain().focus().toggleSubscript().run();
7308
7975
  }
7309
7976
  },
7310
7977
  link: {
7311
- label: __56("Link", "elementor"),
7312
- icon: /* @__PURE__ */ React109.createElement(LinkIcon3, { fontSize: "tiny" }),
7978
+ label: __57("Link", "elementor"),
7979
+ icon: /* @__PURE__ */ React115.createElement(LinkIcon3, { fontSize: "tiny" }),
7313
7980
  action: "link",
7314
7981
  method: null
7315
7982
  }
@@ -7318,13 +7985,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
7318
7985
  var possibleFormats = Object.keys(formatButtons);
7319
7986
 
7320
7987
  // src/components/size/unstable-size-field.tsx
7321
- import * as React112 from "react";
7322
- import { InputAdornment as InputAdornment5 } from "@elementor/ui";
7988
+ import * as React118 from "react";
7989
+ import { InputAdornment as InputAdornment6 } from "@elementor/ui";
7323
7990
 
7324
7991
  // src/hooks/use-size-value.ts
7325
7992
  var DEFAULT_UNIT2 = "px";
7326
- var DEFAULT_SIZE2 = "";
7327
- var useSizeValue = (externalValue, onChange, defaultUnit) => {
7993
+ var DEFAULT_SIZE3 = "";
7994
+ var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
7328
7995
  const [sizeValue, setSizeValue] = useSyncExternalState({
7329
7996
  external: externalValue,
7330
7997
  setExternal: (newState) => {
@@ -7333,7 +8000,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
7333
8000
  }
7334
8001
  },
7335
8002
  persistWhen: (newState) => differsFromExternal(newState, externalValue),
7336
- fallback: () => ({ size: DEFAULT_SIZE2, unit: defaultUnit ?? DEFAULT_UNIT2 })
8003
+ fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
7337
8004
  });
7338
8005
  const setSize = (value) => {
7339
8006
  const newState = {
@@ -7361,44 +8028,44 @@ var differsFromExternal = (newState, externalState) => {
7361
8028
  };
7362
8029
 
7363
8030
  // 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 = {
8031
+ import * as React116 from "react";
8032
+ import { useId as useId4 } from "react";
8033
+ import { MenuListItem as MenuListItem8 } from "@elementor/editor-ui";
8034
+ import { bindMenu as bindMenu3, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu4, styled as styled11, usePopupState as usePopupState12 } from "@elementor/ui";
8035
+ var menuItemContentStyles2 = {
7369
8036
  display: "flex",
7370
8037
  flexDirection: "column",
7371
8038
  justifyContent: "center"
7372
8039
  };
7373
8040
  var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
7374
- const popupState = usePopupState10({
8041
+ const popupState = usePopupState12({
7375
8042
  variant: "popover",
7376
- popupId: useId3()
8043
+ popupId: useId4()
7377
8044
  });
7378
8045
  const handleMenuItemClick = (index) => {
7379
8046
  onClick(options[index]);
7380
8047
  popupState.close();
7381
8048
  };
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,
8049
+ 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(
8050
+ MenuListItem8,
7384
8051
  {
7385
8052
  key: option,
7386
8053
  onClick: () => handleMenuItemClick(index),
7387
8054
  primaryTypographyProps: {
7388
8055
  variant: "caption",
7389
8056
  sx: {
7390
- ...menuItemContentStyles,
8057
+ ...menuItemContentStyles2,
7391
8058
  lineHeight: "1"
7392
8059
  }
7393
8060
  },
7394
8061
  menuItemTextProps: {
7395
- sx: menuItemContentStyles
8062
+ sx: menuItemContentStyles2
7396
8063
  }
7397
8064
  },
7398
8065
  option.toUpperCase()
7399
8066
  ))));
7400
8067
  };
7401
- var StyledButton2 = styled10(Button6, {
8068
+ var StyledButton3 = styled11(Button7, {
7402
8069
  shouldForwardProp: (prop) => prop !== "isPrimaryColor"
7403
8070
  })(({ isPrimaryColor, theme }) => ({
7404
8071
  color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
@@ -7408,11 +8075,11 @@ var StyledButton2 = styled10(Button6, {
7408
8075
  }));
7409
8076
 
7410
8077
  // src/components/size/unstable-size-input.tsx
7411
- import * as React111 from "react";
7412
- import { forwardRef as forwardRef12 } from "react";
7413
- var UnstableSizeInput = forwardRef12(
8078
+ import * as React117 from "react";
8079
+ import { forwardRef as forwardRef13 } from "react";
8080
+ var UnstableSizeInput = forwardRef13(
7414
8081
  ({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
7415
- return /* @__PURE__ */ React111.createElement(
8082
+ return /* @__PURE__ */ React117.createElement(
7416
8083
  NumberInput,
7417
8084
  {
7418
8085
  ref,
@@ -7427,12 +8094,12 @@ var UnstableSizeInput = forwardRef12(
7427
8094
  onInput: onChange,
7428
8095
  onBlur,
7429
8096
  InputProps,
7430
- sx: getCursorStyle(InputProps?.readOnly ?? false)
8097
+ sx: getCursorStyle2(InputProps?.readOnly ?? false)
7431
8098
  }
7432
8099
  );
7433
8100
  }
7434
8101
  );
7435
- var getCursorStyle = (readOnly) => ({
8102
+ var getCursorStyle2 = (readOnly) => ({
7436
8103
  input: { cursor: readOnly ? "default !important" : void 0 }
7437
8104
  });
7438
8105
 
@@ -7446,11 +8113,11 @@ var UnstableSizeField = ({
7446
8113
  defaultUnit,
7447
8114
  startIcon
7448
8115
  }) => {
7449
- const { size, unit, setSize, setUnit } = useSizeValue(value, onChange, defaultUnit);
7450
- const shouldHighlightUnit = () => {
8116
+ const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
8117
+ const shouldHighlightUnit2 = () => {
7451
8118
  return hasValue(size);
7452
8119
  };
7453
- return /* @__PURE__ */ React112.createElement(
8120
+ return /* @__PURE__ */ React118.createElement(
7454
8121
  UnstableSizeInput,
7455
8122
  {
7456
8123
  type: "number",
@@ -7459,14 +8126,14 @@ var UnstableSizeField = ({
7459
8126
  onChange: (event) => setSize(event.target.value),
7460
8127
  InputProps: {
7461
8128
  ...InputProps,
7462
- startAdornment: startIcon && /* @__PURE__ */ React112.createElement(InputAdornment5, { position: "start" }, startIcon),
7463
- endAdornment: /* @__PURE__ */ React112.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React112.createElement(
8129
+ startAdornment: startIcon && /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "start" }, startIcon),
8130
+ endAdornment: /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React118.createElement(
7464
8131
  UnitSelect,
7465
8132
  {
7466
8133
  options: units2,
7467
8134
  value: unit,
7468
8135
  onClick: setUnit,
7469
- showPrimaryColor: shouldHighlightUnit()
8136
+ showPrimaryColor: shouldHighlightUnit2()
7470
8137
  }
7471
8138
  ))
7472
8139
  }
@@ -7478,41 +8145,35 @@ var hasValue = (value) => {
7478
8145
  };
7479
8146
 
7480
8147
  // src/hooks/use-font-families.ts
7481
- import { useMemo as useMemo16 } from "react";
8148
+ import { useMemo as useMemo17 } from "react";
7482
8149
  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 = () => {
8150
+ var getFontControlConfig = () => {
7490
8151
  const { controls } = getElementorConfig();
7491
- const options = controls?.font?.options;
7492
- if (!options) {
7493
- return null;
7494
- }
7495
- return options;
8152
+ return controls?.font ?? {};
7496
8153
  };
7497
8154
  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]) {
8155
+ const { groups, options } = getFontControlConfig();
8156
+ return useMemo17(() => {
8157
+ if (!groups || !options) {
8158
+ return [];
8159
+ }
8160
+ const groupKeys = Object.keys(groups);
8161
+ const groupIndexMap = new Map(groupKeys.map((key, index) => [key, index]));
8162
+ return Object.entries(options).reduce((acc, [font, category]) => {
8163
+ const groupIndex = groupIndexMap.get(category);
8164
+ if (groupIndex === void 0) {
7503
8165
  return acc;
7504
8166
  }
7505
- const categoryIndex = categoriesOrder.indexOf(category);
7506
- if (!acc[categoryIndex]) {
7507
- acc[categoryIndex] = {
7508
- label: supportedCategories[category],
8167
+ if (!acc[groupIndex]) {
8168
+ acc[groupIndex] = {
8169
+ label: groups[category],
7509
8170
  fonts: []
7510
8171
  };
7511
8172
  }
7512
- acc[categoryIndex].fonts.push(font);
8173
+ acc[groupIndex].fonts.push(font);
7513
8174
  return acc;
7514
8175
  }, []).filter(Boolean);
7515
- }, [fontFamilies]);
8176
+ }, [groups, options]);
7516
8177
  };
7517
8178
  export {
7518
8179
  AspectRatioControl,
@@ -7557,6 +8218,7 @@ export {
7557
8218
  Repeater3 as Repeater,
7558
8219
  SelectControl,
7559
8220
  SelectControlWrapper,
8221
+ SizeComponent,
7560
8222
  SizeControl,
7561
8223
  StrokeControl,
7562
8224
  SvgMediaControl,
@@ -7568,6 +8230,7 @@ export {
7568
8230
  TransformRepeaterControl,
7569
8231
  TransformSettingsControl,
7570
8232
  TransitionRepeaterControl,
8233
+ UnstableSizeControl,
7571
8234
  UnstableSizeField,
7572
8235
  UrlControl,
7573
8236
  VideoMediaControl,
@@ -7580,6 +8243,8 @@ export {
7580
8243
  injectIntoRepeaterItemLabel,
7581
8244
  isUnitExtendedOption,
7582
8245
  registerControlReplacement,
8246
+ trackUpgradePromotionClick,
8247
+ trackViewPromotion,
7583
8248
  transitionProperties,
7584
8249
  transitionsItemsList,
7585
8250
  useBoundProp,