@elementor/editor-controls 0.3.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @elementor/editor-controls
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3019657: Add render control test util.
8
+ - 2653cf0: Pass empty string to control input null values.
9
+ - 862178c: Set mixed border value properly from empty initial state.
10
+
11
+ ## 0.3.1
12
+
13
+ ### Patch Changes
14
+
15
+ - a0ca1d8: fixed an issue where persisting dimensions values behaved unpredictably when switching breakpoints
16
+
3
17
  ## 0.3.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -38,16 +38,15 @@ declare const StrokeControl: ControlComponent<() => React.JSX.Element>;
38
38
 
39
39
  declare const BoxShadowRepeaterControl: ControlComponent<() => React.JSX.Element>;
40
40
 
41
- declare const BackgroundOverlayRepeaterControl: ControlComponent<() => React.JSX.Element>;
42
-
43
41
  type Props$2 = {
44
42
  options: Array<{
45
43
  label: string;
46
44
  value: StringPropValue['value'];
47
45
  disabled?: boolean;
48
46
  }>;
47
+ onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
49
48
  };
50
- declare const SelectControl: ControlComponent<({ options }: Props$2) => React.JSX.Element>;
49
+ declare const SelectControl: ControlComponent<({ options, onChange }: Props$2) => React.JSX.Element>;
51
50
 
52
51
  declare const ColorControl: ControlComponent<(props: Partial<Omit<UnstableColorFieldProps, "value" | "onChange">>) => React.JSX.Element>;
53
52
 
@@ -124,22 +123,22 @@ declare const GapControl: ControlComponent<({ label }: {
124
123
  label: string;
125
124
  }) => React.JSX.Element>;
126
125
 
126
+ declare const BackgroundControl: ControlComponent<() => React.JSX.Element>;
127
+
127
128
  declare const ControlLabel: ({ children }: {
128
129
  children: React.ReactNode;
129
130
  }) => React.JSX.Element;
130
131
 
131
- type ReplaceWhenParams = {
132
- value: PropValue;
133
- };
134
- type CreateControlReplacement = {
135
- component: ComponentType;
136
- condition: ({ value }: ReplaceWhenParams) => boolean;
137
- };
138
- declare const ControlReplacementProvider: ({ component, condition, children, }: React.PropsWithChildren<CreateControlReplacement>) => React.JSX.Element;
139
- declare const createControlReplacement: () => {
140
- replaceControl: ({ component, condition }: CreateControlReplacement) => void;
141
- getControlReplacement: () => CreateControlReplacement;
132
+ type ControlActionsItems = Array<{
133
+ id: string;
134
+ MenuItem: React.ComponentType;
135
+ }>;
136
+ type ControlActionsContext = {
137
+ items: ControlActionsItems;
142
138
  };
139
+ type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
140
+ declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React.JSX.Element;
141
+ declare const useControlActions: () => ControlActionsContext;
143
142
 
144
143
  type BoundPropContext<T extends PropValue> = {
145
144
  bind: PropKey;
@@ -160,15 +159,18 @@ type UseBoundProp<TValue> = {
160
159
  declare function useBoundProp<TValue extends PropValue>(): BoundPropContext<TValue>;
161
160
  declare function useBoundProp<TKey extends string, TValue extends PropValue>(propTypeUtil: PropTypeUtil<TKey, TValue>): UseBoundProp<TValue>;
162
161
 
163
- type ControlActionsContext = {
164
- items: Array<{
165
- id: string;
166
- MenuItem: React.ComponentType;
167
- }>;
162
+ type ReplaceWhenParams = {
163
+ value: PropValue;
164
+ };
165
+ type CreateControlReplacement = {
166
+ component: ComponentType;
167
+ condition: ({ value }: ReplaceWhenParams) => boolean;
168
+ };
169
+ declare const ControlReplacementProvider: ({ component, condition, children, }: React.PropsWithChildren<CreateControlReplacement>) => React.JSX.Element;
170
+ declare const createControlReplacement: () => {
171
+ replaceControl: ({ component, condition }: CreateControlReplacement) => void;
172
+ getControlReplacement: () => CreateControlReplacement;
168
173
  };
169
- type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
170
- declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React.JSX.Element;
171
- declare const useControlActions: () => ControlActionsContext;
172
174
 
173
175
  type UseInternalStateOptions<TValue> = {
174
176
  external: TValue | null;
@@ -178,4 +180,4 @@ type UseInternalStateOptions<TValue> = {
178
180
  };
179
181
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
180
182
 
181
- export { BackgroundOverlayRepeaterControl, BoundPropProvider, BoxShadowRepeaterControl, ColorControl, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, SelectControl, SizeControl, StrokeControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
183
+ export { BackgroundControl, BoundPropProvider, type BoundPropProviderProps, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, SelectControl, SizeControl, StrokeControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
package/dist/index.d.ts CHANGED
@@ -38,16 +38,15 @@ declare const StrokeControl: ControlComponent<() => React.JSX.Element>;
38
38
 
39
39
  declare const BoxShadowRepeaterControl: ControlComponent<() => React.JSX.Element>;
40
40
 
41
- declare const BackgroundOverlayRepeaterControl: ControlComponent<() => React.JSX.Element>;
42
-
43
41
  type Props$2 = {
44
42
  options: Array<{
45
43
  label: string;
46
44
  value: StringPropValue['value'];
47
45
  disabled?: boolean;
48
46
  }>;
47
+ onChange?: (newValue: string | null, previousValue: string | null | undefined) => void;
49
48
  };
50
- declare const SelectControl: ControlComponent<({ options }: Props$2) => React.JSX.Element>;
49
+ declare const SelectControl: ControlComponent<({ options, onChange }: Props$2) => React.JSX.Element>;
51
50
 
52
51
  declare const ColorControl: ControlComponent<(props: Partial<Omit<UnstableColorFieldProps, "value" | "onChange">>) => React.JSX.Element>;
53
52
 
@@ -124,22 +123,22 @@ declare const GapControl: ControlComponent<({ label }: {
124
123
  label: string;
125
124
  }) => React.JSX.Element>;
126
125
 
126
+ declare const BackgroundControl: ControlComponent<() => React.JSX.Element>;
127
+
127
128
  declare const ControlLabel: ({ children }: {
128
129
  children: React.ReactNode;
129
130
  }) => React.JSX.Element;
130
131
 
131
- type ReplaceWhenParams = {
132
- value: PropValue;
133
- };
134
- type CreateControlReplacement = {
135
- component: ComponentType;
136
- condition: ({ value }: ReplaceWhenParams) => boolean;
137
- };
138
- declare const ControlReplacementProvider: ({ component, condition, children, }: React.PropsWithChildren<CreateControlReplacement>) => React.JSX.Element;
139
- declare const createControlReplacement: () => {
140
- replaceControl: ({ component, condition }: CreateControlReplacement) => void;
141
- getControlReplacement: () => CreateControlReplacement;
132
+ type ControlActionsItems = Array<{
133
+ id: string;
134
+ MenuItem: React.ComponentType;
135
+ }>;
136
+ type ControlActionsContext = {
137
+ items: ControlActionsItems;
142
138
  };
139
+ type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
140
+ declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React.JSX.Element;
141
+ declare const useControlActions: () => ControlActionsContext;
143
142
 
144
143
  type BoundPropContext<T extends PropValue> = {
145
144
  bind: PropKey;
@@ -160,15 +159,18 @@ type UseBoundProp<TValue> = {
160
159
  declare function useBoundProp<TValue extends PropValue>(): BoundPropContext<TValue>;
161
160
  declare function useBoundProp<TKey extends string, TValue extends PropValue>(propTypeUtil: PropTypeUtil<TKey, TValue>): UseBoundProp<TValue>;
162
161
 
163
- type ControlActionsContext = {
164
- items: Array<{
165
- id: string;
166
- MenuItem: React.ComponentType;
167
- }>;
162
+ type ReplaceWhenParams = {
163
+ value: PropValue;
164
+ };
165
+ type CreateControlReplacement = {
166
+ component: ComponentType;
167
+ condition: ({ value }: ReplaceWhenParams) => boolean;
168
+ };
169
+ declare const ControlReplacementProvider: ({ component, condition, children, }: React.PropsWithChildren<CreateControlReplacement>) => React.JSX.Element;
170
+ declare const createControlReplacement: () => {
171
+ replaceControl: ({ component, condition }: CreateControlReplacement) => void;
172
+ getControlReplacement: () => CreateControlReplacement;
168
173
  };
169
- type ControlActionsProviderProps = PropsWithChildren<ControlActionsContext>;
170
- declare const ControlActionsProvider: ({ children, items }: ControlActionsProviderProps) => React.JSX.Element;
171
- declare const useControlActions: () => ControlActionsContext;
172
174
 
173
175
  type UseInternalStateOptions<TValue> = {
174
176
  external: TValue | null;
@@ -178,4 +180,4 @@ type UseInternalStateOptions<TValue> = {
178
180
  };
179
181
  declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
180
182
 
181
- export { BackgroundOverlayRepeaterControl, BoundPropProvider, BoxShadowRepeaterControl, ColorControl, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, SelectControl, SizeControl, StrokeControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
183
+ export { BackgroundControl, BoundPropProvider, type BoundPropProviderProps, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, SelectControl, SizeControl, StrokeControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };