@supernova-studio/model 0.52.18 → 0.53.2

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.52.18",
3
+ "version": "0.53.2",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,7 +47,7 @@ export const PageBlockDefinitionRichTextPropertyStyle = z.enum([
47
47
  "Default",
48
48
  ]);
49
49
 
50
- export const PageBlockDefinitionMultiRichTextPropertyStyle = z.enum(["OL", "UL", "Default"]);
50
+ export const PageBlockDefinitionMultiRichTextPropertyStyle = z.enum(["OL", "UL"]);
51
51
 
52
52
  export const PageBlockDefinitionRichTextEditorPropertyStyle = z.enum([
53
53
  "OL",
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { PageBlockDefinitionMultiRichTextPropertyStyle } from "../../documentation/block-definitions/item";
2
3
  import { DesignTokenType } from "../raw-element";
3
4
  import { PageBlockCalloutType, PageBlockCodeLanguage, PageBlockText } from "./documentation-block-v1";
4
5
 
@@ -248,10 +249,6 @@ export const PageBlockItemRichTextValue = z.object({
248
249
  calloutType: PageBlockCalloutType.optional(),
249
250
  });
250
251
 
251
- export const PageBlockItemRichTextEditorValue = z.object({
252
- value: z.any(),
253
- });
254
-
255
252
  export const PageBlockItemSingleSelectValue = z.object({
256
253
  value: z.string(),
257
254
  });
@@ -325,6 +322,35 @@ export type PageBlockItemTokenPropertyValue = z.infer<typeof PageBlockItemTokenP
325
322
  export type PageBlockItemTokenTypeValue = z.infer<typeof PageBlockItemTokenTypeValue>;
326
323
  export type PageBlockItemUrlValue = z.infer<typeof PageBlockItemUrlValue>;
327
324
 
325
+ //
326
+ // Definitions - Rich text editor value
327
+ //
328
+
329
+ export const PageBlockItemRichTextEditorParagraphNode = z.object({
330
+ type: z.literal("Paragraph"),
331
+ value: PageBlockItemRichTextValue.shape.value,
332
+ });
333
+
334
+ export const PageBlockItemRichTextEditorListNode = z.object({
335
+ type: z.literal("List"),
336
+ listType: PageBlockDefinitionMultiRichTextPropertyStyle,
337
+ value: PageBlockItemMultiRichTextValue.shape.value,
338
+ });
339
+
340
+ export const PageBlockItemRichTextEditorNode = z.discriminatedUnion("type", [
341
+ PageBlockItemRichTextEditorParagraphNode,
342
+ PageBlockItemRichTextEditorListNode,
343
+ ]);
344
+
345
+ export const PageBlockItemRichTextEditorValue = z.object({
346
+ value: PageBlockItemRichTextEditorNode.array(),
347
+ });
348
+
349
+ export type PageBlockItemRichTextEditorParagraphNode = z.infer<typeof PageBlockItemRichTextEditorParagraphNode>;
350
+ export type PageBlockItemRichTextEditorListNode = z.infer<typeof PageBlockItemRichTextEditorListNode>;
351
+ export type PageBlockItemRichTextEditorNode = z.infer<typeof PageBlockItemRichTextEditorNode>;
352
+ export type PageBlockItemRichTextEditorValue = z.infer<typeof PageBlockItemRichTextEditorValue>;
353
+
328
354
  //
329
355
  // Definitions - Table Value
330
356
  //
@@ -335,11 +361,6 @@ export const PageBlockItemTableRichTextNode = z.object({
335
361
  value: PageBlockItemRichTextValue.shape.value,
336
362
  });
337
363
 
338
- export const PageBlockItemTableMultiRichTextNode = z.object({
339
- type: z.literal("MultiRichText"),
340
- value: PageBlockItemMultiRichTextValue.shape.value,
341
- });
342
-
343
364
  export const PageBlockItemTableImageNode = z.object({
344
365
  type: z.literal("Image"),
345
366
  id: z.string(),
@@ -349,7 +370,6 @@ export const PageBlockItemTableImageNode = z.object({
349
370
 
350
371
  export const PageBlockItemTableNode = z.discriminatedUnion("type", [
351
372
  PageBlockItemTableRichTextNode,
352
- // PageBlockItemTableMultiRichTextNode,
353
373
  PageBlockItemTableImageNode,
354
374
  ]);
355
375
 
@@ -372,7 +392,6 @@ export const PageBlockItemTableValue = z.object({
372
392
  });
373
393
 
374
394
  export type PageBlockItemTableRichTextNode = z.infer<typeof PageBlockItemTableRichTextNode>;
375
- export type PageBlockItemTableMultiRichTextNode = z.infer<typeof PageBlockItemTableMultiRichTextNode>;
376
395
  export type PageBlockItemTableImageNode = z.infer<typeof PageBlockItemTableImageNode>;
377
396
  export type PageBlockItemTableNode = z.infer<typeof PageBlockItemTableNode>;
378
397
  export type PageBlockItemTableCell = z.infer<typeof PageBlockItemTableCell>;
@@ -1,4 +1,4 @@
1
- import { ZodType, ZodTypeDef, z } from "zod";
1
+ import { ZodType, ZodTypeDef } from "zod";
2
2
 
3
3
  /**
4
4
  * Allows both null and undefined as input values in addition to the actual value,