@contentful/experiences-visual-editor-react 0.0.1-alpha.3 → 0.0.1-alpha.4

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
@@ -16,7 +16,7 @@ styleInject(css_248z$7);
16
16
 
17
17
  const INCOMING_EVENTS$1 = {
18
18
  RequestEditorMode: 'requestEditorMode',
19
- CompositionUpdated: 'componentTreeUpdated',
19
+ ExperienceUpdated: 'componentTreeUpdated',
20
20
  ComponentDraggingChanged: 'componentDraggingChanged',
21
21
  ComponentDragCanceled: 'componentDragCanceled',
22
22
  ComponentDragStarted: 'componentDragStarted',
@@ -1187,6 +1187,13 @@ class EntityStoreBase {
1187
1187
  }
1188
1188
  return this.entryMap.get(id);
1189
1189
  }
1190
+ toJSON() {
1191
+ return {
1192
+ entryMap: Object.fromEntries(this.entryMap),
1193
+ assetMap: Object.fromEntries(this.assetMap),
1194
+ locale: this.locale,
1195
+ };
1196
+ }
1190
1197
  }
1191
1198
 
1192
1199
  /**
@@ -1467,7 +1474,7 @@ const OUTGOING_EVENTS = {
1467
1474
  };
1468
1475
  const INCOMING_EVENTS = {
1469
1476
  RequestEditorMode: 'requestEditorMode',
1470
- CompositionUpdated: 'componentTreeUpdated',
1477
+ ExperienceUpdated: 'componentTreeUpdated',
1471
1478
  ComponentDraggingChanged: 'componentDraggingChanged',
1472
1479
  ComponentDragCanceled: 'componentDragCanceled',
1473
1480
  ComponentDragStarted: 'componentDragStarted',
@@ -2388,7 +2395,9 @@ const resolveAssembly = ({ node, entityStore, }) => {
2388
2395
  });
2389
2396
  return node;
2390
2397
  }
2391
- const componentFields = entityStore?.getValue(assembly, ['fields']);
2398
+ const componentFields = entityStore?.getValue(assembly, [
2399
+ 'fields',
2400
+ ]);
2392
2401
  if (!componentFields) {
2393
2402
  console.warn(`Entry for assembly with ID '${componentId}' not found`, { entityStore });
2394
2403
  return node;
@@ -3067,7 +3076,7 @@ const EmptyContainer = ({ isDragging }) => {
3067
3076
  React.createElement("rect", { width: "11.676", height: "11.676", x: "18.011", y: "18.625", rx: "1.621", transform: "rotate(45 18.01 18.625)" }),
3068
3077
  React.createElement("rect", { width: "11.676", height: "11.676", x: "30.557", y: "10.131", rx: "1.621", transform: "rotate(60 30.557 10.13)" }),
3069
3078
  React.createElement("path", { fill: "#fff", stroke: "#fff", strokeWidth: ".243", d: "M31.113 17.038a.463.463 0 0 0-.683-.517l-1.763 1.032-1.033-1.763a.464.464 0 0 0-.8.469l1.034 1.763-1.763 1.033a.463.463 0 1 0 .468.8l1.763-1.033 1.033 1.763a.463.463 0 1 0 .8-.469l-1.033-1.763 1.763-1.033a.463.463 0 0 0 .214-.282Z" })),
3070
- React.createElement("span", { className: styles$1.label }, "Add elements to begin")));
3079
+ React.createElement("span", { className: styles$1.label }, "Add components to begin")));
3071
3080
  };
3072
3081
 
3073
3082
  const getZoneParents = (zoneId) => {
@@ -3694,7 +3703,7 @@ function useEditorSubscriber() {
3694
3703
  console.debug(`[experiences-sdk-react::onMessage] Received message [${eventData.eventType}]`, eventData);
3695
3704
  const { payload } = eventData;
3696
3705
  switch (eventData.eventType) {
3697
- case INCOMING_EVENTS.CompositionUpdated: {
3706
+ case INCOMING_EVENTS.ExperienceUpdated: {
3698
3707
  const { tree, locale, changedNode, changedValueType, assemblies, } = payload;
3699
3708
  // Make sure to first store the assemblies before setting the tree and thus triggering a rerender
3700
3709
  if (assemblies) {