@supernova-studio/supernova-sdk-beta 1.6.14 → 1.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/sdk-typescript/src/core/areas/SDKAreaBulkOperations.d.ts +1 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaComponents.d.ts +114 -2
- package/build/sdk-typescript/src/core/areas/SDKAreaTokenValues.d.ts +3 -7
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +41 -2
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +18 -2
- package/build/sdk-typescript/src/exports.d.ts +4 -2
- package/build/sdk-typescript/src/model/components/SDKComponent.d.ts +3 -1
- package/build/sdk-typescript/src/model/elements/SDKElementPropertyOption.d.ts +5 -0
- package/build/sdk-typescript/src/model/enums/SDKTokenType.d.ts +2 -2
- package/build/sdk-typescript/src/model/groups/SDKComponentGroup.d.ts +1 -0
- package/build/sdk-typescript/src/model/themes/SDKTokenTheme.d.ts +3 -3
- package/build/sdk-typescript/src/model/themes/SDKTokenThemeOverride.d.ts +3 -3
- package/build/sdk-typescript/src/model/tokens/SDKColorToken.d.ts +3 -0
- package/build/sdk-typescript/src/model/tokens/SDKDimensionToken.d.ts +8 -1
- package/build/sdk-typescript/src/tests/validators.d.ts +1 -0
- package/build/sdk-typescript/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +1 -1
- package/build/sdk-typescript/src/utils/ComponentUtils.d.ts +12 -0
- package/build/sdk-typescript/src/utils/TokenUtils.d.ts +137 -2
- package/build/supernova-sdk-typescript.js +1911 -871
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export type TokenUpdateTransactionData = {
|
|
|
11
11
|
tokenMode: "create" | "update";
|
|
12
12
|
propertyValuesToCreateOrUpdate?: Array<{
|
|
13
13
|
property: ElementProperty;
|
|
14
|
-
value: string | boolean;
|
|
14
|
+
value: string | boolean | number;
|
|
15
15
|
}>;
|
|
16
16
|
propertyValuesToDelete?: Array<string>;
|
|
17
17
|
themesToUpdate?: Array<TokenTheme>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Component } from "../../model/components/SDKComponent";
|
|
2
2
|
import { DesignComponent } from "../../model/components/SDKDesignComponent";
|
|
3
3
|
import { ElementDataView } from "../../model/elements/SDKElementDataView";
|
|
4
|
-
import {
|
|
4
|
+
import { ElementDataViewColumn } from "../../model/elements/SDKElementDataViewColumn";
|
|
5
|
+
import { ElementProperty, ElementPropertyCreationModel, ElementPropertyUpdateModel } from "../../model/elements/SDKElementProperty";
|
|
6
|
+
import { ElementPropertyValue } from "../../model/elements/values/SDKElementPropertyValue";
|
|
5
7
|
import { ComponentGroup } from "../../model/groups/SDKComponentGroup";
|
|
6
8
|
import { DesignComponentGroup } from "../../model/groups/SDKDesignComponentGroup";
|
|
7
9
|
import { DataCore } from "../data/SDKDataCore";
|
|
@@ -30,14 +32,124 @@ export declare class AreaComponents {
|
|
|
30
32
|
* @returns All design component groups in the specified version
|
|
31
33
|
*/
|
|
32
34
|
getDesignComponentGroups(from: RemoteVersionIdentifier): Promise<Array<DesignComponentGroup>>;
|
|
33
|
-
/** Retrieves all remote properties for
|
|
35
|
+
/** Retrieves all remote properties for components
|
|
34
36
|
* @param from - Remote version to fetch from
|
|
35
37
|
* @returns All component properties in the specified version
|
|
36
38
|
*/
|
|
37
39
|
getComponentProperties(from: RemoteVersionIdentifier): Promise<Array<ElementProperty>>;
|
|
40
|
+
/** Retrieves all remote property definitions for components
|
|
41
|
+
* @param from - Remote version to fetch from
|
|
42
|
+
* @returns All property definitions in the specified version
|
|
43
|
+
*/
|
|
44
|
+
getComponentPropertyValues(from: RemoteVersionIdentifier): Promise<Array<ElementPropertyValue>>;
|
|
38
45
|
/** Retrieves all remote property views for components
|
|
39
46
|
* @param from - Remote version to fetch from
|
|
40
47
|
* @returns All component views in the specified version
|
|
41
48
|
*/
|
|
42
49
|
getComponentDataViews(from: RemoteVersionIdentifier): Promise<Array<ElementDataView>>;
|
|
50
|
+
/** Creates remote component. This method can only be used once per component and will assign persistent id to the component. Calling this version on component that already has id assigned will result in error
|
|
51
|
+
* @param to - Remote version to write to
|
|
52
|
+
* @param component - Component to create
|
|
53
|
+
* @param parentId - Id of the group to add the component to. This is id of the group, not the versioned id
|
|
54
|
+
* @returns New remote component ids
|
|
55
|
+
*/
|
|
56
|
+
createComponent(to: RemoteVersionIdentifier, component: Component, parentId: string): Promise<{
|
|
57
|
+
id: string;
|
|
58
|
+
idInVersion: string;
|
|
59
|
+
}>;
|
|
60
|
+
/** Creates local component. This component doesn't have id associated with it on remote, and must be created once with `createComponent` to be stored in design system
|
|
61
|
+
* @returns New component filled with default values not associated with remote (yet)
|
|
62
|
+
*/
|
|
63
|
+
createLocalComponent(versionId: string, brandId: string): Component;
|
|
64
|
+
/** Creates remote component group. This method can only be used once per group and will assign persistent id to the group. Calling this version on group that already has id assigned will result in error
|
|
65
|
+
* @param to - Remote version to write to
|
|
66
|
+
* @param group - Group to create
|
|
67
|
+
* @param parentId - Id of the group to add the group to. This is id of the group, not the versioned id
|
|
68
|
+
* @returns New remote component group ids
|
|
69
|
+
*/
|
|
70
|
+
createComponentGroup(to: RemoteVersionIdentifier, group: ComponentGroup, parentId: string): Promise<{
|
|
71
|
+
id: string;
|
|
72
|
+
idInVersion: string;
|
|
73
|
+
}>;
|
|
74
|
+
/** Creates local component group. This group doesn't have id associated with it on remote, and must be created once with `createComponentGroup` to be stored in design system
|
|
75
|
+
* @param versionId - Id of the version to create the group in
|
|
76
|
+
* @param brandId - Id of the brand to create the group in
|
|
77
|
+
* @returns New group with id assigned
|
|
78
|
+
*/
|
|
79
|
+
createLocalComponentGroup(versionId: string, brandId: string): ComponentGroup;
|
|
80
|
+
/** Updates remote component. This method can only be used on components that already exist in the version
|
|
81
|
+
* @param to - Remote version to write to
|
|
82
|
+
* @param component - Component to update
|
|
83
|
+
* @returns Nothing
|
|
84
|
+
*/
|
|
85
|
+
updateComponent(to: RemoteVersionIdentifier, component: Component): Promise<void>;
|
|
86
|
+
/** Updates remote component groups. This method can only be used on component groups that already exist in the version
|
|
87
|
+
* @param to - Remote version to write to
|
|
88
|
+
* @param component - Component group to update
|
|
89
|
+
* @returns Nothing
|
|
90
|
+
*/
|
|
91
|
+
updateComponentGroup(to: RemoteVersionIdentifier, group: ComponentGroup): Promise<void>;
|
|
92
|
+
/** Updates remote component property value. This also creates the property value if it doesn't exist
|
|
93
|
+
* @param to - Remote version to write to
|
|
94
|
+
* @param newValue - Value to set - this can be multiple things, from ID to raw string value to others
|
|
95
|
+
* @param forComponent - Component to assign the value to
|
|
96
|
+
* @param forProperty - Property to assign the value to
|
|
97
|
+
*/
|
|
98
|
+
updateComponentPropertyValue(to: RemoteVersionIdentifier, newValue: string, forComponent: Component, forProperty: ElementProperty): Promise<void>;
|
|
99
|
+
/** Deletes remote component property value
|
|
100
|
+
* @param to - Remote version to write to
|
|
101
|
+
* @param valueId - Value identifier
|
|
102
|
+
*/
|
|
103
|
+
deleteComponentPropertyValue(to: RemoteVersionIdentifier, valueId: string): Promise<void>;
|
|
104
|
+
/** Create component property
|
|
105
|
+
* @param to - Remote version to write to
|
|
106
|
+
* @param model - Property creation model to create the property from
|
|
107
|
+
*/
|
|
108
|
+
createComponentProperty(to: RemoteVersionIdentifier, model: ElementPropertyCreationModel): Promise<{
|
|
109
|
+
id: string;
|
|
110
|
+
idInVersion: string;
|
|
111
|
+
}>;
|
|
112
|
+
/** Update component property
|
|
113
|
+
* @param to - Remote version to write to
|
|
114
|
+
* @param propertyIdInVersion - Remote element property to update
|
|
115
|
+
* @param model - Property update model to apply to property
|
|
116
|
+
*/
|
|
117
|
+
updateComponentProperty(to: RemoteVersionIdentifier, propertyIdInVersion: string, model: ElementPropertyUpdateModel): Promise<void>;
|
|
118
|
+
/** Delete component property. This will remove all values associated with the property
|
|
119
|
+
* @param to - Remote version to write to
|
|
120
|
+
* @param propertyIdInVersion - Id of the property to delete
|
|
121
|
+
*/
|
|
122
|
+
deleteComponentProperty(to: RemoteVersionIdentifier, propertyIdInVersion: string): Promise<void>;
|
|
123
|
+
/** Resize specific component column
|
|
124
|
+
* @param to - Remote version to write to
|
|
125
|
+
* @param columnIdInVersion - Id of the column to update
|
|
126
|
+
* @param newWidth - New width of the column
|
|
127
|
+
*/
|
|
128
|
+
updateResizeComponentColumn(to: RemoteVersionIdentifier, view: ElementDataView, column: ElementDataViewColumn, newWidth: number): Promise<void>;
|
|
129
|
+
/** Move column to a new index and reorder all other columns around it
|
|
130
|
+
* @param to - Remote version to write to
|
|
131
|
+
* @param colum - Column object to move
|
|
132
|
+
* @param newIndex - New index to move the component to
|
|
133
|
+
*/
|
|
134
|
+
updateReorderComponentColumn(to: RemoteVersionIdentifier, view: ElementDataView, column: ElementDataViewColumn, newIndex: number): Promise<void>;
|
|
135
|
+
/** Deletes remote component. Calling this method on component that doesn't exist in the version will result in error
|
|
136
|
+
* @param to - Remote version to write to
|
|
137
|
+
* @param componentIdInVersion - Component idInVersion to delete
|
|
138
|
+
* @returns Nothing
|
|
139
|
+
*/
|
|
140
|
+
deleteComponent(to: RemoteVersionIdentifier, componentIdInVersion: string): Promise<void>;
|
|
141
|
+
/** Deletes remote component group. This method will also fix the component group tree by moving any subgroups to parent - do note it will NOT delete contents of the group. Calling this method on group that doesn't exist in the version will result in error
|
|
142
|
+
* @param to - Remote version to write to
|
|
143
|
+
* @param componentGroupIdInVersion - Component group idInVersion to delete
|
|
144
|
+
* @returns Nothing
|
|
145
|
+
*/
|
|
146
|
+
ungroupComponentGroup(to: RemoteVersionIdentifier, componentGroupIdInVersion: string): Promise<void>;
|
|
147
|
+
/** Deletes remote component group and all its descendants. All items (groups and components) underneath will be deleted. Calling this method on group that doesn't exist in the version will result in error
|
|
148
|
+
* @param to - Remote version to write to
|
|
149
|
+
* @param componentGroupToDelete - Component group to delete
|
|
150
|
+
* @param allComponents - Components for lookup
|
|
151
|
+
* @param allComponentGroup - Component group for lookup
|
|
152
|
+
* @returns Nothing
|
|
153
|
+
*/
|
|
154
|
+
deleteComponentGroup(to: RemoteVersionIdentifier, componentGroupToDelete: ComponentGroup, components: Array<Component>, componentGroups: Array<ComponentGroup>): Promise<void>;
|
|
43
155
|
}
|
|
@@ -32,6 +32,8 @@ export declare class AreaTokenValues {
|
|
|
32
32
|
typographyTokenByUpdatingParagraphIndent(token: TypographyToken, newValue: RawValue<ParagraphSpacingTokenValue> | ParagraphSpacingToken): TypographyToken;
|
|
33
33
|
/** Creates a new border token with updated .position value */
|
|
34
34
|
typographyTokenByUpdatingTextDecoration(token: TypographyToken, newValue: RawValue<TextDecorationTokenValue> | TextDecorationToken): TypographyToken;
|
|
35
|
+
/** Creates a new typography token with updated .textCase value */
|
|
36
|
+
typographyTokenByUpdatingTextCase(token: TypographyToken, newValue: RawValue<TextCaseTokenValue> | TextCaseToken): TypographyToken;
|
|
35
37
|
/** Creates a new border token with updated .color value. Do note, opacity is ignored */
|
|
36
38
|
borderTokenByUpdatingColor(token: BorderToken, newValue: ColorValue | ColorToken): BorderToken;
|
|
37
39
|
/** Creates a new border token with updated color.opacity value */
|
|
@@ -117,12 +119,10 @@ export declare class AreaTokenValues {
|
|
|
117
119
|
position: number;
|
|
118
120
|
color: ColorTokenValue | ColorToken;
|
|
119
121
|
}>): GradientToken;
|
|
120
|
-
/** Builds the gradient stop data from the elementary values */
|
|
121
|
-
private gradientStopsFromRawData;
|
|
122
122
|
/** Creates a new token where value is reference to the provided token. Token and reference must be of the same type */
|
|
123
123
|
tokenByReferencing<T extends AnyToken>(token: T, reference: T): T;
|
|
124
124
|
/** Creates a new multilayer token where one of the layers is reference to the provided token. Token and reference must be of the same type */
|
|
125
|
-
multilayerTokenByReferencing<T extends AnyMultiLayerToken>(token: T, layerIndex: number, reference:
|
|
125
|
+
multilayerTokenByReferencing<T extends AnyMultiLayerToken, R extends T>(token: T, layerIndex: number, reference: R): T;
|
|
126
126
|
/** Creates a new token where value is raw, but taken from the previously referenced token. Token must have had reference before */
|
|
127
127
|
tokenByDisconnectingReference<T extends AnySingleLayerToken>(token: T): T;
|
|
128
128
|
/** Creates a new multilayer token where one of the layers value is raw, but taken from the previously referenced token. That layer must have had reference before */
|
|
@@ -133,8 +133,4 @@ export declare class AreaTokenValues {
|
|
|
133
133
|
isReferencedMultilayerTokenLayer(token: AnyMultiLayerToken, layerIndex: number): boolean;
|
|
134
134
|
/** Checks if a token was imported from some foreign source. Not imported tokens were always created in Supernova */
|
|
135
135
|
isTokenImported(token: AnyToken): boolean;
|
|
136
|
-
private checkNotReference;
|
|
137
|
-
private rawOrReferencedDimensionValue;
|
|
138
|
-
private rawOrReferencedStringValue;
|
|
139
|
-
private validateLayerAccess;
|
|
140
136
|
}
|
|
@@ -72,7 +72,7 @@ export declare class DataCore {
|
|
|
72
72
|
elementPropertyValues(designSystemId: string, versionId: string): Promise<Array<ElementPropertyValue>>;
|
|
73
73
|
/** Download all necessary data for element views and retrieve them resolved */
|
|
74
74
|
elementViews(designSystemId: string, versionId: string, type: ElementPropertyTargetElementType): Promise<Array<ElementDataView>>;
|
|
75
|
-
/** Download all
|
|
75
|
+
/** Download all necessary data for tokens and retrieve them resolved */
|
|
76
76
|
tokens(designSystemId: string, versionId: string, filter?: {
|
|
77
77
|
type?: TokenType;
|
|
78
78
|
brandId?: string;
|
|
@@ -122,7 +122,7 @@ export declare class DataCore {
|
|
|
122
122
|
deleteTokenGroup(designSystemId: string, versionId: string, tokenGroupToDelete: TokenGroup, tokens: Array<Token>, tokenGroups: Array<TokenGroup>): Promise<void>;
|
|
123
123
|
private itemsToDeleteFromGroup;
|
|
124
124
|
/** Update token property at remote */
|
|
125
|
-
updateTokenPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean, token: Token, property: ElementProperty): Promise<void>;
|
|
125
|
+
updateTokenPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean | number, token: Token, property: ElementProperty): Promise<void>;
|
|
126
126
|
/** Delete token property in remote */
|
|
127
127
|
deleteTokenPropertyValue(designSystemId: string, versionId: string, valueId: string): Promise<void>;
|
|
128
128
|
/** Create a custom property in remote */
|
|
@@ -146,6 +146,45 @@ export declare class DataCore {
|
|
|
146
146
|
componentGroups(designSystemId: string, versionId: string): Promise<Array<ComponentGroup>>;
|
|
147
147
|
designComponents(designSystemId: string, versionId: string): Promise<Array<DesignComponent>>;
|
|
148
148
|
designComponentGroups(designSystemId: string, versionId: string): Promise<Array<DesignComponentGroup>>;
|
|
149
|
+
/** Write new component to remote */
|
|
150
|
+
createComponent(designSystemId: string, versionId: string, component: Component, parentId: string): Promise<{
|
|
151
|
+
id: string;
|
|
152
|
+
idInVersion: string;
|
|
153
|
+
}>;
|
|
154
|
+
/** Update existing component in remote */
|
|
155
|
+
updateComponent(designSystemId: string, versionId: string, component: Component): Promise<void>;
|
|
156
|
+
/** Write new component group to remote */
|
|
157
|
+
createComponentGroup(designSystemId: string, versionId: string, group: ComponentGroup, parentId: string): Promise<{
|
|
158
|
+
id: string;
|
|
159
|
+
idInVersion: string;
|
|
160
|
+
}>;
|
|
161
|
+
/** Update existing component group in remote */
|
|
162
|
+
updateComponentGroup(designSystemId: string, versionId: string, group: ComponentGroup): Promise<void>;
|
|
163
|
+
/** Update component property at remote */
|
|
164
|
+
updateComponentPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean, component: Component, property: ElementProperty): Promise<void>;
|
|
165
|
+
/** Delete component property in remote */
|
|
166
|
+
deleteComponentPropertyValue(designSystemId: string, versionId: string, valueId: string): Promise<void>;
|
|
167
|
+
/** Create a custom property in remote */
|
|
168
|
+
createComponentProperty(designSystemId: string, versionId: string, model: ElementPropertyCreationModel): Promise<{
|
|
169
|
+
id: string;
|
|
170
|
+
idInVersion: string;
|
|
171
|
+
}>;
|
|
172
|
+
/** Create a custom property in remote */
|
|
173
|
+
updateComponentProperty(designSystemId: string, versionId: string, propertyIdInVersion: string, model: ElementPropertyUpdateModel): Promise<void>;
|
|
174
|
+
/** Delete a custom property in remote */
|
|
175
|
+
deleteComponentProperty(designSystemId: string, versionId: string, propertyId: string): Promise<void>;
|
|
176
|
+
/** Move column to a new index and reorder all other columns around it */
|
|
177
|
+
updateReorderComponentColumn(designSystemId: string, versionId: string, view: ElementDataView, column: ElementDataViewColumn, newIndex: number): Promise<void>;
|
|
178
|
+
/** Update column size */
|
|
179
|
+
updateResizeComponentColumn(designSystemId: string, versionId: string, view: ElementDataView, column: ElementDataViewColumn, newWidth: number): Promise<void>;
|
|
180
|
+
/** Delete component from remote */
|
|
181
|
+
deleteComponent(designSystemId: string, versionId: string, componentId: string): Promise<void>;
|
|
182
|
+
/** Delete group from remote */
|
|
183
|
+
ungroupComponentGroup(designSystemId: string, versionId: string, groupId: string): Promise<void>;
|
|
184
|
+
/** Delete group from remote */
|
|
185
|
+
deleteComponentGroup(designSystemId: string, versionId: string, componentGroupToDelete: ComponentGroup, components: Array<Component>, componentGroups: Array<ComponentGroup>): Promise<void>;
|
|
186
|
+
/** Write the component to remote */
|
|
187
|
+
writeComponentData(designSystemId: string, versionId: string, components: Array<Component>, groups: Array<ComponentGroup>, deleteComponents: Array<Component>, deleteGroups: Array<ComponentGroup>): Promise<void>;
|
|
149
188
|
/** Download all necessary data for assets and retrieve them resolved */
|
|
150
189
|
assets(designSystemId: string, versionId: string): Promise<Array<Asset>>;
|
|
151
190
|
/** Download all necessary data for asset groups and retrieve them resolved */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DocumentationEnvironment } from "../../../model/enums/SDKDocumentationEnvironment";
|
|
2
2
|
import { ElementDataViewColumnType } from "../../../exports";
|
|
3
|
+
import { Component, ComponentRemoteModel } from "../../../model/components/SDKComponent";
|
|
3
4
|
import { ElementPropertyRemoteModel } from "../../../model/elements/SDKElementProperty";
|
|
5
|
+
import { ComponentGroup, ComponentGroupRemoteModel } from "../../../model/groups/SDKComponentGroup";
|
|
4
6
|
import { TokenGroup, TokenGroupRemoteModel } from "../../../model/groups/SDKTokenGroup";
|
|
5
7
|
import { TokenThemeRemoteModel } from "../../../model/themes/SDKTokenTheme";
|
|
6
8
|
import { TokenRemoteModel } from "../../../model/tokens/remote/SDKRemoteTokenModel";
|
|
@@ -64,12 +66,26 @@ export declare class DataCoreWriteRequests {
|
|
|
64
66
|
deleteRemoteTokenTheme(designSystemId: string, versionId: string, themeId: string): Promise<void>;
|
|
65
67
|
writeTokenData(designSystemId: string, versionId: string, tokens: Array<TokenRemoteModel>, groups: Array<TokenGroupRemoteModel>, deleteTokens: Array<Token>, deleteTokenGroups: Array<TokenGroup>): Promise<void>;
|
|
66
68
|
writeTokenThemeData(designSystemId: string, versionId: string, theme: TokenThemeRemoteModel): Promise<void>;
|
|
67
|
-
updateTokenPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean, tokenId: string, propertyId: string): Promise<void>;
|
|
69
|
+
updateTokenPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean | number, tokenId: string, propertyId: string): Promise<void>;
|
|
68
70
|
deleteTokenPropertyValue(designSystemId: string, versionId: string, valueId: string): Promise<void>;
|
|
69
71
|
createTokenProperty(designSystemId: string, versionId: string, model: object): Promise<ElementPropertyRemoteModel>;
|
|
70
72
|
updateTokenProperty(designSystemId: string, versionId: string, propertyIdInVersion: string, model: object): Promise<void>;
|
|
71
73
|
deleteTokenProperty(designSystemId: string, versionId: string, propertyId: string): Promise<void>;
|
|
72
74
|
updateReorderTokenColumn(designSystemId: string, versionId: string, viewId: string, columnId: string, newIndex: number): Promise<void>;
|
|
73
|
-
updateResizeTokenColumn(designSystemId: string, versionId: string, viewId: string, columnType: ElementDataViewColumnType, columnId: string, columnThemeId: string | undefined, columnBasePropertyType: string | undefined, newWidth: number): Promise<void>;
|
|
75
|
+
updateResizeTokenColumn(designSystemId: string, versionId: string, viewId: string, columnType: ElementDataViewColumnType, columnId: string, columnThemeId: string | undefined, columnBasePropertyType: string | undefined, columnPropertyDefinitionId: string | undefined, newWidth: number): Promise<void>;
|
|
76
|
+
createRemoteComponent(designSystemId: string, versionId: string, component: ComponentRemoteModel): Promise<ComponentRemoteModel>;
|
|
77
|
+
updateRemoteComponent(designSystemId: string, versionId: string, component: ComponentRemoteModel): Promise<ComponentRemoteModel>;
|
|
78
|
+
createRemoteComponentGroup(designSystemId: string, versionId: string, group: ComponentGroupRemoteModel): Promise<ComponentGroupRemoteModel>;
|
|
79
|
+
updateRemoteComponentGroup(designSystemId: string, versionId: string, group: ComponentGroupRemoteModel): Promise<void>;
|
|
80
|
+
deleteRemoteComponent(designSystemId: string, versionId: string, componentId: string): Promise<void>;
|
|
81
|
+
ungroupRemoteComponentGroup(designSystemId: string, versionId: string, componentGroupId: string): Promise<void>;
|
|
82
|
+
writeComponentData(designSystemId: string, versionId: string, components: Array<ComponentRemoteModel>, groups: Array<ComponentGroupRemoteModel>, deleteComponents: Array<Component>, deleteComponentGroups: Array<ComponentGroup>): Promise<void>;
|
|
83
|
+
updateComponentPropertyValue(designSystemId: string, versionId: string, newValue: string | boolean, componentId: string, propertyId: string): Promise<void>;
|
|
84
|
+
deleteComponentPropertyValue(designSystemId: string, versionId: string, valueId: string): Promise<void>;
|
|
85
|
+
createComponentProperty(designSystemId: string, versionId: string, model: object): Promise<ElementPropertyRemoteModel>;
|
|
86
|
+
updateComponentProperty(designSystemId: string, versionId: string, propertyIdInVersion: string, model: object): Promise<void>;
|
|
87
|
+
deleteComponentProperty(designSystemId: string, versionId: string, propertyId: string): Promise<void>;
|
|
88
|
+
updateReorderComponentColumn(designSystemId: string, versionId: string, viewId: string, columnId: string, newIndex: number): Promise<void>;
|
|
89
|
+
updateResizeComponentColumn(designSystemId: string, versionId: string, viewId: string, columnType: ElementDataViewColumnType, columnId: string, columnThemeId: string | undefined, columnBasePropertyType: string | undefined, columnPropertyDefinitionId: string | undefined, newWidth: number): Promise<void>;
|
|
74
90
|
writeTokenStudioJSONData(designSystemId: string, versionId: string, data: object): Promise<boolean>;
|
|
75
91
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export { ThemeUtilities } from "./model/themes/SDKThemeUtilities";
|
|
1
2
|
export { ElementPropertyValue } from "./model/elements/values/SDKElementPropertyValue";
|
|
2
3
|
export { TokenUtilPreviewSegmentGenerator } from "./tools/token-preview/TokenUtilPreviewSegmentGenerator";
|
|
3
4
|
export { TokenTypeMapToken } from "./utils/TokenUtils";
|
|
4
|
-
export {
|
|
5
|
+
export { TokenUtils } from "./utils/TokenUtils";
|
|
6
|
+
export { DimensionTokenType, DIMENSION_TOKEN_TYPES, StringTokenType, STRING_TOKEN_TYPES, OptionTokenType, OPTION_TOKEN_TYPES, } from "./model/enums/SDKTokenType";
|
|
5
7
|
export { Supernova } from "./core/SDKSupernova";
|
|
6
8
|
export { Workspace } from "./model/workspaces/SDKWorkspace";
|
|
7
9
|
export { WorkspaceProfile, WorkspaceProfileUpdateModel, } from "./model/workspaces/SDKWorkspaceProfile";
|
|
@@ -30,7 +32,7 @@ export { Asset } from "./model/assets/SDKAsset";
|
|
|
30
32
|
export { RenderedAsset } from "./model/assets/SDKRenderedAsset";
|
|
31
33
|
export { Component } from "./model/components/SDKComponent";
|
|
32
34
|
export { ElementProperty, ElementPropertyLinkElementType, ElementPropertyTargetElementType, ElementPropertyType, } from "./model/elements/SDKElementProperty";
|
|
33
|
-
export { ElementPropertyOption } from "./model/elements/SDKElementPropertyOption";
|
|
35
|
+
export { ElementPropertyOption, ElementPropertyOptionBadgeColor, } from "./model/elements/SDKElementPropertyOption";
|
|
34
36
|
export { ElementDataView } from "./model/elements/SDKElementDataView";
|
|
35
37
|
export { ElementDataViewColumn, ElementDataViewColumnBasePropertyType, ElementDataViewColumnType, } from "./model/elements/SDKElementDataViewColumn";
|
|
36
38
|
export { DesignComponent } from "./model/components/SDKDesignComponent";
|
|
@@ -11,10 +11,11 @@ export type ComponentRemoteModel = {
|
|
|
11
11
|
};
|
|
12
12
|
createdAt?: string;
|
|
13
13
|
updatedAt?: string;
|
|
14
|
+
groupPersistentId?: string;
|
|
14
15
|
};
|
|
15
16
|
export declare class Component {
|
|
17
|
+
idInVersion: string;
|
|
16
18
|
id: string;
|
|
17
|
-
persistentId: string;
|
|
18
19
|
designSystemVersionId: string;
|
|
19
20
|
brandId: string;
|
|
20
21
|
name: string;
|
|
@@ -24,4 +25,5 @@ export declare class Component {
|
|
|
24
25
|
createdAt: Date | null;
|
|
25
26
|
updatedAt: Date | null;
|
|
26
27
|
constructor(model: ComponentRemoteModel, properties: Array<ElementProperty>, propertyValues: Array<ElementPropertyValue>);
|
|
28
|
+
toWriteObject(): ComponentRemoteModel;
|
|
27
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type ElementPropertyOptionBadgeColor = "blue" | "cyan" | "fuchsia" | "green" | "grey" | "light-grey" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "custom";
|
|
1
2
|
export type ElementPropertyOptionRemoteModel = {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -14,4 +15,8 @@ export declare class ElementPropertyOption {
|
|
|
14
15
|
constructor(model: ElementPropertyOptionRemoteModel);
|
|
15
16
|
/** Constructs directly manipulable update object for user profile */
|
|
16
17
|
toUpdateObject(): ElementPropertyOptionUpdateModel;
|
|
18
|
+
/** Returns background color represented as badge color. If badge color is different than what badge defines as base, return custom. Note: Only temporary implementation until BE supports it properly */
|
|
19
|
+
asBadgeColor(): ElementPropertyOptionBadgeColor;
|
|
20
|
+
/** Sets background color based on badge identifier color. Note: Only temporary implementation until BE supports it properly */
|
|
21
|
+
setFromBadgeColor(color: ElementPropertyOptionBadgeColor): void;
|
|
17
22
|
}
|
|
@@ -34,10 +34,10 @@ export type DimensionTokenType = (typeof DIMENSION_TOKEN_TYPES)[number];
|
|
|
34
34
|
export declare const RAW_DIMENSION_TOKEN_TYPES: TokenType[];
|
|
35
35
|
export declare const MS_DIMENSION_TOKEN_TYPES: TokenType[];
|
|
36
36
|
export declare const ALL_TOKEN_TYPES: TokenType[];
|
|
37
|
-
export declare const PURE_TOKEN_TYPES: readonly [TokenType.
|
|
37
|
+
export declare const PURE_TOKEN_TYPES: readonly [TokenType.dimension, TokenType.size, TokenType.space, TokenType.opacity, TokenType.fontSize, TokenType.lineHeight, TokenType.letterSpacing, TokenType.paragraphSpacing, TokenType.borderWidth, TokenType.radius, TokenType.duration, TokenType.zIndex, TokenType.string, TokenType.productCopy, TokenType.fontFamily, TokenType.fontWeight, TokenType.textCase, TokenType.textDecoration, TokenType.visibility];
|
|
38
38
|
export type PureTokenType = (typeof PURE_TOKEN_TYPES)[number];
|
|
39
39
|
export type NonPureTokenType = Exclude<TokenType, PureTokenType>;
|
|
40
|
-
export declare const tokenTypeIsPure: (tokenType: TokenType) => tokenType is TokenType.
|
|
40
|
+
export declare const tokenTypeIsPure: (tokenType: TokenType) => tokenType is TokenType.dimension | TokenType.size | TokenType.space | TokenType.opacity | TokenType.fontSize | TokenType.lineHeight | TokenType.letterSpacing | TokenType.paragraphSpacing | TokenType.borderWidth | TokenType.radius | TokenType.duration | TokenType.zIndex | TokenType.string | TokenType.productCopy | TokenType.fontFamily | TokenType.fontWeight | TokenType.textCase | TokenType.textDecoration | TokenType.visibility;
|
|
41
41
|
export declare const tokenTypeIsNonPure: (tokenType: TokenType) => tokenType is NonPureTokenType;
|
|
42
42
|
export declare const REPLACABLE_TOKEN_TYPES: readonly [TokenType.color, TokenType.dimension, TokenType.size, TokenType.space, TokenType.opacity, TokenType.fontSize, TokenType.lineHeight, TokenType.letterSpacing, TokenType.paragraphSpacing, TokenType.borderWidth, TokenType.radius, TokenType.duration, TokenType.zIndex, TokenType.string, TokenType.productCopy, TokenType.fontFamily, TokenType.fontWeight, TokenType.textCase, TokenType.textDecoration, TokenType.visibility];
|
|
43
43
|
export type ReplacableTokenType = (typeof REPLACABLE_TOKEN_TYPES)[number];
|
|
@@ -42,14 +42,14 @@ export declare class TokenTheme {
|
|
|
42
42
|
} | {
|
|
43
43
|
aliasTo: string;
|
|
44
44
|
value: import("../tokens/remote/SDKRemoteTokenValue").ColorTokenRemoteValue;
|
|
45
|
-
} | {
|
|
46
|
-
aliasTo: string;
|
|
47
|
-
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
48
45
|
} | {
|
|
49
46
|
aliasTo: string;
|
|
50
47
|
value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
|
|
51
48
|
} | {
|
|
52
49
|
aliasTo: string;
|
|
53
50
|
value: string;
|
|
51
|
+
} | {
|
|
52
|
+
aliasTo: string;
|
|
53
|
+
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
@@ -28,14 +28,14 @@ export declare class TokenThemeOverride {
|
|
|
28
28
|
} | {
|
|
29
29
|
aliasTo: string;
|
|
30
30
|
value: import("../tokens/remote/SDKRemoteTokenValue").ColorTokenRemoteValue;
|
|
31
|
-
} | {
|
|
32
|
-
aliasTo: string;
|
|
33
|
-
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
34
31
|
} | {
|
|
35
32
|
aliasTo: string;
|
|
36
33
|
value: import("../tokens/remote/SDKRemoteTokenValue").AnyDimensionTokenRemoteValue;
|
|
37
34
|
} | {
|
|
38
35
|
aliasTo: string;
|
|
39
36
|
value: string;
|
|
37
|
+
} | {
|
|
38
|
+
aliasTo: string;
|
|
39
|
+
value: import("../tokens/remote/SDKRemoteTokenValue").TypographyTokenRemoteValue;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -20,6 +20,9 @@ export declare class ColorToken extends Token {
|
|
|
20
20
|
toHex8(): string;
|
|
21
21
|
static colorValueToHex6(value: ColorTokenValue): string;
|
|
22
22
|
static colorValueToHex8(value: ColorTokenValue): string;
|
|
23
|
+
/** Normalizes any color value to server readable value, and ignores alpha value optionally */
|
|
24
|
+
static colorStringToNormalizedServerValue(value: string | undefined | null, ignoreAlpha?: boolean): string;
|
|
25
|
+
static normalizedDefaultServerValue(): string;
|
|
23
26
|
updateWithRawValue(value: Omit<ColorTokenValue, "referencedTokenId">): void;
|
|
24
27
|
updateWithReferencedValue(value: ColorToken): void;
|
|
25
28
|
toWriteObject(): ColorTokenRemoteModel;
|
|
@@ -22,7 +22,14 @@ export declare class DimensionCategoryToken<T extends AnyDimensionTokenValue> ex
|
|
|
22
22
|
};
|
|
23
23
|
static dimensionValueFromDefinitionOrReference(definition: any, referenceResolver: DTTokenReferenceResolver, tokenType: DimensionTokenType): BorderWidthTokenValue;
|
|
24
24
|
toString(): string;
|
|
25
|
-
static valueToString(value: AnyDimensionTokenValue
|
|
25
|
+
static valueToString(value: AnyDimensionTokenValue, options?: {
|
|
26
|
+
maxNumberOfDecimals?: number;
|
|
27
|
+
clipTrailingZeroes?: boolean;
|
|
28
|
+
}): string;
|
|
29
|
+
static numberToString(value: number, options?: {
|
|
30
|
+
maxNumberOfDecimals?: number;
|
|
31
|
+
clipTrailingZeroes?: boolean;
|
|
32
|
+
}): string;
|
|
26
33
|
static unitToString(unit: Unit): string;
|
|
27
34
|
toWriteObject(): DimensionTokenRemoteModel;
|
|
28
35
|
static valueToWriteObject(value: AnyDimensionTokenValue): {
|
|
@@ -78,6 +78,7 @@ export declare const validateNoToken: (t: any, tokens: Token[], name: string) =>
|
|
|
78
78
|
export declare const validateTokenRef: (t: any, tokens: Token[], description: string, hex: string, name: string, refDescription?: string) => void;
|
|
79
79
|
export declare const validateTokensJustColorRef: (t: any, token: ColorToken, colorRef: ColorToken, name: string, hex: string, opacity?: number, colorRefId?: string, colorRefName?: string, refHex?: string, refOpacity?: number) => void;
|
|
80
80
|
export declare const validateTokenJustColorRef: (t: any, tokens: Token[], name: string, hex: string, opacity?: number, colorRefId?: string, colorRefName?: string, refHex?: string, refOpacity?: number) => void;
|
|
81
|
+
export declare const validateColorTokenJustOpacityRef: (t: any, tokens: Token[], name: string, opacity: number, unit: Unit, opacityRefId: string, opacityRefName: string) => void;
|
|
81
82
|
export declare const validateDimensionTokenRef: (t: any, tokens: Token[], description: string, refName: string, measure: number, unit: Unit) => void;
|
|
82
83
|
export declare const validateBorderTokenRef: (t: any, tokens: Token[], description: string, refName: string, hex: string, position: BorderPosition, style: BorderStyle, measure: number, unit: Unit) => void;
|
|
83
84
|
export declare const validateBorderTokenInnerRef: (t: any, tokens: Token[], name: string, hex: string, position: BorderPosition, style: BorderStyle, measure: number, unit: Unit) => void;
|
|
@@ -62,7 +62,7 @@ export declare class TokenJSONElementTransformer {
|
|
|
62
62
|
safeGroupName(group: TokenGroup): string;
|
|
63
63
|
processedName(name: string, naming: JSONBuilderNamingOption): string;
|
|
64
64
|
/** Retrieve human-readable token type in unified fashion, used both as token type and as token master group */
|
|
65
|
-
typeLabel(type: TokenType): "color" | "gradient" | "typography" | "border" | "textCase" | "textDecoration" | "shadow" | "visibility" | "
|
|
65
|
+
typeLabel(type: TokenType): "color" | "gradient" | "typography" | "border" | "textCase" | "textDecoration" | "shadow" | "visibility" | "text" | "measure";
|
|
66
66
|
/** Retrieve chain of groups up to a specified group, ordered from parent to children */
|
|
67
67
|
referenceGroupChain(containingGroup: TokenGroup, allGroups: Array<TokenGroup>): Array<TokenGroup>;
|
|
68
68
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from "../model/components/SDKComponent";
|
|
2
|
+
import { ComponentGroup } from "../model/groups/SDKComponentGroup";
|
|
3
|
+
export declare class ComponentUtils {
|
|
4
|
+
/** Map components for lookup */
|
|
5
|
+
static componentsToReferenceMap(components: Array<Component>): Map<string, Component>;
|
|
6
|
+
/** Map component groups for lookup */
|
|
7
|
+
static componentGroupsToReferenceMap(groups: Array<ComponentGroup>): Map<string, ComponentGroup>;
|
|
8
|
+
/** Creates a new component group. Default values will be used for all properties */
|
|
9
|
+
static createDefaultComponentGroup(versionId: string, brandId: string, name?: string): ComponentGroup;
|
|
10
|
+
/** Creates a new component. Default values will be used for all properties */
|
|
11
|
+
static createDefaultComponent(versionId: string, brandId: string, name?: string): Component;
|
|
12
|
+
}
|