@supernova-studio/client 0.47.71 → 0.47.73

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.47.71",
3
+ "version": "0.47.73",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -4,6 +4,7 @@ import {
4
4
  DocumentationPageV2,
5
5
  ElementGroup,
6
6
  ElementGroupSnapshot,
7
+ defaultDocumentationItemConfigurationV2,
7
8
  mapByUnique,
8
9
  } from "@supernova-studio/model";
9
10
  import * as Y from "yjs";
@@ -22,7 +23,7 @@ import { generatePageContentHash } from "./utils";
22
23
 
23
24
  type ItemState = {
24
25
  title: string;
25
- configuration: DocumentationItemConfigurationV2 | undefined;
26
+ configuration: DocumentationItemConfigurationV2;
26
27
  contentHash: string;
27
28
  };
28
29
 
@@ -149,7 +150,7 @@ export class FrontendVersionRoomYDoc {
149
150
  private itemStateFromPage(page: DocumentationPageV2, pageContentHash: string): ItemState {
150
151
  return {
151
152
  title: page.meta.name,
152
- configuration: page.data.configuration,
153
+ configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,
153
154
  contentHash: pageContentHash,
154
155
  };
155
156
  }
@@ -198,7 +199,7 @@ export class FrontendVersionRoomYDoc {
198
199
  private itemStateFromGroup(group: ElementGroup): ItemState {
199
200
  return {
200
201
  title: group.meta.name,
201
- configuration: group.data?.configuration,
202
+ configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,
202
203
  contentHash: "-",
203
204
  };
204
205
  }
@@ -231,12 +232,7 @@ export class FrontendVersionRoomYDoc {
231
232
  updatedDraftState.changes.previousTitle = publishedState.title;
232
233
  }
233
234
 
234
- const currentStateConfigHash = currentState.configuration ? generateHash(currentState.configuration) : "default";
235
- const publishedStateConfigHash = publishedState.configuration
236
- ? generateHash(publishedState.configuration)
237
- : "default";
238
-
239
- if (currentStateConfigHash !== publishedStateConfigHash) {
235
+ if (generateHash(currentState.configuration) !== generateHash(publishedState.configuration)) {
240
236
  if (this.debug) {
241
237
  console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
242
238
  }