@elementor/editor-controls 4.2.0-beta1 → 4.3.0-1000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -779,11 +779,11 @@ function useTypingBuffer(options = {}) {
779
779
  var lengthUnits = ["px", "%", "em", "rem", "vw", "vh", "ch"];
780
780
  var angleUnits = ["deg", "rad", "grad", "turn"];
781
781
  var timeUnits = ["s", "ms"];
782
- var defaultExtendedOptions = ["auto", "custom"];
783
782
  var DEFAULT_UNIT = "px";
784
783
  var DEFAULT_SIZE = NaN;
784
+ var extendedOptions = ["auto", "custom"];
785
785
  function isUnitExtendedOption(unit) {
786
- return defaultExtendedOptions.includes(unit);
786
+ return extendedOptions.includes(unit);
787
787
  }
788
788
 
789
789
  // src/components/size-control/text-field-inner-selection.tsx
@@ -1121,13 +1121,13 @@ var TextFieldPopover = (props) => {
1121
1121
  import { useMemo } from "react";
1122
1122
  function useSizeExtendedOptions(options, disableCustom) {
1123
1123
  return useMemo(() => {
1124
- const extendedOptions = [...options];
1125
- if (!disableCustom && !extendedOptions.includes("custom")) {
1126
- extendedOptions.push("custom");
1124
+ const extendedOptions2 = [...options];
1125
+ if (!disableCustom && !extendedOptions2.includes("custom")) {
1126
+ extendedOptions2.push("custom");
1127
1127
  } else if (options.includes("custom")) {
1128
- extendedOptions.splice(extendedOptions.indexOf("custom"), 1);
1128
+ extendedOptions2.splice(extendedOptions2.indexOf("custom"), 1);
1129
1129
  }
1130
- return extendedOptions;
1130
+ return extendedOptions2;
1131
1131
  }, [options, disableCustom]);
1132
1132
  }
1133
1133
 
@@ -1164,6 +1164,11 @@ var useSyncExternalState = ({
1164
1164
  return [internal, setInternalValue];
1165
1165
  };
1166
1166
 
1167
+ // src/controls/size-control/utils/settings/get-prop-type-settings.ts
1168
+ var getPropTypeSettings = (propType) => {
1169
+ return propType.settings;
1170
+ };
1171
+
1167
1172
  // src/controls/size-control.tsx
1168
1173
  var defaultSelectedUnit = {
1169
1174
  length: "px",
@@ -1184,7 +1189,7 @@ var SizeControl = createControl(
1184
1189
  placeholder,
1185
1190
  startIcon,
1186
1191
  anchorRef,
1187
- extendedOptions,
1192
+ extendedOptions: extendedOptions2,
1188
1193
  disableCustom,
1189
1194
  min = 0,
1190
1195
  enablePropTypeUnits = false,
@@ -1201,7 +1206,7 @@ var SizeControl = createControl(
1201
1206
  } = useBoundProp(sizePropTypeUtil2);
1202
1207
  const actualDefaultUnit = defaultUnit ?? externalPlaceholder?.unit ?? defaultSelectedUnit[variant];
1203
1208
  const activeBreakpoint = useActiveBreakpoint();
1204
- const actualExtendedOptions = useSizeExtendedOptions(extendedOptions || [], disableCustom ?? false);
1209
+ const actualExtendedOptions = useSizeExtendedOptions(extendedOptions2 || [], disableCustom ?? false);
1205
1210
  const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
1206
1211
  const popupState = usePopupState2({ variant: "popover" });
1207
1212
  const memorizedExternalState = useMemo2(
@@ -1290,7 +1295,7 @@ function resolveUnits(propType, enablePropTypeUnits, variant, externalUnits, act
1290
1295
  if (!enablePropTypeUnits) {
1291
1296
  return [...externalUnits ?? fallback, ...actualExtendedOptions || []];
1292
1297
  }
1293
- return propType.settings?.available_units ?? fallback;
1298
+ return getPropTypeSettings(propType)?.available_units ?? fallback;
1294
1299
  }
1295
1300
  function formatSize(size, unit) {
1296
1301
  if (isUnitExtendedOption(unit)) {
@@ -3626,11 +3631,6 @@ var resolvePlaceholder = (placeholder) => {
3626
3631
  return typeof size === "number" ? size.toString() : size;
3627
3632
  };
3628
3633
 
3629
- // src/controls/size-control/utils/settings/get-prop-type-settings.ts
3630
- var getPropTypeSettings = (propType) => {
3631
- return propType.settings;
3632
- };
3633
-
3634
3634
  // src/controls/size-control/utils/settings/get-default-unit.ts
3635
3635
  var getDefaultUnit = (propType) => {
3636
3636
  return getPropTypeSettings(propType)?.default_unit;
@@ -5105,7 +5105,7 @@ var GapControl = ({ label }) => {
5105
5105
  const disabled = sizeDisabled || directionDisabled;
5106
5106
  const propProviderProps = {
5107
5107
  propType,
5108
- value: directionValue ?? (!isLinked ? { row: masterPlaceholder, column: masterPlaceholder } : null),
5108
+ value: directionValue ?? (!isLinked ? { row: directionPlaceholder?.row, column: directionPlaceholder?.column } : null),
5109
5109
  setValue: (directions) => {
5110
5110
  const entries = Object.entries(directions);
5111
5111
  const filtered = entries.filter(([, value]) => Boolean(value));
@@ -7297,7 +7297,6 @@ import { __ as __53 } from "@wordpress/i18n";
7297
7297
  import { getSelectedElements as getSelectedElements2 } from "@elementor/editor-elements";
7298
7298
  import { getMixpanel } from "@elementor/events";
7299
7299
  var getBaseEventProperties = (data, config) => ({
7300
- app_type: config?.appTypes?.editor ?? "editor",
7301
7300
  window_name: config?.appTypes?.editor ?? "editor",
7302
7301
  interaction_type: config?.triggers?.click ?? "Click",
7303
7302
  target_name: data.target_name,
@@ -8300,7 +8299,7 @@ var shouldShowMentionsInfo = () => {
8300
8299
  };
8301
8300
 
8302
8301
  // src/controls/email-form-action-control/email-chips-field.tsx
8303
- var EmailChipsField = ({ fieldLabel, placeholder }) => {
8302
+ var EmailChipsControl = createControl(({ placeholder }) => {
8304
8303
  const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
8305
8304
  const [inputValue, setInputValue] = useState19("");
8306
8305
  const items2 = value || [];
@@ -8336,7 +8335,7 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
8336
8335
  tryAddChip(inputValue);
8337
8336
  }
8338
8337
  };
8339
- return /* @__PURE__ */ React116.createElement(Grid32, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(
8338
+ return /* @__PURE__ */ React116.createElement(ControlActions, null, /* @__PURE__ */ React116.createElement(
8340
8339
  Autocomplete4,
8341
8340
  {
8342
8341
  fullWidth: true,
@@ -8359,8 +8358,9 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
8359
8358
  renderInput: (params) => /* @__PURE__ */ React116.createElement(TextField11, { ...params, placeholder, onKeyDown: handleKeyDown }),
8360
8359
  renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React116.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
8361
8360
  }
8362
- )));
8363
- };
8361
+ ));
8362
+ });
8363
+ var EmailChipsField = ({ fieldLabel, placeholder }) => /* @__PURE__ */ React116.createElement(Grid32, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React116.createElement(Grid32, { item: true }, /* @__PURE__ */ React116.createElement(EmailChipsControl, { placeholder })));
8364
8364
 
8365
8365
  // src/controls/email-form-action-control/email-field.tsx
8366
8366
  import * as React117 from "react";
@@ -8368,7 +8368,7 @@ import { Grid as Grid33 } from "@elementor/ui";
8368
8368
  var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React117.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React117.createElement(Grid33, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React117.createElement(Grid33, { item: true }, /* @__PURE__ */ React117.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React117.createElement(Grid33, { item: true }, /* @__PURE__ */ React117.createElement(TextControl, { placeholder }))));
8369
8369
 
8370
8370
  // src/controls/email-form-action-control/fields.tsx
8371
- var SendToField = ({ placeholder }) => /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: __57("Send to", "elementor"), placeholder });
8371
+ var SendToField = ({ placeholder }) => /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React118.createElement(EmailChipsField, { fieldLabel: __57("Send to", "elementor"), placeholder }));
8372
8372
  var SubjectField = () => /* @__PURE__ */ React118.createElement(
8373
8373
  EmailField,
8374
8374
  {
@@ -8440,7 +8440,7 @@ var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider,
8440
8440
  var EmailFormActionControl = createControl(
8441
8441
  ({ toPlaceholder, label }) => {
8442
8442
  const { value, setValue, ...propContext } = useBoundProp(emailsPropTypeUtil);
8443
- return /* @__PURE__ */ React119.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React119.createElement(Stack20, { gap: 2 }, /* @__PURE__ */ React119.createElement(ControlLabel, null, label ? label + " " + __58("settings", "elementor") : __58("Email settings", "elementor")), /* @__PURE__ */ React119.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React119.createElement(SendToField, { placeholder: toPlaceholder })), /* @__PURE__ */ React119.createElement(SubjectField, null), /* @__PURE__ */ React119.createElement(MessageField, null), /* @__PURE__ */ React119.createElement(FromEmailField, null), /* @__PURE__ */ React119.createElement(AdvancedSettings, null)));
8443
+ return /* @__PURE__ */ React119.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React119.createElement(Stack20, { gap: 2 }, /* @__PURE__ */ React119.createElement(ControlLabel, null, label ? label + " " + __58("settings", "elementor") : __58("Email settings", "elementor")), /* @__PURE__ */ React119.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React119.createElement(SubjectField, null), /* @__PURE__ */ React119.createElement(MessageField, null), /* @__PURE__ */ React119.createElement(FromEmailField, null), /* @__PURE__ */ React119.createElement(AdvancedSettings, null)));
8444
8444
  }
8445
8445
  );
8446
8446
  var AdvancedSettings = () => /* @__PURE__ */ React119.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React119.createElement(Box26, { sx: { pt: 2 } }, /* @__PURE__ */ React119.createElement(Stack20, { gap: 2 }, /* @__PURE__ */ React119.createElement(FromNameField, null), /* @__PURE__ */ React119.createElement(ReplyToField, null), /* @__PURE__ */ React119.createElement(CcField, null), /* @__PURE__ */ React119.createElement(BccField, null), /* @__PURE__ */ React119.createElement(Divider5, null), /* @__PURE__ */ React119.createElement(MetaDataField, null), /* @__PURE__ */ React119.createElement(SendAsField, null))));
@@ -8661,7 +8661,8 @@ var Repeater3 = ({
8661
8661
  disableAddItemButton = false,
8662
8662
  addButtonInfotipContent,
8663
8663
  openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
8664
- isSortable = true
8664
+ isSortable = true,
8665
+ adornment = ControlAdornments
8665
8666
  }) => {
8666
8667
  const [openItem, setOpenItem] = useState21(initialOpenItem);
8667
8668
  const uniqueKeys = items2.map(
@@ -8739,7 +8740,7 @@ var Repeater3 = ({
8739
8740
  },
8740
8741
  /* @__PURE__ */ React126.createElement(PlusIcon5, { fontSize: SIZE12 })
8741
8742
  );
8742
- return /* @__PURE__ */ React126.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React126.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React126.createElement(
8743
+ return /* @__PURE__ */ React126.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React126.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React126.createElement(
8743
8744
  Infotip4,
8744
8745
  {
8745
8746
  placement: "right",