@elementor/editor-canvas 3.33.0-260 → 3.33.0-261

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
@@ -314,10 +314,10 @@ function useInteractionsItems() {
314
314
  });
315
315
  });
316
316
  });
317
- return (0, import_react7.useMemo)(
318
- () => Object.values(interactionItems).sort(sortByProviderPriority).flatMap(({ items }) => items),
319
- [interactionItems]
320
- );
317
+ return (0, import_react7.useMemo)(() => {
318
+ const result = Object.values(interactionItems).sort(sortByProviderPriority).flatMap(({ items }) => items);
319
+ return result;
320
+ }, [interactionItems]);
321
321
  }
322
322
  function sortByProviderPriority({ provider: providerA }, { provider: providerB }) {
323
323
  return providerA.priority - providerB.priority;
@@ -349,7 +349,7 @@ function InteractionsRenderer() {
349
349
  if (!container) {
350
350
  return null;
351
351
  }
352
- const interactionsData = JSON.stringify(interactionItems);
352
+ const interactionsData = JSON.stringify(Array.isArray(interactionItems) ? interactionItems : []);
353
353
  return /* @__PURE__ */ React3.createElement(import_ui2.Portal, { container }, /* @__PURE__ */ React3.createElement(
354
354
  "script",
355
355
  {
package/dist/index.mjs CHANGED
@@ -273,10 +273,10 @@ function useInteractionsItems() {
273
273
  });
274
274
  });
275
275
  });
276
- return useMemo(
277
- () => Object.values(interactionItems).sort(sortByProviderPriority).flatMap(({ items }) => items),
278
- [interactionItems]
279
- );
276
+ return useMemo(() => {
277
+ const result = Object.values(interactionItems).sort(sortByProviderPriority).flatMap(({ items }) => items);
278
+ return result;
279
+ }, [interactionItems]);
280
280
  }
281
281
  function sortByProviderPriority({ provider: providerA }, { provider: providerB }) {
282
282
  return providerA.priority - providerB.priority;
@@ -308,7 +308,7 @@ function InteractionsRenderer() {
308
308
  if (!container) {
309
309
  return null;
310
310
  }
311
- const interactionsData = JSON.stringify(interactionItems);
311
+ const interactionsData = JSON.stringify(Array.isArray(interactionItems) ? interactionItems : []);
312
312
  return /* @__PURE__ */ React3.createElement(Portal, { container }, /* @__PURE__ */ React3.createElement(
313
313
  "script",
314
314
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "3.33.0-260",
4
+ "version": "3.33.0-261",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,21 +37,21 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "3.33.0-260",
41
- "@elementor/editor-controls": "3.33.0-260",
42
- "@elementor/editor-documents": "3.33.0-260",
43
- "@elementor/editor-elements": "3.33.0-260",
44
- "@elementor/editor-interactions": "3.33.0-260",
45
- "@elementor/editor-notifications": "3.33.0-260",
46
- "@elementor/editor-props": "3.33.0-260",
47
- "@elementor/editor-responsive": "3.33.0-260",
48
- "@elementor/editor-styles": "3.33.0-260",
49
- "@elementor/editor-styles-repository": "3.33.0-260",
50
- "@elementor/editor-v1-adapters": "3.33.0-260",
51
- "@elementor/twing": "3.33.0-260",
40
+ "@elementor/editor": "3.33.0-261",
41
+ "@elementor/editor-controls": "3.33.0-261",
42
+ "@elementor/editor-documents": "3.33.0-261",
43
+ "@elementor/editor-elements": "3.33.0-261",
44
+ "@elementor/editor-interactions": "3.33.0-261",
45
+ "@elementor/editor-notifications": "3.33.0-261",
46
+ "@elementor/editor-props": "3.33.0-261",
47
+ "@elementor/editor-responsive": "3.33.0-261",
48
+ "@elementor/editor-styles": "3.33.0-261",
49
+ "@elementor/editor-styles-repository": "3.33.0-261",
50
+ "@elementor/editor-v1-adapters": "3.33.0-261",
51
+ "@elementor/twing": "3.33.0-261",
52
52
  "@elementor/ui": "1.36.17",
53
- "@elementor/utils": "3.33.0-260",
54
- "@elementor/wp-media": "3.33.0-260",
53
+ "@elementor/utils": "3.33.0-261",
54
+ "@elementor/wp-media": "3.33.0-261",
55
55
  "@floating-ui/react": "^0.27.5",
56
56
  "@wordpress/i18n": "^5.13.0"
57
57
  },
@@ -13,7 +13,7 @@ export function InteractionsRenderer() {
13
13
  return null;
14
14
  }
15
15
 
16
- const interactionsData = JSON.stringify( interactionItems );
16
+ const interactionsData = JSON.stringify( Array.isArray( interactionItems ) ? interactionItems : [] );
17
17
 
18
18
  return (
19
19
  <Portal container={ container }>
@@ -48,6 +48,7 @@ export function useInteractionsItems() {
48
48
  subscriber();
49
49
  } catch {}
50
50
  };
51
+
51
52
  const unsubscribe = provider.subscribe( safeSubscriber );
52
53
  return unsubscribe;
53
54
  } );
@@ -71,13 +72,13 @@ export function useInteractionsItems() {
71
72
  } );
72
73
  } );
73
74
 
74
- return useMemo(
75
- () =>
76
- Object.values( interactionItems )
77
- .sort( sortByProviderPriority )
78
- .flatMap( ( { items } ) => items ),
79
- [ interactionItems ]
80
- );
75
+ return useMemo( () => {
76
+ const result = Object.values( interactionItems )
77
+ .sort( sortByProviderPriority )
78
+ .flatMap( ( { items } ) => items );
79
+
80
+ return result;
81
+ }, [ interactionItems ] );
81
82
  }
82
83
 
83
84
  function sortByProviderPriority(