@supernova-studio/supernova-sdk-beta 1.6.19 → 1.6.21
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/SDKAreaBrands.d.ts +18 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaVersions.d.ts +20 -1
- package/build/sdk-typescript/src/core/areas/SDKAreaWorkspaces.d.ts +8 -0
- package/build/sdk-typescript/src/core/data/SDKDataCore.d.ts +11 -2
- package/build/sdk-typescript/src/core/data/requests/SDKDataCoreWriteRequests.d.ts +17 -0
- package/build/sdk-typescript/src/exports.d.ts +1 -0
- package/build/sdk-typescript/src/model/base/SDKBrand.d.ts +5 -1
- package/build/sdk-typescript/src/model/base/SDKDesignSystemVersion.d.ts +5 -0
- package/build/sdk-typescript/src/model/support/SDKSource.d.ts +76 -70
- package/build/sdk-typescript/src/model/support/SDKTokenOrigin.d.ts +2 -0
- package/build/sdk-typescript/src/model/tokens/SDKTokenValue.d.ts +1 -0
- package/build/sdk-typescript/src/model/tokens/remote/SDKRemoteTokenModel.d.ts +2 -0
- package/build/sdk-typescript/src/model/users/SDKUser.d.ts +14 -0
- package/build/sdk-typescript/src/model/workspaces/SDKWorkspaceIPWhitelistSettings.d.ts +1 -1
- package/build/sdk-typescript/src/tests/Enterprise/PluginFigmaTokens.spec.d.ts +1 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTJSONConverter.d.ts +1 -0
- package/build/sdk-typescript/src/tools/design-tokens/utilities/SDKDTTokenReferenceResolver.d.ts +1 -0
- package/build/supernova-sdk-typescript.js +495 -226
- package/build/supernova-sdk-typescript.js.map +1 -1
- package/package.json +1 -1
|
@@ -35243,6 +35243,35 @@ class AreaBrands {
|
|
|
35243
35243
|
return this.dataCore.getBrand(from.designSystemId, from.versionId, from.brandId);
|
|
35244
35244
|
});
|
|
35245
35245
|
}
|
|
35246
|
+
/** Creates new brand and retrieves the newly created brand object.
|
|
35247
|
+
* @param from - Remote brand to fetch from
|
|
35248
|
+
* @param model - new brand model
|
|
35249
|
+
* @returns Newly created brand object
|
|
35250
|
+
*/
|
|
35251
|
+
createBrand(from, model) {
|
|
35252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35253
|
+
return this.dataCore.createBrand(from.designSystemId, from.versionId, model);
|
|
35254
|
+
});
|
|
35255
|
+
}
|
|
35256
|
+
/** Edits brand
|
|
35257
|
+
* @param from - Remote brand to fetch from
|
|
35258
|
+
* @param model - new version model
|
|
35259
|
+
* @returns nothing
|
|
35260
|
+
*/
|
|
35261
|
+
editBrand(from, brand) {
|
|
35262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35263
|
+
yield this.dataCore.editBrand(from.designSystemId, from.versionId, from.brandId, brand);
|
|
35264
|
+
});
|
|
35265
|
+
}
|
|
35266
|
+
/** Deletes brand
|
|
35267
|
+
* @param from - Remote brand to fetch from
|
|
35268
|
+
* @returns nothing
|
|
35269
|
+
*/
|
|
35270
|
+
deleteBrand(from) {
|
|
35271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35272
|
+
yield this.dataCore.deleteBrand(from.designSystemId, from.versionId, from.brandId);
|
|
35273
|
+
});
|
|
35274
|
+
}
|
|
35246
35275
|
}
|
|
35247
35276
|
exports.AreaBrands = AreaBrands;
|
|
35248
35277
|
|
|
@@ -36900,6 +36929,37 @@ class AreaVersions {
|
|
|
36900
36929
|
throw SDKSupernovaError_1.SupernovaError.fromMessage(`Unable to retrieve active version for design system id ${designSystemId} - no version is currently active in selected design system`);
|
|
36901
36930
|
});
|
|
36902
36931
|
}
|
|
36932
|
+
/** Creates new version and retrieves the newly created version object.
|
|
36933
|
+
* @param designSystemId - ID of the design system
|
|
36934
|
+
* @param model - new version model
|
|
36935
|
+
* @returns Newly created version object
|
|
36936
|
+
*/
|
|
36937
|
+
createVersion(designSystemId, model) {
|
|
36938
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36939
|
+
return this.dataCore.createVersion(designSystemId, model);
|
|
36940
|
+
});
|
|
36941
|
+
}
|
|
36942
|
+
/** Edits version
|
|
36943
|
+
* @param designSystemId - ID of the design system
|
|
36944
|
+
* @param versionId - ID of version
|
|
36945
|
+
* @param model - new version model
|
|
36946
|
+
* @returns nothing
|
|
36947
|
+
*/
|
|
36948
|
+
editVersion(designSystemId, versionId, model) {
|
|
36949
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36950
|
+
yield this.dataCore.editVersion(designSystemId, versionId, model);
|
|
36951
|
+
});
|
|
36952
|
+
}
|
|
36953
|
+
/** Deletes version
|
|
36954
|
+
* @param designSystemId - ID of the design system
|
|
36955
|
+
* @param versionId - ID of version
|
|
36956
|
+
* @returns nothing
|
|
36957
|
+
*/
|
|
36958
|
+
deleteVersion(designSystemId, versionId) {
|
|
36959
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36960
|
+
yield this.dataCore.deleteVersion(designSystemId, versionId);
|
|
36961
|
+
});
|
|
36962
|
+
}
|
|
36903
36963
|
/** Fetches all design system versions of provided design system */
|
|
36904
36964
|
getVersions(designSystemId) {
|
|
36905
36965
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37088,6 +37148,16 @@ class AreaWorkspaces {
|
|
|
37088
37148
|
return this.dataCore.updateWorkspaceProfile(workspaceId, update);
|
|
37089
37149
|
});
|
|
37090
37150
|
}
|
|
37151
|
+
/** tests accessibility of IP allowlist settings
|
|
37152
|
+
* @param workspaceId - ID of the workspace
|
|
37153
|
+
* @param ipWhitelistSettings - settings to test
|
|
37154
|
+
* @returns information if workspace is accesible by your IP
|
|
37155
|
+
*/
|
|
37156
|
+
testIpWhitelistSettings(workspaceId, ipWhitelistSettings) {
|
|
37157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37158
|
+
return this.dataCore.testIpWhitelistSettings(workspaceId, ipWhitelistSettings);
|
|
37159
|
+
});
|
|
37160
|
+
}
|
|
37091
37161
|
/** Updates workspace onboarding state for a specific workspace
|
|
37092
37162
|
* @param workspaceId - ID of the workspace
|
|
37093
37163
|
* @param update - New onboarding state
|
|
@@ -38238,6 +38308,38 @@ class DataCore {
|
|
|
38238
38308
|
return new SDKWorkspace_1.Workspace(data);
|
|
38239
38309
|
});
|
|
38240
38310
|
}
|
|
38311
|
+
createVersion(designSystemId, model) {
|
|
38312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38313
|
+
const data = yield this.write.createRemoteVersion(designSystemId, model);
|
|
38314
|
+
return new SDKDesignSystemVersion_1.DesignSystemVersion(data);
|
|
38315
|
+
});
|
|
38316
|
+
}
|
|
38317
|
+
editVersion(designSystemId, versionId, model) {
|
|
38318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38319
|
+
yield this.write.updateRemoteVersion(designSystemId, versionId, model);
|
|
38320
|
+
});
|
|
38321
|
+
}
|
|
38322
|
+
deleteVersion(designSystemId, versionId) {
|
|
38323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38324
|
+
yield this.write.deleteRemoteVersion(designSystemId, versionId);
|
|
38325
|
+
});
|
|
38326
|
+
}
|
|
38327
|
+
createBrand(designSystemId, versionId, model) {
|
|
38328
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38329
|
+
const data = yield this.write.createRemoteBrand(designSystemId, versionId, model);
|
|
38330
|
+
return new SDKBrand_1.Brand(data);
|
|
38331
|
+
});
|
|
38332
|
+
}
|
|
38333
|
+
editBrand(designSystemId, versionId, brandId, brand) {
|
|
38334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38335
|
+
yield this.write.updateRemoteBrand(designSystemId, versionId, brandId, brand);
|
|
38336
|
+
});
|
|
38337
|
+
}
|
|
38338
|
+
deleteBrand(designSystemId, versionId, brandId) {
|
|
38339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38340
|
+
yield this.write.deleteRemoteBrand(designSystemId, versionId, brandId);
|
|
38341
|
+
});
|
|
38342
|
+
}
|
|
38241
38343
|
/** Validate that workspace handle is available */
|
|
38242
38344
|
validateIsWorkspaceHandleAvailable(handle) {
|
|
38243
38345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38273,6 +38375,11 @@ class DataCore {
|
|
|
38273
38375
|
return this.write.updateRemoteWorkspaceProfile(workspaceId, profile);
|
|
38274
38376
|
});
|
|
38275
38377
|
}
|
|
38378
|
+
testIpWhitelistSettings(workspaceId, ipWhitelistSettings) {
|
|
38379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38380
|
+
return this.write.testIpWhitelistSettings(workspaceId, ipWhitelistSettings);
|
|
38381
|
+
});
|
|
38382
|
+
}
|
|
38276
38383
|
updateWorkspaceOnboarding(workspaceId, state) {
|
|
38277
38384
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38278
38385
|
return this.write.updateRemoteWorkspaceOnboarding(workspaceId, state);
|
|
@@ -39119,7 +39226,7 @@ exports.DataCoreRenderRequests = DataCoreRenderRequests;
|
|
|
39119
39226
|
/*!************************************************************!*\
|
|
39120
39227
|
!*** ./src/core/data/requests/SDKDataCoreWriteRequests.ts ***!
|
|
39121
39228
|
\************************************************************/
|
|
39122
|
-
/***/ (function(__unused_webpack_module, exports) {
|
|
39229
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
39123
39230
|
|
|
39124
39231
|
"use strict";
|
|
39125
39232
|
|
|
@@ -39141,6 +39248,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39141
39248
|
};
|
|
39142
39249
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
39143
39250
|
exports.DataCoreWriteRequests = void 0;
|
|
39251
|
+
const uuid_1 = __webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-node/index.js");
|
|
39144
39252
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
39145
39253
|
// MARK: - Request engine: Write
|
|
39146
39254
|
class DataCoreWriteRequests {
|
|
@@ -39209,6 +39317,73 @@ class DataCoreWriteRequests {
|
|
|
39209
39317
|
return payload.result.workspace;
|
|
39210
39318
|
});
|
|
39211
39319
|
}
|
|
39320
|
+
/** Remote: Creates a new version */
|
|
39321
|
+
createRemoteVersion(designSystemId, model) {
|
|
39322
|
+
var _a, _b;
|
|
39323
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39324
|
+
const endpoint = this.bridge.getDesignSystemEndpoint(designSystemId, "head/commit");
|
|
39325
|
+
const response = yield this.bridge.post(endpoint, {
|
|
39326
|
+
meta: {
|
|
39327
|
+
name: (_a = model.name) !== null && _a !== void 0 ? _a : "",
|
|
39328
|
+
description: (_b = model.description) !== null && _b !== void 0 ? _b : "",
|
|
39329
|
+
},
|
|
39330
|
+
version: model.version,
|
|
39331
|
+
changelog: "",
|
|
39332
|
+
});
|
|
39333
|
+
return response.result.designSystemVersion;
|
|
39334
|
+
});
|
|
39335
|
+
}
|
|
39336
|
+
/** Remote: Updates a version */
|
|
39337
|
+
updateRemoteVersion(designSystemId, versionId, model) {
|
|
39338
|
+
var _a, _b;
|
|
39339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39340
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, null);
|
|
39341
|
+
return this.bridge.put(endpoint, {
|
|
39342
|
+
meta: {
|
|
39343
|
+
name: (_a = model.name) !== null && _a !== void 0 ? _a : "",
|
|
39344
|
+
description: (_b = model.description) !== null && _b !== void 0 ? _b : "",
|
|
39345
|
+
},
|
|
39346
|
+
version: model.version,
|
|
39347
|
+
changelog: "",
|
|
39348
|
+
});
|
|
39349
|
+
});
|
|
39350
|
+
}
|
|
39351
|
+
/** Remote: Deletes a version */
|
|
39352
|
+
deleteRemoteVersion(designSystemId, versionId) {
|
|
39353
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39354
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, null);
|
|
39355
|
+
return this.bridge.delete(endpoint);
|
|
39356
|
+
});
|
|
39357
|
+
}
|
|
39358
|
+
/** Remote: Creates a new brand */
|
|
39359
|
+
createRemoteBrand(designSystemId, versionId, model) {
|
|
39360
|
+
var _a, _b;
|
|
39361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39362
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, "brands");
|
|
39363
|
+
const response = yield this.bridge.post(endpoint, {
|
|
39364
|
+
meta: {
|
|
39365
|
+
name: (_a = model.name) !== null && _a !== void 0 ? _a : "",
|
|
39366
|
+
description: (_b = model.description) !== null && _b !== void 0 ? _b : "",
|
|
39367
|
+
},
|
|
39368
|
+
persistentId: (0, uuid_1.v4)(),
|
|
39369
|
+
});
|
|
39370
|
+
return response.result.designSystemVersion;
|
|
39371
|
+
});
|
|
39372
|
+
}
|
|
39373
|
+
/** Remote: Updates a brand */
|
|
39374
|
+
updateRemoteBrand(designSystemId, versionId, brandId, brand) {
|
|
39375
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39376
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, `brands/${brandId}`);
|
|
39377
|
+
return this.bridge.put(endpoint, brand.toRemote());
|
|
39378
|
+
});
|
|
39379
|
+
}
|
|
39380
|
+
/** Remote: Deletes a brand */
|
|
39381
|
+
deleteRemoteBrand(designSystemId, versionId, brandId) {
|
|
39382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39383
|
+
const endpoint = this.bridge.getVersionEndpoint(designSystemId, versionId, `brands/${brandId}`);
|
|
39384
|
+
return this.bridge.delete(endpoint);
|
|
39385
|
+
});
|
|
39386
|
+
}
|
|
39212
39387
|
/** Remote: Updates a workspace profile */
|
|
39213
39388
|
updateRemoteWorkspaceProfile(workspaceId, profile) {
|
|
39214
39389
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -39216,6 +39391,13 @@ class DataCoreWriteRequests {
|
|
|
39216
39391
|
return this.bridge.put(endpoint, profile);
|
|
39217
39392
|
});
|
|
39218
39393
|
}
|
|
39394
|
+
testIpWhitelistSettings(workspaceId, ipWhitelistSettings) {
|
|
39395
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39396
|
+
const endpoint = this.bridge.getWorkspaceEndpoint(workspaceId, "ip-whitelist-test");
|
|
39397
|
+
const response = yield this.bridge.post(endpoint, ipWhitelistSettings);
|
|
39398
|
+
return response.result;
|
|
39399
|
+
});
|
|
39400
|
+
}
|
|
39219
39401
|
/** Remote: Updates a workspace avatar */
|
|
39220
39402
|
updateRemoteWorkspaceAvatar(workspaceId, avatar) {
|
|
39221
39403
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41715,8 +41897,8 @@ exports.TokenResolver = TokenResolver;
|
|
|
41715
41897
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
41716
41898
|
exports.DocumentationPageBlockCallout = exports.DocumentationPageBlockAssets = exports.DocumentationPageBlockAsset = exports.Documentation = exports.DesignComponent = exports.ElementDataViewColumnType = exports.ElementDataViewColumnBasePropertyType = exports.ElementDataViewColumn = exports.ElementDataView = exports.ElementPropertyOption = exports.ElementPropertyType = exports.ElementPropertyTargetElementType = exports.ElementPropertyLinkElementType = exports.ElementProperty = exports.Component = exports.RenderedAsset = exports.Asset = exports.ExporterConfigurationPropertyType = exports.ExporterConfigurationPropertyInputType = exports.ExporterConfigurationProperty = exports.ExporterCustomBlockVariant = exports.ExporterCustomBlockPropertyInputType = exports.ExporterCustomBlockPropertyType = exports.ExporterCustomBlockProperty = exports.ExporterCustomBlockMode = exports.ExporterCustomBlock = exports.Exporter = exports.Membership = exports.DesignSystemVersion = exports.DesignSystem = exports.Brand = exports.SubscriptionProductFeatures = exports.Acl = exports.UserProfile = exports.User = exports.WorkspaceNPMRegistrySettings = exports.WorkspaceSSOSettings = exports.WorkspaceIPWhitelistSettings = exports.WorkspaceSubscription = exports.WorkspaceOnboarding = exports.WorkspaceProfile = exports.Workspace = exports.Supernova = exports.OPTION_TOKEN_TYPES = exports.STRING_TOKEN_TYPES = exports.DIMENSION_TOKEN_TYPES = exports.TokenUtils = exports.TokenUtilPreviewSegmentGenerator = exports.ElementPropertyValue = exports.ThemeUtilities = void 0;
|
|
41717
41899
|
exports.BlurType = exports.AssetScaleType = exports.AssetScale = exports.AssetFormat = exports.Alignment = exports.TokenGroup = exports.DesignComponentGroup = exports.AssetGroup = exports.RichTextSpanAttribute = exports.RichTextSpan = exports.DocumentationRichText = exports.DocumentationPageAsset = exports.DocumentationPageBlock = exports.DocumentationPage = exports.DocumentationItem = exports.DocumentationGroup = exports.DocumentationConfiguration = exports.DocumentationItemConfiguration = exports.DocumentationItemHeader = exports.DocumentationPageBlockTableColumn = exports.DocumentationPageBlockTableRow = exports.DocumentationPageBlockTableCell = exports.DocumentationPageBlockTable = exports.DocumentationPageBlockTabItem = exports.DocumentationPageBlockTab = exports.DocumentationPageBlockColumnItem = exports.DocumentationPageBlockColumn = exports.DocumentationPageUnorderedList = exports.DocumentationPageBlockTokenList = exports.DocumentationPageBlockTokenGroup = exports.DocumentationPageBlockToken = exports.DocumentationPageBlockText = exports.DocumentationPageBlockShortcuts = exports.DocumentationPageBlockShortcutType = exports.DocumentationPageBlockShortcut = exports.DocumentationPageBlockRenderCode = exports.DocumentationPageBlockQuote = exports.DocumentationPageOrderedList = exports.DocumentationPageBlockImage = exports.DocumentationPageBlockHeading = exports.DocumentationPageBlockFrames = exports.DocumentationPageBlockFrame = exports.DocumentationPageBlockEmbedYoutube = exports.DocumentationPageBlockEmbedStorybook = exports.DocumentationPageBlockEmbedLink = exports.DocumentationPageBlockEmbedGeneric = exports.DocumentationPageBlockEmbedFigma = exports.DocumentationPageBlockDivider = exports.DocumentationPageBlockCustom = exports.DocumentationPageBlockCode = void 0;
|
|
41718
|
-
exports.
|
|
41719
|
-
exports.SupernovaError = exports.UnreachableCaseError = exports.TokenTransform = exports.MarkdownTransformType = exports.MarkdownTransform = exports.DocSearchResultDataType = exports.DocSearch = exports.SupernovaToolsDesignTokensPlugin = exports.DTPluginToSupernovaMapType = exports.JSONBuilderNamingOption = exports.TokenJSONBuilder = exports.TokenUtilPreviewGenerator = exports.TokenThemeOverride = exports.TokenTheme = exports.Token = exports.VisibilityToken = exports.TextDecorationToken = exports.TextCaseToken = exports.FontWeightToken = exports.FontFamilyToken = void 0;
|
|
41900
|
+
exports.StringToken = exports.TypographyToken = exports.ShadowToken = exports.ZIndexToken = exports.DurationToken = exports.RadiusToken = exports.BorderWidthToken = exports.ParagraphSpacingToken = exports.LetterSpacingToken = exports.LineHeightToken = exports.FontSizeToken = exports.OpacityToken = exports.SpaceToken = exports.SizeToken = exports.DimensionToken = exports.GradientToken = exports.ColorToken = exports.BorderToken = exports.BlurToken = exports.TokenOrigin = exports.Size = exports.Source = exports.DesignComponentOrigin = exports.SourceType = exports.WorkspaceNPMRegistryType = exports.WorkspaceNPMRegistryAuthType = exports.WorkspaceSubscriptionStatusInternal = exports.WorkspaceSubscriptionStatus = exports.WorkspaceSubscriptionProduct = exports.WorkspaceSubscriptionPlanInterval = exports.VisibilityType = exports.UserRole = exports.Unit = exports.TokenType = exports.TextDecoration = exports.TextCase = exports.ShadowType = exports.RichTextSpanAttributeType = exports.GradientType = exports.FrameLayout = exports.FrameAlignment = exports.DocumentationPageBlockThemeType = exports.DocumentationPageBlockType = exports.DocumentationPageAssetType = exports.DocumentationItemType = exports.DocumentationHeadingType = exports.DocumentationGroupBehavior = exports.DocumentationCalloutType = exports.BorderStyle = exports.BorderPosition = void 0;
|
|
41901
|
+
exports.SupernovaError = exports.UnreachableCaseError = exports.TokenTransform = exports.MarkdownTransformType = exports.MarkdownTransform = exports.DocSearchResultDataType = exports.DocSearch = exports.SupernovaToolsDesignTokensPlugin = exports.DTPluginToSupernovaMapType = exports.JSONBuilderNamingOption = exports.TokenJSONBuilder = exports.TokenUtilPreviewGenerator = exports.TokenThemeOverride = exports.TokenTheme = exports.Token = exports.VisibilityToken = exports.TextDecorationToken = exports.TextCaseToken = exports.FontWeightToken = exports.FontFamilyToken = exports.ProductCopyToken = void 0;
|
|
41720
41902
|
var SDKThemeUtilities_1 = __webpack_require__(/*! ./model/themes/SDKThemeUtilities */ "./src/model/themes/SDKThemeUtilities.ts");
|
|
41721
41903
|
Object.defineProperty(exports, "ThemeUtilities", ({ enumerable: true, get: function () { return SDKThemeUtilities_1.ThemeUtilities; } }));
|
|
41722
41904
|
var SDKElementPropertyValue_1 = __webpack_require__(/*! ./model/elements/values/SDKElementPropertyValue */ "./src/model/elements/values/SDKElementPropertyValue.ts");
|
|
@@ -41973,6 +42155,8 @@ var SDKWorkspaceNPMRegistryAuthType_1 = __webpack_require__(/*! ./model/enums/SD
|
|
|
41973
42155
|
Object.defineProperty(exports, "WorkspaceNPMRegistryAuthType", ({ enumerable: true, get: function () { return SDKWorkspaceNPMRegistryAuthType_1.WorkspaceNPMRegistryAuthType; } }));
|
|
41974
42156
|
var SDKWorkspaceNPMRegistryType_1 = __webpack_require__(/*! ./model/enums/SDKWorkspaceNPMRegistryType */ "./src/model/enums/SDKWorkspaceNPMRegistryType.ts");
|
|
41975
42157
|
Object.defineProperty(exports, "WorkspaceNPMRegistryType", ({ enumerable: true, get: function () { return SDKWorkspaceNPMRegistryType_1.WorkspaceNPMRegistryType; } }));
|
|
42158
|
+
var SDKSourceType_1 = __webpack_require__(/*! ./model/enums/SDKSourceType */ "./src/model/enums/SDKSourceType.ts");
|
|
42159
|
+
Object.defineProperty(exports, "SourceType", ({ enumerable: true, get: function () { return SDKSourceType_1.SourceType; } }));
|
|
41976
42160
|
// Supporting objects
|
|
41977
42161
|
var SDKDesignComponentOrigin_1 = __webpack_require__(/*! ./model/support/SDKDesignComponentOrigin */ "./src/model/support/SDKDesignComponentOrigin.ts");
|
|
41978
42162
|
Object.defineProperty(exports, "DesignComponentOrigin", ({ enumerable: true, get: function () { return SDKDesignComponentOrigin_1.DesignComponentOrigin; } }));
|
|
@@ -46549,7 +46733,7 @@ class DesignComponentOrigin {
|
|
|
46549
46733
|
const remoteSource = sources.filter((s) => s.id === model.sourceId)[0];
|
|
46550
46734
|
if (remoteSource) {
|
|
46551
46735
|
this.sourceType = remoteSource.type;
|
|
46552
|
-
this.fileId = (_e = remoteSource.fileId) !== null && _e !== void 0 ? _e : null;
|
|
46736
|
+
this.fileId = (_e = remoteSource.cloud.fileId) !== null && _e !== void 0 ? _e : null;
|
|
46553
46737
|
this.fileName = (_f = remoteSource.fileName) !== null && _f !== void 0 ? _f : null;
|
|
46554
46738
|
}
|
|
46555
46739
|
}
|
|
@@ -46663,76 +46847,100 @@ exports.Source = void 0;
|
|
|
46663
46847
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46664
46848
|
// MARK: - Object Definition
|
|
46665
46849
|
class Source {
|
|
46850
|
+
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46851
|
+
// MARK: - Getter & Setters
|
|
46852
|
+
get hasError() {
|
|
46853
|
+
var _a, _b;
|
|
46854
|
+
const lastImportResult = (_a = this.cloud) === null || _a === void 0 ? void 0 : _a.lastImportResult;
|
|
46855
|
+
if (!lastImportResult)
|
|
46856
|
+
return false;
|
|
46857
|
+
// If the import failed completely, it counts as an error
|
|
46858
|
+
if (lastImportResult.isFailed)
|
|
46859
|
+
return true;
|
|
46860
|
+
// Any error warnings count as an error
|
|
46861
|
+
if ((_b = lastImportResult.warnings) === null || _b === void 0 ? void 0 : _b.length)
|
|
46862
|
+
return true;
|
|
46863
|
+
return false;
|
|
46864
|
+
}
|
|
46666
46865
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
46667
46866
|
// MARK: - Constructor
|
|
46668
46867
|
constructor(model) {
|
|
46669
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
46868
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
46670
46869
|
this.type = model.type;
|
|
46671
46870
|
this.id = model.id;
|
|
46672
46871
|
this.fileName = (_a = model.fileName) !== null && _a !== void 0 ? _a : null;
|
|
46673
|
-
this.
|
|
46674
|
-
this.
|
|
46675
|
-
this.
|
|
46676
|
-
if (
|
|
46677
|
-
this.
|
|
46678
|
-
|
|
46679
|
-
|
|
46680
|
-
|
|
46681
|
-
|
|
46682
|
-
|
|
46683
|
-
|
|
46684
|
-
|
|
46685
|
-
|
|
46686
|
-
|
|
46687
|
-
|
|
46688
|
-
|
|
46689
|
-
|
|
46690
|
-
|
|
46691
|
-
tokensCreated: model.cloud.lastImportResult.tokensCreated,
|
|
46692
|
-
tokensUpdated: model.cloud.lastImportResult.tokensUpdated,
|
|
46693
|
-
tokensDeleted: model.cloud.lastImportResult.tokensDeleted,
|
|
46694
|
-
componentsCreated: model.cloud.lastImportResult.componentsCreated,
|
|
46695
|
-
componentsUpdated: model.cloud.lastImportResult.componentsUpdated,
|
|
46696
|
-
componentsDeleted: model.cloud.lastImportResult.componentsDeleted,
|
|
46697
|
-
componentAssetsCreated: model.cloud.lastImportResult.componentAssetsCreated,
|
|
46698
|
-
componentAssetsUpdated: model.cloud.lastImportResult.componentAssetsUpdated,
|
|
46699
|
-
componentAssetsDeleted: model.cloud.lastImportResult.componentAssetsDeleted,
|
|
46700
|
-
isFailed: model.cloud.lastImportResult.isFailed,
|
|
46701
|
-
versionId: model.cloud.lastImportResult.versionId,
|
|
46702
|
-
fileSize: (_l = model.cloud.lastImportResult.fileSize) !== null && _l !== void 0 ? _l : null,
|
|
46703
|
-
};
|
|
46704
|
-
}
|
|
46705
|
-
else {
|
|
46706
|
-
this.lastImportResult = null;
|
|
46707
|
-
}
|
|
46708
|
-
if ((_m = model.cloud) === null || _m === void 0 ? void 0 : _m.lastImportFramesResult) {
|
|
46709
|
-
this.lastImportFramesResult = {
|
|
46710
|
-
sourceId: model.cloud.lastImportFramesResult.sourceId,
|
|
46711
|
-
isFailed: model.cloud.lastImportFramesResult.isFailed,
|
|
46712
|
-
error: (_o = model.cloud.lastImportFramesResult.error) !== null && _o !== void 0 ? _o : null,
|
|
46713
|
-
assetsInFile: model.cloud.lastImportFramesResult.assetsInFile
|
|
46872
|
+
this.linkType = model.linkType;
|
|
46873
|
+
this.brandId = (_b = model.brandId) !== null && _b !== void 0 ? _b : null;
|
|
46874
|
+
this.fileName = (_c = model.fileName) !== null && _c !== void 0 ? _c : null;
|
|
46875
|
+
if (model.cloud) {
|
|
46876
|
+
this.cloud = {
|
|
46877
|
+
fileId: (_e = (_d = model.cloud) === null || _d === void 0 ? void 0 : _d.fileId) !== null && _e !== void 0 ? _e : null,
|
|
46878
|
+
autoImportMode: (_g = (_f = model.cloud) === null || _f === void 0 ? void 0 : _f.autoImportMode) !== null && _g !== void 0 ? _g : null,
|
|
46879
|
+
fileThumbnailUrl: (_j = (_h = model.cloud) === null || _h === void 0 ? void 0 : _h.fileThumbnailUrl) !== null && _j !== void 0 ? _j : null,
|
|
46880
|
+
ownerId: (_l = (_k = model.cloud) === null || _k === void 0 ? void 0 : _k.ownerId) !== null && _l !== void 0 ? _l : null,
|
|
46881
|
+
ownerUserName: (_o = (_m = model.cloud) === null || _m === void 0 ? void 0 : _m.ownerUserName) !== null && _o !== void 0 ? _o : null,
|
|
46882
|
+
state: (_q = (_p = model.cloud) === null || _p === void 0 ? void 0 : _p.state) !== null && _q !== void 0 ? _q : null,
|
|
46883
|
+
lastUpdatesCheckedAt: ((_r = model.cloud) === null || _r === void 0 ? void 0 : _r.lastUpdatesCheckedAt)
|
|
46884
|
+
? new Date(model.cloud.lastUpdatesCheckedAt)
|
|
46885
|
+
: null,
|
|
46886
|
+
lastImportedAt: ((_s = model.cloud) === null || _s === void 0 ? void 0 : _s.lastImportedAt)
|
|
46887
|
+
? new Date(model.cloud.lastImportedAt)
|
|
46888
|
+
: null,
|
|
46889
|
+
lastImportedVersion: ((_t = model.cloud) === null || _t === void 0 ? void 0 : _t.lastImportedVersion)
|
|
46714
46890
|
? {
|
|
46715
|
-
|
|
46716
|
-
|
|
46891
|
+
id: model.cloud.lastImportedVersion.id,
|
|
46892
|
+
created_at: model.cloud.lastImportedVersion.created_at,
|
|
46893
|
+
label: (_u = model.cloud.lastImportedVersion.label) !== null && _u !== void 0 ? _u : null,
|
|
46894
|
+
description: model.cloud.lastImportedVersion.description,
|
|
46895
|
+
}
|
|
46896
|
+
: null,
|
|
46897
|
+
lastImportResult: ((_v = model.cloud) === null || _v === void 0 ? void 0 : _v.lastImportResult)
|
|
46898
|
+
? {
|
|
46899
|
+
sourceId: model.cloud.lastImportResult.sourceId,
|
|
46900
|
+
brandId: model.cloud.lastImportResult.brandId,
|
|
46901
|
+
tokensCreated: model.cloud.lastImportResult.tokensCreated,
|
|
46902
|
+
tokensUpdated: model.cloud.lastImportResult.tokensUpdated,
|
|
46903
|
+
tokensDeleted: model.cloud.lastImportResult.tokensDeleted,
|
|
46904
|
+
componentsCreated: model.cloud.lastImportResult.componentsCreated,
|
|
46905
|
+
componentsUpdated: model.cloud.lastImportResult.componentsUpdated,
|
|
46906
|
+
componentsDeleted: model.cloud.lastImportResult.componentsDeleted,
|
|
46907
|
+
componentAssetsCreated: model.cloud.lastImportResult.componentAssetsCreated,
|
|
46908
|
+
componentAssetsUpdated: model.cloud.lastImportResult.componentAssetsUpdated,
|
|
46909
|
+
componentAssetsDeleted: model.cloud.lastImportResult.componentAssetsDeleted,
|
|
46910
|
+
isFailed: model.cloud.lastImportResult.isFailed,
|
|
46911
|
+
versionId: model.cloud.lastImportResult.versionId,
|
|
46912
|
+
fileSize: (_w = model.cloud.lastImportResult.fileSize) !== null && _w !== void 0 ? _w : null,
|
|
46913
|
+
warnings: (_x = model.cloud.lastImportResult.warnings) !== null && _x !== void 0 ? _x : [],
|
|
46914
|
+
}
|
|
46915
|
+
: null,
|
|
46916
|
+
lastImportFramesResult: ((_y = model.cloud) === null || _y === void 0 ? void 0 : _y.lastImportFramesResult)
|
|
46917
|
+
? {
|
|
46918
|
+
sourceId: model.cloud.lastImportFramesResult.sourceId,
|
|
46919
|
+
isFailed: model.cloud.lastImportFramesResult.isFailed,
|
|
46920
|
+
error: (_z = model.cloud.lastImportFramesResult.error) !== null && _z !== void 0 ? _z : null,
|
|
46921
|
+
assetsInFile: model.cloud.lastImportFramesResult.assetsInFile
|
|
46922
|
+
? {
|
|
46923
|
+
frames: model.cloud.lastImportFramesResult.assetsInFile.frames,
|
|
46924
|
+
components: model.cloud.lastImportFramesResult.assetsInFile
|
|
46925
|
+
.components,
|
|
46926
|
+
}
|
|
46927
|
+
: null,
|
|
46928
|
+
invalidReferencesCount: (_0 = model.cloud.lastImportFramesResult.invalidReferencesCount) !== null && _0 !== void 0 ? _0 : null,
|
|
46717
46929
|
}
|
|
46718
46930
|
: null,
|
|
46719
|
-
invalidReferencesCount: (_p = model.cloud.lastImportFramesResult.invalidReferencesCount) !== null && _p !== void 0 ? _p : null,
|
|
46720
46931
|
};
|
|
46721
46932
|
}
|
|
46722
|
-
|
|
46723
|
-
this.
|
|
46933
|
+
if (model.tokenStudio) {
|
|
46934
|
+
this.tokenStudio = {
|
|
46935
|
+
connectionName: model.tokenStudio.connectionName,
|
|
46936
|
+
lastImportedAt: model.tokenStudio.lastImportedAt
|
|
46937
|
+
? new Date(model.tokenStudio.lastImportedAt)
|
|
46938
|
+
: null,
|
|
46939
|
+
settings: model.tokenStudio.settings,
|
|
46940
|
+
lastImportedResults: model.tokenStudio.lastImportedResults,
|
|
46941
|
+
};
|
|
46724
46942
|
}
|
|
46725
|
-
this.
|
|
46726
|
-
this.ownerUserName = (_t = (_s = model.cloud) === null || _s === void 0 ? void 0 : _s.ownerUserName) !== null && _t !== void 0 ? _t : null;
|
|
46727
|
-
this.state = (_v = (_u = model.cloud) === null || _u === void 0 ? void 0 : _u.state) !== null && _v !== void 0 ? _v : null;
|
|
46728
|
-
this.linkType = model.linkType;
|
|
46729
|
-
this.brandId = (_w = model.brandId) !== null && _w !== void 0 ? _w : null;
|
|
46730
|
-
this.lastUpdatesCheckedAt = ((_x = model.cloud) === null || _x === void 0 ? void 0 : _x.lastUpdatesCheckedAt)
|
|
46731
|
-
? new Date(model.cloud.lastUpdatesCheckedAt)
|
|
46732
|
-
: null;
|
|
46733
|
-
this.lastImportedAt = ((_y = model.cloud) === null || _y === void 0 ? void 0 : _y.lastImportedAt)
|
|
46734
|
-
? new Date(model.cloud.lastImportedAt)
|
|
46735
|
-
: null;
|
|
46943
|
+
this.scope = model.scope;
|
|
46736
46944
|
}
|
|
46737
46945
|
// --- --- --- --- --- --- --- --- --- ---
|
|
46738
46946
|
// MARK: - Serialization & Deserialization
|
|
@@ -46742,25 +46950,26 @@ class Source {
|
|
|
46742
46950
|
type: this.type,
|
|
46743
46951
|
id: this.id,
|
|
46744
46952
|
fileName: this.fileName,
|
|
46953
|
+
linkType: this.linkType,
|
|
46954
|
+
brandId: this.brandId,
|
|
46745
46955
|
cloud: {
|
|
46746
|
-
fileId: this.fileId,
|
|
46747
|
-
autoImportMode: this.autoImportMode,
|
|
46748
|
-
fileThumbnailUrl: this.fileThumbnailUrl,
|
|
46749
|
-
lastUpdatesCheckedAt: this.lastUpdatesCheckedAt
|
|
46750
|
-
? this.lastUpdatesCheckedAt.toISOString()
|
|
46956
|
+
fileId: this.cloud.fileId,
|
|
46957
|
+
autoImportMode: this.cloud.autoImportMode,
|
|
46958
|
+
fileThumbnailUrl: this.cloud.fileThumbnailUrl,
|
|
46959
|
+
lastUpdatesCheckedAt: this.cloud.lastUpdatesCheckedAt
|
|
46960
|
+
? this.cloud.lastUpdatesCheckedAt.toISOString()
|
|
46751
46961
|
: null,
|
|
46752
|
-
lastImportedAt: this.lastImportedAt
|
|
46753
|
-
? this.lastImportedAt.toISOString()
|
|
46962
|
+
lastImportedAt: this.cloud.lastImportedAt
|
|
46963
|
+
? this.cloud.lastImportedAt.toISOString()
|
|
46754
46964
|
: null,
|
|
46755
|
-
lastImportedVersion: this.lastImportedVersion,
|
|
46756
|
-
lastImportResult: this.lastImportResult,
|
|
46757
|
-
lastImportFramesResult: this.lastImportFramesResult,
|
|
46758
|
-
ownerId: this.ownerId,
|
|
46759
|
-
ownerUserName: this.ownerUserName,
|
|
46760
|
-
state: this.state,
|
|
46965
|
+
lastImportedVersion: this.cloud.lastImportedVersion,
|
|
46966
|
+
lastImportResult: this.cloud.lastImportResult,
|
|
46967
|
+
lastImportFramesResult: this.cloud.lastImportFramesResult,
|
|
46968
|
+
ownerId: this.cloud.ownerId,
|
|
46969
|
+
ownerUserName: this.cloud.ownerUserName,
|
|
46970
|
+
state: this.cloud.state,
|
|
46761
46971
|
},
|
|
46762
|
-
|
|
46763
|
-
brandId: this.brandId,
|
|
46972
|
+
scope: this.scope,
|
|
46764
46973
|
};
|
|
46765
46974
|
}
|
|
46766
46975
|
/** Constructs representation that can be used to transport the instantiated object as JSON, for example for SSR <> Client use-cases. Reconstruct to class instance using `fromTransport` */
|
|
@@ -46769,47 +46978,40 @@ class Source {
|
|
|
46769
46978
|
type: this.type,
|
|
46770
46979
|
id: this.id,
|
|
46771
46980
|
fileName: this.fileName,
|
|
46772
|
-
|
|
46773
|
-
|
|
46774
|
-
|
|
46775
|
-
|
|
46776
|
-
|
|
46777
|
-
|
|
46778
|
-
|
|
46779
|
-
|
|
46780
|
-
|
|
46781
|
-
|
|
46782
|
-
|
|
46783
|
-
|
|
46784
|
-
|
|
46785
|
-
|
|
46786
|
-
|
|
46981
|
+
cloud: {
|
|
46982
|
+
fileId: this.cloud.fileId,
|
|
46983
|
+
autoImportMode: this.cloud.autoImportMode,
|
|
46984
|
+
fileThumbnailUrl: this.cloud.fileThumbnailUrl,
|
|
46985
|
+
lastUpdatesCheckedAt: this.cloud.lastUpdatesCheckedAt
|
|
46986
|
+
? this.cloud.lastUpdatesCheckedAt.toISOString()
|
|
46987
|
+
: null,
|
|
46988
|
+
lastImportedAt: this.cloud.lastImportedAt
|
|
46989
|
+
? this.cloud.lastImportedAt.toISOString()
|
|
46990
|
+
: null,
|
|
46991
|
+
lastImportedVersion: this.cloud.lastImportedVersion,
|
|
46992
|
+
lastImportResult: this.cloud.lastImportResult,
|
|
46993
|
+
lastImportFramesResult: this.cloud.lastImportFramesResult,
|
|
46994
|
+
ownerId: this.cloud.ownerId,
|
|
46995
|
+
ownerUserName: this.cloud.ownerUserName,
|
|
46996
|
+
state: this.cloud.state,
|
|
46997
|
+
},
|
|
46787
46998
|
linkType: this.linkType,
|
|
46788
46999
|
brandId: this.brandId,
|
|
47000
|
+
scope: this.scope,
|
|
46789
47001
|
};
|
|
46790
47002
|
}
|
|
46791
47003
|
/** Reconstructs class from the transport model */
|
|
46792
47004
|
static fromTransport(model) {
|
|
46793
|
-
|
|
47005
|
+
console.log("source transport model", model);
|
|
47006
|
+
return {
|
|
46794
47007
|
type: model.type,
|
|
46795
47008
|
id: model.id,
|
|
46796
47009
|
fileName: model.fileName,
|
|
46797
|
-
cloud: {
|
|
46798
|
-
fileId: model.fileId,
|
|
46799
|
-
autoImportMode: model.autoImportMode,
|
|
46800
|
-
fileThumbnailUrl: model.fileThumbnailUrl,
|
|
46801
|
-
lastUpdatesCheckedAt: model.lastUpdatesCheckedAt,
|
|
46802
|
-
lastImportedAt: model.lastImportedAt,
|
|
46803
|
-
lastImportedVersion: model.lastImportedVersion,
|
|
46804
|
-
lastImportResult: model.lastImportResult,
|
|
46805
|
-
lastImportFramesResult: model.lastImportFramesResult,
|
|
46806
|
-
ownerId: model.ownerId,
|
|
46807
|
-
ownerUserName: model.ownerUserName,
|
|
46808
|
-
state: model.state,
|
|
46809
|
-
},
|
|
46810
47010
|
linkType: model.linkType,
|
|
46811
47011
|
brandId: model.brandId,
|
|
46812
|
-
|
|
47012
|
+
scope: model.scope,
|
|
47013
|
+
cloud: Object.assign(Object.assign({}, model.cloud), { lastUpdatesCheckedAt: model.cloud.lastUpdatesCheckedAt, lastImportedAt: model.cloud.lastImportedAt }),
|
|
47014
|
+
};
|
|
46813
47015
|
}
|
|
46814
47016
|
}
|
|
46815
47017
|
exports.Source = Source;
|
|
@@ -48039,6 +48241,7 @@ class DimensionCategoryToken extends SDKToken_1.Token {
|
|
|
48039
48241
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
48040
48242
|
// MARK: - Static building
|
|
48041
48243
|
static create(type, versionId, brandId, name, description, value, alias, properties, propertyValues) {
|
|
48244
|
+
var _a;
|
|
48042
48245
|
const baseToken = {
|
|
48043
48246
|
id: undefined,
|
|
48044
48247
|
persistentId: (0, uuid_1.v4)(),
|
|
@@ -48074,7 +48277,9 @@ class DimensionCategoryToken extends SDKToken_1.Token {
|
|
|
48074
48277
|
measure: DimensionCategoryToken.getCompatibleMeasure(alias.value.unit, type, alias.value.measure),
|
|
48075
48278
|
referencedTokenId: null
|
|
48076
48279
|
};
|
|
48077
|
-
|
|
48280
|
+
const result = new this(versionId, baseToken, tokenValue, undefined, properties, propertyValues);
|
|
48281
|
+
result.origin = Object.assign(Object.assign({}, ((_a = result.origin) !== null && _a !== void 0 ? _a : { id: null, name: null, sourceId: null })), { referencePersistentId: alias.id });
|
|
48282
|
+
return result;
|
|
48078
48283
|
}
|
|
48079
48284
|
}
|
|
48080
48285
|
throw SDKSupernovaError_1.SupernovaError.fromMessage("Dimension Token must be created using value or alias, but none was provided");
|
|
@@ -48248,6 +48453,7 @@ class DimensionCategoryToken extends SDKToken_1.Token {
|
|
|
48248
48453
|
};
|
|
48249
48454
|
}
|
|
48250
48455
|
else {
|
|
48456
|
+
//
|
|
48251
48457
|
// If tokenType from args !== tokenType resolved, inline
|
|
48252
48458
|
// Align units, if we reference dimension from Opacity, unit must become raw
|
|
48253
48459
|
console.log(`Inlining reference ${reference.id}: ${reference.tokenType} into ${definition}:${tokenType}`);
|
|
@@ -49470,7 +49676,7 @@ class Token {
|
|
|
49470
49676
|
this.sortOrder = order;
|
|
49471
49677
|
}
|
|
49472
49678
|
toBaseWriteObject() {
|
|
49473
|
-
var _a, _b, _c, _d;
|
|
49679
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49474
49680
|
return {
|
|
49475
49681
|
id: this.idInVersion,
|
|
49476
49682
|
brandId: this.brandId,
|
|
@@ -49486,6 +49692,8 @@ class Token {
|
|
|
49486
49692
|
id: (_b = this.origin.id) !== null && _b !== void 0 ? _b : undefined,
|
|
49487
49693
|
name: (_c = this.origin.name) !== null && _c !== void 0 ? _c : undefined,
|
|
49488
49694
|
sourceId: (_d = this.origin.sourceId) !== null && _d !== void 0 ? _d : undefined,
|
|
49695
|
+
referenceOriginId: (_e = this.origin.referenceOriginId) !== null && _e !== void 0 ? _e : undefined,
|
|
49696
|
+
referencePersistentId: (_f = this.origin.referencePersistentId) !== null && _f !== void 0 ? _f : undefined,
|
|
49489
49697
|
}
|
|
49490
49698
|
: undefined,
|
|
49491
49699
|
customPropertyOverrides: [],
|
|
@@ -49643,7 +49851,13 @@ class TokenComparator {
|
|
|
49643
49851
|
return true;
|
|
49644
49852
|
}
|
|
49645
49853
|
static isEqualDimensionTokenValue(a, b) {
|
|
49646
|
-
|
|
49854
|
+
// If this.referencesSameToken(a, b) === true, they could still reference token, that has override
|
|
49855
|
+
// Base: typography.fontSize = {fs.default}, fs.default = 10
|
|
49856
|
+
// Theme: typography.fontSize = {fs.default}, fs.default = 11
|
|
49857
|
+
// Thus they reference same token, but in theme it has different value.
|
|
49858
|
+
// Which makes its parent (typography) being ignored as override candidate.
|
|
49859
|
+
// This concerns all tokens that could be used as properties inside complex tokens (dim, string, options).
|
|
49860
|
+
if (this.isUndefinedValue(a, b)) {
|
|
49647
49861
|
return true;
|
|
49648
49862
|
}
|
|
49649
49863
|
return a.measure === b.measure && a.unit === b.unit;
|
|
@@ -49675,13 +49889,25 @@ class TokenComparator {
|
|
|
49675
49889
|
// We don't really have a way to distuingish String from ProductCopy just by value here as we store type above the hierarchy
|
|
49676
49890
|
// As long as this function is used as part of isEqualTokenValue where we check tokenType it is safe
|
|
49677
49891
|
static isEqualStringTokenValue(a, b) {
|
|
49678
|
-
|
|
49892
|
+
// If this.referencesSameToken(a, b) === true, they could still reference token, that has override
|
|
49893
|
+
// Base: typography.fontFamily = {ff.default}, ff.default = Roboto
|
|
49894
|
+
// Theme: typography.fontFamily = {ff.default}, ff.default = Gotham
|
|
49895
|
+
// Thus they reference same token, but in theme it has different value.
|
|
49896
|
+
// Which makes its parent (typography) being ignored as override candidate.
|
|
49897
|
+
// This concerns all tokens that could be used as properties inside complex tokens (dim, string, options).
|
|
49898
|
+
if (this.isUndefinedValue(a, b)) {
|
|
49679
49899
|
return true;
|
|
49680
49900
|
}
|
|
49681
49901
|
return a.text === b.text;
|
|
49682
49902
|
}
|
|
49683
49903
|
static isEqualOptionTokenValue(a, b) {
|
|
49684
|
-
|
|
49904
|
+
// If this.referencesSameToken(a, b) === true, they could still reference token, that has override
|
|
49905
|
+
// Base: typography.textCase = {tc.default}, tc.default = None
|
|
49906
|
+
// Theme: typography.textCase = {tc.default}, tc.default = Upper
|
|
49907
|
+
// Thus they reference same token, but in theme it has different value.
|
|
49908
|
+
// Which makes its parent (typography) being ignored as override candidate.
|
|
49909
|
+
// This concerns all tokens that could be used as properties inside complex tokens (dim, string, options).
|
|
49910
|
+
if (this.isUndefinedValue(a, b)) {
|
|
49685
49911
|
return true;
|
|
49686
49912
|
}
|
|
49687
49913
|
// NOTE: We do not rely on options always be present
|
|
@@ -49724,7 +49950,7 @@ exports.TokenComparator = TokenComparator;
|
|
|
49724
49950
|
// This file defines all token value containers for the actual model - this model will be exactly available to users
|
|
49725
49951
|
//
|
|
49726
49952
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
49727
|
-
exports.replaceReferencedTokenByIds = exports.replaceReferencedToken = exports.replaceReferencedTokenIds = exports.checkSingleReferencedTokenById = exports.getSingleReferencedTokenId = exports.getReferencedTokens = void 0;
|
|
49953
|
+
exports.replaceOriginReferencePersistentIdByIds = exports.replaceReferencedTokenByIds = exports.replaceReferencedToken = exports.replaceReferencedTokenIds = exports.checkSingleReferencedTokenById = exports.getSingleReferencedTokenId = exports.getReferencedTokens = void 0;
|
|
49728
49954
|
const SDKGradientToken_1 = __webpack_require__(/*! ./SDKGradientToken */ "./src/model/tokens/SDKGradientToken.ts");
|
|
49729
49955
|
const SDKShadowToken_1 = __webpack_require__(/*! ./SDKShadowToken */ "./src/model/tokens/SDKShadowToken.ts");
|
|
49730
49956
|
const getReferencedTokens = (token, allTokens) => {
|
|
@@ -49759,6 +49985,7 @@ const replaceReferencedTokenIds = (token, currentId, newId, allTokens) => {
|
|
|
49759
49985
|
exports.replaceReferencedTokenIds = replaceReferencedTokenIds;
|
|
49760
49986
|
const replaceReferencedToken = (token, existingToken, newToken) => {
|
|
49761
49987
|
(0, exports.replaceReferencedTokenByIds)(token, existingToken.id, newToken.id);
|
|
49988
|
+
(0, exports.replaceOriginReferencePersistentIdByIds)(token, existingToken.id, newToken.id);
|
|
49762
49989
|
};
|
|
49763
49990
|
exports.replaceReferencedToken = replaceReferencedToken;
|
|
49764
49991
|
const replaceReferencedTokenByIds = (token, existingTokenId, newTokenId) => {
|
|
@@ -49781,6 +50008,18 @@ const replaceReferencedTokenByIds = (token, existingTokenId, newTokenId) => {
|
|
|
49781
50008
|
}
|
|
49782
50009
|
};
|
|
49783
50010
|
exports.replaceReferencedTokenByIds = replaceReferencedTokenByIds;
|
|
50011
|
+
const replaceOriginReferencePersistentIdByIds = (token, existingTokenId, newTokenId) => {
|
|
50012
|
+
const origin = token === null || token === void 0 ? void 0 : token.origin;
|
|
50013
|
+
if (!(origin === null || origin === void 0 ? void 0 : origin.referencePersistentId)) {
|
|
50014
|
+
// Do nothing if there is no origin
|
|
50015
|
+
}
|
|
50016
|
+
else if (origin.referencePersistentId && !Array.isArray(origin.referencePersistentId)) {
|
|
50017
|
+
if (origin.referencePersistentId === existingTokenId) {
|
|
50018
|
+
origin.referencePersistentId = newTokenId;
|
|
50019
|
+
}
|
|
50020
|
+
}
|
|
50021
|
+
};
|
|
50022
|
+
exports.replaceOriginReferencePersistentIdByIds = replaceOriginReferencePersistentIdByIds;
|
|
49784
50023
|
|
|
49785
50024
|
|
|
49786
50025
|
/***/ }),
|
|
@@ -50106,10 +50345,12 @@ class User {
|
|
|
50106
50345
|
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
|
50107
50346
|
// MARK: - Constructor
|
|
50108
50347
|
constructor(model) {
|
|
50348
|
+
var _a;
|
|
50109
50349
|
this.id = model.id;
|
|
50110
50350
|
this.email = model.email;
|
|
50111
50351
|
this.profile = new SDKUserProfile_1.UserProfile(model.profile);
|
|
50112
50352
|
this.createdAt = model.createdAt ? new Date(model.createdAt) : null;
|
|
50353
|
+
this.linkedIntegrations = (_a = model.linkedIntegrations) !== null && _a !== void 0 ? _a : null;
|
|
50113
50354
|
}
|
|
50114
50355
|
// --- --- --- --- --- --- --- --- --- ---
|
|
50115
50356
|
// MARK: - Serialization & Deserialization
|
|
@@ -50120,6 +50361,7 @@ class User {
|
|
|
50120
50361
|
email: this.email,
|
|
50121
50362
|
profile: this.profile.toRemote(),
|
|
50122
50363
|
createdAt: this.createdAt ? this.createdAt.toISOString() : "",
|
|
50364
|
+
linkedIntegrations: this.linkedIntegrations,
|
|
50123
50365
|
};
|
|
50124
50366
|
}
|
|
50125
50367
|
/** Constructs representation that can be used to transport the instantiated object as JSON, for example for SSR <> Client use-cases. Reconstruct to class instance using `fromTransport` */
|
|
@@ -50129,6 +50371,7 @@ class User {
|
|
|
50129
50371
|
email: this.email,
|
|
50130
50372
|
profile: this.profile.toTransport(),
|
|
50131
50373
|
createdAt: this.createdAt ? this.createdAt.toISOString() : "",
|
|
50374
|
+
linkedIntegrations: this.linkedIntegrations,
|
|
50132
50375
|
};
|
|
50133
50376
|
}
|
|
50134
50377
|
/** Reconstructs class from the transport model */
|
|
@@ -51081,17 +51324,13 @@ class SupernovaToolsDesignTokensPlugin {
|
|
|
51081
51324
|
return mapping;
|
|
51082
51325
|
}
|
|
51083
51326
|
setTokensOrigin(map, brand, sources) {
|
|
51084
|
-
var _a;
|
|
51327
|
+
var _a, _b, _c;
|
|
51085
51328
|
const sourceId = (_a = sources.find((s) => s.type === SDKSourceType_1.SourceType.tokenStudio && s.brandId === brand.id)) === null || _a === void 0 ? void 0 : _a.id;
|
|
51086
51329
|
if (!sourceId) {
|
|
51087
51330
|
return map;
|
|
51088
51331
|
}
|
|
51089
51332
|
for (const node of map.processedNodes) {
|
|
51090
|
-
node.token.origin = {
|
|
51091
|
-
name: node.token.name,
|
|
51092
|
-
sourceId,
|
|
51093
|
-
id: node.key,
|
|
51094
|
-
};
|
|
51333
|
+
node.token.origin = Object.assign(Object.assign({ name: node.token.name, sourceId, id: node.key }, (((_b = node.token.origin) === null || _b === void 0 ? void 0 : _b.referenceOriginId) ? { referenceOriginId: node.token.origin.referenceOriginId } : {})), (((_c = node.token.origin) === null || _c === void 0 ? void 0 : _c.referencePersistentId) ? { referencePersistentId: node.token.origin.referencePersistentId } : {}));
|
|
51095
51334
|
}
|
|
51096
51335
|
return map;
|
|
51097
51336
|
}
|
|
@@ -51375,112 +51614,117 @@ class DTJSONConverter {
|
|
|
51375
51614
|
// Retrieve all tokens
|
|
51376
51615
|
return processedNodes;
|
|
51377
51616
|
}
|
|
51617
|
+
remapRootNodeKey(nodePath, tokenType, nodeOriginalType, nodeTokenName) {
|
|
51618
|
+
let path = Array.from(nodePath);
|
|
51619
|
+
let firstSegment = path.splice(0, 1)[0];
|
|
51620
|
+
// Remap remote to proper destination
|
|
51621
|
+
// TODO: maybe we should make firstSegment typed?
|
|
51622
|
+
const type = tokenType;
|
|
51623
|
+
switch (type) {
|
|
51624
|
+
case SDKTokenType_1.TokenType.color:
|
|
51625
|
+
firstSegment = "Color";
|
|
51626
|
+
break;
|
|
51627
|
+
case SDKTokenType_1.TokenType.gradient:
|
|
51628
|
+
firstSegment = "Gradient";
|
|
51629
|
+
break;
|
|
51630
|
+
// TEST: Do we use separate keys for all Dimensions
|
|
51631
|
+
case SDKTokenType_1.TokenType.radius:
|
|
51632
|
+
firstSegment = "Radius";
|
|
51633
|
+
break;
|
|
51634
|
+
case SDKTokenType_1.TokenType.space:
|
|
51635
|
+
case SDKTokenType_1.TokenType.opacity:
|
|
51636
|
+
case SDKTokenType_1.TokenType.fontSize:
|
|
51637
|
+
case SDKTokenType_1.TokenType.lineHeight:
|
|
51638
|
+
case SDKTokenType_1.TokenType.letterSpacing:
|
|
51639
|
+
case SDKTokenType_1.TokenType.paragraphSpacing:
|
|
51640
|
+
case SDKTokenType_1.TokenType.borderWidth:
|
|
51641
|
+
case SDKTokenType_1.TokenType.duration:
|
|
51642
|
+
case SDKTokenType_1.TokenType.zIndex:
|
|
51643
|
+
case SDKTokenType_1.TokenType.size:
|
|
51644
|
+
case SDKTokenType_1.TokenType.dimension:
|
|
51645
|
+
// firstSegment = "Dimension"
|
|
51646
|
+
firstSegment = "Measure";
|
|
51647
|
+
break;
|
|
51648
|
+
case SDKTokenType_1.TokenType.shadow:
|
|
51649
|
+
firstSegment = "Shadow";
|
|
51650
|
+
break;
|
|
51651
|
+
case SDKTokenType_1.TokenType.typography:
|
|
51652
|
+
firstSegment = "Typography";
|
|
51653
|
+
break;
|
|
51654
|
+
// TEST: Should we now use separate segments here or String?
|
|
51655
|
+
case SDKTokenType_1.TokenType.fontFamily:
|
|
51656
|
+
case SDKTokenType_1.TokenType.fontWeight:
|
|
51657
|
+
firstSegment = "Generic";
|
|
51658
|
+
break;
|
|
51659
|
+
case SDKTokenType_1.TokenType.border:
|
|
51660
|
+
firstSegment = "Border";
|
|
51661
|
+
break;
|
|
51662
|
+
case SDKTokenType_1.TokenType.textCase:
|
|
51663
|
+
case SDKTokenType_1.TokenType.textDecoration:
|
|
51664
|
+
case SDKTokenType_1.TokenType.visibility:
|
|
51665
|
+
firstSegment = "Options";
|
|
51666
|
+
break;
|
|
51667
|
+
default:
|
|
51668
|
+
throw new UnreachableCaseError_1.UnreachableCaseError(type, `Unsupported type ${firstSegment} in remapping of nodes`);
|
|
51669
|
+
}
|
|
51670
|
+
let secondSegment;
|
|
51671
|
+
switch (nodeOriginalType) {
|
|
51672
|
+
case "borderRadius":
|
|
51673
|
+
secondSegment = "Border Radius";
|
|
51674
|
+
break;
|
|
51675
|
+
case "borderWidth":
|
|
51676
|
+
secondSegment = "Border Width";
|
|
51677
|
+
break;
|
|
51678
|
+
case "sizing":
|
|
51679
|
+
secondSegment = "Sizing";
|
|
51680
|
+
break;
|
|
51681
|
+
case "fontSizes":
|
|
51682
|
+
secondSegment = "Font Size";
|
|
51683
|
+
break;
|
|
51684
|
+
case "paragraphSpacing":
|
|
51685
|
+
secondSegment = "Paragraph Spacing";
|
|
51686
|
+
break;
|
|
51687
|
+
case "lineHeights":
|
|
51688
|
+
secondSegment = "Line Height";
|
|
51689
|
+
break;
|
|
51690
|
+
case "letterSpacing":
|
|
51691
|
+
secondSegment = "Letter Spacing";
|
|
51692
|
+
break;
|
|
51693
|
+
case "spacing":
|
|
51694
|
+
secondSegment = "Spacing";
|
|
51695
|
+
break;
|
|
51696
|
+
case "opacity":
|
|
51697
|
+
secondSegment = "Opacity";
|
|
51698
|
+
break;
|
|
51699
|
+
case "dimension":
|
|
51700
|
+
secondSegment = "Dimension";
|
|
51701
|
+
break;
|
|
51702
|
+
case 'fontFamilies':
|
|
51703
|
+
secondSegment = 'Font Family';
|
|
51704
|
+
break;
|
|
51705
|
+
case 'fontWeights':
|
|
51706
|
+
secondSegment = 'Font Weight';
|
|
51707
|
+
break;
|
|
51708
|
+
default:
|
|
51709
|
+
// Other types than listed should be ignored
|
|
51710
|
+
break;
|
|
51711
|
+
}
|
|
51712
|
+
// Remap original type and add extra group, if needed
|
|
51713
|
+
if (secondSegment) {
|
|
51714
|
+
path = [firstSegment, secondSegment, ...path];
|
|
51715
|
+
}
|
|
51716
|
+
else {
|
|
51717
|
+
path = [firstSegment, ...path];
|
|
51718
|
+
}
|
|
51719
|
+
// Rebuild key
|
|
51720
|
+
const key = SDKDTTokenMerger_1.DTTokenMerger.buildKey(path, nodeTokenName);
|
|
51721
|
+
return { path, key };
|
|
51722
|
+
}
|
|
51378
51723
|
remapRootNodeKeys(nodes) {
|
|
51379
51724
|
for (const node of nodes) {
|
|
51380
|
-
let path =
|
|
51381
|
-
let firstSegment = path.splice(0, 1)[0];
|
|
51382
|
-
// Remap remote to proper destination
|
|
51383
|
-
// TODO: maybe we should make firstSegment typed?
|
|
51384
|
-
const type = node.token.tokenType;
|
|
51385
|
-
switch (type) {
|
|
51386
|
-
case SDKTokenType_1.TokenType.color:
|
|
51387
|
-
firstSegment = "Color";
|
|
51388
|
-
break;
|
|
51389
|
-
case SDKTokenType_1.TokenType.gradient:
|
|
51390
|
-
firstSegment = "Gradient";
|
|
51391
|
-
break;
|
|
51392
|
-
// TEST: Do we use separate keys for all Dimensions
|
|
51393
|
-
case SDKTokenType_1.TokenType.radius:
|
|
51394
|
-
firstSegment = "Radius";
|
|
51395
|
-
break;
|
|
51396
|
-
case SDKTokenType_1.TokenType.space:
|
|
51397
|
-
case SDKTokenType_1.TokenType.opacity:
|
|
51398
|
-
case SDKTokenType_1.TokenType.fontSize:
|
|
51399
|
-
case SDKTokenType_1.TokenType.lineHeight:
|
|
51400
|
-
case SDKTokenType_1.TokenType.letterSpacing:
|
|
51401
|
-
case SDKTokenType_1.TokenType.paragraphSpacing:
|
|
51402
|
-
case SDKTokenType_1.TokenType.borderWidth:
|
|
51403
|
-
case SDKTokenType_1.TokenType.duration:
|
|
51404
|
-
case SDKTokenType_1.TokenType.zIndex:
|
|
51405
|
-
case SDKTokenType_1.TokenType.size:
|
|
51406
|
-
case SDKTokenType_1.TokenType.dimension:
|
|
51407
|
-
// firstSegment = "Dimension"
|
|
51408
|
-
firstSegment = "Measure";
|
|
51409
|
-
break;
|
|
51410
|
-
case SDKTokenType_1.TokenType.shadow:
|
|
51411
|
-
firstSegment = "Shadow";
|
|
51412
|
-
break;
|
|
51413
|
-
case SDKTokenType_1.TokenType.typography:
|
|
51414
|
-
firstSegment = "Typography";
|
|
51415
|
-
break;
|
|
51416
|
-
// TEST: Should we now use separate segments here or String?
|
|
51417
|
-
case SDKTokenType_1.TokenType.fontFamily:
|
|
51418
|
-
case SDKTokenType_1.TokenType.fontWeight:
|
|
51419
|
-
firstSegment = "Generic";
|
|
51420
|
-
break;
|
|
51421
|
-
case SDKTokenType_1.TokenType.border:
|
|
51422
|
-
firstSegment = "Border";
|
|
51423
|
-
break;
|
|
51424
|
-
case SDKTokenType_1.TokenType.textCase:
|
|
51425
|
-
case SDKTokenType_1.TokenType.textDecoration:
|
|
51426
|
-
case SDKTokenType_1.TokenType.visibility:
|
|
51427
|
-
firstSegment = "Options";
|
|
51428
|
-
break;
|
|
51429
|
-
default:
|
|
51430
|
-
throw new UnreachableCaseError_1.UnreachableCaseError(type, `Unsupported type ${firstSegment} in remapping of nodes`);
|
|
51431
|
-
}
|
|
51432
|
-
let secondSegment;
|
|
51433
|
-
switch (node.originalType) {
|
|
51434
|
-
case "borderRadius":
|
|
51435
|
-
secondSegment = "Border Radius";
|
|
51436
|
-
break;
|
|
51437
|
-
case "borderWidth":
|
|
51438
|
-
secondSegment = "Border Width";
|
|
51439
|
-
break;
|
|
51440
|
-
case "sizing":
|
|
51441
|
-
secondSegment = "Sizing";
|
|
51442
|
-
break;
|
|
51443
|
-
case "fontSizes":
|
|
51444
|
-
secondSegment = "Font Size";
|
|
51445
|
-
break;
|
|
51446
|
-
case "paragraphSpacing":
|
|
51447
|
-
secondSegment = "Paragraph Spacing";
|
|
51448
|
-
break;
|
|
51449
|
-
case "lineHeights":
|
|
51450
|
-
secondSegment = "Line Height";
|
|
51451
|
-
break;
|
|
51452
|
-
case "letterSpacing":
|
|
51453
|
-
secondSegment = "Letter Spacing";
|
|
51454
|
-
break;
|
|
51455
|
-
case "spacing":
|
|
51456
|
-
secondSegment = "Spacing";
|
|
51457
|
-
break;
|
|
51458
|
-
case "opacity":
|
|
51459
|
-
secondSegment = "Opacity";
|
|
51460
|
-
break;
|
|
51461
|
-
case "dimension":
|
|
51462
|
-
secondSegment = "Dimension";
|
|
51463
|
-
break;
|
|
51464
|
-
case 'fontFamilies':
|
|
51465
|
-
secondSegment = 'Font Family';
|
|
51466
|
-
break;
|
|
51467
|
-
case 'fontWeights':
|
|
51468
|
-
secondSegment = 'Font Weight';
|
|
51469
|
-
break;
|
|
51470
|
-
default:
|
|
51471
|
-
// Other types than listed should be ignored
|
|
51472
|
-
break;
|
|
51473
|
-
}
|
|
51474
|
-
// Remap original type and add extra group, if needed
|
|
51475
|
-
if (secondSegment) {
|
|
51476
|
-
path = [firstSegment, secondSegment, ...path];
|
|
51477
|
-
}
|
|
51478
|
-
else {
|
|
51479
|
-
path = [firstSegment, ...path];
|
|
51480
|
-
}
|
|
51725
|
+
let { path, key } = this.remapRootNodeKey(node.path, node.token.tokenType, node.originalType, node.token.name);
|
|
51481
51726
|
node.path = path;
|
|
51482
|
-
|
|
51483
|
-
node.key = SDKDTTokenMerger_1.DTTokenMerger.buildKey(node.path, node.token.name);
|
|
51727
|
+
node.key = key;
|
|
51484
51728
|
}
|
|
51485
51729
|
return nodes;
|
|
51486
51730
|
}
|
|
@@ -51686,6 +51930,7 @@ class DTJSONConverter {
|
|
|
51686
51930
|
}
|
|
51687
51931
|
// TODO: Can we do better or need to copy paste?
|
|
51688
51932
|
convertPureReferencedNode(node, brand) {
|
|
51933
|
+
var _a, _b;
|
|
51689
51934
|
const valueAsReference = node.value;
|
|
51690
51935
|
const resolvedToken = this.referenceResolver.lookupReferencedToken(valueAsReference);
|
|
51691
51936
|
if (resolvedToken) {
|
|
@@ -51708,6 +51953,12 @@ class DTJSONConverter {
|
|
|
51708
51953
|
case SDKTokenType_1.TokenType.duration:
|
|
51709
51954
|
case SDKTokenType_1.TokenType.zIndex:
|
|
51710
51955
|
constructedToken = (0, SDKDimensionToken_1.resolveDimension)(snType).create(snType, this.versionId, brand.id, node.name, node.description, undefined, resolvedToken, [], []);
|
|
51956
|
+
if (resolvedToken && ((_a = constructedToken.origin) === null || _a === void 0 ? void 0 : _a.referencePersistentId)) {
|
|
51957
|
+
const refNode = this.referenceResolver.lookupReferencedNode(valueAsReference);
|
|
51958
|
+
const key = this.remapRootNodeKey(refNode.path, resolvedToken.tokenType, refNode.originalType, resolvedToken.name).key;
|
|
51959
|
+
console.log(`Inlining reference origin id ${valueAsReference}: ${key}: ${(_b = constructedToken.origin) === null || _b === void 0 ? void 0 : _b.referencePersistentId} into ${constructedToken.id}:${node.name}:${node.type}`);
|
|
51960
|
+
constructedToken.origin.referenceOriginId = key;
|
|
51961
|
+
}
|
|
51711
51962
|
break;
|
|
51712
51963
|
case SDKTokenType_1.TokenType.shadow:
|
|
51713
51964
|
constructedToken = SDKShadowToken_1.ShadowToken.create(this.versionId, brand.id, node.name, node.description, undefined, resolvedToken, this.referenceResolver, [], []);
|
|
@@ -52399,6 +52650,8 @@ class DTThemeMerger {
|
|
|
52399
52650
|
const tokensToIterate = [...themeReplica.overriddenTokens, ...[...tokensInThemeButNotInUpstream.values()].map(t => t.token)];
|
|
52400
52651
|
for (const node of tokensToIterate) {
|
|
52401
52652
|
(0, SDKTokenValue_1.replaceReferencedTokenByIds)(node, oldId, newId);
|
|
52653
|
+
(0, SDKTokenValue_1.replaceOriginReferencePersistentIdByIds)(node, oldId, newId);
|
|
52654
|
+
// TODO: Fix inside Typography.fontSize
|
|
52402
52655
|
TokenUtils_1.TokenUtils.replaceIdForComplexTokens(node, oldId, newId);
|
|
52403
52656
|
}
|
|
52404
52657
|
}
|
|
@@ -52645,6 +52898,8 @@ class DTTokenMerger {
|
|
|
52645
52898
|
for (const [oldId, newId] of idsToRemap) {
|
|
52646
52899
|
for (const node of toCreateOrUpdate) {
|
|
52647
52900
|
(0, SDKTokenValue_1.replaceReferencedTokenByIds)(node.token, oldId, newId);
|
|
52901
|
+
(0, SDKTokenValue_1.replaceOriginReferencePersistentIdByIds)(node.token, oldId, newId);
|
|
52902
|
+
// TODO: Fix inside Typography.fontSize
|
|
52648
52903
|
TokenUtils_1.TokenUtils.replaceIdForComplexTokens(node.token, oldId, newId);
|
|
52649
52904
|
}
|
|
52650
52905
|
}
|
|
@@ -52787,6 +53042,7 @@ class DTTokenReferenceResolver {
|
|
|
52787
53042
|
}
|
|
52788
53043
|
lookupReferencedToken(reference) {
|
|
52789
53044
|
var _a;
|
|
53045
|
+
reference = reference.trim();
|
|
52790
53046
|
let ref = reference;
|
|
52791
53047
|
if (reference.includes('$')) {
|
|
52792
53048
|
// Convert $ reference to {}-type of reference as keys are all defined as {}
|
|
@@ -52795,8 +53051,19 @@ class DTTokenReferenceResolver {
|
|
|
52795
53051
|
// Find single token reference
|
|
52796
53052
|
return (_a = this.mappedTokens.get(ref)) === null || _a === void 0 ? void 0 : _a[0];
|
|
52797
53053
|
}
|
|
53054
|
+
lookupReferencedNode(reference) {
|
|
53055
|
+
reference = reference.trim();
|
|
53056
|
+
let ref = reference;
|
|
53057
|
+
if (reference.includes('$')) {
|
|
53058
|
+
// Convert $ reference to {}-type of reference as keys are all defined as {}
|
|
53059
|
+
ref = `{${reference.substring(1)}}`;
|
|
53060
|
+
}
|
|
53061
|
+
// Find single token reference
|
|
53062
|
+
return this.nodes.get(ref);
|
|
53063
|
+
}
|
|
52798
53064
|
lookupAllReferencedTokens(reference) {
|
|
52799
53065
|
var _a, _b;
|
|
53066
|
+
reference = reference.trim();
|
|
52800
53067
|
const findings = [...this.findBracketStrings(reference), ...this.findDollarStrings(reference)];
|
|
52801
53068
|
const result = [];
|
|
52802
53069
|
for (const finding of findings) {
|
|
@@ -52818,6 +53085,7 @@ class DTTokenReferenceResolver {
|
|
|
52818
53085
|
return result;
|
|
52819
53086
|
}
|
|
52820
53087
|
replaceAllReferencedTokens(reference, replacements) {
|
|
53088
|
+
reference = reference.trim();
|
|
52821
53089
|
// Seek from the last position so we don't have to deal with repositioning
|
|
52822
53090
|
const sortedReps = replacements.sort((a, b) => b.location - a.location);
|
|
52823
53091
|
let finalReference = reference;
|
|
@@ -66342,6 +66610,10 @@ function getNodeRequestOptions(request) {
|
|
|
66342
66610
|
agent = agent(parsedURL);
|
|
66343
66611
|
}
|
|
66344
66612
|
|
|
66613
|
+
if (!headers.has('Connection') && !agent) {
|
|
66614
|
+
headers.set('Connection', 'close');
|
|
66615
|
+
}
|
|
66616
|
+
|
|
66345
66617
|
// HTTP-network fetch step 4.2
|
|
66346
66618
|
// chunked encoding is handled by Node.js
|
|
66347
66619
|
|
|
@@ -66715,11 +66987,8 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
66715
66987
|
|
|
66716
66988
|
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
|
66717
66989
|
response.once('close', function (hadError) {
|
|
66718
|
-
// tests for socket presence, as in some situations the
|
|
66719
|
-
// the 'socket' event is not triggered for the request
|
|
66720
|
-
// (happens in deno), avoids `TypeError`
|
|
66721
66990
|
// if a data listener is still present we didn't end cleanly
|
|
66722
|
-
const hasDataListener = socket
|
|
66991
|
+
const hasDataListener = socket.listenerCount('data') > 0;
|
|
66723
66992
|
|
|
66724
66993
|
if (hasDataListener && !hadError) {
|
|
66725
66994
|
const err = new Error('Premature close');
|