@elementor/editor-controls 0.15.0 → 0.17.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 +45 -0
- package/dist/index.d.mts +19 -6
- package/dist/index.d.ts +19 -6
- package/dist/index.js +478 -178
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +484 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
- package/src/components/control-toggle-button-group.tsx +5 -0
- package/src/components/enable-unfiltered-modal.tsx +130 -0
- package/src/components/repeater.tsx +39 -10
- package/src/components/sortable.tsx +2 -7
- package/src/controls/background-control/background-gradient-color-control.tsx +101 -0
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +80 -14
- package/src/controls/background-control/background-overlay/use-background-tabs-history.ts +29 -2
- package/src/controls/box-shadow-repeater-control.tsx +15 -4
- package/src/controls/equal-unequal-sizes-control.tsx +1 -1
- package/src/controls/font-family-control/font-family-control.tsx +35 -14
- package/src/controls/link-control.tsx +11 -2
- package/src/controls/svg-media-control.tsx +20 -5
- package/src/controls/toggle-control.tsx +36 -10
- package/src/hooks/use-filtered-font-families.ts +15 -16
- package/src/index.ts +2 -0
- package/src/utils/link-restriction.ts +47 -0
- package/src/utils/types.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @elementor/editor-controls
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0ed25f2: Reorder font categories in font family control
|
|
8
|
+
- dcfcd9f: Move editor-current-user package to libs, added user capabilities usage in svg control
|
|
9
|
+
- 91aa1eb: Open dialog when trying to upload svg with enable unfiltered uploads disabled
|
|
10
|
+
- 16453f0: Add a space before the font name in the list of the font family menu
|
|
11
|
+
- d8bc786: consistent dimension controls
|
|
12
|
+
- 6f36e05: Update background gradient test
|
|
13
|
+
- 7cf5003: mitigating extra paddings for (sortable) repeater items
|
|
14
|
+
- 3e9ffb0: Open repeater item's popover on add.
|
|
15
|
+
- 8231e7c: Added logic to block adding anchor/link to elements nested in or containing an already an anchored element
|
|
16
|
+
- c002cba: Change background color overlay shape to support variables
|
|
17
|
+
- 353031f: Refactored text decoration field with additional options and updated toggle control for non-exclusive selection.
|
|
18
|
+
- 1748439: Fix default background gradient color stop
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [1e2dfa0]
|
|
23
|
+
- Updated dependencies [b8a7725]
|
|
24
|
+
- Updated dependencies [dcfcd9f]
|
|
25
|
+
- Updated dependencies [4c2935b]
|
|
26
|
+
- Updated dependencies [8231e7c]
|
|
27
|
+
- Updated dependencies [19f5dfe]
|
|
28
|
+
- Updated dependencies [c002cba]
|
|
29
|
+
- Updated dependencies [51432b9]
|
|
30
|
+
- Updated dependencies [070b92c]
|
|
31
|
+
- @elementor/editor-current-user@0.3.0
|
|
32
|
+
- @elementor/wp-media@0.6.0
|
|
33
|
+
- @elementor/editor-props@0.11.0
|
|
34
|
+
- @elementor/editor-elements@0.6.3
|
|
35
|
+
|
|
36
|
+
## 0.16.0
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- 7d37fc1: Add background gradient overlay control
|
|
41
|
+
- 788208d: Change font control not found modal content
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [7d37fc1]
|
|
46
|
+
- @elementor/editor-props@0.10.0
|
|
47
|
+
|
|
3
48
|
## 0.15.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -78,11 +78,14 @@ type Props$2<TValue> = {
|
|
|
78
78
|
declare const ControlToggleButtonGroup: <TValue>({ justify, size, value, onChange, items, exclusive, fullWidth, }: Props$2<TValue>) => React.JSX.Element;
|
|
79
79
|
|
|
80
80
|
type ToggleControlProps<T extends PropValue> = {
|
|
81
|
-
options: ToggleButtonGroupItem<T>
|
|
81
|
+
options: Array<ToggleButtonGroupItem<T> & {
|
|
82
|
+
exclusive?: boolean;
|
|
83
|
+
}>;
|
|
82
84
|
fullWidth?: boolean;
|
|
83
85
|
size?: ToggleButtonProps['size'];
|
|
86
|
+
exclusive?: boolean;
|
|
84
87
|
};
|
|
85
|
-
declare const ToggleControl: ControlComponent<({ options, fullWidth, size }: ToggleControlProps<StringPropValue["value"]>) => React.JSX.Element>;
|
|
88
|
+
declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, }: ToggleControlProps<StringPropValue["value"]>) => React.JSX.Element>;
|
|
86
89
|
|
|
87
90
|
declare const NumberControl: ControlComponent<({ placeholder, max, min, step, shouldForceInt, }: {
|
|
88
91
|
placeholder?: string;
|
|
@@ -114,8 +117,12 @@ declare const LinkedDimensionsControl: ControlComponent<({ label, isSiteRtl, ext
|
|
|
114
117
|
extendedValues?: ExtendedValue[];
|
|
115
118
|
}) => React.JSX.Element>;
|
|
116
119
|
|
|
120
|
+
type FontCategory = {
|
|
121
|
+
label: string;
|
|
122
|
+
fonts: string[];
|
|
123
|
+
};
|
|
117
124
|
type FontFamilyControlProps = {
|
|
118
|
-
fontFamilies:
|
|
125
|
+
fontFamilies: FontCategory[];
|
|
119
126
|
};
|
|
120
127
|
declare const FontFamilyControl: ControlComponent<({ fontFamilies }: FontFamilyControlProps) => React.JSX.Element>;
|
|
121
128
|
|
|
@@ -123,7 +130,13 @@ declare const UrlControl: ControlComponent<({ placeholder }: {
|
|
|
123
130
|
placeholder?: string;
|
|
124
131
|
}) => React.JSX.Element>;
|
|
125
132
|
|
|
126
|
-
type
|
|
133
|
+
type ControlProps<TControlProps = unknown> = TControlProps & {
|
|
134
|
+
context: {
|
|
135
|
+
elementId: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type Props = ControlProps<{
|
|
127
140
|
queryOptions: {
|
|
128
141
|
requestParams: Record<string, unknown>;
|
|
129
142
|
endpoint: string;
|
|
@@ -131,7 +144,7 @@ type Props = {
|
|
|
131
144
|
allowCustomValues?: boolean;
|
|
132
145
|
minInputLength?: number;
|
|
133
146
|
placeholder?: string;
|
|
134
|
-
}
|
|
147
|
+
}>;
|
|
135
148
|
declare const LinkControl: ControlComponent<(props: Props) => React.JSX.Element>;
|
|
136
149
|
|
|
137
150
|
declare const GapControl: ControlComponent<({ label }: {
|
|
@@ -219,4 +232,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
219
232
|
};
|
|
220
233
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
221
234
|
|
|
222
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
235
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -78,11 +78,14 @@ type Props$2<TValue> = {
|
|
|
78
78
|
declare const ControlToggleButtonGroup: <TValue>({ justify, size, value, onChange, items, exclusive, fullWidth, }: Props$2<TValue>) => React.JSX.Element;
|
|
79
79
|
|
|
80
80
|
type ToggleControlProps<T extends PropValue> = {
|
|
81
|
-
options: ToggleButtonGroupItem<T>
|
|
81
|
+
options: Array<ToggleButtonGroupItem<T> & {
|
|
82
|
+
exclusive?: boolean;
|
|
83
|
+
}>;
|
|
82
84
|
fullWidth?: boolean;
|
|
83
85
|
size?: ToggleButtonProps['size'];
|
|
86
|
+
exclusive?: boolean;
|
|
84
87
|
};
|
|
85
|
-
declare const ToggleControl: ControlComponent<({ options, fullWidth, size }: ToggleControlProps<StringPropValue["value"]>) => React.JSX.Element>;
|
|
88
|
+
declare const ToggleControl: ControlComponent<({ options, fullWidth, size, exclusive, }: ToggleControlProps<StringPropValue["value"]>) => React.JSX.Element>;
|
|
86
89
|
|
|
87
90
|
declare const NumberControl: ControlComponent<({ placeholder, max, min, step, shouldForceInt, }: {
|
|
88
91
|
placeholder?: string;
|
|
@@ -114,8 +117,12 @@ declare const LinkedDimensionsControl: ControlComponent<({ label, isSiteRtl, ext
|
|
|
114
117
|
extendedValues?: ExtendedValue[];
|
|
115
118
|
}) => React.JSX.Element>;
|
|
116
119
|
|
|
120
|
+
type FontCategory = {
|
|
121
|
+
label: string;
|
|
122
|
+
fonts: string[];
|
|
123
|
+
};
|
|
117
124
|
type FontFamilyControlProps = {
|
|
118
|
-
fontFamilies:
|
|
125
|
+
fontFamilies: FontCategory[];
|
|
119
126
|
};
|
|
120
127
|
declare const FontFamilyControl: ControlComponent<({ fontFamilies }: FontFamilyControlProps) => React.JSX.Element>;
|
|
121
128
|
|
|
@@ -123,7 +130,13 @@ declare const UrlControl: ControlComponent<({ placeholder }: {
|
|
|
123
130
|
placeholder?: string;
|
|
124
131
|
}) => React.JSX.Element>;
|
|
125
132
|
|
|
126
|
-
type
|
|
133
|
+
type ControlProps<TControlProps = unknown> = TControlProps & {
|
|
134
|
+
context: {
|
|
135
|
+
elementId: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type Props = ControlProps<{
|
|
127
140
|
queryOptions: {
|
|
128
141
|
requestParams: Record<string, unknown>;
|
|
129
142
|
endpoint: string;
|
|
@@ -131,7 +144,7 @@ type Props = {
|
|
|
131
144
|
allowCustomValues?: boolean;
|
|
132
145
|
minInputLength?: number;
|
|
133
146
|
placeholder?: string;
|
|
134
|
-
}
|
|
147
|
+
}>;
|
|
135
148
|
declare const LinkControl: ControlComponent<(props: Props) => React.JSX.Element>;
|
|
136
149
|
|
|
137
150
|
declare const GapControl: ControlComponent<({ label }: {
|
|
@@ -219,4 +232,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
219
232
|
};
|
|
220
233
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
221
234
|
|
|
222
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
235
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, type FontCategory, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, type ToggleControlProps, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|