@elementor/editor-controls 3.33.0-177 → 3.33.0-178

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.d.mts CHANGED
@@ -14,19 +14,21 @@ type ImageControlProps = {
14
14
  };
15
15
  declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
16
16
 
17
- declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, }: {
17
+ declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel, }: {
18
18
  placeholder?: string;
19
19
  error?: boolean;
20
20
  inputValue?: string;
21
21
  inputDisabled?: boolean;
22
22
  helperText?: string;
23
23
  sx?: SxProps;
24
+ ariaLabel?: string;
24
25
  }) => React$1.JSX.Element>;
25
26
 
26
27
  type Props$7 = {
27
28
  placeholder?: string;
29
+ ariaLabel?: string;
28
30
  };
29
- declare const TextAreaControl: ControlComponent<({ placeholder }: Props$7) => React$1.JSX.Element>;
31
+ declare const TextAreaControl: ControlComponent<({ placeholder, ariaLabel }: Props$7) => React$1.JSX.Element>;
30
32
 
31
33
  declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
32
34
  declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
@@ -85,8 +87,9 @@ type SelectControlProps = {
85
87
  options: SelectOption$1[];
86
88
  onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
87
89
  MenuProps?: SelectProps['MenuProps'];
90
+ ariaLabel?: string;
88
91
  };
89
- declare const SelectControl: ControlComponent<({ options, onChange, MenuProps }: SelectControlProps) => React$1.JSX.Element>;
92
+ declare const SelectControl: ControlComponent<({ options, onChange, MenuProps, ariaLabel }: SelectControlProps) => React$1.JSX.Element>;
90
93
 
91
94
  declare const collectionMethods: {
92
95
  readonly 'off-canvas': () => SelectOption$1[];
@@ -214,8 +217,9 @@ type ItemSelectorProps = {
214
217
  };
215
218
  declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
216
219
 
217
- declare const UrlControl: ControlComponent<({ placeholder }: {
220
+ declare const UrlControl: ControlComponent<({ placeholder, ariaLabel }: {
218
221
  placeholder?: string;
222
+ ariaLabel?: string;
219
223
  }) => React$1.JSX.Element>;
220
224
 
221
225
  type ControlProps<TControlProps = unknown> = TControlProps & {
@@ -233,6 +237,7 @@ type Props$3 = ControlProps<{
233
237
  minInputLength?: number;
234
238
  placeholder?: string;
235
239
  label?: string;
240
+ ariaLabel?: string;
236
241
  }>;
237
242
  type DestinationProp = LinkPropValue['value']['destination'];
238
243
  declare const LinkControl: ControlComponent<(props: Props$3) => React$1.JSX.Element>;
@@ -258,6 +263,7 @@ type Props$1 = {
258
263
  minInputLength?: number;
259
264
  placeholder?: string;
260
265
  onSetValue?: (value: DestinationProp | null) => void;
266
+ ariaLabel?: string;
261
267
  };
262
268
  declare const QueryControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
263
269
 
package/dist/index.d.ts CHANGED
@@ -14,19 +14,21 @@ type ImageControlProps = {
14
14
  };
15
15
  declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
16
16
 
17
- declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, }: {
17
+ declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, helperText, sx, ariaLabel, }: {
18
18
  placeholder?: string;
19
19
  error?: boolean;
20
20
  inputValue?: string;
21
21
  inputDisabled?: boolean;
22
22
  helperText?: string;
23
23
  sx?: SxProps;
24
+ ariaLabel?: string;
24
25
  }) => React$1.JSX.Element>;
25
26
 
26
27
  type Props$7 = {
27
28
  placeholder?: string;
29
+ ariaLabel?: string;
28
30
  };
29
- declare const TextAreaControl: ControlComponent<({ placeholder }: Props$7) => React$1.JSX.Element>;
31
+ declare const TextAreaControl: ControlComponent<({ placeholder, ariaLabel }: Props$7) => React$1.JSX.Element>;
30
32
 
31
33
  declare const lengthUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
32
34
  declare const angleUnits: readonly ["deg", "rad", "grad", "turn"];
@@ -85,8 +87,9 @@ type SelectControlProps = {
85
87
  options: SelectOption$1[];
86
88
  onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
87
89
  MenuProps?: SelectProps['MenuProps'];
90
+ ariaLabel?: string;
88
91
  };
89
- declare const SelectControl: ControlComponent<({ options, onChange, MenuProps }: SelectControlProps) => React$1.JSX.Element>;
92
+ declare const SelectControl: ControlComponent<({ options, onChange, MenuProps, ariaLabel }: SelectControlProps) => React$1.JSX.Element>;
90
93
 
91
94
  declare const collectionMethods: {
92
95
  readonly 'off-canvas': () => SelectOption$1[];
@@ -214,8 +217,9 @@ type ItemSelectorProps = {
214
217
  };
215
218
  declare const ItemSelector: ({ itemsList, selectedItem, onItemChange, onClose, sectionWidth, title, itemStyle, onDebounce, icon, disabledItems, id, }: ItemSelectorProps) => React$1.JSX.Element;
216
219
 
217
- declare const UrlControl: ControlComponent<({ placeholder }: {
220
+ declare const UrlControl: ControlComponent<({ placeholder, ariaLabel }: {
218
221
  placeholder?: string;
222
+ ariaLabel?: string;
219
223
  }) => React$1.JSX.Element>;
220
224
 
221
225
  type ControlProps<TControlProps = unknown> = TControlProps & {
@@ -233,6 +237,7 @@ type Props$3 = ControlProps<{
233
237
  minInputLength?: number;
234
238
  placeholder?: string;
235
239
  label?: string;
240
+ ariaLabel?: string;
236
241
  }>;
237
242
  type DestinationProp = LinkPropValue['value']['destination'];
238
243
  declare const LinkControl: ControlComponent<(props: Props$3) => React$1.JSX.Element>;
@@ -258,6 +263,7 @@ type Props$1 = {
258
263
  minInputLength?: number;
259
264
  placeholder?: string;
260
265
  onSetValue?: (value: DestinationProp | null) => void;
266
+ ariaLabel?: string;
261
267
  };
262
268
  declare const QueryControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
263
269
 
package/dist/index.js CHANGED
@@ -476,7 +476,7 @@ var React10 = __toESM(require("react"));
476
476
  var import_editor_props2 = require("@elementor/editor-props");
477
477
  var import_editor_ui = require("@elementor/editor-ui");
478
478
  var import_ui5 = require("@elementor/ui");
479
- var SelectControl = createControl(({ options, onChange, MenuProps }) => {
479
+ var SelectControl = createControl(({ options, onChange, MenuProps, ariaLabel }) => {
480
480
  const { value, setValue, disabled, placeholder } = useBoundProp(import_editor_props2.stringPropTypeUtil);
481
481
  const handleChange = (event) => {
482
482
  const newValue = event.target.value || null;
@@ -491,6 +491,7 @@ var SelectControl = createControl(({ options, onChange, MenuProps }) => {
491
491
  displayEmpty: true,
492
492
  size: "tiny",
493
493
  MenuProps,
494
+ "aria-label": ariaLabel || placeholder,
494
495
  renderValue: (selectedValue) => {
495
496
  const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
496
497
  if (!selectedValue || selectedValue === "") {
@@ -550,7 +551,8 @@ var TextControl = createControl(
550
551
  inputValue,
551
552
  inputDisabled,
552
553
  helperText,
553
- sx
554
+ sx,
555
+ ariaLabel
554
556
  }) => {
555
557
  const { value, setValue, disabled } = useBoundProp(import_editor_props4.stringPropTypeUtil);
556
558
  const handleChange = (event) => setValue(event.target.value);
@@ -565,7 +567,10 @@ var TextControl = createControl(
565
567
  placeholder,
566
568
  error,
567
569
  helperText,
568
- sx
570
+ sx,
571
+ inputProps: {
572
+ ...ariaLabel ? { "aria-label": ariaLabel } : {}
573
+ }
569
574
  }
570
575
  ));
571
576
  }
@@ -575,7 +580,7 @@ var TextControl = createControl(
575
580
  var React13 = __toESM(require("react"));
576
581
  var import_editor_props5 = require("@elementor/editor-props");
577
582
  var import_ui8 = require("@elementor/ui");
578
- var TextAreaControl = createControl(({ placeholder }) => {
583
+ var TextAreaControl = createControl(({ placeholder, ariaLabel }) => {
579
584
  const { value, setValue, disabled } = useBoundProp(import_editor_props5.stringPropTypeUtil);
580
585
  const handleChange = (event) => {
581
586
  setValue(event.target.value);
@@ -590,7 +595,10 @@ var TextAreaControl = createControl(({ placeholder }) => {
590
595
  disabled,
591
596
  value: value ?? "",
592
597
  onChange: handleChange,
593
- placeholder
598
+ placeholder,
599
+ inputProps: {
600
+ ...ariaLabel ? { "aria-label": ariaLabel } : {}
601
+ }
594
602
  }
595
603
  ));
596
604
  });
@@ -3026,21 +3034,26 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
3026
3034
  var React58 = __toESM(require("react"));
3027
3035
  var import_editor_props21 = require("@elementor/editor-props");
3028
3036
  var import_ui43 = require("@elementor/ui");
3029
- var UrlControl = createControl(({ placeholder }) => {
3030
- const { value, setValue, disabled } = useBoundProp(import_editor_props21.urlPropTypeUtil);
3031
- const handleChange = (event) => setValue(event.target.value);
3032
- return /* @__PURE__ */ React58.createElement(ControlActions, null, /* @__PURE__ */ React58.createElement(
3033
- import_ui43.TextField,
3034
- {
3035
- size: "tiny",
3036
- fullWidth: true,
3037
- value: value ?? "",
3038
- disabled,
3039
- onChange: handleChange,
3040
- placeholder
3041
- }
3042
- ));
3043
- });
3037
+ var UrlControl = createControl(
3038
+ ({ placeholder, ariaLabel }) => {
3039
+ const { value, setValue, disabled } = useBoundProp(import_editor_props21.urlPropTypeUtil);
3040
+ const handleChange = (event) => setValue(event.target.value);
3041
+ return /* @__PURE__ */ React58.createElement(ControlActions, null, /* @__PURE__ */ React58.createElement(
3042
+ import_ui43.TextField,
3043
+ {
3044
+ size: "tiny",
3045
+ fullWidth: true,
3046
+ value: value ?? "",
3047
+ disabled,
3048
+ onChange: handleChange,
3049
+ placeholder,
3050
+ inputProps: {
3051
+ ...ariaLabel ? { "aria-label": ariaLabel } : {}
3052
+ }
3053
+ }
3054
+ ));
3055
+ }
3056
+ );
3044
3057
 
3045
3058
  // src/controls/link-control.tsx
3046
3059
  var React63 = __toESM(require("react"));
@@ -3175,7 +3188,8 @@ var Autocomplete = (0, import_react28.forwardRef)((props, ref) => {
3175
3188
  allowClear,
3176
3189
  placeholder,
3177
3190
  hasSelectedValue: isValueFromOptions,
3178
- startAdornment
3191
+ startAdornment,
3192
+ extraInputProps: restProps.inputProps
3179
3193
  }
3180
3194
  )
3181
3195
  }
@@ -3187,7 +3201,8 @@ var TextInput = ({
3187
3201
  placeholder,
3188
3202
  handleChange,
3189
3203
  hasSelectedValue,
3190
- startAdornment
3204
+ startAdornment,
3205
+ extraInputProps
3191
3206
  }) => {
3192
3207
  const onChange = (event) => {
3193
3208
  handleChange(event.target.value);
@@ -3198,6 +3213,7 @@ var TextInput = ({
3198
3213
  ...params,
3199
3214
  placeholder,
3200
3215
  onChange,
3216
+ inputProps: { ...params.inputProps ?? {}, ...extraInputProps ?? {} },
3201
3217
  sx: {
3202
3218
  "& .MuiInputBase-input": {
3203
3219
  cursor: hasSelectedValue ? "default" : void 0
@@ -3248,7 +3264,8 @@ var QueryControl = createControl((props) => {
3248
3264
  queryOptions: { url, params = {} },
3249
3265
  placeholder,
3250
3266
  minInputLength = 2,
3251
- onSetValue
3267
+ onSetValue,
3268
+ ariaLabel
3252
3269
  } = props || {};
3253
3270
  const normalizedPlaceholder = placeholder || (0, import_i18n22.__)("Search", "elementor");
3254
3271
  const [options, setOptions] = (0, import_react29.useState)(
@@ -3308,7 +3325,10 @@ var QueryControl = createControl((props) => {
3308
3325
  value: value?.value?.id?.value || value?.value,
3309
3326
  onOptionChange,
3310
3327
  onTextChange,
3311
- minInputLength
3328
+ minInputLength,
3329
+ inputProps: {
3330
+ ...ariaLabel ? { "aria-label": ariaLabel } : {}
3331
+ }
3312
3332
  }
3313
3333
  ));
3314
3334
  });
@@ -3376,7 +3396,8 @@ var LinkControl = createControl((props) => {
3376
3396
  placeholder,
3377
3397
  minInputLength = 2,
3378
3398
  context: { elementId },
3379
- label = (0, import_i18n23.__)("Link", "elementor")
3399
+ label = (0, import_i18n23.__)("Link", "elementor"),
3400
+ ariaLabel
3380
3401
  } = props || {};
3381
3402
  const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react30.useState)((0, import_editor_elements2.getLinkInLinkRestriction)(elementId));
3382
3403
  const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
@@ -3432,7 +3453,8 @@ var LinkControl = createControl((props) => {
3432
3453
  allowCustomValues,
3433
3454
  minInputLength,
3434
3455
  placeholder,
3435
- onSetValue: onSaveValueToSession
3456
+ onSetValue: onSaveValueToSession,
3457
+ ariaLabel: ariaLabel || label
3436
3458
  }
3437
3459
  )), /* @__PURE__ */ React63.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React63.createElement(import_ui47.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React63.createElement(import_ui47.Grid, { item: true }, /* @__PURE__ */ React63.createElement(ControlFormLabel, null, (0, import_i18n23.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React63.createElement(import_ui47.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React63.createElement(SwitchControl, null))))))));
3438
3460
  });