@supernova-studio/model 0.55.5 → 0.55.7

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.55.5",
3
+ "version": "0.55.7",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -192,6 +192,10 @@ export const PageBlockDefinitionComponentOptions = z.object({
192
192
  allowPropertySelection: z.boolean().optional(),
193
193
  });
194
194
 
195
+ export const PageBlockDefinitionFigmaComponentOptions = z.object({
196
+ renderLayoutAs: z.enum(["Grid", "PropsTable", "Canvas", "Playground"]),
197
+ });
198
+
195
199
  export type PageBlockDefinitionUntypedPropertyOptions = z.infer<typeof PageBlockDefinitionUntypedPropertyOptions>;
196
200
  export type PageBlockDefinitionRichTextOptions = z.infer<typeof PageBlockDefinitionRichTextOptions>;
197
201
  export type PageBlockDefinitionMutiRichTextOptions = z.infer<typeof PageBlockDefinitionMutiRichTextOptions>;
@@ -202,6 +206,7 @@ export type PageBlockDefinitionImageOptions = z.infer<typeof PageBlockDefinition
202
206
  export type PageBlockDefinitionBooleanOptions = z.infer<typeof PageBlockDefinitionBooleanOptions>;
203
207
  export type PageBlockDefinitionNumberOptions = z.infer<typeof PageBlockDefinitionNumberOptions>;
204
208
  export type PageBlockDefinitionComponentOptions = z.infer<typeof PageBlockDefinitionComponentOptions>;
209
+ export type PageBlockDefinitionFigmaComponentOptions = z.infer<typeof PageBlockDefinitionFigmaComponentOptions>;
205
210
 
206
211
  //
207
212
  // Definitions
@@ -47,6 +47,8 @@ export const PageBlockTypeV1 = z.enum([
47
47
  "TableCell",
48
48
  "Guidelines",
49
49
  "Guideline",
50
+ "FigmaComponents",
51
+ "FigmaComponentPropsTable",
50
52
  ]);
51
53
 
52
54
  export const PageBlockCodeLanguage = z.enum([
@@ -168,17 +170,6 @@ export const PageBlockCustomBlockPropertyImageValue = z.object({
168
170
  export const PageBlockCustomBlockPropertyValue = z.object({
169
171
  key: z.string(),
170
172
  value: z.any(),
171
-
172
- // TODO Artem: for some reason there are cases when there's an array here in the DB
173
- // e.g. element id 67451 in the dev db
174
-
175
- // value: z
176
- // .boolean()
177
- // .or(z.number())
178
- // .or(z.string())
179
- // .or(ColorTokenData)
180
- // .or(TypographyTokenData)
181
- // .or(PageBlockCustomBlockPropertyImageValue),
182
173
  });
183
174
 
184
175
  export const PageBlockFigmaFrameProperties = z.object({
@@ -218,6 +209,23 @@ export const PageBlockTableProperties = z.object({
218
209
  columns: z.array(PageBlockTableColumn),
219
210
  });
220
211
 
212
+ export const PageBlockFigmaComponentBlockConfig = z.object({
213
+ showComponentName: nullishToOptional(z.boolean()),
214
+ showComponentDescription: nullishToOptional(z.boolean()),
215
+ showPropertyList: nullishToOptional(z.boolean()),
216
+ previewContainerSize: nullishToOptional(z.enum(["Centered", "NaturalHeight"])),
217
+ backgroundColor: nullishToOptional(ColorTokenInlineData),
218
+ });
219
+
220
+ export const PageBlockSelectedFigmaComponent = z.object({
221
+ figmaComponentId: z.string(),
222
+ selectedComponentProperties: z.string().array(),
223
+ });
224
+
225
+ //
226
+ // Rich text
227
+ //
228
+
221
229
  export const PageBlockTextSpanAttributeType = z.enum(["Bold", "Italic", "Link", "Strikethrough", "Code", "Comment"]);
222
230
 
223
231
  export const PageBlockTextSpanAttribute = z.object({
@@ -275,6 +283,7 @@ export type PageBlockSwatch = z.infer<typeof PageBlockSwatch>;
275
283
  export type PageBlockShortcut = z.infer<typeof PageBlockShortcut>;
276
284
  export type PageBlockCustomBlockPropertyValue = z.infer<typeof PageBlockCustomBlockPropertyValue>;
277
285
  export type PageBlockCustomBlockPropertyImageValue = z.infer<typeof PageBlockCustomBlockPropertyImageValue>;
286
+ export type PageBlockFigmaComponentBlockConfig = z.infer<typeof PageBlockFigmaComponentBlockConfig>;
278
287
 
279
288
  //
280
289
  // Block
@@ -342,6 +351,11 @@ export const PageBlockBaseV1 = z.object({
342
351
  swatches: nullishToOptional(PageBlockSwatch.array()),
343
352
  blacklistedElementProperties: nullishToOptional(z.array(z.string())),
344
353
 
354
+ // Figma components
355
+ figmaComponentsBlockConfig: nullishToOptional(PageBlockFigmaComponentBlockConfig),
356
+ selectedFigmaComponent: nullishToOptional(PageBlockSelectedFigmaComponent),
357
+ selectedFigmaComponents: nullishToOptional(PageBlockSelectedFigmaComponent.array()),
358
+
345
359
  // Arbitrary
346
360
  userMetadata: nullishToOptional(z.string()),
347
361
  });
@@ -148,7 +148,7 @@ export const PageBlockItemFigmaComponentValue = z.object({
148
148
  z.object({
149
149
  entityId: z.string(),
150
150
  entityType: z.enum(["FigmaComponent"]),
151
- entityMeta: PageBlockFigmaComponentEntityMeta.optional(),
151
+ selectedComponentProperties: z.string().array().optional(),
152
152
  })
153
153
  )
154
154
  .default([]),