@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 +14 -0
- package/dist/index.d.mts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.js +234 -193
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -158
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/control-actions/control-actions-context.tsx +6 -4
- package/src/controls/background-control/background-control.tsx +57 -0
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +89 -0
- package/src/controls/color-control.tsx +7 -1
- package/src/controls/equal-unequal-sizes-control.tsx +5 -1
- package/src/controls/select-control.tsx +3 -1
- package/src/controls/text-area-control.tsx +1 -1
- package/src/controls/text-control.tsx +7 -1
- package/src/index.ts +3 -1
- package/src/controls/background-overlay-repeater-control.tsx +0 -115
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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 {
|
|
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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 {
|
|
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 };
|