@elementor/editor-controls 1.1.0 → 1.2.0

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 (31) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/index.d.mts +20 -11
  3. package/dist/index.d.ts +20 -11
  4. package/dist/index.js +739 -565
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +548 -372
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +8 -8
  9. package/src/components/font-family-selector.tsx +30 -13
  10. package/src/components/popover-content.tsx +3 -11
  11. package/src/components/repeater.tsx +3 -1
  12. package/src/components/text-field-popover.tsx +3 -3
  13. package/src/controls/aspect-ratio-control.tsx +20 -2
  14. package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +2 -2
  15. package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +2 -2
  16. package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +9 -4
  17. package/src/controls/box-shadow-repeater-control.tsx +2 -2
  18. package/src/controls/equal-unequal-sizes-control.tsx +3 -9
  19. package/src/controls/filter-repeater-control.tsx +186 -0
  20. package/src/controls/font-family-control/font-family-control.tsx +6 -2
  21. package/src/controls/gap-control.tsx +3 -3
  22. package/src/controls/image-control.tsx +22 -35
  23. package/src/controls/key-value-control.tsx +39 -19
  24. package/src/controls/link-control.tsx +3 -1
  25. package/src/controls/linked-dimensions-control.tsx +3 -3
  26. package/src/controls/number-control.tsx +3 -3
  27. package/src/controls/repeatable-control.tsx +38 -8
  28. package/src/controls/size-control.tsx +3 -3
  29. package/src/controls/stroke-control.tsx +2 -2
  30. package/src/controls/svg-media-control.tsx +0 -2
  31. package/src/index.ts +3 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @elementor/editor-controls
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ab6ad10: Adds support for css filter property, blur and brightness only.
8
+ - a0ff6bc: Reset value button position fix, input reset fix for aspect ratio control
9
+ - bfe6b0b: Update the width settings for the popover selection list.
10
+ - 125de7b: Show placeholders in Number control
11
+ - 9bbd4e3: Ensure repeatable control works with key-value control
12
+ - d85ca8c: Update the popover styling for version 3.30.
13
+
14
+ ### Patch Changes
15
+
16
+ - 0b32e5c: Removed % units from blur css filter.
17
+ - 16df763: Add changed prop name to atomic element setting history
18
+ - 6c6f0d6: Standardize style field layout and add `propDisplayName` prop to `StylesField`
19
+ - Updated dependencies [e953081]
20
+ - Updated dependencies [ab6ad10]
21
+ - Updated dependencies [c91168a]
22
+ - Updated dependencies [bfe6b0b]
23
+ - Updated dependencies [ea388a1]
24
+ - Updated dependencies [16df763]
25
+ - Updated dependencies [d85ca8c]
26
+ - @elementor/utils@0.5.0
27
+ - @elementor/editor-props@0.15.0
28
+ - @elementor/editor-ui@0.13.0
29
+ - @elementor/editor-elements@0.8.7
30
+ - @elementor/editor-v1-adapters@0.12.1
31
+ - @elementor/wp-media@0.6.1
32
+ - @elementor/editor-responsive@0.13.6
33
+
3
34
  ## 1.1.0
4
35
 
5
36
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
- import { MutableRefObject, ReactNode, ComponentType, PropsWithChildren } from 'react';
2
+ import { RefObject, ReactNode, FC, PropsWithChildren, ComponentType } from 'react';
3
3
  import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
4
- import { UnstableColorFieldProps, ToggleButtonProps, StackProps, SxProps, Theme, FormLabelProps } from '@elementor/ui';
4
+ import { UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
5
5
  import * as _elementor_locations from '@elementor/locations';
6
6
 
7
7
  type ImageControlProps = {
@@ -9,10 +9,9 @@ type ImageControlProps = {
9
9
  label: string;
10
10
  value: string;
11
11
  }[];
12
- resolutionLabel?: string;
13
12
  showMode?: 'all' | 'media' | 'sizes';
14
13
  };
15
- declare const ImageControl: ControlComponent<({ sizes, resolutionLabel, showMode }: ImageControlProps) => React$1.JSX.Element>;
14
+ declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
16
15
 
17
16
  declare const TextControl: ControlComponent<({ placeholder }: {
18
17
  placeholder?: string;
@@ -34,7 +33,7 @@ type SizeControlProps = {
34
33
  units?: Unit[];
35
34
  extendedOptions?: ExtendedOption[];
36
35
  disableCustom?: boolean;
37
- anchorRef?: MutableRefObject<HTMLElement | undefined>;
36
+ anchorRef?: RefObject<HTMLDivElement | null>;
38
37
  defaultUnit?: Unit;
39
38
  };
40
39
  declare const SizeControl: ControlComponent<(props: SizeControlProps) => React$1.JSX.Element>;
@@ -43,6 +42,8 @@ declare const StrokeControl: ControlComponent<() => React$1.JSX.Element>;
43
42
 
44
43
  declare const BoxShadowRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
45
44
 
45
+ declare const FilterRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
46
+
46
47
  type Props$5 = {
47
48
  options: Array<{
48
49
  label: string;
@@ -99,7 +100,7 @@ type ToggleControlProps<T extends PropValue> = {
99
100
  };
100
101
  declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, maxItems, }: ToggleControlProps<StringPropValue["value"]>) => React$1.JSX.Element>;
101
102
 
102
- declare const NumberControl: ControlComponent<({ placeholder, max, min, step, shouldForceInt, }: {
103
+ declare const NumberControl: ControlComponent<({ placeholder: labelPlaceholder, max, min, step, shouldForceInt, }: {
103
104
  placeholder?: string;
104
105
  max?: number;
105
106
  min?: number;
@@ -135,8 +136,9 @@ type FontCategory = {
135
136
  };
136
137
  type FontFamilyControlProps = {
137
138
  fontFamilies: FontCategory[];
139
+ sectionWidth: number;
138
140
  };
139
- declare const FontFamilyControl: ControlComponent<({ fontFamilies }: FontFamilyControlProps) => React$1.JSX.Element>;
141
+ declare const FontFamilyControl: ControlComponent<({ fontFamilies, sectionWidth }: FontFamilyControlProps) => React$1.JSX.Element>;
140
142
 
141
143
  declare const UrlControl: ControlComponent<({ placeholder }: {
142
144
  placeholder?: string;
@@ -156,6 +158,7 @@ type Props$1 = ControlProps<{
156
158
  allowCustomValues?: boolean;
157
159
  minInputLength?: number;
158
160
  placeholder?: string;
161
+ label?: string;
159
162
  }>;
160
163
  declare const LinkControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
161
164
 
@@ -182,16 +185,19 @@ type ChildControlConfig = {
182
185
 
183
186
  type RepeatableControlProps = {
184
187
  label: string;
188
+ repeaterLabel: string;
185
189
  childControlConfig: ChildControlConfig;
186
190
  showDuplicate?: boolean;
187
191
  showToggle?: boolean;
192
+ initialValues?: object;
193
+ patternLabel?: string;
194
+ placeholder?: string;
188
195
  };
189
- declare const RepeatableControl: ControlComponent<({ label, childControlConfig, showDuplicate, showToggle }: RepeatableControlProps) => React$1.JSX.Element | null>;
196
+ declare const RepeatableControl: ControlComponent<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, }: RepeatableControlProps) => React$1.JSX.Element | null>;
190
197
 
191
198
  type KeyValueControlProps = {
192
199
  keyName?: string;
193
200
  valueName?: string;
194
- sx?: SxProps<Theme>;
195
201
  regexKey?: string;
196
202
  regexValue?: string;
197
203
  validationErrorMessage?: string;
@@ -200,6 +206,8 @@ declare const KeyValueControl: ControlComponent<(props?: KeyValueControlProps) =
200
206
 
201
207
  declare const PositionControl: () => React$1.JSX.Element;
202
208
 
209
+ declare const PopoverContent: FC<PropsWithChildren<StackProps>>;
210
+
203
211
  declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
204
212
 
205
213
  type FontFamilySelectorProps = {
@@ -207,8 +215,9 @@ type FontFamilySelectorProps = {
207
215
  fontFamily: string | null;
208
216
  onFontFamilyChange: (fontFamily: string) => void;
209
217
  onClose: () => void;
218
+ sectionWidth: number;
210
219
  };
211
- declare const FontFamilySelector: ({ fontFamilies, fontFamily, onFontFamilyChange, onClose, }: FontFamilySelectorProps) => React$1.JSX.Element;
220
+ declare const FontFamilySelector: ({ fontFamilies, fontFamily, onFontFamilyChange, onClose, sectionWidth, }: FontFamilySelectorProps) => React$1.JSX.Element;
212
221
 
213
222
  type AnyComponentType = ComponentType<any>;
214
223
  declare const brandSymbol: unique symbol;
@@ -312,4 +321,4 @@ type UseInternalStateOptions<TValue> = {
312
321
  };
313
322
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
314
323
 
315
- export { AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, type FontCategory, FontFamilyControl, FontFamilySelector, GapControl, ImageControl, KeyValueControl, LinkControl, LinkedDimensionsControl, NumberControl, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };
324
+ export { AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, FontFamilySelector, GapControl, ImageControl, KeyValueControl, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, type Unit, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
- import { MutableRefObject, ReactNode, ComponentType, PropsWithChildren } from 'react';
2
+ import { RefObject, ReactNode, FC, PropsWithChildren, ComponentType } from 'react';
3
3
  import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
4
- import { UnstableColorFieldProps, ToggleButtonProps, StackProps, SxProps, Theme, FormLabelProps } from '@elementor/ui';
4
+ import { UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
5
5
  import * as _elementor_locations from '@elementor/locations';
6
6
 
7
7
  type ImageControlProps = {
@@ -9,10 +9,9 @@ type ImageControlProps = {
9
9
  label: string;
10
10
  value: string;
11
11
  }[];
12
- resolutionLabel?: string;
13
12
  showMode?: 'all' | 'media' | 'sizes';
14
13
  };
15
- declare const ImageControl: ControlComponent<({ sizes, resolutionLabel, showMode }: ImageControlProps) => React$1.JSX.Element>;
14
+ declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
16
15
 
17
16
  declare const TextControl: ControlComponent<({ placeholder }: {
18
17
  placeholder?: string;
@@ -34,7 +33,7 @@ type SizeControlProps = {
34
33
  units?: Unit[];
35
34
  extendedOptions?: ExtendedOption[];
36
35
  disableCustom?: boolean;
37
- anchorRef?: MutableRefObject<HTMLElement | undefined>;
36
+ anchorRef?: RefObject<HTMLDivElement | null>;
38
37
  defaultUnit?: Unit;
39
38
  };
40
39
  declare const SizeControl: ControlComponent<(props: SizeControlProps) => React$1.JSX.Element>;
@@ -43,6 +42,8 @@ declare const StrokeControl: ControlComponent<() => React$1.JSX.Element>;
43
42
 
44
43
  declare const BoxShadowRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
45
44
 
45
+ declare const FilterRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
46
+
46
47
  type Props$5 = {
47
48
  options: Array<{
48
49
  label: string;
@@ -99,7 +100,7 @@ type ToggleControlProps<T extends PropValue> = {
99
100
  };
100
101
  declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, maxItems, }: ToggleControlProps<StringPropValue["value"]>) => React$1.JSX.Element>;
101
102
 
102
- declare const NumberControl: ControlComponent<({ placeholder, max, min, step, shouldForceInt, }: {
103
+ declare const NumberControl: ControlComponent<({ placeholder: labelPlaceholder, max, min, step, shouldForceInt, }: {
103
104
  placeholder?: string;
104
105
  max?: number;
105
106
  min?: number;
@@ -135,8 +136,9 @@ type FontCategory = {
135
136
  };
136
137
  type FontFamilyControlProps = {
137
138
  fontFamilies: FontCategory[];
139
+ sectionWidth: number;
138
140
  };
139
- declare const FontFamilyControl: ControlComponent<({ fontFamilies }: FontFamilyControlProps) => React$1.JSX.Element>;
141
+ declare const FontFamilyControl: ControlComponent<({ fontFamilies, sectionWidth }: FontFamilyControlProps) => React$1.JSX.Element>;
140
142
 
141
143
  declare const UrlControl: ControlComponent<({ placeholder }: {
142
144
  placeholder?: string;
@@ -156,6 +158,7 @@ type Props$1 = ControlProps<{
156
158
  allowCustomValues?: boolean;
157
159
  minInputLength?: number;
158
160
  placeholder?: string;
161
+ label?: string;
159
162
  }>;
160
163
  declare const LinkControl: ControlComponent<(props: Props$1) => React$1.JSX.Element>;
161
164
 
@@ -182,16 +185,19 @@ type ChildControlConfig = {
182
185
 
183
186
  type RepeatableControlProps = {
184
187
  label: string;
188
+ repeaterLabel: string;
185
189
  childControlConfig: ChildControlConfig;
186
190
  showDuplicate?: boolean;
187
191
  showToggle?: boolean;
192
+ initialValues?: object;
193
+ patternLabel?: string;
194
+ placeholder?: string;
188
195
  };
189
- declare const RepeatableControl: ControlComponent<({ label, childControlConfig, showDuplicate, showToggle }: RepeatableControlProps) => React$1.JSX.Element | null>;
196
+ declare const RepeatableControl: ControlComponent<({ repeaterLabel, childControlConfig, showDuplicate, showToggle, initialValues, patternLabel, placeholder, }: RepeatableControlProps) => React$1.JSX.Element | null>;
190
197
 
191
198
  type KeyValueControlProps = {
192
199
  keyName?: string;
193
200
  valueName?: string;
194
- sx?: SxProps<Theme>;
195
201
  regexKey?: string;
196
202
  regexValue?: string;
197
203
  validationErrorMessage?: string;
@@ -200,6 +206,8 @@ declare const KeyValueControl: ControlComponent<(props?: KeyValueControlProps) =
200
206
 
201
207
  declare const PositionControl: () => React$1.JSX.Element;
202
208
 
209
+ declare const PopoverContent: FC<PropsWithChildren<StackProps>>;
210
+
203
211
  declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
204
212
 
205
213
  type FontFamilySelectorProps = {
@@ -207,8 +215,9 @@ type FontFamilySelectorProps = {
207
215
  fontFamily: string | null;
208
216
  onFontFamilyChange: (fontFamily: string) => void;
209
217
  onClose: () => void;
218
+ sectionWidth: number;
210
219
  };
211
- declare const FontFamilySelector: ({ fontFamilies, fontFamily, onFontFamilyChange, onClose, }: FontFamilySelectorProps) => React$1.JSX.Element;
220
+ declare const FontFamilySelector: ({ fontFamilies, fontFamily, onFontFamilyChange, onClose, sectionWidth, }: FontFamilySelectorProps) => React$1.JSX.Element;
212
221
 
213
222
  type AnyComponentType = ComponentType<any>;
214
223
  declare const brandSymbol: unique symbol;
@@ -312,4 +321,4 @@ type UseInternalStateOptions<TValue> = {
312
321
  };
313
322
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
314
323
 
315
- export { AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, type FontCategory, FontFamilyControl, FontFamilySelector, GapControl, ImageControl, KeyValueControl, LinkControl, LinkedDimensionsControl, NumberControl, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };
324
+ export { AspectRatioControl, BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, ControlAdornments, ControlAdornmentsProvider, type ControlComponent, ControlFormLabel, ControlReplacementsProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedOption, FilterRepeaterControl, type FontCategory, FontFamilyControl, FontFamilySelector, GapControl, ImageControl, KeyValueControl, LinkControl, LinkedDimensionsControl, NumberControl, PopoverContent, PositionControl, PropKeyProvider, PropProvider, type PropProviderProps, RepeatableControl, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, SwitchControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, type Unit, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };