@supernova-studio/model 0.54.16 → 0.54.18
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 +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/design-system.ts +1 -0
- package/src/dsm/elements/component-properties.ts +4 -0
- package/src/dsm/elements/data/component.ts +1 -0
- package/src/dsm/elements/figma-component.ts +16 -3
- package/src/dsm/import/component.ts +1 -0
package/package.json
CHANGED
package/src/dsm/design-system.ts
CHANGED
|
@@ -35,6 +35,7 @@ export const DesignSystem = z.object({
|
|
|
35
35
|
isApprovalFeatureEnabled: z.boolean(),
|
|
36
36
|
approvalRequiredForPublishing: z.boolean(),
|
|
37
37
|
accessMode: DesignSystemAccessMode,
|
|
38
|
+
membersGenerated: z.boolean(),
|
|
38
39
|
|
|
39
40
|
createdAt: z.coerce.date(),
|
|
40
41
|
updatedAt: z.coerce.date(),
|
|
@@ -22,6 +22,7 @@ export const ComponentElementData = z.object({
|
|
|
22
22
|
|
|
23
23
|
parentComponentPersistentId: nullishToOptional(z.string()),
|
|
24
24
|
componentPropertyDefinitions: nullishToOptional(FigmaComponentPropertyMap),
|
|
25
|
+
variantPropertyValues: nullishToOptional(z.record(z.string())),
|
|
25
26
|
}),
|
|
26
27
|
});
|
|
27
28
|
|
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
} from "./base";
|
|
10
10
|
import { FigmaComponentPropertyMap } from "./component-properties";
|
|
11
11
|
|
|
12
|
+
//
|
|
13
|
+
// Figma Component
|
|
14
|
+
//
|
|
15
|
+
|
|
12
16
|
export const FigmaComponentOriginPart = z.object({
|
|
13
17
|
nodeId: z.string().optional(),
|
|
14
18
|
width: z.number().optional(),
|
|
@@ -28,6 +32,7 @@ export const FigmaComponent = DesignElementBase.extend(DesignElementGroupableReq
|
|
|
28
32
|
origin: FigmaComponentOrigin.optional(),
|
|
29
33
|
thumbnail: FigmaComponentAsset,
|
|
30
34
|
componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),
|
|
35
|
+
variantPropertyValues: z.record(z.string()).optional(),
|
|
31
36
|
|
|
32
37
|
svg: FigmaComponentAsset.optional(),
|
|
33
38
|
isAsset: z.boolean(),
|
|
@@ -39,9 +44,9 @@ export type FigmaComponent = z.infer<typeof FigmaComponent>;
|
|
|
39
44
|
export type FigmaComponentOrigin = z.infer<typeof FigmaComponentOrigin>;
|
|
40
45
|
export type ImportedFigmaComponent = OmitStrict<FigmaComponent, "origin"> & { origin: FigmaComponentOrigin };
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
//
|
|
48
|
+
// Support types
|
|
49
|
+
//
|
|
45
50
|
|
|
46
51
|
export type CreateFigmaComponent = DbCreateInputOmit<FigmaComponent>;
|
|
47
52
|
export type UpdateFigmaComponent = OmitStrict<DbUpdate<FigmaComponent>, "brandPersistentId" | "designSystemVersionId">;
|
|
@@ -51,3 +56,11 @@ export type FigmaComponentDiff = {
|
|
|
51
56
|
toUpdate: UpdateFigmaComponent[];
|
|
52
57
|
toDelete: FigmaComponent["id"][];
|
|
53
58
|
};
|
|
59
|
+
|
|
60
|
+
//
|
|
61
|
+
// Utils
|
|
62
|
+
//
|
|
63
|
+
|
|
64
|
+
export function isImportedFigmaComponent(component: FigmaComponent): component is ImportedFigmaComponent {
|
|
65
|
+
return !!component.origin;
|
|
66
|
+
}
|
|
@@ -11,6 +11,7 @@ const FigmaComponentImportModelPart = z.object({
|
|
|
11
11
|
thumbnail: ImageImportModel,
|
|
12
12
|
parentComponentId: z.string().optional(),
|
|
13
13
|
componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),
|
|
14
|
+
variantPropertyValues: z.record(z.string()).optional(),
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
export const FigmaComponentImportModel = ImportModelBase.extend(FigmaComponentImportModelPart.shape).extend({
|