@elementor/editor-controls 3.33.0-248 → 3.33.0-249
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 +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +715 -729
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +487 -505
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/control-repeater/index.ts +0 -1
- package/src/components/control-repeater/items/edit-item-popover.tsx +4 -13
- package/src/components/control-repeater/items/item.tsx +25 -33
- package/src/components/control-repeater/items/items-container.tsx +1 -1
- package/src/components/{control-repeater/header/header.tsx → repeater/repeater-header.tsx} +3 -2
- package/src/components/repeater/repeater-popover.tsx +19 -0
- package/src/components/repeater/repeater-tag.tsx +16 -0
- package/src/components/{repeater.tsx → repeater/repeater.tsx} +16 -50
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +4 -3
- package/src/controls/box-shadow-repeater-control.tsx +4 -3
- package/src/controls/filter-control/filter-repeater-control.tsx +4 -3
- package/src/controls/repeatable-control.tsx +5 -5
- package/src/controls/transform-control/transform-repeater-control.tsx +4 -3
- package/src/index.ts +6 -1
- /package/src/components/{sortable.tsx → repeater/sortable.tsx} +0 -0
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-249",
|
|
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-249",
|
|
44
|
+
"@elementor/editor-elements": "3.33.0-249",
|
|
45
|
+
"@elementor/editor-props": "3.33.0-249",
|
|
46
|
+
"@elementor/editor-responsive": "3.33.0-249",
|
|
47
|
+
"@elementor/editor-ui": "3.33.0-249",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.33.0-249",
|
|
49
|
+
"@elementor/env": "3.33.0-249",
|
|
50
|
+
"@elementor/http-client": "3.33.0-249",
|
|
51
51
|
"@elementor/icons": "1.55.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-249",
|
|
53
|
+
"@elementor/mixpanel": "3.33.0-249",
|
|
54
|
+
"@elementor/query": "3.33.0-249",
|
|
55
|
+
"@elementor/session": "3.33.0-249",
|
|
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-249",
|
|
58
|
+
"@elementor/wp-media": "3.33.0-249",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { TooltipAddItemAction } from './actions/tooltip-add-item-action';
|
|
2
|
-
export { Header } from './header/header';
|
|
3
2
|
export { ItemsContainer } from './items/items-container';
|
|
4
3
|
export { Item } from './items/item';
|
|
5
4
|
export { ControlRepeater } from './control-repeater';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { bindPopover, Box
|
|
2
|
+
import { bindPopover, Box } from '@elementor/ui';
|
|
3
3
|
|
|
4
4
|
import { PropKeyProvider } from '../../../bound-prop-context';
|
|
5
|
+
import { RepeaterPopover } from '../../repeater/repeater-popover';
|
|
5
6
|
import { EMPTY_OPEN_ITEM, useRepeaterContext } from '../context/repeater-context';
|
|
6
7
|
|
|
7
8
|
export const EditItemPopover = ( { children }: { children: React.ReactNode } ) => {
|
|
@@ -18,20 +19,10 @@ export const EditItemPopover = ( { children }: { children: React.ReactNode } ) =
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
|
-
<
|
|
22
|
-
disablePortal
|
|
23
|
-
slotProps={ {
|
|
24
|
-
paper: {
|
|
25
|
-
sx: { mt: 0.5, width: rowRef.offsetWidth },
|
|
26
|
-
},
|
|
27
|
-
} }
|
|
28
|
-
anchorOrigin={ { vertical: 'bottom', horizontal: 'left' } }
|
|
29
|
-
{ ...bindPopover( popoverState ) }
|
|
30
|
-
onClose={ onClose }
|
|
31
|
-
>
|
|
22
|
+
<RepeaterPopover width={ rowRef.offsetWidth } { ...bindPopover( popoverState ) } onClose={ onClose }>
|
|
32
23
|
<PropKeyProvider bind={ String( openItemIndex ) }>
|
|
33
24
|
<Box>{ children }</Box>
|
|
34
25
|
</PropKeyProvider>
|
|
35
|
-
</
|
|
26
|
+
</RepeaterPopover>
|
|
36
27
|
);
|
|
37
28
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { bindTrigger
|
|
2
|
+
import { bindTrigger } from '@elementor/ui';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
4
|
|
|
5
|
+
import { RepeaterTag } from '../../repeater/repeater-tag';
|
|
5
6
|
import { useRepeaterContext } from '../context/repeater-context';
|
|
6
7
|
import { RepeaterItemActionsSlot, RepeaterItemIconSlot, RepeaterItemLabelSlot } from '../locations';
|
|
7
8
|
import { type ItemProps, type RepeatablePropValue } from '../types';
|
|
8
9
|
|
|
9
10
|
export const Item = < T extends RepeatablePropValue >( { Label, Icon, actions }: ItemProps< T > ) => {
|
|
10
|
-
const {
|
|
11
|
+
const { popoverState, setRowRef, openItemIndex, setOpenItemIndex, index = -1, value } = useRepeaterContext();
|
|
11
12
|
const triggerProps = bindTrigger( popoverState );
|
|
12
|
-
const key = items[ index ].key ?? -1;
|
|
13
13
|
|
|
14
14
|
const onClick = ( ev: React.MouseEvent ) => {
|
|
15
15
|
triggerProps.onClick( ev );
|
|
@@ -26,35 +26,27 @@ export const Item = < T extends RepeatablePropValue >( { Label, Icon, actions }:
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
actions={
|
|
52
|
-
<>
|
|
53
|
-
<RepeaterItemActionsSlot index={ index ?? -1 } />
|
|
54
|
-
{ actions }
|
|
55
|
-
</>
|
|
56
|
-
}
|
|
57
|
-
/>
|
|
58
|
-
</>
|
|
29
|
+
<RepeaterTag
|
|
30
|
+
ref={ setRef }
|
|
31
|
+
label={
|
|
32
|
+
<RepeaterItemLabelSlot value={ value }>
|
|
33
|
+
<Label value={ value as T } />
|
|
34
|
+
</RepeaterItemLabelSlot>
|
|
35
|
+
}
|
|
36
|
+
aria-label={ __( 'Open item', 'elementor' ) }
|
|
37
|
+
{ ...triggerProps }
|
|
38
|
+
onClick={ onClick }
|
|
39
|
+
startIcon={
|
|
40
|
+
<RepeaterItemIconSlot value={ value }>
|
|
41
|
+
<Icon value={ value as T } />
|
|
42
|
+
</RepeaterItemIconSlot>
|
|
43
|
+
}
|
|
44
|
+
actions={
|
|
45
|
+
<>
|
|
46
|
+
<RepeaterItemActionsSlot index={ index ?? -1 } />
|
|
47
|
+
{ actions }
|
|
48
|
+
</>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
59
51
|
);
|
|
60
52
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { SortableItem, SortableProvider } from '../../sortable';
|
|
3
|
+
import { SortableItem, SortableProvider } from '../../repeater/sortable';
|
|
4
4
|
import { ItemContext } from '../context/item-context';
|
|
5
5
|
import { useRepeaterContext } from '../context/repeater-context';
|
|
6
6
|
import { type Item, type RepeatablePropValue } from '../types';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Box, Stack, Typography } from '@elementor/ui';
|
|
3
4
|
|
|
4
|
-
import { ControlAdornments } from '
|
|
5
|
+
import { ControlAdornments } from '../../control-adornments/control-adornments';
|
|
5
6
|
|
|
6
|
-
export const
|
|
7
|
+
export const RepeaterHeader = forwardRef(
|
|
7
8
|
(
|
|
8
9
|
{
|
|
9
10
|
label,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Popover, type PopoverProps } from '@elementor/ui';
|
|
3
|
+
|
|
4
|
+
export const RepeaterPopover = ( { children, width, ...props }: PopoverProps & { width?: number } ) => {
|
|
5
|
+
return (
|
|
6
|
+
<Popover
|
|
7
|
+
disablePortal
|
|
8
|
+
anchorOrigin={ { vertical: 'bottom', horizontal: 'left' } }
|
|
9
|
+
slotProps={ {
|
|
10
|
+
paper: {
|
|
11
|
+
sx: { mt: 0.5, width },
|
|
12
|
+
},
|
|
13
|
+
} }
|
|
14
|
+
{ ...props }
|
|
15
|
+
>
|
|
16
|
+
{ children }
|
|
17
|
+
</Popover>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { UnstableTag, type UnstableTagProps } from '@elementor/ui';
|
|
4
|
+
|
|
5
|
+
export const RepeaterTag = forwardRef< HTMLDivElement, UnstableTagProps >( ( props, ref ) => {
|
|
6
|
+
return (
|
|
7
|
+
<UnstableTag
|
|
8
|
+
ref={ ref }
|
|
9
|
+
fullWidth
|
|
10
|
+
showActionsOnHover
|
|
11
|
+
variant="outlined"
|
|
12
|
+
sx={ { minHeight: ( theme ) => theme.spacing( 3.5 ) } }
|
|
13
|
+
{ ...props }
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
} );
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { type CreateOptions, type PropKey
|
|
3
|
+
import { type CreateOptions, type PropKey } from '@elementor/editor-props';
|
|
4
4
|
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from '@elementor/icons';
|
|
5
5
|
import {
|
|
6
6
|
bindPopover,
|
|
7
7
|
bindTrigger,
|
|
8
8
|
Box,
|
|
9
9
|
IconButton,
|
|
10
|
-
Popover,
|
|
11
|
-
Stack,
|
|
12
10
|
Tooltip,
|
|
13
|
-
Typography,
|
|
14
|
-
UnstableTag,
|
|
15
11
|
type UnstableTagProps,
|
|
16
12
|
usePopupState,
|
|
17
13
|
} from '@elementor/ui';
|
|
18
14
|
import { __ } from '@wordpress/i18n';
|
|
19
15
|
|
|
20
|
-
import { type SetValueMeta } from '
|
|
21
|
-
import { ControlAdornments } from '
|
|
22
|
-
import { useSyncExternalState } from '
|
|
23
|
-
import { RepeaterItemIconSlot, RepeaterItemLabelSlot } from '
|
|
24
|
-
import { SectionContent } from '
|
|
16
|
+
import { type SetValueMeta } from '../../bound-prop-context';
|
|
17
|
+
import { ControlAdornments } from '../../control-adornments/control-adornments';
|
|
18
|
+
import { useSyncExternalState } from '../../hooks/use-sync-external-state';
|
|
19
|
+
import { RepeaterItemIconSlot, RepeaterItemLabelSlot } from '../control-repeater/locations';
|
|
20
|
+
import { SectionContent } from '../section-content';
|
|
21
|
+
import { RepeaterHeader } from './repeater-header';
|
|
22
|
+
import { RepeaterPopover } from './repeater-popover';
|
|
23
|
+
import { RepeaterTag } from './repeater-tag';
|
|
25
24
|
import { SortableItem, SortableProvider } from './sortable';
|
|
26
25
|
|
|
27
26
|
const SIZE = 'tiny';
|
|
@@ -32,13 +31,10 @@ export type RepeaterItem< T > = {
|
|
|
32
31
|
disabled?: boolean;
|
|
33
32
|
} & T;
|
|
34
33
|
|
|
35
|
-
export type CollectionPropUtil< T > = PropTypeUtil< PropKey, T[] >;
|
|
36
|
-
|
|
37
34
|
type RepeaterItemContentProps< T > = {
|
|
38
35
|
anchorEl: AnchorEl;
|
|
39
36
|
bind: PropKey;
|
|
40
37
|
value: T;
|
|
41
|
-
collectionPropUtil?: CollectionPropUtil< T >;
|
|
42
38
|
index: number;
|
|
43
39
|
};
|
|
44
40
|
|
|
@@ -88,7 +84,6 @@ type RepeaterProps< T > = {
|
|
|
88
84
|
showDuplicate?: boolean;
|
|
89
85
|
showToggle?: boolean;
|
|
90
86
|
isSortable?: boolean;
|
|
91
|
-
collectionPropUtil?: CollectionPropUtil< T >;
|
|
92
87
|
};
|
|
93
88
|
|
|
94
89
|
const EMPTY_OPEN_ITEM = -1;
|
|
@@ -104,7 +99,6 @@ export const Repeater = < T, >( {
|
|
|
104
99
|
showDuplicate = true,
|
|
105
100
|
showToggle = true,
|
|
106
101
|
isSortable = true,
|
|
107
|
-
collectionPropUtil,
|
|
108
102
|
}: RepeaterProps< RepeaterItem< T > > ) => {
|
|
109
103
|
const [ openItem, setOpenItem ] = useState( EMPTY_OPEN_ITEM );
|
|
110
104
|
|
|
@@ -206,17 +200,7 @@ export const Repeater = < T, >( {
|
|
|
206
200
|
|
|
207
201
|
return (
|
|
208
202
|
<SectionContent gap={ 2 }>
|
|
209
|
-
<
|
|
210
|
-
direction="row"
|
|
211
|
-
justifyContent="start"
|
|
212
|
-
alignItems="center"
|
|
213
|
-
gap={ 1 }
|
|
214
|
-
sx={ { marginInlineEnd: -0.75 } }
|
|
215
|
-
>
|
|
216
|
-
<Typography component="label" variant="caption" color="text.secondary">
|
|
217
|
-
{ label }
|
|
218
|
-
</Typography>
|
|
219
|
-
<ControlAdornments />
|
|
203
|
+
<RepeaterHeader label={ label } adornment={ ControlAdornments }>
|
|
220
204
|
<IconButton
|
|
221
205
|
size={ SIZE }
|
|
222
206
|
sx={ { ml: 'auto' } }
|
|
@@ -226,7 +210,7 @@ export const Repeater = < T, >( {
|
|
|
226
210
|
>
|
|
227
211
|
<PlusIcon fontSize={ SIZE } />
|
|
228
212
|
</IconButton>
|
|
229
|
-
</
|
|
213
|
+
</RepeaterHeader>
|
|
230
214
|
{ 0 < uniqueKeys.length && (
|
|
231
215
|
<SortableProvider value={ uniqueKeys } onChange={ onChangeOrder }>
|
|
232
216
|
{ uniqueKeys.map( ( key, index ) => {
|
|
@@ -258,7 +242,6 @@ export const Repeater = < T, >( {
|
|
|
258
242
|
onOpen={ () => setOpenItem( EMPTY_OPEN_ITEM ) }
|
|
259
243
|
showDuplicate={ showDuplicate }
|
|
260
244
|
showToggle={ showToggle }
|
|
261
|
-
collectionPropUtil={ collectionPropUtil }
|
|
262
245
|
>
|
|
263
246
|
{ ( props ) => (
|
|
264
247
|
<itemSettings.Content
|
|
@@ -285,13 +268,12 @@ type RepeaterItemProps< T > = {
|
|
|
285
268
|
removeItem: () => void;
|
|
286
269
|
duplicateItem: () => void;
|
|
287
270
|
toggleDisableItem: () => void;
|
|
288
|
-
children: ( props: Pick< RepeaterItemContentProps< T >, 'anchorEl'
|
|
271
|
+
children: ( props: Pick< RepeaterItemContentProps< T >, 'anchorEl' > ) => React.ReactNode;
|
|
289
272
|
openOnMount: boolean;
|
|
290
273
|
onOpen: () => void;
|
|
291
274
|
showDuplicate: boolean;
|
|
292
275
|
showToggle: boolean;
|
|
293
276
|
disabled?: boolean;
|
|
294
|
-
collectionPropUtil?: CollectionPropUtil< T >;
|
|
295
277
|
};
|
|
296
278
|
|
|
297
279
|
const RepeaterItem = < T, >( {
|
|
@@ -307,9 +289,7 @@ const RepeaterItem = < T, >( {
|
|
|
307
289
|
showDuplicate,
|
|
308
290
|
showToggle,
|
|
309
291
|
disabled,
|
|
310
|
-
collectionPropUtil,
|
|
311
292
|
}: RepeaterItemProps< T > ) => {
|
|
312
|
-
const [ anchorEl, setAnchorEl ] = useState< AnchorEl >( null );
|
|
313
293
|
const { popoverState, popoverProps, ref, setRef } = usePopover( openOnMount, onOpen );
|
|
314
294
|
|
|
315
295
|
const duplicateLabel = __( 'Duplicate', 'elementor' );
|
|
@@ -318,13 +298,10 @@ const RepeaterItem = < T, >( {
|
|
|
318
298
|
|
|
319
299
|
return (
|
|
320
300
|
<>
|
|
321
|
-
<
|
|
301
|
+
<RepeaterTag
|
|
322
302
|
disabled={ disabled }
|
|
323
303
|
label={ label }
|
|
324
|
-
showActionsOnHover
|
|
325
|
-
fullWidth
|
|
326
304
|
ref={ setRef }
|
|
327
|
-
variant="outlined"
|
|
328
305
|
aria-label={ __( 'Open item', 'elementor' ) }
|
|
329
306
|
{ ...bindTrigger( popoverState ) }
|
|
330
307
|
startIcon={ startIcon }
|
|
@@ -352,20 +329,9 @@ const RepeaterItem = < T, >( {
|
|
|
352
329
|
</>
|
|
353
330
|
}
|
|
354
331
|
/>
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
paper: {
|
|
359
|
-
ref: setAnchorEl,
|
|
360
|
-
sx: { mt: 0.5, width: ref?.getBoundingClientRect().width },
|
|
361
|
-
},
|
|
362
|
-
} }
|
|
363
|
-
anchorOrigin={ { vertical: 'bottom', horizontal: 'left' } }
|
|
364
|
-
{ ...popoverProps }
|
|
365
|
-
anchorEl={ ref }
|
|
366
|
-
>
|
|
367
|
-
<Box>{ children( { anchorEl, collectionPropUtil } ) }</Box>
|
|
368
|
-
</Popover>
|
|
332
|
+
<RepeaterPopover width={ ref?.getBoundingClientRect().width } { ...popoverProps } anchorEl={ ref }>
|
|
333
|
+
<Box>{ children( { anchorEl: ref } ) }</Box>
|
|
334
|
+
</RepeaterPopover>
|
|
369
335
|
</>
|
|
370
336
|
);
|
|
371
337
|
};
|
package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { useWpMediaAttachment } from '@elementor/wp-media';
|
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
|
|
13
13
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../../../bound-prop-context';
|
|
14
|
-
import { ControlRepeater,
|
|
14
|
+
import { ControlRepeater, ItemsContainer, TooltipAddItemAction } from '../../../components/control-repeater';
|
|
15
15
|
import { DisableItemAction } from '../../../components/control-repeater/actions/disable-item-action';
|
|
16
16
|
import { DuplicateItemAction } from '../../../components/control-repeater/actions/duplicate-item-action';
|
|
17
17
|
import { RemoveItemAction } from '../../../components/control-repeater/actions/remove-item-action';
|
|
@@ -20,6 +20,7 @@ import { EditItemPopover } from '../../../components/control-repeater/items/edit
|
|
|
20
20
|
import { Item } from '../../../components/control-repeater/items/item';
|
|
21
21
|
import { type CollectionPropUtil, type RepeatablePropValue } from '../../../components/control-repeater/types';
|
|
22
22
|
import { PopoverContent } from '../../../components/popover-content';
|
|
23
|
+
import { RepeaterHeader } from '../../../components/repeater/repeater-header';
|
|
23
24
|
import { createControl } from '../../../create-control';
|
|
24
25
|
import { env } from '../../../env';
|
|
25
26
|
import { ColorControl } from '../../color-control';
|
|
@@ -85,9 +86,9 @@ export const BackgroundOverlayRepeaterControl = createControl( () => {
|
|
|
85
86
|
initial={ getInitialBackgroundOverlay() as RepeatablePropValue }
|
|
86
87
|
propTypeUtil={ backgroundOverlayPropTypeUtil as CollectionPropUtil< RepeatablePropValue > }
|
|
87
88
|
>
|
|
88
|
-
<
|
|
89
|
+
<RepeaterHeader label={ __( 'Overlay', 'elementor' ) }>
|
|
89
90
|
<TooltipAddItemAction newItemIndex={ 0 } />
|
|
90
|
-
</
|
|
91
|
+
</RepeaterHeader>
|
|
91
92
|
<ItemsContainer>
|
|
92
93
|
<Item
|
|
93
94
|
Icon={ ItemIcon }
|
|
@@ -5,7 +5,7 @@ import { FormLabel, Grid, styled, type SxProps, type Theme, UnstableColorIndicat
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
8
|
-
import { ControlRepeater,
|
|
8
|
+
import { ControlRepeater, Item, ItemsContainer, TooltipAddItemAction } from '../components/control-repeater';
|
|
9
9
|
import { DisableItemAction } from '../components/control-repeater/actions/disable-item-action';
|
|
10
10
|
import { DuplicateItemAction } from '../components/control-repeater/actions/duplicate-item-action';
|
|
11
11
|
import { RemoveItemAction } from '../components/control-repeater/actions/remove-item-action';
|
|
@@ -13,6 +13,7 @@ import { useRepeaterContext } from '../components/control-repeater/context/repea
|
|
|
13
13
|
import { EditItemPopover } from '../components/control-repeater/items/edit-item-popover';
|
|
14
14
|
import { PopoverContent } from '../components/popover-content';
|
|
15
15
|
import { PopoverGridContainer } from '../components/popover-grid-container';
|
|
16
|
+
import { RepeaterHeader } from '../components/repeater/repeater-header';
|
|
16
17
|
import { createControl } from '../create-control';
|
|
17
18
|
import { ColorControl } from './color-control';
|
|
18
19
|
import { SelectControl } from './select-control';
|
|
@@ -24,9 +25,9 @@ export const BoxShadowRepeaterControl = createControl( () => {
|
|
|
24
25
|
return (
|
|
25
26
|
<PropProvider propType={ propType } value={ value } setValue={ setValue } isDisabled={ () => disabled }>
|
|
26
27
|
<ControlRepeater initial={ initialShadow } propTypeUtil={ boxShadowPropTypeUtil }>
|
|
27
|
-
<
|
|
28
|
+
<RepeaterHeader label={ __( 'Box shadow', 'elementor' ) }>
|
|
28
29
|
<TooltipAddItemAction newItemIndex={ 0 } disabled={ disabled } ariaLabel={ 'Box shadow' } />
|
|
29
|
-
</
|
|
30
|
+
</RepeaterHeader>
|
|
30
31
|
<ItemsContainer>
|
|
31
32
|
<Item
|
|
32
33
|
Icon={ ItemIcon }
|
|
@@ -8,12 +8,13 @@ import {
|
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
9
|
|
|
10
10
|
import { PropProvider, useBoundProp } from '../../bound-prop-context';
|
|
11
|
-
import { ControlRepeater,
|
|
11
|
+
import { ControlRepeater, Item, ItemsContainer, TooltipAddItemAction } from '../../components/control-repeater';
|
|
12
12
|
import { DisableItemAction } from '../../components/control-repeater/actions/disable-item-action';
|
|
13
13
|
import { DuplicateItemAction } from '../../components/control-repeater/actions/duplicate-item-action';
|
|
14
14
|
import { RemoveItemAction } from '../../components/control-repeater/actions/remove-item-action';
|
|
15
15
|
import { EditItemPopover } from '../../components/control-repeater/items/edit-item-popover';
|
|
16
16
|
import type { RepeatablePropValue } from '../../components/control-repeater/types';
|
|
17
|
+
import { RepeaterHeader } from '../../components/repeater/repeater-header';
|
|
17
18
|
import { createControl } from '../../create-control';
|
|
18
19
|
import { FilterConfigProvider, useFilterConfig } from './context/filter-config-context';
|
|
19
20
|
import { FilterContent } from './filter-content';
|
|
@@ -68,12 +69,12 @@ const Repeater = ( { propTypeUtil, label, filterPropName }: RepeaterProps ) => {
|
|
|
68
69
|
|
|
69
70
|
return (
|
|
70
71
|
<ControlRepeater initial={ getInitialValue() as RepeatablePropValue } propTypeUtil={ propTypeUtil }>
|
|
71
|
-
<
|
|
72
|
+
<RepeaterHeader label={ label }>
|
|
72
73
|
<TooltipAddItemAction
|
|
73
74
|
newItemIndex={ 0 }
|
|
74
75
|
ariaLabel={ filterPropName === 'backdrop-filter' ? 'backdrop filter' : 'filter' }
|
|
75
76
|
/>
|
|
76
|
-
</
|
|
77
|
+
</RepeaterHeader>
|
|
77
78
|
<ItemsContainer>
|
|
78
79
|
<Item
|
|
79
80
|
Label={ FilterLabel }
|
|
@@ -4,17 +4,17 @@ import { createArrayPropUtils, type SizePropValue } from '@elementor/editor-prop
|
|
|
4
4
|
import { Box } from '@elementor/ui';
|
|
5
5
|
|
|
6
6
|
import { PropProvider, useBoundProp } from '../bound-prop-context';
|
|
7
|
-
import { ControlRepeater,
|
|
7
|
+
import { ControlRepeater, Item, TooltipAddItemAction } from '../components/control-repeater';
|
|
8
8
|
import { DisableItemAction } from '../components/control-repeater/actions/disable-item-action';
|
|
9
9
|
import { DuplicateItemAction } from '../components/control-repeater/actions/duplicate-item-action';
|
|
10
10
|
import { RemoveItemAction } from '../components/control-repeater/actions/remove-item-action';
|
|
11
11
|
import { type TooltipAddItemActionProps } from '../components/control-repeater/actions/tooltip-add-item-action';
|
|
12
12
|
import { EditItemPopover } from '../components/control-repeater/items/edit-item-popover';
|
|
13
13
|
import { ItemsContainer } from '../components/control-repeater/items/items-container';
|
|
14
|
-
import { type RepeatablePropValue } from '../components/control-repeater/types';
|
|
14
|
+
import { type CollectionPropUtil, type RepeatablePropValue } from '../components/control-repeater/types';
|
|
15
15
|
import { PopoverContent } from '../components/popover-content';
|
|
16
16
|
import { PopoverGridContainer } from '../components/popover-grid-container';
|
|
17
|
-
import {
|
|
17
|
+
import { RepeaterHeader } from '../components/repeater/repeater-header';
|
|
18
18
|
import { createControl } from '../create-control';
|
|
19
19
|
import {
|
|
20
20
|
type ChildControlConfig,
|
|
@@ -79,13 +79,13 @@ export const RepeatableControl = createControl(
|
|
|
79
79
|
initial={ childPropTypeUtil.create( initialValues || null ) }
|
|
80
80
|
propTypeUtil={ childArrayPropTypeUtil as CollectionPropUtil< RepeatablePropValue > }
|
|
81
81
|
>
|
|
82
|
-
<
|
|
82
|
+
<RepeaterHeader label={ repeaterLabel }>
|
|
83
83
|
<TooltipAddItemAction
|
|
84
84
|
{ ...addItemTooltipProps }
|
|
85
85
|
newItemIndex={ 0 }
|
|
86
86
|
ariaLabel={ repeaterLabel }
|
|
87
87
|
/>
|
|
88
|
-
</
|
|
88
|
+
</RepeaterHeader>
|
|
89
89
|
<ItemsContainer isSortable={ false }>
|
|
90
90
|
<Item
|
|
91
91
|
Icon={ ItemIcon }
|
|
@@ -6,10 +6,11 @@ import { bindTrigger, Box, IconButton, type PopupState, Tooltip, Typography, use
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../../bound-prop-context';
|
|
9
|
-
import { ControlRepeater,
|
|
9
|
+
import { ControlRepeater, Item, ItemsContainer, TooltipAddItemAction } from '../../components/control-repeater';
|
|
10
10
|
import { DisableItemAction } from '../../components/control-repeater/actions/disable-item-action';
|
|
11
11
|
import { RemoveItemAction } from '../../components/control-repeater/actions/remove-item-action';
|
|
12
12
|
import { EditItemPopover } from '../../components/control-repeater/items/edit-item-popover';
|
|
13
|
+
import { RepeaterHeader } from '../../components/repeater/repeater-header';
|
|
13
14
|
import { ControlAdornments } from '../../control-adornments/control-adornments';
|
|
14
15
|
import { createControl } from '../../create-control';
|
|
15
16
|
import { initialRotateValue, initialScaleValue, initialSkewValue, initialTransformValue } from './initial-values';
|
|
@@ -73,7 +74,7 @@ const Repeater = ( {
|
|
|
73
74
|
initial={ getInitialValue() ?? initialTransformValue }
|
|
74
75
|
propTypeUtil={ transformFunctionsPropTypeUtil }
|
|
75
76
|
>
|
|
76
|
-
<
|
|
77
|
+
<RepeaterHeader
|
|
77
78
|
label={ __( 'Transform', 'elementor' ) }
|
|
78
79
|
adornment={ () => <ControlAdornments customContext={ { path: [ 'transform' ], propType } } /> }
|
|
79
80
|
ref={ headerRef }
|
|
@@ -85,7 +86,7 @@ const Repeater = ( {
|
|
|
85
86
|
enableTooltip={ shouldDisableAddItem }
|
|
86
87
|
ariaLabel={ 'transform' }
|
|
87
88
|
/>
|
|
88
|
-
</
|
|
89
|
+
</RepeaterHeader>
|
|
89
90
|
<ItemsContainer>
|
|
90
91
|
<Item
|
|
91
92
|
Icon={ TransformIcon }
|
package/src/index.ts
CHANGED
|
@@ -41,7 +41,12 @@ export { InlineEditor } from './components/inline-editor';
|
|
|
41
41
|
export { ControlFormLabel } from './components/control-form-label';
|
|
42
42
|
export { ControlToggleButtonGroup } from './components/control-toggle-button-group';
|
|
43
43
|
export { ClearIconButton } from './components/icon-buttons/clear-icon-button';
|
|
44
|
-
export {
|
|
44
|
+
export {
|
|
45
|
+
Repeater,
|
|
46
|
+
type SetRepeaterValuesMeta,
|
|
47
|
+
type ItemActionPayload,
|
|
48
|
+
type RepeaterItem,
|
|
49
|
+
} from './components/repeater/repeater';
|
|
45
50
|
export { FloatingActionsBar } from './components/floating-bar';
|
|
46
51
|
|
|
47
52
|
// types
|
|
File without changes
|