@elementor/editor-controls 4.3.0-983 → 4.3.0-985

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "4.3.0-983",
4
+ "version": "4.3.0-985",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,23 +40,23 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.3.0-983",
44
- "@elementor/editor-elements": "4.3.0-983",
45
- "@elementor/editor-props": "4.3.0-983",
46
- "@elementor/editor-responsive": "4.3.0-983",
47
- "@elementor/editor-ui": "4.3.0-983",
48
- "@elementor/editor-v1-adapters": "4.3.0-983",
49
- "@elementor/env": "4.3.0-983",
50
- "@elementor/events": "4.3.0-983",
51
- "@elementor/http-client": "4.3.0-983",
43
+ "@elementor/editor-current-user": "4.3.0-985",
44
+ "@elementor/editor-elements": "4.3.0-985",
45
+ "@elementor/editor-props": "4.3.0-985",
46
+ "@elementor/editor-responsive": "4.3.0-985",
47
+ "@elementor/editor-ui": "4.3.0-985",
48
+ "@elementor/editor-v1-adapters": "4.3.0-985",
49
+ "@elementor/env": "4.3.0-985",
50
+ "@elementor/events": "4.3.0-985",
51
+ "@elementor/http-client": "4.3.0-985",
52
52
  "@elementor/icons": "~1.75.1",
53
- "@elementor/locations": "4.3.0-983",
54
- "@elementor/query": "4.3.0-983",
55
- "@elementor/schema": "4.3.0-983",
56
- "@elementor/session": "4.3.0-983",
53
+ "@elementor/locations": "4.3.0-985",
54
+ "@elementor/query": "4.3.0-985",
55
+ "@elementor/schema": "4.3.0-985",
56
+ "@elementor/session": "4.3.0-985",
57
57
  "@elementor/ui": "1.37.5",
58
- "@elementor/utils": "4.3.0-983",
59
- "@elementor/wp-media": "4.3.0-983",
58
+ "@elementor/utils": "4.3.0-985",
59
+ "@elementor/wp-media": "4.3.0-985",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "@tiptap/extension-bold": "^3.11.1",
62
62
  "@tiptap/extension-document": "^3.11.1",
@@ -88,37 +88,32 @@ type SortableItemSettings< T > = BaseItemSettings< T > & {
88
88
  getId: ( { item, index }: { item: T; index: number } ) => string;
89
89
  };
90
90
 
91
- type RepeaterProps< T > =
92
- | {
93
- label: string;
94
- values?: T[];
95
- openOnAdd?: boolean;
96
- setValues: ( newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta< T > ) => void;
97
- disabled?: boolean;
98
- disableAddItemButton?: boolean;
99
- addButtonInfotipContent?: React.ReactNode;
100
- showDuplicate?: boolean;
101
- showToggle?: boolean;
102
- showRemove?: boolean;
103
- openItem?: number;
104
- isSortable: false;
105
- itemSettings: BaseItemSettings< T >;
106
- }
107
- | {
108
- label: string;
109
- values?: T[];
110
- openOnAdd?: boolean;
111
- setValues: ( newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta< T > ) => void;
112
- disabled?: boolean;
113
- disableAddItemButton?: boolean;
114
- addButtonInfotipContent?: React.ReactNode;
115
- showDuplicate?: boolean;
116
- showToggle?: boolean;
117
- showRemove?: boolean;
118
- openItem?: number;
119
- isSortable?: true;
120
- itemSettings: SortableItemSettings< T >;
121
- };
91
+ type BaseProps< T > = {
92
+ label: string;
93
+ values?: T[];
94
+ openOnAdd?: boolean;
95
+ setValues: ( newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta< T > ) => void;
96
+ disabled?: boolean;
97
+ disableAddItemButton?: boolean;
98
+ addButtonInfotipContent?: React.ReactNode;
99
+ showDuplicate?: boolean;
100
+ showToggle?: boolean;
101
+ showRemove?: boolean;
102
+ openItem?: number;
103
+ adornment?: React.FC;
104
+ };
105
+
106
+ type SortableProps< T > = BaseProps< T > & {
107
+ isSortable?: true;
108
+ itemSettings: SortableItemSettings< T >;
109
+ };
110
+
111
+ type NonSortableProps< T > = BaseProps< T > & {
112
+ isSortable?: false;
113
+ itemSettings: BaseItemSettings< T >;
114
+ };
115
+
116
+ type RepeaterProps< T > = SortableProps< T > | NonSortableProps< T >;
122
117
 
123
118
  const EMPTY_OPEN_ITEM = -1;
124
119
 
@@ -136,6 +131,7 @@ export const Repeater = < T, >( {
136
131
  addButtonInfotipContent,
137
132
  openItem: initialOpenItem = EMPTY_OPEN_ITEM,
138
133
  isSortable = true,
134
+ adornment = ControlAdornments,
139
135
  }: RepeaterProps< RepeaterItem< T > > ) => {
140
136
  const [ openItem, setOpenItem ] = useState( initialOpenItem );
141
137
 
@@ -232,7 +228,7 @@ export const Repeater = < T, >( {
232
228
 
233
229
  return (
234
230
  <SectionContent gap={ 2 }>
235
- <RepeaterHeader label={ label } adornment={ ControlAdornments }>
231
+ <RepeaterHeader label={ label } adornment={ adornment }>
236
232
  { shouldShowInfotip ? (
237
233
  <Infotip
238
234
  placement="right"