@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.js CHANGED
@@ -72,6 +72,7 @@ __export(index_exports, {
72
72
  Repeater: () => Repeater3,
73
73
  SelectControl: () => SelectControl,
74
74
  SelectControlWrapper: () => SelectControlWrapper,
75
+ SizeComponent: () => SizeComponent,
75
76
  SizeControl: () => SizeControl,
76
77
  StrokeControl: () => StrokeControl,
77
78
  SvgMediaControl: () => SvgMediaControl,
@@ -83,6 +84,7 @@ __export(index_exports, {
83
84
  TransformRepeaterControl: () => TransformRepeaterControl,
84
85
  TransformSettingsControl: () => TransformSettingsControl,
85
86
  TransitionRepeaterControl: () => TransitionRepeaterControl,
87
+ UnstableSizeControl: () => UnstableSizeControl,
86
88
  UnstableSizeField: () => UnstableSizeField,
87
89
  UrlControl: () => UrlControl,
88
90
  VideoMediaControl: () => VideoMediaControl,
@@ -95,6 +97,8 @@ __export(index_exports, {
95
97
  injectIntoRepeaterItemLabel: () => injectIntoRepeaterItemLabel,
96
98
  isUnitExtendedOption: () => isUnitExtendedOption,
97
99
  registerControlReplacement: () => registerControlReplacement,
100
+ trackUpgradePromotionClick: () => trackUpgradePromotionClick,
101
+ trackViewPromotion: () => trackViewPromotion,
98
102
  transitionProperties: () => transitionProperties,
99
103
  transitionsItemsList: () => transitionsItemsList,
100
104
  useBoundProp: () => useBoundProp,
@@ -753,14 +757,14 @@ var TextFieldInnerSelection = (0, import_react9.forwardRef)(
753
757
  id
754
758
  }, ref) => {
755
759
  const { placeholder: boundPropPlaceholder } = useBoundProp(import_editor_props6.sizePropTypeUtil);
756
- const getCursorStyle2 = () => ({
760
+ const getCursorStyle3 = () => ({
757
761
  input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
758
762
  });
759
763
  return /* @__PURE__ */ React17.createElement(
760
764
  NumberInput,
761
765
  {
762
766
  ref,
763
- sx: getCursorStyle2(),
767
+ sx: getCursorStyle3(),
764
768
  size: "tiny",
765
769
  fullWidth: true,
766
770
  type,
@@ -2329,7 +2333,7 @@ var ChipsControl = createControl(({ options }) => {
2329
2333
  const selectedOptions = selectedValues.map((val) => options.find((opt) => opt.value === val)).filter((opt) => opt !== void 0);
2330
2334
  const handleChange = (_, newValue) => {
2331
2335
  const values = newValue.map((option) => import_editor_props16.stringPropTypeUtil.create(option.value));
2332
- setValue(values.length > 0 ? values : null);
2336
+ setValue(values);
2333
2337
  };
2334
2338
  return /* @__PURE__ */ React50.createElement(ControlActions, null, /* @__PURE__ */ React50.createElement(
2335
2339
  import_ui37.Autocomplete,
@@ -2678,7 +2682,7 @@ var import_ui40 = require("@elementor/ui");
2678
2682
  var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
2679
2683
  var renderSuffix = (propType) => {
2680
2684
  if (propType.meta?.suffix) {
2681
- return /* @__PURE__ */ React55.createElement(import_ui40.InputAdornment, { position: "end" }, propType.meta.suffix);
2685
+ return /* @__PURE__ */ React55.createElement(import_ui40.InputAdornment, { position: "end" }, /* @__PURE__ */ React55.createElement(import_ui40.Typography, { variant: "caption", color: "text.secondary" }, propType.meta.suffix));
2682
2686
  }
2683
2687
  return /* @__PURE__ */ React55.createElement(React55.Fragment, null);
2684
2688
  };
@@ -4130,8 +4134,9 @@ var StyledCardMediaContainer = (0, import_ui56.styled)(import_ui56.Stack)`
4130
4134
  var MODE_BROWSE = { mode: "browse" };
4131
4135
  var MODE_UPLOAD = { mode: "upload" };
4132
4136
  var SvgMediaControl = createControl(() => {
4133
- const { value, setValue } = useBoundProp(import_editor_props28.imageSrcPropTypeUtil);
4134
- const { id, url } = value ?? {};
4137
+ const { value, setValue } = useBoundProp(import_editor_props28.svgSrcPropTypeUtil);
4138
+ const id = value?.id;
4139
+ const url = value?.url;
4135
4140
  const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
4136
4141
  const src = attachment?.url ?? url?.value ?? null;
4137
4142
  const { data: allowSvgUpload } = useUnfilteredFilesUpload();
@@ -4147,7 +4152,7 @@ var SvgMediaControl = createControl(() => {
4147
4152
  $$type: "image-attachment-id",
4148
4153
  value: selectedAttachment.id
4149
4154
  },
4150
- url: null
4155
+ url: import_editor_props28.urlPropTypeUtil.create(selectedAttachment.url)
4151
4156
  });
4152
4157
  }
4153
4158
  });
@@ -5759,6 +5764,7 @@ var import_react50 = require("react");
5759
5764
  var import_editor_props50 = require("@elementor/editor-props");
5760
5765
  var import_icons33 = require("@elementor/icons");
5761
5766
  var import_ui84 = require("@elementor/ui");
5767
+ var import_utils7 = require("@elementor/utils");
5762
5768
  var import_i18n50 = require("@wordpress/i18n");
5763
5769
 
5764
5770
  // src/controls/selection-size-control.tsx
@@ -5812,9 +5818,9 @@ var MIN_PRO_VERSION = "3.35";
5812
5818
  var getIsSiteRtl = () => {
5813
5819
  return !!window.elementorFrontend?.config?.is_rtl;
5814
5820
  };
5815
- var shouldExtendTransitionProperties = () => {
5821
+ var shouldShowAllTransitionProperties = () => {
5816
5822
  if (!(0, import_utils6.hasProInstalled)()) {
5817
- return false;
5823
+ return true;
5818
5824
  }
5819
5825
  const proVersion = window.elementorPro?.config?.version;
5820
5826
  if (!proVersion) {
@@ -5951,7 +5957,7 @@ var createTransitionPropertiesList = () => {
5951
5957
  ]
5952
5958
  }
5953
5959
  ];
5954
- return shouldExtendTransitionProperties() ? baseProperties : [baseProperties[0]];
5960
+ return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
5955
5961
  };
5956
5962
  var transitionProperties = createTransitionPropertiesList();
5957
5963
  var transitionsItemsList = transitionProperties.map((category) => ({
@@ -5990,6 +5996,47 @@ var import_editor_ui12 = require("@elementor/editor-ui");
5990
5996
  var import_icons32 = require("@elementor/icons");
5991
5997
  var import_ui83 = require("@elementor/ui");
5992
5998
  var import_i18n49 = require("@wordpress/i18n");
5999
+
6000
+ // src/utils/tracking.ts
6001
+ var import_editor_elements5 = require("@elementor/editor-elements");
6002
+ var import_events2 = require("@elementor/events");
6003
+ var getBaseEventProperties = (data, config) => ({
6004
+ app_type: config?.appTypes?.editor ?? "editor",
6005
+ window_name: config?.appTypes?.editor ?? "editor",
6006
+ interaction_type: config?.triggers?.click ?? "Click",
6007
+ target_name: data.target_name,
6008
+ target_location: data.target_location ?? "widget_panel",
6009
+ location_l1: data.location_l1 ?? (0, import_editor_elements5.getSelectedElements)()[0]?.type ?? "",
6010
+ ...data.location_l2 && { location_l2: data.location_l2 }
6011
+ });
6012
+ var dispatchPromotionEvent = (data, resolveOptions) => {
6013
+ const { dispatchEvent, config } = (0, import_events2.getMixpanel)();
6014
+ const { eventName, interactionResult, interactionDescription } = resolveOptions(config);
6015
+ if (!eventName) {
6016
+ return;
6017
+ }
6018
+ dispatchEvent?.(eventName, {
6019
+ ...getBaseEventProperties(data, config),
6020
+ interaction_result: interactionResult,
6021
+ interaction_description: interactionDescription
6022
+ });
6023
+ };
6024
+ var trackViewPromotion = (data) => {
6025
+ dispatchPromotionEvent(data, (config) => ({
6026
+ eventName: config?.names?.promotions?.viewPromotion,
6027
+ interactionResult: config?.interactionResults?.promotionViewed ?? "promotion_viewed",
6028
+ interactionDescription: "user_viewed_promotion"
6029
+ }));
6030
+ };
6031
+ var trackUpgradePromotionClick = (data) => {
6032
+ dispatchPromotionEvent(data, (config) => ({
6033
+ eventName: config?.names?.promotions?.upgradePromotionClick,
6034
+ interactionResult: config?.interactionResults?.upgradeNow ?? "upgrade_now",
6035
+ interactionDescription: "user_clicked_upgrade_now"
6036
+ }));
6037
+ };
6038
+
6039
+ // src/controls/transition-control/transition-selector.tsx
5993
6040
  var toTransitionSelectorValue = (label) => {
5994
6041
  for (const category of transitionProperties) {
5995
6042
  const property = category.properties.find((prop) => prop.label === label);
@@ -6127,7 +6174,11 @@ var TransitionSelector = ({
6127
6174
  "Upgrade to customize transition properties and control effects.",
6128
6175
  "elementor"
6129
6176
  ),
6130
- upgradeUrl: PRO_UPGRADE_URL
6177
+ upgradeUrl: PRO_UPGRADE_URL,
6178
+ onCtaClick: () => trackUpgradePromotionClick({
6179
+ target_name: "transition_property",
6180
+ location_l2: "style"
6181
+ })
6131
6182
  }
6132
6183
  ) : null
6133
6184
  }
@@ -6255,6 +6306,7 @@ var TransitionRepeaterControl = createControl(
6255
6306
  }) => {
6256
6307
  const currentStyleIsNormal = currentStyleState === null;
6257
6308
  const [recentlyUsedList, setRecentlyUsedList] = (0, import_react50.useState)([]);
6309
+ const proInstalled = (0, import_utils7.hasProInstalled)();
6258
6310
  const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
6259
6311
  const { allDisabled: disabledItems, proDisabled: proDisabledItems } = (0, import_react50.useMemo)(
6260
6312
  () => getDisabledItemLabels(value),
@@ -6263,10 +6315,14 @@ var TransitionRepeaterControl = createControl(
6263
6315
  const allowedTransitionSet = (0, import_react50.useMemo)(() => {
6264
6316
  const set = /* @__PURE__ */ new Set();
6265
6317
  transitionProperties.forEach((category) => {
6266
- category.properties.forEach((prop) => set.add(prop.value));
6318
+ category.properties.forEach((prop) => {
6319
+ if (!prop.isDisabled || proInstalled) {
6320
+ set.add(prop.value);
6321
+ }
6322
+ });
6267
6323
  });
6268
6324
  return set;
6269
- }, []);
6325
+ }, [proInstalled]);
6270
6326
  (0, import_react50.useEffect)(() => {
6271
6327
  if (!value || value.length === 0) {
6272
6328
  return;
@@ -6391,7 +6447,7 @@ var React101 = __toESM(require("react"));
6391
6447
  var import_react53 = require("react");
6392
6448
  var import_editor_props53 = require("@elementor/editor-props");
6393
6449
  var import_ui87 = require("@elementor/ui");
6394
- var import_utils7 = require("@elementor/utils");
6450
+ var import_utils8 = require("@elementor/utils");
6395
6451
 
6396
6452
  // src/components/inline-editor.tsx
6397
6453
  var React100 = __toESM(require("react"));
@@ -6437,9 +6493,12 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6437
6493
  expectedTag = null,
6438
6494
  onEditorCreate,
6439
6495
  wrapperClassName,
6440
- onSelectionEnd
6496
+ onSelectionEnd,
6497
+ mountElement = null
6441
6498
  } = props;
6442
6499
  const containerRef = (0, import_react51.useRef)(null);
6500
+ const onBlurRef = (0, import_react51.useRef)(onBlur);
6501
+ onBlurRef.current = onBlur;
6443
6502
  const documentContentSettings = !!expectedTag ? "block+" : "inline*";
6444
6503
  const onUpdate = ({ editor: updatedEditor }) => {
6445
6504
  const newValue = updatedEditor.getHTML();
@@ -6447,7 +6506,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6447
6506
  };
6448
6507
  const onKeyDown = (_, event) => {
6449
6508
  if (event.key === "Escape") {
6450
- onBlur?.();
6509
+ onBlurRef.current?.();
6451
6510
  }
6452
6511
  if (!event.metaKey && !event.ctrlKey || event.altKey) {
6453
6512
  return;
@@ -6461,6 +6520,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6461
6520
  class: elementClasses
6462
6521
  });
6463
6522
  const editor = (0, import_react52.useEditor)({
6523
+ ...mountElement ? { element: mountElement } : {},
6464
6524
  extensions: [
6465
6525
  import_extension_document.default.extend({
6466
6526
  content: documentContentSettings
@@ -6514,6 +6574,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6514
6574
  }
6515
6575
  },
6516
6576
  onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
6577
+ onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
6517
6578
  onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
6518
6579
  });
6519
6580
  useOnUpdate(() => {
@@ -6525,33 +6586,11 @@ var InlineEditor = React100.forwardRef((props, ref) => {
6525
6586
  editor.commands.setContent(value, { emitUpdate: false });
6526
6587
  }
6527
6588
  }, [editor, value]);
6528
- return /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(
6529
- Wrapper,
6530
- {
6531
- containerRef,
6532
- editor,
6533
- sx,
6534
- onBlur,
6535
- className: wrapperClassName
6536
- },
6537
- /* @__PURE__ */ React100.createElement(import_react52.EditorContent, { ref, editor })
6538
- ));
6589
+ if (mountElement) {
6590
+ return null;
6591
+ }
6592
+ return /* @__PURE__ */ React100.createElement(import_ui86.Box, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React100.createElement(import_react52.EditorContent, { ref, editor }));
6539
6593
  });
6540
- var Wrapper = ({ children, containerRef, editor, sx, onBlur, className }) => {
6541
- const wrappedChildren = /* @__PURE__ */ React100.createElement(import_ui86.Box, { ref: containerRef, ...sx, className }, children);
6542
- return onBlur ? /* @__PURE__ */ React100.createElement(
6543
- import_ui86.ClickAwayListener,
6544
- {
6545
- onClickAway: (event) => {
6546
- if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
6547
- return;
6548
- }
6549
- onBlur?.();
6550
- }
6551
- },
6552
- wrappedChildren
6553
- ) : /* @__PURE__ */ React100.createElement(React100.Fragment, null, wrappedChildren);
6554
- };
6555
6594
  var useOnUpdate = (callback, dependencies) => {
6556
6595
  const hasMounted = (0, import_react51.useRef)(false);
6557
6596
  (0, import_react51.useEffect)(() => {
@@ -6574,7 +6613,7 @@ var InlineEditingControl = createControl(
6574
6613
  const { value, setValue } = useBoundProp(import_editor_props53.htmlV3PropTypeUtil);
6575
6614
  const content = import_editor_props53.stringPropTypeUtil.extract(value?.content ?? null) ?? "";
6576
6615
  const debouncedParse = (0, import_react53.useMemo)(
6577
- () => (0, import_utils7.debounce)((html) => {
6616
+ () => (0, import_utils8.debounce)((html) => {
6578
6617
  const parsed = (0, import_editor_props53.parseHtmlChildren)(html);
6579
6618
  setValue({
6580
6619
  content: parsed.content ? import_editor_props53.stringPropTypeUtil.create(parsed.content) : null,
@@ -6649,7 +6688,7 @@ var SendToField = () => /* @__PURE__ */ React102.createElement(
6649
6688
  EmailField,
6650
6689
  {
6651
6690
  bind: "to",
6652
- label: (0, import_i18n51.__)("Send To", "elementor"),
6691
+ label: (0, import_i18n51.__)("Send to", "elementor"),
6653
6692
  placeholder: (0, import_i18n51.__)("Where should we send new submissions?", "elementor")
6654
6693
  }
6655
6694
  );
@@ -6657,7 +6696,7 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
6657
6696
  EmailField,
6658
6697
  {
6659
6698
  bind: "subject",
6660
- label: (0, import_i18n51.__)("Email Subject", "elementor"),
6699
+ label: (0, import_i18n51.__)("Email subject", "elementor"),
6661
6700
  placeholder: (0, import_i18n51.__)("New form submission", "elementor")
6662
6701
  }
6663
6702
  );
@@ -6675,7 +6714,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
6675
6714
  {
6676
6715
  bind: "from",
6677
6716
  label: (0, import_i18n51.__)("From email", "elementor"),
6678
- placeholder: (0, import_i18n51.__)("What email address should appear as the sender?", "elementor")
6717
+ placeholder: (0, import_i18n51.__)("What email should appear as the sender?", "elementor")
6679
6718
  }
6680
6719
  );
6681
6720
  var FromNameField = () => /* @__PURE__ */ React102.createElement(
@@ -6689,7 +6728,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
6689
6728
  var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: (0, import_i18n51.__)("Reply-to", "elementor") });
6690
6729
  var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: (0, import_i18n51.__)("Cc", "elementor") });
6691
6730
  var BccField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "bcc", label: (0, import_i18n51.__)("Bcc", "elementor") });
6692
- var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("Meta data", "elementor")), /* @__PURE__ */ React102.createElement(
6731
+ var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("Metadata", "elementor")), /* @__PURE__ */ React102.createElement(
6693
6732
  ChipsControl,
6694
6733
  {
6695
6734
  options: [
@@ -6713,32 +6752,664 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
6713
6752
  var AdvancedSettings = () => /* @__PURE__ */ React102.createElement(import_editor_ui13.CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React102.createElement(import_ui88.Box, { sx: { pt: 2 } }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { 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(import_ui88.Divider, null), /* @__PURE__ */ React102.createElement(MetaDataField, null), /* @__PURE__ */ React102.createElement(SendAsField, null))));
6714
6753
  var EmailFormActionControl = createControl(() => {
6715
6754
  const { value, setValue, ...propContext } = useBoundProp(import_editor_props54.emailPropTypeUtil);
6716
- return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlFormLabel, null, (0, import_i18n51.__)("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)));
6755
+ return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(import_ui88.Stack, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, (0, import_i18n51.__)("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)));
6717
6756
  });
6718
6757
 
6719
- // src/components/promotions/display-conditions-control.tsx
6720
- var React104 = __toESM(require("react"));
6721
- var import_react55 = require("react");
6758
+ // src/controls/size-control/unstable-size-control.tsx
6759
+ var React108 = __toESM(require("react"));
6760
+ var import_editor_props56 = require("@elementor/editor-props");
6761
+
6762
+ // src/controls/size-control/size-component.tsx
6763
+ var React107 = __toESM(require("react"));
6764
+ var import_react58 = require("react");
6765
+ var import_editor_responsive4 = require("@elementor/editor-responsive");
6766
+ var import_ui92 = require("@elementor/ui");
6767
+
6768
+ // src/controls/size-control/size-field.tsx
6769
+ var React105 = __toESM(require("react"));
6722
6770
  var import_icons34 = require("@elementor/icons");
6723
6771
  var import_ui90 = require("@elementor/ui");
6724
- var import_i18n52 = require("@wordpress/i18n");
6725
6772
 
6726
- // src/components/promotions/promotion-trigger.tsx
6727
- var React103 = __toESM(require("react"));
6773
+ // src/controls/size-control/sync/get-units.ts
6774
+ var getLengthUnits = () => {
6775
+ return window.elementor?.config?.size_units?.length ?? [];
6776
+ };
6777
+ var getAngleUnits = () => {
6778
+ return window.elementor?.config?.size_units?.angle ?? [];
6779
+ };
6780
+ var getTimeUnits = () => {
6781
+ return window.elementor?.config?.size_units?.time ?? [];
6782
+ };
6783
+ var getExtendedUnits = () => {
6784
+ return window.elementor?.config?.size_units?.extended_units ?? [];
6785
+ };
6786
+
6787
+ // src/controls/size-control/utils/is-extended-unit.ts
6788
+ var isExtendedUnit = (unit) => {
6789
+ const extendedUnits = getExtendedUnits();
6790
+ return extendedUnits.includes(unit);
6791
+ };
6792
+
6793
+ // src/controls/size-control/hooks/use-size-unit-keyboard.tsx
6794
+ var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
6795
+ var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
6796
+ const { appendKey, startsWith } = useTypingBuffer();
6797
+ const onUnitKeyDown = (event) => {
6798
+ if (units2.length === 0) {
6799
+ return;
6800
+ }
6801
+ const { key, altKey, ctrlKey, metaKey } = event;
6802
+ if (altKey || ctrlKey || metaKey) {
6803
+ return;
6804
+ }
6805
+ if (isExtendedUnit(unit) && isNumericValue(key)) {
6806
+ const [defaultUnit] = units2;
6807
+ if (defaultUnit) {
6808
+ onUnitChange(defaultUnit);
6809
+ }
6810
+ return;
6811
+ }
6812
+ if (!UNIT_KEY_PATTERN.test(key)) {
6813
+ return;
6814
+ }
6815
+ event.preventDefault();
6816
+ const updatedBuffer = appendKey(key.toLowerCase());
6817
+ const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
6818
+ if (matchedUnit) {
6819
+ onUnitChange(matchedUnit);
6820
+ }
6821
+ };
6822
+ return { onUnitKeyDown };
6823
+ };
6824
+ var isNumericValue = (value) => {
6825
+ if (typeof value === "number") {
6826
+ return !isNaN(value);
6827
+ }
6828
+ if (typeof value === "string") {
6829
+ return value.trim() !== "" && !isNaN(Number(value));
6830
+ }
6831
+ return false;
6832
+ };
6833
+
6834
+ // src/controls/size-control/hooks/use-size-value.ts
6728
6835
  var import_react54 = require("react");
6836
+
6837
+ // src/controls/size-control/utils/resolve-size-value.ts
6838
+ var DEFAULT_SIZE2 = "";
6839
+ var EXTENDED_UNITS = {
6840
+ auto: "auto",
6841
+ custom: "custom"
6842
+ };
6843
+ var resolveSizeValue = (value, context) => {
6844
+ if (!value) {
6845
+ return value;
6846
+ }
6847
+ const { units: units2, defaultUnit } = context;
6848
+ const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
6849
+ if (unit === EXTENDED_UNITS.auto) {
6850
+ return { size: DEFAULT_SIZE2, unit };
6851
+ }
6852
+ if (unit === EXTENDED_UNITS.custom) {
6853
+ return { size: String(value.size ?? DEFAULT_SIZE2), unit };
6854
+ }
6855
+ return {
6856
+ size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
6857
+ unit
6858
+ };
6859
+ };
6860
+ var resolveSizeOnUnitChange = (size, unit) => {
6861
+ return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
6862
+ };
6863
+ var createDefaultSizeValue = (units2, defaultUnit) => {
6864
+ let [unit] = units2;
6865
+ if (defaultUnit !== void 0) {
6866
+ unit = resolveFallbackUnit(defaultUnit, units2);
6867
+ }
6868
+ return { size: DEFAULT_SIZE2, unit };
6869
+ };
6870
+ var resolveFallbackUnit = (unit, units2, defaultUnit) => {
6871
+ if (units2.includes(unit)) {
6872
+ return unit;
6873
+ }
6874
+ if (defaultUnit && units2.includes(defaultUnit)) {
6875
+ return defaultUnit;
6876
+ }
6877
+ return units2[0] ?? "";
6878
+ };
6879
+ var sanitizeSize = (size) => {
6880
+ if (typeof size === "number" && isNaN(size)) {
6881
+ return DEFAULT_SIZE2;
6882
+ }
6883
+ return size;
6884
+ };
6885
+
6886
+ // src/controls/size-control/hooks/use-size-value.ts
6887
+ var useSizeValue = ({
6888
+ value,
6889
+ setValue,
6890
+ units: units2,
6891
+ defaultUnit
6892
+ }) => {
6893
+ const resolvedValue = (0, import_react54.useMemo)(
6894
+ () => resolveSizeValue(value, { units: units2, defaultUnit }),
6895
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6896
+ [value?.size, value?.unit, defaultUnit]
6897
+ );
6898
+ const [sizeValue, setSizeValue] = useSyncExternalState({
6899
+ external: resolvedValue,
6900
+ setExternal: (newState, options, meta) => {
6901
+ if (newState !== null) {
6902
+ setValue(newState, options, meta);
6903
+ }
6904
+ },
6905
+ persistWhen: (next) => hasChanged(next, resolvedValue),
6906
+ fallback: () => createDefaultSizeValue(units2, defaultUnit)
6907
+ });
6908
+ const setSize = (newSize, isInputValid = true) => {
6909
+ if (isExtendedUnit(sizeValue.unit)) {
6910
+ return;
6911
+ }
6912
+ const trimmed = newSize.trim();
6913
+ const parsed = Number(trimmed);
6914
+ const newState = {
6915
+ ...sizeValue,
6916
+ size: trimmed && !isNaN(parsed) ? parsed : ""
6917
+ };
6918
+ setSizeValue(newState, void 0, { validation: () => isInputValid });
6919
+ };
6920
+ const setUnit = (unit) => {
6921
+ setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
6922
+ };
6923
+ return {
6924
+ size: sizeValue.size,
6925
+ unit: sizeValue.unit,
6926
+ setSize,
6927
+ setUnit
6928
+ };
6929
+ };
6930
+ var hasChanged = (next, current) => {
6931
+ return next?.size !== current?.size || next?.unit !== current?.unit;
6932
+ };
6933
+
6934
+ // src/controls/size-control/ui/size-input.tsx
6935
+ var React103 = __toESM(require("react"));
6936
+ var import_react55 = require("react");
6937
+ var SizeInput2 = (0, import_react55.forwardRef)(
6938
+ ({
6939
+ id,
6940
+ type,
6941
+ value,
6942
+ onBlur,
6943
+ onKeyUp,
6944
+ focused,
6945
+ disabled,
6946
+ onChange,
6947
+ onKeyDown,
6948
+ InputProps,
6949
+ inputProps,
6950
+ placeholder
6951
+ }, ref) => {
6952
+ return /* @__PURE__ */ React103.createElement(
6953
+ NumberInput,
6954
+ {
6955
+ id,
6956
+ ref,
6957
+ size: "tiny",
6958
+ fullWidth: true,
6959
+ type,
6960
+ value,
6961
+ placeholder,
6962
+ onKeyUp,
6963
+ focused,
6964
+ disabled,
6965
+ onKeyDown,
6966
+ onInput: onChange,
6967
+ onBlur,
6968
+ InputProps,
6969
+ inputProps,
6970
+ sx: getCursorStyle(InputProps?.readOnly ?? false)
6971
+ }
6972
+ );
6973
+ }
6974
+ );
6975
+ var getCursorStyle = (readOnly) => ({
6976
+ input: { cursor: readOnly ? "default !important" : void 0 }
6977
+ });
6978
+
6979
+ // src/controls/size-control/ui/unit-selector.tsx
6980
+ var React104 = __toESM(require("react"));
6981
+ var import_react56 = require("react");
6729
6982
  var import_editor_ui14 = require("@elementor/editor-ui");
6730
6983
  var import_ui89 = require("@elementor/ui");
6984
+ var menuItemContentStyles = {
6985
+ display: "flex",
6986
+ flexDirection: "column",
6987
+ justifyContent: "center"
6988
+ };
6989
+ var UnitSelector = ({
6990
+ value,
6991
+ isActive,
6992
+ onSelect,
6993
+ options,
6994
+ disabled,
6995
+ menuItemsAttributes = {},
6996
+ optionLabelOverrides = {}
6997
+ }) => {
6998
+ const popupState = (0, import_ui89.usePopupState)({
6999
+ variant: "popover",
7000
+ popupId: (0, import_react56.useId)()
7001
+ });
7002
+ const handleMenuItemClick = (option) => {
7003
+ onSelect(option);
7004
+ popupState.close();
7005
+ };
7006
+ return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(StyledButton2, { isActive, disabled, size: "small", ...(0, import_ui89.bindTrigger)(popupState) }, optionLabelOverrides[value] ?? value), /* @__PURE__ */ React104.createElement(import_ui89.Menu, { MenuListProps: { dense: true }, ...(0, import_ui89.bindMenu)(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
7007
+ import_editor_ui14.MenuListItem,
7008
+ {
7009
+ key: option,
7010
+ onClick: () => handleMenuItemClick(option),
7011
+ ...menuItemsAttributes?.[option],
7012
+ primaryTypographyProps: {
7013
+ variant: "caption",
7014
+ sx: {
7015
+ ...menuItemContentStyles,
7016
+ lineHeight: "1"
7017
+ }
7018
+ },
7019
+ menuItemTextProps: {
7020
+ sx: menuItemContentStyles
7021
+ }
7022
+ },
7023
+ optionLabelOverrides[option] ?? option.toUpperCase()
7024
+ ))));
7025
+ };
7026
+ var StyledButton2 = (0, import_ui89.styled)(import_ui89.Button, {
7027
+ shouldForwardProp: (prop) => prop !== "isActive"
7028
+ })(({ isActive, theme }) => ({
7029
+ color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
7030
+ font: "inherit",
7031
+ minWidth: "initial",
7032
+ textTransform: "uppercase"
7033
+ }));
7034
+
7035
+ // src/controls/size-control/utils/has-size-value.ts
7036
+ var hasSizeValue = (size) => {
7037
+ return Boolean(size) || size === 0;
7038
+ };
7039
+
7040
+ // src/controls/size-control/size-field.tsx
7041
+ var UNIT_DISPLAY_LABELS_OVERRIDES = {
7042
+ custom: /* @__PURE__ */ React105.createElement(import_icons34.MathFunctionIcon, { fontSize: "tiny" })
7043
+ };
7044
+ var SizeField = ({
7045
+ value,
7046
+ focused,
7047
+ disabled,
7048
+ InputProps,
7049
+ defaultUnit,
7050
+ placeholder,
7051
+ onUnitChange,
7052
+ startIcon,
7053
+ ariaLabel,
7054
+ onKeyDown,
7055
+ setValue,
7056
+ onBlur,
7057
+ units: units2,
7058
+ min,
7059
+ unitSelectorProps
7060
+ }) => {
7061
+ const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
7062
+ const handleUnitChange = (newUnit) => {
7063
+ setUnit(newUnit);
7064
+ onUnitChange?.(newUnit);
7065
+ };
7066
+ const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
7067
+ const handleKeyDown = (event) => {
7068
+ onUnitKeyDown(event);
7069
+ onKeyDown?.(event);
7070
+ };
7071
+ const handleChange = (event) => {
7072
+ const newSize = event.target.value;
7073
+ const isInputValid = event.target.validity.valid;
7074
+ setSize(newSize, isInputValid);
7075
+ };
7076
+ const inputType = isExtendedUnit(unit) ? "text" : "number";
7077
+ return /* @__PURE__ */ React105.createElement(
7078
+ SizeInput2,
7079
+ {
7080
+ disabled,
7081
+ focused,
7082
+ type: inputType,
7083
+ value: size,
7084
+ placeholder,
7085
+ onBlur,
7086
+ onKeyDown: handleKeyDown,
7087
+ onChange: handleChange,
7088
+ InputProps: {
7089
+ ...InputProps,
7090
+ autoComplete: "off",
7091
+ readOnly: isExtendedUnit(unit),
7092
+ startAdornment: startIcon && /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "start", disabled }, startIcon),
7093
+ endAdornment: /* @__PURE__ */ React105.createElement(import_ui90.InputAdornment, { position: "end" }, /* @__PURE__ */ React105.createElement(
7094
+ UnitSelector,
7095
+ {
7096
+ options: units2,
7097
+ value: unit,
7098
+ onSelect: handleUnitChange,
7099
+ isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
7100
+ ...unitSelectorProps,
7101
+ optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
7102
+ }
7103
+ ))
7104
+ },
7105
+ inputProps: { min, step: "any", "arial-label": ariaLabel }
7106
+ }
7107
+ );
7108
+ };
7109
+
7110
+ // src/controls/size-control/ui/text-field-popover.tsx
7111
+ var React106 = __toESM(require("react"));
7112
+ var import_react57 = require("react");
7113
+ var import_editor_ui15 = require("@elementor/editor-ui");
7114
+ var import_icons35 = require("@elementor/icons");
7115
+ var import_ui91 = require("@elementor/ui");
7116
+ var import_i18n52 = require("@wordpress/i18n");
7117
+ var SIZE10 = "tiny";
7118
+ var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
7119
+ const inputRef = (0, import_react57.useRef)(null);
7120
+ (0, import_react57.useEffect)(() => {
7121
+ if (popupState.isOpen) {
7122
+ requestAnimationFrame(() => {
7123
+ if (inputRef.current) {
7124
+ inputRef.current.focus();
7125
+ }
7126
+ });
7127
+ }
7128
+ }, [popupState.isOpen]);
7129
+ const handleKeyDown = (event) => {
7130
+ if (event.key.toLowerCase() === "enter") {
7131
+ handleClose();
7132
+ }
7133
+ };
7134
+ const handleClose = () => {
7135
+ onClose?.();
7136
+ popupState.close();
7137
+ };
7138
+ return /* @__PURE__ */ React106.createElement(
7139
+ import_ui91.Popover,
7140
+ {
7141
+ disablePortal: true,
7142
+ slotProps: {
7143
+ paper: {
7144
+ sx: {
7145
+ borderRadius: 2,
7146
+ width: anchorRef.current?.offsetWidth + "px"
7147
+ }
7148
+ }
7149
+ },
7150
+ ...(0, import_ui91.bindPopover)(popupState),
7151
+ anchorOrigin: { vertical: "bottom", horizontal: "center" },
7152
+ transformOrigin: { vertical: "top", horizontal: "center" },
7153
+ onClose: handleClose
7154
+ },
7155
+ /* @__PURE__ */ React106.createElement(
7156
+ import_editor_ui15.PopoverHeader,
7157
+ {
7158
+ title: (0, import_i18n52.__)("CSS function", "elementor"),
7159
+ onClose: handleClose,
7160
+ icon: /* @__PURE__ */ React106.createElement(import_icons35.MathFunctionIcon, { fontSize: SIZE10 })
7161
+ }
7162
+ ),
7163
+ /* @__PURE__ */ React106.createElement(
7164
+ import_ui91.TextField,
7165
+ {
7166
+ value,
7167
+ onChange,
7168
+ onKeyDown: handleKeyDown,
7169
+ size: "tiny",
7170
+ type: "text",
7171
+ fullWidth: true,
7172
+ inputProps: {
7173
+ ref: inputRef
7174
+ },
7175
+ sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
7176
+ }
7177
+ )
7178
+ );
7179
+ };
7180
+
7181
+ // src/controls/size-control/size-component.tsx
7182
+ var SizeComponent = ({
7183
+ anchorRef,
7184
+ isUnitActive,
7185
+ SizeFieldWrapper = React107.Fragment,
7186
+ ...sizeFieldProps
7187
+ }) => {
7188
+ const popupState = (0, import_ui92.usePopupState)({ variant: "popover" });
7189
+ const activeBreakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
7190
+ const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
7191
+ const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
7192
+ (0, import_react58.useEffect)(() => {
7193
+ if (popupState && popupState.isOpen) {
7194
+ popupState.close();
7195
+ }
7196
+ }, [activeBreakpoint]);
7197
+ const handleCustomSizeChange = (event) => {
7198
+ sizeFieldProps.setValue({
7199
+ size: event.target.value,
7200
+ unit: EXTENDED_UNITS.custom
7201
+ });
7202
+ };
7203
+ const handleSizeFieldClick = (event) => {
7204
+ if (event.target.closest("input") && isCustomUnit) {
7205
+ popupState.open(anchorRef?.current);
7206
+ }
7207
+ };
7208
+ const handleUnitChange = (unit) => {
7209
+ if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
7210
+ popupState.open(anchorRef.current);
7211
+ }
7212
+ };
7213
+ const popupAttributes = {
7214
+ "aria-controls": popupState.isOpen ? popupState.popupId : void 0,
7215
+ "aria-haspopup": true
7216
+ };
7217
+ return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(import_ui92.Box, null, /* @__PURE__ */ React107.createElement(
7218
+ SizeField,
7219
+ {
7220
+ focused: popupState.isOpen ? true : void 0,
7221
+ onUnitChange: handleUnitChange,
7222
+ InputProps: {
7223
+ ...popupAttributes,
7224
+ onClick: handleSizeFieldClick
7225
+ },
7226
+ unitSelectorProps: {
7227
+ menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
7228
+ isActive: isUnitActive
7229
+ },
7230
+ ...sizeFieldProps
7231
+ }
7232
+ ))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
7233
+ TextFieldPopover2,
7234
+ {
7235
+ popupState,
7236
+ anchorRef,
7237
+ value: String(sizeFieldProps?.value?.size ?? ""),
7238
+ onChange: handleCustomSizeChange,
7239
+ onClose: () => {
7240
+ }
7241
+ }
7242
+ ));
7243
+ };
7244
+
7245
+ // src/controls/size-control/utils/resolve-bound-prop-value.ts
7246
+ var import_editor_props55 = require("@elementor/editor-props");
7247
+ var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
7248
+ let sizeValue = null;
7249
+ if (validateSizeValue(value)) {
7250
+ sizeValue = value;
7251
+ } else if (validateSizeValue(boundPropPlaceholder)) {
7252
+ sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
7253
+ }
7254
+ return {
7255
+ sizeValue,
7256
+ isUnitHighlighted: shouldHighlightUnit(value),
7257
+ placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
7258
+ };
7259
+ };
7260
+ var validateSizeValue = (value) => {
7261
+ if (!value) {
7262
+ return false;
7263
+ }
7264
+ const sizePropValue = import_editor_props55.sizePropTypeUtil.create(value);
7265
+ return import_editor_props55.sizePropTypeUtil.isValid(sizePropValue);
7266
+ };
7267
+ var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
7268
+ if (propPlaceholder) {
7269
+ return propPlaceholder;
7270
+ }
7271
+ const size = boundPropPlaceholder?.size;
7272
+ if (size === void 0) {
7273
+ return void 0;
7274
+ }
7275
+ if (typeof size === "number") {
7276
+ return size.toString();
7277
+ }
7278
+ return size;
7279
+ };
7280
+ var shouldHighlightUnit = (value) => {
7281
+ if (!value) {
7282
+ return false;
7283
+ }
7284
+ if (value.unit === EXTENDED_UNITS.auto) {
7285
+ return true;
7286
+ }
7287
+ return hasSizeValue(value.size);
7288
+ };
7289
+
7290
+ // src/controls/size-control/utils/settings/get-prop-type-settings.ts
7291
+ var getPropTypeSettings = (propType) => {
7292
+ return propType.settings;
7293
+ };
7294
+
7295
+ // src/controls/size-control/utils/settings/get-default-unit.ts
7296
+ var getDefaultUnit = (propType) => {
7297
+ return getPropTypeSettings(propType)?.default_unit;
7298
+ };
7299
+
7300
+ // src/controls/size-control/utils/settings/get-size-units.ts
7301
+ var getVariantUnits = (variant) => {
7302
+ const map = {
7303
+ length: getLengthUnits,
7304
+ angle: getAngleUnits,
7305
+ time: getTimeUnits
7306
+ };
7307
+ return map[variant]();
7308
+ };
7309
+ var getSettingsUnits = (propType) => {
7310
+ return getPropTypeSettings(propType)?.units;
7311
+ };
7312
+ var getSizeUnits = (propType, variant) => {
7313
+ return getSettingsUnits(propType) ?? getVariantUnits(variant);
7314
+ };
7315
+
7316
+ // src/controls/size-control/utils/should-nullify-value.ts
7317
+ var conditions = [
7318
+ (value) => value?.size === null || value?.size === void 0 || value?.size === "",
7319
+ (value) => value?.unit !== EXTENDED_UNITS.auto,
7320
+ (value) => value?.unit !== EXTENDED_UNITS.custom
7321
+ ];
7322
+ var shouldNullifyValue = (value) => {
7323
+ return conditions.every((condition) => condition(value));
7324
+ };
7325
+
7326
+ // src/controls/size-control/unstable-size-control.tsx
7327
+ var UnstableSizeControl = createControl(
7328
+ ({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
7329
+ const {
7330
+ value,
7331
+ setValue,
7332
+ propType,
7333
+ placeholder: boundPropPlaceholder,
7334
+ restoreValue
7335
+ } = useBoundProp(import_editor_props56.sizePropTypeUtil);
7336
+ const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
7337
+ value,
7338
+ boundPropPlaceholder,
7339
+ propPlaceholder
7340
+ );
7341
+ const units2 = getSizeUnits(propType, variant);
7342
+ const defaultUnit = getDefaultUnit(propType);
7343
+ const handleBlur = () => {
7344
+ const isRequired = propType.settings.required;
7345
+ if (shouldNullifyValue(value) && !isRequired) {
7346
+ setValue(null);
7347
+ }
7348
+ if (isRequired) {
7349
+ restoreValue();
7350
+ }
7351
+ };
7352
+ const handleChange = (newValue, options, meta) => {
7353
+ setValue(newValue, options, {
7354
+ ...meta,
7355
+ validation: () => {
7356
+ if (propType.settings.required) {
7357
+ return newValue.size !== "";
7358
+ }
7359
+ return meta?.validation ? meta.validation(newValue) : true;
7360
+ }
7361
+ });
7362
+ };
7363
+ return /* @__PURE__ */ React108.createElement(
7364
+ SizeComponent,
7365
+ {
7366
+ units: units2,
7367
+ value: sizeValue,
7368
+ anchorRef,
7369
+ placeholder,
7370
+ defaultUnit,
7371
+ isUnitActive: isUnitHighlighted,
7372
+ onBlur: handleBlur,
7373
+ setValue: handleChange,
7374
+ SizeFieldWrapper: ControlActions,
7375
+ startIcon,
7376
+ ariaLabel,
7377
+ min
7378
+ }
7379
+ );
7380
+ }
7381
+ );
7382
+
7383
+ // src/components/promotions/display-conditions-control.tsx
7384
+ var React110 = __toESM(require("react"));
7385
+ var import_react60 = require("react");
7386
+ var import_icons36 = require("@elementor/icons");
7387
+ var import_ui94 = require("@elementor/ui");
7388
+ var import_i18n53 = require("@wordpress/i18n");
7389
+
7390
+ // src/components/promotions/promotion-trigger.tsx
7391
+ var React109 = __toESM(require("react"));
7392
+ var import_react59 = require("react");
7393
+ var import_editor_ui16 = require("@elementor/editor-ui");
7394
+ var import_ui93 = require("@elementor/ui");
6731
7395
  function getV4Promotion(key) {
6732
7396
  return window.elementor?.config?.v4Promotions?.[key];
6733
7397
  }
6734
- var PromotionTrigger = (0, import_react54.forwardRef)(
6735
- ({ promotionKey, children }, ref) => {
6736
- const [isOpen, setIsOpen] = (0, import_react54.useState)(false);
7398
+ var PromotionTrigger = (0, import_react59.forwardRef)(
7399
+ ({ promotionKey, children, trackingData }, ref) => {
7400
+ const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
6737
7401
  const promotion = getV4Promotion(promotionKey);
6738
- const toggle = () => setIsOpen((prev) => !prev);
6739
- (0, import_react54.useImperativeHandle)(ref, () => ({ toggle }), []);
6740
- return /* @__PURE__ */ React103.createElement(React103.Fragment, null, promotion && /* @__PURE__ */ React103.createElement(
6741
- import_editor_ui14.PromotionInfotip,
7402
+ const toggle = (0, import_react59.useCallback)(() => {
7403
+ setIsOpen((prev) => {
7404
+ if (!prev) {
7405
+ trackViewPromotion(trackingData);
7406
+ }
7407
+ return !prev;
7408
+ });
7409
+ }, [trackingData]);
7410
+ (0, import_react59.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
7411
+ return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
7412
+ import_editor_ui16.PromotionInfotip,
6742
7413
  {
6743
7414
  title: promotion.title,
6744
7415
  content: promotion.content,
@@ -6748,10 +7419,11 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
6748
7419
  onClose: (e) => {
6749
7420
  e.stopPropagation();
6750
7421
  setIsOpen(false);
6751
- }
7422
+ },
7423
+ onCtaClick: () => trackUpgradePromotionClick(trackingData)
6752
7424
  },
6753
- /* @__PURE__ */ React103.createElement(
6754
- import_ui89.Box,
7425
+ /* @__PURE__ */ React109.createElement(
7426
+ import_ui93.Box,
6755
7427
  {
6756
7428
  onClick: (e) => {
6757
7429
  e.stopPropagation();
@@ -6759,18 +7431,19 @@ var PromotionTrigger = (0, import_react54.forwardRef)(
6759
7431
  },
6760
7432
  sx: { cursor: "pointer", display: "inline-flex" }
6761
7433
  },
6762
- children ?? /* @__PURE__ */ React103.createElement(import_editor_ui14.PromotionChip, null)
7434
+ children ?? /* @__PURE__ */ React109.createElement(import_editor_ui16.PromotionChip, null)
6763
7435
  )
6764
7436
  ));
6765
7437
  }
6766
7438
  );
6767
7439
 
6768
7440
  // src/components/promotions/display-conditions-control.tsx
6769
- var ARIA_LABEL = (0, import_i18n52.__)("Display Conditions", "elementor");
7441
+ var ARIA_LABEL = (0, import_i18n53.__)("Display Conditions", "elementor");
7442
+ var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
6770
7443
  var DisplayConditionsControl = createControl(() => {
6771
- const triggerRef = (0, import_react55.useRef)(null);
6772
- return /* @__PURE__ */ React104.createElement(
6773
- import_ui90.Stack,
7444
+ const triggerRef = (0, import_react60.useRef)(null);
7445
+ return /* @__PURE__ */ React110.createElement(
7446
+ import_ui94.Stack,
6774
7447
  {
6775
7448
  direction: "row",
6776
7449
  spacing: 2,
@@ -6779,9 +7452,9 @@ var DisplayConditionsControl = createControl(() => {
6779
7452
  alignItems: "center"
6780
7453
  }
6781
7454
  },
6782
- /* @__PURE__ */ React104.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions" }),
6783
- /* @__PURE__ */ React104.createElement(import_ui90.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React104.createElement(
6784
- import_ui90.IconButton,
7455
+ /* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
7456
+ /* @__PURE__ */ React110.createElement(import_ui94.Tooltip, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
7457
+ import_ui94.IconButton,
6785
7458
  {
6786
7459
  size: "tiny",
6787
7460
  "aria-label": ARIA_LABEL,
@@ -6793,22 +7466,23 @@ var DisplayConditionsControl = createControl(() => {
6793
7466
  borderRadius: 1
6794
7467
  }
6795
7468
  },
6796
- /* @__PURE__ */ React104.createElement(import_icons34.SitemapIcon, { fontSize: "tiny", color: "disabled" })
7469
+ /* @__PURE__ */ React110.createElement(import_icons36.SitemapIcon, { fontSize: "tiny", color: "disabled" })
6797
7470
  ))
6798
7471
  );
6799
7472
  });
6800
7473
 
6801
7474
  // src/components/promotions/attributes-control.tsx
6802
- var React105 = __toESM(require("react"));
6803
- var import_react56 = require("react");
6804
- var import_icons35 = require("@elementor/icons");
6805
- var import_ui91 = require("@elementor/ui");
6806
- var import_i18n53 = require("@wordpress/i18n");
6807
- var ARIA_LABEL2 = (0, import_i18n53.__)("Attributes", "elementor");
7475
+ var React111 = __toESM(require("react"));
7476
+ var import_react61 = require("react");
7477
+ var import_icons37 = require("@elementor/icons");
7478
+ var import_ui95 = require("@elementor/ui");
7479
+ var import_i18n54 = require("@wordpress/i18n");
7480
+ var ARIA_LABEL2 = (0, import_i18n54.__)("Attributes", "elementor");
7481
+ var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
6808
7482
  var AttributesControl = createControl(() => {
6809
- const triggerRef = (0, import_react56.useRef)(null);
6810
- return /* @__PURE__ */ React105.createElement(
6811
- import_ui91.Stack,
7483
+ const triggerRef = (0, import_react61.useRef)(null);
7484
+ return /* @__PURE__ */ React111.createElement(
7485
+ import_ui95.Stack,
6812
7486
  {
6813
7487
  direction: "row",
6814
7488
  spacing: 2,
@@ -6817,9 +7491,9 @@ var AttributesControl = createControl(() => {
6817
7491
  alignItems: "center"
6818
7492
  }
6819
7493
  },
6820
- /* @__PURE__ */ React105.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes" }),
6821
- /* @__PURE__ */ React105.createElement(import_ui91.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React105.createElement(
6822
- import_icons35.PlusIcon,
7494
+ /* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
7495
+ /* @__PURE__ */ React111.createElement(import_ui95.Tooltip, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
7496
+ import_icons37.PlusIcon,
6823
7497
  {
6824
7498
  "aria-label": ARIA_LABEL2,
6825
7499
  fontSize: "tiny",
@@ -6832,22 +7506,22 @@ var AttributesControl = createControl(() => {
6832
7506
  });
6833
7507
 
6834
7508
  // src/components/icon-buttons/clear-icon-button.tsx
6835
- var React106 = __toESM(require("react"));
6836
- var import_icons36 = require("@elementor/icons");
6837
- var import_ui92 = require("@elementor/ui");
6838
- var CustomIconButton = (0, import_ui92.styled)(import_ui92.IconButton)(({ theme }) => ({
7509
+ var React112 = __toESM(require("react"));
7510
+ var import_icons38 = require("@elementor/icons");
7511
+ var import_ui96 = require("@elementor/ui");
7512
+ var CustomIconButton = (0, import_ui96.styled)(import_ui96.IconButton)(({ theme }) => ({
6839
7513
  width: theme.spacing(2.5),
6840
7514
  height: theme.spacing(2.5)
6841
7515
  }));
6842
- var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React106.createElement(import_ui92.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React106.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React106.createElement(import_icons36.BrushBigIcon, { fontSize: size })));
7516
+ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React112.createElement(import_ui96.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React112.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React112.createElement(import_icons38.BrushBigIcon, { fontSize: size })));
6843
7517
 
6844
7518
  // src/components/repeater/repeater.tsx
6845
- var React107 = __toESM(require("react"));
6846
- var import_react57 = require("react");
6847
- var import_icons37 = require("@elementor/icons");
6848
- var import_ui93 = require("@elementor/ui");
6849
- var import_i18n54 = require("@wordpress/i18n");
6850
- var SIZE10 = "tiny";
7519
+ var React113 = __toESM(require("react"));
7520
+ var import_react62 = require("react");
7521
+ var import_icons39 = require("@elementor/icons");
7522
+ var import_ui97 = require("@elementor/ui");
7523
+ var import_i18n55 = require("@wordpress/i18n");
7524
+ var SIZE11 = "tiny";
6851
7525
  var EMPTY_OPEN_ITEM2 = -1;
6852
7526
  var Repeater3 = ({
6853
7527
  label,
@@ -6864,7 +7538,7 @@ var Repeater3 = ({
6864
7538
  openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
6865
7539
  isSortable = true
6866
7540
  }) => {
6867
- const [openItem, setOpenItem] = (0, import_react57.useState)(initialOpenItem);
7541
+ const [openItem, setOpenItem] = (0, import_react62.useState)(initialOpenItem);
6868
7542
  const uniqueKeys = items2.map(
6869
7543
  (item, index) => isSortable && "getId" in itemSettings ? itemSettings.getId({ item, index }) : String(index)
6870
7544
  );
@@ -6927,41 +7601,41 @@ var Repeater3 = ({
6927
7601
  };
6928
7602
  const isButtonDisabled = disabled || disableAddItemButton;
6929
7603
  const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
6930
- const addButton = /* @__PURE__ */ React107.createElement(
6931
- import_ui93.IconButton,
7604
+ const addButton = /* @__PURE__ */ React113.createElement(
7605
+ import_ui97.IconButton,
6932
7606
  {
6933
- size: SIZE10,
7607
+ size: SIZE11,
6934
7608
  sx: {
6935
7609
  ml: "auto"
6936
7610
  },
6937
7611
  disabled: isButtonDisabled,
6938
7612
  onClick: addRepeaterItem,
6939
- "aria-label": (0, import_i18n54.__)("Add item", "elementor")
7613
+ "aria-label": (0, import_i18n55.__)("Add item", "elementor")
6940
7614
  },
6941
- /* @__PURE__ */ React107.createElement(import_icons37.PlusIcon, { fontSize: SIZE10 })
7615
+ /* @__PURE__ */ React113.createElement(import_icons39.PlusIcon, { fontSize: SIZE11 })
6942
7616
  );
6943
- return /* @__PURE__ */ React107.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React107.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React107.createElement(
6944
- import_ui93.Infotip,
7617
+ return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
7618
+ import_ui97.Infotip,
6945
7619
  {
6946
7620
  placement: "right",
6947
7621
  content: addButtonInfotipContent,
6948
7622
  color: "secondary",
6949
7623
  slotProps: { popper: { sx: { width: 300 } } }
6950
7624
  },
6951
- /* @__PURE__ */ React107.createElement(import_ui93.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
6952
- ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React107.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
7625
+ /* @__PURE__ */ React113.createElement(import_ui97.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
7626
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6953
7627
  const index = uniqueKeys.indexOf(key);
6954
7628
  const value = items2[index];
6955
7629
  if (!value) {
6956
7630
  return null;
6957
7631
  }
6958
- return /* @__PURE__ */ React107.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React107.createElement(
7632
+ return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
6959
7633
  RepeaterItem,
6960
7634
  {
6961
7635
  disabled,
6962
7636
  propDisabled: value?.disabled,
6963
- label: /* @__PURE__ */ React107.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React107.createElement(itemSettings.Label, { value, index })),
6964
- startIcon: /* @__PURE__ */ React107.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React107.createElement(itemSettings.Icon, { value })),
7637
+ label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
7638
+ startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
6965
7639
  removeItem: () => removeRepeaterItem(index),
6966
7640
  duplicateItem: () => duplicateRepeaterItem(index),
6967
7641
  toggleDisableItem: () => toggleDisableRepeaterItem(index),
@@ -6973,7 +7647,7 @@ var Repeater3 = ({
6973
7647
  actions: itemSettings.actions,
6974
7648
  value
6975
7649
  },
6976
- (props) => /* @__PURE__ */ React107.createElement(
7650
+ (props) => /* @__PURE__ */ React113.createElement(
6977
7651
  itemSettings.Content,
6978
7652
  {
6979
7653
  ...props,
@@ -7003,27 +7677,27 @@ var RepeaterItem = ({
7003
7677
  value
7004
7678
  }) => {
7005
7679
  const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
7006
- const duplicateLabel = (0, import_i18n54.__)("Duplicate", "elementor");
7007
- const toggleLabel = propDisabled ? (0, import_i18n54.__)("Show", "elementor") : (0, import_i18n54.__)("Hide", "elementor");
7008
- const removeLabel = (0, import_i18n54.__)("Remove", "elementor");
7009
- return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
7680
+ const duplicateLabel = (0, import_i18n55.__)("Duplicate", "elementor");
7681
+ const toggleLabel = propDisabled ? (0, import_i18n55.__)("Show", "elementor") : (0, import_i18n55.__)("Hide", "elementor");
7682
+ const removeLabel = (0, import_i18n55.__)("Remove", "elementor");
7683
+ return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
7010
7684
  RepeaterTag,
7011
7685
  {
7012
7686
  disabled,
7013
7687
  label,
7014
7688
  ref: setRef,
7015
- "aria-label": (0, import_i18n54.__)("Open item", "elementor"),
7016
- ...(0, import_ui93.bindTrigger)(popoverState),
7689
+ "aria-label": (0, import_i18n55.__)("Open item", "elementor"),
7690
+ ...(0, import_ui97.bindTrigger)(popoverState),
7017
7691
  startIcon,
7018
- actions: /* @__PURE__ */ React107.createElement(React107.Fragment, null, showDuplicate && /* @__PURE__ */ React107.createElement(import_ui93.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(import_ui93.IconButton, { size: SIZE10, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React107.createElement(import_icons37.CopyIcon, { fontSize: SIZE10 }))), showToggle && /* @__PURE__ */ React107.createElement(import_ui93.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(import_ui93.IconButton, { size: SIZE10, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React107.createElement(import_icons37.EyeOffIcon, { fontSize: SIZE10 }) : /* @__PURE__ */ React107.createElement(import_icons37.EyeIcon, { fontSize: SIZE10 }))), actions?.(value), showRemove && /* @__PURE__ */ React107.createElement(import_ui93.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React107.createElement(import_ui93.IconButton, { size: SIZE10, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React107.createElement(import_icons37.XIcon, { fontSize: SIZE10 }))))
7692
+ actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(import_icons39.CopyIcon, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(import_icons39.EyeOffIcon, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(import_icons39.EyeIcon, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(import_ui97.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(import_ui97.IconButton, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(import_icons39.XIcon, { fontSize: SIZE11 }))))
7019
7693
  }
7020
- ), /* @__PURE__ */ React107.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React107.createElement(import_ui93.Box, null, children({ anchorEl: ref }))));
7694
+ ), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(import_ui97.Box, null, children({ anchorEl: ref }))));
7021
7695
  };
7022
7696
  var usePopover = (openOnMount, onOpen) => {
7023
- const [ref, setRef] = (0, import_react57.useState)(null);
7024
- const popoverState = (0, import_ui93.usePopupState)({ variant: "popover" });
7025
- const popoverProps = (0, import_ui93.bindPopover)(popoverState);
7026
- (0, import_react57.useEffect)(() => {
7697
+ const [ref, setRef] = (0, import_react62.useState)(null);
7698
+ const popoverState = (0, import_ui97.usePopupState)({ variant: "popover" });
7699
+ const popoverProps = (0, import_ui97.bindPopover)(popoverState);
7700
+ (0, import_react62.useEffect)(() => {
7027
7701
  if (openOnMount && ref) {
7028
7702
  popoverState.open(ref);
7029
7703
  onOpen?.();
@@ -7038,20 +7712,20 @@ var usePopover = (openOnMount, onOpen) => {
7038
7712
  };
7039
7713
 
7040
7714
  // src/components/inline-editor-toolbar.tsx
7041
- var React109 = __toESM(require("react"));
7042
- var import_react59 = require("react");
7043
- var import_editor_elements5 = require("@elementor/editor-elements");
7044
- var import_icons39 = require("@elementor/icons");
7045
- var import_ui95 = require("@elementor/ui");
7046
- var import_react60 = require("@tiptap/react");
7047
- var import_i18n56 = require("@wordpress/i18n");
7715
+ var React115 = __toESM(require("react"));
7716
+ var import_react64 = require("react");
7717
+ var import_editor_elements6 = require("@elementor/editor-elements");
7718
+ var import_icons41 = require("@elementor/icons");
7719
+ var import_ui99 = require("@elementor/ui");
7720
+ var import_react65 = require("@tiptap/react");
7721
+ var import_i18n57 = require("@wordpress/i18n");
7048
7722
 
7049
7723
  // src/components/url-popover.tsx
7050
- var React108 = __toESM(require("react"));
7051
- var import_react58 = require("react");
7052
- var import_icons38 = require("@elementor/icons");
7053
- var import_ui94 = require("@elementor/ui");
7054
- var import_i18n55 = require("@wordpress/i18n");
7724
+ var React114 = __toESM(require("react"));
7725
+ var import_react63 = require("react");
7726
+ var import_icons40 = require("@elementor/icons");
7727
+ var import_ui98 = require("@elementor/ui");
7728
+ var import_i18n56 = require("@wordpress/i18n");
7055
7729
  var UrlPopover = ({
7056
7730
  popupState,
7057
7731
  restoreValue,
@@ -7061,8 +7735,8 @@ var UrlPopover = ({
7061
7735
  openInNewTab,
7062
7736
  onToggleNewTab
7063
7737
  }) => {
7064
- const inputRef = (0, import_react58.useRef)(null);
7065
- (0, import_react58.useEffect)(() => {
7738
+ const inputRef = (0, import_react63.useRef)(null);
7739
+ (0, import_react63.useEffect)(() => {
7066
7740
  if (popupState.isOpen) {
7067
7741
  requestAnimationFrame(() => inputRef.current?.focus());
7068
7742
  }
@@ -7071,57 +7745,57 @@ var UrlPopover = ({
7071
7745
  restoreValue();
7072
7746
  popupState.close();
7073
7747
  };
7074
- return /* @__PURE__ */ React108.createElement(
7075
- import_ui94.Popover,
7748
+ return /* @__PURE__ */ React114.createElement(
7749
+ import_ui98.Popover,
7076
7750
  {
7077
7751
  slotProps: {
7078
7752
  paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
7079
7753
  },
7080
- ...(0, import_ui94.bindPopover)(popupState),
7754
+ ...(0, import_ui98.bindPopover)(popupState),
7081
7755
  anchorOrigin: { vertical: "top", horizontal: "left" },
7082
7756
  transformOrigin: { vertical: "top", horizontal: "left" },
7083
7757
  onClose: handleClose
7084
7758
  },
7085
- /* @__PURE__ */ React108.createElement(import_ui94.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React108.createElement(
7086
- import_ui94.TextField,
7759
+ /* @__PURE__ */ React114.createElement(import_ui98.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
7760
+ import_ui98.TextField,
7087
7761
  {
7088
7762
  value,
7089
7763
  onChange,
7090
7764
  size: "tiny",
7091
7765
  fullWidth: true,
7092
- placeholder: (0, import_i18n55.__)("Type a URL", "elementor"),
7766
+ placeholder: (0, import_i18n56.__)("Type a URL", "elementor"),
7093
7767
  inputProps: { ref: inputRef },
7094
7768
  color: "secondary",
7095
7769
  InputProps: { sx: { borderRadius: "8px" } },
7096
7770
  onKeyUp: (event) => event.key === "Enter" && handleClose()
7097
7771
  }
7098
- ), /* @__PURE__ */ React108.createElement(import_ui94.Tooltip, { title: (0, import_i18n55.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React108.createElement(
7099
- import_ui94.ToggleButton,
7772
+ ), /* @__PURE__ */ React114.createElement(import_ui98.Tooltip, { title: (0, import_i18n56.__)("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
7773
+ import_ui98.ToggleButton,
7100
7774
  {
7101
7775
  size: "tiny",
7102
7776
  value: "newTab",
7103
7777
  selected: openInNewTab,
7104
7778
  onClick: onToggleNewTab,
7105
- "aria-label": (0, import_i18n55.__)("Open in a new tab", "elementor"),
7779
+ "aria-label": (0, import_i18n56.__)("Open in a new tab", "elementor"),
7106
7780
  sx: { borderRadius: "8px" }
7107
7781
  },
7108
- /* @__PURE__ */ React108.createElement(import_icons38.ExternalLinkIcon, { fontSize: "tiny" })
7782
+ /* @__PURE__ */ React114.createElement(import_icons40.ExternalLinkIcon, { fontSize: "tiny" })
7109
7783
  )))
7110
7784
  );
7111
7785
  };
7112
7786
 
7113
7787
  // src/components/inline-editor-toolbar.tsx
7114
7788
  var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7115
- const [urlValue, setUrlValue] = (0, import_react59.useState)("");
7116
- const [openInNewTab, setOpenInNewTab] = (0, import_react59.useState)(false);
7117
- const toolbarRef = (0, import_react59.useRef)(null);
7118
- const linkPopupState = (0, import_ui95.usePopupState)({ variant: "popover" });
7789
+ const [urlValue, setUrlValue] = (0, import_react64.useState)("");
7790
+ const [openInNewTab, setOpenInNewTab] = (0, import_react64.useState)(false);
7791
+ const toolbarRef = (0, import_react64.useRef)(null);
7792
+ const linkPopupState = (0, import_ui99.usePopupState)({ variant: "popover" });
7119
7793
  const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
7120
- const editorState = (0, import_react60.useEditorState)({
7794
+ const editorState = (0, import_react65.useEditorState)({
7121
7795
  editor,
7122
7796
  selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
7123
7797
  });
7124
- const formatButtonsList = (0, import_react59.useMemo)(() => {
7798
+ const formatButtonsList = (0, import_react64.useMemo)(() => {
7125
7799
  const buttons = Object.values(formatButtons);
7126
7800
  if (isElementClickable) {
7127
7801
  return buttons.filter((button) => button.action !== "link");
@@ -7158,11 +7832,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7158
7832
  }
7159
7833
  linkPopupState.close();
7160
7834
  };
7161
- React109.useEffect(() => {
7835
+ React115.useEffect(() => {
7162
7836
  editor?.commands?.focus();
7163
7837
  }, [editor]);
7164
- return /* @__PURE__ */ React109.createElement(
7165
- import_ui95.Box,
7838
+ return /* @__PURE__ */ React115.createElement(
7839
+ import_ui99.Box,
7166
7840
  {
7167
7841
  ref: toolbarRef,
7168
7842
  sx: {
@@ -7178,9 +7852,9 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7178
7852
  ...sx
7179
7853
  }
7180
7854
  },
7181
- /* @__PURE__ */ React109.createElement(import_ui95.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React109.createElement(import_ui95.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
7182
- /* @__PURE__ */ React109.createElement(
7183
- import_ui95.ToggleButtonGroup,
7855
+ /* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React115.createElement(import_ui99.IconButton, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
7856
+ /* @__PURE__ */ React115.createElement(
7857
+ import_ui99.ToggleButtonGroup,
7184
7858
  {
7185
7859
  value: editorState,
7186
7860
  size: "tiny",
@@ -7188,7 +7862,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7188
7862
  display: "flex",
7189
7863
  gap: 0.5,
7190
7864
  border: "none",
7191
- [`& .${import_ui95.toggleButtonGroupClasses.firstButton}, & .${import_ui95.toggleButtonGroupClasses.middleButton}, & .${import_ui95.toggleButtonGroupClasses.lastButton}`]: {
7865
+ [`& .${import_ui99.toggleButtonGroupClasses.firstButton}, & .${import_ui99.toggleButtonGroupClasses.middleButton}, & .${import_ui99.toggleButtonGroupClasses.lastButton}`]: {
7192
7866
  borderRadius: "8px",
7193
7867
  border: "none",
7194
7868
  marginLeft: 0,
@@ -7201,8 +7875,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7201
7875
  }
7202
7876
  }
7203
7877
  },
7204
- formatButtonsList.map((button) => /* @__PURE__ */ React109.createElement(import_ui95.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React109.createElement(
7205
- import_ui95.ToggleButton,
7878
+ formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(import_ui99.Tooltip, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
7879
+ import_ui99.ToggleButton,
7206
7880
  {
7207
7881
  value: button.action,
7208
7882
  "aria-label": button.label,
@@ -7219,7 +7893,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7219
7893
  button.icon
7220
7894
  )))
7221
7895
  ),
7222
- /* @__PURE__ */ React109.createElement(
7896
+ /* @__PURE__ */ React115.createElement(
7223
7897
  UrlPopover,
7224
7898
  {
7225
7899
  popupState: linkPopupState,
@@ -7234,72 +7908,72 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
7234
7908
  );
7235
7909
  };
7236
7910
  var checkIfElementIsClickable = (elementId) => {
7237
- const container = (0, import_editor_elements5.getContainer)(elementId);
7911
+ const container = (0, import_editor_elements6.getContainer)(elementId);
7238
7912
  const type = container?.model.get("widgetType");
7239
7913
  const isButton = type === "e-button";
7240
- const hasLink = !!(0, import_editor_elements5.getElementSetting)(elementId, "link")?.value?.destination;
7914
+ const hasLink = !!(0, import_editor_elements6.getElementSetting)(elementId, "link")?.value?.destination;
7241
7915
  return isButton || hasLink;
7242
7916
  };
7243
7917
  var toolbarButtons = {
7244
7918
  clear: {
7245
- label: (0, import_i18n56.__)("Clear", "elementor"),
7246
- icon: /* @__PURE__ */ React109.createElement(import_icons39.MinusIcon, { fontSize: "tiny" }),
7919
+ label: (0, import_i18n57.__)("Clear", "elementor"),
7920
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.MinusIcon, { fontSize: "tiny" }),
7247
7921
  action: "clear",
7248
7922
  method: (editor) => {
7249
7923
  editor.chain().focus().clearNodes().unsetAllMarks().run();
7250
7924
  }
7251
7925
  },
7252
7926
  bold: {
7253
- label: (0, import_i18n56.__)("Bold", "elementor"),
7254
- icon: /* @__PURE__ */ React109.createElement(import_icons39.BoldIcon, { fontSize: "tiny" }),
7927
+ label: (0, import_i18n57.__)("Bold", "elementor"),
7928
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.BoldIcon, { fontSize: "tiny" }),
7255
7929
  action: "bold",
7256
7930
  method: (editor) => {
7257
7931
  editor.chain().focus().toggleBold().run();
7258
7932
  }
7259
7933
  },
7260
7934
  italic: {
7261
- label: (0, import_i18n56.__)("Italic", "elementor"),
7262
- icon: /* @__PURE__ */ React109.createElement(import_icons39.ItalicIcon, { fontSize: "tiny" }),
7935
+ label: (0, import_i18n57.__)("Italic", "elementor"),
7936
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.ItalicIcon, { fontSize: "tiny" }),
7263
7937
  action: "italic",
7264
7938
  method: (editor) => {
7265
7939
  editor.chain().focus().toggleItalic().run();
7266
7940
  }
7267
7941
  },
7268
7942
  underline: {
7269
- label: (0, import_i18n56.__)("Underline", "elementor"),
7270
- icon: /* @__PURE__ */ React109.createElement(import_icons39.UnderlineIcon, { fontSize: "tiny" }),
7943
+ label: (0, import_i18n57.__)("Underline", "elementor"),
7944
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.UnderlineIcon, { fontSize: "tiny" }),
7271
7945
  action: "underline",
7272
7946
  method: (editor) => {
7273
7947
  editor.chain().focus().toggleUnderline().run();
7274
7948
  }
7275
7949
  },
7276
7950
  strike: {
7277
- label: (0, import_i18n56.__)("Strikethrough", "elementor"),
7278
- icon: /* @__PURE__ */ React109.createElement(import_icons39.StrikethroughIcon, { fontSize: "tiny" }),
7951
+ label: (0, import_i18n57.__)("Strikethrough", "elementor"),
7952
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.StrikethroughIcon, { fontSize: "tiny" }),
7279
7953
  action: "strike",
7280
7954
  method: (editor) => {
7281
7955
  editor.chain().focus().toggleStrike().run();
7282
7956
  }
7283
7957
  },
7284
7958
  superscript: {
7285
- label: (0, import_i18n56.__)("Superscript", "elementor"),
7286
- icon: /* @__PURE__ */ React109.createElement(import_icons39.SuperscriptIcon, { fontSize: "tiny" }),
7959
+ label: (0, import_i18n57.__)("Superscript", "elementor"),
7960
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.SuperscriptIcon, { fontSize: "tiny" }),
7287
7961
  action: "superscript",
7288
7962
  method: (editor) => {
7289
7963
  editor.chain().focus().toggleSuperscript().run();
7290
7964
  }
7291
7965
  },
7292
7966
  subscript: {
7293
- label: (0, import_i18n56.__)("Subscript", "elementor"),
7294
- icon: /* @__PURE__ */ React109.createElement(import_icons39.SubscriptIcon, { fontSize: "tiny" }),
7967
+ label: (0, import_i18n57.__)("Subscript", "elementor"),
7968
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.SubscriptIcon, { fontSize: "tiny" }),
7295
7969
  action: "subscript",
7296
7970
  method: (editor) => {
7297
7971
  editor.chain().focus().toggleSubscript().run();
7298
7972
  }
7299
7973
  },
7300
7974
  link: {
7301
- label: (0, import_i18n56.__)("Link", "elementor"),
7302
- icon: /* @__PURE__ */ React109.createElement(import_icons39.LinkIcon, { fontSize: "tiny" }),
7975
+ label: (0, import_i18n57.__)("Link", "elementor"),
7976
+ icon: /* @__PURE__ */ React115.createElement(import_icons41.LinkIcon, { fontSize: "tiny" }),
7303
7977
  action: "link",
7304
7978
  method: null
7305
7979
  }
@@ -7308,13 +7982,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
7308
7982
  var possibleFormats = Object.keys(formatButtons);
7309
7983
 
7310
7984
  // src/components/size/unstable-size-field.tsx
7311
- var React112 = __toESM(require("react"));
7312
- var import_ui97 = require("@elementor/ui");
7985
+ var React118 = __toESM(require("react"));
7986
+ var import_ui101 = require("@elementor/ui");
7313
7987
 
7314
7988
  // src/hooks/use-size-value.ts
7315
7989
  var DEFAULT_UNIT2 = "px";
7316
- var DEFAULT_SIZE2 = "";
7317
- var useSizeValue = (externalValue, onChange, defaultUnit) => {
7990
+ var DEFAULT_SIZE3 = "";
7991
+ var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
7318
7992
  const [sizeValue, setSizeValue] = useSyncExternalState({
7319
7993
  external: externalValue,
7320
7994
  setExternal: (newState) => {
@@ -7323,7 +7997,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
7323
7997
  }
7324
7998
  },
7325
7999
  persistWhen: (newState) => differsFromExternal(newState, externalValue),
7326
- fallback: () => ({ size: DEFAULT_SIZE2, unit: defaultUnit ?? DEFAULT_UNIT2 })
8000
+ fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
7327
8001
  });
7328
8002
  const setSize = (value) => {
7329
8003
  const newState = {
@@ -7351,44 +8025,44 @@ var differsFromExternal = (newState, externalState) => {
7351
8025
  };
7352
8026
 
7353
8027
  // src/components/size/unit-select.tsx
7354
- var React110 = __toESM(require("react"));
7355
- var import_react61 = require("react");
7356
- var import_editor_ui15 = require("@elementor/editor-ui");
7357
- var import_ui96 = require("@elementor/ui");
7358
- var menuItemContentStyles = {
8028
+ var React116 = __toESM(require("react"));
8029
+ var import_react66 = require("react");
8030
+ var import_editor_ui17 = require("@elementor/editor-ui");
8031
+ var import_ui100 = require("@elementor/ui");
8032
+ var menuItemContentStyles2 = {
7359
8033
  display: "flex",
7360
8034
  flexDirection: "column",
7361
8035
  justifyContent: "center"
7362
8036
  };
7363
8037
  var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
7364
- const popupState = (0, import_ui96.usePopupState)({
8038
+ const popupState = (0, import_ui100.usePopupState)({
7365
8039
  variant: "popover",
7366
- popupId: (0, import_react61.useId)()
8040
+ popupId: (0, import_react66.useId)()
7367
8041
  });
7368
8042
  const handleMenuItemClick = (index) => {
7369
8043
  onClick(options[index]);
7370
8044
  popupState.close();
7371
8045
  };
7372
- return /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement(StyledButton2, { isPrimaryColor: showPrimaryColor, size: "small", ...(0, import_ui96.bindTrigger)(popupState) }, value), /* @__PURE__ */ React110.createElement(import_ui96.Menu, { MenuListProps: { dense: true }, ...(0, import_ui96.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React110.createElement(
7373
- import_editor_ui15.MenuListItem,
8046
+ return /* @__PURE__ */ React116.createElement(React116.Fragment, null, /* @__PURE__ */ React116.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...(0, import_ui100.bindTrigger)(popupState) }, value), /* @__PURE__ */ React116.createElement(import_ui100.Menu, { MenuListProps: { dense: true }, ...(0, import_ui100.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React116.createElement(
8047
+ import_editor_ui17.MenuListItem,
7374
8048
  {
7375
8049
  key: option,
7376
8050
  onClick: () => handleMenuItemClick(index),
7377
8051
  primaryTypographyProps: {
7378
8052
  variant: "caption",
7379
8053
  sx: {
7380
- ...menuItemContentStyles,
8054
+ ...menuItemContentStyles2,
7381
8055
  lineHeight: "1"
7382
8056
  }
7383
8057
  },
7384
8058
  menuItemTextProps: {
7385
- sx: menuItemContentStyles
8059
+ sx: menuItemContentStyles2
7386
8060
  }
7387
8061
  },
7388
8062
  option.toUpperCase()
7389
8063
  ))));
7390
8064
  };
7391
- var StyledButton2 = (0, import_ui96.styled)(import_ui96.Button, {
8065
+ var StyledButton3 = (0, import_ui100.styled)(import_ui100.Button, {
7392
8066
  shouldForwardProp: (prop) => prop !== "isPrimaryColor"
7393
8067
  })(({ isPrimaryColor, theme }) => ({
7394
8068
  color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
@@ -7398,11 +8072,11 @@ var StyledButton2 = (0, import_ui96.styled)(import_ui96.Button, {
7398
8072
  }));
7399
8073
 
7400
8074
  // src/components/size/unstable-size-input.tsx
7401
- var React111 = __toESM(require("react"));
7402
- var import_react62 = require("react");
7403
- var UnstableSizeInput = (0, import_react62.forwardRef)(
8075
+ var React117 = __toESM(require("react"));
8076
+ var import_react67 = require("react");
8077
+ var UnstableSizeInput = (0, import_react67.forwardRef)(
7404
8078
  ({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
7405
- return /* @__PURE__ */ React111.createElement(
8079
+ return /* @__PURE__ */ React117.createElement(
7406
8080
  NumberInput,
7407
8081
  {
7408
8082
  ref,
@@ -7417,12 +8091,12 @@ var UnstableSizeInput = (0, import_react62.forwardRef)(
7417
8091
  onInput: onChange,
7418
8092
  onBlur,
7419
8093
  InputProps,
7420
- sx: getCursorStyle(InputProps?.readOnly ?? false)
8094
+ sx: getCursorStyle2(InputProps?.readOnly ?? false)
7421
8095
  }
7422
8096
  );
7423
8097
  }
7424
8098
  );
7425
- var getCursorStyle = (readOnly) => ({
8099
+ var getCursorStyle2 = (readOnly) => ({
7426
8100
  input: { cursor: readOnly ? "default !important" : void 0 }
7427
8101
  });
7428
8102
 
@@ -7436,11 +8110,11 @@ var UnstableSizeField = ({
7436
8110
  defaultUnit,
7437
8111
  startIcon
7438
8112
  }) => {
7439
- const { size, unit, setSize, setUnit } = useSizeValue(value, onChange, defaultUnit);
7440
- const shouldHighlightUnit = () => {
8113
+ const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
8114
+ const shouldHighlightUnit2 = () => {
7441
8115
  return hasValue(size);
7442
8116
  };
7443
- return /* @__PURE__ */ React112.createElement(
8117
+ return /* @__PURE__ */ React118.createElement(
7444
8118
  UnstableSizeInput,
7445
8119
  {
7446
8120
  type: "number",
@@ -7449,14 +8123,14 @@ var UnstableSizeField = ({
7449
8123
  onChange: (event) => setSize(event.target.value),
7450
8124
  InputProps: {
7451
8125
  ...InputProps,
7452
- startAdornment: startIcon && /* @__PURE__ */ React112.createElement(import_ui97.InputAdornment, { position: "start" }, startIcon),
7453
- endAdornment: /* @__PURE__ */ React112.createElement(import_ui97.InputAdornment, { position: "end" }, /* @__PURE__ */ React112.createElement(
8126
+ startAdornment: startIcon && /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "start" }, startIcon),
8127
+ endAdornment: /* @__PURE__ */ React118.createElement(import_ui101.InputAdornment, { position: "end" }, /* @__PURE__ */ React118.createElement(
7454
8128
  UnitSelect,
7455
8129
  {
7456
8130
  options: units2,
7457
8131
  value: unit,
7458
8132
  onClick: setUnit,
7459
- showPrimaryColor: shouldHighlightUnit()
8133
+ showPrimaryColor: shouldHighlightUnit2()
7460
8134
  }
7461
8135
  ))
7462
8136
  }
@@ -7468,41 +8142,35 @@ var hasValue = (value) => {
7468
8142
  };
7469
8143
 
7470
8144
  // src/hooks/use-font-families.ts
7471
- var import_react63 = require("react");
8145
+ var import_react68 = require("react");
7472
8146
  var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
7473
- var import_i18n57 = require("@wordpress/i18n");
7474
- var supportedCategories = {
7475
- system: (0, import_i18n57.__)("System", "elementor"),
7476
- custom: (0, import_i18n57.__)("Custom Fonts", "elementor"),
7477
- googlefonts: (0, import_i18n57.__)("Google Fonts", "elementor")
7478
- };
7479
- var getFontFamilies = () => {
8147
+ var getFontControlConfig = () => {
7480
8148
  const { controls } = (0, import_editor_v1_adapters.getElementorConfig)();
7481
- const options = controls?.font?.options;
7482
- if (!options) {
7483
- return null;
7484
- }
7485
- return options;
8149
+ return controls?.font ?? {};
7486
8150
  };
7487
8151
  var useFontFamilies = () => {
7488
- const fontFamilies = getFontFamilies();
7489
- return (0, import_react63.useMemo)(() => {
7490
- const categoriesOrder = ["system", "custom", "googlefonts"];
7491
- return Object.entries(fontFamilies || {}).reduce((acc, [font, category]) => {
7492
- if (!supportedCategories[category]) {
8152
+ const { groups, options } = getFontControlConfig();
8153
+ return (0, import_react68.useMemo)(() => {
8154
+ if (!groups || !options) {
8155
+ return [];
8156
+ }
8157
+ const groupKeys = Object.keys(groups);
8158
+ const groupIndexMap = new Map(groupKeys.map((key, index) => [key, index]));
8159
+ return Object.entries(options).reduce((acc, [font, category]) => {
8160
+ const groupIndex = groupIndexMap.get(category);
8161
+ if (groupIndex === void 0) {
7493
8162
  return acc;
7494
8163
  }
7495
- const categoryIndex = categoriesOrder.indexOf(category);
7496
- if (!acc[categoryIndex]) {
7497
- acc[categoryIndex] = {
7498
- label: supportedCategories[category],
8164
+ if (!acc[groupIndex]) {
8165
+ acc[groupIndex] = {
8166
+ label: groups[category],
7499
8167
  fonts: []
7500
8168
  };
7501
8169
  }
7502
- acc[categoryIndex].fonts.push(font);
8170
+ acc[groupIndex].fonts.push(font);
7503
8171
  return acc;
7504
8172
  }, []).filter(Boolean);
7505
- }, [fontFamilies]);
8173
+ }, [groups, options]);
7506
8174
  };
7507
8175
  // Annotate the CommonJS export names for ESM import in node:
7508
8176
  0 && (module.exports = {
@@ -7548,6 +8216,7 @@ var useFontFamilies = () => {
7548
8216
  Repeater,
7549
8217
  SelectControl,
7550
8218
  SelectControlWrapper,
8219
+ SizeComponent,
7551
8220
  SizeControl,
7552
8221
  StrokeControl,
7553
8222
  SvgMediaControl,
@@ -7559,6 +8228,7 @@ var useFontFamilies = () => {
7559
8228
  TransformRepeaterControl,
7560
8229
  TransformSettingsControl,
7561
8230
  TransitionRepeaterControl,
8231
+ UnstableSizeControl,
7562
8232
  UnstableSizeField,
7563
8233
  UrlControl,
7564
8234
  VideoMediaControl,
@@ -7571,6 +8241,8 @@ var useFontFamilies = () => {
7571
8241
  injectIntoRepeaterItemLabel,
7572
8242
  isUnitExtendedOption,
7573
8243
  registerControlReplacement,
8244
+ trackUpgradePromotionClick,
8245
+ trackViewPromotion,
7574
8246
  transitionProperties,
7575
8247
  transitionsItemsList,
7576
8248
  useBoundProp,