@elementor/editor-controls 3.35.0-469 → 3.35.0-470

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.35.0-469",
4
+ "version": "3.35.0-470",
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.35.0-469",
44
- "@elementor/editor-elements": "3.35.0-469",
45
- "@elementor/editor-props": "3.35.0-469",
46
- "@elementor/editor-responsive": "3.35.0-469",
47
- "@elementor/editor-ui": "3.35.0-469",
48
- "@elementor/editor-v1-adapters": "3.35.0-469",
49
- "@elementor/env": "3.35.0-469",
50
- "@elementor/http-client": "3.35.0-469",
43
+ "@elementor/editor-current-user": "3.35.0-470",
44
+ "@elementor/editor-elements": "3.35.0-470",
45
+ "@elementor/editor-props": "3.35.0-470",
46
+ "@elementor/editor-responsive": "3.35.0-470",
47
+ "@elementor/editor-ui": "3.35.0-470",
48
+ "@elementor/editor-v1-adapters": "3.35.0-470",
49
+ "@elementor/env": "3.35.0-470",
50
+ "@elementor/http-client": "3.35.0-470",
51
51
  "@elementor/icons": "^1.63.0",
52
- "@elementor/locations": "3.35.0-469",
53
- "@elementor/mixpanel": "3.35.0-469",
54
- "@elementor/query": "3.35.0-469",
55
- "@elementor/session": "3.35.0-469",
52
+ "@elementor/locations": "3.35.0-470",
53
+ "@elementor/mixpanel": "3.35.0-470",
54
+ "@elementor/query": "3.35.0-470",
55
+ "@elementor/session": "3.35.0-470",
56
56
  "@elementor/ui": "1.36.17",
57
- "@elementor/utils": "3.35.0-469",
58
- "@elementor/wp-media": "3.35.0-469",
57
+ "@elementor/utils": "3.35.0-470",
58
+ "@elementor/wp-media": "3.35.0-470",
59
59
  "@wordpress/i18n": "^5.13.0",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "dayjs": "^1.11.18",
@@ -67,9 +67,27 @@ export const RepeaterContextProvider = < T extends RepeatablePropValue = Repeata
67
67
  } );
68
68
 
69
69
  const [ uniqueKeys, setUniqueKeys ] = useState( () => {
70
- return items?.map( ( _, index ) => index ) ?? [];
70
+ return items?.map( () => generateUniqueKey() ) ?? [];
71
71
  } );
72
72
 
73
+ React.useEffect( () => {
74
+ const nextLength = items?.length ?? 0;
75
+
76
+ setUniqueKeys( ( prev ) => {
77
+ const prevLength = prev.length;
78
+
79
+ if ( prevLength === nextLength ) {
80
+ return prev;
81
+ }
82
+
83
+ if ( prevLength > nextLength ) {
84
+ return prev.slice( 0, nextLength );
85
+ }
86
+
87
+ return [ ...prev, ...Array.from( { length: nextLength - prevLength }, generateUniqueKey ) ];
88
+ } );
89
+ }, [ items?.length ] );
90
+
73
91
  const itemsWithKeys = useMemo(
74
92
  () =>
75
93
  uniqueKeys