@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/dist/index.d.mts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/documentation/publish.ts +10 -4
- package/src/yjs/version-room/frontend.ts +6 -3
package/package.json
CHANGED
|
@@ -5,10 +5,16 @@ import { DTOExportJob } from "../export";
|
|
|
5
5
|
export const DTOPublishDocumentationRequest = z.object({
|
|
6
6
|
environment: PublishedDocEnvironment,
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 =
|
|
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,
|