@supernova-studio/model 0.17.0 → 0.18.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 +4189 -19
- package/dist/index.d.ts +4189 -19
- package/dist/index.js +20 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/elements/data/documentation-block-v2.ts +7 -0
- package/src/dsm/elements/group.ts +1 -6
- package/src/multiplayer/design-system-version-room.ts +2 -20
- package/src/multiplayer/documentation-page-room.ts +19 -0
package/package.json
CHANGED
|
@@ -155,6 +155,13 @@ export const PageBlockItemEmbedValue = z.object({
|
|
|
155
155
|
value: z.string().optional(),
|
|
156
156
|
caption: z.string().optional(),
|
|
157
157
|
height: z.number().optional(),
|
|
158
|
+
openGraph: z
|
|
159
|
+
.object({
|
|
160
|
+
title: z.string().optional(),
|
|
161
|
+
description: z.string().optional(),
|
|
162
|
+
imageUrl: z.string().optional(),
|
|
163
|
+
})
|
|
164
|
+
.optional(),
|
|
158
165
|
});
|
|
159
166
|
|
|
160
167
|
export const PageBlockItemFigmaNodeValue = z.object({
|
|
@@ -29,13 +29,8 @@ export type UpdateElementGroup = DbUpdate<
|
|
|
29
29
|
}
|
|
30
30
|
>;
|
|
31
31
|
|
|
32
|
-
export type DeleteElementGroup = {
|
|
33
|
-
id: ElementGroup["id"];
|
|
34
|
-
childType: ElementGroup["childType"];
|
|
35
|
-
};
|
|
36
|
-
|
|
37
32
|
export type ElementGroupsDiff = {
|
|
38
33
|
toCreate: CreateElementGroup[];
|
|
39
34
|
toUpdate: UpdateElementGroup[];
|
|
40
|
-
toDelete:
|
|
35
|
+
toDelete: ElementGroup["id"][];
|
|
41
36
|
};
|
|
@@ -20,30 +20,12 @@ export type UpdateDesignSystemVersionRoom = DbUpdate<DesignSystemVersionRoom>;
|
|
|
20
20
|
export const DesignSystemVersionRoomInitialState = z.object({
|
|
21
21
|
pages: z.array(DocumentationPageV2),
|
|
22
22
|
groups: z.array(ElementGroup),
|
|
23
|
-
deletedPagePersistentIds: z.array(z.string()),
|
|
24
|
-
deletedGroupPersistentIds: z.array(z.string()),
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
export const DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
deletedPageIds: z.array(z.string()),
|
|
27
|
+
deletedGroupIds: z.array(z.string()),
|
|
30
28
|
});
|
|
31
29
|
|
|
32
30
|
export type DesignSystemVersionRoomInitialState = z.infer<typeof DesignSystemVersionRoomInitialState>;
|
|
33
31
|
export type DesignSystemVersionRoomUpdate = z.infer<typeof DesignSystemVersionRoomUpdate>;
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
// Utils
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
export function mergeDesignSystemVersionRoomUpdates(
|
|
40
|
-
lhs: DesignSystemVersionRoomUpdate,
|
|
41
|
-
rhs: DesignSystemVersionRoomUpdate
|
|
42
|
-
): DesignSystemVersionRoomUpdate {
|
|
43
|
-
return {
|
|
44
|
-
pages: [...lhs.pages, ...rhs.pages],
|
|
45
|
-
groups: [...lhs.groups, ...rhs.groups],
|
|
46
|
-
deletedPagePersistentIds: [...lhs.deletedPagePersistentIds, ...rhs.deletedPagePersistentIds],
|
|
47
|
-
deletedGroupPersistentIds: [...lhs.deletedGroupPersistentIds, ...rhs.deletedGroupPersistentIds],
|
|
48
|
-
};
|
|
49
|
-
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Entity } from "../common/entity";
|
|
3
3
|
import { DbCreateInputOmit, DbUpdate } from "../helpers";
|
|
4
|
+
import { DocumentationPageV2, ElementGroup, PageBlockDefinition } from "../dsm";
|
|
5
|
+
import { PageBlockEditorModel } from "@supernova-studio/client";
|
|
4
6
|
|
|
5
7
|
export const DocumentationPageRoom = Entity.extend({
|
|
6
8
|
designSystemVersionId: z.string(),
|
|
@@ -12,3 +14,20 @@ export type DocumentationPageRoom = z.infer<typeof DocumentationPageRoom>;
|
|
|
12
14
|
|
|
13
15
|
export type CreateDocumentationPageRoom = DbCreateInputOmit<DocumentationPageRoom>;
|
|
14
16
|
export type UpdateDocumentationPageRoom = DbUpdate<DocumentationPageRoom>;
|
|
17
|
+
|
|
18
|
+
//
|
|
19
|
+
// Room content
|
|
20
|
+
//
|
|
21
|
+
|
|
22
|
+
export const DocumentationPageRoomRoomUpdate = z.object({
|
|
23
|
+
page: DocumentationPageV2,
|
|
24
|
+
pageParent: ElementGroup,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const DocumentationPageRoomInitialState = DocumentationPageRoomRoomUpdate.extend({
|
|
28
|
+
pageBlocks: z.array(PageBlockEditorModel),
|
|
29
|
+
blockDefinitions: z.array(PageBlockDefinition),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type DocumentationPageRoomRoomUpdate = z.infer<typeof DocumentationPageRoomRoomUpdate>;
|
|
33
|
+
export type DocumentationPageRoomInitialState = z.infer<typeof DocumentationPageRoomInitialState>;
|