@elementor/editor-controls 4.3.0-965 → 4.3.0-967

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;
@@ -8299,7 +8299,7 @@ var shouldShowMentionsInfo = () => {
8299
8299
  };
8300
8300
 
8301
8301
  // src/controls/email-form-action-control/email-chips-field.tsx
8302
- var EmailChipsField = ({ fieldLabel, placeholder }) => {
8302
+ var EmailChipsControl = createControl(({ placeholder }) => {
8303
8303
  const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
8304
8304
  const [inputValue, setInputValue] = useState19("");
8305
8305
  const items2 = value || [];
@@ -8335,7 +8335,7 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
8335
8335
  tryAddChip(inputValue);
8336
8336
  }
8337
8337
  };
8338
- 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(
8339
8339
  Autocomplete4,
8340
8340
  {
8341
8341
  fullWidth: true,
@@ -8358,8 +8358,9 @@ var EmailChipsField = ({ fieldLabel, placeholder }) => {
8358
8358
  renderInput: (params) => /* @__PURE__ */ React116.createElement(TextField11, { ...params, placeholder, onKeyDown: handleKeyDown }),
8359
8359
  renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React116.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
8360
8360
  }
8361
- )));
8362
- };
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 })));
8363
8364
 
8364
8365
  // src/controls/email-form-action-control/email-field.tsx
8365
8366
  import * as React117 from "react";
@@ -8367,7 +8368,7 @@ import { Grid as Grid33 } from "@elementor/ui";
8367
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 }))));
8368
8369
 
8369
8370
  // src/controls/email-form-action-control/fields.tsx
8370
- 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 }));
8371
8372
  var SubjectField = () => /* @__PURE__ */ React118.createElement(
8372
8373
  EmailField,
8373
8374
  {
@@ -8439,7 +8440,7 @@ var SendAsField = () => /* @__PURE__ */ React118.createElement(PropKeyProvider,
8439
8440
  var EmailFormActionControl = createControl(
8440
8441
  ({ toPlaceholder, label }) => {
8441
8442
  const { value, setValue, ...propContext } = useBoundProp(emailsPropTypeUtil);
8442
- 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)));
8443
8444
  }
8444
8445
  );
8445
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))));