@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.
Files changed (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/build/sdk-typescript/src/browser-bundle.d.ts +1 -0
  4. package/build/sdk-typescript/src/core/SDKBrand.d.ts +80 -0
  5. package/build/sdk-typescript/src/core/SDKBrandWriter.d.ts +29 -0
  6. package/build/sdk-typescript/src/core/SDKDesignSystem.d.ts +62 -0
  7. package/build/sdk-typescript/src/core/SDKDesignSystemVersion.d.ts +99 -0
  8. package/build/sdk-typescript/src/core/SDKDocumentation.d.ts +55 -0
  9. package/build/sdk-typescript/src/core/SDKSupernova.d.ts +46 -0
  10. package/build/sdk-typescript/src/core/SDKWorkspace.d.ts +26 -0
  11. package/build/sdk-typescript/src/core/data/SDKConfiguration.d.ts +6 -0
  12. package/build/sdk-typescript/src/core/data/SDKDataBridge.d.ts +50 -0
  13. package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +141 -0
  14. package/build/sdk-typescript/src/core/errors/SDKSupernovaError.d.ts +24 -0
  15. package/build/sdk-typescript/src/core/resolvers/SDKAssetGroupResolver.d.ts +14 -0
  16. package/build/sdk-typescript/src/core/resolvers/SDKComponentResolver.d.ts +8 -0
  17. package/build/sdk-typescript/src/core/resolvers/SDKDesignComponentGroupResolver.d.ts +13 -0
  18. package/build/sdk-typescript/src/core/resolvers/SDKDocumentationItemResolver.d.ts +32 -0
  19. package/build/sdk-typescript/src/core/resolvers/SDKTokenGroupResolver.d.ts +11 -0
  20. package/build/sdk-typescript/src/core/resolvers/SDKTokenResolver.d.ts +76 -0
  21. package/build/sdk-typescript/src/exports.d.ts +117 -0
  22. package/build/sdk-typescript/src/index.d.ts +1 -0
  23. package/build/sdk-typescript/src/model/assets/SDKAsset.d.ts +16 -0
  24. package/build/sdk-typescript/src/model/assets/SDKRenderedAsset.d.ts +28 -0
  25. package/build/sdk-typescript/src/model/components/SDKComponent.d.ts +27 -0
  26. package/build/sdk-typescript/src/model/components/SDKDesignComponent.d.ts +32 -0
  27. package/build/sdk-typescript/src/model/documentation/SDKDocumentationConfiguration.d.ts +13 -0
  28. package/build/sdk-typescript/src/model/documentation/SDKDocumentationGroup.d.ts +38 -0
  29. package/build/sdk-typescript/src/model/documentation/SDKDocumentationItem.d.ts +26 -0
  30. package/build/sdk-typescript/src/model/documentation/SDKDocumentationPage.d.ts +31 -0
  31. package/build/sdk-typescript/src/model/documentation/SDKDocumentationPageAsset.d.ts +15 -0
  32. package/build/sdk-typescript/src/model/documentation/SDKDocumentationPageBlock.d.ts +32 -0
  33. package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichText.d.ts +10 -0
  34. package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichTextSpan.d.ts +10 -0
  35. package/build/sdk-typescript/src/model/documentation/SDKDocumentationRichTextSpanAttribute.d.ts +14 -0
  36. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockAsset.d.ts +15 -0
  37. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockAssets.d.ts +24 -0
  38. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCallout.d.ts +11 -0
  39. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCode.d.ts +12 -0
  40. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockColumn.d.ts +8 -0
  41. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockColumnItem.d.ts +11 -0
  42. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockCustom.d.ts +16 -0
  43. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockDivider.d.ts +8 -0
  44. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedFigma.d.ts +8 -0
  45. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedGeneric.d.ts +15 -0
  46. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedLink.d.ts +16 -0
  47. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedStorybook.d.ts +8 -0
  48. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedYoutube.d.ts +8 -0
  49. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockFrame.d.ts +18 -0
  50. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockFrames.d.ts +26 -0
  51. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockHeading.d.ts +11 -0
  52. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockImage.d.ts +18 -0
  53. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockOrderedList.d.ts +8 -0
  54. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockQuote.d.ts +8 -0
  55. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockRenderCode.d.ts +34 -0
  56. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockShortcut.d.ts +35 -0
  57. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockShortcuts.d.ts +11 -0
  58. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTab.d.ts +8 -0
  59. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTabItem.d.ts +10 -0
  60. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTable.d.ts +23 -0
  61. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableCell.d.ts +13 -0
  62. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableColumn.d.ts +10 -0
  63. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTableRow.d.ts +8 -0
  64. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockText.d.ts +13 -0
  65. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockToken.d.ts +10 -0
  66. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTokenGroup.d.ts +12 -0
  67. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockTokenList.d.ts +10 -0
  68. package/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockUnorderedList.d.ts +8 -0
  69. package/build/sdk-typescript/src/model/documentation/builder/SDKDocumentationBlockBuilder.d.ts +6 -0
  70. package/build/sdk-typescript/src/model/documentation/configuration/SDKDocumentationItemConfiguration.d.ts +10 -0
  71. package/build/sdk-typescript/src/model/documentation/configuration/SDKDocumentationItemHeader.d.ts +30 -0
  72. package/build/sdk-typescript/src/model/elements/SDKElementDataView.d.ts +30 -0
  73. package/build/sdk-typescript/src/model/elements/SDKElementDataViewColumn.d.ts +37 -0
  74. package/build/sdk-typescript/src/model/elements/SDKElementProperty.d.ts +56 -0
  75. package/build/sdk-typescript/src/model/elements/SDKElementPropertyOption.d.ts +13 -0
  76. package/build/sdk-typescript/src/model/elements/values/SDKElementPropertyValue.d.ts +15 -0
  77. package/build/sdk-typescript/src/model/enums/SDKAlignment.d.ts +5 -0
  78. package/build/sdk-typescript/src/model/enums/SDKAssetFormat.d.ts +5 -0
  79. package/build/sdk-typescript/src/model/enums/SDKAssetScale.d.ts +6 -0
  80. package/build/sdk-typescript/src/model/enums/SDKAssetScaleType.d.ts +4 -0
  81. package/build/sdk-typescript/src/model/enums/SDKBlurType.d.ts +4 -0
  82. package/build/sdk-typescript/src/model/enums/SDKBorderPosition.d.ts +5 -0
  83. package/build/sdk-typescript/src/model/enums/SDKDocumentationCalloutType.d.ts +6 -0
  84. package/build/sdk-typescript/src/model/enums/SDKDocumentationGroupBehavior.d.ts +4 -0
  85. package/build/sdk-typescript/src/model/enums/SDKDocumentationHeadingType.d.ts +5 -0
  86. package/build/sdk-typescript/src/model/enums/SDKDocumentationItemType.d.ts +4 -0
  87. package/build/sdk-typescript/src/model/enums/SDKDocumentationPageAssetType.d.ts +4 -0
  88. package/build/sdk-typescript/src/model/enums/SDKDocumentationPageBlockThemeType.d.ts +4 -0
  89. package/build/sdk-typescript/src/model/enums/SDKDocumentationPageBlockType.d.ts +31 -0
  90. package/build/sdk-typescript/src/model/enums/SDKFrameAlignment.d.ts +4 -0
  91. package/build/sdk-typescript/src/model/enums/SDKFrameLayout.d.ts +11 -0
  92. package/build/sdk-typescript/src/model/enums/SDKGradientType.d.ts +5 -0
  93. package/build/sdk-typescript/src/model/enums/SDKRichTextSpanAttributeType.d.ts +7 -0
  94. package/build/sdk-typescript/src/model/enums/SDKShadowType.d.ts +4 -0
  95. package/build/sdk-typescript/src/model/enums/SDKSourceType.d.ts +4 -0
  96. package/build/sdk-typescript/src/model/enums/SDKTextCase.d.ts +6 -0
  97. package/build/sdk-typescript/src/model/enums/SDKTextDecoration.d.ts +5 -0
  98. package/build/sdk-typescript/src/model/enums/SDKTokenType.d.ts +13 -0
  99. package/build/sdk-typescript/src/model/enums/SDKUnit.d.ts +6 -0
  100. package/build/sdk-typescript/src/model/exporters/SDKExporter.d.ts +74 -0
  101. package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlock.d.ts +23 -0
  102. package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlockProperty.d.ts +32 -0
  103. package/build/sdk-typescript/src/model/exporters/custom_blocks/SDKExporterCustomBlockVariant.d.ts +12 -0
  104. package/build/sdk-typescript/src/model/exporters/custom_properties/SDKExporterConfigurationProperty.d.ts +38 -0
  105. package/build/sdk-typescript/src/model/groups/SDKAssetGroup.d.ts +20 -0
  106. package/build/sdk-typescript/src/model/groups/SDKDesignComponentGroup.d.ts +33 -0
  107. package/build/sdk-typescript/src/model/groups/SDKTokenGroup.d.ts +42 -0
  108. package/build/sdk-typescript/src/model/support/SDKDesignComponentOrigin.d.ts +23 -0
  109. package/build/sdk-typescript/src/model/support/SDKFrameOrigin.d.ts +25 -0
  110. package/build/sdk-typescript/src/model/support/SDKSize.d.ts +9 -0
  111. package/build/sdk-typescript/src/model/support/SDKSource.d.ts +102 -0
  112. package/build/sdk-typescript/src/model/support/SDKTokenOrigin.d.ts +11 -0
  113. package/build/sdk-typescript/src/model/support/SDKWorkspaceNPMRegistry.d.ts +13 -0
  114. package/build/sdk-typescript/src/model/themes/SDKThemeUtilities.d.ts +6 -0
  115. package/build/sdk-typescript/src/model/themes/SDKTokenTheme.d.ts +63 -0
  116. package/build/sdk-typescript/src/model/themes/SDKTokenThemeOverride.d.ts +49 -0
  117. package/build/sdk-typescript/src/model/tokens/SDKBlurToken.d.ts +18 -0
  118. package/build/sdk-typescript/src/model/tokens/SDKBorderToken.d.ts +19 -0
  119. package/build/sdk-typescript/src/model/tokens/SDKColorToken.d.ts +22 -0
  120. package/build/sdk-typescript/src/model/tokens/SDKFontToken.d.ts +16 -0
  121. package/build/sdk-typescript/src/model/tokens/SDKGenericToken.d.ts +18 -0
  122. package/build/sdk-typescript/src/model/tokens/SDKGradientToken.d.ts +18 -0
  123. package/build/sdk-typescript/src/model/tokens/SDKMeasureToken.d.ts +26 -0
  124. package/build/sdk-typescript/src/model/tokens/SDKRadiusToken.d.ts +18 -0
  125. package/build/sdk-typescript/src/model/tokens/SDKShadowToken.d.ts +21 -0
  126. package/build/sdk-typescript/src/model/tokens/SDKTextToken.d.ts +16 -0
  127. package/build/sdk-typescript/src/model/tokens/SDKToken.d.ts +30 -0
  128. package/build/sdk-typescript/src/model/tokens/SDKTokenCompator.d.ts +20 -0
  129. package/build/sdk-typescript/src/model/tokens/SDKTokenValue.d.ts +113 -0
  130. package/build/sdk-typescript/src/model/tokens/SDKTypographyToken.d.ts +19 -0
  131. package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenData.d.ts +45 -0
  132. package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenModel.d.ts +60 -0
  133. package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenValue.d.ts +72 -0
  134. package/build/sdk-typescript/src/model/users/SDKUser.d.ts +22 -0
  135. package/build/sdk-typescript/src/tests/Accessors/Brand.spec.d.ts +1 -0
  136. package/build/sdk-typescript/src/tests/Accessors/Components.spec.d.ts +1 -0
  137. package/build/sdk-typescript/src/tests/Accessors/DesignSystem.spec.d.ts +1 -0
  138. package/build/sdk-typescript/src/tests/Accessors/DesignSystemVersion.spec.d.ts +1 -0
  139. package/build/sdk-typescript/src/tests/Accessors/Documentation.spec.d.ts +1 -0
  140. package/build/sdk-typescript/src/tests/Accessors/Supernova.spec.d.ts +1 -0
  141. package/build/sdk-typescript/src/tests/Accessors/Theme.spec.d.ts +1 -0
  142. package/build/sdk-typescript/src/tests/Accessors/Workspace.spec.d.ts +1 -0
  143. package/build/sdk-typescript/src/tests/Tooling/PluginFigmaTokens.spec.d.ts +17 -0
  144. package/build/sdk-typescript/src/tests/Tooling/PluginJSONBuilder.spec.d.ts +1 -0
  145. package/build/sdk-typescript/src/tests/Tooling/ToolDocSearch.spec.d.ts +1 -0
  146. package/build/sdk-typescript/src/tests/Tooling/ToolMarkdownTransform.spec.d.ts +1 -0
  147. package/build/sdk-typescript/src/tests/helpers.d.ts +2 -0
  148. package/build/sdk-typescript/src/tools/design-tokens/SDKToolsDesignTokensPlugin.d.ts +48 -0
  149. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONConverter.d.ts +34 -0
  150. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONGroupBuilder.d.ts +21 -0
  151. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONLoader.d.ts +27 -0
  152. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONParser.d.ts +40 -0
  153. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTMapLoader.d.ts +39 -0
  154. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTMapResolver.d.ts +10 -0
  155. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTThemeMerger.d.ts +17 -0
  156. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenGroupTreeMerger.d.ts +23 -0
  157. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenMerger.d.ts +17 -0
  158. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenReferenceResolver.d.ts +37 -0
  159. package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenSetResolver.d.ts +12 -0
  160. package/build/sdk-typescript/src/tools/design-tokens/utilities/collection/SDKDTTokenCollection.d.ts +13 -0
  161. package/build/sdk-typescript/src/tools/design-tokens/utilities/expression/SDKDTExpressionParser.d.ts +5 -0
  162. package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTGroupTree.d.ts +10 -0
  163. package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTGroupTreeNode.d.ts +20 -0
  164. package/build/sdk-typescript/src/tools/design-tokens/utilities/tree/SDKDTParentChildMapping.d.ts +5 -0
  165. package/build/sdk-typescript/src/tools/json-builder/SDKToolsJSONBuilder.d.ts +57 -0
  166. package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementFigmaTokensTransformer.d.ts +40 -0
  167. package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementStyleDictionaryTransformer.d.ts +29 -0
  168. package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +77 -0
  169. package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransform.d.ts +23 -0
  170. package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransformBlock.d.ts +75 -0
  171. package/build/sdk-typescript/src/tools/markdown-transform/SDKToolsMarkdownTransformUtil.d.ts +26 -0
  172. package/build/sdk-typescript/src/tools/search-index/SDKToolsDocSearch.d.ts +47 -0
  173. package/build/sdk-typescript/src/tools/token-transform/SDKToolsTokenTransform.d.ts +44 -0
  174. package/build/sdk-typescript/src/utils/FlowUtils.d.ts +5 -0
  175. package/build/sdk-typescript/src/utils/StringUtils.d.ts +72 -0
  176. package/build/supernova-sdk-typescript.js +3 -0
  177. package/build/supernova-sdk-typescript.js.LICENSE.txt +8 -0
  178. package/build/supernova-sdk-typescript.js.map +1 -0
  179. package/package.json +114 -0
@@ -0,0 +1,17 @@
1
+ import { Token } from '../../../model/tokens/SDKToken';
2
+ import { DTProcessedTokenNode } from './SDKDTJSONConverter';
3
+ export type DTTokenMergeDiff = {
4
+ toUpdate: Array<DTProcessedTokenNode>;
5
+ toCreate: Array<DTProcessedTokenNode>;
6
+ toDelete: Array<DTProcessedTokenNode>;
7
+ toCreateOrUpdate: Array<DTProcessedTokenNode>;
8
+ };
9
+ /** Utility allowing merging of two pools of tokens */
10
+ export declare class DTTokenMerger {
11
+ constructor();
12
+ static buildKey(path: Array<string>, name: string): string;
13
+ buildPath(token: Token): Array<string>;
14
+ buildNodeMap(nodes: Array<DTProcessedTokenNode>): Map<string, DTProcessedTokenNode>;
15
+ convertBaseTokensToProcessedNode(tokens: Array<Token>): Array<DTProcessedTokenNode>;
16
+ makeTokensDiff(existing: Array<Token>, extracted: Array<DTProcessedTokenNode>): DTTokenMergeDiff;
17
+ }
@@ -0,0 +1,37 @@
1
+ import { AnyToken } from '../../../model/tokens/SDKTokenValue';
2
+ import { Token } from '../../../model/tokens/SDKToken';
3
+ import { DTProcessedTokenNode } from './SDKDTJSONConverter';
4
+ /** Utility allowing resolution of token references */
5
+ export declare class DTTokenReferenceResolver {
6
+ private mappedTokens;
7
+ private nodes;
8
+ constructor();
9
+ replaceRefs(existingToken: AnyToken, newToken: AnyToken): void;
10
+ addAtomicToken(token: DTProcessedTokenNode): void;
11
+ addAtomicTokens(tokens: Array<DTProcessedTokenNode>): void;
12
+ unmappedValues(): Array<DTProcessedTokenNode>;
13
+ lookupReferencedToken(reference: string): Token | undefined;
14
+ lookupAllReferencedTokens(reference: string): Array<{
15
+ token: Token;
16
+ key: string;
17
+ location: number;
18
+ }> | undefined;
19
+ replaceAllReferencedTokens(reference: string, replacements: Array<{
20
+ token: Token;
21
+ key: string;
22
+ location: number;
23
+ }>): string;
24
+ replaceToken(base: string, token: Token, key: string, location: number): string;
25
+ replaceAt(s: string, what: string, replacement: string, index: number): string;
26
+ replacableValue(token: Token): string;
27
+ isBalancedReference(syntax: string): boolean;
28
+ valueHasReference(value: string | object | number): boolean;
29
+ valueIsPureReference(value: string | object): boolean;
30
+ hasSameNumberOfCharacters(str: string, char1: string, char2: string): boolean;
31
+ countCharacter(str: string, char: string): number;
32
+ tokenReferenceKey(path: Array<String>, name: string): string;
33
+ findBracketStrings(str: string): {
34
+ index: number;
35
+ value: string;
36
+ }[];
37
+ }
@@ -0,0 +1,12 @@
1
+ import { Token } from "../../..";
2
+ export type DTProcessedTheme = {
3
+ sets: Array<DTProcessedTokenSet>;
4
+ };
5
+ export type DTProcessedTokenSet = {
6
+ tokens: Array<Token>;
7
+ };
8
+ /** Utility allowing merging of two pools of tokens */
9
+ export declare class DTTokenSetResolver {
10
+ constructor();
11
+ parseTokenSets(sets: any): void;
12
+ }
@@ -0,0 +1,13 @@
1
+ import { DTProcessedTokenNode } from "../SDKDTJSONConverter";
2
+ export declare class DTProcessedTokenNodeCollection {
3
+ readonly index: Map<string, DTProcessedTokenNode>;
4
+ readonly added: Set<string>;
5
+ readonly deleted: Map<string, DTProcessedTokenNode>;
6
+ readonly dirty: Set<string>;
7
+ readonly list: Array<DTProcessedTokenNode>;
8
+ constructor(source: Array<DTProcessedTokenNode> | Map<string, DTProcessedTokenNode>);
9
+ markDeleted(element: DTProcessedTokenNode): void;
10
+ removeFromCollection(persistentId: string): void;
11
+ markDirty(node: DTProcessedTokenNode): void;
12
+ add(node: DTProcessedTokenNode): void;
13
+ }
@@ -0,0 +1,5 @@
1
+ /** Parsing and reduction utility for math expressions */
2
+ export declare class DTExpressionParser {
3
+ /** Reduce value of expressions to their base form */
4
+ static reduceExpressionsToBaseForm(baseExpression: string): string | number;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { Token, TokenGroup, TokenType } from '../../../..';
2
+ import { GroupTreeNode } from './SDKDTGroupTreeNode';
3
+ export type GroupTreeNodeWalker = (node: GroupTreeNode, path: GroupTreeNode[]) => void;
4
+ export type TokenTreeElement = Token | TokenGroup;
5
+ export declare class GroupTree extends GroupTreeNode {
6
+ childType: TokenType;
7
+ constructor(backingElement: TokenTreeElement);
8
+ static populate(root: TokenTreeElement, elements: Array<TokenTreeElement>, parentChildrenMap: Map<string, Array<TokenTreeElement>>): GroupTree;
9
+ }
10
+ export declare function buildBrandedElementRoots(elements: TokenTreeElement[]): Map<string, Map<TokenType, GroupTree>>;
@@ -0,0 +1,20 @@
1
+ import { Token, TokenGroup } from '../../../..';
2
+ import { GroupTree } from './SDKDTGroupTree';
3
+ export type GroupTreeNodeWalker = (node: GroupTreeNode, path: GroupTreeNode[]) => void;
4
+ export type TokenTreeElement = Token | TokenGroup;
5
+ export declare class GroupTreeNode {
6
+ children: GroupTreeNode[];
7
+ element: TokenTreeElement;
8
+ tree: GroupTree;
9
+ get isGroup(): boolean;
10
+ get name(): string;
11
+ constructor(element: TokenTreeElement, tree: GroupTree);
12
+ applyDefaultSorting(): void;
13
+ protected addChildInternal(child: GroupTreeNode, atIndex?: number): void;
14
+ protected populate(childrenMap: Map<string, TokenTreeElement[]>): void;
15
+ private createGroupChild;
16
+ addChildGroup(groupElement: TokenTreeElement): GroupTreeNode;
17
+ getOrCreateGroup(path: Array<string>): GroupTreeNode;
18
+ forEach(callback: GroupTreeNodeWalker, leafsFirst?: boolean): void;
19
+ private forEachInternal;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { TokenTreeElement } from "./SDKDTGroupTreeNode";
2
+ export declare const MAX_SORT_ORDER: number;
3
+ export declare function buildParentChildrenMap(elements: TokenTreeElement[]): {
4
+ childrenMap: Map<string, TokenTreeElement[]>;
5
+ };
@@ -0,0 +1,57 @@
1
+ import { DesignSystemVersion } from "../../core/SDKDesignSystemVersion";
2
+ import { Supernova } from "../../core/SDKSupernova";
3
+ import { TokenType } from "../../model/enums/SDKTokenType";
4
+ import { TokenGroup } from "../../model/groups/SDKTokenGroup";
5
+ import { Token } from "../../model/tokens/SDKToken";
6
+ export type TokenJSONBuilderOptions = {
7
+ /** Conversion method to be used for token names. Original will use actual token name */
8
+ naming: JSONBuilderNamingOption;
9
+ /** When enabled, brandId will be included in every token */
10
+ includeBrandId: boolean;
11
+ /** When enabled, comments will be included in tokens that have description */
12
+ includeComments: boolean;
13
+ /** When provided, tokens will be filtered to only show tokens belonging to this brand */
14
+ brandId: string | null;
15
+ /** When enabled, type will be included in every token */
16
+ includeType: boolean;
17
+ /** When enabled, root category node will be generated. If type === null, multiple root nodes will be generated, one for each type */
18
+ includeRootTypeNodes: boolean;
19
+ /** When provided, only tokens of one category will be generated. Providing null will generate all tokens regardless of type */
20
+ type: TokenType | null;
21
+ /** When enabled, output will be split into multiple files. Ignored for now */
22
+ multifile: boolean;
23
+ };
24
+ export type TokenJSONBuilderOptionsInternal = TokenJSONBuilderOptions & {
25
+ consumerMode: ConsumerMode;
26
+ };
27
+ export declare enum JSONBuilderNamingOption {
28
+ original = "original",
29
+ camelcase = "camelcase",
30
+ snakecase = "snakecase",
31
+ kebabcase = "kebabcase"
32
+ }
33
+ declare enum ConsumerMode {
34
+ styleDictionary = 0,
35
+ figmaTokens = 1
36
+ }
37
+ /** JSON builder tooling object. Allows to build full token JSON definition for different styles of outputs, like Style Dictionary or Figma Tokens plugin */
38
+ export declare class TokenJSONBuilder {
39
+ private instance;
40
+ private version;
41
+ private tokenTransformer;
42
+ constructor(instance: Supernova, version: DesignSystemVersion);
43
+ /** Fetches all tokens available for selected design system version, and converts them to style dictionary representation. */
44
+ styleDictionaryRepresentation(options: TokenJSONBuilderOptions): Promise<Object>;
45
+ /** Fetches all tokens available for selected design system version, and converts them to figma tokens representation. */
46
+ figmaTokensRepresentation(isSingleFile: boolean): Promise<Object>;
47
+ private buildTokenStructure;
48
+ /** Generate style dictionary tree */
49
+ private generateStyleDictionaryTree;
50
+ /** Construct tree out of one specific group, independent of tree type */
51
+ private representTree;
52
+ /** Find all tokens that belong to a certain group and retrieve them as objects */
53
+ static tokensOfGroup(containingGroup: TokenGroup, allTokens: Array<Token>): Array<Token>;
54
+ /** Retrieve chain of groups up to a specified group, ordered from parent to children */
55
+ static referenceGroupChain(containingGroup: TokenGroup): Array<TokenGroup>;
56
+ }
57
+ export {};
@@ -0,0 +1,40 @@
1
+ import { TokenGroup } from "../../../model/groups/SDKTokenGroup";
2
+ import { Token } from "../../../model/tokens/SDKToken";
3
+ import { BorderTokenValue, ColorTokenValue, FontTokenValue, GradientTokenValue, MeasureTokenValue, RadiusTokenValue, ShadowTokenValue, TextTokenValue, TypographyTokenValue } from "../../../model/tokens/SDKTokenValue";
4
+ import { JSONBuilderNamingOption, TokenJSONBuilderOptionsInternal } from "../SDKToolsJSONBuilder";
5
+ import { TokenJSONElementTransformer } from "./SDKToolsJSONElementTransformer";
6
+ /** Token transformer that allow generic transform of tokens to different destinations, like Style Dictionary or Figma Tokens representation */
7
+ export declare class TokenJSONElementFigmaTokensTransformer extends TokenJSONElementTransformer {
8
+ /** Represent color token value either as reference or as plain representation */
9
+ representColorTokenValue(value: ColorTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
10
+ /** Represent radius token value either as reference or as plain representation */
11
+ representRadiusTokenValue(value: RadiusTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
12
+ /** Represent measure token value either as reference or as plain representation */
13
+ representMeasureTokenValue(value: MeasureTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
14
+ /** Represent font token value either as reference or as plain representation */
15
+ representFontTokenValue(value: FontTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
16
+ /** Represent text token value either as reference or as plain representation */
17
+ representTextTokenValue(value: TextTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
18
+ /** Represent typography token value either as reference or as plain representation */
19
+ representTypographyTokenValue(value: TypographyTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
20
+ /** Represent border token value either as reference or as plain representation */
21
+ representBorderTokenValue(value: BorderTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
22
+ /** Represent shadow token value either as reference or as plain representation */
23
+ representShadowTokenValue(value: ShadowTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
24
+ /** Represent gradient token value either as reference or as plain representation */
25
+ representGradientTokenValue(value: GradientTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
26
+ /** Retrieve token wrapper containing its metadata and value information (used as container for each defined token) */
27
+ tokenWrapper(token: Token, value: any, options: TokenJSONBuilderOptionsInternal): Object;
28
+ /** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
29
+ typeLabelConsideringAbstractGroups(token: Token): "border" | "color" | "fontSize" | "letterSpacing" | "lineHeight" | "paragraphSpacing" | "font" | "gradient" | "radius" | "shadow" | "text" | "typography" | "sizing" | "borderWidth" | "spacing" | "opacity" | "dimension" | "borderRadius";
30
+ /** Retrieve wrapper to certain token (referenced by name) pointing to token value */
31
+ referenceWrapper(reference: string, options: TokenJSONBuilderOptionsInternal): string;
32
+ /** Retrieve safe group name made out of normal group name
33
+ * This replace spaces with dashes, also change anything non-alphanumeric char to it as well.
34
+ * For example, ST&RK Industries will be changed to st-rk-industries
35
+ */
36
+ safeGroupName(group: TokenGroup, naming: JSONBuilderNamingOption): string;
37
+ /** Create full reference name representing token. Such name can, for example, look like: [g1].[g2].[g3].[g4].[token-name] */
38
+ referenceName(token: Token, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): string;
39
+ groupIsAbstract(group: TokenGroup): boolean;
40
+ }
@@ -0,0 +1,29 @@
1
+ import { TokenGroup } from "../../../model/groups/SDKTokenGroup";
2
+ import { Token } from "../../../model/tokens/SDKToken";
3
+ import { BorderTokenValue, ColorTokenValue, FontTokenValue, GradientTokenValue, MeasureTokenValue, RadiusTokenValue, ShadowTokenValue, TextTokenValue, TypographyTokenValue } from "../../../model/tokens/SDKTokenValue";
4
+ import { TokenJSONBuilderOptionsInternal } from "../SDKToolsJSONBuilder";
5
+ import { TokenJSONElementTransformer } from "./SDKToolsJSONElementTransformer";
6
+ /** Token transformer that allow generic transform of tokens to different destinations, like Style Dictionary or Figma Tokens representation */
7
+ export declare class TokenJSONElementStyleDictionaryTransformer extends TokenJSONElementTransformer {
8
+ /** Represent color token value either as reference or as plain representation */
9
+ representColorTokenValue(value: ColorTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
10
+ /** Represent radius token value either as reference or as plain representation */
11
+ representRadiusTokenValue(value: RadiusTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
12
+ /** Represent measure token value either as reference or as plain representation */
13
+ representMeasureTokenValue(value: MeasureTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
14
+ /** Represent font token value either as reference or as plain representation */
15
+ representFontTokenValue(value: FontTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
16
+ /** Represent text token value either as reference or as plain representation */
17
+ representTextTokenValue(value: TextTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
18
+ /** Represent typography token value either as reference or as plain representation */
19
+ representTypographyTokenValue(value: TypographyTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
20
+ /** Represent border token value either as reference or as plain representation */
21
+ representBorderTokenValue(value: BorderTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
22
+ /** Represent shadow token value either as reference or as plain representation */
23
+ representShadowTokenValue(value: ShadowTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
24
+ /** Represent gradient token value either as reference or as plain representation */
25
+ representGradientTokenValue(value: GradientTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
26
+ /** Retrieve wrapper to certain token (referenced by name) pointing to token value */
27
+ referenceWrapper(reference: string, options: TokenJSONBuilderOptionsInternal): string;
28
+ groupIsAbstract(group: TokenGroup): boolean;
29
+ }
@@ -0,0 +1,77 @@
1
+ import { TokenType } from "../../../model/enums/SDKTokenType";
2
+ import { TokenGroup } from "../../../model/groups/SDKTokenGroup";
3
+ import { BorderToken } from "../../../model/tokens/SDKBorderToken";
4
+ import { ColorToken } from "../../../model/tokens/SDKColorToken";
5
+ import { FontToken } from "../../../model/tokens/SDKFontToken";
6
+ import { GradientToken } from "../../../model/tokens/SDKGradientToken";
7
+ import { MeasureToken } from "../../../model/tokens/SDKMeasureToken";
8
+ import { RadiusToken } from "../../../model/tokens/SDKRadiusToken";
9
+ import { ShadowToken } from "../../../model/tokens/SDKShadowToken";
10
+ import { TextToken } from "../../../model/tokens/SDKTextToken";
11
+ import { Token } from "../../../model/tokens/SDKToken";
12
+ import { BorderTokenValue, ColorTokenValue, FontTokenValue, GradientTokenValue, MeasureTokenValue, RadiusTokenValue, ShadowTokenValue, TextTokenValue, TypographyTokenValue } from "../../../model/tokens/SDKTokenValue";
13
+ import { TypographyToken } from "../../../model/tokens/SDKTypographyToken";
14
+ import { JSONBuilderNamingOption, TokenJSONBuilderOptionsInternal } from "../SDKToolsJSONBuilder";
15
+ /** Token transformer that allow generic transform of tokens to different destinations, like Style Dictionary or Figma Tokens representation */
16
+ export declare class TokenJSONElementTransformer {
17
+ /** Represent a singular token as SD object */
18
+ representToken(token: Token, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
19
+ /** Represent full color token, including wrapping meta-information such as user description */
20
+ representColorToken(token: ColorToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
21
+ /** Represent full border token, including wrapping meta-information such as user description */
22
+ representBorderToken(token: BorderToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
23
+ /** Represent full font token, including wrapping meta-information such as user description */
24
+ representFontToken(token: FontToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
25
+ /** Represent full gradient token, including wrapping meta-information such as user description */
26
+ representGradientToken(token: GradientToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
27
+ /** Represent full measure token, including wrapping meta-information such as user description */
28
+ representMeasureToken(token: MeasureToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
29
+ /** Represent full radius token, including wrapping meta-information such as user description */
30
+ representRadiusToken(token: RadiusToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
31
+ /** Represent full shadow token, including wrapping meta-information such as user description */
32
+ representShadowToken(token: ShadowToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
33
+ /** Represent full text token, including wrapping meta-information such as user description */
34
+ representTextToken(token: TextToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
35
+ /** Represent full typography token, including wrapping meta-information such as user description */
36
+ representTypographyToken(token: TypographyToken, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): Object;
37
+ /** Represent color token value either as reference or as plain representation */
38
+ representColorTokenValue(value: ColorTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
39
+ /** Represent radius token value either as reference or as plain representation */
40
+ representRadiusTokenValue(value: RadiusTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
41
+ /** Represent measure token value either as reference or as plain representation */
42
+ representMeasureTokenValue(value: MeasureTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
43
+ /** Represent font token value either as reference or as plain representation */
44
+ representFontTokenValue(value: FontTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
45
+ /** Represent text token value either as reference or as plain representation */
46
+ representTextTokenValue(value: TextTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
47
+ /** Represent typography token value either as reference or as plain representation */
48
+ representTypographyTokenValue(value: TypographyTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
49
+ /** Represent border token value either as reference or as plain representation */
50
+ representBorderTokenValue(value: BorderTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
51
+ /** Represent shadow token value either as reference or as plain representation */
52
+ representShadowTokenValue(value: ShadowTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
53
+ /** Represent gradient token value either as reference or as plain representation */
54
+ representGradientTokenValue(value: GradientTokenValue, allTokens: Array<Token>, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): any;
55
+ /** Retrieve wrapper to certain token (referenced by name) pointing to token value */
56
+ referenceWrapper(reference: string, options: TokenJSONBuilderOptionsInternal): void;
57
+ /** Retrieve token wrapper containing its metadata and value information (used as container for each defined token) */
58
+ tokenWrapper(token: Token, value: any, options: TokenJSONBuilderOptionsInternal): Object;
59
+ /** Create full reference name representing token. Such name can, for example, look like: [g1].[g2].[g3].[g4].[token-name] */
60
+ referenceName(token: Token, allGroups: Array<TokenGroup>, options: TokenJSONBuilderOptionsInternal): string;
61
+ /** Retrieve safe token name made out of normal token name
62
+ * This replace spaces with dashes, also change anything non-alphanumeric char to it as well.
63
+ * For example, ST&RK Industries will be changed to st-rk-industries
64
+ */
65
+ safeTokenName(token: Token, naming: JSONBuilderNamingOption): string;
66
+ /** Retrieve safe group name made out of normal group name
67
+ * This replace spaces with dashes, also change anything non-alphanumeric char to it as well.
68
+ * For example, ST&RK Industries will be changed to st-rk-industries
69
+ */
70
+ safeGroupName(group: TokenGroup, naming: JSONBuilderNamingOption): string;
71
+ processedName(name: string, naming: JSONBuilderNamingOption): string;
72
+ /** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
73
+ typeLabel(type: TokenType): "border" | "color" | "font" | "gradient" | "measure" | "radius" | "shadow" | "text" | "typography";
74
+ /** Retrieve chain of groups up to a specified group, ordered from parent to children */
75
+ referenceGroupChain(containingGroup: TokenGroup): Array<TokenGroup>;
76
+ groupIsAbstract(group: TokenGroup): boolean;
77
+ }
@@ -0,0 +1,23 @@
1
+ import { DesignSystemVersion } from '../../core/SDKDesignSystemVersion';
2
+ import { DocumentationPageBlockType } from '../../exports';
3
+ import { DocumentationPage } from '../../model/documentation/SDKDocumentationPage';
4
+ import { MarkdownTransformBlock } from './SDKToolsMarkdownTransformBlock';
5
+ /** Output markdown mode. Commonmark and GitHub is currently supported */
6
+ export declare enum MarkdownTransformType {
7
+ commonmark = "commonmark",
8
+ github = "github"
9
+ }
10
+ /** Markdown transformers */
11
+ export declare class MarkdownTransform {
12
+ conversionType: MarkdownTransformType;
13
+ blockTransformer: MarkdownTransformBlock;
14
+ version: DesignSystemVersion;
15
+ constructor(type: MarkdownTransformType, version: DesignSystemVersion);
16
+ /** Converts entire definition of the page, including its metadata like title and description, to markdown */
17
+ convertPageToMarkdown(page: DocumentationPage): Promise<string>;
18
+ /** Creates flattened structure of the blocks, even from the contained blocks, so it is easier to iterate through them */
19
+ private flattenedBlocksOfPage;
20
+ /** Flattens one leaf of blocks */
21
+ private flattenedBlocksOfBlock;
22
+ isContainer(blockType: DocumentationPageBlockType): boolean;
23
+ }
@@ -0,0 +1,75 @@
1
+ import { DesignSystemVersion } from '../../core/SDKDesignSystemVersion';
2
+ import { DocumentationPageBlockAssets } from '../../model/documentation/blocks/SDKDocumentationPageBlockAssets';
3
+ import { DocumentationPageBlockCallout } from '../../model/documentation/blocks/SDKDocumentationPageBlockCallout';
4
+ import { DocumentationPageBlockCode } from '../../model/documentation/blocks/SDKDocumentationPageBlockCode';
5
+ import { DocumentationPageBlockColumn } from '../../model/documentation/blocks/SDKDocumentationPageBlockColumn';
6
+ import { DocumentationPageBlockColumnItem } from '../../model/documentation/blocks/SDKDocumentationPageBlockColumnItem';
7
+ import { DocumentationPageBlockCustom } from '../../model/documentation/blocks/SDKDocumentationPageBlockCustom';
8
+ import { DocumentationPageBlockDivider } from '../../model/documentation/blocks/SDKDocumentationPageBlockDivider';
9
+ import { DocumentationPageBlockEmbedFigma } from '../../model/documentation/blocks/SDKDocumentationPageBlockEmbedFigma';
10
+ import { DocumentationPageBlockEmbedGeneric } from '../../model/documentation/blocks/SDKDocumentationPageBlockEmbedGeneric';
11
+ import { DocumentationPageBlockEmbedLink } from '../../model/documentation/blocks/SDKDocumentationPageBlockEmbedLink';
12
+ import { DocumentationPageBlockEmbedStorybook } from '../../model/documentation/blocks/SDKDocumentationPageBlockEmbedStorybook';
13
+ import { DocumentationPageBlockEmbedYoutube } from '../../model/documentation/blocks/SDKDocumentationPageBlockEmbedYoutube';
14
+ import { DocumentationPageBlockFrames } from '../../model/documentation/blocks/SDKDocumentationPageBlockFrames';
15
+ import { DocumentationPageBlockHeading } from '../../model/documentation/blocks/SDKDocumentationPageBlockHeading';
16
+ import { DocumentationPageBlockImage } from '../../model/documentation/blocks/SDKDocumentationPageBlockImage';
17
+ import { DocumentationPageOrderedList } from '../../model/documentation/blocks/SDKDocumentationPageBlockOrderedList';
18
+ import { DocumentationPageBlockQuote } from '../../model/documentation/blocks/SDKDocumentationPageBlockQuote';
19
+ import { DocumentationPageBlockRenderCode } from '../../model/documentation/blocks/SDKDocumentationPageBlockRenderCode';
20
+ import { DocumentationPageBlockShortcuts } from '../../model/documentation/blocks/SDKDocumentationPageBlockShortcuts';
21
+ import { DocumentationPageBlockTab } from '../../model/documentation/blocks/SDKDocumentationPageBlockTab';
22
+ import { DocumentationPageBlockTabItem } from '../../model/documentation/blocks/SDKDocumentationPageBlockTabItem';
23
+ import { DocumentationPageBlockTable } from '../../model/documentation/blocks/SDKDocumentationPageBlockTable';
24
+ import { DocumentationPageBlockTableCell } from '../../model/documentation/blocks/SDKDocumentationPageBlockTableCell';
25
+ import { DocumentationPageBlockTableRow } from '../../model/documentation/blocks/SDKDocumentationPageBlockTableRow';
26
+ import { DocumentationPageBlockText } from '../../model/documentation/blocks/SDKDocumentationPageBlockText';
27
+ import { DocumentationPageBlockToken } from '../../model/documentation/blocks/SDKDocumentationPageBlockToken';
28
+ import { DocumentationPageBlockTokenGroup } from '../../model/documentation/blocks/SDKDocumentationPageBlockTokenGroup';
29
+ import { DocumentationPageBlockTokenList } from '../../model/documentation/blocks/SDKDocumentationPageBlockTokenList';
30
+ import { DocumentationPageUnorderedList } from '../../model/documentation/blocks/SDKDocumentationPageBlockUnorderedList';
31
+ import { DocumentationPage } from '../../model/documentation/SDKDocumentationPage';
32
+ import { DocumentationPageBlock } from '../../model/documentation/SDKDocumentationPageBlock';
33
+ import { MarkdownTransformType } from './SDKToolsMarkdownTransform';
34
+ /** Markdown block transformer */
35
+ export declare class MarkdownTransformBlock {
36
+ private transformType;
37
+ private utilTransformer;
38
+ private version;
39
+ newlineSeparator: string;
40
+ constructor(type: MarkdownTransformType, version: DesignSystemVersion);
41
+ /** Converts a single block - depending on the type - to a markdown definition of specific type */
42
+ convertBlockToMarkdown(block: DocumentationPageBlock, pageContext: DocumentationPage): Promise<string | null>;
43
+ convertHeadingBlock(block: DocumentationPageBlockHeading): string | null;
44
+ convertCalloutBlock(block: DocumentationPageBlockCallout): string | null;
45
+ convertQuoteBlock(block: DocumentationPageBlockQuote): string | null;
46
+ convertDividerBlock(block: DocumentationPageBlockDivider): string | null;
47
+ convertImageBlock(block: DocumentationPageBlockImage): string | null;
48
+ convertOrderedListBlock(block: DocumentationPageOrderedList): string | null;
49
+ convertUnorderedListBlock(block: DocumentationPageUnorderedList): string | null;
50
+ convertLiveCodeBlock(block: DocumentationPageBlockRenderCode): string | null;
51
+ convertCodeBlock(block: DocumentationPageBlockCode): string | null;
52
+ convertTextBlock(block: DocumentationPageBlockText): string | null;
53
+ convertGenericEmbedBlock(block: DocumentationPageBlockEmbedGeneric): string | null;
54
+ convertStorybookEmbedBlock(block: DocumentationPageBlockEmbedStorybook): string | null;
55
+ convertLinkBlock(block: DocumentationPageBlockEmbedLink): string | null;
56
+ convertYoutubeEmbedBlock(block: DocumentationPageBlockEmbedYoutube): string | null;
57
+ convertFigmaEmbedBlock(block: DocumentationPageBlockEmbedFigma): string | null;
58
+ convertTokenBlock(block: DocumentationPageBlockToken): Promise<string | null>;
59
+ convertTokenListBlock(block: DocumentationPageBlockTokenList): Promise<string | null>;
60
+ convertTokenGroupBlock(block: DocumentationPageBlockTokenGroup): Promise<string | null>;
61
+ private flattenedGroupsFromRoot;
62
+ convertComponentAssetBlock(block: DocumentationPageBlockAssets): Promise<string | null>;
63
+ convertFigmaFramesBlock(block: DocumentationPageBlockFrames): string | null;
64
+ convertShortcutsBlock(block: DocumentationPageBlockShortcuts, pageContext: DocumentationPage): Promise<string | null>;
65
+ private relativePathToPage;
66
+ convertTableBlock(block: DocumentationPageBlockTable, pageContext: DocumentationPage): Promise<string | null>;
67
+ convertTableRowBlock(block: DocumentationPageBlockTableRow): string | null;
68
+ convertTableCellBlock(block: DocumentationPageBlockTableCell, pageContext: DocumentationPage): Promise<string | null>;
69
+ convertTabsBlock(block: DocumentationPageBlockTab, pageContext: DocumentationPage): Promise<string | null>;
70
+ convertTabItemBlock(block: DocumentationPageBlockTabItem, pageContext: DocumentationPage): Promise<string | null>;
71
+ convertColumnBlock(block: DocumentationPageBlockColumn, pageContext: DocumentationPage): Promise<string | null>;
72
+ convertColumnItemBlock(block: DocumentationPageBlockColumnItem, pageContext: DocumentationPage): Promise<string | null>;
73
+ convertCustomBlock(block: DocumentationPageBlockCustom): string | null;
74
+ convertURLBlock(block: DocumentationPageBlockEmbedGeneric, userAction: string, showLink: boolean): string | null;
75
+ }
@@ -0,0 +1,26 @@
1
+ import { DocumentationRichText } from '../../model/documentation/SDKDocumentationRichText';
2
+ import { MarkdownTransformType } from './SDKToolsMarkdownTransform';
3
+ import { DocumentationPageBlockText } from '../../model/documentation/blocks/SDKDocumentationPageBlockText';
4
+ import { DesignSystemVersion } from '../../core/SDKDesignSystemVersion';
5
+ import { Token } from '../..';
6
+ /** Markdown block transformer */
7
+ export declare class MarkdownTransformUtil {
8
+ private transformType;
9
+ private version;
10
+ private tokenTransformer;
11
+ constructor(type: MarkdownTransformType, version: DesignSystemVersion);
12
+ /** Converts rich text block to markdown
13
+ *
14
+ * This is very naive implementation and will break in complicated cases, like double control characters of the same type next to each other
15
+ * Must improve later with something more sophisticated, ideally tree builder with branched resolution.
16
+ */
17
+ convertTextBlockToMarkdown(block: DocumentationPageBlockText): string | null;
18
+ /** Converts rich text to markdown
19
+ *
20
+ * This is very naive implementation and will break in complicated cases, like double control characters of the same type next to each other
21
+ * Must improve later with something more sophisticated, ideally tree builder with branched resolution.
22
+ */
23
+ convertRichTextToMarkdown(richText: DocumentationRichText): string;
24
+ /** Convert token to markdown representation */
25
+ convertTokenToMarkdown(token: Token): string;
26
+ }
@@ -0,0 +1,47 @@
1
+ import Fuse from "fuse.js";
2
+ import { DocumentationPage } from "../../model/documentation/SDKDocumentationPage";
3
+ export declare enum DocSearchResultDataType {
4
+ contentBlock = "contentBlock",
5
+ sectionHeader = "sectionHeader",
6
+ pageTitle = "pageTitle"
7
+ }
8
+ export type DocSearchResult = {
9
+ item: DocSearchResultData;
10
+ refIndex: number;
11
+ };
12
+ export type DocSearchResultData = {
13
+ id: number;
14
+ pageName: string;
15
+ pageId: string;
16
+ blockId: string | undefined;
17
+ text: string;
18
+ type: DocSearchResultDataType;
19
+ };
20
+ export type DocSearchConfiguration = {
21
+ shouldSort?: boolean;
22
+ threshold?: number;
23
+ location?: number;
24
+ distance?: number;
25
+ maxPatternLength?: number;
26
+ minMatchCharLength?: number;
27
+ ignoreLocation?: boolean;
28
+ keys: Array<string>;
29
+ };
30
+ /** Search manager */
31
+ export declare class DocSearch {
32
+ searchEngine: Fuse<object>;
33
+ searchConfiguration: DocSearchConfiguration;
34
+ constructor(configuration: DocSearchConfiguration);
35
+ updateSearchIndex: (pages: Array<DocumentationPage>) => Array<DocSearchResultData>;
36
+ search: (input: string) => Array<DocSearchResult>;
37
+ /** When using this configuration, the results will be very precise and will not be deviating too much from the query */
38
+ static defaultPreciseConfiguration(): DocSearchConfiguration;
39
+ /** When using this configuration, the results will be more fuzzy and might cover broader spectrum results than just near-keyword based search */
40
+ static defaultFuzzyConfiguration(): DocSearchConfiguration;
41
+ /** Reconstructs the search index */
42
+ private reconstructSearchIndex;
43
+ /** Creates flattened structure of the blocks, even from the contained blocks, so it is easier to iterate through them */
44
+ private flattenedBlocksOfPage;
45
+ /** Flattens one leaf of blocks */
46
+ private flattenedBlocksOfBlock;
47
+ }
@@ -0,0 +1,44 @@
1
+ import { Token } from '../../model/tokens/SDKToken';
2
+ import { ColorToken } from '../../model/tokens/SDKColorToken';
3
+ import { BlurTokenValue, BorderTokenValue, ColorTokenValue, FontTokenValue, GenericTokenValue, GradientTokenValue, MeasureTokenValue, RadiusTokenValue, ShadowTokenValue, TextTokenValue, TypographyTokenValue } from '../../model/tokens/SDKTokenValue';
4
+ /** Token data transformer. Use for direct representation of token to other representations, such as CSS, rgb etc. More transformers will be added over time */
5
+ export declare class TokenTransform {
6
+ constructor();
7
+ /** Converts a single token to CSS definition. Values are always resolved to plain values, references to other tokens are not yet supported */
8
+ tokenToCSS(token: Token): string;
9
+ /** Converts token to appropriate css variable definition --(name): css_definition */
10
+ tokenToCSSVariableDeclaration(token: Token, variableName: string): string;
11
+ /** Converts color token value to css definition */
12
+ colorTokenToCSS(value: ColorTokenValue): string;
13
+ /** Converts border token value to css definition */
14
+ borderTokenToCSS(value: BorderTokenValue): string;
15
+ /** Converts shadow token value to css definition */
16
+ shadowTokenToCSS(value: ShadowTokenValue): string;
17
+ /** Converts typography token value to css definition */
18
+ typographyTokenToCSS(value: TypographyTokenValue): string;
19
+ /** Converts border token value to css definition */
20
+ blurTokenToCSS(value: BlurTokenValue): string;
21
+ /** Converts border token value to css definition */
22
+ measureTokenToCSS(value: MeasureTokenValue): string;
23
+ private unitToCSS;
24
+ /** Converts border token value to css definition */
25
+ radiusTokenToCSS(value: RadiusTokenValue): string;
26
+ /** Converts gradient token value to css definition */
27
+ gradientTokenToCSS(value: GradientTokenValue): string;
28
+ /** Converts font token value to css definition */
29
+ fontTokenToCSS(value: FontTokenValue): string;
30
+ /** Converts generic token value to css definition */
31
+ genericTokenToCSS(value: GenericTokenValue): string;
32
+ /** Converts generic token value to css definition */
33
+ textTokenToCSS(value: TextTokenValue): string;
34
+ /** Converts a single color token to #hheexx or #hheexxaa */
35
+ colorTokenToHEXorHEXA(colorToken: ColorToken): string;
36
+ /** Converts a single color token to rgba(x,x,x,x) */
37
+ colorTokenToRGBA(colorToken: ColorToken): string;
38
+ /** Converts a single color token to rgba(x,x,x,x) with relative values */
39
+ colorTokenToPercenageRGBA(colorToken: ColorToken): string;
40
+ /** Converts a single color token to hsla(x,x,x,x) */
41
+ colorTokenToHSLA(colorToken: ColorToken): string;
42
+ /** Converts a single color token to hsva(x,x,x,x) */
43
+ colorTokenToHSVA(colorToken: ColorToken): string;
44
+ }
@@ -0,0 +1,5 @@
1
+ export declare class FlowUtils {
2
+ static offsetLines(content: string, by: number, character: string): string;
3
+ static offsetLinesIgnoreFirst(content: string, by: number, character: string): string;
4
+ static offsetLinesCanIgnoreFirstline(content: string, shouldIgnoreFirstLine: boolean, userOffset: number, nodeOffset: number, character: string): string;
5
+ }