@supernova-studio/model 0.7.1 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/model",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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),
@@ -12,11 +12,13 @@ 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"]);
15
16
 
16
17
  export type PageBlockLinkType = z.infer<typeof PageBlockLinkType>;
17
18
  export type PageBlockImageType = z.infer<typeof PageBlockImageType>;
18
19
  export type PageBlockImageAlignment = z.infer<typeof PageBlockImageAlignment>;
19
20
  export type PageBlockTableCellAlignment = z.infer<typeof PageBlockTableCellAlignment>;
21
+ export type PageBlockPreviewContainerSize = z.infer<typeof PageBlockPreviewContainerSize>;
20
22
 
21
23
  //
22
24
  // Definitions - Block
@@ -74,6 +76,11 @@ export const PageBlockItemImageReference = z.object({
74
76
  .object({
75
77
  sourceId: z.string(),
76
78
  frameId: z.string(),
79
+ frameReferenceId: z.string(),
80
+ origin: z.object({
81
+ title: z.string().optional(),
82
+ sourceFileName: z.string().optional(),
83
+ }),
77
84
  })
78
85
  .optional(),
79
86
  });
@@ -81,12 +88,18 @@ export const PageBlockItemImageReference = z.object({
81
88
  export const PageBlockItemAssetValue = z.object({
82
89
  selectedPropertyIds: z.array(z.string()).optional(),
83
90
  showSearch: z.boolean().optional(),
84
- previewContainerSize: z.enum(["Centered", "NaturalHeight"]).optional(),
91
+ previewContainerSize: PageBlockPreviewContainerSize.optional(),
85
92
  backgroundColor: z.string().optional(),
86
93
  value: z.array(
87
94
  z.object({
88
95
  entityId: z.string(),
89
96
  entityType: z.enum(["Asset", "AssetGroup"]),
97
+ entityMeta: z
98
+ .object({
99
+ title: z.string().optional(),
100
+ description: z.string().optional(),
101
+ })
102
+ .optional(),
90
103
  })
91
104
  ),
92
105
  });
@@ -247,12 +260,13 @@ export const PageBlockItemTableMultiRichTextNode = z.object({
247
260
 
248
261
  export const PageBlockItemTableImageNode = z.object({
249
262
  type: z.literal("Image"),
263
+ caption: PageBlockItemImageValue.shape.caption,
250
264
  value: PageBlockItemImageValue.shape.value,
251
265
  });
252
266
 
253
267
  export const PageBlockItemTableNode = z.discriminatedUnion("type", [
254
268
  PageBlockItemTableRichTextNode,
255
- PageBlockItemTableMultiRichTextNode,
269
+ // PageBlockItemTableMultiRichTextNode,
256
270
  PageBlockItemTableImageNode,
257
271
  ]);
258
272
 
@@ -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>;