@supernova-studio/client 0.47.59 → 0.47.60

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.59",
3
+ "version": "0.47.60",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -5,10 +5,16 @@ import { DTOExportJob } from "../export";
5
5
  export const DTOPublishDocumentationRequest = z.object({
6
6
  environment: PublishedDocEnvironment,
7
7
 
8
- changes: z.object({
9
- pagePersistentIds: z.string().array(),
10
- groupPersistentIds: z.string().array(),
11
- }),
8
+ /**
9
+ * If defined, this allows narrowing down what is published to a set of specific pages and groups
10
+ * If undefined, everything will be published.
11
+ */
12
+ changes: z
13
+ .object({
14
+ pagePersistentIds: z.string().array(),
15
+ groupPersistentIds: z.string().array(),
16
+ })
17
+ .optional(),
12
18
  });
13
19
 
14
20
  export const DTOPublishDocumentationResponse = z.object({
@@ -16,9 +16,9 @@ import {
16
16
  documentationPagesToDTOV2,
17
17
  elementGroupsToDocumentationGroupDTOV2,
18
18
  } from "../../api";
19
- import { generateHash } from "../../utils";
20
19
  import { DocumentationPageEditorModel } from "../docs-editor";
21
20
  import { VersionRoomBaseYDoc } from "./base";
21
+ import { generatePageContentHash } from "./utils";
22
22
 
23
23
  type ItemState = {
24
24
  title: string;
@@ -29,7 +29,7 @@ type ItemState = {
29
29
  export class FrontendVersionRoomYDoc {
30
30
  private readonly yDoc: Y.Doc;
31
31
 
32
- constructor(yDoc: Y.Doc) {
32
+ constructor(yDoc: Y.Doc, private readonly debug = false) {
33
33
  this.yDoc = yDoc;
34
34
  }
35
35
 
@@ -249,7 +249,10 @@ export class FrontendVersionRoomYDoc {
249
249
  //
250
250
 
251
251
  notifyDocumentationPageContentUpdated(pageId: string, content: DocumentationPageEditorModel) {
252
- const pageContentHash = generateHash(content);
252
+ const pageContentHash = generatePageContentHash(content);
253
+ if (this.debug) {
254
+ console.log(`Will set page content hash: '${pageId}' : '${pageContentHash}'`);
255
+ }
253
256
 
254
257
  new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({
255
258
  [pageId]: pageContentHash,