@supernova-studio/model 0.30.1 → 0.32.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.30.1",
3
+ "version": "0.32.0",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
34
  "@sindresorhus/slugify": "1.1.2",
35
- "ip-cidr": "^4.0.0",
35
+ "ip-cidr": "^3.1.0",
36
36
  "zod": "^3.22.4"
37
37
  },
38
38
  "devDependencies": {
@@ -51,13 +51,13 @@ export const PulsarContributionVariant = z.object({
51
51
  });
52
52
 
53
53
  export const PulsarCustomBlock = z.object({
54
- title: z.string(),
54
+ title: nullishToOptional(z.string()),
55
55
  key: z.string(),
56
- category: z.string(),
56
+ category: nullishToOptional(z.string()),
57
57
  description: nullishToOptional(z.string()),
58
- iconURL: z.string(),
59
- mode: z.enum(["array", "block"]),
60
- properties: z.array(PulsarBaseProperty),
58
+ iconURL: nullishToOptional(z.string()),
59
+ mode: nullishToOptional(z.enum(["array", "block"])),
60
+ properties: nullishToOptional(z.array(PulsarBaseProperty)).transform(v => v ?? []),
61
61
  });
62
62
 
63
63
  //
@@ -4,6 +4,7 @@ export const PageBlockDefinitionAppearance = z.object({
4
4
  isBordered: z.boolean().optional(),
5
5
  hasBackground: z.boolean().optional(),
6
6
  isEditorPresentationDifferent: z.boolean().optional(),
7
+ showBlockHeaderInEditor: z.boolean().optional(),
7
8
  });
8
9
 
9
10
  export type PageBlockDefinitionAppearance = z.infer<typeof PageBlockDefinitionAppearance>;
@@ -59,6 +59,7 @@ export const PageBlockDefinitionTextPropertyStyle = z.enum([
59
59
  "Small",
60
60
  "SmallBold",
61
61
  "SmallSemibold",
62
+ "Custom",
62
63
  ]);
63
64
 
64
65
  export const PageBlockDefinitionTextPropertyColor = z.enum(["Neutral", "NeutralFaded"]);
@@ -244,12 +244,13 @@ export type PageBlockTableColumn = z.infer<typeof PageBlockTableColumn>;
244
244
  export type PageBlockTheme = z.infer<typeof PageBlockTheme>;
245
245
  export type PageBlockShortcut = z.infer<typeof PageBlockShortcut>;
246
246
  export type PageBlockCustomBlockPropertyValue = z.infer<typeof PageBlockCustomBlockPropertyValue>;
247
+ export type PageBlockCustomBlockPropertyImageValue = z.infer<typeof PageBlockCustomBlockPropertyImageValue>;
247
248
 
248
249
  //
249
250
  // Block
250
251
  //
251
252
 
252
- const PageBlockBaseV1 = z.object({
253
+ export const PageBlockBaseV1 = z.object({
253
254
  persistentId: z.string(),
254
255
  type: PageBlockTypeV1,
255
256
 
@@ -24,22 +24,21 @@ export type PageBlockThemeDisplayMode = z.infer<typeof PageBlockThemeDisplayMode
24
24
  // Definitions - Block
25
25
  //
26
26
 
27
+ export const PageBlockImageResourceReference = z.object({
28
+ resourceId: z.string(),
29
+ url: z.string(),
30
+ });
31
+
32
+ export const PageBlockResourceFrameNodeReference = z.object({
33
+ sourceId: z.string(),
34
+ frameReferenceId: z.string(),
35
+ });
36
+
27
37
  export const PageBlockImageReference = z.object({
28
38
  type: PageBlockImageType,
29
39
 
30
- resource: z
31
- .object({
32
- url: z.string(),
33
- resourceId: z.string(),
34
- })
35
- .optional(),
36
-
37
- figmaFile: z
38
- .object({
39
- sourceId: z.string(),
40
- frameReferenceId: z.string(),
41
- })
42
- .optional(),
40
+ resource: PageBlockImageResourceReference.optional(),
41
+ figmaFile: PageBlockResourceFrameNodeReference.optional(),
43
42
  });
44
43
 
45
44
  export const PageBlockColorV2 = z.object({
@@ -92,6 +91,8 @@ export const PageBlockDataV2 = z.object({
92
91
  items: z.array(PageBlockItemV2),
93
92
  });
94
93
 
94
+ export type PageBlockImageResourceReference = z.infer<typeof PageBlockImageResourceReference>;
95
+ export type PageBlockResourceFrameNodeReference = z.infer<typeof PageBlockResourceFrameNodeReference>;
95
96
  export type PageBlockImageReference = z.infer<typeof PageBlockImageReference>;
96
97
  export type PageBlockColorV2 = z.infer<typeof PageBlockColorV2>;
97
98
  export type PageBlockAssetEntityMeta = z.infer<typeof PageBlockAssetEntityMeta>;
@@ -175,10 +176,10 @@ export const PageBlockItemEmbedValue = z.object({
175
176
  });
176
177
 
177
178
  export const PageBlockItemFigmaNodeValue = z.object({
178
- selectedPropertyIds: z.array(z.string()).optional(),
179
179
  showSearch: z.boolean().optional(),
180
180
  previewContainerSize: PageBlockPreviewContainerSize.optional(),
181
181
  backgroundColor: PageBlockColorV2.optional(),
182
+ showFrameDetails: z.boolean().optional(),
182
183
  value: z.array(
183
184
  z.object({
184
185
  entityId: z.string(),
@@ -7,8 +7,3 @@ export const DocumentationPageDataV1 = z.object({
7
7
  blocks: z.array(PageBlockV1),
8
8
  configuration: nullishToOptional(DocumentationItemConfigurationV1),
9
9
  });
10
-
11
- export const DocumentationPageElementDataV1 = z.object({
12
- dataVersion: z.literal(1).optional().default(1),
13
- value: DocumentationPageDataV1,
14
- });
@@ -6,8 +6,3 @@ import { DocumentationPageDataV1 } from "./documentation-page-v1";
6
6
  export const DocumentationPageDataV2 = z.object({
7
7
  configuration: nullishToOptional(DocumentationItemConfigurationV2),
8
8
  });
9
-
10
- export const DocumentationPageElementDataV2 = z.object({
11
- value: DocumentationPageDataV1,
12
- valueV2: DocumentationPageDataV2.optional(),
13
- });
@@ -5,20 +5,10 @@ import { DocumentationItemConfigurationV2 } from "./documentation-v2";
5
5
 
6
6
  export const DocumentationGroupBehavior = z.enum(["Group", "Tabs"]);
7
7
 
8
- export const ElementGroupDataDeprecated = z.object({
9
- behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
10
- configuration: nullishToOptional(DocumentationItemConfigurationV1),
11
- });
12
-
13
8
  export const ElementGroupDataV2 = z.object({
14
9
  behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
15
10
  configuration: nullishToOptional(DocumentationItemConfigurationV2),
16
11
  });
17
12
 
18
- export const ElementGroupElementData = z.object({
19
- value: ElementGroupDataDeprecated.optional(),
20
- valueV2: ElementGroupDataV2.optional(),
21
- });
22
-
23
13
  export type DocumentationGroupBehavior = z.infer<typeof DocumentationGroupBehavior>;
24
14
  export type ElementGroupDataV2 = z.infer<typeof ElementGroupDataV2>;