@supernova-studio/model 0.48.37 → 0.49.0
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 +256 -65
- package/dist/index.d.ts +256 -65
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +863 -838
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/design-system.ts +1 -0
- package/src/dsm/documentation/approvals/approval-state.ts +4 -0
- package/src/dsm/documentation/approvals/approval.ts +17 -0
- package/src/dsm/documentation/approvals/index.ts +2 -0
- package/src/dsm/documentation/index.ts +1 -0
- package/src/dsm/elements/component-set.ts +1 -2
- package/src/dsm/elements/component.ts +4 -4
- package/src/liveblocks/rooms/design-system-version-room.ts +6 -1
package/package.json
CHANGED
package/src/dsm/design-system.ts
CHANGED
|
@@ -21,6 +21,7 @@ export const DesignSystem = z.object({
|
|
|
21
21
|
docViewUrl: nullishToOptional(z.string()),
|
|
22
22
|
basePrefixes: z.array(z.string()),
|
|
23
23
|
designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
|
|
24
|
+
isApprovalFeatureEnabled: z.boolean(),
|
|
24
25
|
createdAt: z.coerce.date(),
|
|
25
26
|
updatedAt: z.coerce.date(),
|
|
26
27
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DbCreateInputOmit, DocumentationPageApprovalState } from "../../../";
|
|
3
|
+
|
|
4
|
+
export const DocumentationPageApproval = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
approvalState: DocumentationPageApprovalState,
|
|
7
|
+
persistentId: z.string(),
|
|
8
|
+
pageId: z.string(),
|
|
9
|
+
pagePersistentId: z.string(),
|
|
10
|
+
updatedByUserId: z.string(),
|
|
11
|
+
designSystemVersionId: z.string(),
|
|
12
|
+
updatedAt: z.coerce.date(),
|
|
13
|
+
createdAt: z.coerce.date(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type CreateDocumentationPageApproval = DbCreateInputOmit<DocumentationPageApproval>;
|
|
17
|
+
export type DocumentationPageApproval = z.infer<typeof DocumentationPageApproval>;
|
|
@@ -3,8 +3,7 @@ import { FigmaComponentSetProperties } from "./component-properties";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
export const ComponentSet = BaseComponent.extend({
|
|
6
|
-
|
|
6
|
+
properties: FigmaComponentSetProperties,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
export type ComponentSet = z.infer<typeof ComponentSet>;
|
|
@@ -30,10 +30,10 @@ export const BaseComponent = DesignElementBase.extend(DesignElementGroupableRequ
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export const Component = BaseComponent.extend({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
svg: ComponentAsset.optional(),
|
|
34
|
+
isAsset: z.boolean(),
|
|
35
|
+
componentSetId: z.string().optional(),
|
|
36
|
+
properties: FigmaComponentProperties.optional(),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export type ComponentAsset = z.infer<typeof ComponentAsset>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Entity } from "../../common/entity";
|
|
3
|
-
import { DocumentationPageSnapshot, ElementGroupSnapshot } from "../../dsm";
|
|
3
|
+
import { DocumentationPageApproval, DocumentationPageSnapshot, ElementGroupSnapshot } from "../../dsm";
|
|
4
4
|
import { DocumentationPageV2 } from "../../dsm/elements/documentation-page-v2";
|
|
5
5
|
import { ElementGroup } from "../../dsm/elements/group";
|
|
6
6
|
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
@@ -26,6 +26,7 @@ export type UpdateDesignSystemVersionRoom = DbUpdate<DesignSystemVersionRoom>;
|
|
|
26
26
|
export const DesignSystemVersionRoomInternalSettings = z.object({
|
|
27
27
|
routingVersion: z.string(),
|
|
28
28
|
isDraftFeatureAdopted: z.boolean(),
|
|
29
|
+
isApprovalFeatureEnabled: z.boolean(),
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
export const DesignSystemVersionRoomInitialState = z.object({
|
|
@@ -35,6 +36,7 @@ export const DesignSystemVersionRoomInitialState = z.object({
|
|
|
35
36
|
pageSnapshots: z.array(DocumentationPageSnapshot),
|
|
36
37
|
groupSnapshots: z.array(ElementGroupSnapshot),
|
|
37
38
|
|
|
39
|
+
pageApprovals: z.array(DocumentationPageApproval),
|
|
38
40
|
internalSettings: DesignSystemVersionRoomInternalSettings,
|
|
39
41
|
});
|
|
40
42
|
|
|
@@ -49,6 +51,9 @@ export const DesignSystemVersionRoomUpdate = z.object({
|
|
|
49
51
|
pageSnapshotIdsToDelete: z.array(z.string()),
|
|
50
52
|
groupSnapshotIdsToDelete: z.array(z.string()),
|
|
51
53
|
pageHashesToUpdate: z.record(z.string(), z.string()),
|
|
54
|
+
|
|
55
|
+
pageApprovals: z.array(DocumentationPageApproval),
|
|
56
|
+
pageApprovalIdsToDelete: z.array(z.string()),
|
|
52
57
|
});
|
|
53
58
|
|
|
54
59
|
export type DesignSystemVersionRoomInternalSettings = z.infer<typeof DesignSystemVersionRoomInternalSettings>;
|