@elementor/editor-controls 3.32.0-46 → 3.32.0-47

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": "3.32.0-46",
4
+ "version": "3.32.0-47",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,21 +40,21 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "3.32.0-46",
44
- "@elementor/editor-elements": "3.32.0-46",
45
- "@elementor/editor-props": "3.32.0-46",
46
- "@elementor/editor-responsive": "3.32.0-46",
47
- "@elementor/editor-ui": "3.32.0-46",
48
- "@elementor/editor-v1-adapters": "3.32.0-46",
49
- "@elementor/env": "3.32.0-46",
50
- "@elementor/http-client": "3.32.0-46",
43
+ "@elementor/editor-current-user": "3.32.0-47",
44
+ "@elementor/editor-elements": "3.32.0-47",
45
+ "@elementor/editor-props": "3.32.0-47",
46
+ "@elementor/editor-responsive": "3.32.0-47",
47
+ "@elementor/editor-ui": "3.32.0-47",
48
+ "@elementor/editor-v1-adapters": "3.32.0-47",
49
+ "@elementor/env": "3.32.0-47",
50
+ "@elementor/http-client": "3.32.0-47",
51
51
  "@elementor/icons": "^1.51.1",
52
- "@elementor/locations": "3.32.0-46",
53
- "@elementor/query": "3.32.0-46",
54
- "@elementor/session": "3.32.0-46",
52
+ "@elementor/locations": "3.32.0-47",
53
+ "@elementor/query": "3.32.0-47",
54
+ "@elementor/session": "3.32.0-47",
55
55
  "@elementor/ui": "1.36.8",
56
- "@elementor/utils": "3.32.0-46",
57
- "@elementor/wp-media": "3.32.0-46",
56
+ "@elementor/utils": "3.32.0-47",
57
+ "@elementor/wp-media": "3.32.0-47",
58
58
  "@wordpress/i18n": "^5.13.0",
59
59
  "@monaco-editor/react": "^4.7.0"
60
60
  },
@@ -22,11 +22,11 @@ export const Header = ( { label, children }: React.PropsWithChildren< { label: s
22
22
  <Typography component="label" variant="caption" color="text.secondary" sx={ { lineHeight: 1 } }>
23
23
  { label }
24
24
  </Typography>
25
+ <ControlAdornments />
25
26
  <RepeaterHeaderActionsSlot value={ value } />
26
27
  <SlotChildren whitelist={ [ TransformBaseControl, TooltipAddItemAction ] as React.FC[] } sorted>
27
28
  { children }
28
29
  </SlotChildren>
29
- <ControlAdornments />
30
30
  </Stack>
31
31
  );
32
32
  };
@@ -257,6 +257,8 @@ const ImageOverlayContent = () => {
257
257
  };
258
258
 
259
259
  const StyledUnstableColorIndicator = styled( UnstableColorIndicator )( ( { theme } ) => ( {
260
+ height: '1rem',
261
+ width: '1rem',
260
262
  borderRadius: `${ theme.shape.borderRadius / 2 }px`,
261
263
  } ) );
262
264
 
@@ -1,12 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { useMemo } from 'react';
3
- import { createArrayPropUtils, type PropKey } from '@elementor/editor-props';
3
+ import { createArrayPropUtils } from '@elementor/editor-props';
4
4
  import { Box } from '@elementor/ui';
5
5
 
6
- import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
6
+ import { PropProvider, useBoundProp } from '../bound-prop-context';
7
7
  import { PopoverContent } from '../components/popover-content';
8
8
  import { PopoverGridContainer } from '../components/popover-grid-container';
9
- import { Repeater } from '../components/repeater';
9
+ import { type CollectionPropUtil } from '../components/repeater';
10
+ import { Header, Item, TooltipAddItemAction, UnstableRepeater } from '../components/unstable-repeater';
11
+ import { DisableItemAction } from '../components/unstable-repeater/actions/disable-item-action';
12
+ import { DuplicateItemAction } from '../components/unstable-repeater/actions/duplicate-item-action';
13
+ import { RemoveItemAction } from '../components/unstable-repeater/actions/remove-item-action';
14
+ import { EditItemPopover } from '../components/unstable-repeater/items/edit-item-popover';
15
+ import { ItemsContainer } from '../components/unstable-repeater/items/items-container';
16
+ import { type RepeatablePropValue } from '../components/unstable-repeater/types';
10
17
  import { createControl } from '../create-control';
11
18
  import {
12
19
  type ChildControlConfig,
@@ -64,41 +71,36 @@ export const RepeatableControl = createControl(
64
71
  return (
65
72
  <PropProvider propType={ propType } value={ value } setValue={ setValue }>
66
73
  <RepeatableControlContext.Provider value={ contextValue }>
67
- <Repeater
68
- openOnAdd
69
- values={ value ?? [] }
70
- setValues={ setValue }
71
- label={ repeaterLabel }
72
- isSortable={ false }
73
- itemSettings={ {
74
- Icon: ItemIcon,
75
- Label: ItemLabel,
76
- Content: ItemContent,
77
- initialValues: childPropTypeUtil.create( initialValues || null ),
78
- } }
79
- showDuplicate={ showDuplicate }
80
- showToggle={ showToggle }
81
- />
74
+ <UnstableRepeater
75
+ initial={ childPropTypeUtil.create( initialValues || null ) }
76
+ propTypeUtil={ childArrayPropTypeUtil as CollectionPropUtil< RepeatablePropValue > }
77
+ >
78
+ <Header label={ repeaterLabel }>
79
+ <TooltipAddItemAction newItemIndex={ 0 } />
80
+ </Header>
81
+ <ItemsContainer
82
+ isSortable={ false }
83
+ itemTemplate={ <Item Icon={ ItemIcon } Label={ ItemLabel } /> }
84
+ >
85
+ { showDuplicate && <DuplicateItemAction /> }
86
+ { showToggle && <DisableItemAction /> }
87
+ <RemoveItemAction />
88
+ </ItemsContainer>
89
+ <EditItemPopover>
90
+ <Content />
91
+ </EditItemPopover>
92
+ </UnstableRepeater>
82
93
  </RepeatableControlContext.Provider>
83
94
  </PropProvider>
84
95
  );
85
96
  }
86
97
  );
87
98
 
88
- const ItemContent = ( { bind }: { bind: PropKey } ) => {
89
- return (
90
- <PropKeyProvider bind={ bind }>
91
- <Content />
92
- </PropKeyProvider>
93
- );
94
- };
95
-
96
99
  // TODO: Configurable icon probably can be somehow part of the injected control and bubbled up to the repeater
97
100
  const ItemIcon = () => <></>;
98
101
 
99
102
  const Content = () => {
100
103
  const { component: ChildControl, props = {} } = useRepeatableControlContext();
101
-
102
104
  return (
103
105
  <PopoverContent p={ 1.5 }>
104
106
  <PopoverGridContainer>
@@ -56,7 +56,7 @@ export const TransitionSelector = ( { recentlyUsedList }: { recentlyUsedList: st
56
56
  }
57
57
  return [
58
58
  {
59
- label: __( 'Recent', 'elementor' ),
59
+ label: __( 'Recently Used', 'elementor' ),
60
60
  items: recentItems,
61
61
  },
62
62
  ...filteredItems,