@supernova-studio/model 0.57.5 → 0.57.6
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/dist/index.d.mts +34 -1
- package/dist/index.d.ts +34 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/elements/data/component.ts +1 -0
- package/src/dsm/elements/figma-component.ts +1 -0
- package/src/dsm/elements/tokens.ts +16 -2
- package/src/dsm/import/component.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -657,7 +657,8 @@ var ComponentElementData = z33.object({
|
|
|
657
657
|
}).optional(),
|
|
658
658
|
parentComponentPersistentId: nullishToOptional(z33.string()),
|
|
659
659
|
componentPropertyDefinitions: nullishToOptional(FigmaComponentPropertyMap),
|
|
660
|
-
variantPropertyValues: nullishToOptional(z33.record(z33.string()))
|
|
660
|
+
variantPropertyValues: nullishToOptional(z33.record(z33.string())),
|
|
661
|
+
renderNodeId: nullishToOptional(z33.string())
|
|
661
662
|
})
|
|
662
663
|
});
|
|
663
664
|
|
|
@@ -3075,7 +3076,8 @@ var FigmaComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart
|
|
|
3075
3076
|
variantPropertyValues: z82.record(z82.string()).optional(),
|
|
3076
3077
|
svg: FigmaComponentAsset.optional(),
|
|
3077
3078
|
isAsset: z82.boolean(),
|
|
3078
|
-
parentComponentPersistentId: nullishToOptional(z82.string())
|
|
3079
|
+
parentComponentPersistentId: nullishToOptional(z82.string()),
|
|
3080
|
+
renderNodeId: z82.string().optional()
|
|
3079
3081
|
});
|
|
3080
3082
|
function isImportedFigmaComponent(component) {
|
|
3081
3083
|
return !!component.origin;
|
|
@@ -3277,6 +3279,15 @@ function extractTokenTypedData(source) {
|
|
|
3277
3279
|
data: source.data
|
|
3278
3280
|
};
|
|
3279
3281
|
}
|
|
3282
|
+
function convertTokenTypedData(source, type) {
|
|
3283
|
+
if (!areTokenTypesCompatible(source.type, type)) {
|
|
3284
|
+
throw SupernovaException.invalidOperation(`Cannot convert token from ${source.type} to ${type}`);
|
|
3285
|
+
}
|
|
3286
|
+
return {
|
|
3287
|
+
type,
|
|
3288
|
+
data: source.data
|
|
3289
|
+
};
|
|
3290
|
+
}
|
|
3280
3291
|
function isImportedDesignToken(designToken) {
|
|
3281
3292
|
return !!designToken.origin;
|
|
3282
3293
|
}
|
|
@@ -3664,7 +3675,8 @@ var FigmaComponentImportModelPart = z93.object({
|
|
|
3664
3675
|
thumbnail: ImageImportModel,
|
|
3665
3676
|
parentComponentId: z93.string().optional(),
|
|
3666
3677
|
componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),
|
|
3667
|
-
variantPropertyValues: z93.record(z93.string()).optional()
|
|
3678
|
+
variantPropertyValues: z93.record(z93.string()).optional(),
|
|
3679
|
+
renderNodeId: z93.string()
|
|
3668
3680
|
});
|
|
3669
3681
|
var FigmaComponentImportModel = ImportModelBase.extend(FigmaComponentImportModelPart.shape).extend({
|
|
3670
3682
|
isAsset: z93.boolean(),
|
|
@@ -5966,6 +5978,7 @@ export {
|
|
|
5966
5978
|
areShallowObjectsEqual,
|
|
5967
5979
|
areTokenTypesCompatible,
|
|
5968
5980
|
buildConstantEnum,
|
|
5981
|
+
convertTokenTypedData,
|
|
5969
5982
|
defaultDocumentationItemConfigurationV1,
|
|
5970
5983
|
defaultDocumentationItemConfigurationV2,
|
|
5971
5984
|
defaultDocumentationItemHeaderV1,
|