@elementor/editor-controls 3.33.0-256 → 3.33.0-258
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/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/repeater/repeater.tsx +11 -2
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": "3.33.0-
|
|
4
|
+
"version": "3.33.0-258",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "3.33.0-
|
|
44
|
-
"@elementor/editor-elements": "3.33.0-
|
|
45
|
-
"@elementor/editor-props": "3.33.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.33.0-
|
|
47
|
-
"@elementor/editor-ui": "3.33.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.33.0-
|
|
49
|
-
"@elementor/env": "3.33.0-
|
|
50
|
-
"@elementor/http-client": "3.33.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.33.0-258",
|
|
44
|
+
"@elementor/editor-elements": "3.33.0-258",
|
|
45
|
+
"@elementor/editor-props": "3.33.0-258",
|
|
46
|
+
"@elementor/editor-responsive": "3.33.0-258",
|
|
47
|
+
"@elementor/editor-ui": "3.33.0-258",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.33.0-258",
|
|
49
|
+
"@elementor/env": "3.33.0-258",
|
|
50
|
+
"@elementor/http-client": "3.33.0-258",
|
|
51
51
|
"@elementor/icons": "^1.61.0",
|
|
52
|
-
"@elementor/locations": "3.33.0-
|
|
53
|
-
"@elementor/mixpanel": "3.33.0-
|
|
54
|
-
"@elementor/query": "3.33.0-
|
|
55
|
-
"@elementor/session": "3.33.0-
|
|
52
|
+
"@elementor/locations": "3.33.0-258",
|
|
53
|
+
"@elementor/mixpanel": "3.33.0-258",
|
|
54
|
+
"@elementor/query": "3.33.0-258",
|
|
55
|
+
"@elementor/session": "3.33.0-258",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "3.33.0-
|
|
58
|
-
"@elementor/wp-media": "3.33.0-
|
|
57
|
+
"@elementor/utils": "3.33.0-258",
|
|
58
|
+
"@elementor/wp-media": "3.33.0-258",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -75,15 +75,18 @@ type RepeaterProps< T > = {
|
|
|
75
75
|
openOnAdd?: boolean;
|
|
76
76
|
setValues: ( newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta< T > ) => void;
|
|
77
77
|
disabled?: boolean;
|
|
78
|
+
disableAddItemButton?: boolean;
|
|
78
79
|
itemSettings: {
|
|
79
80
|
initialValues: T;
|
|
80
81
|
Label: React.ComponentType< { value: T; index: number } >;
|
|
81
82
|
Icon: React.ComponentType< { value: T } >;
|
|
82
83
|
Content: RepeaterItemContent< T >;
|
|
84
|
+
actions?: React.ReactNode;
|
|
83
85
|
};
|
|
84
86
|
showDuplicate?: boolean;
|
|
85
87
|
showToggle?: boolean;
|
|
86
88
|
isSortable?: boolean;
|
|
89
|
+
openItem?: number;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
const EMPTY_OPEN_ITEM = -1;
|
|
@@ -99,8 +102,10 @@ export const Repeater = < T, >( {
|
|
|
99
102
|
showDuplicate = true,
|
|
100
103
|
showToggle = true,
|
|
101
104
|
isSortable = true,
|
|
105
|
+
disableAddItemButton = false,
|
|
106
|
+
openItem: initialOpenItem = EMPTY_OPEN_ITEM,
|
|
102
107
|
}: RepeaterProps< RepeaterItem< T > > ) => {
|
|
103
|
-
const [ openItem, setOpenItem ] = useState(
|
|
108
|
+
const [ openItem, setOpenItem ] = useState( initialOpenItem );
|
|
104
109
|
|
|
105
110
|
const [ items, setItems ] = useSyncExternalState( {
|
|
106
111
|
external: repeaterValues,
|
|
@@ -204,7 +209,7 @@ export const Repeater = < T, >( {
|
|
|
204
209
|
<IconButton
|
|
205
210
|
size={ SIZE }
|
|
206
211
|
sx={ { ml: 'auto' } }
|
|
207
|
-
disabled={ disabled }
|
|
212
|
+
disabled={ disabled || disableAddItemButton }
|
|
208
213
|
onClick={ addRepeaterItem }
|
|
209
214
|
aria-label={ __( 'Add item', 'elementor' ) }
|
|
210
215
|
>
|
|
@@ -242,6 +247,7 @@ export const Repeater = < T, >( {
|
|
|
242
247
|
onOpen={ () => setOpenItem( EMPTY_OPEN_ITEM ) }
|
|
243
248
|
showDuplicate={ showDuplicate }
|
|
244
249
|
showToggle={ showToggle }
|
|
250
|
+
actions={ itemSettings.actions }
|
|
245
251
|
>
|
|
246
252
|
{ ( props ) => (
|
|
247
253
|
<itemSettings.Content
|
|
@@ -274,6 +280,7 @@ type RepeaterItemProps< T > = {
|
|
|
274
280
|
showDuplicate: boolean;
|
|
275
281
|
showToggle: boolean;
|
|
276
282
|
disabled?: boolean;
|
|
283
|
+
actions?: React.ReactNode;
|
|
277
284
|
};
|
|
278
285
|
|
|
279
286
|
const RepeaterItem = < T, >( {
|
|
@@ -289,6 +296,7 @@ const RepeaterItem = < T, >( {
|
|
|
289
296
|
showDuplicate,
|
|
290
297
|
showToggle,
|
|
291
298
|
disabled,
|
|
299
|
+
actions,
|
|
292
300
|
}: RepeaterItemProps< T > ) => {
|
|
293
301
|
const { popoverState, popoverProps, ref, setRef } = usePopover( openOnMount, onOpen );
|
|
294
302
|
|
|
@@ -321,6 +329,7 @@ const RepeaterItem = < T, >( {
|
|
|
321
329
|
</IconButton>
|
|
322
330
|
</Tooltip>
|
|
323
331
|
) }
|
|
332
|
+
{ actions }
|
|
324
333
|
<Tooltip title={ removeLabel } placement="top">
|
|
325
334
|
<IconButton size={ SIZE } onClick={ removeItem } aria-label={ removeLabel }>
|
|
326
335
|
<XIcon fontSize={ SIZE } />
|