@supernova-studio/model 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1911 -1187
- package/dist/index.d.ts +1911 -1187
- package/dist/index.js +238 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +243 -63
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/codegen/export-jobs.ts +136 -21
- package/src/codegen/exporter.ts +12 -13
- package/src/codegen/pulsar.ts +39 -27
- package/src/dsm/design-system.ts +7 -5
- package/src/dsm/documentation/block-definitions/definition.ts +1 -1
- package/src/dsm/documentation/block-definitions/item.ts +85 -12
- package/src/dsm/elements/data/documentation-block-v1.ts +2 -0
- package/src/dsm/elements/data/documentation-block-v2.ts +20 -1
package/package.json
CHANGED
|
@@ -1,26 +1,141 @@
|
|
|
1
1
|
import { PublishedDocEnvironment } from "../dsm";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
]);
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
|
|
4
|
+
export const ExporterJobDestination = z.enum(["s3", "webhookUrl", "github", "documentation", "azure", "gitlab"]);
|
|
5
|
+
|
|
6
|
+
export const ExporterJobStatus = z.enum(["InProgress", "Success", "Failed", "Timeout"]);
|
|
7
|
+
|
|
8
|
+
export const ExporterJobLogEntryType = z.enum(["success", "info", "warning", "error", "user"]);
|
|
9
|
+
|
|
10
|
+
export const ExporterJobLogEntry = z.object({
|
|
11
|
+
id: z.string().optional(),
|
|
12
|
+
time: z.coerce.date(),
|
|
13
|
+
type: ExporterJobLogEntryType,
|
|
14
|
+
message: z.string(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const ExporterJobResultPullRequestDestination = z.object({
|
|
18
|
+
pullRequestUrl: z.string(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const ExporterJobResultS3Destination = z.object({
|
|
22
|
+
bucket: z.string(),
|
|
23
|
+
urlPrefix: z.string().optional(),
|
|
24
|
+
path: z.string(),
|
|
25
|
+
files: z.array(z.string()),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const ExporterJobResultDocsDestination = z.object({
|
|
29
|
+
url: z.string(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const ExporterJobResult = z.object({
|
|
33
|
+
error: z.string().optional(),
|
|
34
|
+
logs: z.array(ExporterJobLogEntry).optional(),
|
|
35
|
+
s3: ExporterJobResultS3Destination.optional(),
|
|
36
|
+
github: ExporterJobResultPullRequestDestination.optional(),
|
|
37
|
+
azure: ExporterJobResultPullRequestDestination.optional(),
|
|
38
|
+
gitlab: ExporterJobResultPullRequestDestination.optional(),
|
|
39
|
+
bitbucket: ExporterJobResultPullRequestDestination.optional(),
|
|
40
|
+
sndocs: ExporterJobResultDocsDestination.optional(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const ExporterDestinationSnDocs = z.object({
|
|
22
44
|
environment: PublishedDocEnvironment,
|
|
23
|
-
finishedAt: z.date().nullish(),
|
|
24
45
|
});
|
|
25
46
|
|
|
26
|
-
export
|
|
47
|
+
export const ExporterDestinationS3 = z.object({});
|
|
48
|
+
|
|
49
|
+
export const ExporterDestinationGithub = z.object({
|
|
50
|
+
connectionId: z.string(),
|
|
51
|
+
url: z.string(),
|
|
52
|
+
branch: z.string(),
|
|
53
|
+
relativePath: z.string(),
|
|
54
|
+
// +
|
|
55
|
+
userId: z.coerce.string(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const ExporterDestinationAzure = z.object({
|
|
59
|
+
connectionId: z.string(),
|
|
60
|
+
organizationId: z.string(),
|
|
61
|
+
projectId: z.string(),
|
|
62
|
+
repositoryId: z.string(),
|
|
63
|
+
branch: z.string(),
|
|
64
|
+
relativePath: z.string(),
|
|
65
|
+
// +
|
|
66
|
+
userId: z.coerce.string(),
|
|
67
|
+
url: z.string(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const ExporterDestinationGitlab = z.object({
|
|
71
|
+
connectionId: z.string(),
|
|
72
|
+
projectId: z.string(),
|
|
73
|
+
branch: z.string(),
|
|
74
|
+
relativePath: z.string(),
|
|
75
|
+
// +
|
|
76
|
+
userId: z.coerce.string(),
|
|
77
|
+
url: z.string(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
|
|
81
|
+
const BITBUCKET_MAX_LENGTH = 64;
|
|
82
|
+
|
|
83
|
+
export const ExporterDestinationBitbucket = z.object({
|
|
84
|
+
connectionId: z.string(),
|
|
85
|
+
workspaceSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
86
|
+
projectKey: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
87
|
+
repoSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
|
|
88
|
+
branch: z.string(),
|
|
89
|
+
relativePath: z.string(),
|
|
90
|
+
// +
|
|
91
|
+
userId: z.coerce.string(),
|
|
92
|
+
url: z.string(),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export const ExporterJob = z.object({
|
|
96
|
+
id: z.coerce.string(),
|
|
97
|
+
createdAt: z.coerce.date(),
|
|
98
|
+
finishedAt: z.coerce.date().optional(),
|
|
99
|
+
designSystemId: z.coerce.string(),
|
|
100
|
+
designSystemVersionId: z.coerce.string(),
|
|
101
|
+
workspaceId: z.coerce.string(),
|
|
102
|
+
scheduleId: z.coerce.string().nullish(),
|
|
103
|
+
exporterId: z.coerce.string(),
|
|
104
|
+
brandId: z.coerce.string().optional(),
|
|
105
|
+
themeId: z.coerce.string().optional(),
|
|
106
|
+
estimatedExecutionTime: z.number().optional(),
|
|
107
|
+
status: ExporterJobStatus,
|
|
108
|
+
result: ExporterJobResult.optional(),
|
|
109
|
+
createdByUserId: z.string().optional(),
|
|
110
|
+
|
|
111
|
+
// CodegenDestinationsModel
|
|
112
|
+
webhookUrl: z.string().optional(),
|
|
113
|
+
destinationSnDocs: ExporterDestinationSnDocs.optional(),
|
|
114
|
+
destinationS3: ExporterDestinationS3.optional(),
|
|
115
|
+
destinationGithub: ExporterDestinationGithub.optional(),
|
|
116
|
+
destinationAzure: ExporterDestinationAzure.optional(),
|
|
117
|
+
destinationGitlab: ExporterDestinationGitlab.optional(),
|
|
118
|
+
destinationBitbucket: ExporterDestinationBitbucket.optional(),
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export const ExporterJobFindByFilter = ExporterJob.pick({
|
|
122
|
+
exporterId: true,
|
|
123
|
+
designSystemVersionId: true,
|
|
124
|
+
destinations: true,
|
|
125
|
+
createdByUserId: true,
|
|
126
|
+
status: true,
|
|
127
|
+
scheduleId: true,
|
|
128
|
+
designSystemId: true,
|
|
129
|
+
themeId: true,
|
|
130
|
+
brandId: true,
|
|
131
|
+
})
|
|
132
|
+
.extend({
|
|
133
|
+
destinations: z.array(ExporterJobDestination),
|
|
134
|
+
docsEnvironment: PublishedDocEnvironment,
|
|
135
|
+
})
|
|
136
|
+
.partial();
|
|
137
|
+
|
|
138
|
+
export type ExporterJobDestination = z.infer<typeof ExporterJobDestination>;
|
|
139
|
+
export type ExporterJobStatus = z.infer<typeof ExporterJobStatus>;
|
|
140
|
+
export type ExporterJob = z.infer<typeof ExporterJob>;
|
|
141
|
+
export type ExporterJobFindByFilter = z.infer<typeof ExporterJobFindByFilter>;
|
package/src/codegen/exporter.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { GitProvider } from "./git-providers";
|
|
3
|
-
import {
|
|
3
|
+
import { PulsarCustomBlock, PulsarContributionConfigurationProperty, PulsarContributionVariant } from "./pulsar";
|
|
4
4
|
import { nullishToOptional } from "../helpers";
|
|
5
5
|
|
|
6
6
|
export const ExporterType = z.enum(["code", "documentation"]);
|
|
@@ -8,24 +8,23 @@ export const ExporterSource = z.enum(["git", "upload"]);
|
|
|
8
8
|
export const ExporterTag = z.string().regex(/^[0-9a-zA-Z]+(\s[0-9a-zA-Z]+)*$/);
|
|
9
9
|
|
|
10
10
|
export const ExporterDetails = z.object({
|
|
11
|
-
packageId: z.string().max(255),
|
|
12
|
-
version: z.string(),
|
|
13
11
|
description: z.string(),
|
|
12
|
+
version: z.string(),
|
|
13
|
+
routingVersion: nullishToOptional(z.string()),
|
|
14
14
|
author: nullishToOptional(z.string()),
|
|
15
15
|
organization: nullishToOptional(z.string()),
|
|
16
16
|
homepage: nullishToOptional(z.string()),
|
|
17
17
|
readme: nullishToOptional(z.string()),
|
|
18
|
-
tags: z.array(ExporterTag).default([]),
|
|
19
|
-
|
|
20
|
-
routingVersion: nullishToOptional(z.string()),
|
|
18
|
+
tags: nullishToOptional(z.array(ExporterTag)).default([]),
|
|
19
|
+
packageId: nullishToOptional(z.string().max(255)),
|
|
21
20
|
|
|
22
21
|
iconURL: nullishToOptional(z.string()),
|
|
23
|
-
configurationProperties: z.array(PulsarContributionConfigurationProperty).default([]),
|
|
24
|
-
customBlocks: z.array(
|
|
25
|
-
blockVariants: z.record(z.string(), z.array(PulsarContributionVariant)).default({}),
|
|
22
|
+
configurationProperties: nullishToOptional(z.array(PulsarContributionConfigurationProperty)).default([]),
|
|
23
|
+
customBlocks: nullishToOptional(z.array(PulsarCustomBlock)).default([]),
|
|
24
|
+
blockVariants: nullishToOptional(z.record(z.string(), z.array(PulsarContributionVariant))).default({}),
|
|
26
25
|
|
|
27
|
-
usesBrands: z.boolean().default(false),
|
|
28
|
-
usesThemes: z.boolean().default(false),
|
|
26
|
+
usesBrands: nullishToOptional(z.boolean()).default(false),
|
|
27
|
+
usesThemes: nullishToOptional(z.boolean()).default(false),
|
|
29
28
|
|
|
30
29
|
source: ExporterSource,
|
|
31
30
|
|
|
@@ -41,8 +40,8 @@ export const Exporter = z.object({
|
|
|
41
40
|
name: z.string(),
|
|
42
41
|
isPrivate: z.boolean(),
|
|
43
42
|
details: ExporterDetails,
|
|
44
|
-
exporterType: ExporterType.default("code"),
|
|
45
|
-
storagePath: z.string().default(""),
|
|
43
|
+
exporterType: nullishToOptional(ExporterType).default("code"),
|
|
44
|
+
storagePath: nullishToOptional(z.string()).default(""),
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
export type ExporterType = z.infer<typeof ExporterType>;
|
package/src/codegen/pulsar.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { nullishToOptional } from "../helpers";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
isDefault: z.boolean().optional(),
|
|
7
|
-
description: z.string().optional(),
|
|
8
|
-
thumbnailURL: z.string().optional(),
|
|
9
|
-
});
|
|
10
|
-
export type PulsarContributionVariant = z.infer<typeof PulsarContributionVariant>;
|
|
4
|
+
//
|
|
5
|
+
// Base
|
|
6
|
+
//
|
|
11
7
|
|
|
12
8
|
export const PulsarPropertyType = z.enum([
|
|
13
9
|
"string",
|
|
@@ -22,38 +18,54 @@ export const PulsarPropertyType = z.enum([
|
|
|
22
18
|
"tokenProperties",
|
|
23
19
|
"tokenType",
|
|
24
20
|
]);
|
|
25
|
-
export type PulsarPropertyType = z.infer<typeof PulsarPropertyType>;
|
|
26
|
-
|
|
27
|
-
// export type PulsarPropertyValueType =
|
|
28
|
-
// | string
|
|
29
|
-
// | number
|
|
30
|
-
// | boolean
|
|
31
|
-
// | PulsarPropertyImageValue
|
|
32
|
-
// | ColorTokenData // TODO: Should we do smth here? Update Pulsar to get value?!
|
|
33
|
-
// | TypographyTokenData;
|
|
34
21
|
|
|
35
|
-
export const
|
|
22
|
+
export const PulsarBaseProperty = z.object({
|
|
36
23
|
label: z.string(),
|
|
37
24
|
key: z.string(),
|
|
38
|
-
description: z.string().
|
|
25
|
+
description: z.string().nullish(),
|
|
39
26
|
type: PulsarPropertyType,
|
|
40
|
-
values: z.array(z.string()).
|
|
27
|
+
values: z.array(z.string()).nullish(),
|
|
41
28
|
default: z.union([z.string(), z.boolean(), z.number()]).nullish(), // PulsarPropertyValueType //is optional?
|
|
42
29
|
inputType: z.enum(["code", "plain"]).optional(), //is optional?
|
|
43
|
-
isMultiline: z.boolean().
|
|
30
|
+
isMultiline: z.boolean().nullish(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//
|
|
34
|
+
// Exporter custom properties
|
|
35
|
+
//
|
|
36
|
+
|
|
37
|
+
export const PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({
|
|
38
|
+
category: z.string(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//
|
|
42
|
+
// Exporter custom blocks
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
export const PulsarContributionVariant = z.object({
|
|
46
|
+
key: z.string(),
|
|
47
|
+
name: z.string(),
|
|
48
|
+
isDefault: z.boolean().nullish(),
|
|
49
|
+
description: z.string().nullish(),
|
|
50
|
+
thumbnailURL: z.string().nullish(),
|
|
44
51
|
});
|
|
45
|
-
export type BasePulsarProperty = z.infer<typeof BasePulsarProperty>;
|
|
46
52
|
|
|
47
|
-
export const
|
|
53
|
+
export const PulsarCustomBlock = z.object({
|
|
48
54
|
title: z.string(),
|
|
49
55
|
key: z.string(),
|
|
50
56
|
category: z.string(),
|
|
51
|
-
description: z.string()
|
|
57
|
+
description: nullishToOptional(z.string()),
|
|
52
58
|
iconURL: z.string(),
|
|
53
59
|
mode: z.enum(["array", "block"]),
|
|
54
|
-
properties: z.array(
|
|
60
|
+
properties: z.array(PulsarBaseProperty),
|
|
55
61
|
});
|
|
56
|
-
export type PulsarContributionBlock = z.infer<typeof PulsarContributionBlock>;
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
//
|
|
64
|
+
// Types
|
|
65
|
+
//
|
|
66
|
+
|
|
67
|
+
export type PulsarContributionVariant = z.infer<typeof PulsarContributionVariant>;
|
|
68
|
+
export type PulsarPropertyType = z.infer<typeof PulsarPropertyType>;
|
|
69
|
+
export type PulsarBaseProperty = z.infer<typeof PulsarBaseProperty>;
|
|
70
|
+
export type PulsarCustomBlock = z.infer<typeof PulsarCustomBlock>;
|
|
59
71
|
export type PulsarContributionConfigurationProperty = z.infer<typeof PulsarContributionConfigurationProperty>;
|
package/src/dsm/design-system.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Workspace } from "../workspace";
|
|
3
|
+
import { nullishToOptional } from "../helpers";
|
|
4
|
+
|
|
3
5
|
export const DesignSystemSwitcher = z.object({
|
|
4
6
|
isEnabled: z.boolean(),
|
|
5
|
-
designSystemIds: z.string(),
|
|
7
|
+
designSystemIds: z.array(z.string()),
|
|
6
8
|
});
|
|
7
9
|
|
|
8
10
|
export const DesignSystem = z.object({
|
|
@@ -10,15 +12,15 @@ export const DesignSystem = z.object({
|
|
|
10
12
|
workspaceId: z.string(),
|
|
11
13
|
name: z.string(),
|
|
12
14
|
description: z.string(),
|
|
13
|
-
docExporterId: z.string()
|
|
15
|
+
docExporterId: nullishToOptional(z.string()),
|
|
14
16
|
docSlug: z.string(),
|
|
15
|
-
docUserSlug: z.string()
|
|
17
|
+
docUserSlug: nullishToOptional(z.string()),
|
|
16
18
|
docSlugDeprecated: z.string(),
|
|
17
19
|
isPublic: z.boolean(),
|
|
18
20
|
isMultibrand: z.boolean(),
|
|
19
|
-
docViewUrl: z.string()
|
|
21
|
+
docViewUrl: nullishToOptional(z.string()),
|
|
20
22
|
basePrefixes: z.array(z.string()),
|
|
21
|
-
designSystemSwitcher: DesignSystemSwitcher
|
|
23
|
+
designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
|
|
22
24
|
createdAt: z.date(),
|
|
23
25
|
updatedAt: z.date(),
|
|
24
26
|
});
|
|
@@ -22,7 +22,7 @@ export const PageBlockCategory = z.enum([
|
|
|
22
22
|
"Other",
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
export const PageBlockBehaviorDataType = z.enum(["Item", "Token", "Asset", "Component", "
|
|
25
|
+
export const PageBlockBehaviorDataType = z.enum(["Item", "Token", "Asset", "Component", "FigmaNode"]);
|
|
26
26
|
export const PageBlockBehaviorSelectionType = z.enum(["Entity", "Group", "EntityAndGroup"]);
|
|
27
27
|
|
|
28
28
|
export type PageBlockCategory = z.infer<typeof PageBlockCategory>;
|
|
@@ -60,6 +60,8 @@ export const PageBlockDefinitionTextPropertyStyle = z.enum([
|
|
|
60
60
|
"SmallSemibold",
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
|
+
export const PageBlockDefinitionTextPropertyColor = z.enum(["Neutral", "NeutralFaded"]);
|
|
64
|
+
|
|
63
65
|
export const PageBlockDefinitionBooleanPropertyStyle = z.enum(["SegmentedControl", "ToggleButton", "Checkbox"]);
|
|
64
66
|
export const PageBlockDefinitionSingleSelectPropertyStyle = z.enum([
|
|
65
67
|
"SegmentedControl",
|
|
@@ -69,28 +71,100 @@ export const PageBlockDefinitionSingleSelectPropertyStyle = z.enum([
|
|
|
69
71
|
]);
|
|
70
72
|
export const PageBlockDefinitionMultiSelectPropertyStyle = z.enum(["SegmentedControl", "Select", "Checkbox"]);
|
|
71
73
|
|
|
74
|
+
export const PageBlockDefinitionImageAspectRatio = z.enum(["Auto", "Square", "Landscape", "Portrait", "Wide"]);
|
|
75
|
+
|
|
76
|
+
export const PageBlockDefinitionImageWidth = z.enum(["Full", "Icon", "Small", "Medium", "Large", "Poster"]);
|
|
77
|
+
|
|
72
78
|
export type PageBlockDefinitionPropertyType = z.infer<typeof PageBlockDefinitionPropertyType>;
|
|
73
79
|
export type PageBlockDefinitionRichTextPropertyStyle = z.infer<typeof PageBlockDefinitionRichTextPropertyStyle>;
|
|
74
80
|
export type PageBlockDefinitionMultiRichTextPropertyStyle = z.infer<
|
|
75
81
|
typeof PageBlockDefinitionMultiRichTextPropertyStyle
|
|
76
82
|
>;
|
|
77
83
|
export type PageBlockDefinitionTextPropertyStyle = z.infer<typeof PageBlockDefinitionTextPropertyStyle>;
|
|
84
|
+
export type PageBlockDefinitionTextPropertyColor = z.infer<typeof PageBlockDefinitionTextPropertyColor>;
|
|
78
85
|
export type PageBlockDefinitionBooleanPropertyStyle = z.infer<typeof PageBlockDefinitionBooleanPropertyStyle>;
|
|
79
86
|
export type PageBlockDefinitionSingleSelectPropertyStyle = z.infer<typeof PageBlockDefinitionSingleSelectPropertyStyle>;
|
|
80
87
|
export type PageBlockDefinitionMultiSelectPropertyStyle = z.infer<typeof PageBlockDefinitionMultiSelectPropertyStyle>;
|
|
88
|
+
export type PageBlockDefinitionImageAspectRatio = z.infer<typeof PageBlockDefinitionImageAspectRatio>;
|
|
89
|
+
export type PageBlockDefinitionImageWidth = z.infer<typeof PageBlockDefinitionImageWidth>;
|
|
81
90
|
|
|
82
91
|
//
|
|
83
|
-
//
|
|
92
|
+
// Aux
|
|
93
|
+
//
|
|
94
|
+
|
|
95
|
+
export const PageBlockDefinitionSelectChoice = z.object({
|
|
96
|
+
value: z.string(),
|
|
97
|
+
name: z.string(),
|
|
98
|
+
icon: z.string().optional(),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export type PageBlockDefinitionSelectChoice = z.infer<typeof PageBlockDefinitionSelectChoice>;
|
|
102
|
+
|
|
84
103
|
//
|
|
104
|
+
// Property options
|
|
105
|
+
//
|
|
106
|
+
|
|
107
|
+
export const PageBlockDefinitionUntypedPropertyOptions = z.record(z.any());
|
|
108
|
+
|
|
109
|
+
export const PageBlockDefinitionRichTextOptions = z.object({
|
|
110
|
+
richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional(),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export const PageBlockDefinitionMutiRichTextOptions = z.object({
|
|
114
|
+
multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional(),
|
|
115
|
+
});
|
|
85
116
|
|
|
86
|
-
export const
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
117
|
+
export const PageBlockDefinitionTextOptions = z.object({
|
|
118
|
+
placeholder: z.string().optional(),
|
|
119
|
+
defaultValue: z.string().optional(),
|
|
120
|
+
textStyle: PageBlockDefinitionTextPropertyStyle.optional(),
|
|
121
|
+
color: PageBlockDefinitionTextPropertyColor.optional(),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const PageBlockDefinitionSelectOptions = z.object({
|
|
125
|
+
singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),
|
|
126
|
+
defaultChoice: z.string(),
|
|
127
|
+
choices: z.array(PageBlockDefinitionSelectChoice),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const PageBlockDefinitionImageOptions = z.object({
|
|
131
|
+
width: PageBlockDefinitionImageWidth.optional(),
|
|
132
|
+
aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),
|
|
133
|
+
allowCaption: z.boolean().optional(),
|
|
134
|
+
recommendation: z.string().optional(),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const PageBlockDefinitionBooleanOptions = z.object({
|
|
138
|
+
defaultvalue: z.boolean().optional(),
|
|
139
|
+
booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional(),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export const PageBlockDefinitionNumberOptions = z.object({
|
|
143
|
+
defaultValue: z.number(),
|
|
144
|
+
min: z.number().optional(),
|
|
145
|
+
max: z.number().optional(),
|
|
146
|
+
step: z.number().optional(),
|
|
147
|
+
placeholder: z.string().optional(),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export const PageBlockDefinitionComponentOptions = z.object({
|
|
151
|
+
renderLayoutAs: z.enum(["List", "Table"]).optional(),
|
|
152
|
+
allowPropertySelection: z.boolean().optional(),
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export type PageBlockDefinitionUntypedPropertyOptions = z.infer<typeof PageBlockDefinitionUntypedPropertyOptions>;
|
|
156
|
+
export type PageBlockDefinitionRichTextOptions = z.infer<typeof PageBlockDefinitionRichTextOptions>;
|
|
157
|
+
export type PageBlockDefinitionMutiRichTextOptions = z.infer<typeof PageBlockDefinitionMutiRichTextOptions>;
|
|
158
|
+
export type PageBlockDefinitionTextOptions = z.infer<typeof PageBlockDefinitionTextOptions>;
|
|
159
|
+
export type PageBlockDefinitionSelectOptions = z.infer<typeof PageBlockDefinitionSelectOptions>;
|
|
160
|
+
export type PageBlockDefinitionImageOptions = z.infer<typeof PageBlockDefinitionImageOptions>;
|
|
161
|
+
export type PageBlockDefinitionBooleanOptions = z.infer<typeof PageBlockDefinitionBooleanOptions>;
|
|
162
|
+
export type PageBlockDefinitionNumberOptions = z.infer<typeof PageBlockDefinitionNumberOptions>;
|
|
163
|
+
export type PageBlockDefinitionComponentOptions = z.infer<typeof PageBlockDefinitionComponentOptions>;
|
|
164
|
+
|
|
165
|
+
//
|
|
166
|
+
// Definitions
|
|
167
|
+
//
|
|
94
168
|
|
|
95
169
|
export const PageBlockDefinitionProperty = z.object({
|
|
96
170
|
id: z.string(),
|
|
@@ -98,8 +172,8 @@ export const PageBlockDefinitionProperty = z.object({
|
|
|
98
172
|
type: PageBlockDefinitionPropertyType,
|
|
99
173
|
description: z.string().optional(),
|
|
100
174
|
// TODO Docs
|
|
101
|
-
options:
|
|
102
|
-
variantOptions: z.record(
|
|
175
|
+
options: PageBlockDefinitionUntypedPropertyOptions.optional(),
|
|
176
|
+
variantOptions: z.record(PageBlockDefinitionUntypedPropertyOptions).optional(),
|
|
103
177
|
});
|
|
104
178
|
|
|
105
179
|
export const PageBlockDefinitionItem = z.object({
|
|
@@ -109,6 +183,5 @@ export const PageBlockDefinitionItem = z.object({
|
|
|
109
183
|
defaultVariantKey: z.string(),
|
|
110
184
|
});
|
|
111
185
|
|
|
112
|
-
export type PageBlockDefinitionPropertyOptions = z.infer<typeof PageBlockDefinitionPropertyOptions>;
|
|
113
186
|
export type PageBlockDefinitionProperty = z.infer<typeof PageBlockDefinitionProperty>;
|
|
114
187
|
export type PageBlockDefinitionItem = z.infer<typeof PageBlockDefinitionItem>;
|
|
@@ -242,6 +242,8 @@ export type PageBlockFrameOrigin = z.infer<typeof PageBlockFrameOrigin>;
|
|
|
242
242
|
export type PageBlockAsset = z.infer<typeof PageBlockAsset>;
|
|
243
243
|
export type PageBlockTableColumn = z.infer<typeof PageBlockTableColumn>;
|
|
244
244
|
export type PageBlockTheme = z.infer<typeof PageBlockTheme>;
|
|
245
|
+
export type PageBlockShortcut = z.infer<typeof PageBlockShortcut>;
|
|
246
|
+
export type PageBlockCustomBlockPropertyValue = z.infer<typeof PageBlockCustomBlockPropertyValue>;
|
|
245
247
|
|
|
246
248
|
//
|
|
247
249
|
// Block
|
|
@@ -9,7 +9,7 @@ import { DesignTokenType } from "../raw-element";
|
|
|
9
9
|
//
|
|
10
10
|
|
|
11
11
|
export const PageBlockLinkType = z.enum(["DocumentationItem", "PageHeading", "Url"]);
|
|
12
|
-
export const PageBlockImageType = z.enum(["Upload", "Asset", "
|
|
12
|
+
export const PageBlockImageType = z.enum(["Upload", "Asset", "FigmaNode"]);
|
|
13
13
|
export const PageBlockImageAlignment = z.enum(["Left", "Center", "Stretch"]);
|
|
14
14
|
export const PageBlockTableCellAlignment = z.enum(["Left", "Center", "Right"]);
|
|
15
15
|
export const PageBlockPreviewContainerSize = z.enum(["Centered", "NaturalHeight"]);
|
|
@@ -152,6 +152,24 @@ export const PageBlockItemEmbedValue = z.object({
|
|
|
152
152
|
height: z.number().optional(),
|
|
153
153
|
});
|
|
154
154
|
|
|
155
|
+
export const PageBlockItemFigmaNodeValue = z.object({
|
|
156
|
+
selectedPropertyIds: z.array(z.string()).optional(),
|
|
157
|
+
showSearch: z.boolean().optional(),
|
|
158
|
+
previewContainerSize: PageBlockPreviewContainerSize.optional(),
|
|
159
|
+
backgroundColor: z.string().optional(),
|
|
160
|
+
value: z.array(
|
|
161
|
+
z.object({
|
|
162
|
+
entityId: z.string(),
|
|
163
|
+
entityMeta: z
|
|
164
|
+
.object({
|
|
165
|
+
title: z.string().optional(),
|
|
166
|
+
description: z.string().optional(),
|
|
167
|
+
})
|
|
168
|
+
.optional(),
|
|
169
|
+
})
|
|
170
|
+
),
|
|
171
|
+
});
|
|
172
|
+
|
|
155
173
|
export const PageBlockItemImageValue = z.object({
|
|
156
174
|
alt: z.string().optional(),
|
|
157
175
|
caption: z.string().optional(),
|
|
@@ -238,6 +256,7 @@ export type PageBlockItemComponentValue = z.infer<typeof PageBlockItemComponentV
|
|
|
238
256
|
export type PageBlockItemComponentPropertyValue = z.infer<typeof PageBlockItemComponentPropertyValue>;
|
|
239
257
|
export type PageBlockItemDividerValue = z.infer<typeof PageBlockItemDividerValue>;
|
|
240
258
|
export type PageBlockItemEmbedValue = z.infer<typeof PageBlockItemEmbedValue>;
|
|
259
|
+
export type PageBlockItemFigmaNodeValue = z.infer<typeof PageBlockItemFigmaNodeValue>;
|
|
241
260
|
export type PageBlockItemImageValue = z.infer<typeof PageBlockItemImageValue>;
|
|
242
261
|
export type PageBlockItemMarkdownValue = z.infer<typeof PageBlockItemMarkdownValue>;
|
|
243
262
|
export type PageBlockItemMultiRichTextValue = z.infer<typeof PageBlockItemMultiRichTextValue>;
|