@supernova-studio/supernova-sdk-beta 1.6.10
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/LICENSE +21 -0
- package/README.md +144 -0
- package/build/sdk-typescript/src/browser-bundle.d.ts +1 -0
- package/build/sdk-typescript/src/core/SDKBrand.d.ts +80 -0
- package/build/sdk-typescript/src/core/SDKBrandWriter.d.ts +29 -0
- package/build/sdk-typescript/src/core/SDKDesignSystem.d.ts +62 -0
- package/build/sdk-typescript/src/core/SDKDesignSystemVersion.d.ts +99 -0
- package/build/sdk-typescript/src/core/SDKDocumentation.d.ts +55 -0
- package/build/sdk-typescript/src/core/SDKSupernova.d.ts +46 -0
- package/build/sdk-typescript/src/core/SDKWorkspace.d.ts +26 -0
- package/build/sdk-typescript/src/core/data/SDKConfiguration.d.ts +6 -0
- package/build/sdk-typescript/src/core/data/SDKDataBridge.d.ts +50 -0
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +141 -0
- package/build/sdk-typescript/src/core/errors/SDKSupernovaError.d.ts +24 -0
- package/build/sdk-typescript/src/core/resolvers/SDKAssetGroupResolver.d.ts +14 -0
- package/build/sdk-typescript/src/core/resolvers/SDKComponentResolver.d.ts +8 -0
- package/build/sdk-typescript/src/core/resolvers/SDKDesignComponentGroupResolver.d.ts +13 -0
- package/build/sdk-typescript/src/core/resolvers/SDKDocumentationItemResolver.d.ts +32 -0
- package/build/sdk-typescript/src/core/resolvers/SDKTokenGroupResolver.d.ts +11 -0
- package/build/sdk-typescript/src/core/resolvers/SDKTokenResolver.d.ts +76 -0
- package/build/sdk-typescript/src/exports.d.ts +117 -0
- package/build/sdk-typescript/src/index.d.ts +1 -0
- package/build/sdk-typescript/src/model/assets/SDKAsset.d.ts +16 -0
- package/build/sdk-typescript/src/model/assets/SDKRenderedAsset.d.ts +28 -0
- package/build/sdk-typescript/src/model/components/SDKComponent.d.ts +27 -0
- package/build/sdk-typescript/src/model/components/SDKDesignComponent.d.ts +32 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationConfiguration.d.ts +13 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationGroup.d.ts +38 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationItem.d.ts +26 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationPage.d.ts +31 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationPageAsset.d.ts +15 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationPageBlock.d.ts +32 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichText.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichTextSpan.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichTextSpanAttribute.d.ts +14 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockAsset.d.ts +15 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockAssets.d.ts +24 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCallout.d.ts +11 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCode.d.ts +12 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockColumn.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockColumnItem.d.ts +11 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCustom.d.ts +16 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockDivider.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedFigma.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedGeneric.d.ts +15 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedLink.d.ts +16 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedStorybook.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedYoutube.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockFrame.d.ts +18 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockFrames.d.ts +26 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockHeading.d.ts +11 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockImage.d.ts +18 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockOrderedList.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockQuote.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockRenderCode.d.ts +34 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockShortcut.d.ts +35 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockShortcuts.d.ts +11 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTab.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTabItem.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTable.d.ts +23 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableCell.d.ts +13 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableColumn.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableRow.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockText.d.ts +13 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockToken.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTokenGroup.d.ts +12 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTokenList.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockUnorderedList.d.ts +8 -0
- package/build/sdk-typescript/src/model/documentation/builder/SDKDocumentationBlockBuilder.d.ts +6 -0
- package/build/sdk-typescript/src/model/documentation/configuration/SDKDocumentationItemConfiguration.d.ts +10 -0
- package/build/sdk-typescript/src/model/documentation/configuration/SDKDocumentationItemHeader.d.ts +30 -0
- package/build/sdk-typescript/src/model/elements/SDKElementDataView.d.ts +30 -0
- package/build/sdk-typescript/src/model/elements/SDKElementDataViewColumn.d.ts +37 -0
- package/build/sdk-typescript/src/model/elements/SDKElementProperty.d.ts +56 -0
- package/build/sdk-typescript/src/model/elements/SDKElementPropertyOption.d.ts +13 -0
- package/build/sdk-typescript/src/model/elements/values/SDKElementPropertyValue.d.ts +15 -0
- package/build/sdk-typescript/src/model/enums/SDKAlignment.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKAssetFormat.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKAssetScale.d.ts +6 -0
- package/build/sdk-typescript/src/model/enums/SDKAssetScaleType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKBlurType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKBorderPosition.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationCalloutType.d.ts +6 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationGroupBehavior.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationHeadingType.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationItemType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationPageAssetType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationPageBlockThemeType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKDocumentationPageBlockType.d.ts +31 -0
- package/build/sdk-typescript/src/model/enums/SDKFrameAlignment.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKFrameLayout.d.ts +11 -0
- package/build/sdk-typescript/src/model/enums/SDKGradientType.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKRichTextSpanAttributeType.d.ts +7 -0
- package/build/sdk-typescript/src/model/enums/SDKShadowType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKSourceType.d.ts +4 -0
- package/build/sdk-typescript/src/model/enums/SDKTextCase.d.ts +6 -0
- package/build/sdk-typescript/src/model/enums/SDKTextDecoration.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKTokenType.d.ts +13 -0
- package/build/sdk-typescript/src/model/enums/SDKUnit.d.ts +6 -0
- package/build/sdk-typescript/src/model/exporters/SDKExporter.d.ts +74 -0
- package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlock.d.ts +23 -0
- package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlockProperty.d.ts +32 -0
- package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlockVariant.d.ts +12 -0
- package/build/sdk-typescript/src/model/exporters/custom_properties/SDKExporterConfigurationProperty.d.ts +38 -0
- package/build/sdk-typescript/src/model/groups/SDKAssetGroup.d.ts +20 -0
- package/build/sdk-typescript/src/model/groups/SDKDesignComponentGroup.d.ts +33 -0
- package/build/sdk-typescript/src/model/groups/SDKTokenGroup.d.ts +42 -0
- package/build/sdk-typescript/src/model/support/SDKDesignComponentOrigin.d.ts +23 -0
- package/build/sdk-typescript/src/model/support/SDKFrameOrigin.d.ts +25 -0
- package/build/sdk-typescript/src/model/support/SDKSize.d.ts +9 -0
- package/build/sdk-typescript/src/model/support/SDKSource.d.ts +102 -0
- package/build/sdk-typescript/src/model/support/SDKTokenOrigin.d.ts +11 -0
- package/build/sdk-typescript/src/model/support/SDKWorkspaceNPMRegistry.d.ts +13 -0
- package/build/sdk-typescript/src/model/themes/SDKThemeUtilities.d.ts +6 -0
- package/build/sdk-typescript/src/model/themes/SDKTokenTheme.d.ts +63 -0
- package/build/sdk-typescript/src/model/themes/SDKTokenThemeOverride.d.ts +49 -0
- package/build/sdk-typescript/src/model/tokens/SDKBlurToken.d.ts +18 -0
- package/build/sdk-typescript/src/model/tokens/SDKBorderToken.d.ts +19 -0
- package/build/sdk-typescript/src/model/tokens/SDKColorToken.d.ts +22 -0
- package/build/sdk-typescript/src/model/tokens/SDKFontToken.d.ts +16 -0
- package/build/sdk-typescript/src/model/tokens/SDKGenericToken.d.ts +18 -0
- package/build/sdk-typescript/src/model/tokens/SDKGradientToken.d.ts +18 -0
- package/build/sdk-typescript/src/model/tokens/SDKMeasureToken.d.ts +26 -0
- package/build/sdk-typescript/src/model/tokens/SDKRadiusToken.d.ts +18 -0
- package/build/sdk-typescript/src/model/tokens/SDKShadowToken.d.ts +21 -0
- package/build/sdk-typescript/src/model/tokens/SDKTextToken.d.ts +16 -0
- package/build/sdk-typescript/src/model/tokens/SDKToken.d.ts +30 -0
- package/build/sdk-typescript/src/model/tokens/SDKTokenCompator.d.ts +20 -0
- package/build/sdk-typescript/src/model/tokens/SDKTokenValue.d.ts +113 -0
- package/build/sdk-typescript/src/model/tokens/SDKTypographyToken.d.ts +19 -0
- package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenData.d.ts +45 -0
- package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenModel.d.ts +60 -0
- package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenValue.d.ts +72 -0
- package/build/sdk-typescript/src/model/users/SDKUser.d.ts +22 -0
- package/build/sdk-typescript/src/tests/Accessors/Brand.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/Components.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/DesignSystem.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/DesignSystemVersion.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/Documentation.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/Supernova.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/Theme.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Accessors/Workspace.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Tooling/PluginFigmaTokens.spec.d.ts +17 -0
- package/build/sdk-typescript/src/tests/Tooling/PluginJSONBuilder.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Tooling/ToolDocSearch.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/Tooling/ToolMarkdownTransform.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tests/helpers.d.ts +2 -0
- package/build/sdk-typescript/src/tools/design-tokens/SDKToolsDesignTokensPlugin.d.ts +48 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONConverter.d.ts +34 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONGroupBuilder.d.ts +21 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONLoader.d.ts +27 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONParser.d.ts +40 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTMapLoader.d.ts +39 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTMapResolver.d.ts +10 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTThemeMerger.d.ts +17 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenGroupTreeMerger.d.ts +23 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenMerger.d.ts +17 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenReferenceResolver.d.ts +37 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenSetResolver.d.ts +12 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/collection/SDKDTTokenCollection.d.ts +13 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/expression/SDKDTExpressionParser.d.ts +5 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTGroupTree.d.ts +10 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTGroupTreeNode.d.ts +20 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTParentChildMapping.d.ts +5 -0
- package/build/sdk-typescript/src/tools/json-builder/SDKToolsJSONBuilder.d.ts +57 -0
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementFigmaTokensTransformer.d.ts +40 -0
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementStyleDictionaryTransformer.d.ts +29 -0
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +77 -0
- package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransform.d.ts +23 -0
- package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransformBlock.d.ts +75 -0
- package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransformUtil.d.ts +26 -0
- package/build/sdk-typescript/src/tools/search-index/SDKToolsDocSearch.d.ts +47 -0
- package/build/sdk-typescript/src/tools/token-transform/SDKToolsTokenTransform.d.ts +44 -0
- package/build/sdk-typescript/src/utils/FlowUtils.d.ts +5 -0
- package/build/sdk-typescript/src/utils/StringUtils.d.ts +72 -0
- package/build/supernova-sdk-typescript.js +3 -0
- package/build/supernova-sdk-typescript.js.LICENSE.txt +8 -0
- package/build/supernova-sdk-typescript.js.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { BlurType } from '../enums/SDKBlurType';
|
|
2
|
+
import { BorderPosition } from '../enums/SDKBorderPosition';
|
|
3
|
+
import { GradientType } from '../enums/SDKGradientType';
|
|
4
|
+
import { ShadowType } from '../enums/SDKShadowType';
|
|
5
|
+
import { TextCase } from '../enums/SDKTextCase';
|
|
6
|
+
import { TextDecoration } from '../enums/SDKTextDecoration';
|
|
7
|
+
import { TokenType } from '../enums/SDKTokenType';
|
|
8
|
+
import { Unit } from '../enums/SDKUnit';
|
|
9
|
+
import { TokenOrigin } from '../support/SDKTokenOrigin';
|
|
10
|
+
import { BlurToken } from './SDKBlurToken';
|
|
11
|
+
import { BorderToken } from './SDKBorderToken';
|
|
12
|
+
import { ColorToken } from './SDKColorToken';
|
|
13
|
+
import { FontToken } from './SDKFontToken';
|
|
14
|
+
import { GenericToken } from './SDKGenericToken';
|
|
15
|
+
import { GradientToken } from './SDKGradientToken';
|
|
16
|
+
import { MeasureToken } from './SDKMeasureToken';
|
|
17
|
+
import { RadiusToken } from './SDKRadiusToken';
|
|
18
|
+
import { ShadowToken } from './SDKShadowToken';
|
|
19
|
+
import { TextToken } from './SDKTextToken';
|
|
20
|
+
import { TypographyToken } from './SDKTypographyToken';
|
|
21
|
+
export type TokenValue = {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
tokenType: TokenType;
|
|
26
|
+
origin: TokenOrigin | null;
|
|
27
|
+
};
|
|
28
|
+
export type ColorTokenValue = {
|
|
29
|
+
hex: string;
|
|
30
|
+
r: number;
|
|
31
|
+
g: number;
|
|
32
|
+
b: number;
|
|
33
|
+
a: number;
|
|
34
|
+
referencedToken: ColorToken | null;
|
|
35
|
+
};
|
|
36
|
+
export type TypographyTokenValue = {
|
|
37
|
+
font: FontTokenValue;
|
|
38
|
+
fontSize: MeasureTokenValue;
|
|
39
|
+
textDecoration: TextDecoration;
|
|
40
|
+
textCase: TextCase;
|
|
41
|
+
letterSpacing: MeasureTokenValue;
|
|
42
|
+
lineHeight: MeasureTokenValue | null;
|
|
43
|
+
paragraphIndent: MeasureTokenValue;
|
|
44
|
+
paragraphSpacing: MeasureTokenValue;
|
|
45
|
+
referencedToken: TypographyToken | null;
|
|
46
|
+
};
|
|
47
|
+
export type RadiusTokenValue = {
|
|
48
|
+
radius: MeasureTokenValue;
|
|
49
|
+
topLeft: MeasureTokenValue | null;
|
|
50
|
+
topRight: MeasureTokenValue | null;
|
|
51
|
+
bottomLeft: MeasureTokenValue | null;
|
|
52
|
+
bottomRight: MeasureTokenValue | null;
|
|
53
|
+
referencedToken: RadiusToken | null;
|
|
54
|
+
};
|
|
55
|
+
export type ShadowTokenValue = {
|
|
56
|
+
color: ColorTokenValue;
|
|
57
|
+
x: MeasureTokenValue;
|
|
58
|
+
y: MeasureTokenValue;
|
|
59
|
+
radius: MeasureTokenValue;
|
|
60
|
+
spread: MeasureTokenValue;
|
|
61
|
+
opacity: number;
|
|
62
|
+
type: ShadowType;
|
|
63
|
+
referencedToken: ShadowToken | null;
|
|
64
|
+
};
|
|
65
|
+
export type MeasureTokenValue = {
|
|
66
|
+
unit: Unit;
|
|
67
|
+
measure: number;
|
|
68
|
+
referencedToken: MeasureToken | null;
|
|
69
|
+
};
|
|
70
|
+
export type FontTokenValue = {
|
|
71
|
+
family: string;
|
|
72
|
+
subfamily: string;
|
|
73
|
+
referencedToken: FontToken | null;
|
|
74
|
+
};
|
|
75
|
+
export type BorderTokenValue = {
|
|
76
|
+
color: ColorTokenValue;
|
|
77
|
+
width: MeasureTokenValue;
|
|
78
|
+
position: BorderPosition;
|
|
79
|
+
referencedToken: BorderToken | null;
|
|
80
|
+
};
|
|
81
|
+
export type GradientTokenValue = {
|
|
82
|
+
to: {
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
};
|
|
86
|
+
from: {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
};
|
|
90
|
+
type: GradientType;
|
|
91
|
+
aspectRatio: number;
|
|
92
|
+
stops: Array<GradientStopValue>;
|
|
93
|
+
referencedToken: GradientToken | null;
|
|
94
|
+
};
|
|
95
|
+
export type GradientStopValue = {
|
|
96
|
+
position: number;
|
|
97
|
+
color: ColorTokenValue;
|
|
98
|
+
};
|
|
99
|
+
export type TextTokenValue = {
|
|
100
|
+
text: string;
|
|
101
|
+
referencedToken: TextToken;
|
|
102
|
+
};
|
|
103
|
+
export type GenericTokenValue = {
|
|
104
|
+
text: string;
|
|
105
|
+
referencedToken: GenericToken;
|
|
106
|
+
};
|
|
107
|
+
export type BlurTokenValue = {
|
|
108
|
+
type: BlurType;
|
|
109
|
+
radius: MeasureTokenValue;
|
|
110
|
+
referencedToken: BlurToken | null;
|
|
111
|
+
};
|
|
112
|
+
export type AnyTokenValue = ColorTokenValue | TextTokenValue | GenericTokenValue | TypographyTokenValue | RadiusTokenValue | ShadowTokenValue | MeasureTokenValue | FontTokenValue | BorderTokenValue | GradientTokenValue | BlurTokenValue;
|
|
113
|
+
export type AnyToken = ColorToken | TextToken | GenericToken | TypographyToken | RadiusToken | ShadowToken | MeasureToken | FontToken | BorderToken | GradientToken | BlurToken;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Brand, ElementProperty } from '../..';
|
|
2
|
+
import { DesignSystemVersion } from '../../core/SDKDesignSystemVersion';
|
|
3
|
+
import { DTTokenReferenceResolver } from '../../tools/design-tokens/utilities/SDKDTTokenReferenceResolver';
|
|
4
|
+
import { ElementPropertyValue } from '../elements/values/SDKElementPropertyValue';
|
|
5
|
+
import { TokenRemoteModel, TypographyTokenRemoteModel } from './remote/SDKRemoteTokenModel';
|
|
6
|
+
import { TypographyTokenRemoteValue } from './remote/SDKRemoteTokenValue';
|
|
7
|
+
import { Token } from './SDKToken';
|
|
8
|
+
import { TypographyTokenValue } from './SDKTokenValue';
|
|
9
|
+
export declare class TypographyToken extends Token {
|
|
10
|
+
value: TypographyTokenValue;
|
|
11
|
+
constructor(version: DesignSystemVersion, baseToken: TokenRemoteModel, value: TypographyTokenValue, alias: TypographyToken | null, properties: Array<ElementProperty>, propertyValues: Array<ElementPropertyValue>);
|
|
12
|
+
static create(version: DesignSystemVersion, brand: Brand, name: string, description: string, value: object, alias: TypographyToken | null, referenceResolver: DTTokenReferenceResolver, properties: Array<ElementProperty>, propertyValues: Array<ElementPropertyValue>): TypographyToken;
|
|
13
|
+
static typographyValueFromDefinition(definition: object, referenceResolver: DTTokenReferenceResolver): TypographyTokenValue;
|
|
14
|
+
toWriteObject(): TypographyTokenRemoteModel;
|
|
15
|
+
static valueToWriteObject(value: TypographyTokenValue): {
|
|
16
|
+
aliasTo: string | undefined;
|
|
17
|
+
value: TypographyTokenRemoteValue;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BlurTokenRemoteValue, BorderTokenRemoteValue, ColorTokenRemoteValue, FontTokenRemoteValue, GradientTokenRemoteValue, MeasureTokenRemoteValue, RadiusTokenRemoteValue, ShadowTokenRemoteValue, TextTokenRemoteValue, TypographyTokenRemoteValue } from './SDKRemoteTokenValue';
|
|
2
|
+
export type ColorTokenRemoteData = {
|
|
3
|
+
aliasTo?: string;
|
|
4
|
+
value?: ColorTokenRemoteValue;
|
|
5
|
+
};
|
|
6
|
+
export type TextTokenRemoteData = {
|
|
7
|
+
aliasTo?: string;
|
|
8
|
+
value?: TextTokenRemoteValue;
|
|
9
|
+
};
|
|
10
|
+
export type GenericTokenRemoteData = {
|
|
11
|
+
aliasTo?: string;
|
|
12
|
+
value?: TextTokenRemoteValue;
|
|
13
|
+
};
|
|
14
|
+
export type TypographyTokenRemoteData = {
|
|
15
|
+
aliasTo?: string;
|
|
16
|
+
value?: TypographyTokenRemoteValue;
|
|
17
|
+
};
|
|
18
|
+
export type RadiusTokenRemoteData = {
|
|
19
|
+
aliasTo?: string;
|
|
20
|
+
value?: RadiusTokenRemoteValue;
|
|
21
|
+
};
|
|
22
|
+
export type ShadowTokenRemoteData = {
|
|
23
|
+
aliasTo?: string;
|
|
24
|
+
value?: ShadowTokenRemoteValue;
|
|
25
|
+
};
|
|
26
|
+
export type MeasureTokenRemoteData = {
|
|
27
|
+
aliasTo?: string;
|
|
28
|
+
value?: MeasureTokenRemoteValue;
|
|
29
|
+
};
|
|
30
|
+
export type FontTokenRemoteData = {
|
|
31
|
+
aliasTo?: string;
|
|
32
|
+
value?: FontTokenRemoteValue;
|
|
33
|
+
};
|
|
34
|
+
export type BorderTokenRemoteData = {
|
|
35
|
+
aliasTo?: string;
|
|
36
|
+
value?: BorderTokenRemoteValue;
|
|
37
|
+
};
|
|
38
|
+
export type GradientTokenRemoteData = {
|
|
39
|
+
aliasTo?: string;
|
|
40
|
+
value?: GradientTokenRemoteValue;
|
|
41
|
+
};
|
|
42
|
+
export type BlurTokenRemoteData = {
|
|
43
|
+
aliasTo?: string;
|
|
44
|
+
value?: BlurTokenRemoteValue;
|
|
45
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TokenType } from '../../enums/SDKTokenType';
|
|
2
|
+
import { BlurTokenRemoteData, BorderTokenRemoteData, ColorTokenRemoteData, FontTokenRemoteData, GenericTokenRemoteData, GradientTokenRemoteData, MeasureTokenRemoteData, RadiusTokenRemoteData, ShadowTokenRemoteData, TextTokenRemoteData, TypographyTokenRemoteData } from './SDKRemoteTokenData';
|
|
3
|
+
export interface TokenRemoteModel {
|
|
4
|
+
id: string;
|
|
5
|
+
brandId: string;
|
|
6
|
+
designSystemVersionId: string;
|
|
7
|
+
persistentId: string;
|
|
8
|
+
type: TokenType;
|
|
9
|
+
meta: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
originStyle?: {
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
sourceId?: string;
|
|
17
|
+
};
|
|
18
|
+
data: {
|
|
19
|
+
aliasTo?: string;
|
|
20
|
+
};
|
|
21
|
+
customPropertyOverrides: Array<{
|
|
22
|
+
propertyId: string;
|
|
23
|
+
value: any;
|
|
24
|
+
}>;
|
|
25
|
+
createdAt?: string;
|
|
26
|
+
updatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export type ColorTokenRemoteModel = TokenRemoteModel & {
|
|
29
|
+
data: ColorTokenRemoteData;
|
|
30
|
+
};
|
|
31
|
+
export type TextTokenRemoteModel = TokenRemoteModel & {
|
|
32
|
+
data: TextTokenRemoteData;
|
|
33
|
+
};
|
|
34
|
+
export type GenericTokenRemoteModel = TokenRemoteModel & {
|
|
35
|
+
data: GenericTokenRemoteData;
|
|
36
|
+
};
|
|
37
|
+
export type TypographyTokenRemoteModel = TokenRemoteModel & {
|
|
38
|
+
data: TypographyTokenRemoteData;
|
|
39
|
+
};
|
|
40
|
+
export type RadiusTokenRemoteModel = TokenRemoteModel & {
|
|
41
|
+
data: RadiusTokenRemoteData;
|
|
42
|
+
};
|
|
43
|
+
export type ShadowTokenRemoteModel = TokenRemoteModel & {
|
|
44
|
+
data: ShadowTokenRemoteData;
|
|
45
|
+
};
|
|
46
|
+
export type MeasureTokenRemoteModel = TokenRemoteModel & {
|
|
47
|
+
data: MeasureTokenRemoteData;
|
|
48
|
+
};
|
|
49
|
+
export type FontTokenRemoteModel = TokenRemoteModel & {
|
|
50
|
+
data: FontTokenRemoteData;
|
|
51
|
+
};
|
|
52
|
+
export type BorderTokenRemoteModel = TokenRemoteModel & {
|
|
53
|
+
data: BorderTokenRemoteData;
|
|
54
|
+
};
|
|
55
|
+
export type GradientTokenRemoteModel = TokenRemoteModel & {
|
|
56
|
+
data: GradientTokenRemoteData;
|
|
57
|
+
};
|
|
58
|
+
export type BlurTokenRemoteModel = TokenRemoteModel & {
|
|
59
|
+
data: BlurTokenRemoteData;
|
|
60
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BlurType } from "../../enums/SDKBlurType";
|
|
2
|
+
import { BorderPosition } from "../../enums/SDKBorderPosition";
|
|
3
|
+
import { GradientType } from "../../enums/SDKGradientType";
|
|
4
|
+
import { ShadowType } from "../../enums/SDKShadowType";
|
|
5
|
+
import { TextCase } from "../../enums/SDKTextCase";
|
|
6
|
+
import { TextDecoration } from "../../enums/SDKTextDecoration";
|
|
7
|
+
import { Unit } from "../../enums/SDKUnit";
|
|
8
|
+
import { ColorTokenRemoteData, FontTokenRemoteData, MeasureTokenRemoteData } from "./SDKRemoteTokenData";
|
|
9
|
+
export type ColorTokenRemoteValue = string;
|
|
10
|
+
export type TextTokenRemoteValue = string;
|
|
11
|
+
export type TypographyTokenRemoteValue = {
|
|
12
|
+
font: FontTokenRemoteData;
|
|
13
|
+
fontSize: MeasureTokenRemoteData;
|
|
14
|
+
textDecoration: TextDecoration;
|
|
15
|
+
textCase: TextCase;
|
|
16
|
+
letterSpacing: MeasureTokenRemoteData;
|
|
17
|
+
lineHeight: MeasureTokenRemoteData | null;
|
|
18
|
+
paragraphSpacing: MeasureTokenRemoteData;
|
|
19
|
+
paragraphIndent: MeasureTokenRemoteData;
|
|
20
|
+
};
|
|
21
|
+
export type RadiusTokenRemoteValue = {
|
|
22
|
+
radius: MeasureTokenRemoteData;
|
|
23
|
+
topLeft: MeasureTokenRemoteData | null;
|
|
24
|
+
topRight: MeasureTokenRemoteData | null;
|
|
25
|
+
bottomLeft: MeasureTokenRemoteData | null;
|
|
26
|
+
bottomRight: MeasureTokenRemoteData | null;
|
|
27
|
+
};
|
|
28
|
+
export type ShadowTokenRemoteValue = {
|
|
29
|
+
isEnabled: boolean;
|
|
30
|
+
color: ColorTokenRemoteData;
|
|
31
|
+
x: MeasureTokenRemoteData;
|
|
32
|
+
y: MeasureTokenRemoteData;
|
|
33
|
+
radius: MeasureTokenRemoteData;
|
|
34
|
+
spread: MeasureTokenRemoteData;
|
|
35
|
+
opacity: number;
|
|
36
|
+
type: ShadowType;
|
|
37
|
+
};
|
|
38
|
+
export type MeasureTokenRemoteValue = {
|
|
39
|
+
unit: Unit;
|
|
40
|
+
measure: number;
|
|
41
|
+
};
|
|
42
|
+
export type FontTokenRemoteValue = {
|
|
43
|
+
family: string;
|
|
44
|
+
subfamily: string;
|
|
45
|
+
};
|
|
46
|
+
export type BorderTokenRemoteValue = {
|
|
47
|
+
isEnabled: boolean;
|
|
48
|
+
color: ColorTokenRemoteData;
|
|
49
|
+
width: MeasureTokenRemoteData;
|
|
50
|
+
position: BorderPosition;
|
|
51
|
+
};
|
|
52
|
+
export type GradientTokenRemoteValue = {
|
|
53
|
+
to: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
};
|
|
57
|
+
from: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
61
|
+
type: GradientType;
|
|
62
|
+
aspectRatio: number;
|
|
63
|
+
stops: Array<GradientStopRemoteValue>;
|
|
64
|
+
};
|
|
65
|
+
export type GradientStopRemoteValue = {
|
|
66
|
+
position: number;
|
|
67
|
+
color: ColorTokenRemoteData;
|
|
68
|
+
};
|
|
69
|
+
export type BlurTokenRemoteValue = {
|
|
70
|
+
type: BlurType;
|
|
71
|
+
radius: MeasureTokenRemoteData;
|
|
72
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface UserModel {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
profile: {
|
|
6
|
+
name: string;
|
|
7
|
+
nickname: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare class User {
|
|
11
|
+
/** Unique user identifier */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Unique user email */
|
|
14
|
+
email: string;
|
|
15
|
+
/** When was the user created */
|
|
16
|
+
createdAt: Date | null;
|
|
17
|
+
/** User name */
|
|
18
|
+
name: string;
|
|
19
|
+
/** User nickname */
|
|
20
|
+
nickname: string | null;
|
|
21
|
+
constructor(model: UserModel);
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DTPluginToSupernovaMapPack, DTPluginToSupernovaSettings } from '../../tools/design-tokens/utilities/SDKDTMapLoader';
|
|
2
|
+
export declare class FigmaTokensDataLoader {
|
|
3
|
+
/** Load token definitions from path */
|
|
4
|
+
loadTokensFromPath(pathToFile: string): Promise<object>;
|
|
5
|
+
loadTokensFromDirectory(pathToDirectory: string, settingsPath: string): Promise<object>;
|
|
6
|
+
private getAllJSONFiles;
|
|
7
|
+
private getFileNameWithoutExtension;
|
|
8
|
+
private getSetKey;
|
|
9
|
+
loadConfigFromPath(pathToFile: string): {
|
|
10
|
+
mapping: DTPluginToSupernovaMapPack;
|
|
11
|
+
settings: DTPluginToSupernovaSettings;
|
|
12
|
+
};
|
|
13
|
+
private weakValidateMapping;
|
|
14
|
+
private processFileToMapping;
|
|
15
|
+
private parseDefinition;
|
|
16
|
+
private loadObjectFile;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DesignSystemVersion } from '../../core/SDKDesignSystemVersion';
|
|
2
|
+
import { TokenGroup } from '../../model/groups/SDKTokenGroup';
|
|
3
|
+
import { Token } from '../../model/tokens/SDKToken';
|
|
4
|
+
import { DTProcessedTokenNode } from './utilities/SDKDTJSONConverter';
|
|
5
|
+
import { DTTokenMergeDiff } from './utilities/SDKDTTokenMerger';
|
|
6
|
+
import { Brand } from '../../core/SDKBrand';
|
|
7
|
+
import { TokenTheme } from '../../model/themes/SDKTokenTheme';
|
|
8
|
+
import { DTPluginToSupernovaMap, DTPluginToSupernovaMapPack, DTPluginToSupernovaSettings } from './utilities/SDKDTMapLoader';
|
|
9
|
+
export type SupernovaToolsDesignTokensLoadingResult = {
|
|
10
|
+
processedNodes: Array<DTProcessedTokenNode>;
|
|
11
|
+
tokens: Array<Token>;
|
|
12
|
+
groups: Array<TokenGroup>;
|
|
13
|
+
};
|
|
14
|
+
export type SupernovaToolsDesignTokensResult = {
|
|
15
|
+
map: Pick<DTPluginToSupernovaMap, 'bindToBrand' | 'bindToTheme' | 'pluginSets' | 'pluginTheme' | 'type'>;
|
|
16
|
+
tokensCreated: Array<string>;
|
|
17
|
+
tokensUpdated: Array<string>;
|
|
18
|
+
tokensDeleted: Array<string>;
|
|
19
|
+
};
|
|
20
|
+
/** Design Tokens Plugin Manipulation Tool */
|
|
21
|
+
export declare class SupernovaToolsDesignTokensPlugin {
|
|
22
|
+
private version;
|
|
23
|
+
private sortMultiplier;
|
|
24
|
+
constructor(version: DesignSystemVersion);
|
|
25
|
+
synchronizeTokensFromData(data: object, mapping: DTPluginToSupernovaMapPack, settings: DTPluginToSupernovaSettings): Promise<boolean>;
|
|
26
|
+
synchronizeTokensFromDataWithResults(data: object, mapping: DTPluginToSupernovaMapPack, settings: DTPluginToSupernovaSettings): Promise<SupernovaToolsDesignTokensResult[]>;
|
|
27
|
+
private processTokenNodes;
|
|
28
|
+
private setTokensOrigin;
|
|
29
|
+
/** Creates pure tree for validation purposes, ignoring any existing token state in workspaces. This method works offline. */
|
|
30
|
+
createPureTokenTree(processedNodes: Array<DTProcessedTokenNode>, verbose: boolean): Promise<{
|
|
31
|
+
tokens: Array<Token>;
|
|
32
|
+
groups: Array<TokenGroup>;
|
|
33
|
+
}>;
|
|
34
|
+
/** Loads remote source connected to this tool, then merges tokens and groups with it, creating union. Can optionally write to the source as well */
|
|
35
|
+
mergeWithRemoteSource(processedNodes: Array<DTProcessedTokenNode>, brand: Brand, write: boolean, verbose: boolean, preciseCopy: boolean): Promise<{
|
|
36
|
+
tokens: Array<Token>;
|
|
37
|
+
groups: Array<TokenGroup>;
|
|
38
|
+
diff: DTTokenMergeDiff;
|
|
39
|
+
}>;
|
|
40
|
+
/** Loads remote source connected to this tool, then creates the diff from the base tree and updates the associated theme. Can optionally write to the source as well */
|
|
41
|
+
mergeThemeWithRemoteSource(processedNodes: Array<DTProcessedTokenNode>, brand: Brand, theme: TokenTheme, write: boolean, verbose: boolean, preciseCopy?: boolean): Promise<{
|
|
42
|
+
theme: TokenTheme;
|
|
43
|
+
tokens: Array<Token>;
|
|
44
|
+
}>;
|
|
45
|
+
correctSortOrder(tokens: Array<Token>, tokenGroups: Array<TokenGroup>): void;
|
|
46
|
+
correctSortOrderFromTypeRoot(root: TokenGroup, tokenMap: Map<string, Token>, groupMap: Map<string, TokenGroup>): void;
|
|
47
|
+
flattenedIdsFromRoot(root: TokenGroup, tokenMap: Map<string, Token>, groupMap: Map<string, TokenGroup>): Array<string>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Brand } from '../../../core/SDKBrand';
|
|
2
|
+
import { DesignSystemVersion } from '../../../core/SDKDesignSystemVersion';
|
|
3
|
+
import { Token } from '../../../model/tokens/SDKToken';
|
|
4
|
+
import { DTParsedNode } from './SDKDTJSONLoader';
|
|
5
|
+
import { DTPluginToSupernovaMapPack } from './SDKDTMapLoader';
|
|
6
|
+
import { DTTokenReferenceResolver } from './SDKDTTokenReferenceResolver';
|
|
7
|
+
export type DTProcessedTokenNode = {
|
|
8
|
+
token: Token;
|
|
9
|
+
originalType: string;
|
|
10
|
+
path: Array<string>;
|
|
11
|
+
key: string;
|
|
12
|
+
};
|
|
13
|
+
/** Utility to DS Tokens plugin JSON to Supernova entities */
|
|
14
|
+
export declare class DTJSONConverter {
|
|
15
|
+
version: DesignSystemVersion;
|
|
16
|
+
mapping: DTPluginToSupernovaMapPack;
|
|
17
|
+
referenceResolver: DTTokenReferenceResolver;
|
|
18
|
+
constructor(version: DesignSystemVersion, mapping: DTPluginToSupernovaMapPack);
|
|
19
|
+
convertNodesToTokens(nodes: Array<DTParsedNode>, brand: Brand): Array<DTProcessedTokenNode>;
|
|
20
|
+
private remapRootNodeKeys;
|
|
21
|
+
private convertNodesToTokensForSupportedNodeTypes;
|
|
22
|
+
private convertAtomicNode;
|
|
23
|
+
private convertColorAtomicNode;
|
|
24
|
+
private convertMeasureAtomicNode;
|
|
25
|
+
private convertRadiusAtomicNode;
|
|
26
|
+
private convertShadowAtomicNode;
|
|
27
|
+
private convertBorderAtomicNode;
|
|
28
|
+
private convertTypographyAtomicNode;
|
|
29
|
+
private convertGenericAtomicNode;
|
|
30
|
+
private convertReferencedNode;
|
|
31
|
+
private convertPureReferencedNode;
|
|
32
|
+
private convertComplexReferenceNode;
|
|
33
|
+
private convertDTTypeToSupernovaType;
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Brand, DesignSystemVersion, TokenGroup, TokenType } from '../../..';
|
|
2
|
+
import { DTProcessedTokenNode } from './SDKDTJSONConverter';
|
|
3
|
+
import { DTPluginToSupernovaMapPack } from './SDKDTMapLoader';
|
|
4
|
+
export type DTRootGroupMapping = {
|
|
5
|
+
snType: TokenType;
|
|
6
|
+
dtType: string;
|
|
7
|
+
snRootName: string;
|
|
8
|
+
dtRootName: string;
|
|
9
|
+
};
|
|
10
|
+
/** Utility for building token trees */
|
|
11
|
+
export declare class DTJSONGroupBuilder {
|
|
12
|
+
version: DesignSystemVersion;
|
|
13
|
+
mapping: DTPluginToSupernovaMapPack;
|
|
14
|
+
constructor(version: DesignSystemVersion, mapping: DTPluginToSupernovaMapPack);
|
|
15
|
+
/** Create mapping between DT <> SN and assign all tokens into their respective newly created groups */
|
|
16
|
+
constructAllDefinableGroupsTrees(processedNodes: Array<DTProcessedTokenNode>, brand: Brand): Array<TokenGroup>;
|
|
17
|
+
/** Create group tree needed to contain entire token tree for particular mapping combination */
|
|
18
|
+
constructGroupTree(processedNodes: Array<DTProcessedTokenNode>, mapping: DTRootGroupMapping, brand: Brand): Array<TokenGroup>;
|
|
19
|
+
constructGroupChain(version: DesignSystemVersion, brand: Brand, groups: Map<string, TokenGroup>, path: Array<string>): void;
|
|
20
|
+
createGroup(brandId: string, versionId: string, name: string, type: TokenType, isRoot: boolean): TokenGroup;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type DTParsedNode = {
|
|
2
|
+
rootKey: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: Array<string>;
|
|
5
|
+
type: string;
|
|
6
|
+
value: any;
|
|
7
|
+
description: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type DTParsedTokenSet = {
|
|
10
|
+
name: string;
|
|
11
|
+
id: string;
|
|
12
|
+
contains: Array<DTParsedNode>;
|
|
13
|
+
};
|
|
14
|
+
export type DTParsedTheme = {
|
|
15
|
+
name: string;
|
|
16
|
+
id: string;
|
|
17
|
+
selectedTokenSets: Array<DTParsedThemeSetPriorityPair>;
|
|
18
|
+
};
|
|
19
|
+
export type DTParsedThemeSetPriorityPair = {
|
|
20
|
+
set: DTParsedTokenSet;
|
|
21
|
+
priority: DTParsedThemeSetPriority;
|
|
22
|
+
};
|
|
23
|
+
export declare enum DTParsedThemeSetPriority {
|
|
24
|
+
source = "source",
|
|
25
|
+
enabled = "enabled",
|
|
26
|
+
disabled = "disabled"
|
|
27
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type DTParsedNode = {
|
|
2
|
+
rootKey: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: Array<string>;
|
|
5
|
+
type: string;
|
|
6
|
+
value: any;
|
|
7
|
+
description: string | null;
|
|
8
|
+
};
|
|
9
|
+
export type DTParsedTokenSet = {
|
|
10
|
+
name: string;
|
|
11
|
+
id: string;
|
|
12
|
+
contains: Array<DTParsedNode>;
|
|
13
|
+
};
|
|
14
|
+
export type DTParsedTheme = {
|
|
15
|
+
name: string;
|
|
16
|
+
id: string;
|
|
17
|
+
selectedTokenSets: Array<DTParsedThemeSetPriorityPair>;
|
|
18
|
+
};
|
|
19
|
+
export type DTParsedThemeSetPriorityPair = {
|
|
20
|
+
set: DTParsedTokenSet;
|
|
21
|
+
priority: DTParsedThemeSetPriority;
|
|
22
|
+
};
|
|
23
|
+
export declare enum DTParsedThemeSetPriority {
|
|
24
|
+
source = "source",
|
|
25
|
+
enabled = "enabled",
|
|
26
|
+
disabled = "disabled"
|
|
27
|
+
}
|
|
28
|
+
/** Design Tokens Plugin Manipulation Tool */
|
|
29
|
+
export declare class DTJSONParser {
|
|
30
|
+
themeBuffer: Array<DTParsedTheme>;
|
|
31
|
+
constructor();
|
|
32
|
+
processPluginDataRepresentation(definition: object): Promise<{
|
|
33
|
+
nodes: Array<DTParsedNode>;
|
|
34
|
+
themes: Array<DTParsedTheme>;
|
|
35
|
+
sets: Array<DTParsedTokenSet>;
|
|
36
|
+
}>;
|
|
37
|
+
private processThemes;
|
|
38
|
+
private processSets;
|
|
39
|
+
private parseNode;
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TokenGroup } from '../../..';
|
|
2
|
+
import { DTProcessedTokenNode } from './SDKDTJSONConverter';
|
|
3
|
+
import { DTParsedNode } from './SDKDTJSONLoader';
|
|
4
|
+
export type DTPluginToSupernovaMapPack = Array<DTPluginToSupernovaMap>;
|
|
5
|
+
export declare enum DTPluginToSupernovaMapType {
|
|
6
|
+
theme = "theme",
|
|
7
|
+
set = "set"
|
|
8
|
+
}
|
|
9
|
+
export type DTPluginToSupernovaMap = {
|
|
10
|
+
type: DTPluginToSupernovaMapType;
|
|
11
|
+
pluginSets: Array<string> | null;
|
|
12
|
+
pluginTheme: string | null;
|
|
13
|
+
bindToBrand: string;
|
|
14
|
+
bindToTheme: string | null;
|
|
15
|
+
nodes: Array<DTParsedNode> | null;
|
|
16
|
+
processedNodes: Array<DTProcessedTokenNode> | null;
|
|
17
|
+
processedGroups: Array<TokenGroup> | null;
|
|
18
|
+
};
|
|
19
|
+
export type DTPluginToSupernovaMappingFile = {
|
|
20
|
+
mode: 'single-file' | 'multi-file';
|
|
21
|
+
mapping: [
|
|
22
|
+
{
|
|
23
|
+
tokensTheme?: string;
|
|
24
|
+
tokenSets?: Array<string>;
|
|
25
|
+
supernovaBrand: string;
|
|
26
|
+
supernovaTheme?: string;
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
settings?: {
|
|
30
|
+
verbose?: boolean;
|
|
31
|
+
dryRun?: boolean;
|
|
32
|
+
preciseCopy?: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type DTPluginToSupernovaSettings = {
|
|
36
|
+
verbose: boolean;
|
|
37
|
+
dryRun: boolean;
|
|
38
|
+
preciseCopy: boolean;
|
|
39
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DesignSystemVersion } from '../../../core/SDKDesignSystemVersion';
|
|
2
|
+
import { DTParsedTheme, DTParsedTokenSet } from './SDKDTJSONLoader';
|
|
3
|
+
import { DTPluginToSupernovaMap } from './SDKDTMapLoader';
|
|
4
|
+
/** Utility to resolve token maps */
|
|
5
|
+
export declare class DTMapResolver {
|
|
6
|
+
private version;
|
|
7
|
+
constructor(version: DesignSystemVersion);
|
|
8
|
+
mappedNodePools(map: DTPluginToSupernovaMap, themes: Array<DTParsedTheme>, sets: Array<DTParsedTokenSet>): DTPluginToSupernovaMap;
|
|
9
|
+
private computeUniqueNodesFromSets;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DesignSystemVersion } from "../../../core/SDKDesignSystemVersion";
|
|
2
|
+
import { DTProcessedTokenNode } from "./SDKDTJSONConverter";
|
|
3
|
+
import { TokenTheme } from "../../../model/themes/SDKTokenTheme";
|
|
4
|
+
import { Token } from "../../../model/tokens/SDKToken";
|
|
5
|
+
export type DTThemeMergeDiff = {
|
|
6
|
+
toUpdate: Array<DTProcessedTokenNode>;
|
|
7
|
+
toCreate: Array<DTProcessedTokenNode>;
|
|
8
|
+
};
|
|
9
|
+
/** Utility allowing merging of two pools of tokens */
|
|
10
|
+
export declare class DTThemeMerger {
|
|
11
|
+
private version;
|
|
12
|
+
constructor(version: DesignSystemVersion);
|
|
13
|
+
makeTheme(upstreamTokens: Array<Token>, upstreamTheme: TokenTheme, processedNodes: Array<DTProcessedTokenNode>, preciseCopy?: boolean): TokenTheme;
|
|
14
|
+
replaceIdAcrossAllPossibleReferences(override: DTProcessedTokenNode, newId: string, allTokens: Array<DTProcessedTokenNode>): void;
|
|
15
|
+
buildKey(path: Array<string>, name: string): string;
|
|
16
|
+
buildPath(token: Token): Array<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Token, TokenGroup } from '../../..';
|
|
2
|
+
import { DTTokenMergeDiff } from './SDKDTTokenMerger';
|
|
3
|
+
import { TokenTreeElement } from './tree/SDKDTGroupTreeNode';
|
|
4
|
+
export type DTTokenTreeMergeDiff = {
|
|
5
|
+
toUpdate: Array<TokenTreeElement>;
|
|
6
|
+
toCreate: Array<TokenTreeElement>;
|
|
7
|
+
toDelete: Array<TokenTreeElement>;
|
|
8
|
+
toCreateOrUpdate: Array<TokenTreeElement>;
|
|
9
|
+
};
|
|
10
|
+
export type DTGroupMergeDiffElement = {
|
|
11
|
+
element: TokenTreeElement;
|
|
12
|
+
childrenIds: Array<string>;
|
|
13
|
+
};
|
|
14
|
+
export declare class DTGroupMergeDiff {
|
|
15
|
+
toUpdate: Array<DTGroupMergeDiffElement>;
|
|
16
|
+
toCreate: Array<DTGroupMergeDiffElement>;
|
|
17
|
+
toDelete: Array<TokenTreeElement>;
|
|
18
|
+
}
|
|
19
|
+
/** Utility allowing merging of two distinct token trees */
|
|
20
|
+
export declare class DTTokenGroupTreeMerger {
|
|
21
|
+
constructor();
|
|
22
|
+
makeGroupsDiff(tokensDiff: DTTokenMergeDiff, existingElements: Array<Token | TokenGroup>): DTGroupMergeDiff;
|
|
23
|
+
}
|