@supernova-studio/model 0.7.1 → 0.9.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 +573 -515
- package/dist/index.d.ts +573 -515
- package/dist/index.js +71 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +99 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/elements/data/documentation-block-v1.ts +6 -0
- package/src/dsm/elements/data/documentation-block-v2.ts +25 -3
- package/src/dsm/elements/raw-element.ts +7 -1
- package/src/workspace/workspace-context.ts +3 -1
package/package.json
CHANGED
|
@@ -171,6 +171,11 @@ export const PageBlockCustomBlockPropertyValue = z.object({
|
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
export const PageBlockFigmaFrameProperties = z.object({
|
|
174
|
+
color: nullishToOptional(
|
|
175
|
+
z.object({
|
|
176
|
+
value: z.string(),
|
|
177
|
+
})
|
|
178
|
+
),
|
|
174
179
|
alignment: PageBlockTilesAlignment,
|
|
175
180
|
layout: PageBlockTilesLayout,
|
|
176
181
|
backgroundColor: nullishToOptional(ColorTokenInlineData),
|
|
@@ -236,6 +241,7 @@ export type PageBlockFrame = z.infer<typeof PageBlockFrame>;
|
|
|
236
241
|
export type PageBlockFrameOrigin = z.infer<typeof PageBlockFrameOrigin>;
|
|
237
242
|
export type PageBlockAsset = z.infer<typeof PageBlockAsset>;
|
|
238
243
|
export type PageBlockTableColumn = z.infer<typeof PageBlockTableColumn>;
|
|
244
|
+
export type PageBlockTheme = z.infer<typeof PageBlockTheme>;
|
|
239
245
|
|
|
240
246
|
//
|
|
241
247
|
// Block
|
|
@@ -12,11 +12,15 @@ export const PageBlockLinkType = z.enum(["DocumentationItem", "PageHeading", "Ur
|
|
|
12
12
|
export const PageBlockImageType = z.enum(["Upload", "Asset", "FigmaFrame"]);
|
|
13
13
|
export const PageBlockImageAlignment = z.enum(["Left", "Center", "Stretch"]);
|
|
14
14
|
export const PageBlockTableCellAlignment = z.enum(["Left", "Center", "Right"]);
|
|
15
|
+
export const PageBlockPreviewContainerSize = z.enum(["Centered", "NaturalHeight"]);
|
|
16
|
+
export const PageBlockThemeDisplayMode = z.enum(["Split", "Override"]);
|
|
15
17
|
|
|
16
18
|
export type PageBlockLinkType = z.infer<typeof PageBlockLinkType>;
|
|
17
19
|
export type PageBlockImageType = z.infer<typeof PageBlockImageType>;
|
|
18
20
|
export type PageBlockImageAlignment = z.infer<typeof PageBlockImageAlignment>;
|
|
19
21
|
export type PageBlockTableCellAlignment = z.infer<typeof PageBlockTableCellAlignment>;
|
|
22
|
+
export type PageBlockPreviewContainerSize = z.infer<typeof PageBlockPreviewContainerSize>;
|
|
23
|
+
export type PageBlockThemeDisplayMode = z.infer<typeof PageBlockThemeDisplayMode>;
|
|
20
24
|
|
|
21
25
|
//
|
|
22
26
|
// Definitions - Block
|
|
@@ -74,6 +78,11 @@ export const PageBlockItemImageReference = z.object({
|
|
|
74
78
|
.object({
|
|
75
79
|
sourceId: z.string(),
|
|
76
80
|
frameId: z.string(),
|
|
81
|
+
frameReferenceId: z.string(),
|
|
82
|
+
origin: z.object({
|
|
83
|
+
title: z.string().optional(),
|
|
84
|
+
sourceFileName: z.string().optional(),
|
|
85
|
+
}),
|
|
77
86
|
})
|
|
78
87
|
.optional(),
|
|
79
88
|
});
|
|
@@ -81,12 +90,18 @@ export const PageBlockItemImageReference = z.object({
|
|
|
81
90
|
export const PageBlockItemAssetValue = z.object({
|
|
82
91
|
selectedPropertyIds: z.array(z.string()).optional(),
|
|
83
92
|
showSearch: z.boolean().optional(),
|
|
84
|
-
previewContainerSize:
|
|
93
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
85
94
|
backgroundColor: z.string().optional(),
|
|
86
95
|
value: z.array(
|
|
87
96
|
z.object({
|
|
88
97
|
entityId: z.string(),
|
|
89
98
|
entityType: z.enum(["Asset", "AssetGroup"]),
|
|
99
|
+
entityMeta: z
|
|
100
|
+
.object({
|
|
101
|
+
title: z.string().optional(),
|
|
102
|
+
description: z.string().optional(),
|
|
103
|
+
})
|
|
104
|
+
.optional(),
|
|
90
105
|
})
|
|
91
106
|
),
|
|
92
107
|
});
|
|
@@ -109,6 +124,7 @@ export const PageBlockItemSandboxValue = z.object({
|
|
|
109
124
|
showCode: z.boolean().optional(),
|
|
110
125
|
backgroundColor: z.string().optional(),
|
|
111
126
|
alignPreview: z.enum(["Left", "Center"]).optional(),
|
|
127
|
+
previewHeight: z.number().optional(),
|
|
112
128
|
value: z.string(),
|
|
113
129
|
});
|
|
114
130
|
|
|
@@ -182,11 +198,16 @@ export const PageBlockItemTextValue = z.object({
|
|
|
182
198
|
export const PageBlockItemTokenValue = z.object({
|
|
183
199
|
selectedPropertyIds: z.array(z.string()).optional(),
|
|
184
200
|
selectedThemeIds: z.array(z.string()).optional(),
|
|
185
|
-
themeDisplayMode:
|
|
201
|
+
themeDisplayMode: PageBlockThemeDisplayMode.optional(),
|
|
186
202
|
value: z.array(
|
|
187
203
|
z.object({
|
|
188
204
|
entityId: z.string(),
|
|
189
205
|
entityType: z.enum(["Token", "TokenGroup"]),
|
|
206
|
+
entityMeta: z
|
|
207
|
+
.object({
|
|
208
|
+
showNestedGroups: z.boolean().optional(),
|
|
209
|
+
})
|
|
210
|
+
.optional(),
|
|
190
211
|
})
|
|
191
212
|
),
|
|
192
213
|
});
|
|
@@ -247,12 +268,13 @@ export const PageBlockItemTableMultiRichTextNode = z.object({
|
|
|
247
268
|
|
|
248
269
|
export const PageBlockItemTableImageNode = z.object({
|
|
249
270
|
type: z.literal("Image"),
|
|
271
|
+
caption: PageBlockItemImageValue.shape.caption,
|
|
250
272
|
value: PageBlockItemImageValue.shape.value,
|
|
251
273
|
});
|
|
252
274
|
|
|
253
275
|
export const PageBlockItemTableNode = z.discriminatedUnion("type", [
|
|
254
276
|
PageBlockItemTableRichTextNode,
|
|
255
|
-
PageBlockItemTableMultiRichTextNode,
|
|
277
|
+
// PageBlockItemTableMultiRichTextNode,
|
|
256
278
|
PageBlockItemTableImageNode,
|
|
257
279
|
]);
|
|
258
280
|
|
|
@@ -107,12 +107,12 @@ export const ShallowDesignElement = z.object({
|
|
|
107
107
|
brandPersistentId: z.string().optional(),
|
|
108
108
|
parentPersistentId: z.string().optional(),
|
|
109
109
|
shortPersistentId: z.string().optional(),
|
|
110
|
+
childType: DesignElementType.optional(),
|
|
110
111
|
sortOrder: z.number(),
|
|
111
112
|
});
|
|
112
113
|
|
|
113
114
|
export const DesignElement = ShallowDesignElement.extend({
|
|
114
115
|
meta: ObjectMeta,
|
|
115
|
-
childType: DesignElementType.optional(),
|
|
116
116
|
slug: z.string().optional(),
|
|
117
117
|
userSlug: z.string().optional(),
|
|
118
118
|
createdAt: z.date(),
|
|
@@ -124,3 +124,9 @@ export const DesignElement = ShallowDesignElement.extend({
|
|
|
124
124
|
|
|
125
125
|
export type ShallowDesignElement = z.infer<typeof ShallowDesignElement>;
|
|
126
126
|
export type DesignElement = z.infer<typeof DesignElement>;
|
|
127
|
+
|
|
128
|
+
export const HierarchicalElements = DesignTokenType.or(
|
|
129
|
+
z.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
export type HierarchicalElements = z.infer<typeof HierarchicalElements>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ProductCodeSchema } from "../billing";
|
|
2
1
|
import { z } from "zod";
|
|
2
|
+
import { ProductCodeSchema } from "../billing";
|
|
3
|
+
import { WorkspaceIpSettings } from "./workspace";
|
|
3
4
|
|
|
4
5
|
export const WorkspaceContext = z.object({
|
|
5
6
|
workspaceId: z.string(),
|
|
6
7
|
product: ProductCodeSchema,
|
|
8
|
+
ipWhitelist: WorkspaceIpSettings,
|
|
7
9
|
publicDesignSystem: z.boolean().optional(),
|
|
8
10
|
});
|
|
9
11
|
|