@supernova-studio/supernova-sdk-beta 1.6.31 → 1.6.33
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/build/sdk-typescript/.eslintrc.d.cts +41 -0
- package/build/sdk-typescript/src/core/SDKSupernova.d.ts +4 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaAutomation.d.ts +1 -14
- package/build/sdk-typescript/src/core/areas/SDKAreaDocumentation.d.ts +34 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaMultiplayer.d.ts +10 -0
- package/build/sdk-typescript/src/core/areas/SDKAreaResources.d.ts +6 -2
- package/build/sdk-typescript/src/core/data/SDKDataBridge.d.ts +4 -1
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +18 -19
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreReadRequests.d.ts +7 -7
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +9 -8
- package/build/sdk-typescript/src/core/resolvers/SDKAssetGroupResolver.d.ts +4 -0
- package/build/sdk-typescript/src/core/resolvers/SDKTokenResolver.d.ts +1 -1
- package/build/sdk-typescript/src/exports.d.ts +9 -1
- package/build/sdk-typescript/src/model/docs/blocks/definition/SDKDocsBlockBehavior.d.ts +2 -11
- package/build/sdk-typescript/src/model/docs/blocks/definition/SDKDocsBlockDefinition.d.ts +5 -21
- package/build/sdk-typescript/src/model/docs/blocks/definition/SDKDocsBlockItemDefinition.d.ts +3 -10
- package/build/sdk-typescript/src/model/docs/blocks/definition/SDKDocsBlockLayout.d.ts +2 -7
- package/build/sdk-typescript/src/model/docs/blocks/definition/SDKDocsBlockVariant.d.ts +2 -15
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockAssetProperty.d.ts +1 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockBooleanProperty.d.ts +1 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockCodeSandboxProperty.d.ts +2 -2
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockColorProperty.d.ts +13 -0
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockComponentProperty.d.ts +2 -2
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockMultiRichTextProperty.d.ts +19 -0
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockMultiSelectProperty.d.ts +1 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockProperty.d.ts +2 -10
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockRichTextProperty.d.ts +3 -3
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockSingleSelectProperty.d.ts +1 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockStorybookProperty.d.ts +10 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockTableProperty.d.ts +23 -2
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockTextProperty.d.ts +1 -1
- package/build/sdk-typescript/src/model/docs/blocks/properties/SDKDocsBlockTokenProperty.d.ts +2 -2
- package/build/sdk-typescript/src/model/docs/blocks/support/SDKDocsImageRef.d.ts +5 -2
- package/build/sdk-typescript/src/model/docs/blocks/support/SDKDocsLinkRef.d.ts +10 -7
- package/build/sdk-typescript/src/model/docs/blocks/usage/SDKDocsBlock.d.ts +7 -20
- package/build/sdk-typescript/src/model/docs/blocks/usage/SDKDocsBlockItem.d.ts +2 -7
- package/build/sdk-typescript/src/model/docs/entities/SDKDocsEntityHeader.d.ts +3 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationLegacyPageAsset.d.ts +1 -1
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationLegacyPageBlockRenderCode.d.ts +1 -1
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockItemPropertyType.d.ts +5 -1
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockItemVariantLayoutAlign.d.ts +3 -3
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockItemVariantLayoutColumnResizing.d.ts +2 -2
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockItemVariantLayoutGap.d.ts +4 -4
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockMultiRichTextPropertyStyle.d.ts +8 -0
- package/build/sdk-typescript/src/model/enums/SDKDocsBlockRichTextPropertyStyle.d.ts +0 -4
- package/build/sdk-typescript/src/model/enums/SDKDocsPublishStatus.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKTokenType.d.ts +19 -19
- package/build/sdk-typescript/src/model/enums/SDKUserRole.d.ts +2 -2
- package/build/sdk-typescript/src/model/exporters/exporter_builds/SDKExportBuild.d.ts +6 -0
- package/build/sdk-typescript/src/model/exporters/exporter_builds/SDKExportBuildResults.d.ts +12 -0
- package/build/sdk-typescript/src/model/exporters/exporter_builds/SDKExportDestinations.d.ts +16 -1
- package/build/sdk-typescript/src/model/exporters/remote/SDKRemoteConnectionsModel.d.ts +1 -1
- package/build/sdk-typescript/src/model/groups/SDKAssetGroup.d.ts +4 -0
- package/build/sdk-typescript/src/model/resources/SDKResourceFont.d.ts +2 -2
- package/build/sdk-typescript/src/model/support/SDKFigmaFrame.d.ts +2 -0
- package/build/sdk-typescript/src/model/support/SDKSource.d.ts +10 -4
- package/build/sdk-typescript/src/model/support/SDKTokenOrigin.d.ts +1 -1
- package/build/sdk-typescript/src/model/themes/SDKTokenTheme.d.ts +6 -6
- package/build/sdk-typescript/src/model/themes/SDKTokenThemeOverride.d.ts +6 -6
- package/build/sdk-typescript/src/model/tokens/SDKColorToken.d.ts +1 -0
- package/build/sdk-typescript/src/model/tokens/SDKDimensionToken.d.ts +1 -1
- package/build/sdk-typescript/src/model/tokens/SDKStringToken.d.ts +1 -1
- package/build/sdk-typescript/src/model/tokens/SDKTextCaseToken.d.ts +1 -1
- package/build/sdk-typescript/src/model/tokens/SDKTextDecorationToken.d.ts +1 -1
- package/build/sdk-typescript/src/model/tokens/SDKTokenValue.d.ts +2 -2
- package/build/sdk-typescript/src/tests/FigmaTokensDataLoader.d.ts +3 -3
- package/build/sdk-typescript/src/tools/design-tokens/SDKToolsDesignTokensPlugin.d.ts +2 -1
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONParser.d.ts +1 -1
- package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTGroupTree.d.ts +1 -1
- package/build/sdk-typescript/src/tools/docs-block-builder/SDKDocsBlockBuilder.d.ts +11 -0
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementFigmaTokensTransformer.d.ts +1 -1
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +1 -1
- package/build/sdk-typescript/src/tools/token-preview/TokenUtilPreviewGenerator.d.ts +4 -1
- package/build/sdk-typescript/src/tools/token-preview/TokenUtilPreviewStyleGenerator.d.ts +4 -1
- package/build/sdk-typescript/src/utils/CommonUtils.d.ts +5 -0
- package/build/sdk-typescript/src/utils/TokenUtils.d.ts +3 -3
- package/build/sdk-typescript/src/utils/deepPartial.d.ts +3 -0
- package/build/supernova-sdk-typescript.js +1 -1
- package/build/supernova-sdk-typescript.js.LICENSE.txt +0 -14
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/package.json +122 -118
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DesignComponentGroupRemoteModel } from "./SDKDesignComponentGroup";
|
|
2
2
|
export declare class AssetGroup {
|
|
3
3
|
id: string;
|
|
4
|
+
persistentId: string;
|
|
4
5
|
brandId: string;
|
|
5
6
|
name: string;
|
|
6
7
|
description: string;
|
|
@@ -12,6 +13,9 @@ export declare class AssetGroup {
|
|
|
12
13
|
parentGroupId: string | null;
|
|
13
14
|
createdAt: Date | null;
|
|
14
15
|
updatedAt: Date | null;
|
|
16
|
+
isAssetGroup: boolean;
|
|
17
|
+
sourceId: string | null;
|
|
18
|
+
sourceName: string | null;
|
|
15
19
|
constructor(model: DesignComponentGroupRemoteModel);
|
|
16
20
|
addChild(groupId: string): void;
|
|
17
21
|
addChildren(groupsIds: Array<string>): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Resource, ResourceModel, ResourceType } from "./SDKResource";
|
|
2
2
|
export type ResourceFontModel = ResourceModel & {
|
|
3
|
-
fontProperties?: {
|
|
3
|
+
fontProperties?: Array<{
|
|
4
4
|
family?: string;
|
|
5
5
|
subfamily?: string;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
7
7
|
};
|
|
8
8
|
export declare class ResourceFont extends Resource {
|
|
9
9
|
type: ResourceType;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ImportWarningType } from "../enums/SDKCloudWarningType";
|
|
2
2
|
import { SourceType } from "../enums/SDKSourceType";
|
|
3
|
+
declare enum SourceRemoteType {
|
|
4
|
+
figma = "Figma",
|
|
5
|
+
tokenStudio = "TokenStudio",
|
|
6
|
+
figmaVariablesPlugin = "FigmaVariablesPlugin",
|
|
7
|
+
upload = "Upload"
|
|
8
|
+
}
|
|
3
9
|
export type SourceRemoteModel = {
|
|
4
|
-
type:
|
|
10
|
+
type: SourceRemoteType;
|
|
5
11
|
id: string;
|
|
6
12
|
fileName?: string;
|
|
7
|
-
linkType: "Design" | "Frames";
|
|
8
13
|
brandId?: string;
|
|
9
14
|
plugin?: {
|
|
10
15
|
fileId: string;
|
|
@@ -100,6 +105,7 @@ export type SourceRemoteModelTokensStudio = {
|
|
|
100
105
|
export type SourceRemoteModelFigmaVariablesPlugin = {
|
|
101
106
|
fileId: string;
|
|
102
107
|
lastImportedAt?: string;
|
|
108
|
+
lastImportMetadata?: Record<string, any>;
|
|
103
109
|
};
|
|
104
110
|
export type SourceModelTokenStudio = Omit<SourceRemoteModelTokensStudio, "lastUpdatesCheckedAt" | "lastImportedAt"> & {
|
|
105
111
|
lastUpdatesCheckedAt?: Date;
|
|
@@ -112,14 +118,13 @@ export type SourceModelCloud = Omit<SourceRemoteModelCloud, "lastUpdatesCheckedA
|
|
|
112
118
|
export type SourceModelFigmaVariablesPlugin = Omit<SourceRemoteModelFigmaVariablesPlugin, "lastImportedAt"> & {
|
|
113
119
|
lastImportedAt?: Date;
|
|
114
120
|
};
|
|
115
|
-
export type SourceTransportModel = Pick<Source, "type" | "id" | "fileName" | "
|
|
121
|
+
export type SourceTransportModel = Pick<Source, "type" | "id" | "fileName" | "brandId" | "scope"> & {
|
|
116
122
|
cloud?: SourceRemoteModelCloud | null;
|
|
117
123
|
};
|
|
118
124
|
export declare class Source {
|
|
119
125
|
type: SourceType;
|
|
120
126
|
id: string;
|
|
121
127
|
fileName: string | null;
|
|
122
|
-
linkType: "Design" | "Frames";
|
|
123
128
|
brandId: string | null;
|
|
124
129
|
cloud: SourceModelCloud | null;
|
|
125
130
|
tokenStudio?: SourceModelTokenStudio | null;
|
|
@@ -139,3 +144,4 @@ export declare class Source {
|
|
|
139
144
|
/** Reconstructs class from the transport model */
|
|
140
145
|
static fromTransport(model: SourceTransportModel): SourceRemoteModel;
|
|
141
146
|
}
|
|
147
|
+
export {};
|
|
@@ -34,22 +34,22 @@ export declare class TokenTheme {
|
|
|
34
34
|
private tokensToOverrides;
|
|
35
35
|
toWriteOverrideObject(token: Token): TokenThemeOverrideRemoteModel;
|
|
36
36
|
valueToWriteObject(value: AnyTokenValue, type: TokenType, token: AnyToken): import("../tokens/remote/SDKRemoteTokenData").ShadowTokenRemoteData | import("../tokens/remote/SDKRemoteTokenData").GradientTokenRemoteData | {
|
|
37
|
-
aliasTo: string;
|
|
37
|
+
aliasTo: string | undefined;
|
|
38
38
|
value: import("../tokens/remote/SDKRemoteTokenValue").BlurTokenRemoteValue;
|
|
39
39
|
} | {
|
|
40
|
-
aliasTo: string;
|
|
40
|
+
aliasTo: string | undefined;
|
|
41
41
|
value: import("../tokens/remote/SDKRemoteTokenValue").BorderTokenRemoteValue;
|
|
42
42
|
} | {
|
|
43
|
-
aliasTo: string;
|
|
43
|
+
aliasTo: string | undefined;
|
|
44
44
|
value: import("../tokens/remote/SDKRemoteTokenValue").ColorTokenRemoteValue;
|
|
45
45
|
} | {
|
|
46
|
-
aliasTo: string;
|
|
46
|
+
aliasTo: string | undefined;
|
|
47
47
|
value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
|
|
48
48
|
} | {
|
|
49
|
-
aliasTo: string;
|
|
49
|
+
aliasTo: string | undefined;
|
|
50
50
|
value: string;
|
|
51
51
|
} | {
|
|
52
|
-
aliasTo: string;
|
|
52
|
+
aliasTo: string | undefined;
|
|
53
53
|
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
@@ -20,22 +20,22 @@ export declare class TokenThemeOverride {
|
|
|
20
20
|
constructor(model: TokenThemeOverrideRemoteModel, value: AnyTokenValue);
|
|
21
21
|
toWriteObject(): TokenThemeOverrideRemoteModel;
|
|
22
22
|
valueToWriteObject(value: AnyTokenValue, type: TokenType): ShadowTokenRemoteData | GradientTokenRemoteData | {
|
|
23
|
-
aliasTo: string;
|
|
23
|
+
aliasTo: string | undefined;
|
|
24
24
|
value: import("../tokens/remote/SDKRemoteTokenValue").BlurTokenRemoteValue;
|
|
25
25
|
} | {
|
|
26
|
-
aliasTo: string;
|
|
26
|
+
aliasTo: string | undefined;
|
|
27
27
|
value: import("../tokens/remote/SDKRemoteTokenValue").BorderTokenRemoteValue;
|
|
28
28
|
} | {
|
|
29
|
-
aliasTo: string;
|
|
29
|
+
aliasTo: string | undefined;
|
|
30
30
|
value: import("../tokens/remote/SDKRemoteTokenValue").ColorTokenRemoteValue;
|
|
31
31
|
} | {
|
|
32
|
-
aliasTo: string;
|
|
32
|
+
aliasTo: string | undefined;
|
|
33
33
|
value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
|
|
34
34
|
} | {
|
|
35
|
-
aliasTo: string;
|
|
35
|
+
aliasTo: string | undefined;
|
|
36
36
|
value: string;
|
|
37
37
|
} | {
|
|
38
|
-
aliasTo: string;
|
|
38
|
+
aliasTo: string | undefined;
|
|
39
39
|
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -18,6 +18,7 @@ export declare class ColorToken extends Token {
|
|
|
18
18
|
static colorValueFromDefinitionOrReference(definition: string | object, referenceResolver: DTTokenReferenceResolver): ColorTokenValue | undefined;
|
|
19
19
|
toHex6(): string;
|
|
20
20
|
toHex8(): string;
|
|
21
|
+
static hexToColorValue(hex: string): ColorTokenValue;
|
|
21
22
|
static colorValueToHex6(value: ColorTokenValue): string;
|
|
22
23
|
static colorValueToHex8(value: ColorTokenValue): string;
|
|
23
24
|
/** Normalizes any color value to server readable value, and ignores alpha value optionally */
|
|
@@ -75,7 +75,7 @@ export declare class ZIndexToken extends DimensionCategoryToken<ZIndexTokenValue
|
|
|
75
75
|
tokenType: TokenType.zIndex;
|
|
76
76
|
}
|
|
77
77
|
export type AnyDimensionToken = DimensionToken | SizeToken | SpaceToken | OpacityToken | FontSizeToken | LineHeightToken | LetterSpacingToken | ParagraphSpacingToken | BorderWidthToken | RadiusToken | DurationToken | ZIndexToken;
|
|
78
|
-
export declare const resolveDimension: <TK extends TokenType.
|
|
78
|
+
export declare const resolveDimension: <TK extends TokenType.radius | TokenType.borderWidth | TokenType.duration | TokenType.fontSize | TokenType.dimension | TokenType.letterSpacing | TokenType.lineHeight | TokenType.opacity | TokenType.paragraphSpacing | TokenType.size | TokenType.space | TokenType.zIndex>(type: TK) => {
|
|
79
79
|
Color: typeof import("./SDKColorToken").ColorToken;
|
|
80
80
|
Typography: typeof import("./SDKTypographyToken").TypographyToken;
|
|
81
81
|
Blur: typeof import("./SDKBlurToken").BlurToken;
|
|
@@ -32,7 +32,7 @@ export declare class FontWeightToken extends StringCategoryToken<FontWeightToken
|
|
|
32
32
|
tokenType: TokenType.fontWeight;
|
|
33
33
|
}
|
|
34
34
|
export type AnyStringToken = StringToken | ProductCopyToken | FontFamilyToken | FontWeightToken;
|
|
35
|
-
export declare const resolveString: <TK extends TokenType.
|
|
35
|
+
export declare const resolveString: <TK extends TokenType.fontFamily | TokenType.fontWeight | TokenType.string | TokenType.productCopy>(type: TK) => {
|
|
36
36
|
Color: typeof import("./SDKColorToken").ColorToken;
|
|
37
37
|
Typography: typeof import("./SDKTypographyToken").TypographyToken;
|
|
38
38
|
Blur: typeof import("./SDKBlurToken").BlurToken;
|
|
@@ -13,7 +13,7 @@ export declare class TextCaseToken extends Token {
|
|
|
13
13
|
static create(versionId: string, brandId: string, name: string, description: string, value: string, alias: TextCaseToken | null, properties: Array<ElementProperty>, propertyValues: Array<ElementPropertyValue>): TextCaseToken;
|
|
14
14
|
static textCaseFromDefinition(textCase: string): {
|
|
15
15
|
value: TextCase;
|
|
16
|
-
referencedTokenId:
|
|
16
|
+
referencedTokenId: null;
|
|
17
17
|
};
|
|
18
18
|
toWriteObject(): TextCaseTokenRemoteModel;
|
|
19
19
|
static valueToWriteObject(value: TextCaseTokenValue): {
|
|
@@ -14,7 +14,7 @@ export declare class TextDecorationToken extends Token {
|
|
|
14
14
|
static create(versionId: string, brandId: string, name: string, description: string, value: string, alias: TextDecorationToken | null, properties: Array<ElementProperty>, propertyValues: Array<ElementPropertyValue>): TextDecorationToken;
|
|
15
15
|
static textDecorationFromDefinition(textDecoration: string): {
|
|
16
16
|
value: TextDecoration;
|
|
17
|
-
referencedTokenId:
|
|
17
|
+
referencedTokenId: null;
|
|
18
18
|
};
|
|
19
19
|
static optionValueFromDefinitionOrReference(definition: any, referenceResolver: DTTokenReferenceResolver, tokenType: OptionTokenType): AnyOptionTokenValue;
|
|
20
20
|
static optionValueFromDefinition(definition: string, type: OptionTokenType): AnyOptionTokenValue;
|
|
@@ -192,9 +192,9 @@ export type AnyPlainTokenValue = Exclude<AnyTokenValue, ShadowTokenValue[] | Gra
|
|
|
192
192
|
export type RawValue<T extends {
|
|
193
193
|
referencedTokenId: string;
|
|
194
194
|
}> = Omit<T, "referencedTokenId">;
|
|
195
|
-
export declare const getReferencedTokens: (token: AnyToken, allTokens: Map<string, Token>) => Token[];
|
|
195
|
+
export declare const getReferencedTokens: (token: AnyToken, allTokens: Map<string, Token>) => (Token | undefined)[];
|
|
196
196
|
export declare const getSingleReferencedTokenId: (token: AnyToken, allTokens: Map<string, Token>) => string | undefined;
|
|
197
|
-
export declare const checkSingleReferencedTokenById: (token: AnyToken, candidateId: string, allTokens: Map<string, Token>) => boolean;
|
|
197
|
+
export declare const checkSingleReferencedTokenById: (token: AnyToken, candidateId: string, allTokens: Map<string, Token>) => boolean | "";
|
|
198
198
|
export declare const replaceReferencedTokenIds: (token: AnyToken, currentId: string, newId: string, allTokens: Map<string, Token>) => void;
|
|
199
199
|
export declare const replaceReferencedToken: (token: Token, existingToken: AnyToken, newToken: AnyToken) => void;
|
|
200
200
|
export declare const replaceReferencedTokenByIds: (token: Token, existingTokenId: string, newTokenId: string) => void;
|
|
@@ -10,9 +10,9 @@ export declare class FigmaTokensDataLoader {
|
|
|
10
10
|
settings: DTPluginToSupernovaSettings;
|
|
11
11
|
mapping: {
|
|
12
12
|
supernovaBrand: string;
|
|
13
|
-
supernovaTheme: string;
|
|
14
|
-
tokensTheme: string | string[];
|
|
15
|
-
tokenSets: string[];
|
|
13
|
+
supernovaTheme: string | null;
|
|
14
|
+
tokensTheme: string | string[] | null;
|
|
15
|
+
tokenSets: string[] | null;
|
|
16
16
|
}[];
|
|
17
17
|
payload: object;
|
|
18
18
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Supernova } from "../../core/SDKSupernova";
|
|
2
2
|
import { Brand } from "../../model/base/SDKBrand";
|
|
3
3
|
import { TokenGroup } from "../../model/groups/SDKTokenGroup";
|
|
4
|
+
import { Logger } from "../../model/support/SDKLogger";
|
|
4
5
|
import { TokenTheme } from "../../model/themes/SDKTokenTheme";
|
|
5
6
|
import { Token } from "../../model/tokens/SDKToken";
|
|
6
7
|
import { AnyToken } from "../../model/tokens/SDKTokenValue";
|
|
@@ -25,7 +26,7 @@ export declare class SupernovaToolsDesignTokensPlugin {
|
|
|
25
26
|
private versionId;
|
|
26
27
|
private sortMultiplier;
|
|
27
28
|
private logger;
|
|
28
|
-
constructor(designSystemId: string, versionId: string, instance: Supernova);
|
|
29
|
+
constructor(designSystemId: string, versionId: string, instance: Supernova, logger?: Logger);
|
|
29
30
|
synchronizeTokensFromData(data: object, mapping: DTPluginToSupernovaMapPack, settings: DTPluginToSupernovaSettings): Promise<object>;
|
|
30
31
|
synchronizeTokensFromDataWithResults(data: object, mapping: DTPluginToSupernovaMapPack, settings: DTPluginToSupernovaSettings): Promise<{
|
|
31
32
|
results: SupernovaToolsDesignTokensResult[];
|
|
@@ -7,6 +7,6 @@ export type TokenTreeElement = Token | TokenGroup;
|
|
|
7
7
|
export declare class GroupTree extends GroupTreeNode {
|
|
8
8
|
childType: TokenType;
|
|
9
9
|
constructor(backingElement: TokenTreeElement);
|
|
10
|
-
static populate(root: TokenTreeElement, elements: Array<TokenTreeElement>, parentChildrenMap: Map<string, Array<TokenTreeElement>>): GroupTree;
|
|
10
|
+
static populate(root: TokenTreeElement, elements: Array<TokenTreeElement>, parentChildrenMap: Map<string, Array<TokenTreeElement>>): GroupTree | null;
|
|
11
11
|
}
|
|
12
12
|
export declare function buildBrandedElementRoots(elements: TokenTreeElement[]): Map<string, Map<TokenType, GroupTree>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DocsBlockMultiRichTextPropertyOptions } from "../../exports";
|
|
1
2
|
import { DocsBlockDefinition } from "../../model/docs/blocks/definition/SDKDocsBlockDefinition";
|
|
2
3
|
import { DocsBlockItemDefinition } from "../../model/docs/blocks/definition/SDKDocsBlockItemDefinition";
|
|
3
4
|
import { DocsBlockLayout } from "../../model/docs/blocks/definition/SDKDocsBlockLayout";
|
|
@@ -165,6 +166,16 @@ export declare class DocsBlockBuilder {
|
|
|
165
166
|
[key: string]: DocsBlockRichTextPropertyOptions;
|
|
166
167
|
};
|
|
167
168
|
}): DocsBlockRichTextPropertyDefinition;
|
|
169
|
+
/** Create a block property with type .richText and its specific options */
|
|
170
|
+
multiRichTextProperty(configuration: {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
description?: string;
|
|
174
|
+
options: DocsBlockMultiRichTextPropertyOptions;
|
|
175
|
+
variants?: {
|
|
176
|
+
[key: string]: DocsBlockMultiRichTextPropertyOptions;
|
|
177
|
+
};
|
|
178
|
+
}): DocsBlockRichTextPropertyDefinition;
|
|
168
179
|
/** Create a block property with type .boolean and its specific options */
|
|
169
180
|
booleanProperty(configuration: {
|
|
170
181
|
id: string;
|
|
@@ -23,7 +23,7 @@ export declare class TokenJSONElementFigmaTokensTransformer extends TokenJSONEle
|
|
|
23
23
|
/** Retrieve token wrapper containing its metadata and value information (used as container for each defined token) */
|
|
24
24
|
tokenWrapper(token: Token, value: any, options: TokenJSONBuilderOptionsInternal, groups: Array<TokenGroup>): object;
|
|
25
25
|
/** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
|
|
26
|
-
typeLabelConsideringAbstractGroups(token: Token, groups: Array<TokenGroup>): string;
|
|
26
|
+
typeLabelConsideringAbstractGroups(token: Token, groups: Array<TokenGroup>): string | undefined;
|
|
27
27
|
/** Retrieve wrapper to certain token (referenced by name) pointing to token value */
|
|
28
28
|
referenceWrapper(reference: string): string;
|
|
29
29
|
/** Retrieve safe group name made out of normal group name
|
|
@@ -62,7 +62,7 @@ export declare class TokenJSONElementTransformer {
|
|
|
62
62
|
safeGroupName(group: TokenGroup): string;
|
|
63
63
|
processedName(name: string, naming: JSONBuilderNamingOption): string;
|
|
64
64
|
/** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
|
|
65
|
-
typeLabel(type: TokenType): "color" | "gradient" | "typography" | "border" | "textCase" | "textDecoration" | "visibility" | "shadow" | "measure" | "text";
|
|
65
|
+
typeLabel(type: TokenType): "color" | "gradient" | "typography" | "border" | "textCase" | "textDecoration" | "visibility" | "shadow" | "measure" | "text" | undefined;
|
|
66
66
|
/** Retrieve chain of groups up to a specified group, ordered from parent to children */
|
|
67
67
|
referenceGroupChain(containingGroup: TokenGroup, allGroups: Array<TokenGroup>): Array<TokenGroup>;
|
|
68
68
|
}
|
|
@@ -7,7 +7,10 @@ export declare class TokenUtilPreviewGenerator {
|
|
|
7
7
|
/** Generates metadata required for rendering of the preview. Only usable with Supernova preview */
|
|
8
8
|
static tokenPreviewMetadata(token: Token, allTokens: Map<string, Token>): TokenUtilPreviewMetadata;
|
|
9
9
|
/** Generates style required for rendering of the preview. Only usable with Supernova preview */
|
|
10
|
-
static tokenPreviewStyle(token: Token
|
|
10
|
+
static tokenPreviewStyle(token: Token, overridenStyles?: {
|
|
11
|
+
fontFamily?: string;
|
|
12
|
+
fontWeight?: string;
|
|
13
|
+
}): TokenUtilPreviewResolvedStyle;
|
|
11
14
|
/** Generates adjusted preview type required for rendering of the preview. Only usable with Supernova preview */
|
|
12
15
|
static tokenPreviewType(token: Token): TokenUtilPreviewTokenType;
|
|
13
16
|
/** Generates per-value description of passed token. Only usable with Supernova preview */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Token } from "../../model/tokens/SDKToken";
|
|
2
2
|
import { TokenUtilPreviewResolvedStyle } from "./TokenUtilPreviewTypes";
|
|
3
3
|
export declare class TokenUtilPreviewStyleGenerator {
|
|
4
|
-
resolvedStyleForToken(token: Token
|
|
4
|
+
resolvedStyleForToken(token: Token, overridenStyles?: {
|
|
5
|
+
fontFamily?: string;
|
|
6
|
+
fontWeight?: string;
|
|
7
|
+
}): TokenUtilPreviewResolvedStyle | undefined;
|
|
5
8
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function castEnum<O extends string>(value: `${O}`): O;
|
|
2
|
+
export declare function castOptionalEnum<O extends string>(value: `${O}` | undefined): O | undefined;
|
|
3
|
+
export type NonEmptyArray<T> = [T, ...T[]];
|
|
4
|
+
export declare function sureOf<T>(entity: T | null | undefined): NonNullable<T>;
|
|
5
|
+
export declare function sortUsingMap<T, K>(items: Array<T>, indexes: Map<K, number>, keyFn: (item: T) => K): Array<T>;
|
|
@@ -81,7 +81,7 @@ export declare class TokenUtils {
|
|
|
81
81
|
static tokensToReferenceMap(tokens: Array<Token>): Map<string, Token>;
|
|
82
82
|
/** Map token groups for lookup */
|
|
83
83
|
static tokenGroupsToReferenceMap(groups: Array<TokenGroup>): Map<string, TokenGroup>;
|
|
84
|
-
static lookupReference<T extends Token>(id: string, tokens: Map<string, Token>): T | undefined;
|
|
84
|
+
static lookupReference<T extends Token>(id: string | undefined | null, tokens: Map<string, Token>): T | undefined;
|
|
85
85
|
/** Creates a new token group for a given token type. Default values will be used for all properties */
|
|
86
86
|
static createDefaultTokenGroup(type: TokenType, versionId: string, brandId: string, name?: string): TokenGroup;
|
|
87
87
|
/** Creates a new token theme. Default values will be used for all properties */
|
|
@@ -275,9 +275,9 @@ export declare class TokenUtils {
|
|
|
275
275
|
private static checkNotReference;
|
|
276
276
|
private static rawOrReferencedDimensionValue;
|
|
277
277
|
private static rawOrReferencedStringValue;
|
|
278
|
-
|
|
278
|
+
static validateLayerAccess(token: AnyMultiLayerToken, index: number): void;
|
|
279
279
|
static inlineValueIntoComplexTokens(token: AnyToken, candidateId: string, candidateValueToInline: AnyTokenValue): void;
|
|
280
|
-
static getRefIdsFromComplexTokens(token: AnyToken): string[];
|
|
280
|
+
static getRefIdsFromComplexTokens(token: AnyToken): (string | null | undefined)[];
|
|
281
281
|
static buildKey(path: Array<string>, name: string): string;
|
|
282
282
|
static buildPath(token: Token, groups: Array<TokenGroup>): Array<string>;
|
|
283
283
|
static mapTypeToPrefix: (type: TokenType) => string;
|