@elementor/editor-controls 1.2.0 → 1.5.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 (41) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/index.d.mts +20 -8
  3. package/dist/index.d.ts +20 -8
  4. package/dist/index.js +1092 -714
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +937 -549
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +7 -7
  9. package/src/bound-prop-context/prop-context.tsx +3 -3
  10. package/src/bound-prop-context/prop-key-context.tsx +1 -0
  11. package/src/bound-prop-context/use-bound-prop.ts +5 -1
  12. package/src/components/font-family-selector.tsx +54 -56
  13. package/src/components/repeater.tsx +22 -11
  14. package/src/components/size-control/size-input.tsx +4 -4
  15. package/src/components/text-field-popover.tsx +19 -18
  16. package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +3 -15
  17. package/src/controls/box-shadow-repeater-control.tsx +1 -1
  18. package/src/controls/color-control.tsx +12 -1
  19. package/src/controls/equal-unequal-sizes-control.tsx +1 -1
  20. package/src/controls/filter-control/drop-shadow-item-content.tsx +69 -0
  21. package/src/controls/filter-control/drop-shadow-item-label.tsx +20 -0
  22. package/src/controls/filter-repeater-control.tsx +108 -21
  23. package/src/controls/font-family-control/font-family-control.tsx +14 -2
  24. package/src/controls/image-control.tsx +45 -16
  25. package/src/controls/key-value-control.tsx +57 -46
  26. package/src/controls/link-control.tsx +25 -20
  27. package/src/controls/linked-dimensions-control.tsx +1 -1
  28. package/src/controls/repeatable-control.tsx +100 -21
  29. package/src/controls/select-control.tsx +22 -2
  30. package/src/controls/size-control.tsx +25 -12
  31. package/src/controls/switch-control.tsx +9 -1
  32. package/src/controls/text-control.tsx +33 -18
  33. package/src/controls/transform-control/functions/axis-row.tsx +32 -0
  34. package/src/controls/transform-control/functions/move.tsx +44 -0
  35. package/src/controls/transform-control/transform-content.tsx +36 -0
  36. package/src/controls/transform-control/transform-icon.tsx +12 -0
  37. package/src/controls/transform-control/transform-label.tsx +27 -0
  38. package/src/controls/transform-control/transform-repeater-control.tsx +42 -0
  39. package/src/hooks/use-repeatable-control-context.ts +6 -1
  40. package/src/index.ts +1 -0
  41. package/src/utils/size-control.ts +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # @elementor/editor-controls
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 64b3e09: Adds support for the backdrop-filter css property to atomic widgets.
8
+ - 3904505: Adds hue rotate css filter
9
+ - cdbd491: Add Drop Shadow filter
10
+ - b90d7db: Key value control should support dynamic tags
11
+
12
+ ### Patch Changes
13
+
14
+ - 0db150c: Update the popover height.
15
+ - Updated dependencies [64b3e09]
16
+ - Updated dependencies [3904505]
17
+ - Updated dependencies [0db150c]
18
+ - Updated dependencies [cdbd491]
19
+ - Updated dependencies [d44e898]
20
+ - @elementor/editor-props@0.18.0
21
+ - @elementor/editor-ui@0.14.2
22
+ - @elementor/editor-current-user@0.6.1
23
+ - @elementor/editor-elements@0.9.2
24
+
25
+ ## 1.4.0
26
+
27
+ ### Minor Changes
28
+
29
+ - 669f39f: Display a placeholder value inside the color control.
30
+ - 068f659: Adds contrast, gray-scale, invert, sepia and saturate css filters
31
+ - e7cca0a: Updated size control to support degree units
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [2e677ee]
36
+ - Updated dependencies [068f659]
37
+ - Updated dependencies [e7cca0a]
38
+ - Updated dependencies [07ca7e9]
39
+ - @elementor/editor-ui@0.14.1
40
+ - @elementor/editor-props@0.17.0
41
+ - @elementor/editor-elements@0.9.1
42
+
43
+ ## 1.3.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 5c6a912: Fixed issue with item label in repeatable control
48
+ - b3726f6: Add transform move control
49
+ - b17730a: Placeholder logic added to select control & font-family control
50
+ - 1a37b1c: Update the Elementor UI version.
51
+ - c62d64c: Injected prop dependency API into settings field
52
+ - d1fc9d2: Update TextFieldPopover to use slotProps for Paper styling
53
+ - 12333b0: Update `@elementor/icons` package.
54
+
55
+ ### Patch Changes
56
+
57
+ - 8f38cf3: Fix image control layout
58
+ - d4406fd: Add missing FF to link control.
59
+ - Updated dependencies [b3726f6]
60
+ - Updated dependencies [68ce0d9]
61
+ - Updated dependencies [1a37b1c]
62
+ - Updated dependencies [c62d64c]
63
+ - Updated dependencies [12333b0]
64
+ - @elementor/editor-props@0.16.0
65
+ - @elementor/editor-current-user@0.6.0
66
+ - @elementor/editor-ui@0.14.0
67
+ - @elementor/editor-elements@0.9.0
68
+
3
69
  ## 1.2.0
4
70
 
5
71
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import { RefObject, ReactNode, FC, PropsWithChildren, ComponentType } from 'react';
3
+ import { SxProps, UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
3
4
  import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
4
- import { UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
5
5
  import * as _elementor_locations from '@elementor/locations';
6
6
 
7
7
  type ImageControlProps = {
@@ -13,8 +13,12 @@ type ImageControlProps = {
13
13
  };
14
14
  declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
15
15
 
16
- declare const TextControl: ControlComponent<({ placeholder }: {
16
+ declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, sx, }: {
17
17
  placeholder?: string;
18
+ error?: boolean;
19
+ inputValue?: string;
20
+ inputDisabled?: boolean;
21
+ sx?: SxProps;
18
22
  }) => React$1.JSX.Element>;
19
23
 
20
24
  type Props$6 = {
@@ -23,18 +27,20 @@ type Props$6 = {
23
27
  declare const TextAreaControl: ControlComponent<({ placeholder }: Props$6) => React$1.JSX.Element>;
24
28
 
25
29
  declare const defaultUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
30
+ declare const degreeUnits: readonly ["deg", "rad", "grad", "turn"];
26
31
  declare const defaultExtendedOptions: readonly ["auto", "custom"];
27
32
  type Unit = (typeof defaultUnits)[number];
33
+ type DegreeUnit = (typeof degreeUnits)[number];
28
34
  type ExtendedOption = (typeof defaultExtendedOptions)[number];
29
35
 
30
36
  type SizeControlProps = {
31
37
  placeholder?: string;
32
38
  startIcon?: React$1.ReactNode;
33
- units?: Unit[];
39
+ units?: (Unit | DegreeUnit)[];
34
40
  extendedOptions?: ExtendedOption[];
35
41
  disableCustom?: boolean;
36
42
  anchorRef?: RefObject<HTMLDivElement | null>;
37
- defaultUnit?: Unit;
43
+ defaultUnit?: Unit | DegreeUnit;
38
44
  };
39
45
  declare const SizeControl: ControlComponent<(props: SizeControlProps) => React$1.JSX.Element>;
40
46
 
@@ -42,7 +48,9 @@ declare const StrokeControl: ControlComponent<() => React$1.JSX.Element>;
42
48
 
43
49
  declare const BoxShadowRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
44
50
 
45
- declare const FilterRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
51
+ declare const FilterRepeaterControl: ControlComponent<({ filterPropName }: {
52
+ filterPropName?: string;
53
+ }) => React$1.JSX.Element>;
46
54
 
47
55
  type Props$5 = {
48
56
  options: Array<{
@@ -206,6 +214,8 @@ declare const KeyValueControl: ControlComponent<(props?: KeyValueControlProps) =
206
214
 
207
215
  declare const PositionControl: () => React$1.JSX.Element;
208
216
 
217
+ declare const TransformRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
218
+
209
219
  declare const PopoverContent: FC<PropsWithChildren<StackProps>>;
210
220
 
211
221
  declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
@@ -245,11 +255,11 @@ type PropContext<T extends PropValue, P extends PropType> = {
245
255
  value: T | null;
246
256
  propType: P;
247
257
  placeholder?: T;
248
- disabled?: boolean;
258
+ isDisabled?: (propType: PropType) => boolean | undefined;
249
259
  };
250
260
  declare const PropContext: React$1.Context<PropContext<PropValue, PropType> | null>;
251
261
  type PropProviderProps<T extends PropValue, P extends PropType> = React$1.PropsWithChildren<PropContext<T, P>>;
252
- declare const PropProvider: <T extends PropValue, P extends PropType>({ children, value, setValue, propType, placeholder, disabled, }: PropProviderProps<T, P>) => React$1.JSX.Element;
262
+ declare const PropProvider: <T extends PropValue, P extends PropType>({ children, value, setValue, propType, placeholder, isDisabled, }: PropProviderProps<T, P>) => React$1.JSX.Element;
253
263
 
254
264
  type PropKeyContextValue<T, P> = {
255
265
  bind: PropKey;
@@ -258,6 +268,7 @@ type PropKeyContextValue<T, P> = {
258
268
  propType: P;
259
269
  placeholder?: T;
260
270
  path: PropKey[];
271
+ isDisabled?: (propType: PropType) => boolean | undefined;
261
272
  disabled?: boolean;
262
273
  };
263
274
  type PropKeyProviderProps = React$1.PropsWithChildren<{
@@ -273,6 +284,7 @@ type UseBoundProp<TValue extends PropValue> = {
273
284
  placeholder?: TValue;
274
285
  path: PropKey[];
275
286
  restoreValue: () => void;
287
+ isDisabled?: (propType: PropType) => boolean | undefined;
276
288
  disabled?: boolean;
277
289
  };
278
290
  declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): PropKeyContextValue<T, P>;
@@ -321,4 +333,4 @@ type UseInternalStateOptions<TValue> = {
321
333
  };
322
334
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
323
335
 
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 };
336
+ 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, TransformRepeaterControl, 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
2
  import { RefObject, ReactNode, FC, PropsWithChildren, ComponentType } from 'react';
3
+ import { SxProps, UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
3
4
  import { StringPropValue, PropTypeUtil, PropValue, PropKey, SizePropValue, PropType, CreateOptions } from '@elementor/editor-props';
4
- import { UnstableColorFieldProps, ToggleButtonProps, StackProps, FormLabelProps } from '@elementor/ui';
5
5
  import * as _elementor_locations from '@elementor/locations';
6
6
 
7
7
  type ImageControlProps = {
@@ -13,8 +13,12 @@ type ImageControlProps = {
13
13
  };
14
14
  declare const ImageControl: ControlComponent<({ sizes, showMode }: ImageControlProps) => React$1.JSX.Element>;
15
15
 
16
- declare const TextControl: ControlComponent<({ placeholder }: {
16
+ declare const TextControl: ControlComponent<({ placeholder, error, inputValue, inputDisabled, sx, }: {
17
17
  placeholder?: string;
18
+ error?: boolean;
19
+ inputValue?: string;
20
+ inputDisabled?: boolean;
21
+ sx?: SxProps;
18
22
  }) => React$1.JSX.Element>;
19
23
 
20
24
  type Props$6 = {
@@ -23,18 +27,20 @@ type Props$6 = {
23
27
  declare const TextAreaControl: ControlComponent<({ placeholder }: Props$6) => React$1.JSX.Element>;
24
28
 
25
29
  declare const defaultUnits: readonly ["px", "%", "em", "rem", "vw", "vh"];
30
+ declare const degreeUnits: readonly ["deg", "rad", "grad", "turn"];
26
31
  declare const defaultExtendedOptions: readonly ["auto", "custom"];
27
32
  type Unit = (typeof defaultUnits)[number];
33
+ type DegreeUnit = (typeof degreeUnits)[number];
28
34
  type ExtendedOption = (typeof defaultExtendedOptions)[number];
29
35
 
30
36
  type SizeControlProps = {
31
37
  placeholder?: string;
32
38
  startIcon?: React$1.ReactNode;
33
- units?: Unit[];
39
+ units?: (Unit | DegreeUnit)[];
34
40
  extendedOptions?: ExtendedOption[];
35
41
  disableCustom?: boolean;
36
42
  anchorRef?: RefObject<HTMLDivElement | null>;
37
- defaultUnit?: Unit;
43
+ defaultUnit?: Unit | DegreeUnit;
38
44
  };
39
45
  declare const SizeControl: ControlComponent<(props: SizeControlProps) => React$1.JSX.Element>;
40
46
 
@@ -42,7 +48,9 @@ declare const StrokeControl: ControlComponent<() => React$1.JSX.Element>;
42
48
 
43
49
  declare const BoxShadowRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
44
50
 
45
- declare const FilterRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
51
+ declare const FilterRepeaterControl: ControlComponent<({ filterPropName }: {
52
+ filterPropName?: string;
53
+ }) => React$1.JSX.Element>;
46
54
 
47
55
  type Props$5 = {
48
56
  options: Array<{
@@ -206,6 +214,8 @@ declare const KeyValueControl: ControlComponent<(props?: KeyValueControlProps) =
206
214
 
207
215
  declare const PositionControl: () => React$1.JSX.Element;
208
216
 
217
+ declare const TransformRepeaterControl: ControlComponent<() => React$1.JSX.Element>;
218
+
209
219
  declare const PopoverContent: FC<PropsWithChildren<StackProps>>;
210
220
 
211
221
  declare const ControlFormLabel: (props: FormLabelProps) => React$1.JSX.Element;
@@ -245,11 +255,11 @@ type PropContext<T extends PropValue, P extends PropType> = {
245
255
  value: T | null;
246
256
  propType: P;
247
257
  placeholder?: T;
248
- disabled?: boolean;
258
+ isDisabled?: (propType: PropType) => boolean | undefined;
249
259
  };
250
260
  declare const PropContext: React$1.Context<PropContext<PropValue, PropType> | null>;
251
261
  type PropProviderProps<T extends PropValue, P extends PropType> = React$1.PropsWithChildren<PropContext<T, P>>;
252
- declare const PropProvider: <T extends PropValue, P extends PropType>({ children, value, setValue, propType, placeholder, disabled, }: PropProviderProps<T, P>) => React$1.JSX.Element;
262
+ declare const PropProvider: <T extends PropValue, P extends PropType>({ children, value, setValue, propType, placeholder, isDisabled, }: PropProviderProps<T, P>) => React$1.JSX.Element;
253
263
 
254
264
  type PropKeyContextValue<T, P> = {
255
265
  bind: PropKey;
@@ -258,6 +268,7 @@ type PropKeyContextValue<T, P> = {
258
268
  propType: P;
259
269
  placeholder?: T;
260
270
  path: PropKey[];
271
+ isDisabled?: (propType: PropType) => boolean | undefined;
261
272
  disabled?: boolean;
262
273
  };
263
274
  type PropKeyProviderProps = React$1.PropsWithChildren<{
@@ -273,6 +284,7 @@ type UseBoundProp<TValue extends PropValue> = {
273
284
  placeholder?: TValue;
274
285
  path: PropKey[];
275
286
  restoreValue: () => void;
287
+ isDisabled?: (propType: PropType) => boolean | undefined;
276
288
  disabled?: boolean;
277
289
  };
278
290
  declare function useBoundProp<T extends PropValue = PropValue, P extends PropType = PropType>(): PropKeyContextValue<T, P>;
@@ -321,4 +333,4 @@ type UseInternalStateOptions<TValue> = {
321
333
  };
322
334
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
323
335
 
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 };
336
+ 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, TransformRepeaterControl, type Unit, UrlControl, createControlReplacementsRegistry, injectIntoRepeaterItemIcon, injectIntoRepeaterItemLabel, useBoundProp, useControlActions, useSyncExternalState };