@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.
- 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,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ColorTokenData } from "./color";
|
|
3
|
-
import { tokenAliasOrValue } from "./base";
|
|
4
|
-
import { nullishToOptional } from "../../../helpers";
|
|
5
|
-
import { Point2D } from "../primitives";
|
|
6
|
-
|
|
7
|
-
export const GradientType = z.enum(["Linear", "Radial", "Angular"]);
|
|
8
|
-
|
|
9
|
-
export const GradientStop = z.object({
|
|
10
|
-
position: z.number(),
|
|
11
|
-
color: ColorTokenData,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const GradientLayerValue = z.object({
|
|
15
|
-
from: Point2D,
|
|
16
|
-
to: Point2D,
|
|
17
|
-
type: GradientType,
|
|
18
|
-
aspectRatio: nullishToOptional(z.number()), // z.number(),
|
|
19
|
-
stops: z.array(GradientStop).min(2),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const GradientLayerData = tokenAliasOrValue(GradientLayerValue);
|
|
23
|
-
|
|
24
|
-
export const GradientTokenValue = z.array(GradientLayerData);
|
|
25
|
-
export const GradientTokenData = tokenAliasOrValue(GradientTokenValue);
|
|
26
|
-
|
|
27
|
-
export type GradientType = z.infer<typeof GradientType>;
|
|
28
|
-
export type GradientStop = z.infer<typeof GradientStop>;
|
|
29
|
-
export type GradientLayerValue = z.infer<typeof GradientLayerValue>;
|
|
30
|
-
export type GradientLayerData = z.infer<typeof GradientLayerData>;
|
|
31
|
-
export type GradientTokenValue = z.infer<typeof GradientTokenValue>;
|
|
32
|
-
export type GradientTokenData = z.infer<typeof GradientTokenData>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { nullishToOptional } from "../../../helpers";
|
|
3
|
-
import { DocumentationItemConfigurationV1 } from "./documentation-v1";
|
|
4
|
-
import { DocumentationItemConfigurationV2 } from "./documentation-v2";
|
|
5
|
-
|
|
6
|
-
export const DocumentationGroupBehavior = z.enum(["Group", "Tabs"]);
|
|
7
|
-
|
|
8
|
-
export const ElementGroupDataV1 = z.object({
|
|
9
|
-
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
10
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV1),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const ElementGroupDataV2 = z.object({
|
|
14
|
-
behavior: nullishToOptional(DocumentationGroupBehavior.optional()),
|
|
15
|
-
configuration: nullishToOptional(DocumentationItemConfigurationV2),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DocumentationGroupBehavior = z.infer<typeof DocumentationGroupBehavior>;
|
|
19
|
-
export type ElementGroupDataV1 = z.infer<typeof ElementGroupDataV1>;
|
|
20
|
-
export type ElementGroupDataV2 = z.infer<typeof ElementGroupDataV2>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export * from "./base";
|
|
2
|
-
export * from "./blur";
|
|
3
|
-
export * from "./border-radius";
|
|
4
|
-
export * from "./border-width";
|
|
5
|
-
export * from "./border";
|
|
6
|
-
export * from "./color";
|
|
7
|
-
export * from "./component";
|
|
8
|
-
export * from "./dimension";
|
|
9
|
-
export * from "./documentation-block-v1";
|
|
10
|
-
export * from "./documentation-block-v2";
|
|
11
|
-
export * from "./documentation-page-v1";
|
|
12
|
-
export * from "./documentation-page-v2";
|
|
13
|
-
export * from "./documentation-section-v2";
|
|
14
|
-
export * from "./documentation-v1";
|
|
15
|
-
export * from "./documentation-v2";
|
|
16
|
-
export * from "./duration";
|
|
17
|
-
export * from "./figma-file-structure";
|
|
18
|
-
export * from "./figma-node-reference";
|
|
19
|
-
export * from "./font-family";
|
|
20
|
-
export * from "./font-size";
|
|
21
|
-
export * from "./font-weight";
|
|
22
|
-
export * from "./font";
|
|
23
|
-
export * from "./gradient";
|
|
24
|
-
export * from "./group";
|
|
25
|
-
export * from "./item-header-v1";
|
|
26
|
-
export * from "./item-header-v2";
|
|
27
|
-
export * from "./item-header";
|
|
28
|
-
export * from "./letter-spacing";
|
|
29
|
-
export * from "./line-height";
|
|
30
|
-
export * from "./opacity";
|
|
31
|
-
export * from "./paragraph-indent";
|
|
32
|
-
export * from "./paragraph-spacing";
|
|
33
|
-
export * from "./product-copy";
|
|
34
|
-
export * from "./safe-id";
|
|
35
|
-
export * from "./shadow";
|
|
36
|
-
export * from "./size";
|
|
37
|
-
export * from "./space";
|
|
38
|
-
export * from "./string";
|
|
39
|
-
export * from "./text-case";
|
|
40
|
-
export * from "./text-decoration";
|
|
41
|
-
export * from "./typography";
|
|
42
|
-
export * from "./visibility";
|
|
43
|
-
export * from "./z-index";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ColorTokenData } from "./color";
|
|
3
|
-
import {
|
|
4
|
-
DocumentationItemHeaderAlignment,
|
|
5
|
-
DocumentationItemHeaderAlignmentSchema,
|
|
6
|
-
DocumentationItemHeaderImageScaleType,
|
|
7
|
-
DocumentationItemHeaderImageScaleTypeSchema,
|
|
8
|
-
} from "./item-header";
|
|
9
|
-
import { PageBlockAsset } from "./documentation-block-v1";
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
// Definitions
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
export const DocumentationItemHeaderV1 = z.object({
|
|
16
|
-
description: z.string(),
|
|
17
|
-
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
18
|
-
foregroundColor: ColorTokenData.nullish(),
|
|
19
|
-
backgroundColor: ColorTokenData.nullish(),
|
|
20
|
-
backgroundImageAsset: PageBlockAsset.nullish(),
|
|
21
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
22
|
-
showBackgroundOverlay: z.boolean(),
|
|
23
|
-
showCoverText: z.boolean(),
|
|
24
|
-
minHeight: z.number().nullish(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type DocumentationItemHeaderV1 = z.infer<typeof DocumentationItemHeaderV1>;
|
|
28
|
-
|
|
29
|
-
export const defaultDocumentationItemHeaderV1: DocumentationItemHeaderV1 = {
|
|
30
|
-
alignment: DocumentationItemHeaderAlignment.Left,
|
|
31
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
32
|
-
description: "",
|
|
33
|
-
showBackgroundOverlay: false,
|
|
34
|
-
showCoverText: true,
|
|
35
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
DocumentationItemHeaderAlignment,
|
|
4
|
-
DocumentationItemHeaderAlignmentSchema,
|
|
5
|
-
DocumentationItemHeaderImageScaleType,
|
|
6
|
-
DocumentationItemHeaderImageScaleTypeSchema,
|
|
7
|
-
} from "./item-header";
|
|
8
|
-
import { PageBlockColorV2, PageBlockImageReference } from "./documentation-block-v2";
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
// Definitions
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
export const DocumentationItemHeaderV2 = z.object({
|
|
15
|
-
description: z.string(),
|
|
16
|
-
alignment: DocumentationItemHeaderAlignmentSchema,
|
|
17
|
-
foregroundColor: PageBlockColorV2.nullish(),
|
|
18
|
-
backgroundColor: PageBlockColorV2.nullish(),
|
|
19
|
-
backgroundImageAsset: PageBlockImageReference.nullish(),
|
|
20
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,
|
|
21
|
-
showBackgroundOverlay: z.boolean(),
|
|
22
|
-
showCoverText: z.boolean(),
|
|
23
|
-
minHeight: z.number().nullish(),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export type DocumentationItemHeaderV2 = z.infer<typeof DocumentationItemHeaderV2>;
|
|
27
|
-
|
|
28
|
-
export const defaultDocumentationItemHeaderV2: DocumentationItemHeaderV2 = {
|
|
29
|
-
alignment: DocumentationItemHeaderAlignment.Left,
|
|
30
|
-
backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,
|
|
31
|
-
description: "",
|
|
32
|
-
showBackgroundOverlay: false,
|
|
33
|
-
showCoverText: true,
|
|
34
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Enums
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
export const DocumentationItemHeaderAlignmentSchema = z.enum(["Left", "Center"]);
|
|
8
|
-
export const DocumentationItemHeaderImageScaleTypeSchema = z.enum(["AspectFill", "AspectFit"]);
|
|
9
|
-
|
|
10
|
-
export const DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;
|
|
11
|
-
export const DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTypeSchema.enum;
|
|
12
|
-
|
|
13
|
-
export type DocumentationItemHeaderImageScaleType = z.infer<typeof DocumentationItemHeaderImageScaleTypeSchema>;
|
|
14
|
-
export type DocumentationItemHeaderAlignment = z.infer<typeof DocumentationItemHeaderAlignmentSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const LetterSpacingUnit = z.enum(["Pixels", "Rem", "Percent"]);
|
|
6
|
-
|
|
7
|
-
export const LetterSpacingValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const LetterSpacingTokenData = tokenAliasOrValue(LetterSpacingValue);
|
|
13
|
-
|
|
14
|
-
export type LetterSpacingUnit = z.infer<typeof LetterSpacingUnit>;
|
|
15
|
-
export type LetterSpacingValue = z.infer<typeof LetterSpacingValue>;
|
|
16
|
-
export type LetterSpacingTokenData = z.infer<typeof LetterSpacingTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const LineHeightUnit = z.enum(["Pixels", "Rem", "Percent", "Raw"]);
|
|
6
|
-
|
|
7
|
-
export const LineHeightValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const LineHeightTokenData = tokenAliasOrValue(LineHeightValue);
|
|
13
|
-
|
|
14
|
-
export type LineHeightUnit = z.infer<typeof LineHeightUnit>;
|
|
15
|
-
export type LineHeightValue = z.infer<typeof LineHeightValue>;
|
|
16
|
-
export type LineHeightTokenData = z.infer<typeof LineHeightTokenData>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const OpacityValue = z.object({
|
|
6
|
-
unit: DimensionUnit,
|
|
7
|
-
measure: z.number(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const OpacityTokenData = tokenAliasOrValue(OpacityValue);
|
|
11
|
-
|
|
12
|
-
export type OpacityValue = z.infer<typeof OpacityValue>;
|
|
13
|
-
export type OpacityTokenData = z.infer<typeof OpacityTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const ParagraphIndentUnit = z.enum(["Pixels", "Rem", "Percent"]);
|
|
6
|
-
|
|
7
|
-
export const ParagraphIndentValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const ParagraphIndentTokenData = tokenAliasOrValue(ParagraphIndentValue);
|
|
13
|
-
|
|
14
|
-
export type ParagraphIndentUnit = z.infer<typeof ParagraphIndentUnit>;
|
|
15
|
-
export type ParagraphIndentValue = z.infer<typeof ParagraphIndentValue>;
|
|
16
|
-
export type ParagraphIndentTokenData = z.infer<typeof ParagraphIndentTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const ParagraphSpacingUnit = z.enum(["Pixels", "Rem", "Percent"]);
|
|
6
|
-
|
|
7
|
-
export const ParagraphSpacingValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);
|
|
13
|
-
|
|
14
|
-
export type ParagraphSpacingUnit = z.infer<typeof ParagraphSpacingUnit>;
|
|
15
|
-
export type ParagraphSpacingValue = z.infer<typeof ParagraphSpacingValue>;
|
|
16
|
-
export type ParagraphSpacingTokenData = z.infer<typeof ParagraphSpacingTokenData>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
|
|
4
|
-
export const ProductCopyValue = z.string();
|
|
5
|
-
export const ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);
|
|
6
|
-
|
|
7
|
-
export type ProductCopyValue = z.infer<typeof ProductCopyValue>;
|
|
8
|
-
export type ProductCopyTokenData = z.infer<typeof ProductCopyTokenData>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
const RESERVED_OBJECT_ID_PREFIX = "x-sn-reserved-";
|
|
4
|
-
|
|
5
|
-
// Really only checks if the schema does not have the reserved prefix
|
|
6
|
-
export const SafeIdSchema = z.string().refine(
|
|
7
|
-
value => {
|
|
8
|
-
return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`,
|
|
12
|
-
}
|
|
13
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ColorTokenData } from "./color";
|
|
3
|
-
import { OpacityTokenData } from "./opacity";
|
|
4
|
-
import { tokenAliasOrValue } from "./base";
|
|
5
|
-
|
|
6
|
-
export const ShadowType = z.enum(["Drop", "Inner"]);
|
|
7
|
-
|
|
8
|
-
export const ShadowLayerValue = z.object({
|
|
9
|
-
color: ColorTokenData,
|
|
10
|
-
x: z.number(),
|
|
11
|
-
y: z.number(),
|
|
12
|
-
radius: z.number(),
|
|
13
|
-
spread: z.number(),
|
|
14
|
-
opacity: OpacityTokenData.optional(),
|
|
15
|
-
type: ShadowType,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);
|
|
19
|
-
export const ShadowTokenData = tokenAliasOrValue(z.array(ShadowTokenDataBase));
|
|
20
|
-
|
|
21
|
-
export type ShadowType = z.infer<typeof ShadowType>;
|
|
22
|
-
export type ShadowLayerValue = z.infer<typeof ShadowLayerValue>;
|
|
23
|
-
export type ShadowTokenData = z.infer<typeof ShadowTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const SizeUnit = z.enum(["Pixels", "Rem", "Percent"]);
|
|
6
|
-
|
|
7
|
-
export const SizeValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const SizeTokenData = tokenAliasOrValue(SizeValue);
|
|
13
|
-
|
|
14
|
-
export type SizeUnit = z.infer<typeof SizeUnit>;
|
|
15
|
-
export type SizeValue = z.infer<typeof SizeValue>;
|
|
16
|
-
export type SizeTokenData = z.infer<typeof SizeTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const SpaceUnit = z.enum(["Pixels", "Rem", "Percent"]);
|
|
6
|
-
|
|
7
|
-
export const SpaceValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const SpaceTokenData = tokenAliasOrValue(SpaceValue);
|
|
13
|
-
|
|
14
|
-
export type SpaceUnit = z.infer<typeof SpaceUnit>;
|
|
15
|
-
export type SpaceValue = z.infer<typeof SpaceValue>;
|
|
16
|
-
export type SpaceTokenData = z.infer<typeof SpaceTokenData>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
|
|
4
|
-
export const StringValue = z.string();
|
|
5
|
-
export const StringTokenData = tokenAliasOrValue(StringValue);
|
|
6
|
-
|
|
7
|
-
export type StringValue = z.infer<typeof StringValue>;
|
|
8
|
-
export type StringTokenData = z.infer<typeof StringTokenData>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
|
|
4
|
-
export const TextCase = z.enum(["Original", "Upper", "Lower", "Camel", "SmallCaps"]);
|
|
5
|
-
export const TextCaseValue = TextCase;
|
|
6
|
-
export const TextCaseTokenData = tokenAliasOrValue(TextCaseValue);
|
|
7
|
-
|
|
8
|
-
export type TextCase = z.infer<typeof TextCase>;
|
|
9
|
-
export type TextCaseValue = z.infer<typeof TextCaseValue>;
|
|
10
|
-
export type TextCaseTokenData = z.infer<typeof TextCaseTokenData>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
|
|
4
|
-
export const TextDecoration = z.enum(["None", "Underline", "Strikethrough"]);
|
|
5
|
-
export const TextDecorationValue = TextDecoration;
|
|
6
|
-
export const TextDecorationTokenData = tokenAliasOrValue(TextDecorationValue);
|
|
7
|
-
|
|
8
|
-
export type TextDecoration = z.infer<typeof TextDecoration>;
|
|
9
|
-
export type TextDecorationValue = z.infer<typeof TextDecorationValue>;
|
|
10
|
-
export type TextDecorationTokenData = z.infer<typeof TextDecorationTokenData>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { FontSizeTokenData } from "./font-size";
|
|
3
|
-
import { FontFamilyTokenData } from "./font-family";
|
|
4
|
-
import { FontWeightTokenData } from "./font-weight";
|
|
5
|
-
import { TextDecorationTokenData } from "./text-decoration";
|
|
6
|
-
import { TextCaseTokenData } from "./text-case";
|
|
7
|
-
import { LetterSpacingTokenData } from "./letter-spacing";
|
|
8
|
-
import { LineHeightTokenData } from "./line-height";
|
|
9
|
-
import { ParagraphIndentTokenData } from "./paragraph-indent";
|
|
10
|
-
import { ParagraphSpacingTokenData } from "./paragraph-spacing";
|
|
11
|
-
import { tokenAliasOrValue } from "./base";
|
|
12
|
-
|
|
13
|
-
export const TypographyValue = z.object({
|
|
14
|
-
fontSize: FontSizeTokenData,
|
|
15
|
-
fontFamily: FontFamilyTokenData,
|
|
16
|
-
fontWeight: FontWeightTokenData,
|
|
17
|
-
textDecoration: TextDecorationTokenData,
|
|
18
|
-
textCase: TextCaseTokenData,
|
|
19
|
-
letterSpacing: LetterSpacingTokenData.optional(),
|
|
20
|
-
lineHeight: LineHeightTokenData.optional(),
|
|
21
|
-
paragraphIndent: ParagraphIndentTokenData.optional(),
|
|
22
|
-
paragraphSpacing: ParagraphSpacingTokenData.optional(),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const TypographyTokenData = tokenAliasOrValue(TypographyValue);
|
|
26
|
-
|
|
27
|
-
export type TypographyValue = z.infer<typeof TypographyValue>;
|
|
28
|
-
export type TypographyTokenData = z.infer<typeof TypographyTokenData>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
|
|
4
|
-
export const Visibility = z.enum(["Hidden", "Visible"]);
|
|
5
|
-
export const VisibilityValue = Visibility;
|
|
6
|
-
export const VisibilityTokenData = tokenAliasOrValue(VisibilityValue);
|
|
7
|
-
|
|
8
|
-
export type Visibility = z.infer<typeof Visibility>;
|
|
9
|
-
export type VisibilityValue = z.infer<typeof VisibilityValue>;
|
|
10
|
-
export type VisibilityTokenData = z.infer<typeof VisibilityTokenData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { tokenAliasOrValue } from "./base";
|
|
3
|
-
import { DimensionUnit } from "./dimension";
|
|
4
|
-
|
|
5
|
-
export const ZIndexUnit = z.enum(["Raw"]);
|
|
6
|
-
|
|
7
|
-
export const ZIndexValue = z.object({
|
|
8
|
-
unit: DimensionUnit,
|
|
9
|
-
measure: z.number(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const ZIndexTokenData = tokenAliasOrValue(ZIndexValue);
|
|
13
|
-
|
|
14
|
-
export type ZIndexUnit = z.infer<typeof ZIndexUnit>;
|
|
15
|
-
export type ZIndexValue = z.infer<typeof ZIndexValue>;
|
|
16
|
-
export type ZIndexTokenData = z.infer<typeof ZIndexTokenData>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from "./base";
|
|
5
|
-
import { DocumentationPageDataV1, ElementGroupDataV1 } from "./data";
|
|
6
|
-
import { ElementGroup } from "./group";
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
// Documentation page
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
export const DocumentationPageV1 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)
|
|
13
|
-
.extend(DesignElementSlugPart.shape)
|
|
14
|
-
.extend({
|
|
15
|
-
shortPersistentId: z.string(),
|
|
16
|
-
data: DocumentationPageDataV1,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type DocumentationPageV1 = z.infer<typeof DocumentationPageV1>;
|
|
20
|
-
|
|
21
|
-
export type CreateDocumentationPageV1 = DbCreateInputOmit<DocumentationPageV1>;
|
|
22
|
-
export type UpdateDocumentationPageV1 = OmitStrict<DbUpdate<DocumentationPageV1>, "designSystemVersionId">;
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
// Documentation group (legacy)
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
export const DocumentationGroupV1 = ElementGroup.omit({
|
|
29
|
-
data: true,
|
|
30
|
-
}).extend({
|
|
31
|
-
data: ElementGroupDataV1.optional(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export type DocumentationGroupV1 = z.infer<typeof DocumentationGroupV1>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from "./base";
|
|
5
|
-
import { PageBlockV1 } from "./data";
|
|
6
|
-
import { DocumentationPageDataV2 } from "./data/documentation-page-v2";
|
|
7
|
-
|
|
8
|
-
export const DocumentationPageV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)
|
|
9
|
-
.extend(DesignElementSlugPart.shape)
|
|
10
|
-
.extend({
|
|
11
|
-
shortPersistentId: z.string(),
|
|
12
|
-
data: DocumentationPageDataV2.extend({
|
|
13
|
-
oldBlocks: z.array(PageBlockV1).optional(),
|
|
14
|
-
}),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type DocumentationPageV2 = z.infer<typeof DocumentationPageV2>;
|
|
18
|
-
|
|
19
|
-
export type CreateDocumentationPageV2 = DbCreateInputOmit<DocumentationPageV2>;
|
|
20
|
-
export type UpdateDocumentationPageV2 = OmitStrict<DbUpdate<DocumentationPageV2>, "designSystemVersionId">;
|
|
21
|
-
export type RestoreDocumentationPage = CreateDocumentationPageV2 & { id: string; createdAt: Date; updatedAt: Date };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate, nullishToOptional } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import {
|
|
5
|
-
DesignElementBase,
|
|
6
|
-
DesignElementBrandedPart,
|
|
7
|
-
DesignElementGroupableRequiredPart,
|
|
8
|
-
DesignElementOrigin,
|
|
9
|
-
} from "./base";
|
|
10
|
-
import { FigmaComponentPropertyMap } from "./component-properties";
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
// Figma Component
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
export const FigmaComponentOriginPart = z.object({
|
|
17
|
-
nodeId: z.string().optional(),
|
|
18
|
-
width: z.number().optional(),
|
|
19
|
-
height: z.number().optional(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const FigmaComponentAsset = z.object({
|
|
23
|
-
assetId: z.string(),
|
|
24
|
-
assetPath: z.string(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const FigmaComponentOrigin = DesignElementOrigin.extend(FigmaComponentOriginPart.shape);
|
|
28
|
-
|
|
29
|
-
export const FigmaComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)
|
|
30
|
-
.extend(DesignElementBrandedPart.shape)
|
|
31
|
-
.extend({
|
|
32
|
-
origin: FigmaComponentOrigin.optional(),
|
|
33
|
-
thumbnail: FigmaComponentAsset,
|
|
34
|
-
componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),
|
|
35
|
-
variantPropertyValues: z.record(z.string()).optional(),
|
|
36
|
-
|
|
37
|
-
svg: FigmaComponentAsset.optional(),
|
|
38
|
-
isAsset: z.boolean(),
|
|
39
|
-
parentComponentPersistentId: nullishToOptional(z.string()),
|
|
40
|
-
renderNodeId: z.string().optional(),
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export type FigmaComponentAsset = z.infer<typeof FigmaComponentAsset>;
|
|
44
|
-
export type FigmaComponent = z.infer<typeof FigmaComponent>;
|
|
45
|
-
export type FigmaComponentOrigin = z.infer<typeof FigmaComponentOrigin>;
|
|
46
|
-
export type ImportedFigmaComponent = OmitStrict<FigmaComponent, "origin"> & { origin: FigmaComponentOrigin };
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
// Support types
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
export type CreateFigmaComponent = DbCreateInputOmit<FigmaComponent>;
|
|
53
|
-
export type UpdateFigmaComponent = OmitStrict<DbUpdate<FigmaComponent>, "brandPersistentId" | "designSystemVersionId">;
|
|
54
|
-
|
|
55
|
-
export type FigmaComponentDiff = {
|
|
56
|
-
toCreate: CreateFigmaComponent[];
|
|
57
|
-
toUpdate: UpdateFigmaComponent[];
|
|
58
|
-
toDelete: FigmaComponent["id"][];
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
// Utils
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
export function isImportedFigmaComponent(component: FigmaComponent): component is ImportedFigmaComponent {
|
|
66
|
-
return !!component.origin;
|
|
67
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DesignElementBase } from "./base";
|
|
3
|
-
import { FigmaFileStructureNode, FigmaFileStructureStatistics } from "./data/figma-file-structure";
|
|
4
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
5
|
-
import { OmitStrict } from "../../utils";
|
|
6
|
-
|
|
7
|
-
export const FigmaFileStructureOrigin = z.object({
|
|
8
|
-
sourceId: z.string(),
|
|
9
|
-
fileId: z.string().optional(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const FigmaFileStructureData = z.object({
|
|
13
|
-
rootNode: FigmaFileStructureNode,
|
|
14
|
-
assetsInFile: FigmaFileStructureStatistics,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const FigmaFileStructure = DesignElementBase.extend({
|
|
18
|
-
origin: FigmaFileStructureOrigin,
|
|
19
|
-
data: FigmaFileStructureData,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export type FigmaFileStructureOrigin = z.infer<typeof FigmaFileStructureOrigin>;
|
|
23
|
-
export type FigmaFileStructureData = z.infer<typeof FigmaFileStructureData>;
|
|
24
|
-
export type FigmaFileStructure = z.infer<typeof FigmaFileStructure>;
|
|
25
|
-
|
|
26
|
-
export type CreateFigmaFileStructure = DbCreateInputOmit<FigmaFileStructure>;
|
|
27
|
-
export type UpdateFigmaFileStructure = OmitStrict<DbUpdate<FigmaFileStructure>, "designSystemVersionId">;
|
|
28
|
-
|
|
29
|
-
export type FigmaFileStructureDiff = {
|
|
30
|
-
toCreate: CreateFigmaFileStructure[];
|
|
31
|
-
toUpdate: UpdateFigmaFileStructure[];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function traverseStructure(node: FigmaFileStructureNode, action: (node: FigmaFileStructureNode) => void) {
|
|
35
|
-
action(node);
|
|
36
|
-
|
|
37
|
-
for (const child of node.children) {
|
|
38
|
-
traverseStructure(child, action);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { DbCreateInputOmit, DbUpdate } from "../../helpers";
|
|
3
|
-
import { OmitStrict } from "../../utils";
|
|
4
|
-
import { DesignElementBase } from "./base";
|
|
5
|
-
import { FigmaNodeReferenceData } from "./data/figma-node-reference";
|
|
6
|
-
|
|
7
|
-
export const FigmaNodeReferenceOrigin = z.object({
|
|
8
|
-
sourceId: z.string(),
|
|
9
|
-
parentName: z.string().optional(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const FigmaNodeReference = DesignElementBase.extend({
|
|
13
|
-
data: FigmaNodeReferenceData,
|
|
14
|
-
origin: FigmaNodeReferenceOrigin,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type FigmaNodeReferenceOrigin = z.infer<typeof FigmaNodeReferenceOrigin>;
|
|
18
|
-
export type FigmaNodeReference = z.infer<typeof FigmaNodeReference>;
|
|
19
|
-
|
|
20
|
-
export type CreateFigmaNodeReference = DbCreateInputOmit<FigmaNodeReference>;
|
|
21
|
-
export type UpdateFigmaNodeReference = OmitStrict<DbUpdate<FigmaNodeReference>, "designSystemVersionId">;
|
|
22
|
-
|
|
23
|
-
export type FigmaNodeReferenceDiff = {
|
|
24
|
-
toUpdate: UpdateFigmaNodeReference[];
|
|
25
|
-
};
|