@supernova-studio/client 0.51.0 → 0.51.2
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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/design-system-content/documentation-hierarchy.ts +1 -0
- package/src/yjs/version-room/base.ts +6 -0
- package/src/yjs/version-room/frontend.ts +6 -0
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ export const DocumentationHierarchySettings = z.object({
|
|
|
22
22
|
routingVersion: z.string(),
|
|
23
23
|
isDraftFeatureAdopted: z.boolean(),
|
|
24
24
|
isApprovalFeatureEnabled: z.boolean(),
|
|
25
|
+
approvalRequiredForPublishing: z.boolean(),
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
export type DocumentationHierarchySettings = z.infer<typeof DocumentationHierarchySettings>;
|
|
@@ -79,6 +79,7 @@ export class VersionRoomBaseYDoc {
|
|
|
79
79
|
routingVersion: map.get("routingVersion"),
|
|
80
80
|
isDraftFeatureAdopted: map.get("isDraftFeatureAdopted") ?? false,
|
|
81
81
|
isApprovalFeatureEnabled: map.get("isApprovalFeatureEnabled") ?? false,
|
|
82
|
+
approvalRequiredForPublishing: map.get("approvalRequiredForPublishing") ?? false,
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
const settingsParseResult = DocumentationHierarchySettings.safeParse(rawSettings);
|
|
@@ -87,6 +88,7 @@ export class VersionRoomBaseYDoc {
|
|
|
87
88
|
routingVersion: "2",
|
|
88
89
|
isDraftFeatureAdopted: false,
|
|
89
90
|
isApprovalFeatureEnabled: false,
|
|
91
|
+
approvalRequiredForPublishing: false,
|
|
90
92
|
};
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -98,6 +100,10 @@ export class VersionRoomBaseYDoc {
|
|
|
98
100
|
map.set("routingVersion", settings.routingVersion ?? map.get("routingVersion"));
|
|
99
101
|
map.set("isDraftFeatureAdopted", settings.isDraftFeatureAdopted ?? map.get("isDraftFeatureAdopted"));
|
|
100
102
|
map.set("isApprovalFeatureEnabled", settings.isApprovalFeatureEnabled ?? map.get("isApprovalFeatureEnabled"));
|
|
103
|
+
map.set(
|
|
104
|
+
"approvalRequiredForPublishing",
|
|
105
|
+
settings.approvalRequiredForPublishing ?? map.get("approvalRequiredForPublishing")
|
|
106
|
+
);
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
private get internalSettingsYMap() {
|
|
@@ -421,6 +421,12 @@ export class FrontendVersionRoomYDoc {
|
|
|
421
421
|
return settings.isApprovalFeatureEnabled;
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
+
isApprovalRequiredForPublishing() {
|
|
425
|
+
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
426
|
+
const settings = doc.getDocumentationInternalSettings();
|
|
427
|
+
return settings.approvalRequiredForPublishing;
|
|
428
|
+
}
|
|
429
|
+
|
|
424
430
|
private buildPageApprovalStates(pages: DocumentationPageV2[]) {
|
|
425
431
|
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
426
432
|
const pageIds = pages.map(p => p.id);
|