@elementor/editor-canvas 4.0.0-650 → 4.0.0-660

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.js CHANGED
@@ -1017,7 +1017,7 @@ function createProviderSubscriber2({ provider, renderStyles, setStyleItems, cach
1017
1017
  }
1018
1018
  async function createItems(signal) {
1019
1019
  const allStyles = provider.actions.all();
1020
- const styles = allStyles.reverse().map((style) => {
1020
+ const styles = [...allStyles].reverse().map((style) => {
1021
1021
  return {
1022
1022
  ...style,
1023
1023
  cssName: provider.actions.resolveCssName(style.id)
package/dist/index.mjs CHANGED
@@ -983,7 +983,7 @@ function createProviderSubscriber2({ provider, renderStyles, setStyleItems, cach
983
983
  }
984
984
  async function createItems(signal) {
985
985
  const allStyles = provider.actions.all();
986
- const styles = allStyles.reverse().map((style) => {
986
+ const styles = [...allStyles].reverse().map((style) => {
987
987
  return {
988
988
  ...style,
989
989
  cssName: provider.actions.resolveCssName(style.id)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "4.0.0-650",
4
+ "version": "4.0.0-660",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,24 +37,24 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "4.0.0-650",
41
- "@elementor/editor-controls": "4.0.0-650",
42
- "@elementor/editor-documents": "4.0.0-650",
43
- "@elementor/editor-elements": "4.0.0-650",
44
- "@elementor/editor-interactions": "4.0.0-650",
45
- "@elementor/editor-mcp": "4.0.0-650",
46
- "@elementor/editor-notifications": "4.0.0-650",
47
- "@elementor/editor-props": "4.0.0-650",
48
- "@elementor/editor-responsive": "4.0.0-650",
49
- "@elementor/editor-styles": "4.0.0-650",
50
- "@elementor/editor-styles-repository": "4.0.0-650",
51
- "@elementor/editor-ui": "4.0.0-650",
52
- "@elementor/editor-v1-adapters": "4.0.0-650",
53
- "@elementor/schema": "4.0.0-650",
54
- "@elementor/twing": "4.0.0-650",
40
+ "@elementor/editor": "4.0.0-660",
41
+ "@elementor/editor-controls": "4.0.0-660",
42
+ "@elementor/editor-documents": "4.0.0-660",
43
+ "@elementor/editor-elements": "4.0.0-660",
44
+ "@elementor/editor-interactions": "4.0.0-660",
45
+ "@elementor/editor-mcp": "4.0.0-660",
46
+ "@elementor/editor-notifications": "4.0.0-660",
47
+ "@elementor/editor-props": "4.0.0-660",
48
+ "@elementor/editor-responsive": "4.0.0-660",
49
+ "@elementor/editor-styles": "4.0.0-660",
50
+ "@elementor/editor-styles-repository": "4.0.0-660",
51
+ "@elementor/editor-ui": "4.0.0-660",
52
+ "@elementor/editor-v1-adapters": "4.0.0-660",
53
+ "@elementor/schema": "4.0.0-660",
54
+ "@elementor/twing": "4.0.0-660",
55
55
  "@elementor/ui": "1.36.17",
56
- "@elementor/utils": "4.0.0-650",
57
- "@elementor/wp-media": "4.0.0-650",
56
+ "@elementor/utils": "4.0.0-660",
57
+ "@elementor/wp-media": "4.0.0-660",
58
58
  "@floating-ui/react": "^0.27.5",
59
59
  "@wordpress/i18n": "^5.13.0"
60
60
  },
@@ -128,6 +128,9 @@ describe( 'useStyleItems', () => {
128
128
 
129
129
  jest.mocked( stylesRepository ).getProviders.mockReturnValue( [ mockProvider1, mockProvider2 ] );
130
130
 
131
+ const provider1OriginalOrder = mockProvider1.actions.all().map( ( s ) => s.id );
132
+ const provider2OriginalOrder = mockProvider2.actions.all().map( ( s ) => s.id );
133
+
131
134
  let attachPreviewCallback: () => Promise< void >;
132
135
 
133
136
  jest.mocked( registerDataHook ).mockImplementation( ( position, command, callback ) => {
@@ -156,6 +159,9 @@ describe( 'useStyleItems', () => {
156
159
  { id: 'style2', breakpoint: 'desktop' },
157
160
  { id: 'style1', breakpoint: 'desktop' },
158
161
  ] );
162
+
163
+ expect( mockProvider1.actions.all().map( ( s ) => s.id ) ).toEqual( provider1OriginalOrder );
164
+ expect( mockProvider2.actions.all().map( ( s ) => s.id ) ).toEqual( provider2OriginalOrder );
159
165
  } );
160
166
 
161
167
  it( 'should return style items ordered by provider priority and breakpoint', async () => {
@@ -181,7 +181,7 @@ function createProviderSubscriber( { provider, renderStyles, setStyleItems, cach
181
181
  async function createItems( signal: AbortSignal ) {
182
182
  const allStyles = provider.actions.all();
183
183
 
184
- const styles = allStyles.reverse().map( ( style ) => {
184
+ const styles = [ ...allStyles ].reverse().map( ( style ) => {
185
185
  return {
186
186
  ...style,
187
187
  cssName: provider.actions.resolveCssName( style.id ),