@supernova-studio/model 1.0.0 → 1.0.1

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.
Files changed (237) hide show
  1. package/dist/index.d.mts +26740 -18977
  2. package/dist/index.d.ts +26740 -18977
  3. package/dist/index.js +275 -47
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2201 -1973
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +3 -4
  8. package/src/asset-delete-schedule/asset-delete-schedule.ts +0 -20
  9. package/src/asset-delete-schedule/index.ts +0 -1
  10. package/src/auth/index.ts +0 -1
  11. package/src/auth/plugin-oauth-request.ts +0 -14
  12. package/src/billing/card.ts +0 -12
  13. package/src/billing/checkoutSession.ts +0 -16
  14. package/src/billing/customer.ts +0 -29
  15. package/src/billing/features.ts +0 -48
  16. package/src/billing/index.ts +0 -9
  17. package/src/billing/invoice.ts +0 -34
  18. package/src/billing/portalSession.ts +0 -19
  19. package/src/billing/price.ts +0 -24
  20. package/src/billing/product.ts +0 -5
  21. package/src/billing/subscription.ts +0 -65
  22. package/src/common/entity.ts +0 -9
  23. package/src/common/index.ts +0 -2
  24. package/src/common/object-meta.ts +0 -8
  25. package/src/custom-domains/custom-domains.ts +0 -24
  26. package/src/custom-domains/index.ts +0 -1
  27. package/src/data-dumps/code-integration-dump.ts +0 -19
  28. package/src/data-dumps/design-system-dump.ts +0 -16
  29. package/src/data-dumps/design-system-version-dump.ts +0 -45
  30. package/src/data-dumps/index.ts +0 -6
  31. package/src/data-dumps/published-docs-dump.ts +0 -10
  32. package/src/data-dumps/user-data-dump.ts +0 -10
  33. package/src/data-dumps/workspace-dump.ts +0 -14
  34. package/src/docs-server/index.ts +0 -1
  35. package/src/docs-server/session.ts +0 -39
  36. package/src/dsm/assets/asset-dynamo-record.ts +0 -10
  37. package/src/dsm/assets/asset-reference.ts +0 -18
  38. package/src/dsm/assets/asset-value.ts +0 -3
  39. package/src/dsm/assets/asset.ts +0 -60
  40. package/src/dsm/assets/index.ts +0 -4
  41. package/src/dsm/brand.ts +0 -13
  42. package/src/dsm/collection.ts +0 -51
  43. package/src/dsm/components/asset-rendering.ts +0 -22
  44. package/src/dsm/components/index.ts +0 -1
  45. package/src/dsm/data-sources/data-source.ts +0 -167
  46. package/src/dsm/data-sources/import-job.ts +0 -30
  47. package/src/dsm/data-sources/import-summary.ts +0 -70
  48. package/src/dsm/data-sources/index.ts +0 -3
  49. package/src/dsm/design-system.ts +0 -47
  50. package/src/dsm/documentation/approvals/approval-state.ts +0 -4
  51. package/src/dsm/documentation/approvals/approval.ts +0 -18
  52. package/src/dsm/documentation/approvals/index.ts +0 -2
  53. package/src/dsm/documentation/block-definitions/aux.ts +0 -10
  54. package/src/dsm/documentation/block-definitions/definition.ts +0 -76
  55. package/src/dsm/documentation/block-definitions/index.ts +0 -4
  56. package/src/dsm/documentation/block-definitions/item.ts +0 -233
  57. package/src/dsm/documentation/block-definitions/variant.ts +0 -49
  58. package/src/dsm/documentation/group.ts +0 -19
  59. package/src/dsm/documentation/index.ts +0 -10
  60. package/src/dsm/documentation/link-preview.ts +0 -10
  61. package/src/dsm/documentation/page-anchor.ts +0 -9
  62. package/src/dsm/documentation/page-content-backup.ts +0 -13
  63. package/src/dsm/documentation/page-content.ts +0 -32
  64. package/src/dsm/documentation/page.ts +0 -18
  65. package/src/dsm/documentation/settings.ts +0 -18
  66. package/src/dsm/documentation/thread.ts +0 -35
  67. package/src/dsm/element-snapshots/base.ts +0 -34
  68. package/src/dsm/element-snapshots/documentation-page-snapshot.ts +0 -29
  69. package/src/dsm/element-snapshots/group-snapshot.ts +0 -27
  70. package/src/dsm/element-snapshots/index.ts +0 -3
  71. package/src/dsm/elements/base.ts +0 -49
  72. package/src/dsm/elements/component-properties.ts +0 -63
  73. package/src/dsm/elements/data/base.ts +0 -18
  74. package/src/dsm/elements/data/blur.ts +0 -16
  75. package/src/dsm/elements/data/border-radius.ts +0 -16
  76. package/src/dsm/elements/data/border-width.ts +0 -16
  77. package/src/dsm/elements/data/border.ts +0 -21
  78. package/src/dsm/elements/data/color.ts +0 -13
  79. package/src/dsm/elements/data/component.ts +0 -30
  80. package/src/dsm/elements/data/dimension.ts +0 -15
  81. package/src/dsm/elements/data/documentation-block-v1.ts +0 -498
  82. package/src/dsm/elements/data/documentation-block-v2.ts +0 -429
  83. package/src/dsm/elements/data/documentation-page-v1.ts +0 -9
  84. package/src/dsm/elements/data/documentation-page-v2.ts +0 -7
  85. package/src/dsm/elements/data/documentation-section-v2.ts +0 -47
  86. package/src/dsm/elements/data/documentation-v1.ts +0 -16
  87. package/src/dsm/elements/data/documentation-v2.ts +0 -18
  88. package/src/dsm/elements/data/duration.ts +0 -16
  89. package/src/dsm/elements/data/figma-file-structure.ts +0 -65
  90. package/src/dsm/elements/data/figma-node-reference.ts +0 -27
  91. package/src/dsm/elements/data/font-family.ts +0 -8
  92. package/src/dsm/elements/data/font-size.ts +0 -16
  93. package/src/dsm/elements/data/font-weight.ts +0 -8
  94. package/src/dsm/elements/data/font.ts +0 -9
  95. package/src/dsm/elements/data/gradient.ts +0 -32
  96. package/src/dsm/elements/data/group.ts +0 -20
  97. package/src/dsm/elements/data/index.ts +0 -43
  98. package/src/dsm/elements/data/item-header-v1.ts +0 -35
  99. package/src/dsm/elements/data/item-header-v2.ts +0 -34
  100. package/src/dsm/elements/data/item-header.ts +0 -14
  101. package/src/dsm/elements/data/letter-spacing.ts +0 -16
  102. package/src/dsm/elements/data/line-height.ts +0 -16
  103. package/src/dsm/elements/data/opacity.ts +0 -13
  104. package/src/dsm/elements/data/paragraph-indent.ts +0 -16
  105. package/src/dsm/elements/data/paragraph-spacing.ts +0 -16
  106. package/src/dsm/elements/data/product-copy.ts +0 -8
  107. package/src/dsm/elements/data/safe-id.ts +0 -13
  108. package/src/dsm/elements/data/shadow.ts +0 -23
  109. package/src/dsm/elements/data/size.ts +0 -16
  110. package/src/dsm/elements/data/space.ts +0 -16
  111. package/src/dsm/elements/data/string.ts +0 -8
  112. package/src/dsm/elements/data/text-case.ts +0 -10
  113. package/src/dsm/elements/data/text-decoration.ts +0 -10
  114. package/src/dsm/elements/data/typography.ts +0 -28
  115. package/src/dsm/elements/data/visibility.ts +0 -10
  116. package/src/dsm/elements/data/z-index.ts +0 -16
  117. package/src/dsm/elements/documentation-page-v1.ts +0 -34
  118. package/src/dsm/elements/documentation-page-v2.ts +0 -21
  119. package/src/dsm/elements/figma-component.ts +0 -67
  120. package/src/dsm/elements/figma-file-structures.ts +0 -40
  121. package/src/dsm/elements/figma-node-reference.ts +0 -25
  122. package/src/dsm/elements/group.ts +0 -40
  123. package/src/dsm/elements/index.ts +0 -15
  124. package/src/dsm/elements/page-block-v2.ts +0 -25
  125. package/src/dsm/elements/primitives/index.ts +0 -2
  126. package/src/dsm/elements/primitives/point.ts +0 -8
  127. package/src/dsm/elements/primitives/size.ts +0 -28
  128. package/src/dsm/elements/raw-element.ts +0 -164
  129. package/src/dsm/elements/theme.ts +0 -76
  130. package/src/dsm/elements/tokens.ts +0 -311
  131. package/src/dsm/elements/utils.ts +0 -114
  132. package/src/dsm/exporter-property-values-collection.ts +0 -31
  133. package/src/dsm/import/asset.ts +0 -6
  134. package/src/dsm/import/base.ts +0 -24
  135. package/src/dsm/import/collection.ts +0 -16
  136. package/src/dsm/import/component.ts +0 -40
  137. package/src/dsm/import/data-source.ts +0 -9
  138. package/src/dsm/import/figma-frames.ts +0 -74
  139. package/src/dsm/import/image.ts +0 -87
  140. package/src/dsm/import/index.ts +0 -12
  141. package/src/dsm/import/origin.ts +0 -5
  142. package/src/dsm/import/support/figma-files.ts +0 -19
  143. package/src/dsm/import/support/import-context.ts +0 -94
  144. package/src/dsm/import/support/import-model-collections.ts +0 -50
  145. package/src/dsm/import/support/index.ts +0 -3
  146. package/src/dsm/import/theme.ts +0 -76
  147. package/src/dsm/import/tokens.ts +0 -50
  148. package/src/dsm/import/warning.ts +0 -38
  149. package/src/dsm/index.ts +0 -19
  150. package/src/dsm/membership/additions.ts +0 -13
  151. package/src/dsm/membership/design-system-membership.ts +0 -92
  152. package/src/dsm/membership/ds-role.ts +0 -28
  153. package/src/dsm/membership/index.ts +0 -4
  154. package/src/dsm/membership/invitations.ts +0 -21
  155. package/src/dsm/properties/index.ts +0 -3
  156. package/src/dsm/properties/property-definition.ts +0 -57
  157. package/src/dsm/properties/property-reference.ts +0 -5
  158. package/src/dsm/properties/property-value.ts +0 -29
  159. package/src/dsm/published-doc-page-visits.ts +0 -15
  160. package/src/dsm/published-doc-page.ts +0 -37
  161. package/src/dsm/published-doc.ts +0 -32
  162. package/src/dsm/reference.ts +0 -9
  163. package/src/dsm/version.ts +0 -41
  164. package/src/dsm/views/column.ts +0 -58
  165. package/src/dsm/views/index.ts +0 -2
  166. package/src/dsm/views/view.ts +0 -19
  167. package/src/emails/design-system-invite.ts +0 -31
  168. package/src/emails/index.ts +0 -2
  169. package/src/emails/workspace-invite.ts +0 -29
  170. package/src/events/base.ts +0 -7
  171. package/src/events/data-source-imported.ts +0 -9
  172. package/src/events/index.ts +0 -3
  173. package/src/events/version-released.ts +0 -10
  174. package/src/export/export-destinations.ts +0 -127
  175. package/src/export/export-jobs.ts +0 -122
  176. package/src/export/export-runner/export-context.ts +0 -34
  177. package/src/export/export-runner/exporter-payload.ts +0 -10
  178. package/src/export/export-runner/index.ts +0 -2
  179. package/src/export/exporter-workspace-membership-role.ts +0 -4
  180. package/src/export/exporter-workspace-membership.ts +0 -14
  181. package/src/export/exporter.ts +0 -55
  182. package/src/export/git-providers.ts +0 -11
  183. package/src/export/index.ts +0 -9
  184. package/src/export/pipeline.ts +0 -34
  185. package/src/export/pulsar.ts +0 -71
  186. package/src/feature-flags/feature-flags.ts +0 -21
  187. package/src/feature-flags/index.ts +0 -1
  188. package/src/helpers/db.ts +0 -82
  189. package/src/helpers/index.ts +0 -2
  190. package/src/helpers/nullish-to-optional.ts +0 -9
  191. package/src/index.ts +0 -20
  192. package/src/integrations/external-oauth-request.ts +0 -12
  193. package/src/integrations/git.ts +0 -49
  194. package/src/integrations/index.ts +0 -6
  195. package/src/integrations/integration.ts +0 -143
  196. package/src/integrations/oauth-providers.ts +0 -13
  197. package/src/integrations/oauth-token.ts +0 -16
  198. package/src/integrations/workspace-oauth-requests.ts +0 -12
  199. package/src/liveblocks/index.ts +0 -1
  200. package/src/liveblocks/rooms/design-system-version-room.ts +0 -62
  201. package/src/liveblocks/rooms/documentation-page-room.ts +0 -65
  202. package/src/liveblocks/rooms/index.ts +0 -4
  203. package/src/liveblocks/rooms/room-type.ts +0 -12
  204. package/src/liveblocks/rooms/workspace-room.ts +0 -16
  205. package/src/npm/index.ts +0 -2
  206. package/src/npm/npm-package.ts +0 -30
  207. package/src/npm/npm-proxy-token-payload.ts +0 -7
  208. package/src/tokens/index.ts +0 -1
  209. package/src/tokens/personal-access-token.ts +0 -25
  210. package/src/users/index.ts +0 -9
  211. package/src/users/linked-integrations.ts +0 -36
  212. package/src/users/user-analytics-cleanup-schedule.ts +0 -15
  213. package/src/users/user-identity.ts +0 -8
  214. package/src/users/user-minified.ts +0 -10
  215. package/src/users/user-notification-settings.ts +0 -18
  216. package/src/users/user-profile.ts +0 -41
  217. package/src/users/user-test.ts +0 -8
  218. package/src/users/user-with-pat.ts +0 -7
  219. package/src/users/user.ts +0 -21
  220. package/src/utils/common.ts +0 -172
  221. package/src/utils/content-loader-instruction.ts +0 -31
  222. package/src/utils/errors.ts +0 -120
  223. package/src/utils/index.ts +0 -6
  224. package/src/utils/naming.ts +0 -73
  225. package/src/utils/slugify.ts +0 -636
  226. package/src/utils/validation.ts +0 -4
  227. package/src/workspace/index.ts +0 -10
  228. package/src/workspace/npm-registry-settings.ts +0 -45
  229. package/src/workspace/sso-provider.ts +0 -13
  230. package/src/workspace/user-invite.ts +0 -18
  231. package/src/workspace/workspace-configuration.ts +0 -14
  232. package/src/workspace/workspace-context.ts +0 -13
  233. package/src/workspace/workspace-create.ts +0 -25
  234. package/src/workspace/workspace-invitations.ts +0 -22
  235. package/src/workspace/workspace-membership.ts +0 -31
  236. package/src/workspace/workspace-role.ts +0 -6
  237. package/src/workspace/workspace.ts +0 -62
@@ -1,429 +0,0 @@
1
- import { z } from "zod";
2
- import { PageBlockDefinitionMultiRichTextPropertyStyle } from "../../documentation/block-definitions/item";
3
- import { DesignTokenType } from "../raw-element";
4
- import { PageBlockCalloutType, PageBlockCodeLanguage, PageBlockText } from "./documentation-block-v1";
5
-
6
- //
7
- // Enums
8
- //
9
-
10
- export const PageBlockLinkType = z.enum(["DocumentationItem", "PageHeading", "Url"]);
11
- export const PageBlockImageType = z.enum(["Resource", "FigmaNode"]);
12
- export const PageBlockImageAlignment = z.enum(["Left", "Center", "Stretch"]);
13
- export const PageBlockTableCellAlignment = z.enum(["Left", "Center", "Right"]);
14
- export const PageBlockPreviewContainerSize = z.enum(["Centered", "NaturalHeight"]);
15
- export const PageBlockThemeDisplayMode = z.enum(["Split", "Override"]);
16
- export const PageBlockTokenNameFormat = z.enum(["Name", "GroupAndName", "FullPath", "CustomProperty"]);
17
- export const PageBlockTokenValueFormat = z.enum(["ResolvedValue", "ReferenceName", "NoValue"]);
18
-
19
- export type PageBlockLinkType = z.infer<typeof PageBlockLinkType>;
20
- export type PageBlockImageType = z.infer<typeof PageBlockImageType>;
21
- export type PageBlockImageAlignment = z.infer<typeof PageBlockImageAlignment>;
22
- export type PageBlockTableCellAlignment = z.infer<typeof PageBlockTableCellAlignment>;
23
- export type PageBlockPreviewContainerSize = z.infer<typeof PageBlockPreviewContainerSize>;
24
- export type PageBlockThemeDisplayMode = z.infer<typeof PageBlockThemeDisplayMode>;
25
- export type PageBlockTokenNameFormat = z.infer<typeof PageBlockTokenNameFormat>;
26
- export type PageBlockTokenValueFormat = z.infer<typeof PageBlockTokenValueFormat>;
27
-
28
- //
29
- // Definitions - Block
30
- //
31
-
32
- export const PageBlockImageResourceReference = z.object({
33
- resourceId: z.string(),
34
- url: z.string(),
35
- });
36
-
37
- export const PageBlockResourceFrameNodeReference = z.object({
38
- sourceId: z.string(),
39
- frameReferenceId: z.string(),
40
- });
41
-
42
- export const PageBlockImageReference = z.object({
43
- type: PageBlockImageType,
44
-
45
- resource: PageBlockImageResourceReference.optional(),
46
- figmaNode: PageBlockResourceFrameNodeReference.optional(),
47
- });
48
-
49
- export const PageBlockColorV2 = z.object({
50
- value: z.string(),
51
- referencedTokenId: z.string().optional(),
52
- });
53
-
54
- export const PageBlockAssetEntityMeta = z.object({
55
- title: z.string().optional(),
56
- description: z.string().optional(),
57
- backgroundColor: PageBlockColorV2.optional(),
58
- showNestedGroups: z.boolean().optional(),
59
- });
60
-
61
- export const PageBlockFigmaComponentEntityMeta = z.object({
62
- title: z.string().optional(),
63
- description: z.string().optional(),
64
- backgroundColor: PageBlockColorV2.optional(),
65
- selectedComponentProperties: z.array(z.string()).optional(),
66
- });
67
-
68
- export const PageBlockFigmaNodeEntityMeta = z.object({
69
- title: z.string().optional(),
70
- description: z.string().optional(),
71
- backgroundColor: PageBlockColorV2.optional(),
72
- });
73
-
74
- export const PageBlockAppearanceV2 = z.object({
75
- itemBackgroundColor: PageBlockColorV2.optional(),
76
- numberOfColumns: z.number().optional(),
77
- });
78
-
79
- export const PageBlockItemUntypedValue = z
80
- .object({
81
- value: z.any(),
82
- })
83
- .and(z.record(z.any()));
84
-
85
- export const PageBlockLinkV2 = z.object({
86
- type: PageBlockLinkType,
87
- documentationItemId: z.string().optional(),
88
- pageHeadingId: z.string().optional(),
89
- url: z.string().optional(),
90
- openInNewTab: z.boolean().optional(),
91
- });
92
-
93
- export const PageBlockItemV2 = z.object({
94
- id: z.string(),
95
- linksTo: PageBlockLinkV2.optional(),
96
- props: z.record(PageBlockItemUntypedValue),
97
- });
98
-
99
- export const PageBlockDataV2 = z.object({
100
- packageId: z.string(),
101
- variantId: z.string().optional(),
102
- indentLevel: z.number(),
103
- appearance: PageBlockAppearanceV2.optional(),
104
- items: z.array(PageBlockItemV2),
105
- });
106
-
107
- export type PageBlockImageResourceReference = z.infer<typeof PageBlockImageResourceReference>;
108
- export type PageBlockResourceFrameNodeReference = z.infer<typeof PageBlockResourceFrameNodeReference>;
109
- export type PageBlockImageReference = z.infer<typeof PageBlockImageReference>;
110
- export type PageBlockColorV2 = z.infer<typeof PageBlockColorV2>;
111
- export type PageBlockAssetEntityMeta = z.infer<typeof PageBlockAssetEntityMeta>;
112
- export type PageBlockFigmaComponentEntityMeta = z.infer<typeof PageBlockFigmaComponentEntityMeta>;
113
- export type PageBlockFigmaNodeEntityMeta = z.infer<typeof PageBlockFigmaNodeEntityMeta>;
114
- export type PageBlockAppearanceV2 = z.infer<typeof PageBlockAppearanceV2>;
115
- export type PageBlockItemUntypedValue = z.infer<typeof PageBlockItemUntypedValue>;
116
- export type PageBlockLinkV2 = z.infer<typeof PageBlockLinkV2>;
117
- export type PageBlockItemV2 = z.infer<typeof PageBlockItemV2>;
118
- export type PageBlockDataV2 = z.infer<typeof PageBlockDataV2>;
119
-
120
- //
121
- // Definitions - Typed Values
122
- //
123
-
124
- export const PageBlockItemAssetValue = z.object({
125
- selectedPropertyIds: z.array(z.string()).optional(),
126
- showSearch: z.boolean().optional(),
127
- showAssetDescription: z.boolean().optional(),
128
- previewContainerSize: PageBlockPreviewContainerSize.optional(),
129
- previewContainerHeight: z.number().optional(),
130
- backgroundColor: PageBlockColorV2.optional(),
131
- value: z
132
- .array(
133
- z.object({
134
- entityId: z.string(),
135
- entityType: z.enum(["Asset", "AssetGroup"]),
136
- entityMeta: PageBlockAssetEntityMeta.optional(),
137
- })
138
- )
139
- .default([]),
140
- });
141
-
142
- export const PageBlockItemAssetPropertyValue = z.object({
143
- value: z.array(z.string()).default([]),
144
- });
145
-
146
- export const PageBlockItemFigmaComponentValue = z.object({
147
- showComponentName: z.boolean().optional(),
148
- showComponentDescription: z.boolean().optional(),
149
- showPropertyList: z.boolean().optional(),
150
- previewOrderIds: z.array(z.string()).optional(),
151
- previewContainerSize: PageBlockPreviewContainerSize.optional(),
152
- previewContainerHeight: z.number().optional(),
153
- backgroundColor: PageBlockColorV2.optional(),
154
- value: z
155
- .array(
156
- z.object({
157
- entityId: z.string(),
158
- entityType: z.enum(["FigmaComponent"]),
159
- entityMeta: z
160
- .object({
161
- selectedComponentProperties: z.string().array().optional(),
162
- })
163
- .optional(),
164
- })
165
- )
166
- .default([]),
167
- });
168
-
169
- export const PageBlockItemBooleanValue = z.object({
170
- value: z.boolean(),
171
- });
172
-
173
- export const PageBlockItemCodeValue = z.object({
174
- format: PageBlockCodeLanguage.optional(),
175
- caption: z.string().optional(),
176
- value: z.string(),
177
- });
178
-
179
- export const PageBlockItemSandboxValue = z.object({
180
- showCode: z.boolean().optional(),
181
- showControls: z.boolean().optional(),
182
- backgroundColor: z.string().optional(),
183
- alignPreview: z.enum(["Left", "Center"]).optional(),
184
- previewHeight: z.number().optional(),
185
- value: z.string(),
186
- });
187
-
188
- export const PageBlockItemColorValue = z.record(z.any());
189
-
190
- export const PageBlockItemComponentValue = z.object({
191
- selectedPropertyIds: z.array(z.string()).optional(),
192
- selectedBrandId: z.string().optional(),
193
- value: z
194
- .array(
195
- z.object({
196
- entityId: z.string(),
197
- entityType: z.enum(["Component", "ComponentGroup"]),
198
- })
199
- )
200
- .default([]),
201
- });
202
-
203
- export const PageBlockItemComponentPropertyValue = z.object({
204
- value: z.string(),
205
- });
206
-
207
- export const PageBlockItemDividerValue = z.object({});
208
-
209
- export const PageBlockItemEmbedValue = z.object({
210
- value: z.string().optional(),
211
- caption: z.string().optional(),
212
- height: z.number().optional(),
213
- alt: z.string().optional(),
214
- openGraph: z
215
- .object({
216
- title: z.string().optional(),
217
- description: z.string().optional(),
218
- imageUrl: z.string().optional(),
219
- })
220
- .optional(),
221
- });
222
-
223
- export const PageBlockItemFigmaNodeValue = z.object({
224
- showSearch: z.boolean().optional(),
225
- previewContainerSize: PageBlockPreviewContainerSize.optional(),
226
- previewContainerHeight: z.number().optional(),
227
- backgroundColor: PageBlockColorV2.optional(),
228
- showFrameDetails: z.boolean().optional(),
229
- value: z
230
- .array(
231
- z.object({
232
- entityId: z.string(),
233
- entityMeta: PageBlockFigmaNodeEntityMeta.optional(),
234
- })
235
- )
236
- .default([]),
237
- });
238
-
239
- export const PageBlockItemImageValue = z.object({
240
- alt: z.string().optional(),
241
- caption: z.string().optional(),
242
- alignment: PageBlockImageAlignment.optional(),
243
- openLightbox: z.boolean().optional(),
244
- isBordered: z.boolean().optional(),
245
- value: PageBlockImageReference.optional(),
246
- });
247
-
248
- export const PageBlockItemMarkdownValue = z.object({
249
- value: z.string(),
250
- });
251
-
252
- export const PageBlockItemMultiRichTextValue = z.object({
253
- value: PageBlockText.array(),
254
- });
255
-
256
- export const PageBlockItemMultiSelectValue = z.object({
257
- value: z.array(z.string()).default([]),
258
- });
259
-
260
- export const PageBlockItemNumberValue = z.object({
261
- value: z.number(),
262
- });
263
-
264
- export const PageBlockItemRichTextValue = z.object({
265
- value: PageBlockText,
266
- calloutType: PageBlockCalloutType.optional(),
267
- });
268
-
269
- export const PageBlockItemSingleSelectValue = z.object({
270
- value: z.string(),
271
- });
272
-
273
- export const PageBlockItemStorybookValue = z.object({
274
- caption: z.string().optional(),
275
- height: z.number().optional(),
276
- embedUrl: z.string().optional(),
277
- value: z.string().optional(),
278
- });
279
-
280
- export const PageBlockItemTextValue = z.object({
281
- value: z.string(),
282
- });
283
-
284
- export const PageBlockItemSwatch = z.object({
285
- id: z.string(),
286
- selectedThemeIds: z.string().array(),
287
- });
288
-
289
- export const PageBlockItemTokenValue = z.object({
290
- selectedPropertyIds: z.array(z.string()).optional(),
291
- selectedThemeIds: z.array(z.string()).optional(),
292
- swatches: z.array(PageBlockItemSwatch).optional(),
293
- themeDisplayMode: PageBlockThemeDisplayMode.optional(),
294
- tokenNameFormat: PageBlockTokenNameFormat.optional(),
295
- tokenNameCustomPropertyId: z.string().optional(),
296
- tokenValueFormat: PageBlockTokenValueFormat.optional(),
297
- value: z
298
- .array(
299
- z.object({
300
- entityId: z.string(),
301
- entityType: z.enum(["Token", "TokenGroup"]),
302
- entityMeta: z
303
- .object({
304
- showNestedGroups: z.boolean().optional(),
305
- })
306
- .optional(),
307
- })
308
- )
309
- .default([]),
310
- });
311
-
312
- export const PageBlockItemTokenPropertyValue = z.object({
313
- selectedPropertyIds: z.array(z.string()).optional(),
314
- selectedThemeIds: z.array(z.string()).optional(),
315
- value: z.array(z.string()).default([]),
316
- });
317
-
318
- export const PageBlockItemTokenTypeValue = z.object({
319
- value: z.array(DesignTokenType).default([]),
320
- });
321
-
322
- export const PageBlockItemUrlValue = z.object({
323
- value: z.string(),
324
- });
325
-
326
- export type PageBlockItemAssetValue = z.infer<typeof PageBlockItemAssetValue>;
327
- export type PageBlockItemAssetPropertyValue = z.infer<typeof PageBlockItemAssetPropertyValue>;
328
- export type PageBlockItemFigmaComponentValue = z.infer<typeof PageBlockItemFigmaComponentValue>;
329
- export type PageBlockItemBooleanValue = z.infer<typeof PageBlockItemBooleanValue>;
330
- export type PageBlockItemCodeValue = z.infer<typeof PageBlockItemCodeValue>;
331
- export type PageBlockItemSandboxValue = z.infer<typeof PageBlockItemSandboxValue>;
332
- export type PageBlockItemColorValue = z.infer<typeof PageBlockItemColorValue>;
333
- export type PageBlockItemComponentValue = z.infer<typeof PageBlockItemComponentValue>;
334
- export type PageBlockItemComponentPropertyValue = z.infer<typeof PageBlockItemComponentPropertyValue>;
335
- export type PageBlockItemDividerValue = z.infer<typeof PageBlockItemDividerValue>;
336
- export type PageBlockItemEmbedValue = z.infer<typeof PageBlockItemEmbedValue>;
337
- export type PageBlockItemFigmaNodeValue = z.infer<typeof PageBlockItemFigmaNodeValue>;
338
- export type PageBlockItemImageValue = z.infer<typeof PageBlockItemImageValue>;
339
- export type PageBlockItemMarkdownValue = z.infer<typeof PageBlockItemMarkdownValue>;
340
- export type PageBlockItemMultiRichTextValue = z.infer<typeof PageBlockItemMultiRichTextValue>;
341
- export type PageBlockItemMultiSelectValue = z.infer<typeof PageBlockItemMultiSelectValue>;
342
- export type PageBlockItemNumberValue = z.infer<typeof PageBlockItemNumberValue>;
343
- export type PageBlockItemRichTextValue = z.infer<typeof PageBlockItemRichTextValue>;
344
- export type PageBlockItemSingleSelectValue = z.infer<typeof PageBlockItemSingleSelectValue>;
345
- export type PageBlockItemStorybookValue = z.infer<typeof PageBlockItemStorybookValue>;
346
- export type PageBlockItemTextValue = z.infer<typeof PageBlockItemTextValue>;
347
- export type PageBlockItemSwatch = z.infer<typeof PageBlockItemSwatch>;
348
- export type PageBlockItemTokenValue = z.infer<typeof PageBlockItemTokenValue>;
349
- export type PageBlockItemTokenPropertyValue = z.infer<typeof PageBlockItemTokenPropertyValue>;
350
- export type PageBlockItemTokenTypeValue = z.infer<typeof PageBlockItemTokenTypeValue>;
351
- export type PageBlockItemUrlValue = z.infer<typeof PageBlockItemUrlValue>;
352
-
353
- //
354
- // Definitions - Rich text editor value
355
- //
356
-
357
- export const PageBlockItemRichTextEditorParagraphNode = z.object({
358
- type: z.literal("Paragraph"),
359
- value: PageBlockItemRichTextValue.shape.value,
360
- });
361
-
362
- export const PageBlockItemRichTextEditorListNode = z.object({
363
- type: z.literal("List"),
364
- listType: PageBlockDefinitionMultiRichTextPropertyStyle,
365
- value: PageBlockItemMultiRichTextValue.shape.value,
366
- });
367
-
368
- export const PageBlockItemRichTextEditorNode = z.discriminatedUnion("type", [
369
- PageBlockItemRichTextEditorParagraphNode,
370
- PageBlockItemRichTextEditorListNode,
371
- ]);
372
-
373
- export const PageBlockItemRichTextEditorValue = z.object({
374
- value: PageBlockItemRichTextEditorNode.array(),
375
- });
376
-
377
- export type PageBlockItemRichTextEditorParagraphNode = z.infer<typeof PageBlockItemRichTextEditorParagraphNode>;
378
- export type PageBlockItemRichTextEditorListNode = z.infer<typeof PageBlockItemRichTextEditorListNode>;
379
- export type PageBlockItemRichTextEditorNode = z.infer<typeof PageBlockItemRichTextEditorNode>;
380
- export type PageBlockItemRichTextEditorValue = z.infer<typeof PageBlockItemRichTextEditorValue>;
381
-
382
- //
383
- // Definitions - Table Value
384
- //
385
-
386
- export const PageBlockItemTableRichTextNode = z.object({
387
- type: z.literal("RichText"),
388
- id: z.string(),
389
- value: PageBlockItemRichTextValue.shape.value,
390
- });
391
-
392
- export const PageBlockItemTableImageNode = z.object({
393
- type: z.literal("Image"),
394
- id: z.string(),
395
- caption: PageBlockItemImageValue.shape.caption,
396
- alt: PageBlockItemImageValue.shape.alt,
397
- value: PageBlockItemImageValue.shape.value,
398
- alignment: PageBlockItemImageValue.shape.alignment,
399
- });
400
-
401
- export const PageBlockItemTableNode = z.discriminatedUnion("type", [
402
- PageBlockItemTableRichTextNode,
403
- PageBlockItemTableImageNode,
404
- ]);
405
-
406
- export const PageBlockItemTableCell = z.object({
407
- id: z.string(),
408
- nodes: z.array(PageBlockItemTableNode),
409
- columnWidth: z.number().optional(),
410
- alignment: PageBlockTableCellAlignment,
411
- });
412
-
413
- export const PageBlockItemTableRow = z.object({
414
- cells: z.array(PageBlockItemTableCell),
415
- });
416
-
417
- export const PageBlockItemTableValue = z.object({
418
- highlightHeaderColumn: z.boolean().optional(),
419
- highlightHeaderRow: z.boolean().optional(),
420
- showBorder: z.boolean().optional(),
421
- value: z.array(PageBlockItemTableRow).default([]),
422
- });
423
-
424
- export type PageBlockItemTableRichTextNode = z.infer<typeof PageBlockItemTableRichTextNode>;
425
- export type PageBlockItemTableImageNode = z.infer<typeof PageBlockItemTableImageNode>;
426
- export type PageBlockItemTableNode = z.infer<typeof PageBlockItemTableNode>;
427
- export type PageBlockItemTableCell = z.infer<typeof PageBlockItemTableCell>;
428
- export type PageBlockItemTableRow = z.infer<typeof PageBlockItemTableRow>;
429
- export type PageBlockItemTableValue = z.infer<typeof PageBlockItemTableValue>;
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- import { DocumentationItemConfigurationV1 } from "./documentation-v1";
3
- import { PageBlockV1 } from "./documentation-block-v1";
4
- import { nullishToOptional } from "../../../helpers";
5
-
6
- export const DocumentationPageDataV1 = z.object({
7
- blocks: z.array(PageBlockV1),
8
- configuration: nullishToOptional(DocumentationItemConfigurationV1),
9
- });
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
- import { DocumentationItemConfigurationV2 } from "./documentation-v2";
3
- import { nullishToOptional } from "../../../helpers";
4
-
5
- export const DocumentationPageDataV2 = z.object({
6
- configuration: nullishToOptional(DocumentationItemConfigurationV2),
7
- });
@@ -1,47 +0,0 @@
1
- import { z } from "zod";
2
- import { PageBlockEditorModelV2 } from "../page-block-v2";
3
- import { PageBlockColorV2 } from "./documentation-block-v2";
4
-
5
- export const PageSectionTypeV2 = z.enum(["Tabs"]);
6
-
7
- export const PageSectionColumnV2 = z.object({
8
- id: z.string(),
9
- blocks: z.array(PageBlockEditorModelV2),
10
- });
11
-
12
- export const PageSectionItemV2 = z.object({
13
- id: z.string(),
14
- title: z.string(),
15
- columns: z.array(PageSectionColumnV2),
16
- });
17
-
18
- export const PageSectionPaddingV2 = z.object({
19
- top: z.number().optional(),
20
- bottom: z.number().optional(),
21
- left: z.number().optional(),
22
- right: z.number().optional(),
23
- });
24
-
25
- export const PageSectionAppearanceV2 = z.object({
26
- expandToEdges: z.boolean(),
27
- contentExpandToEdges: z.boolean(),
28
- backgroundColor: PageBlockColorV2.optional(),
29
- foregroundColor: PageBlockColorV2.optional(),
30
- padding: PageSectionPaddingV2.optional(),
31
- });
32
-
33
- export const PageSectionEditorModelV2 = z.object({
34
- id: z.string(),
35
- type: z.literal("Section"),
36
- variantId: z.string().optional(),
37
- sectionType: PageSectionTypeV2,
38
- appearance: PageSectionAppearanceV2,
39
- items: z.array(PageSectionItemV2),
40
- });
41
-
42
- export type PageSectionTypeV2 = z.infer<typeof PageSectionTypeV2>;
43
- export type PageSectionColumnV2 = z.infer<typeof PageSectionColumnV2>;
44
- export type PageSectionItemV2 = z.infer<typeof PageSectionItemV2>;
45
- export type PageSectionPaddingV2 = z.infer<typeof PageSectionPaddingV2>;
46
- export type PageSectionAppearanceV2 = z.infer<typeof PageSectionAppearanceV2>;
47
- export type PageSectionEditorModelV2 = z.infer<typeof PageSectionEditorModelV2>;
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
- import { DocumentationItemHeaderV1, defaultDocumentationItemHeaderV1 } from "./item-header-v1";
3
-
4
- export const DocumentationItemConfigurationV1 = z.object({
5
- showSidebar: z.boolean(),
6
- isPrivate: z.boolean().optional(),
7
- isHidden: z.boolean().optional(),
8
- header: DocumentationItemHeaderV1,
9
- });
10
-
11
- export type DocumentationItemConfigurationV1 = z.infer<typeof DocumentationItemConfigurationV1>;
12
-
13
- export const defaultDocumentationItemConfigurationV1: DocumentationItemConfigurationV1 = {
14
- header: defaultDocumentationItemHeaderV1,
15
- showSidebar: true,
16
- };
@@ -1,18 +0,0 @@
1
- import { z } from "zod";
2
- import { DocumentationItemHeaderV2, defaultDocumentationItemHeaderV2 } from "./item-header-v2";
3
-
4
- export const DocumentationItemConfigurationV2 = z.object({
5
- showSidebar: z.boolean(),
6
- isPrivate: z.boolean().optional(),
7
- isHidden: z.boolean().optional(),
8
- header: DocumentationItemHeaderV2,
9
- });
10
-
11
- export type DocumentationItemConfigurationV2 = z.infer<typeof DocumentationItemConfigurationV2>;
12
-
13
- export const defaultDocumentationItemConfigurationV2 = {
14
- header: defaultDocumentationItemHeaderV2,
15
- isHidden: false,
16
- isPrivate: false,
17
- showSidebar: true,
18
- } as const;
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
- import { tokenAliasOrValue } from "./base";
3
- import { DimensionUnit } from "./dimension";
4
-
5
- export const DurationUnit = z.enum(["Ms"]);
6
-
7
- export const DurationValue = z.object({
8
- unit: DimensionUnit,
9
- measure: z.number(),
10
- });
11
-
12
- export const DurationTokenData = tokenAliasOrValue(DurationValue);
13
-
14
- export type DurationUnit = z.infer<typeof DurationUnit>;
15
- export type DurationValue = z.infer<typeof DurationValue>;
16
- export type DurationTokenData = z.infer<typeof DurationTokenData>;
@@ -1,65 +0,0 @@
1
- import { ZodTypeDef, z } from "zod";
2
- import { Size, SizeOrUndefined } from "../primitives/size";
3
-
4
- export const FigmaFileStructureNodeType = z.enum(["DOCUMENT", "CANVAS", "FRAME", "COMPONENT", "COMPONENT_SET"]);
5
-
6
- export const FigmaFileStructureNodeBase = z.object({
7
- id: z.string(),
8
- name: z.string(),
9
- type: FigmaFileStructureNodeType,
10
- size: SizeOrUndefined,
11
- parentComponentSetId: z.string().optional(),
12
- });
13
-
14
- export const FigmaFileStructureNode: z.ZodType<FigmaFileStructureNode, ZodTypeDef, FigmaFileStructureNodeBaseInput> =
15
- FigmaFileStructureNodeBase.extend({
16
- children: z.lazy(() => FigmaFileStructureNode.array()),
17
- });
18
-
19
- type FigmaFileStructureNodeBaseInput = z.input<typeof FigmaFileStructureNodeBase> & {
20
- children: FigmaFileStructureNodeBaseInput[];
21
- };
22
-
23
- export const FigmaFileStructureStatistics = z.object({
24
- frames: z
25
- .number()
26
- .nullable()
27
- .optional()
28
- .transform(v => v ?? 0),
29
- components: z
30
- .number()
31
- .nullable()
32
- .optional()
33
- .transform(v => v ?? 0),
34
- componentSets: z
35
- .number()
36
- .nullable()
37
- .optional()
38
- .transform(v => v ?? 0),
39
- });
40
-
41
- export const FigmaFileStructureElementData = z.object({
42
- value: z.object({
43
- structure: FigmaFileStructureNode,
44
- assetsInFile: FigmaFileStructureStatistics,
45
- }),
46
- });
47
-
48
- export type FigmaFileStructureNodeBase = z.infer<typeof FigmaFileStructureNodeBase>;
49
- export type FigmaFileStructureNodeType = z.infer<typeof FigmaFileStructureStatistics>;
50
- export type FigmaFileStructureNode = z.infer<typeof FigmaFileStructureNodeBase> & {
51
- children: FigmaFileStructureNode[];
52
- };
53
- export type FigmaFileStructureStatistics = z.infer<typeof FigmaFileStructureStatistics>;
54
- export type FigmaFileStructureElementData = z.infer<typeof FigmaFileStructureElementData>;
55
-
56
- export function figmaFileStructureToMap(root: FigmaFileStructureNode): Map<string, FigmaFileStructureNode> {
57
- const map = new Map<string, FigmaFileStructureNode>();
58
- recursiveFigmaFileStructureToMap(root, map);
59
- return map;
60
- }
61
-
62
- function recursiveFigmaFileStructureToMap(node: FigmaFileStructureNode, map: Map<string, FigmaFileStructureNode>) {
63
- map.set(node.id, node);
64
- for (const child of node.children) recursiveFigmaFileStructureToMap(child, map);
65
- }
@@ -1,27 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const FigmaNodeRenderFormat = z.enum(["Png", "Svg"]);
4
-
5
- export const FigmaNodeReferenceData = z.object({
6
- structureElementId: z.string(),
7
- nodeId: z.string(),
8
- fileId: z.string().optional(),
9
- valid: z.boolean(),
10
- format: FigmaNodeRenderFormat.default("Png"),
11
-
12
- // Asset data
13
- assetId: z.string().optional(),
14
- assetScale: z.number().optional(),
15
- assetWidth: z.number().optional(),
16
- assetHeight: z.number().optional(),
17
- assetUrl: z.string().optional(),
18
- assetOriginKey: z.string().optional(),
19
- });
20
-
21
- export const FigmaNodeReferenceElementData = z.object({
22
- value: FigmaNodeReferenceData,
23
- });
24
-
25
- export type FigmaNodeRenderFormat = z.infer<typeof FigmaNodeRenderFormat>;
26
- export type FigmaNodeReferenceData = z.infer<typeof FigmaNodeReferenceData>;
27
- export type FigmaNodeReferenceElementData = z.infer<typeof FigmaNodeReferenceElementData>;
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- import { tokenAliasOrValue } from "./base";
3
-
4
- export const FontFamilyValue = z.string();
5
- export const FontFamilyTokenData = tokenAliasOrValue(FontFamilyValue);
6
-
7
- export type FontFamilyValue = z.infer<typeof FontFamilyValue>;
8
- export type FontFamilyTokenData = z.infer<typeof FontFamilyTokenData>;
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
- import { tokenAliasOrValue } from "./base";
3
- import { DimensionUnit } from "./dimension";
4
-
5
- export const FontSizeUnit = z.enum(["Pixels", "Rem", "Percent"]);
6
-
7
- export const FontSizeValue = z.object({
8
- unit: DimensionUnit,
9
- measure: z.number(),
10
- });
11
-
12
- export const FontSizeTokenData = tokenAliasOrValue(FontSizeValue);
13
-
14
- export type FontSizeUnit = z.infer<typeof FontSizeUnit>;
15
- export type FontSizeValue = z.infer<typeof FontSizeValue>;
16
- export type FontSizeTokenData = z.infer<typeof FontSizeTokenData>;
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- import { tokenAliasOrValue } from "./base";
3
-
4
- export const FontWeightValue = z.string();
5
- export const FontWeightTokenData = tokenAliasOrValue(FontWeightValue);
6
-
7
- export type FontWeightValue = z.infer<typeof FontWeightValue>;
8
- export type FontWeightTokenData = z.infer<typeof FontWeightTokenData>;
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- import { tokenAliasOrValue } from "./base";
3
-
4
- export const FontValue = z.unknown();
5
-
6
- export const FontTokenData = tokenAliasOrValue(FontValue);
7
-
8
- export type FontValue = z.infer<typeof FontValue>;
9
- export type FontTokenData = z.infer<typeof FontTokenData>;