@supernova-studio/model 1.0.0 → 1.0.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/dist/index.d.mts +26740 -18977
- package/dist/index.d.ts +26740 -18977
- package/dist/index.js +275 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2201 -1973
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
- package/src/asset-delete-schedule/asset-delete-schedule.ts +0 -20
- package/src/asset-delete-schedule/index.ts +0 -1
- package/src/auth/index.ts +0 -1
- package/src/auth/plugin-oauth-request.ts +0 -14
- package/src/billing/card.ts +0 -12
- package/src/billing/checkoutSession.ts +0 -16
- package/src/billing/customer.ts +0 -29
- package/src/billing/features.ts +0 -48
- package/src/billing/index.ts +0 -9
- package/src/billing/invoice.ts +0 -34
- package/src/billing/portalSession.ts +0 -19
- package/src/billing/price.ts +0 -24
- package/src/billing/product.ts +0 -5
- package/src/billing/subscription.ts +0 -65
- package/src/common/entity.ts +0 -9
- package/src/common/index.ts +0 -2
- package/src/common/object-meta.ts +0 -8
- package/src/custom-domains/custom-domains.ts +0 -24
- package/src/custom-domains/index.ts +0 -1
- package/src/data-dumps/code-integration-dump.ts +0 -19
- package/src/data-dumps/design-system-dump.ts +0 -16
- package/src/data-dumps/design-system-version-dump.ts +0 -45
- package/src/data-dumps/index.ts +0 -6
- package/src/data-dumps/published-docs-dump.ts +0 -10
- package/src/data-dumps/user-data-dump.ts +0 -10
- package/src/data-dumps/workspace-dump.ts +0 -14
- package/src/docs-server/index.ts +0 -1
- package/src/docs-server/session.ts +0 -39
- package/src/dsm/assets/asset-dynamo-record.ts +0 -10
- package/src/dsm/assets/asset-reference.ts +0 -18
- package/src/dsm/assets/asset-value.ts +0 -3
- package/src/dsm/assets/asset.ts +0 -60
- package/src/dsm/assets/index.ts +0 -4
- package/src/dsm/brand.ts +0 -13
- package/src/dsm/collection.ts +0 -51
- package/src/dsm/components/asset-rendering.ts +0 -22
- package/src/dsm/components/index.ts +0 -1
- package/src/dsm/data-sources/data-source.ts +0 -167
- package/src/dsm/data-sources/import-job.ts +0 -30
- package/src/dsm/data-sources/import-summary.ts +0 -70
- package/src/dsm/data-sources/index.ts +0 -3
- package/src/dsm/design-system.ts +0 -47
- package/src/dsm/documentation/approvals/approval-state.ts +0 -4
- package/src/dsm/documentation/approvals/approval.ts +0 -18
- package/src/dsm/documentation/approvals/index.ts +0 -2
- package/src/dsm/documentation/block-definitions/aux.ts +0 -10
- package/src/dsm/documentation/block-definitions/definition.ts +0 -76
- package/src/dsm/documentation/block-definitions/index.ts +0 -4
- package/src/dsm/documentation/block-definitions/item.ts +0 -233
- package/src/dsm/documentation/block-definitions/variant.ts +0 -49
- package/src/dsm/documentation/group.ts +0 -19
- package/src/dsm/documentation/index.ts +0 -10
- package/src/dsm/documentation/link-preview.ts +0 -10
- package/src/dsm/documentation/page-anchor.ts +0 -9
- package/src/dsm/documentation/page-content-backup.ts +0 -13
- package/src/dsm/documentation/page-content.ts +0 -32
- package/src/dsm/documentation/page.ts +0 -18
- package/src/dsm/documentation/settings.ts +0 -18
- package/src/dsm/documentation/thread.ts +0 -35
- package/src/dsm/element-snapshots/base.ts +0 -34
- package/src/dsm/element-snapshots/documentation-page-snapshot.ts +0 -29
- package/src/dsm/element-snapshots/group-snapshot.ts +0 -27
- package/src/dsm/element-snapshots/index.ts +0 -3
- package/src/dsm/elements/base.ts +0 -49
- package/src/dsm/elements/component-properties.ts +0 -63
- package/src/dsm/elements/data/base.ts +0 -18
- package/src/dsm/elements/data/blur.ts +0 -16
- package/src/dsm/elements/data/border-radius.ts +0 -16
- package/src/dsm/elements/data/border-width.ts +0 -16
- package/src/dsm/elements/data/border.ts +0 -21
- package/src/dsm/elements/data/color.ts +0 -13
- package/src/dsm/elements/data/component.ts +0 -30
- package/src/dsm/elements/data/dimension.ts +0 -15
- package/src/dsm/elements/data/documentation-block-v1.ts +0 -498
- package/src/dsm/elements/data/documentation-block-v2.ts +0 -429
- package/src/dsm/elements/data/documentation-page-v1.ts +0 -9
- package/src/dsm/elements/data/documentation-page-v2.ts +0 -7
- package/src/dsm/elements/data/documentation-section-v2.ts +0 -47
- package/src/dsm/elements/data/documentation-v1.ts +0 -16
- package/src/dsm/elements/data/documentation-v2.ts +0 -18
- package/src/dsm/elements/data/duration.ts +0 -16
- package/src/dsm/elements/data/figma-file-structure.ts +0 -65
- package/src/dsm/elements/data/figma-node-reference.ts +0 -27
- package/src/dsm/elements/data/font-family.ts +0 -8
- package/src/dsm/elements/data/font-size.ts +0 -16
- package/src/dsm/elements/data/font-weight.ts +0 -8
- package/src/dsm/elements/data/font.ts +0 -9
- package/src/dsm/elements/data/gradient.ts +0 -32
- package/src/dsm/elements/data/group.ts +0 -20
- package/src/dsm/elements/data/index.ts +0 -43
- package/src/dsm/elements/data/item-header-v1.ts +0 -35
- package/src/dsm/elements/data/item-header-v2.ts +0 -34
- package/src/dsm/elements/data/item-header.ts +0 -14
- package/src/dsm/elements/data/letter-spacing.ts +0 -16
- package/src/dsm/elements/data/line-height.ts +0 -16
- package/src/dsm/elements/data/opacity.ts +0 -13
- package/src/dsm/elements/data/paragraph-indent.ts +0 -16
- package/src/dsm/elements/data/paragraph-spacing.ts +0 -16
- package/src/dsm/elements/data/product-copy.ts +0 -8
- package/src/dsm/elements/data/safe-id.ts +0 -13
- package/src/dsm/elements/data/shadow.ts +0 -23
- package/src/dsm/elements/data/size.ts +0 -16
- package/src/dsm/elements/data/space.ts +0 -16
- package/src/dsm/elements/data/string.ts +0 -8
- package/src/dsm/elements/data/text-case.ts +0 -10
- package/src/dsm/elements/data/text-decoration.ts +0 -10
- package/src/dsm/elements/data/typography.ts +0 -28
- package/src/dsm/elements/data/visibility.ts +0 -10
- package/src/dsm/elements/data/z-index.ts +0 -16
- package/src/dsm/elements/documentation-page-v1.ts +0 -34
- package/src/dsm/elements/documentation-page-v2.ts +0 -21
- package/src/dsm/elements/figma-component.ts +0 -67
- package/src/dsm/elements/figma-file-structures.ts +0 -40
- package/src/dsm/elements/figma-node-reference.ts +0 -25
- package/src/dsm/elements/group.ts +0 -40
- package/src/dsm/elements/index.ts +0 -15
- package/src/dsm/elements/page-block-v2.ts +0 -25
- package/src/dsm/elements/primitives/index.ts +0 -2
- package/src/dsm/elements/primitives/point.ts +0 -8
- package/src/dsm/elements/primitives/size.ts +0 -28
- package/src/dsm/elements/raw-element.ts +0 -164
- package/src/dsm/elements/theme.ts +0 -76
- package/src/dsm/elements/tokens.ts +0 -311
- package/src/dsm/elements/utils.ts +0 -114
- package/src/dsm/exporter-property-values-collection.ts +0 -31
- package/src/dsm/import/asset.ts +0 -6
- package/src/dsm/import/base.ts +0 -24
- package/src/dsm/import/collection.ts +0 -16
- package/src/dsm/import/component.ts +0 -40
- package/src/dsm/import/data-source.ts +0 -9
- package/src/dsm/import/figma-frames.ts +0 -74
- package/src/dsm/import/image.ts +0 -87
- package/src/dsm/import/index.ts +0 -12
- package/src/dsm/import/origin.ts +0 -5
- package/src/dsm/import/support/figma-files.ts +0 -19
- package/src/dsm/import/support/import-context.ts +0 -94
- package/src/dsm/import/support/import-model-collections.ts +0 -50
- package/src/dsm/import/support/index.ts +0 -3
- package/src/dsm/import/theme.ts +0 -76
- package/src/dsm/import/tokens.ts +0 -50
- package/src/dsm/import/warning.ts +0 -38
- package/src/dsm/index.ts +0 -19
- package/src/dsm/membership/additions.ts +0 -13
- package/src/dsm/membership/design-system-membership.ts +0 -92
- package/src/dsm/membership/ds-role.ts +0 -28
- package/src/dsm/membership/index.ts +0 -4
- package/src/dsm/membership/invitations.ts +0 -21
- package/src/dsm/properties/index.ts +0 -3
- package/src/dsm/properties/property-definition.ts +0 -57
- package/src/dsm/properties/property-reference.ts +0 -5
- package/src/dsm/properties/property-value.ts +0 -29
- package/src/dsm/published-doc-page-visits.ts +0 -15
- package/src/dsm/published-doc-page.ts +0 -37
- package/src/dsm/published-doc.ts +0 -32
- package/src/dsm/reference.ts +0 -9
- package/src/dsm/version.ts +0 -41
- package/src/dsm/views/column.ts +0 -58
- package/src/dsm/views/index.ts +0 -2
- package/src/dsm/views/view.ts +0 -19
- package/src/emails/design-system-invite.ts +0 -31
- package/src/emails/index.ts +0 -2
- package/src/emails/workspace-invite.ts +0 -29
- package/src/events/base.ts +0 -7
- package/src/events/data-source-imported.ts +0 -9
- package/src/events/index.ts +0 -3
- package/src/events/version-released.ts +0 -10
- package/src/export/export-destinations.ts +0 -127
- package/src/export/export-jobs.ts +0 -122
- package/src/export/export-runner/export-context.ts +0 -34
- package/src/export/export-runner/exporter-payload.ts +0 -10
- package/src/export/export-runner/index.ts +0 -2
- package/src/export/exporter-workspace-membership-role.ts +0 -4
- package/src/export/exporter-workspace-membership.ts +0 -14
- package/src/export/exporter.ts +0 -55
- package/src/export/git-providers.ts +0 -11
- package/src/export/index.ts +0 -9
- package/src/export/pipeline.ts +0 -34
- package/src/export/pulsar.ts +0 -71
- package/src/feature-flags/feature-flags.ts +0 -21
- package/src/feature-flags/index.ts +0 -1
- package/src/helpers/db.ts +0 -82
- package/src/helpers/index.ts +0 -2
- package/src/helpers/nullish-to-optional.ts +0 -9
- package/src/index.ts +0 -20
- package/src/integrations/external-oauth-request.ts +0 -12
- package/src/integrations/git.ts +0 -49
- package/src/integrations/index.ts +0 -6
- package/src/integrations/integration.ts +0 -143
- package/src/integrations/oauth-providers.ts +0 -13
- package/src/integrations/oauth-token.ts +0 -16
- package/src/integrations/workspace-oauth-requests.ts +0 -12
- package/src/liveblocks/index.ts +0 -1
- package/src/liveblocks/rooms/design-system-version-room.ts +0 -62
- package/src/liveblocks/rooms/documentation-page-room.ts +0 -65
- package/src/liveblocks/rooms/index.ts +0 -4
- package/src/liveblocks/rooms/room-type.ts +0 -12
- package/src/liveblocks/rooms/workspace-room.ts +0 -16
- package/src/npm/index.ts +0 -2
- package/src/npm/npm-package.ts +0 -30
- package/src/npm/npm-proxy-token-payload.ts +0 -7
- package/src/tokens/index.ts +0 -1
- package/src/tokens/personal-access-token.ts +0 -25
- package/src/users/index.ts +0 -9
- package/src/users/linked-integrations.ts +0 -36
- package/src/users/user-analytics-cleanup-schedule.ts +0 -15
- package/src/users/user-identity.ts +0 -8
- package/src/users/user-minified.ts +0 -10
- package/src/users/user-notification-settings.ts +0 -18
- package/src/users/user-profile.ts +0 -41
- package/src/users/user-test.ts +0 -8
- package/src/users/user-with-pat.ts +0 -7
- package/src/users/user.ts +0 -21
- package/src/utils/common.ts +0 -172
- package/src/utils/content-loader-instruction.ts +0 -31
- package/src/utils/errors.ts +0 -120
- package/src/utils/index.ts +0 -6
- package/src/utils/naming.ts +0 -73
- package/src/utils/slugify.ts +0 -636
- package/src/utils/validation.ts +0 -4
- package/src/workspace/index.ts +0 -10
- package/src/workspace/npm-registry-settings.ts +0 -45
- package/src/workspace/sso-provider.ts +0 -13
- package/src/workspace/user-invite.ts +0 -18
- package/src/workspace/workspace-configuration.ts +0 -14
- package/src/workspace/workspace-context.ts +0 -13
- package/src/workspace/workspace-create.ts +0 -25
- package/src/workspace/workspace-invitations.ts +0 -22
- package/src/workspace/workspace-membership.ts +0 -31
- package/src/workspace/workspace-role.ts +0 -6
- package/src/workspace/workspace.ts +0 -62
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PageBlockDefinitionAppearance } from "./aux";
|
|
3
|
-
import { PageBlockDefinitionVariant } from "./variant";
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Enums
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const PageBlockDefinitionPropertyType = z.enum([
|
|
10
|
-
"RichText",
|
|
11
|
-
"MultiRichText",
|
|
12
|
-
"RichTextEditor",
|
|
13
|
-
"Text",
|
|
14
|
-
"Boolean",
|
|
15
|
-
"Number",
|
|
16
|
-
"SingleSelect",
|
|
17
|
-
"MultiSelect",
|
|
18
|
-
"Image",
|
|
19
|
-
"Token",
|
|
20
|
-
"TokenType",
|
|
21
|
-
"TokenProperty",
|
|
22
|
-
"Component",
|
|
23
|
-
"ComponentProperty",
|
|
24
|
-
"Asset",
|
|
25
|
-
"AssetProperty",
|
|
26
|
-
"FigmaNode",
|
|
27
|
-
"EmbedURL",
|
|
28
|
-
"URL",
|
|
29
|
-
"Markdown",
|
|
30
|
-
"Code",
|
|
31
|
-
"CodeSandbox",
|
|
32
|
-
"Table",
|
|
33
|
-
"Divider",
|
|
34
|
-
"Storybook",
|
|
35
|
-
"Color",
|
|
36
|
-
"FigmaComponent",
|
|
37
|
-
]);
|
|
38
|
-
|
|
39
|
-
export const PageBlockDefinitionRichTextPropertyStyle = z.enum([
|
|
40
|
-
"Title1",
|
|
41
|
-
"Title2",
|
|
42
|
-
"Title3",
|
|
43
|
-
"Title4",
|
|
44
|
-
"Title5",
|
|
45
|
-
"Quote",
|
|
46
|
-
"Callout",
|
|
47
|
-
"Default",
|
|
48
|
-
]);
|
|
49
|
-
|
|
50
|
-
export const PageBlockDefinitionMultiRichTextPropertyStyle = z.enum(["OL", "UL"]);
|
|
51
|
-
|
|
52
|
-
export const PageBlockDefinitionRichTextEditorPropertyStyle = z.enum([
|
|
53
|
-
"OL",
|
|
54
|
-
"UL",
|
|
55
|
-
"Bold",
|
|
56
|
-
"Italic",
|
|
57
|
-
"Link",
|
|
58
|
-
"Strikethrough",
|
|
59
|
-
"InlineCode",
|
|
60
|
-
]);
|
|
61
|
-
|
|
62
|
-
export const PageBlockDefinitionTextPropertyStyle = z.enum([
|
|
63
|
-
"Title1",
|
|
64
|
-
"Title2",
|
|
65
|
-
"Title3",
|
|
66
|
-
"Title4",
|
|
67
|
-
"Title5",
|
|
68
|
-
"Default",
|
|
69
|
-
"DefaultBold",
|
|
70
|
-
"DefaultSemibold",
|
|
71
|
-
"Small",
|
|
72
|
-
"SmallBold",
|
|
73
|
-
"SmallSemibold",
|
|
74
|
-
"Custom",
|
|
75
|
-
]);
|
|
76
|
-
|
|
77
|
-
export const PageBlockDefinitionTextPropertyColor = z.enum(["Neutral", "NeutralFaded"]);
|
|
78
|
-
|
|
79
|
-
export const PageBlockDefinitionBooleanPropertyStyle = z.enum(["SegmentedControl", "ToggleButton", "Checkbox"]);
|
|
80
|
-
export const PageBlockDefinitionSingleSelectPropertyStyle = z.enum([
|
|
81
|
-
"SegmentedControl",
|
|
82
|
-
"ToggleButton",
|
|
83
|
-
"Select",
|
|
84
|
-
"Checkbox",
|
|
85
|
-
]);
|
|
86
|
-
export const PageBlockDefinitionSingleSelectPropertyColor = z.enum([
|
|
87
|
-
"Green",
|
|
88
|
-
"Red",
|
|
89
|
-
"Yellow",
|
|
90
|
-
"Blue",
|
|
91
|
-
"Purple",
|
|
92
|
-
"Orange",
|
|
93
|
-
"Pink",
|
|
94
|
-
"Teal",
|
|
95
|
-
"Brown",
|
|
96
|
-
"Grey",
|
|
97
|
-
"LightGrey",
|
|
98
|
-
"Cyan",
|
|
99
|
-
"Fuchsia",
|
|
100
|
-
]);
|
|
101
|
-
|
|
102
|
-
export const IconSet = z.enum(["CheckCircle", "CrossCircle", "Alert"]);
|
|
103
|
-
|
|
104
|
-
export const PageBlockDefinitionMultiSelectPropertyStyle = z.enum(["SegmentedControl", "Select", "Checkbox"]);
|
|
105
|
-
|
|
106
|
-
export const PageBlockDefinitionImageAspectRatio = z.enum(["Auto", "Square", "Landscape", "Portrait", "Wide"]);
|
|
107
|
-
|
|
108
|
-
export const PageBlockDefinitionImageWidth = z.enum(["Full", "Icon", "Small", "Medium", "Large", "Poster"]);
|
|
109
|
-
|
|
110
|
-
export type PageBlockDefinitionPropertyType = z.infer<typeof PageBlockDefinitionPropertyType>;
|
|
111
|
-
export type PageBlockDefinitionRichTextPropertyStyle = z.infer<typeof PageBlockDefinitionRichTextPropertyStyle>;
|
|
112
|
-
export type PageBlockDefinitionMultiRichTextPropertyStyle = z.infer<
|
|
113
|
-
typeof PageBlockDefinitionMultiRichTextPropertyStyle
|
|
114
|
-
>;
|
|
115
|
-
export type PageBlockDefinitionTextPropertyStyle = z.infer<typeof PageBlockDefinitionTextPropertyStyle>;
|
|
116
|
-
export type PageBlockDefinitionTextPropertyColor = z.infer<typeof PageBlockDefinitionTextPropertyColor>;
|
|
117
|
-
export type PageBlockDefinitionBooleanPropertyStyle = z.infer<typeof PageBlockDefinitionBooleanPropertyStyle>;
|
|
118
|
-
export type PageBlockDefinitionSingleSelectPropertyStyle = z.infer<typeof PageBlockDefinitionSingleSelectPropertyStyle>;
|
|
119
|
-
export type PageBlockDefinitionMultiSelectPropertyStyle = z.infer<typeof PageBlockDefinitionMultiSelectPropertyStyle>;
|
|
120
|
-
export type PageBlockDefinitionImageAspectRatio = z.infer<typeof PageBlockDefinitionImageAspectRatio>;
|
|
121
|
-
export type PageBlockDefinitionImageWidth = z.infer<typeof PageBlockDefinitionImageWidth>;
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
// Aux
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
export const PageBlockDefinitionSelectChoice = z.object({
|
|
128
|
-
value: z.string(),
|
|
129
|
-
name: z.string(),
|
|
130
|
-
icon: IconSet.optional(),
|
|
131
|
-
customIconUrl: z.string().optional(),
|
|
132
|
-
color: PageBlockDefinitionSingleSelectPropertyColor.optional(),
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
export type PageBlockDefinitionSelectChoice = z.infer<typeof PageBlockDefinitionSelectChoice>;
|
|
136
|
-
|
|
137
|
-
//
|
|
138
|
-
// Property options
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
export const PageBlockDefinitionUntypedPropertyOptions = z.record(z.any());
|
|
142
|
-
|
|
143
|
-
export const PageBlockDefinitionRichTextOptions = z.object({
|
|
144
|
-
richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional(),
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
export const PageBlockDefinitionMutiRichTextOptions = z.object({
|
|
148
|
-
multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional(),
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
export const PageBlockDefinitionRichTextEditorOptions = z.object({
|
|
152
|
-
placeholder: z.string().optional(),
|
|
153
|
-
allowedInlineStyles: z.array(PageBlockDefinitionRichTextEditorPropertyStyle).optional(),
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
export const PageBlockDefinitionTextOptions = z.object({
|
|
157
|
-
placeholder: z.string().optional(),
|
|
158
|
-
defaultValue: z.string().optional(),
|
|
159
|
-
textStyle: PageBlockDefinitionTextPropertyStyle.optional(),
|
|
160
|
-
color: PageBlockDefinitionTextPropertyColor.optional(),
|
|
161
|
-
allowLineBreaks: z.boolean().optional(),
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
export const PageBlockDefinitionSelectOptions = z.object({
|
|
165
|
-
singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),
|
|
166
|
-
defaultChoice: z.string(),
|
|
167
|
-
choices: z.array(PageBlockDefinitionSelectChoice),
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
export const PageBlockDefinitionImageOptions = z.object({
|
|
171
|
-
width: PageBlockDefinitionImageWidth.optional(),
|
|
172
|
-
aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),
|
|
173
|
-
allowCaption: z.boolean().optional(),
|
|
174
|
-
recommendation: z.string().optional(),
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
export const PageBlockDefinitionBooleanOptions = z.object({
|
|
178
|
-
defaultvalue: z.boolean().optional(),
|
|
179
|
-
booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional(),
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
export const PageBlockDefinitionNumberOptions = z.object({
|
|
183
|
-
defaultValue: z.number(),
|
|
184
|
-
min: z.number().optional(),
|
|
185
|
-
max: z.number().optional(),
|
|
186
|
-
step: z.number().optional(),
|
|
187
|
-
placeholder: z.string().optional(),
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
export const PageBlockDefinitionComponentOptions = z.object({
|
|
191
|
-
renderLayoutAs: z.enum(["List", "Table"]).optional(),
|
|
192
|
-
allowPropertySelection: z.boolean().optional(),
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
export const PageBlockDefinitionFigmaComponentOptions = z.object({
|
|
196
|
-
renderLayoutAs: z.enum(["Grid", "PropsTable", "Canvas", "Playground"]),
|
|
197
|
-
invertPropertySelection: z.boolean().optional(),
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
export type PageBlockDefinitionUntypedPropertyOptions = z.infer<typeof PageBlockDefinitionUntypedPropertyOptions>;
|
|
201
|
-
export type PageBlockDefinitionRichTextOptions = z.infer<typeof PageBlockDefinitionRichTextOptions>;
|
|
202
|
-
export type PageBlockDefinitionMutiRichTextOptions = z.infer<typeof PageBlockDefinitionMutiRichTextOptions>;
|
|
203
|
-
export type PageBlockDefinitionRichTextEditorOptions = z.infer<typeof PageBlockDefinitionRichTextEditorOptions>;
|
|
204
|
-
export type PageBlockDefinitionTextOptions = z.infer<typeof PageBlockDefinitionTextOptions>;
|
|
205
|
-
export type PageBlockDefinitionSelectOptions = z.infer<typeof PageBlockDefinitionSelectOptions>;
|
|
206
|
-
export type PageBlockDefinitionImageOptions = z.infer<typeof PageBlockDefinitionImageOptions>;
|
|
207
|
-
export type PageBlockDefinitionBooleanOptions = z.infer<typeof PageBlockDefinitionBooleanOptions>;
|
|
208
|
-
export type PageBlockDefinitionNumberOptions = z.infer<typeof PageBlockDefinitionNumberOptions>;
|
|
209
|
-
export type PageBlockDefinitionComponentOptions = z.infer<typeof PageBlockDefinitionComponentOptions>;
|
|
210
|
-
export type PageBlockDefinitionFigmaComponentOptions = z.infer<typeof PageBlockDefinitionFigmaComponentOptions>;
|
|
211
|
-
|
|
212
|
-
//
|
|
213
|
-
// Definitions
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
export const PageBlockDefinitionProperty = z.object({
|
|
217
|
-
id: z.string(),
|
|
218
|
-
name: z.string(),
|
|
219
|
-
type: PageBlockDefinitionPropertyType,
|
|
220
|
-
description: z.string().optional(),
|
|
221
|
-
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
222
|
-
variantOptions: z.record(PageBlockDefinitionUntypedPropertyOptions).optional(),
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
export const PageBlockDefinitionItem = z.object({
|
|
226
|
-
properties: z.array(PageBlockDefinitionProperty),
|
|
227
|
-
appearance: PageBlockDefinitionAppearance.optional(),
|
|
228
|
-
variants: z.array(PageBlockDefinitionVariant),
|
|
229
|
-
defaultVariantKey: z.string(),
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
export type PageBlockDefinitionProperty = z.infer<typeof PageBlockDefinitionProperty>;
|
|
233
|
-
export type PageBlockDefinitionItem = z.infer<typeof PageBlockDefinitionItem>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ZodTypeDef, z } from "zod";
|
|
2
|
-
import { PageBlockDefinitionAppearance } from "./aux";
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// Enums
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
export const PageBlockDefinitionLayoutType = z.enum(["Column", "Row"]);
|
|
9
|
-
export const PageBlockDefinitionLayoutGap = z.enum(["Small", "Medium", "Large", "None"]);
|
|
10
|
-
export const PageBlockDefinitionLayoutAlign = z.enum(["Start", "Center", "End"]);
|
|
11
|
-
export const PageBlockDefinitionLayoutResizing = z.enum(["Fill", "Hug"]);
|
|
12
|
-
|
|
13
|
-
export type PageBlockDefinitionLayoutType = z.infer<typeof PageBlockDefinitionLayoutType>;
|
|
14
|
-
export type PageBlockDefinitionLayoutGap = z.infer<typeof PageBlockDefinitionLayoutGap>;
|
|
15
|
-
export type PageBlockDefinitionLayoutAlign = z.infer<typeof PageBlockDefinitionLayoutAlign>;
|
|
16
|
-
export type PageBlockDefinitionLayoutResizing = z.infer<typeof PageBlockDefinitionLayoutResizing>;
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
// Definitions
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
export const PageBlockDefinitionLayoutBase = z.object({
|
|
23
|
-
type: PageBlockDefinitionLayoutType,
|
|
24
|
-
gap: PageBlockDefinitionLayoutGap.optional(),
|
|
25
|
-
columnAlign: PageBlockDefinitionLayoutAlign.optional(),
|
|
26
|
-
columnResizing: PageBlockDefinitionLayoutResizing.optional(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const PageBlockDefinitionLayout: z.ZodType<PageBlockDefinitionLayout, ZodTypeDef, PageBlockDefinitionLayout> =
|
|
30
|
-
PageBlockDefinitionLayoutBase.extend({
|
|
31
|
-
children: z.lazy(() => z.array(PageBlockDefinitionLayout.or(z.string()))),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const PageBlockDefinitionVariant = z.object({
|
|
35
|
-
id: z.string(),
|
|
36
|
-
name: z.string(),
|
|
37
|
-
image: z.string().optional(),
|
|
38
|
-
description: z.string().optional(),
|
|
39
|
-
documentationLink: z.string().optional(),
|
|
40
|
-
layout: PageBlockDefinitionLayout,
|
|
41
|
-
maxColumns: z.number().optional(),
|
|
42
|
-
defaultColumns: z.number().optional(),
|
|
43
|
-
appearance: PageBlockDefinitionAppearance.optional(),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export type PageBlockDefinitionVariant = z.infer<typeof PageBlockDefinitionVariant>;
|
|
47
|
-
export type PageBlockDefinitionLayout = z.infer<typeof PageBlockDefinitionLayoutBase> & {
|
|
48
|
-
children: (PageBlockDefinitionLayout | string)[];
|
|
49
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DocumentationPageGroup = z.object({
|
|
4
|
-
type: z.literal("ElementGroup"),
|
|
5
|
-
childType: z.literal("DocumentationPage"),
|
|
6
|
-
id: z.string(),
|
|
7
|
-
persistentId: z.string(),
|
|
8
|
-
shortPersistentId: z.string(),
|
|
9
|
-
designSystemVersionId: z.string(),
|
|
10
|
-
parentPersistentId: z.string().nullish(),
|
|
11
|
-
sortOrder: z.number(),
|
|
12
|
-
title: z.string(),
|
|
13
|
-
slug: z.string(),
|
|
14
|
-
userSlug: z.string().nullish(),
|
|
15
|
-
createdAt: z.coerce.date(),
|
|
16
|
-
updatedAt: z.coerce.date(),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type DocumentationPageGroup = z.infer<typeof DocumentationPageGroup>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./approvals";
|
|
2
|
-
export * from "./block-definitions";
|
|
3
|
-
export * from "./group";
|
|
4
|
-
export * from "./link-preview";
|
|
5
|
-
export * from "./page-anchor";
|
|
6
|
-
export * from "./page-content-backup";
|
|
7
|
-
export * from "./page-content";
|
|
8
|
-
export * from "./page";
|
|
9
|
-
export * from "./settings";
|
|
10
|
-
export * from "./thread";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PageBlockImageReference } from "../elements";
|
|
3
|
-
|
|
4
|
-
export const DocumentationLinkPreview = z.object({
|
|
5
|
-
title: z.string().optional(),
|
|
6
|
-
description: z.string().optional(),
|
|
7
|
-
thumbnail: PageBlockImageReference.optional(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type DocumentationLinkPreview = z.infer<typeof DocumentationLinkPreview>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DocumentationPageContentBackup = z.object({
|
|
4
|
-
id: z.string(),
|
|
5
|
-
designSystemVersionId: z.string(),
|
|
6
|
-
createdAt: z.coerce.date(),
|
|
7
|
-
updatedAt: z.coerce.date(),
|
|
8
|
-
documentationPageId: z.string(),
|
|
9
|
-
documentationPageName: z.string(),
|
|
10
|
-
storagePath: z.string(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export type DocumentationPageContentBackup = z.infer<typeof DocumentationPageContentBackup>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { PageBlockEditorModelV2, PageSectionEditorModelV2 } from "../elements";
|
|
3
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
4
|
-
import { OmitStrict } from "../../utils";
|
|
5
|
-
|
|
6
|
-
export const DocumentationPageContentItem = z.discriminatedUnion("type", [
|
|
7
|
-
PageBlockEditorModelV2,
|
|
8
|
-
PageSectionEditorModelV2,
|
|
9
|
-
]);
|
|
10
|
-
|
|
11
|
-
export const DocumentationPageContentData = z.object({
|
|
12
|
-
items: z.array(DocumentationPageContentItem),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const DocumentationPageContent = z.object({
|
|
16
|
-
id: z.string(),
|
|
17
|
-
designSystemVersionId: z.string(),
|
|
18
|
-
createdAt: z.coerce.date(),
|
|
19
|
-
updatedAt: z.coerce.date(),
|
|
20
|
-
documentationPageId: z.string(),
|
|
21
|
-
data: DocumentationPageContentData,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export type DocumentationPageContentItem = z.infer<typeof DocumentationPageContentItem>;
|
|
25
|
-
export type DocumentationPageContentData = z.infer<typeof DocumentationPageContentData>;
|
|
26
|
-
export type DocumentationPageContent = z.infer<typeof DocumentationPageContent>;
|
|
27
|
-
|
|
28
|
-
export type CreateDocumentationPageContent = DbCreateInputOmit<DocumentationPageContent>;
|
|
29
|
-
export type UpdateDocumentationPageContent = OmitStrict<
|
|
30
|
-
DbUpdate<DocumentationPageContent>,
|
|
31
|
-
"designSystemVersionId" | "documentationPageId"
|
|
32
|
-
>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DocumentationPage = z.object({
|
|
4
|
-
type: z.literal("DocumentationPage"),
|
|
5
|
-
id: z.string(),
|
|
6
|
-
persistentId: z.string(),
|
|
7
|
-
shortPersistentId: z.string(),
|
|
8
|
-
designSystemVersionId: z.string(),
|
|
9
|
-
parentPersistentId: z.string().nullish(),
|
|
10
|
-
sortOrder: z.number(),
|
|
11
|
-
title: z.string(),
|
|
12
|
-
slug: z.string(),
|
|
13
|
-
userSlug: z.string().nullish(),
|
|
14
|
-
createdAt: z.coerce.date(),
|
|
15
|
-
updatedAt: z.coerce.date(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DocumentationPage = z.infer<typeof DocumentationPage>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DocumentationSettings = z.object({
|
|
4
|
-
// Basic
|
|
5
|
-
designSystemVersionId: z.string(),
|
|
6
|
-
createdAt: z.coerce.date(),
|
|
7
|
-
updatedAt: z.coerce.date(),
|
|
8
|
-
|
|
9
|
-
// Configuration
|
|
10
|
-
isTabbedLayoutEnabled: z.boolean(),
|
|
11
|
-
storybookEmbedErrorMessage: z.string().optional(),
|
|
12
|
-
renderCodePackageJson: z.string().optional(),
|
|
13
|
-
selectedBrandPersistentId: z.string().optional(),
|
|
14
|
-
serveDefaultVersionOnly: z.boolean(),
|
|
15
|
-
isPublic: z.boolean(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DocumentationSettings = z.infer<typeof DocumentationSettings>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const DocumentationComment = z.object({
|
|
4
|
-
id: z.string(),
|
|
5
|
-
|
|
6
|
-
authorId: z.string(),
|
|
7
|
-
threadId: z.string(),
|
|
8
|
-
roomId: z.string(),
|
|
9
|
-
|
|
10
|
-
createdAt: z.coerce.date(),
|
|
11
|
-
editedAt: z.coerce.date().optional(),
|
|
12
|
-
deletedAt: z.coerce.date().optional(),
|
|
13
|
-
|
|
14
|
-
body: z.string(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const DocumentationCommentThread = z.object({
|
|
18
|
-
id: z.string(),
|
|
19
|
-
|
|
20
|
-
roomId: z.string(),
|
|
21
|
-
|
|
22
|
-
pagePersistentId: z.string(),
|
|
23
|
-
brandId: z.string(),
|
|
24
|
-
designSystemVersionId: z.string(),
|
|
25
|
-
designSystemId: z.string(),
|
|
26
|
-
|
|
27
|
-
blockId: z.string().optional(),
|
|
28
|
-
resolved: z.boolean(),
|
|
29
|
-
|
|
30
|
-
createdAt: z.coerce.date(),
|
|
31
|
-
updatedAt: z.coerce.date(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export type DocumentationComment = z.infer<typeof DocumentationComment>;
|
|
35
|
-
export type DocumentationCommentThread = z.infer<typeof DocumentationCommentThread>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { groupBy } from "../../utils";
|
|
3
|
-
|
|
4
|
-
export const DesignElementSnapshotReason = z.enum(["Publish", "Deletion"]);
|
|
5
|
-
|
|
6
|
-
export const DesignElementSnapshotBase = z.object({
|
|
7
|
-
id: z.string(),
|
|
8
|
-
persistentId: z.string(),
|
|
9
|
-
designSystemVersionId: z.string(),
|
|
10
|
-
createdAt: z.coerce.date(),
|
|
11
|
-
updatedAt: z.coerce.date(),
|
|
12
|
-
reason: DesignElementSnapshotReason,
|
|
13
|
-
createdByUserId: z.string(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type DesignElementSnapshotBase = z.infer<typeof DesignElementSnapshotBase>;
|
|
17
|
-
export type DesignElementSnapshotReason = z.infer<typeof DesignElementSnapshotReason>;
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
// Util functions
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
export function pickLatestSnapshots<T extends DesignElementSnapshotBase>(
|
|
24
|
-
snapshots: T[],
|
|
25
|
-
getSnapshotElementId: (snapshot: T) => string
|
|
26
|
-
): T[] {
|
|
27
|
-
const groupedSnapshots = groupBy(snapshots, getSnapshotElementId);
|
|
28
|
-
|
|
29
|
-
return Array.from(groupedSnapshots.entries()).map(([_, snapshots]) => {
|
|
30
|
-
// Sort snapshots by created at date desc
|
|
31
|
-
const sorted = snapshots.sort((lhs, rhs) => rhs.createdAt.getTime() - lhs.createdAt.getTime());
|
|
32
|
-
return sorted[0];
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { DocumentationPageV2 } from "../elements";
|
|
5
|
-
import { DesignElementSnapshotBase, pickLatestSnapshots } from "./base";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Snapshot of a documentation page.
|
|
9
|
-
*
|
|
10
|
-
* Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.
|
|
11
|
-
*/
|
|
12
|
-
export const DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
|
|
13
|
-
page: DocumentationPageV2,
|
|
14
|
-
pageContentHash: z.string(),
|
|
15
|
-
pageContentStorageKey: z.string(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DocumentationPageSnapshot = z.infer<typeof DocumentationPageSnapshot>;
|
|
19
|
-
|
|
20
|
-
export type CreateDocumentationPageSnapshot = DbCreateInputOmit<DocumentationPageSnapshot>;
|
|
21
|
-
export type UpdateDocumentationPageSnapshot = OmitStrict<DbUpdate<DocumentationPageSnapshot>, "designSystemVersionId">;
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
// Util functions
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
export function pickLatestPageSnapshots(snapshots: DocumentationPageSnapshot[]): DocumentationPageSnapshot[] {
|
|
28
|
-
return pickLatestSnapshots(snapshots, s => s.page.id);
|
|
29
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { ElementGroup } from "../elements";
|
|
5
|
-
import { DesignElementSnapshotBase, pickLatestSnapshots } from "./base";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Snapshot of an element group.
|
|
9
|
-
*
|
|
10
|
-
* Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.
|
|
11
|
-
*/
|
|
12
|
-
export const ElementGroupSnapshot = DesignElementSnapshotBase.extend({
|
|
13
|
-
group: ElementGroup,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type ElementGroupSnapshot = z.infer<typeof ElementGroupSnapshot>;
|
|
17
|
-
|
|
18
|
-
export type CreateElementGroupSnapshot = DbCreateInputOmit<ElementGroupSnapshot>;
|
|
19
|
-
export type UpdateElementGroupSnapshot = OmitStrict<DbUpdate<ElementGroupSnapshot>, "designSystemVersionId">;
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Util functions
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
export function pickLatestGroupSnapshots(snapshots: ElementGroupSnapshot[]): ElementGroupSnapshot[] {
|
|
26
|
-
return pickLatestSnapshots(snapshots, s => s.group.id);
|
|
27
|
-
}
|
package/src/dsm/elements/base.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ObjectMeta } from "../../common";
|
|
3
|
-
|
|
4
|
-
export const DesignElementOrigin = z.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
sourceId: z.string(),
|
|
7
|
-
name: z.string(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const DesignElementBase = z.object({
|
|
11
|
-
id: z.string(),
|
|
12
|
-
persistentId: z.string(),
|
|
13
|
-
meta: ObjectMeta,
|
|
14
|
-
designSystemVersionId: z.string(),
|
|
15
|
-
createdAt: z.coerce.date(),
|
|
16
|
-
updatedAt: z.coerce.date(),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const DesignElementImportedBase = DesignElementBase.extend({
|
|
20
|
-
origin: DesignElementOrigin,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const DesignElementGroupablePart = z.object({
|
|
24
|
-
parentPersistentId: z.string().optional(),
|
|
25
|
-
sortOrder: z.number(),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export const DesignElementGroupableBase = DesignElementBase.extend(DesignElementGroupablePart.shape);
|
|
29
|
-
|
|
30
|
-
export const DesignElementGroupableRequiredPart = DesignElementGroupablePart.extend({
|
|
31
|
-
parentPersistentId: z.string(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const DesignElementBrandedPart = z.object({
|
|
35
|
-
brandPersistentId: z.string(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const DesignElementSlugPart = z.object({
|
|
39
|
-
slug: z.string().optional(),
|
|
40
|
-
userSlug: z.string().optional(),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export type DesignElementOrigin = z.infer<typeof DesignElementOrigin>;
|
|
44
|
-
export type DesignElementBase = z.infer<typeof DesignElementBase>;
|
|
45
|
-
export type DesignElementGroupablePart = z.infer<typeof DesignElementGroupablePart>;
|
|
46
|
-
export type DesignElementGroupableBase = z.infer<typeof DesignElementGroupableBase>;
|
|
47
|
-
export type DesignElementGroupableRequiredPart = z.infer<typeof DesignElementGroupableRequiredPart>;
|
|
48
|
-
export type DesignElementBrandedPart = z.infer<typeof DesignElementBrandedPart>;
|
|
49
|
-
export type DesignElementSlugPart = z.infer<typeof DesignElementSlugPart>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const FigmaComponentPropertyType = z.enum(["Boolean", "InstanceSwap", "Variant", "Text"]);
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
// Definitions
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const FigmaComponentPropertyOrigin = z.object({
|
|
10
|
-
id: z.string(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const FigmaComponentPropertyBase = z.object({
|
|
14
|
-
id: z.string(),
|
|
15
|
-
name: z.string(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const FigmaComponentInstancePreview = z.object({
|
|
19
|
-
componentName: z.string(),
|
|
20
|
-
componentSetName: z.string().optional(),
|
|
21
|
-
isRemote: z.boolean(),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const FigmaComponentBooleanProperty = FigmaComponentPropertyBase.extend({
|
|
25
|
-
type: z.literal(FigmaComponentPropertyType.enum.Boolean),
|
|
26
|
-
defaultValue: z.boolean(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const FigmaComponentInstanceSwapProperty = FigmaComponentPropertyBase.extend({
|
|
30
|
-
type: z.literal(FigmaComponentPropertyType.enum.InstanceSwap),
|
|
31
|
-
defaultValue: z.string(),
|
|
32
|
-
defaultValuePreview: FigmaComponentInstancePreview.optional(),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const FigmaComponentVariantProperty = FigmaComponentPropertyBase.extend({
|
|
36
|
-
type: z.literal(FigmaComponentPropertyType.enum.Variant),
|
|
37
|
-
defaultValue: z.string(),
|
|
38
|
-
options: z.array(z.string()),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export const FigmaComponentTextProperty = FigmaComponentPropertyBase.extend({
|
|
42
|
-
type: z.literal(FigmaComponentPropertyType.enum.Text),
|
|
43
|
-
id: z.string(),
|
|
44
|
-
defaultValue: z.string(),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export const FigmaComponentProperty = z.discriminatedUnion("type", [
|
|
48
|
-
FigmaComponentBooleanProperty,
|
|
49
|
-
FigmaComponentInstanceSwapProperty,
|
|
50
|
-
FigmaComponentTextProperty,
|
|
51
|
-
FigmaComponentVariantProperty,
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
export const FigmaComponentPropertyMap = z.record(z.string(), FigmaComponentProperty);
|
|
55
|
-
|
|
56
|
-
export type FigmaComponentInstancePreview = z.infer<typeof FigmaComponentInstancePreview>;
|
|
57
|
-
export type FigmaComponentPropertyType = z.infer<typeof FigmaComponentPropertyType>;
|
|
58
|
-
export type FigmaComponentBooleanProperty = z.infer<typeof FigmaComponentBooleanProperty>;
|
|
59
|
-
export type FigmaComponentInstanceSwapProperty = z.infer<typeof FigmaComponentInstanceSwapProperty>;
|
|
60
|
-
export type FigmaComponentVariantProperty = z.infer<typeof FigmaComponentVariantProperty>;
|
|
61
|
-
export type FigmaComponentTextProperty = z.infer<typeof FigmaComponentTextProperty>;
|
|
62
|
-
export type FigmaComponentProperty = z.infer<typeof FigmaComponentProperty>;
|
|
63
|
-
export type FigmaComponentPropertyMap = z.infer<typeof FigmaComponentPropertyMap>;
|