@seed-design/figma 1.1.13 → 1.1.14
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/lib/codegen/index.cjs +636 -114
- package/lib/codegen/index.d.ts +136 -96
- package/lib/codegen/index.d.ts.map +1 -1
- package/lib/codegen/index.js +636 -114
- package/lib/codegen/targets/react/index.cjs +682 -134
- package/lib/codegen/targets/react/index.d.ts +31 -11
- package/lib/codegen/targets/react/index.d.ts.map +1 -1
- package/lib/codegen/targets/react/index.js +682 -135
- package/lib/index.cjs +1254 -433
- package/lib/index.d.ts +46 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1254 -433
- package/package.json +1 -1
- package/src/codegen/component-properties.ts +5 -5
- package/src/codegen/core/value-resolver.ts +49 -12
- package/src/codegen/targets/figma/frame.ts +1 -0
- package/src/codegen/targets/figma/pipeline.ts +5 -0
- package/src/codegen/targets/figma/props.ts +30 -1
- package/src/codegen/targets/figma/shape.ts +1 -0
- package/src/codegen/targets/figma/value-resolver.ts +20 -0
- package/src/codegen/targets/react/component/handlers/menu-sheet.ts +1 -1
- package/src/codegen/targets/react/component/handlers/page-banner.ts +2 -2
- package/src/codegen/targets/react/component/handlers/{radio-mark.ts → radiomark.ts} +4 -4
- package/src/codegen/targets/react/component/handlers/result-section.ts +1 -1
- package/src/codegen/targets/react/component/handlers/{switch-mark.ts → switchmark.ts} +4 -4
- package/src/codegen/targets/react/component/index.ts +4 -4
- package/src/codegen/targets/react/frame.ts +16 -2
- package/src/codegen/targets/react/pipeline.ts +6 -1
- package/src/codegen/targets/react/props.ts +26 -0
- package/src/codegen/targets/react/shape.ts +5 -1
- package/src/codegen/targets/react/value-resolver.ts +26 -0
- package/src/entities/data/__generated__/component-sets/index.d.ts +84 -89
- package/src/entities/data/__generated__/component-sets/index.mjs +84 -89
- package/src/entities/data/__generated__/components/index.d.ts +2 -2
- package/src/entities/data/__generated__/components/index.mjs +2 -2
- package/src/entities/data/__generated__/icons/index.mjs +14 -0
- package/src/entities/data/__generated__/styles/index.mjs +190 -1
- package/src/entities/data/__generated__/variable-collections/index.mjs +11 -1
- package/src/entities/data/__generated__/variables/index.mjs +280 -0
- package/src/normalizer/from-plugin.ts +427 -258
- package/src/normalizer/from-rest.ts +428 -58
- package/src/normalizer/types.ts +63 -10
- package/src/utils/figma-node.ts +15 -10
package/lib/index.cjs
CHANGED
|
@@ -1,67 +1,190 @@
|
|
|
1
1
|
var index_cjs = require('./codegen/index.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* from-rest could be run outside of the Figma Plugin environment
|
|
5
|
+
* so we cannot use the Plugin API types directly e.g. getNodeByIdAsync
|
|
6
|
+
*/ /**
|
|
7
|
+
* NOTE: types of MinimalFillsTrait["styles"] can be found here:
|
|
8
|
+
* https://developers.figma.com/docs/rest-api/component-types/#style-type
|
|
9
|
+
* Record<"text" | "fill" | "stroke" | "effect" | "grid", string>
|
|
10
|
+
*/ function createRestNormalizer(ctx) {
|
|
4
11
|
function normalizeNodes(nodes) {
|
|
5
12
|
// Figma REST API omits default values for some fields, "visible" is one of them
|
|
6
13
|
return nodes.filter((node)=>!("visible" in node) || node.visible).map(normalizeNode);
|
|
7
14
|
}
|
|
8
15
|
function normalizeNode(node) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
switch(node.type){
|
|
17
|
+
case "FRAME":
|
|
18
|
+
return normalizeFrameNode(node);
|
|
19
|
+
case "RECTANGLE":
|
|
20
|
+
return normalizeRectangleNode(node);
|
|
21
|
+
case "TEXT":
|
|
22
|
+
return normalizeTextNode(node);
|
|
23
|
+
case "COMPONENT":
|
|
24
|
+
return normalizeComponentNode(node);
|
|
25
|
+
case "INSTANCE":
|
|
26
|
+
return normalizeInstanceNode(node);
|
|
27
|
+
case "VECTOR":
|
|
28
|
+
return normalizeVectorNode(node);
|
|
29
|
+
case "BOOLEAN_OPERATION":
|
|
30
|
+
return normalizeBooleanOperationNode(node);
|
|
31
|
+
case "GROUP":
|
|
32
|
+
return normalizeGroupNodeAsFrameNode(node);
|
|
33
|
+
default:
|
|
34
|
+
return {
|
|
35
|
+
type: "UNHANDLED",
|
|
36
|
+
id: node.id,
|
|
37
|
+
original: node
|
|
38
|
+
};
|
|
32
39
|
}
|
|
40
|
+
}
|
|
41
|
+
function normalizeBoundVariables(boundVariables) {
|
|
42
|
+
if (!boundVariables) return undefined;
|
|
33
43
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
fills: boundVariables.fills,
|
|
45
|
+
strokes: boundVariables.strokes,
|
|
46
|
+
itemSpacing: boundVariables.itemSpacing,
|
|
47
|
+
counterAxisSpacing: boundVariables.counterAxisSpacing,
|
|
48
|
+
topLeftRadius: boundVariables.topLeftRadius,
|
|
49
|
+
topRightRadius: boundVariables.topRightRadius,
|
|
50
|
+
bottomLeftRadius: boundVariables.bottomLeftRadius,
|
|
51
|
+
bottomRightRadius: boundVariables.bottomRightRadius,
|
|
52
|
+
paddingTop: boundVariables.paddingTop,
|
|
53
|
+
paddingRight: boundVariables.paddingRight,
|
|
54
|
+
paddingBottom: boundVariables.paddingBottom,
|
|
55
|
+
paddingLeft: boundVariables.paddingLeft,
|
|
56
|
+
minWidth: boundVariables.minWidth,
|
|
57
|
+
maxWidth: boundVariables.maxWidth,
|
|
58
|
+
minHeight: boundVariables.minHeight,
|
|
59
|
+
maxHeight: boundVariables.maxHeight,
|
|
60
|
+
fontSize: boundVariables.fontSize,
|
|
61
|
+
fontWeight: boundVariables.fontWeight,
|
|
62
|
+
lineHeight: boundVariables.lineHeight,
|
|
63
|
+
size: boundVariables.size
|
|
37
64
|
};
|
|
38
65
|
}
|
|
39
|
-
function
|
|
66
|
+
function normalizePaint(paint) {
|
|
67
|
+
switch(paint.type){
|
|
68
|
+
case "SOLID":
|
|
69
|
+
case "IMAGE":
|
|
70
|
+
case "GRADIENT_LINEAR":
|
|
71
|
+
case "GRADIENT_RADIAL":
|
|
72
|
+
case "GRADIENT_ANGULAR":
|
|
73
|
+
case "GRADIENT_DIAMOND":
|
|
74
|
+
return paint;
|
|
75
|
+
default:
|
|
76
|
+
throw new Error(`Unimplemented paint type: ${paint.type}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function normalizePaints(paints) {
|
|
80
|
+
if (!paints) return [];
|
|
81
|
+
return paints.map(normalizePaint);
|
|
82
|
+
}
|
|
83
|
+
function normalizeRadiusProps({ cornerRadius, rectangleCornerRadii }) {
|
|
40
84
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
cornerRadius,
|
|
86
|
+
rectangleCornerRadii
|
|
43
87
|
};
|
|
44
88
|
}
|
|
45
|
-
function
|
|
89
|
+
function normalizeEffectProps(node) {
|
|
90
|
+
const effects = (node.effects ?? []).filter((effect)=>effect.visible !== false && (effect.type === "DROP_SHADOW" || effect.type === "INNER_SHADOW")).map((effect)=>{
|
|
91
|
+
const { type, color, offset, radius, spread, boundVariables } = effect;
|
|
92
|
+
return {
|
|
93
|
+
type,
|
|
94
|
+
color,
|
|
95
|
+
offset,
|
|
96
|
+
radius,
|
|
97
|
+
spread,
|
|
98
|
+
boundVariables
|
|
99
|
+
};
|
|
100
|
+
});
|
|
46
101
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children: normalizeNodes(node.children)
|
|
102
|
+
effects,
|
|
103
|
+
effectStyleKey: node.styles?.["effect"] ? ctx.styles[node.styles["effect"]]?.key : undefined
|
|
50
104
|
};
|
|
51
105
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
106
|
+
function normalizeShapeProps(node) {
|
|
107
|
+
return {
|
|
108
|
+
// NormalizedHasLayoutTrait
|
|
109
|
+
layoutGrow: node.layoutGrow,
|
|
110
|
+
layoutAlign: node.layoutAlign,
|
|
111
|
+
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
112
|
+
layoutSizingVertical: node.layoutSizingVertical,
|
|
113
|
+
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
114
|
+
relativeTransform: node.relativeTransform,
|
|
115
|
+
layoutPositioning: node.layoutPositioning,
|
|
116
|
+
minHeight: node.minHeight,
|
|
117
|
+
minWidth: node.minWidth,
|
|
118
|
+
maxHeight: node.maxHeight,
|
|
119
|
+
maxWidth: node.maxWidth,
|
|
120
|
+
// NormalizedHasGeometryTrait
|
|
121
|
+
fills: normalizePaints(node.fills),
|
|
122
|
+
fillStyleKey: node.styles?.["fill"] ? ctx.styles[node.styles["fill"]]?.key : undefined,
|
|
123
|
+
strokes: normalizePaints(node.strokes),
|
|
124
|
+
strokeWeight: node.strokeWeight,
|
|
125
|
+
// NormalizedHasEffectsTrait
|
|
126
|
+
...normalizeEffectProps(node)
|
|
127
|
+
};
|
|
54
128
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
129
|
+
function normalizeAutolayoutProps(node) {
|
|
130
|
+
return {
|
|
131
|
+
layoutMode: node.layoutMode,
|
|
132
|
+
layoutWrap: node.layoutWrap,
|
|
133
|
+
paddingLeft: node.paddingLeft,
|
|
134
|
+
paddingRight: node.paddingRight,
|
|
135
|
+
paddingTop: node.paddingTop,
|
|
136
|
+
paddingBottom: node.paddingBottom,
|
|
137
|
+
primaryAxisAlignItems: node.primaryAxisAlignItems,
|
|
138
|
+
primaryAxisSizingMode: node.primaryAxisSizingMode,
|
|
139
|
+
counterAxisAlignItems: node.counterAxisAlignItems,
|
|
140
|
+
counterAxisSizingMode: node.counterAxisSizingMode,
|
|
141
|
+
itemSpacing: node.itemSpacing,
|
|
142
|
+
counterAxisSpacing: node.counterAxisSpacing
|
|
143
|
+
};
|
|
57
144
|
}
|
|
58
|
-
function
|
|
145
|
+
function normalizeFrameNode(node) {
|
|
59
146
|
return {
|
|
60
|
-
|
|
147
|
+
// NormalizedIsLayerTrait
|
|
148
|
+
type: node.type,
|
|
149
|
+
id: node.id,
|
|
150
|
+
name: node.name,
|
|
151
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
152
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait, NormalizedHasFramePropertiesTrait
|
|
153
|
+
...normalizeShapeProps(node),
|
|
154
|
+
// NormalizedCornerTrait
|
|
155
|
+
...normalizeRadiusProps(node),
|
|
156
|
+
// NormalizedHasFramePropertiesTrait
|
|
157
|
+
...normalizeAutolayoutProps(node),
|
|
158
|
+
// NormalizedHasChildrenTrait
|
|
61
159
|
children: normalizeNodes(node.children)
|
|
62
160
|
};
|
|
63
161
|
}
|
|
162
|
+
function normalizeRectangleNode(node) {
|
|
163
|
+
return {
|
|
164
|
+
// NormalizedIsLayerTrait
|
|
165
|
+
type: node.type,
|
|
166
|
+
id: node.id,
|
|
167
|
+
name: node.name,
|
|
168
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
169
|
+
// NormalizedCornerTrait
|
|
170
|
+
...normalizeRadiusProps(node),
|
|
171
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
172
|
+
...normalizeShapeProps(node)
|
|
173
|
+
};
|
|
174
|
+
}
|
|
64
175
|
function normalizeTextNode(node) {
|
|
176
|
+
// Convert TypeStyle to NormalizedTextSegment.style format
|
|
177
|
+
function normalizeSegmentStyle(typeStyle) {
|
|
178
|
+
return {
|
|
179
|
+
fontFamily: typeStyle.fontFamily,
|
|
180
|
+
fontWeight: typeStyle.fontWeight,
|
|
181
|
+
fontSize: typeStyle.fontSize,
|
|
182
|
+
italic: typeStyle.italic,
|
|
183
|
+
textDecoration: typeStyle.textDecoration,
|
|
184
|
+
letterSpacing: typeStyle.letterSpacing,
|
|
185
|
+
lineHeight: typeStyle.lineHeightPx
|
|
186
|
+
};
|
|
187
|
+
}
|
|
65
188
|
// Function to segment a text node based on style overrides
|
|
66
189
|
function segmentTextNode(textNode) {
|
|
67
190
|
const segments = [];
|
|
@@ -75,7 +198,7 @@ function createRestNormalizer(ctx) {
|
|
|
75
198
|
characters: characters,
|
|
76
199
|
start: 0,
|
|
77
200
|
end: characters.length,
|
|
78
|
-
style: textNode.style
|
|
201
|
+
style: normalizeSegmentStyle(textNode.style)
|
|
79
202
|
}
|
|
80
203
|
];
|
|
81
204
|
}
|
|
@@ -104,7 +227,7 @@ function createRestNormalizer(ctx) {
|
|
|
104
227
|
characters: "",
|
|
105
228
|
start: i,
|
|
106
229
|
end: 0,
|
|
107
|
-
style: styleId ? styleTable[styleId]
|
|
230
|
+
style: styleId ? normalizeSegmentStyle(styleTable[styleId]) : {}
|
|
108
231
|
};
|
|
109
232
|
}
|
|
110
233
|
}
|
|
@@ -117,14 +240,34 @@ function createRestNormalizer(ctx) {
|
|
|
117
240
|
return segments;
|
|
118
241
|
}
|
|
119
242
|
return {
|
|
120
|
-
|
|
243
|
+
// NormalizedIsLayerTrait
|
|
244
|
+
type: node.type,
|
|
245
|
+
id: node.id,
|
|
246
|
+
name: node.name,
|
|
247
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
248
|
+
// NormalizedTypePropertiesTrait
|
|
249
|
+
style: node.style,
|
|
250
|
+
characters: node.characters,
|
|
121
251
|
textStyleKey: node.styles?.["text"] ? ctx.styles[node.styles["text"]]?.key : undefined,
|
|
122
|
-
segments: segmentTextNode(node)
|
|
252
|
+
segments: segmentTextNode(node),
|
|
253
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
254
|
+
...normalizeShapeProps(node)
|
|
123
255
|
};
|
|
124
256
|
}
|
|
125
257
|
function normalizeComponentNode(node) {
|
|
126
258
|
return {
|
|
127
|
-
|
|
259
|
+
// NormalizedIsLayerTrait
|
|
260
|
+
type: node.type,
|
|
261
|
+
id: node.id,
|
|
262
|
+
name: node.name,
|
|
263
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
264
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
265
|
+
...normalizeShapeProps(node),
|
|
266
|
+
// NormalizedHasCornerTrait
|
|
267
|
+
...normalizeRadiusProps(node),
|
|
268
|
+
// NormalizedHasFramePropertiesTrait
|
|
269
|
+
...normalizeAutolayoutProps(node),
|
|
270
|
+
// NormalizedHasChildrenTrait
|
|
128
271
|
children: normalizeNodes(node.children)
|
|
129
272
|
};
|
|
130
273
|
}
|
|
@@ -138,22 +281,128 @@ function createRestNormalizer(ctx) {
|
|
|
138
281
|
for (const [key, value] of Object.entries(node.componentProperties ?? {})){
|
|
139
282
|
componentProperties[key] = value;
|
|
140
283
|
if (value.type === "INSTANCE_SWAP") {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
284
|
+
// unless value.type === "BOOLEAN", value.value is string
|
|
285
|
+
const swappedComponent = ctx.components[value.value];
|
|
286
|
+
if (swappedComponent) {
|
|
287
|
+
componentProperties[key].componentKey = swappedComponent.key;
|
|
288
|
+
const swappedComponentSet = swappedComponent?.componentSetId ? ctx.componentSets[swappedComponent.componentSetId] : undefined;
|
|
289
|
+
if (swappedComponentSet) {
|
|
290
|
+
componentProperties[key].componentSetKey = swappedComponentSet.key;
|
|
291
|
+
}
|
|
148
292
|
}
|
|
149
293
|
}
|
|
150
294
|
}
|
|
151
295
|
return {
|
|
152
|
-
|
|
296
|
+
// NormalizedIsLayerTrait
|
|
297
|
+
type: node.type,
|
|
298
|
+
id: node.id,
|
|
299
|
+
name: node.name,
|
|
300
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
301
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
302
|
+
...normalizeShapeProps(node),
|
|
303
|
+
// NormalizedCornerTrait
|
|
304
|
+
...normalizeRadiusProps(node),
|
|
305
|
+
// NormalizedHasFramePropertiesTrait
|
|
306
|
+
...normalizeAutolayoutProps(node),
|
|
307
|
+
// NormalizedHasChildrenTrait
|
|
153
308
|
children: normalizeNodes(node.children),
|
|
309
|
+
// NormalizedInstanceNode specific
|
|
310
|
+
componentProperties,
|
|
154
311
|
componentKey: mainComponent.key,
|
|
155
312
|
componentSetKey: componentSet?.key,
|
|
156
|
-
|
|
313
|
+
overrides: node.overrides
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function normalizeVectorNode(node) {
|
|
317
|
+
return {
|
|
318
|
+
// NormalizedIsLayerTrait
|
|
319
|
+
type: node.type,
|
|
320
|
+
id: node.id,
|
|
321
|
+
name: node.name,
|
|
322
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
323
|
+
// NormalizedCornerTrait
|
|
324
|
+
...normalizeRadiusProps(node),
|
|
325
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
326
|
+
...normalizeShapeProps(node)
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function normalizeBooleanOperationNode(node) {
|
|
330
|
+
return {
|
|
331
|
+
// NormalizedIsLayerTrait
|
|
332
|
+
type: node.type,
|
|
333
|
+
id: node.id,
|
|
334
|
+
name: node.name,
|
|
335
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
336
|
+
// NormalizedHasLayoutTrait
|
|
337
|
+
layoutGrow: node.layoutGrow,
|
|
338
|
+
layoutAlign: node.layoutAlign,
|
|
339
|
+
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
340
|
+
layoutSizingVertical: node.layoutSizingVertical,
|
|
341
|
+
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
342
|
+
relativeTransform: node.relativeTransform,
|
|
343
|
+
layoutPositioning: node.layoutPositioning,
|
|
344
|
+
minHeight: node.minHeight,
|
|
345
|
+
minWidth: node.minWidth,
|
|
346
|
+
maxHeight: node.maxHeight,
|
|
347
|
+
maxWidth: node.maxWidth,
|
|
348
|
+
// NormalizedHasGeometryTrait
|
|
349
|
+
fills: normalizePaints(node.fills),
|
|
350
|
+
fillStyleKey: node.styles?.["fill"] ? ctx.styles[node.styles["fill"]]?.key : undefined,
|
|
351
|
+
strokes: normalizePaints(node.strokes),
|
|
352
|
+
strokeWeight: node.strokeWeight,
|
|
353
|
+
// NormalizedHasEffectsTrait
|
|
354
|
+
...normalizeEffectProps(node),
|
|
355
|
+
// NormalizedHasChildrenTrait
|
|
356
|
+
children: normalizeNodes(node.children)
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function normalizeGroupNodeAsFrameNode(node) {
|
|
360
|
+
return {
|
|
361
|
+
// NormalizedIsLayerTrait
|
|
362
|
+
type: "FRAME",
|
|
363
|
+
id: node.id,
|
|
364
|
+
name: node.name,
|
|
365
|
+
boundVariables: normalizeBoundVariables(node.boundVariables),
|
|
366
|
+
// NormalizedHasLayoutTrait
|
|
367
|
+
layoutGrow: node.layoutGrow,
|
|
368
|
+
layoutAlign: node.layoutAlign,
|
|
369
|
+
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
370
|
+
layoutSizingVertical: node.layoutSizingVertical,
|
|
371
|
+
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
372
|
+
relativeTransform: node.relativeTransform,
|
|
373
|
+
layoutPositioning: node.layoutPositioning,
|
|
374
|
+
minHeight: node.minHeight,
|
|
375
|
+
minWidth: node.minWidth,
|
|
376
|
+
maxHeight: node.maxHeight,
|
|
377
|
+
maxWidth: node.maxWidth,
|
|
378
|
+
// NormalizedHasGeometryTrait
|
|
379
|
+
fills: [],
|
|
380
|
+
fillStyleKey: undefined,
|
|
381
|
+
strokes: [],
|
|
382
|
+
strokeWeight: undefined,
|
|
383
|
+
// NormalizedHasEffectsTrait
|
|
384
|
+
effects: [],
|
|
385
|
+
effectStyleKey: undefined,
|
|
386
|
+
// NormalizedCornerTrait
|
|
387
|
+
cornerRadius: undefined,
|
|
388
|
+
rectangleCornerRadii: undefined,
|
|
389
|
+
// NormalizedHasFramePropertiesTrait
|
|
390
|
+
// these are undefined compared to from-plugin normalizer
|
|
391
|
+
// since inferredAutoLayout isn't available in REST API
|
|
392
|
+
layoutMode: undefined,
|
|
393
|
+
layoutWrap: undefined,
|
|
394
|
+
paddingLeft: undefined,
|
|
395
|
+
paddingRight: undefined,
|
|
396
|
+
paddingTop: undefined,
|
|
397
|
+
paddingBottom: undefined,
|
|
398
|
+
primaryAxisAlignItems: undefined,
|
|
399
|
+
primaryAxisSizingMode: undefined,
|
|
400
|
+
counterAxisAlignItems: undefined,
|
|
401
|
+
counterAxisSizingMode: undefined,
|
|
402
|
+
itemSpacing: undefined,
|
|
403
|
+
counterAxisSpacing: undefined,
|
|
404
|
+
// NormalizedHasChildrenTrait
|
|
405
|
+
children: normalizeNodes(node.children)
|
|
157
406
|
};
|
|
158
407
|
}
|
|
159
408
|
return normalizeNode;
|
|
@@ -253,110 +502,217 @@ function createPluginNormalizer() {
|
|
|
253
502
|
return Promise.all(nodes.filter((node)=>node.visible).map(normalizeNode));
|
|
254
503
|
}
|
|
255
504
|
async function normalizeNode(node) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
505
|
+
switch(node.type){
|
|
506
|
+
case "FRAME":
|
|
507
|
+
return normalizeFrameNode(node);
|
|
508
|
+
case "RECTANGLE":
|
|
509
|
+
return normalizeRectangleNode(node);
|
|
510
|
+
case "TEXT":
|
|
511
|
+
return normalizeTextNode(node);
|
|
512
|
+
case "COMPONENT":
|
|
513
|
+
return normalizeComponentNode(node);
|
|
514
|
+
case "INSTANCE":
|
|
515
|
+
return normalizeInstanceNode(node);
|
|
516
|
+
case "VECTOR":
|
|
517
|
+
return normalizeVectorNode(node);
|
|
518
|
+
case "BOOLEAN_OPERATION":
|
|
519
|
+
return normalizeBooleanOperationNode(node);
|
|
520
|
+
case "GROUP":
|
|
521
|
+
return normalizeGroupNodeAsFrameNode(node);
|
|
522
|
+
default:
|
|
523
|
+
return {
|
|
524
|
+
type: "UNHANDLED",
|
|
525
|
+
id: node.id,
|
|
526
|
+
original: node
|
|
527
|
+
};
|
|
273
528
|
}
|
|
274
|
-
|
|
275
|
-
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Pick specific fields from boundVariables
|
|
532
|
+
*/ function normalizeBoundVariables({ boundVariables }) {
|
|
533
|
+
if (!boundVariables) return undefined;
|
|
534
|
+
return {
|
|
535
|
+
fills: boundVariables.fills,
|
|
536
|
+
strokes: boundVariables.strokes,
|
|
537
|
+
itemSpacing: boundVariables.itemSpacing,
|
|
538
|
+
counterAxisSpacing: boundVariables.counterAxisSpacing,
|
|
539
|
+
topLeftRadius: boundVariables.topLeftRadius,
|
|
540
|
+
topRightRadius: boundVariables.topRightRadius,
|
|
541
|
+
bottomLeftRadius: boundVariables.bottomLeftRadius,
|
|
542
|
+
bottomRightRadius: boundVariables.bottomRightRadius,
|
|
543
|
+
paddingTop: boundVariables.paddingTop,
|
|
544
|
+
paddingRight: boundVariables.paddingRight,
|
|
545
|
+
paddingBottom: boundVariables.paddingBottom,
|
|
546
|
+
paddingLeft: boundVariables.paddingLeft,
|
|
547
|
+
minWidth: boundVariables.minWidth,
|
|
548
|
+
maxWidth: boundVariables.maxWidth,
|
|
549
|
+
minHeight: boundVariables.minHeight,
|
|
550
|
+
maxHeight: boundVariables.maxHeight,
|
|
551
|
+
fontSize: boundVariables.fontSize,
|
|
552
|
+
fontWeight: boundVariables.fontWeight,
|
|
553
|
+
lineHeight: boundVariables.lineHeight,
|
|
554
|
+
size: {
|
|
555
|
+
x: boundVariables.width,
|
|
556
|
+
y: boundVariables.height
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function normalizeSolidPaint(paint) {
|
|
561
|
+
return {
|
|
562
|
+
type: paint.type,
|
|
563
|
+
color: {
|
|
564
|
+
r: paint.color.r,
|
|
565
|
+
g: paint.color.g,
|
|
566
|
+
b: paint.color.b,
|
|
567
|
+
a: paint.opacity ?? 1
|
|
568
|
+
},
|
|
569
|
+
visible: paint.visible,
|
|
570
|
+
blendMode: paint.blendMode ?? "NORMAL",
|
|
571
|
+
opacity: paint.opacity,
|
|
572
|
+
boundVariables: paint.boundVariables
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
function normalizePaint(paint) {
|
|
576
|
+
switch(paint.type){
|
|
577
|
+
case "SOLID":
|
|
578
|
+
return normalizeSolidPaint(paint);
|
|
579
|
+
case "IMAGE":
|
|
580
|
+
return {
|
|
581
|
+
type: "IMAGE",
|
|
582
|
+
scaleMode: paint.scaleMode === "CROP" ? "STRETCH" : paint.scaleMode,
|
|
583
|
+
imageTransform: paint.imageTransform,
|
|
584
|
+
scalingFactor: paint.scalingFactor,
|
|
585
|
+
filters: paint.filters,
|
|
586
|
+
rotation: paint.rotation,
|
|
587
|
+
imageRef: paint.imageHash ?? "",
|
|
588
|
+
blendMode: paint.blendMode ?? "NORMAL",
|
|
589
|
+
visible: paint.visible,
|
|
590
|
+
opacity: paint.opacity
|
|
591
|
+
};
|
|
592
|
+
case "GRADIENT_LINEAR":
|
|
593
|
+
case "GRADIENT_RADIAL":
|
|
594
|
+
case "GRADIENT_ANGULAR":
|
|
595
|
+
case "GRADIENT_DIAMOND":
|
|
596
|
+
return {
|
|
597
|
+
type: paint.type,
|
|
598
|
+
gradientStops: [
|
|
599
|
+
...paint.gradientStops
|
|
600
|
+
],
|
|
601
|
+
visible: paint.visible,
|
|
602
|
+
opacity: paint.opacity,
|
|
603
|
+
blendMode: paint.blendMode ?? "NORMAL",
|
|
604
|
+
gradientHandlePositions: convertTransformToGradientHandles(paint.gradientTransform)
|
|
605
|
+
};
|
|
606
|
+
default:
|
|
607
|
+
throw new Error(`Unimplemented paint type: ${paint.type}`);
|
|
276
608
|
}
|
|
277
|
-
|
|
278
|
-
|
|
609
|
+
}
|
|
610
|
+
function normalizePaints(fills) {
|
|
611
|
+
if (fills === figma.mixed) {
|
|
612
|
+
console.warn("Mixed fills are not supported");
|
|
613
|
+
return [];
|
|
279
614
|
}
|
|
615
|
+
return fills.map(normalizePaint);
|
|
616
|
+
}
|
|
617
|
+
function normalizeRadiusProps(node) {
|
|
280
618
|
return {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
619
|
+
cornerRadius: node.cornerRadius === figma.mixed ? undefined : node.cornerRadius,
|
|
620
|
+
rectangleCornerRadii: [
|
|
621
|
+
node.topLeftRadius,
|
|
622
|
+
node.topRightRadius,
|
|
623
|
+
node.bottomRightRadius,
|
|
624
|
+
node.bottomLeftRadius
|
|
625
|
+
]
|
|
284
626
|
};
|
|
285
627
|
}
|
|
286
|
-
async function
|
|
628
|
+
async function normalizeEffectProps(node) {
|
|
629
|
+
const effectStyleKey = typeof node.effectStyleId === "string" ? (await figma.getStyleByIdAsync(node.effectStyleId))?.key : undefined;
|
|
630
|
+
const effects = node.effects.filter((effect)=>{
|
|
631
|
+
if (!effect.visible) return false;
|
|
632
|
+
return effect.type === "DROP_SHADOW" || effect.type === "INNER_SHADOW";
|
|
633
|
+
}).map(({ blendMode, visible, ...rest })=>rest);
|
|
287
634
|
return {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
...normalizeRadiusProps(node),
|
|
293
|
-
...await normalizeAutolayoutProps(node),
|
|
294
|
-
children: await normalizeNodes(node.children)
|
|
635
|
+
...effectStyleKey ? {
|
|
636
|
+
effectStyleKey
|
|
637
|
+
} : {},
|
|
638
|
+
effects
|
|
295
639
|
};
|
|
296
640
|
}
|
|
297
|
-
async function
|
|
641
|
+
async function normalizeShapeProps(node) {
|
|
642
|
+
const fillStyleKey = typeof node.fillStyleId === "string" ? (await figma.getStyleByIdAsync(node.fillStyleId))?.key : undefined;
|
|
298
643
|
return {
|
|
299
|
-
|
|
300
|
-
id: node.id,
|
|
301
|
-
name: node.name,
|
|
302
|
-
boundVariables: await normalizeBoundVariables(node),
|
|
644
|
+
// NormalizedHasLayoutTrait
|
|
303
645
|
layoutGrow: node.inferredAutoLayout?.layoutGrow ?? node.layoutGrow,
|
|
304
646
|
layoutAlign: node.inferredAutoLayout?.layoutAlign ?? node.layoutAlign,
|
|
305
647
|
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
306
648
|
layoutSizingVertical: node.layoutSizingVertical,
|
|
307
649
|
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
308
650
|
relativeTransform: node.relativeTransform,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
fills: [],
|
|
322
|
-
strokes: [],
|
|
323
|
-
children: await normalizeNodes(node.children)
|
|
651
|
+
layoutPositioning: node.layoutPositioning,
|
|
652
|
+
minHeight: node.minHeight ?? undefined,
|
|
653
|
+
minWidth: node.minWidth ?? undefined,
|
|
654
|
+
maxHeight: node.maxHeight ?? undefined,
|
|
655
|
+
maxWidth: node.maxWidth ?? undefined,
|
|
656
|
+
// NormalizedHasGeometryTrait
|
|
657
|
+
fills: await normalizePaints(node.fills),
|
|
658
|
+
fillStyleKey,
|
|
659
|
+
strokes: await normalizePaints(node.strokes),
|
|
660
|
+
strokeWeight: node.strokeWeight === figma.mixed ? undefined : node.strokeWeight,
|
|
661
|
+
// NormalizedHasEffectsTrait
|
|
662
|
+
...await normalizeEffectProps(node)
|
|
324
663
|
};
|
|
325
664
|
}
|
|
326
|
-
async function
|
|
665
|
+
async function normalizeAutolayoutProps(node) {
|
|
327
666
|
return {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
667
|
+
layoutMode: node.inferredAutoLayout?.layoutMode ?? node.layoutMode,
|
|
668
|
+
layoutWrap: node.inferredAutoLayout?.layoutWrap ?? node.layoutWrap,
|
|
669
|
+
paddingLeft: node.inferredAutoLayout?.paddingLeft ?? node.paddingLeft,
|
|
670
|
+
paddingRight: node.inferredAutoLayout?.paddingRight ?? node.paddingRight,
|
|
671
|
+
paddingTop: node.inferredAutoLayout?.paddingTop ?? node.paddingTop,
|
|
672
|
+
paddingBottom: node.inferredAutoLayout?.paddingBottom ?? node.paddingBottom,
|
|
673
|
+
primaryAxisAlignItems: node.inferredAutoLayout?.primaryAxisAlignItems ?? node.primaryAxisAlignItems,
|
|
674
|
+
counterAxisAlignItems: node.inferredAutoLayout?.counterAxisAlignItems ?? node.counterAxisAlignItems,
|
|
675
|
+
primaryAxisSizingMode: node.inferredAutoLayout?.primaryAxisSizingMode ?? node.primaryAxisSizingMode,
|
|
676
|
+
counterAxisSizingMode: node.inferredAutoLayout?.counterAxisSizingMode ?? node.counterAxisSizingMode,
|
|
677
|
+
itemSpacing: node.inferredAutoLayout?.itemSpacing ?? node.itemSpacing,
|
|
678
|
+
counterAxisSpacing: node.inferredAutoLayout?.counterAxisSpacing ?? node.counterAxisSpacing ?? undefined
|
|
334
679
|
};
|
|
335
680
|
}
|
|
336
|
-
async function
|
|
681
|
+
async function normalizeFrameNode(node) {
|
|
337
682
|
return {
|
|
683
|
+
// NormalizedIsLayerTrait
|
|
338
684
|
type: node.type,
|
|
339
685
|
id: node.id,
|
|
340
686
|
name: node.name,
|
|
341
|
-
boundVariables:
|
|
342
|
-
|
|
687
|
+
boundVariables: normalizeBoundVariables(node),
|
|
688
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
689
|
+
...await normalizeShapeProps(node),
|
|
690
|
+
// NormalizedCornerTrait
|
|
691
|
+
...normalizeRadiusProps(node),
|
|
692
|
+
// NormalizedHasFramePropertiesTrait
|
|
693
|
+
...await normalizeAutolayoutProps(node),
|
|
694
|
+
// NormalizedHasChildrenTrait
|
|
695
|
+
children: await normalizeNodes(node.children)
|
|
343
696
|
};
|
|
344
697
|
}
|
|
345
|
-
async function
|
|
698
|
+
async function normalizeRectangleNode(node) {
|
|
346
699
|
return {
|
|
700
|
+
// NormalizedIsLayerTrait
|
|
347
701
|
type: node.type,
|
|
348
702
|
id: node.id,
|
|
349
703
|
name: node.name,
|
|
350
|
-
boundVariables:
|
|
351
|
-
|
|
704
|
+
boundVariables: normalizeBoundVariables(node),
|
|
705
|
+
// NormalizedCornerTrait
|
|
706
|
+
...normalizeRadiusProps(node),
|
|
707
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
352
708
|
...await normalizeShapeProps(node)
|
|
353
709
|
};
|
|
354
710
|
}
|
|
355
711
|
async function normalizeTextNode(node) {
|
|
356
712
|
const segments = node.getStyledTextSegments([
|
|
357
|
-
"fontSize",
|
|
358
|
-
"fontWeight",
|
|
359
713
|
"fontName",
|
|
714
|
+
"fontWeight",
|
|
715
|
+
"fontSize",
|
|
360
716
|
"letterSpacing",
|
|
361
717
|
"lineHeight",
|
|
362
718
|
"paragraphSpacing",
|
|
@@ -367,25 +723,50 @@ function createPluginNormalizer() {
|
|
|
367
723
|
]);
|
|
368
724
|
const first = segments[0];
|
|
369
725
|
const textStyleKey = typeof node.textStyleId === "string" ? (await figma.getStyleByIdAsync(node.textStyleId))?.key : undefined;
|
|
726
|
+
const normalizeLetterSpacing = (letterSpacing, fontSize)=>{
|
|
727
|
+
if (letterSpacing.unit === "PIXELS") return letterSpacing.value;
|
|
728
|
+
if (letterSpacing.unit === "PERCENT") return fontSize * letterSpacing.value / 100;
|
|
729
|
+
return undefined;
|
|
730
|
+
};
|
|
731
|
+
const normalizeLineHeight = (lineHeight, fontSize)=>{
|
|
732
|
+
if (lineHeight.unit === "PIXELS") return lineHeight.value;
|
|
733
|
+
if (lineHeight.unit === "PERCENT") return fontSize * lineHeight.value / 100;
|
|
734
|
+
return undefined;
|
|
735
|
+
};
|
|
736
|
+
const isItalic = (fontName)=>{
|
|
737
|
+
// {
|
|
738
|
+
// family: "SF Mono",
|
|
739
|
+
// style: "Bold Italic"
|
|
740
|
+
// }
|
|
741
|
+
return fontName.style.toLowerCase().includes("italic");
|
|
742
|
+
};
|
|
370
743
|
return {
|
|
744
|
+
// NormalizedIsLayerTrait
|
|
371
745
|
type: node.type,
|
|
372
746
|
id: node.id,
|
|
373
747
|
name: node.name,
|
|
374
|
-
boundVariables:
|
|
748
|
+
boundVariables: normalizeBoundVariables(node),
|
|
749
|
+
// NormalizedTypePropertiesTrait
|
|
750
|
+
// NOTE: this normalization is incomplete compared to from-rest.ts normalizer
|
|
375
751
|
style: {
|
|
376
|
-
fontSize: first.fontSize,
|
|
377
|
-
fontWeight: first.fontWeight,
|
|
378
752
|
fontFamily: first.fontName.family,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
753
|
+
fontPostScriptName: null,
|
|
754
|
+
fontStyle: first.fontName.style,
|
|
755
|
+
italic: isItalic(first.fontName),
|
|
756
|
+
fontWeight: first.fontWeight,
|
|
757
|
+
fontSize: first.fontSize,
|
|
758
|
+
textAlignHorizontal: node.textAlignHorizontal,
|
|
759
|
+
textAlignVertical: node.textAlignVertical,
|
|
760
|
+
letterSpacing: normalizeLetterSpacing(first.letterSpacing, first.fontSize),
|
|
382
761
|
paragraphSpacing: first.paragraphSpacing,
|
|
383
|
-
|
|
762
|
+
textDecoration: first.textDecoration,
|
|
763
|
+
lineHeightPx: normalizeLineHeight(first.lineHeight, first.fontSize),
|
|
764
|
+
lineHeightUnit: first.lineHeight.unit === "PIXELS" ? "PIXELS" : first.lineHeight.unit === "PERCENT" ? "FONT_SIZE_%" : undefined,
|
|
765
|
+
boundVariables: first.boundVariables,
|
|
766
|
+
maxLines: node.maxLines ?? undefined
|
|
384
767
|
},
|
|
385
|
-
...textStyleKey ? {
|
|
386
|
-
textStyleKey
|
|
387
|
-
} : {},
|
|
388
768
|
characters: node.characters,
|
|
769
|
+
textStyleKey,
|
|
389
770
|
segments: segments.map((segment)=>({
|
|
390
771
|
characters: segment.characters,
|
|
391
772
|
start: segment.start,
|
|
@@ -394,21 +775,30 @@ function createPluginNormalizer() {
|
|
|
394
775
|
fontSize: segment.fontSize,
|
|
395
776
|
fontWeight: segment.fontWeight,
|
|
396
777
|
fontFamily: segment.fontName.family,
|
|
397
|
-
|
|
398
|
-
|
|
778
|
+
italic: isItalic(segment.fontName),
|
|
779
|
+
letterSpacing: normalizeLetterSpacing(segment.letterSpacing, segment.fontSize),
|
|
780
|
+
lineHeight: normalizeLineHeight(segment.lineHeight, segment.fontSize),
|
|
781
|
+
textDecoration: segment.textDecoration
|
|
399
782
|
}
|
|
400
783
|
})),
|
|
784
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
401
785
|
...await normalizeShapeProps(node)
|
|
402
786
|
};
|
|
403
787
|
}
|
|
404
788
|
async function normalizeComponentNode(node) {
|
|
405
789
|
return {
|
|
790
|
+
// NormalizedIsLayerTrait
|
|
406
791
|
type: node.type,
|
|
407
792
|
id: node.id,
|
|
408
793
|
name: node.name,
|
|
409
|
-
boundVariables:
|
|
794
|
+
boundVariables: normalizeBoundVariables(node),
|
|
795
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
796
|
+
...await normalizeShapeProps(node),
|
|
797
|
+
// NormalizedCornerTrait
|
|
410
798
|
...normalizeRadiusProps(node),
|
|
799
|
+
// NormalizedHasFramePropertiesTrait
|
|
411
800
|
...await normalizeAutolayoutProps(node),
|
|
801
|
+
// NormalizedHasChildrenTrait
|
|
412
802
|
children: await normalizeNodes(node.children)
|
|
413
803
|
};
|
|
414
804
|
}
|
|
@@ -421,184 +811,127 @@ function createPluginNormalizer() {
|
|
|
421
811
|
for (const [key, value] of Object.entries(node.componentProperties)){
|
|
422
812
|
componentProperties[key] = value;
|
|
423
813
|
if (value.type === "INSTANCE_SWAP") {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
814
|
+
// unless value.type === "BOOLEAN", value.value is string
|
|
815
|
+
const swappedComponent = await figma.getNodeByIdAsync(value.value);
|
|
816
|
+
if (swappedComponent) {
|
|
817
|
+
componentProperties[key].componentKey = swappedComponent.key;
|
|
818
|
+
if (swappedComponent.parent?.type === "COMPONENT_SET") {
|
|
819
|
+
componentProperties[key].componentSetKey = swappedComponent.parent.key;
|
|
429
820
|
}
|
|
430
821
|
}
|
|
431
822
|
}
|
|
432
823
|
}
|
|
433
824
|
return {
|
|
825
|
+
// NormalizedIsLayerTrait
|
|
434
826
|
type: node.type,
|
|
435
827
|
id: node.id,
|
|
436
828
|
name: node.name,
|
|
437
|
-
boundVariables:
|
|
829
|
+
boundVariables: normalizeBoundVariables(node),
|
|
830
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
831
|
+
...await normalizeShapeProps(node),
|
|
832
|
+
// NormalizedCornerTrait
|
|
438
833
|
...normalizeRadiusProps(node),
|
|
834
|
+
// NormalizedHasFramePropertiesTrait
|
|
439
835
|
...await normalizeAutolayoutProps(node),
|
|
836
|
+
// NormalizedHasChildrenTrait
|
|
440
837
|
children: await normalizeNodes(node.children),
|
|
838
|
+
// NormalizedInstanceNode specific
|
|
839
|
+
componentProperties,
|
|
441
840
|
componentKey: mainComponent.key,
|
|
442
841
|
componentSetKey: mainComponent.parent?.type === "COMPONENT_SET" ? mainComponent.parent.key : undefined,
|
|
443
|
-
componentProperties,
|
|
444
842
|
overrides: node.overrides
|
|
445
843
|
};
|
|
446
844
|
}
|
|
447
|
-
function
|
|
448
|
-
return {
|
|
449
|
-
type: paint.type,
|
|
450
|
-
color: {
|
|
451
|
-
r: paint.color.r,
|
|
452
|
-
g: paint.color.g,
|
|
453
|
-
b: paint.color.b,
|
|
454
|
-
a: paint.opacity ?? 1
|
|
455
|
-
},
|
|
456
|
-
visible: paint.visible,
|
|
457
|
-
blendMode: paint.blendMode ?? "NORMAL",
|
|
458
|
-
boundVariables: paint.boundVariables
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
function normalizePaint(paint) {
|
|
462
|
-
switch(paint.type){
|
|
463
|
-
case "SOLID":
|
|
464
|
-
return normalizeSolidPaint(paint);
|
|
465
|
-
case "IMAGE":
|
|
466
|
-
return {
|
|
467
|
-
type: "IMAGE",
|
|
468
|
-
scaleMode: paint.scaleMode === "CROP" ? "STRETCH" : paint.scaleMode,
|
|
469
|
-
imageTransform: paint.imageTransform,
|
|
470
|
-
scalingFactor: paint.scalingFactor,
|
|
471
|
-
filters: paint.filters,
|
|
472
|
-
rotation: paint.rotation,
|
|
473
|
-
imageRef: paint.imageHash ?? "",
|
|
474
|
-
blendMode: paint.blendMode ?? "NORMAL",
|
|
475
|
-
visible: paint.visible,
|
|
476
|
-
opacity: paint.opacity
|
|
477
|
-
};
|
|
478
|
-
case "GRADIENT_LINEAR":
|
|
479
|
-
case "GRADIENT_RADIAL":
|
|
480
|
-
case "GRADIENT_ANGULAR":
|
|
481
|
-
case "GRADIENT_DIAMOND":
|
|
482
|
-
return {
|
|
483
|
-
type: paint.type,
|
|
484
|
-
gradientStops: [
|
|
485
|
-
...paint.gradientStops
|
|
486
|
-
],
|
|
487
|
-
visible: paint.visible,
|
|
488
|
-
opacity: paint.opacity,
|
|
489
|
-
blendMode: paint.blendMode ?? "NORMAL",
|
|
490
|
-
gradientHandlePositions: convertTransformToGradientHandles(paint.gradientTransform)
|
|
491
|
-
};
|
|
492
|
-
default:
|
|
493
|
-
throw new Error(`Unimplemented paint type: ${paint.type}`);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
function normalizePaints(fills) {
|
|
497
|
-
if (fills === figma.mixed) {
|
|
498
|
-
console.warn("Mixed fills are not supported");
|
|
499
|
-
return [];
|
|
500
|
-
}
|
|
501
|
-
return fills.map(normalizePaint);
|
|
502
|
-
}
|
|
503
|
-
function normalizeRadiusProps(node) {
|
|
845
|
+
async function normalizeVectorNode(node) {
|
|
504
846
|
return {
|
|
847
|
+
// NormalizedIsLayerTrait
|
|
848
|
+
type: node.type,
|
|
849
|
+
id: node.id,
|
|
850
|
+
name: node.name,
|
|
851
|
+
boundVariables: normalizeBoundVariables(node),
|
|
852
|
+
// NormalizedCornerTrait
|
|
505
853
|
cornerRadius: node.cornerRadius === figma.mixed ? undefined : node.cornerRadius,
|
|
506
|
-
rectangleCornerRadii:
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
node.bottomRightRadius,
|
|
510
|
-
node.bottomLeftRadius
|
|
511
|
-
]
|
|
854
|
+
rectangleCornerRadii: undefined,
|
|
855
|
+
// NormalizedHasLayoutTrait, NormalizedHasGeometryTrait, NormalizedHasEffectsTrait
|
|
856
|
+
...await normalizeShapeProps(node)
|
|
512
857
|
};
|
|
513
858
|
}
|
|
514
|
-
async function
|
|
859
|
+
async function normalizeBooleanOperationNode(node) {
|
|
515
860
|
const fillStyleKey = typeof node.fillStyleId === "string" ? (await figma.getStyleByIdAsync(node.fillStyleId))?.key : undefined;
|
|
516
861
|
return {
|
|
517
|
-
|
|
518
|
-
|
|
862
|
+
// NormalizedIsLayerTrait
|
|
863
|
+
type: node.type,
|
|
864
|
+
id: node.id,
|
|
865
|
+
name: node.name,
|
|
866
|
+
boundVariables: normalizeBoundVariables(node),
|
|
867
|
+
// NormalizedHasLayoutTrait
|
|
868
|
+
layoutGrow: node.layoutGrow,
|
|
869
|
+
layoutAlign: node.layoutAlign,
|
|
519
870
|
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
520
871
|
layoutSizingVertical: node.layoutSizingVertical,
|
|
521
872
|
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
522
873
|
relativeTransform: node.relativeTransform,
|
|
523
|
-
|
|
524
|
-
...fillStyleKey ? {
|
|
525
|
-
fillStyleKey
|
|
526
|
-
} : {},
|
|
527
|
-
strokes: normalizePaints(node.strokes),
|
|
528
|
-
strokeWeight: node.strokeWeight === figma.mixed ? undefined : node.strokeWeight,
|
|
874
|
+
layoutPositioning: node.layoutPositioning,
|
|
529
875
|
minHeight: node.minHeight ?? undefined,
|
|
530
876
|
minWidth: node.minWidth ?? undefined,
|
|
531
877
|
maxHeight: node.maxHeight ?? undefined,
|
|
532
|
-
maxWidth: node.maxWidth ?? undefined
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
paddingTop: node.inferredAutoLayout?.paddingTop ?? node.paddingTop,
|
|
543
|
-
paddingBottom: node.inferredAutoLayout?.paddingBottom ?? node.paddingBottom,
|
|
544
|
-
primaryAxisAlignItems: node.inferredAutoLayout?.primaryAxisAlignItems ?? node.primaryAxisAlignItems,
|
|
545
|
-
counterAxisAlignItems: node.inferredAutoLayout?.counterAxisAlignItems ?? node.counterAxisAlignItems,
|
|
546
|
-
primaryAxisSizingMode: node.inferredAutoLayout?.primaryAxisSizingMode ?? node.primaryAxisSizingMode,
|
|
547
|
-
counterAxisSizingMode: node.inferredAutoLayout?.counterAxisSizingMode ?? node.counterAxisSizingMode,
|
|
548
|
-
itemSpacing: node.inferredAutoLayout?.itemSpacing ?? node.itemSpacing,
|
|
549
|
-
counterAxisSpacing: node.inferredAutoLayout?.counterAxisSpacing ?? node.counterAxisSpacing ?? undefined
|
|
878
|
+
maxWidth: node.maxWidth ?? undefined,
|
|
879
|
+
// NormalizedHasGeometryTrait
|
|
880
|
+
fills: await normalizePaints(node.fills),
|
|
881
|
+
fillStyleKey,
|
|
882
|
+
strokes: await normalizePaints(node.strokes),
|
|
883
|
+
strokeWeight: node.strokeWeight === figma.mixed ? undefined : node.strokeWeight,
|
|
884
|
+
// NormalizedHasEffectsTrait
|
|
885
|
+
...await normalizeEffectProps(node),
|
|
886
|
+
// NormalizedHasChildrenTrait
|
|
887
|
+
children: await normalizeNodes(node.children)
|
|
550
888
|
};
|
|
551
889
|
}
|
|
552
|
-
async function
|
|
553
|
-
if (!boundVariables) return undefined;
|
|
554
|
-
const { width, height, componentProperties: _componentProperties, ...rest } = boundVariables;
|
|
555
|
-
// replace VariableAlias' id with the actual variable key
|
|
556
|
-
const resolveVariableId = async (variable)=>({
|
|
557
|
-
...variable,
|
|
558
|
-
id: (await figma.variables.getVariableByIdAsync(variable.id))?.key ?? variable.id
|
|
559
|
-
});
|
|
560
|
-
const needsResolution = [
|
|
561
|
-
"fills",
|
|
562
|
-
"itemSpacing",
|
|
563
|
-
"counterAxisSpacing",
|
|
564
|
-
"bottomLeftRadius",
|
|
565
|
-
"bottomRightRadius",
|
|
566
|
-
"topLeftRadius",
|
|
567
|
-
"topRightRadius",
|
|
568
|
-
"paddingBottom",
|
|
569
|
-
"paddingLeft",
|
|
570
|
-
"paddingRight",
|
|
571
|
-
"paddingTop",
|
|
572
|
-
"maxHeight",
|
|
573
|
-
"minHeight",
|
|
574
|
-
"maxWidth",
|
|
575
|
-
"minWidth"
|
|
576
|
-
];
|
|
577
|
-
// Process all properties in parallel
|
|
578
|
-
const resolvedEntries = await Promise.all(Object.entries(rest).map(async ([key, value])=>{
|
|
579
|
-
if (!value || !needsResolution.includes(key)) return [
|
|
580
|
-
key,
|
|
581
|
-
value
|
|
582
|
-
];
|
|
583
|
-
if (Array.isArray(value)) {
|
|
584
|
-
return [
|
|
585
|
-
key,
|
|
586
|
-
await Promise.all(value.map(resolveVariableId))
|
|
587
|
-
];
|
|
588
|
-
}
|
|
589
|
-
return [
|
|
590
|
-
key,
|
|
591
|
-
await resolveVariableId(value)
|
|
592
|
-
];
|
|
593
|
-
}));
|
|
890
|
+
async function normalizeGroupNodeAsFrameNode(node) {
|
|
594
891
|
return {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
892
|
+
// NormalizedIsLayerTrait
|
|
893
|
+
type: "FRAME",
|
|
894
|
+
id: node.id,
|
|
895
|
+
name: node.name,
|
|
896
|
+
boundVariables: normalizeBoundVariables(node),
|
|
897
|
+
// NormalizedHasLayoutTrait
|
|
898
|
+
layoutGrow: node.inferredAutoLayout?.layoutGrow ?? node.layoutGrow,
|
|
899
|
+
layoutAlign: node.inferredAutoLayout?.layoutAlign ?? node.layoutAlign,
|
|
900
|
+
layoutSizingHorizontal: node.layoutSizingHorizontal,
|
|
901
|
+
layoutSizingVertical: node.layoutSizingVertical,
|
|
902
|
+
absoluteBoundingBox: node.absoluteBoundingBox,
|
|
903
|
+
relativeTransform: node.relativeTransform,
|
|
904
|
+
layoutPositioning: node.layoutPositioning,
|
|
905
|
+
minHeight: node.minHeight ?? undefined,
|
|
906
|
+
minWidth: node.minWidth ?? undefined,
|
|
907
|
+
maxHeight: node.maxHeight ?? undefined,
|
|
908
|
+
maxWidth: node.maxWidth ?? undefined,
|
|
909
|
+
// NormalizedHasGeometryTrait
|
|
910
|
+
fills: [],
|
|
911
|
+
fillStyleKey: undefined,
|
|
912
|
+
strokes: [],
|
|
913
|
+
strokeWeight: undefined,
|
|
914
|
+
// NormalizedHasEffectsTrait
|
|
915
|
+
effects: [],
|
|
916
|
+
effectStyleKey: undefined,
|
|
917
|
+
// NormalizedCornerTrait
|
|
918
|
+
cornerRadius: undefined,
|
|
919
|
+
rectangleCornerRadii: undefined,
|
|
920
|
+
// NormalizedHasFramePropertiesTrait
|
|
921
|
+
layoutMode: node.inferredAutoLayout?.layoutMode,
|
|
922
|
+
layoutWrap: node.inferredAutoLayout?.layoutWrap,
|
|
923
|
+
paddingLeft: node.inferredAutoLayout?.paddingLeft,
|
|
924
|
+
paddingRight: node.inferredAutoLayout?.paddingRight,
|
|
925
|
+
paddingTop: node.inferredAutoLayout?.paddingTop,
|
|
926
|
+
paddingBottom: node.inferredAutoLayout?.paddingBottom,
|
|
927
|
+
primaryAxisAlignItems: node.inferredAutoLayout?.primaryAxisAlignItems,
|
|
928
|
+
counterAxisAlignItems: node.inferredAutoLayout?.counterAxisAlignItems,
|
|
929
|
+
primaryAxisSizingMode: node.inferredAutoLayout?.primaryAxisSizingMode,
|
|
930
|
+
counterAxisSizingMode: node.inferredAutoLayout?.counterAxisSizingMode,
|
|
931
|
+
itemSpacing: node.inferredAutoLayout?.itemSpacing,
|
|
932
|
+
counterAxisSpacing: node.inferredAutoLayout?.counterAxisSpacing ?? undefined,
|
|
933
|
+
// NormalizedHasChildrenTrait
|
|
934
|
+
children: await normalizeNodes(node.children)
|
|
602
935
|
};
|
|
603
936
|
}
|
|
604
937
|
return normalizeNode;
|
|
@@ -2251,6 +2584,16 @@ const FIGMA_ICONS = {
|
|
|
2251
2584
|
"type": "monochrome",
|
|
2252
2585
|
"weight": "Line"
|
|
2253
2586
|
},
|
|
2587
|
+
"27885dd88c45e55e1ce6790b6517b663fbc89286": {
|
|
2588
|
+
"name": "icon_keyhole_shield",
|
|
2589
|
+
"type": "monochrome",
|
|
2590
|
+
"weight": "Fill"
|
|
2591
|
+
},
|
|
2592
|
+
"2111483a75d693815d578415279d077e66412da1": {
|
|
2593
|
+
"name": "icon_keyhole_shield",
|
|
2594
|
+
"type": "monochrome",
|
|
2595
|
+
"weight": "Line"
|
|
2596
|
+
},
|
|
2254
2597
|
"fe92b27029511a3fa4745e4d49cba81ee303cf48": {
|
|
2255
2598
|
"name": "icon_laptop",
|
|
2256
2599
|
"type": "monochrome",
|
|
@@ -3991,6 +4334,10 @@ const FIGMA_ICONS = {
|
|
|
3991
4334
|
"name": "icon_tshirt_bubble2",
|
|
3992
4335
|
"type": "multicolor"
|
|
3993
4336
|
},
|
|
4337
|
+
"ab66ee11be5539d340a87f1e9ca021fef1db3ef8": {
|
|
4338
|
+
"name": "icon_vest_horizstripe",
|
|
4339
|
+
"type": "multicolor"
|
|
4340
|
+
},
|
|
3994
4341
|
"7ddb6f0f63708485a75cb21a25fae01671a34562": {
|
|
3995
4342
|
"name": "icon_warninglight",
|
|
3996
4343
|
"type": "multicolor"
|
|
@@ -4067,7 +4414,7 @@ const FIGMA_STYLES = [
|
|
|
4067
4414
|
{
|
|
4068
4415
|
"styleType": "TEXT",
|
|
4069
4416
|
"key": "af24f9e7cc90af3bf2a18029dd59ae0646966486",
|
|
4070
|
-
"name": "legacy-13-150",
|
|
4417
|
+
"name": "scale/legacy-13-150",
|
|
4071
4418
|
"description": "13",
|
|
4072
4419
|
"remote": false
|
|
4073
4420
|
},
|
|
@@ -4099,6 +4446,27 @@ const FIGMA_STYLES = [
|
|
|
4099
4446
|
"description": "11",
|
|
4100
4447
|
"remote": false
|
|
4101
4448
|
},
|
|
4449
|
+
{
|
|
4450
|
+
"styleType": "TEXT",
|
|
4451
|
+
"key": "ab6db5fae979eef82d7eece9237bd04c02707f57",
|
|
4452
|
+
"name": "scale/t1-static-bold",
|
|
4453
|
+
"description": "11",
|
|
4454
|
+
"remote": false
|
|
4455
|
+
},
|
|
4456
|
+
{
|
|
4457
|
+
"styleType": "TEXT",
|
|
4458
|
+
"key": "16c25fb788efbfe8f6d042820e342077a461f9bf",
|
|
4459
|
+
"name": "scale/t1-static-medium",
|
|
4460
|
+
"description": "11",
|
|
4461
|
+
"remote": false
|
|
4462
|
+
},
|
|
4463
|
+
{
|
|
4464
|
+
"styleType": "TEXT",
|
|
4465
|
+
"key": "5579ed6f529f5e97049e0842212b4958437eea34",
|
|
4466
|
+
"name": "scale/t1-static-regular",
|
|
4467
|
+
"description": "11",
|
|
4468
|
+
"remote": false
|
|
4469
|
+
},
|
|
4102
4470
|
{
|
|
4103
4471
|
"styleType": "TEXT",
|
|
4104
4472
|
"key": "6ea6b06312771259d59de265a5ef12cd1dae9102",
|
|
@@ -4106,6 +4474,13 @@ const FIGMA_STYLES = [
|
|
|
4106
4474
|
"description": "26",
|
|
4107
4475
|
"remote": false
|
|
4108
4476
|
},
|
|
4477
|
+
{
|
|
4478
|
+
"styleType": "TEXT",
|
|
4479
|
+
"key": "08861e25c3f74a29c2ae4ce007fe50b63e302392",
|
|
4480
|
+
"name": "scale/t10-static-bold",
|
|
4481
|
+
"description": "26",
|
|
4482
|
+
"remote": false
|
|
4483
|
+
},
|
|
4109
4484
|
{
|
|
4110
4485
|
"styleType": "TEXT",
|
|
4111
4486
|
"key": "8378bd59b14f5682dcaf20110efde4b7a1fb18e3",
|
|
@@ -4127,6 +4502,27 @@ const FIGMA_STYLES = [
|
|
|
4127
4502
|
"description": "12",
|
|
4128
4503
|
"remote": false
|
|
4129
4504
|
},
|
|
4505
|
+
{
|
|
4506
|
+
"styleType": "TEXT",
|
|
4507
|
+
"key": "4c6e5c31b949694aa08bf8d4d5cc445e22cf301f",
|
|
4508
|
+
"name": "scale/t2-static-bold",
|
|
4509
|
+
"description": "12",
|
|
4510
|
+
"remote": false
|
|
4511
|
+
},
|
|
4512
|
+
{
|
|
4513
|
+
"styleType": "TEXT",
|
|
4514
|
+
"key": "7d4bb16ddefb735fd197123b013864e7c412a934",
|
|
4515
|
+
"name": "scale/t2-static-medium",
|
|
4516
|
+
"description": "12",
|
|
4517
|
+
"remote": false
|
|
4518
|
+
},
|
|
4519
|
+
{
|
|
4520
|
+
"styleType": "TEXT",
|
|
4521
|
+
"key": "e05fbcacd044da0c9e6b73c7382bc4562a4a5d30",
|
|
4522
|
+
"name": "scale/t2-static-regular",
|
|
4523
|
+
"description": "12",
|
|
4524
|
+
"remote": false
|
|
4525
|
+
},
|
|
4130
4526
|
{
|
|
4131
4527
|
"styleType": "TEXT",
|
|
4132
4528
|
"key": "f749d659a689cbbecbdbb1b559056731234332a3",
|
|
@@ -4148,6 +4544,27 @@ const FIGMA_STYLES = [
|
|
|
4148
4544
|
"description": "13",
|
|
4149
4545
|
"remote": false
|
|
4150
4546
|
},
|
|
4547
|
+
{
|
|
4548
|
+
"styleType": "TEXT",
|
|
4549
|
+
"key": "3174e2a628cf75bc8f906af35b9b5d04595267c8",
|
|
4550
|
+
"name": "scale/t3-static-bold",
|
|
4551
|
+
"description": "13",
|
|
4552
|
+
"remote": false
|
|
4553
|
+
},
|
|
4554
|
+
{
|
|
4555
|
+
"styleType": "TEXT",
|
|
4556
|
+
"key": "c19d7f5ec3290802216aa3b0993931835d8fa3b5",
|
|
4557
|
+
"name": "scale/t3-static-medium",
|
|
4558
|
+
"description": "13",
|
|
4559
|
+
"remote": false
|
|
4560
|
+
},
|
|
4561
|
+
{
|
|
4562
|
+
"styleType": "TEXT",
|
|
4563
|
+
"key": "0cda3e483e52409e3ca59a019f29c16be078355f",
|
|
4564
|
+
"name": "scale/t3-static-regular",
|
|
4565
|
+
"description": "13",
|
|
4566
|
+
"remote": false
|
|
4567
|
+
},
|
|
4151
4568
|
{
|
|
4152
4569
|
"styleType": "TEXT",
|
|
4153
4570
|
"key": "a85ea49c1625319427c047bc206c26e708012030",
|
|
@@ -4169,6 +4586,27 @@ const FIGMA_STYLES = [
|
|
|
4169
4586
|
"description": "14",
|
|
4170
4587
|
"remote": false
|
|
4171
4588
|
},
|
|
4589
|
+
{
|
|
4590
|
+
"styleType": "TEXT",
|
|
4591
|
+
"key": "35fd98a75610254f7c8c15c6e7b71d67fccd9eed",
|
|
4592
|
+
"name": "scale/t4-static-bold",
|
|
4593
|
+
"description": "14",
|
|
4594
|
+
"remote": false
|
|
4595
|
+
},
|
|
4596
|
+
{
|
|
4597
|
+
"styleType": "TEXT",
|
|
4598
|
+
"key": "c785ba7fed186bd4c98295bdc2292933faed98ef",
|
|
4599
|
+
"name": "scale/t4-static-medium",
|
|
4600
|
+
"description": "14",
|
|
4601
|
+
"remote": false
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
"styleType": "TEXT",
|
|
4605
|
+
"key": "51a90741bcc1a7dc81293eae0f085a8d5fb01855",
|
|
4606
|
+
"name": "scale/t4-static-regular",
|
|
4607
|
+
"description": "14",
|
|
4608
|
+
"remote": false
|
|
4609
|
+
},
|
|
4172
4610
|
{
|
|
4173
4611
|
"styleType": "TEXT",
|
|
4174
4612
|
"key": "8eff229c53f06eeb418f39ad1cb3dbe12480f12b",
|
|
@@ -4192,22 +4630,64 @@ const FIGMA_STYLES = [
|
|
|
4192
4630
|
},
|
|
4193
4631
|
{
|
|
4194
4632
|
"styleType": "TEXT",
|
|
4195
|
-
"key": "
|
|
4196
|
-
"name": "scale/
|
|
4633
|
+
"key": "37a672b087c5d72461b75c679924245ad89bcb06",
|
|
4634
|
+
"name": "scale/t5-static-bold",
|
|
4635
|
+
"description": "16",
|
|
4636
|
+
"remote": false
|
|
4637
|
+
},
|
|
4638
|
+
{
|
|
4639
|
+
"styleType": "TEXT",
|
|
4640
|
+
"key": "8b295f9759faed27b6a03cc50a8b257bf3af5cd0",
|
|
4641
|
+
"name": "scale/t5-static-medium",
|
|
4642
|
+
"description": "16",
|
|
4643
|
+
"remote": false
|
|
4644
|
+
},
|
|
4645
|
+
{
|
|
4646
|
+
"styleType": "TEXT",
|
|
4647
|
+
"key": "2011f31d265d6bb4535da4f16eb4f5d68f48d56e",
|
|
4648
|
+
"name": "scale/t5-static-regular",
|
|
4649
|
+
"description": "16",
|
|
4650
|
+
"remote": false
|
|
4651
|
+
},
|
|
4652
|
+
{
|
|
4653
|
+
"styleType": "TEXT",
|
|
4654
|
+
"key": "adf921a56e89b5737a6b626034cfea184e828370",
|
|
4655
|
+
"name": "scale/t6-bold",
|
|
4656
|
+
"description": "18",
|
|
4657
|
+
"remote": false
|
|
4658
|
+
},
|
|
4659
|
+
{
|
|
4660
|
+
"styleType": "TEXT",
|
|
4661
|
+
"key": "02ee25a9050a9c78dbaa03ea006aa4d1db593e99",
|
|
4662
|
+
"name": "scale/t6-medium",
|
|
4663
|
+
"description": "18",
|
|
4664
|
+
"remote": false
|
|
4665
|
+
},
|
|
4666
|
+
{
|
|
4667
|
+
"styleType": "TEXT",
|
|
4668
|
+
"key": "6608eaab965859080a5effa6e23eb857d888057f",
|
|
4669
|
+
"name": "scale/t6-regular",
|
|
4670
|
+
"description": "18",
|
|
4671
|
+
"remote": false
|
|
4672
|
+
},
|
|
4673
|
+
{
|
|
4674
|
+
"styleType": "TEXT",
|
|
4675
|
+
"key": "122ff9fd500bc63517b01a103a399b26130e7f0b",
|
|
4676
|
+
"name": "scale/t6-static-bold",
|
|
4197
4677
|
"description": "18",
|
|
4198
4678
|
"remote": false
|
|
4199
4679
|
},
|
|
4200
4680
|
{
|
|
4201
4681
|
"styleType": "TEXT",
|
|
4202
|
-
"key": "
|
|
4203
|
-
"name": "scale/t6-medium",
|
|
4682
|
+
"key": "0de548c3afd5c31e8b1c42a0170d44beba400a55",
|
|
4683
|
+
"name": "scale/t6-static-medium",
|
|
4204
4684
|
"description": "18",
|
|
4205
4685
|
"remote": false
|
|
4206
4686
|
},
|
|
4207
4687
|
{
|
|
4208
4688
|
"styleType": "TEXT",
|
|
4209
|
-
"key": "
|
|
4210
|
-
"name": "scale/t6-regular",
|
|
4689
|
+
"key": "c6d683f532e80c0c04e05057674e92265541a231",
|
|
4690
|
+
"name": "scale/t6-static-regular",
|
|
4211
4691
|
"description": "18",
|
|
4212
4692
|
"remote": false
|
|
4213
4693
|
},
|
|
@@ -4232,6 +4712,27 @@ const FIGMA_STYLES = [
|
|
|
4232
4712
|
"description": "20",
|
|
4233
4713
|
"remote": false
|
|
4234
4714
|
},
|
|
4715
|
+
{
|
|
4716
|
+
"styleType": "TEXT",
|
|
4717
|
+
"key": "2454dff78b9ac153728a2cff00ca1d28f234e3a0",
|
|
4718
|
+
"name": "scale/t7-static-bold",
|
|
4719
|
+
"description": "20",
|
|
4720
|
+
"remote": false
|
|
4721
|
+
},
|
|
4722
|
+
{
|
|
4723
|
+
"styleType": "TEXT",
|
|
4724
|
+
"key": "f0da131559e6b466810b06343f94c551a0593bb4",
|
|
4725
|
+
"name": "scale/t7-static-medium",
|
|
4726
|
+
"description": "20",
|
|
4727
|
+
"remote": false
|
|
4728
|
+
},
|
|
4729
|
+
{
|
|
4730
|
+
"styleType": "TEXT",
|
|
4731
|
+
"key": "07ef3b8fcb31319d1d83100957eb06fc0e37c1e9",
|
|
4732
|
+
"name": "scale/t7-static-regular",
|
|
4733
|
+
"description": "20",
|
|
4734
|
+
"remote": false
|
|
4735
|
+
},
|
|
4235
4736
|
{
|
|
4236
4737
|
"styleType": "TEXT",
|
|
4237
4738
|
"key": "b7f864e3f64524a863d38729e2cea18f44c7ebaa",
|
|
@@ -4239,6 +4740,13 @@ const FIGMA_STYLES = [
|
|
|
4239
4740
|
"description": "22",
|
|
4240
4741
|
"remote": false
|
|
4241
4742
|
},
|
|
4743
|
+
{
|
|
4744
|
+
"styleType": "TEXT",
|
|
4745
|
+
"key": "37821f18bc4416d7a81fa429d89240317a8f17e6",
|
|
4746
|
+
"name": "scale/t8-static-bold",
|
|
4747
|
+
"description": "22",
|
|
4748
|
+
"remote": false
|
|
4749
|
+
},
|
|
4242
4750
|
{
|
|
4243
4751
|
"styleType": "TEXT",
|
|
4244
4752
|
"key": "b146e1317c67db787834f1890493225bdbba4e48",
|
|
@@ -4246,6 +4754,13 @@ const FIGMA_STYLES = [
|
|
|
4246
4754
|
"description": "24",
|
|
4247
4755
|
"remote": false
|
|
4248
4756
|
},
|
|
4757
|
+
{
|
|
4758
|
+
"styleType": "TEXT",
|
|
4759
|
+
"key": "c06e147e98440109199e2e3fa2a63390d19afb0c",
|
|
4760
|
+
"name": "scale/t9-static-bold",
|
|
4761
|
+
"description": "24",
|
|
4762
|
+
"remote": false
|
|
4763
|
+
},
|
|
4249
4764
|
{
|
|
4250
4765
|
"styleType": "TEXT",
|
|
4251
4766
|
"key": "85422ef9f0230f821f1a9e6d2f8f86b3ba87f20d",
|
|
@@ -4259,6 +4774,27 @@ const FIGMA_STYLES = [
|
|
|
4259
4774
|
"name": "semantic/screen-title",
|
|
4260
4775
|
"description": "26",
|
|
4261
4776
|
"remote": false
|
|
4777
|
+
},
|
|
4778
|
+
{
|
|
4779
|
+
"styleType": "EFFECT",
|
|
4780
|
+
"key": "4717150d124a52434b2777609b046aa73a94c7ba",
|
|
4781
|
+
"name": "shadow/s1",
|
|
4782
|
+
"description": "",
|
|
4783
|
+
"remote": false
|
|
4784
|
+
},
|
|
4785
|
+
{
|
|
4786
|
+
"styleType": "EFFECT",
|
|
4787
|
+
"key": "906bc739e1b77bc1719762826f6d1154893c8266",
|
|
4788
|
+
"name": "shadow/s2",
|
|
4789
|
+
"description": "",
|
|
4790
|
+
"remote": false
|
|
4791
|
+
},
|
|
4792
|
+
{
|
|
4793
|
+
"styleType": "EFFECT",
|
|
4794
|
+
"key": "56f376d9146d9e158ba127ee8347c3cbf8329f19",
|
|
4795
|
+
"name": "shadow/s3",
|
|
4796
|
+
"description": "화면의 다른 요소들보다 가장 높은 계층에 위치할 때 사용됩니다.",
|
|
4797
|
+
"remote": false
|
|
4262
4798
|
}
|
|
4263
4799
|
];
|
|
4264
4800
|
|
|
@@ -4317,8 +4853,8 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
4317
4853
|
"VariableID:654:20851",
|
|
4318
4854
|
"VariableID:1:171",
|
|
4319
4855
|
"VariableID:41186:6437",
|
|
4320
|
-
"VariableID:1:172",
|
|
4321
4856
|
"VariableID:1:158",
|
|
4857
|
+
"VariableID:1:172",
|
|
4322
4858
|
"VariableID:1:161",
|
|
4323
4859
|
"VariableID:1:159",
|
|
4324
4860
|
"VariableID:576:22878",
|
|
@@ -4373,6 +4909,16 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
4373
4909
|
"VariableID:12548:1436",
|
|
4374
4910
|
"VariableID:12548:1438",
|
|
4375
4911
|
"VariableID:12548:1439",
|
|
4912
|
+
"VariableID:54897:41770",
|
|
4913
|
+
"VariableID:54897:41771",
|
|
4914
|
+
"VariableID:54897:41772",
|
|
4915
|
+
"VariableID:54897:41773",
|
|
4916
|
+
"VariableID:54897:41775",
|
|
4917
|
+
"VariableID:54897:41776",
|
|
4918
|
+
"VariableID:54897:41777",
|
|
4919
|
+
"VariableID:54897:41778",
|
|
4920
|
+
"VariableID:54897:41779",
|
|
4921
|
+
"VariableID:54897:41780",
|
|
4376
4922
|
"VariableID:14609:16910",
|
|
4377
4923
|
"VariableID:29333:3993",
|
|
4378
4924
|
"VariableID:29333:10509",
|
|
@@ -4719,54 +5265,328 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
4719
5265
|
"VariableID:40279:20413"
|
|
4720
5266
|
]
|
|
4721
5267
|
},
|
|
4722
|
-
"VariableCollectionId:6075:34487": {
|
|
4723
|
-
"defaultModeId": "6075:1",
|
|
4724
|
-
"id": "VariableCollectionId:6075:34487",
|
|
4725
|
-
"name": "Preview",
|
|
5268
|
+
"VariableCollectionId:6075:34487": {
|
|
5269
|
+
"defaultModeId": "6075:1",
|
|
5270
|
+
"id": "VariableCollectionId:6075:34487",
|
|
5271
|
+
"name": "Preview",
|
|
5272
|
+
"remote": false,
|
|
5273
|
+
"modes": [
|
|
5274
|
+
{
|
|
5275
|
+
"modeId": "6075:1",
|
|
5276
|
+
"name": "390x844"
|
|
5277
|
+
},
|
|
5278
|
+
{
|
|
5279
|
+
"modeId": "6075:2",
|
|
5280
|
+
"name": "320x568"
|
|
5281
|
+
},
|
|
5282
|
+
{
|
|
5283
|
+
"modeId": "16766:0",
|
|
5284
|
+
"name": "375x812"
|
|
5285
|
+
}
|
|
5286
|
+
],
|
|
5287
|
+
"key": "7b0f506ae5e0955f152efe15b7982265075ad655",
|
|
5288
|
+
"hiddenFromPublishing": false,
|
|
5289
|
+
"isExtension": false,
|
|
5290
|
+
"variableIds": [
|
|
5291
|
+
"VariableID:6075:34488",
|
|
5292
|
+
"VariableID:6075:34489",
|
|
5293
|
+
"VariableID:19290:76727"
|
|
5294
|
+
]
|
|
5295
|
+
}
|
|
5296
|
+
};
|
|
5297
|
+
|
|
5298
|
+
const FIGMA_VARIABLES = {
|
|
5299
|
+
"VariableID:54461:116345": {
|
|
5300
|
+
"name": "_legacy/bg/layer-fill",
|
|
5301
|
+
"id": "VariableID:54461:116345",
|
|
5302
|
+
"remote": false,
|
|
5303
|
+
"key": "f015408caaf8301430455d23312a5b0a3cb9fb43",
|
|
5304
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5305
|
+
"resolvedType": "COLOR",
|
|
5306
|
+
"description": "",
|
|
5307
|
+
"hiddenFromPublishing": false,
|
|
5308
|
+
"valuesByMode": {
|
|
5309
|
+
"1928:7": {
|
|
5310
|
+
"type": "VARIABLE_ALIAS",
|
|
5311
|
+
"id": "VariableID:1883:92912"
|
|
5312
|
+
},
|
|
5313
|
+
"1928:8": {
|
|
5314
|
+
"type": "VARIABLE_ALIAS",
|
|
5315
|
+
"id": "VariableID:1883:92913"
|
|
5316
|
+
}
|
|
5317
|
+
},
|
|
5318
|
+
"scopes": [
|
|
5319
|
+
"ALL_SCOPES"
|
|
5320
|
+
],
|
|
5321
|
+
"codeSyntax": {}
|
|
5322
|
+
},
|
|
5323
|
+
"VariableID:1:170": {
|
|
5324
|
+
"name": "_legacy/stroke/field",
|
|
5325
|
+
"id": "VariableID:1:170",
|
|
5326
|
+
"remote": false,
|
|
5327
|
+
"key": "bffc4d796285b14756405c8faf1eb619eabf8b19",
|
|
5328
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5329
|
+
"resolvedType": "COLOR",
|
|
5330
|
+
"description": "",
|
|
5331
|
+
"hiddenFromPublishing": false,
|
|
5332
|
+
"valuesByMode": {
|
|
5333
|
+
"1928:7": {
|
|
5334
|
+
"type": "VARIABLE_ALIAS",
|
|
5335
|
+
"id": "VariableID:1883:92915"
|
|
5336
|
+
},
|
|
5337
|
+
"1928:8": {
|
|
5338
|
+
"type": "VARIABLE_ALIAS",
|
|
5339
|
+
"id": "VariableID:1883:92915"
|
|
5340
|
+
}
|
|
5341
|
+
},
|
|
5342
|
+
"scopes": [
|
|
5343
|
+
"FRAME_FILL",
|
|
5344
|
+
"SHAPE_FILL",
|
|
5345
|
+
"STROKE_COLOR"
|
|
5346
|
+
],
|
|
5347
|
+
"codeSyntax": {}
|
|
5348
|
+
},
|
|
5349
|
+
"VariableID:17544:4057": {
|
|
5350
|
+
"name": "_legacy/stroke/on-image",
|
|
5351
|
+
"id": "VariableID:17544:4057",
|
|
5352
|
+
"remote": false,
|
|
5353
|
+
"key": "7dda7b5c673d7026f25eccc7533f6c81468b4518",
|
|
5354
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5355
|
+
"resolvedType": "COLOR",
|
|
5356
|
+
"description": "",
|
|
5357
|
+
"hiddenFromPublishing": false,
|
|
5358
|
+
"valuesByMode": {
|
|
5359
|
+
"1928:7": {
|
|
5360
|
+
"type": "VARIABLE_ALIAS",
|
|
5361
|
+
"id": "VariableID:30894:36296"
|
|
5362
|
+
},
|
|
5363
|
+
"1928:8": {
|
|
5364
|
+
"type": "VARIABLE_ALIAS",
|
|
5365
|
+
"id": "VariableID:30894:36305"
|
|
5366
|
+
}
|
|
5367
|
+
},
|
|
5368
|
+
"scopes": [
|
|
5369
|
+
"ALL_SCOPES"
|
|
5370
|
+
],
|
|
5371
|
+
"codeSyntax": {}
|
|
5372
|
+
},
|
|
5373
|
+
"VariableID:54897:41776": {
|
|
5374
|
+
"name": "banner/blue",
|
|
5375
|
+
"id": "VariableID:54897:41776",
|
|
5376
|
+
"remote": false,
|
|
5377
|
+
"key": "f0d9f5531252da917ad0d0b5618c384218463fa1",
|
|
5378
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5379
|
+
"resolvedType": "COLOR",
|
|
5380
|
+
"description": "",
|
|
5381
|
+
"hiddenFromPublishing": false,
|
|
5382
|
+
"valuesByMode": {
|
|
5383
|
+
"1928:7": {
|
|
5384
|
+
"r": 0.8823529481887817,
|
|
5385
|
+
"g": 0.9686274528503418,
|
|
5386
|
+
"b": 1,
|
|
5387
|
+
"a": 1
|
|
5388
|
+
},
|
|
5389
|
+
"1928:8": {
|
|
5390
|
+
"r": 0.05098039284348488,
|
|
5391
|
+
"g": 0.16470588743686676,
|
|
5392
|
+
"b": 0.22745098173618317,
|
|
5393
|
+
"a": 1
|
|
5394
|
+
}
|
|
5395
|
+
},
|
|
5396
|
+
"scopes": [
|
|
5397
|
+
"ALL_SCOPES"
|
|
5398
|
+
],
|
|
5399
|
+
"codeSyntax": {}
|
|
5400
|
+
},
|
|
5401
|
+
"VariableID:54897:41780": {
|
|
5402
|
+
"name": "banner/cool-gray",
|
|
5403
|
+
"id": "VariableID:54897:41780",
|
|
5404
|
+
"remote": false,
|
|
5405
|
+
"key": "406783eff4302eda53767dc58be1467df8e36ba9",
|
|
5406
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5407
|
+
"resolvedType": "COLOR",
|
|
5408
|
+
"description": "",
|
|
5409
|
+
"hiddenFromPublishing": false,
|
|
5410
|
+
"valuesByMode": {
|
|
5411
|
+
"1928:7": {
|
|
5412
|
+
"r": 0.9215686321258545,
|
|
5413
|
+
"g": 0.9450980424880981,
|
|
5414
|
+
"b": 0.9607843160629272,
|
|
5415
|
+
"a": 1
|
|
5416
|
+
},
|
|
5417
|
+
"1928:8": {
|
|
5418
|
+
"r": 0.1411764770746231,
|
|
5419
|
+
"g": 0.1725490242242813,
|
|
5420
|
+
"b": 0.20000000298023224,
|
|
5421
|
+
"a": 1
|
|
5422
|
+
}
|
|
5423
|
+
},
|
|
5424
|
+
"scopes": [
|
|
5425
|
+
"ALL_SCOPES"
|
|
5426
|
+
],
|
|
5427
|
+
"codeSyntax": {}
|
|
5428
|
+
},
|
|
5429
|
+
"VariableID:54897:41773": {
|
|
5430
|
+
"name": "banner/green",
|
|
5431
|
+
"id": "VariableID:54897:41773",
|
|
5432
|
+
"remote": false,
|
|
5433
|
+
"key": "550727f1d9dd9badfe54ff576b58b0333366a9e3",
|
|
5434
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5435
|
+
"resolvedType": "COLOR",
|
|
5436
|
+
"description": "",
|
|
5437
|
+
"hiddenFromPublishing": false,
|
|
5438
|
+
"valuesByMode": {
|
|
5439
|
+
"1928:7": {
|
|
5440
|
+
"r": 0.9411764740943909,
|
|
5441
|
+
"g": 0.9843137264251709,
|
|
5442
|
+
"b": 0.8980392217636108,
|
|
5443
|
+
"a": 1
|
|
5444
|
+
},
|
|
5445
|
+
"1928:8": {
|
|
5446
|
+
"r": 0.11764705926179886,
|
|
5447
|
+
"g": 0.21176470816135406,
|
|
5448
|
+
"b": 0.10980392247438431,
|
|
5449
|
+
"a": 1
|
|
5450
|
+
}
|
|
5451
|
+
},
|
|
5452
|
+
"scopes": [
|
|
5453
|
+
"ALL_SCOPES"
|
|
5454
|
+
],
|
|
5455
|
+
"codeSyntax": {}
|
|
5456
|
+
},
|
|
5457
|
+
"VariableID:54897:41771": {
|
|
5458
|
+
"name": "banner/orange",
|
|
5459
|
+
"id": "VariableID:54897:41771",
|
|
5460
|
+
"remote": false,
|
|
5461
|
+
"key": "ef1b5c743d00c45c11fbc851e22c06159b5df1e0",
|
|
5462
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5463
|
+
"resolvedType": "COLOR",
|
|
5464
|
+
"description": "",
|
|
5465
|
+
"hiddenFromPublishing": false,
|
|
5466
|
+
"valuesByMode": {
|
|
5467
|
+
"1928:7": {
|
|
5468
|
+
"r": 1,
|
|
5469
|
+
"g": 0.9490196108818054,
|
|
5470
|
+
"b": 0.8823529481887817,
|
|
5471
|
+
"a": 1
|
|
5472
|
+
},
|
|
5473
|
+
"1928:8": {
|
|
5474
|
+
"r": 0.25882354378700256,
|
|
5475
|
+
"g": 0.13725490868091583,
|
|
5476
|
+
"b": 0.03921568766236305,
|
|
5477
|
+
"a": 1
|
|
5478
|
+
}
|
|
5479
|
+
},
|
|
5480
|
+
"scopes": [
|
|
5481
|
+
"ALL_SCOPES"
|
|
5482
|
+
],
|
|
5483
|
+
"codeSyntax": {}
|
|
5484
|
+
},
|
|
5485
|
+
"VariableID:54897:41778": {
|
|
5486
|
+
"name": "banner/pink",
|
|
5487
|
+
"id": "VariableID:54897:41778",
|
|
5488
|
+
"remote": false,
|
|
5489
|
+
"key": "04118a56e71ec0771842a975f80b1704daf0d087",
|
|
5490
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5491
|
+
"resolvedType": "COLOR",
|
|
5492
|
+
"description": "",
|
|
5493
|
+
"hiddenFromPublishing": false,
|
|
5494
|
+
"valuesByMode": {
|
|
5495
|
+
"1928:7": {
|
|
5496
|
+
"r": 1,
|
|
5497
|
+
"g": 0.9215686321258545,
|
|
5498
|
+
"b": 0.9450980424880981,
|
|
5499
|
+
"a": 1
|
|
5500
|
+
},
|
|
5501
|
+
"1928:8": {
|
|
5502
|
+
"r": 0.23137255012989044,
|
|
5503
|
+
"g": 0.09019608050584793,
|
|
5504
|
+
"b": 0.1725490242242813,
|
|
5505
|
+
"a": 1
|
|
5506
|
+
}
|
|
5507
|
+
},
|
|
5508
|
+
"scopes": [
|
|
5509
|
+
"ALL_SCOPES"
|
|
5510
|
+
],
|
|
5511
|
+
"codeSyntax": {}
|
|
5512
|
+
},
|
|
5513
|
+
"VariableID:54897:41777": {
|
|
5514
|
+
"name": "banner/purple",
|
|
5515
|
+
"id": "VariableID:54897:41777",
|
|
4726
5516
|
"remote": false,
|
|
4727
|
-
"
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
"
|
|
5517
|
+
"key": "2b4f397b4df3df91aae0020b486d03e7e59de3a1",
|
|
5518
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5519
|
+
"resolvedType": "COLOR",
|
|
5520
|
+
"description": "",
|
|
5521
|
+
"hiddenFromPublishing": false,
|
|
5522
|
+
"valuesByMode": {
|
|
5523
|
+
"1928:7": {
|
|
5524
|
+
"r": 0.9607843160629272,
|
|
5525
|
+
"g": 0.9254902005195618,
|
|
5526
|
+
"b": 1,
|
|
5527
|
+
"a": 1
|
|
4735
5528
|
},
|
|
4736
|
-
{
|
|
4737
|
-
"
|
|
4738
|
-
"
|
|
5529
|
+
"1928:8": {
|
|
5530
|
+
"r": 0.18039216101169586,
|
|
5531
|
+
"g": 0.11764705926179886,
|
|
5532
|
+
"b": 0.2705882489681244,
|
|
5533
|
+
"a": 1
|
|
4739
5534
|
}
|
|
5535
|
+
},
|
|
5536
|
+
"scopes": [
|
|
5537
|
+
"ALL_SCOPES"
|
|
4740
5538
|
],
|
|
4741
|
-
"
|
|
5539
|
+
"codeSyntax": {}
|
|
5540
|
+
},
|
|
5541
|
+
"VariableID:54897:41770": {
|
|
5542
|
+
"name": "banner/red",
|
|
5543
|
+
"id": "VariableID:54897:41770",
|
|
5544
|
+
"remote": false,
|
|
5545
|
+
"key": "332c3632c7252e24d088ff6775a717f2f27514b7",
|
|
5546
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
5547
|
+
"resolvedType": "COLOR",
|
|
5548
|
+
"description": "",
|
|
4742
5549
|
"hiddenFromPublishing": false,
|
|
4743
|
-
"
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
5550
|
+
"valuesByMode": {
|
|
5551
|
+
"1928:7": {
|
|
5552
|
+
"r": 1,
|
|
5553
|
+
"g": 0.9254902005195618,
|
|
5554
|
+
"b": 0.9333333373069763,
|
|
5555
|
+
"a": 1
|
|
5556
|
+
},
|
|
5557
|
+
"1928:8": {
|
|
5558
|
+
"r": 0.22745098173618317,
|
|
5559
|
+
"g": 0.05882352963089943,
|
|
5560
|
+
"b": 0.08235294371843338,
|
|
5561
|
+
"a": 1
|
|
5562
|
+
}
|
|
5563
|
+
},
|
|
5564
|
+
"scopes": [
|
|
5565
|
+
"ALL_SCOPES"
|
|
5566
|
+
],
|
|
5567
|
+
"codeSyntax": {}
|
|
5568
|
+
},
|
|
5569
|
+
"VariableID:54897:41775": {
|
|
5570
|
+
"name": "banner/teal",
|
|
5571
|
+
"id": "VariableID:54897:41775",
|
|
4756
5572
|
"remote": false,
|
|
4757
|
-
"key": "
|
|
5573
|
+
"key": "44155474e492d3bf5a93f8d5b68324c052c279e6",
|
|
4758
5574
|
"variableCollectionId": "VariableCollectionId:1:3",
|
|
4759
5575
|
"resolvedType": "COLOR",
|
|
4760
5576
|
"description": "",
|
|
4761
5577
|
"hiddenFromPublishing": false,
|
|
4762
5578
|
"valuesByMode": {
|
|
4763
5579
|
"1928:7": {
|
|
4764
|
-
"
|
|
4765
|
-
"
|
|
5580
|
+
"r": 0.9019607901573181,
|
|
5581
|
+
"g": 0.9803921580314636,
|
|
5582
|
+
"b": 0.9647058844566345,
|
|
5583
|
+
"a": 1
|
|
4766
5584
|
},
|
|
4767
5585
|
"1928:8": {
|
|
4768
|
-
"
|
|
4769
|
-
"
|
|
5586
|
+
"r": 0.0784313753247261,
|
|
5587
|
+
"g": 0.21176470816135406,
|
|
5588
|
+
"b": 0.20000000298023224,
|
|
5589
|
+
"a": 1
|
|
4770
5590
|
}
|
|
4771
5591
|
},
|
|
4772
5592
|
"scopes": [
|
|
@@ -4774,49 +5594,55 @@ const FIGMA_VARIABLES = {
|
|
|
4774
5594
|
],
|
|
4775
5595
|
"codeSyntax": {}
|
|
4776
5596
|
},
|
|
4777
|
-
"VariableID:
|
|
4778
|
-
"name": "
|
|
4779
|
-
"id": "VariableID:
|
|
5597
|
+
"VariableID:54897:41779": {
|
|
5598
|
+
"name": "banner/warm-gray",
|
|
5599
|
+
"id": "VariableID:54897:41779",
|
|
4780
5600
|
"remote": false,
|
|
4781
|
-
"key": "
|
|
5601
|
+
"key": "795d9d04de8ba3479af2ff06e3359e7a8648caa3",
|
|
4782
5602
|
"variableCollectionId": "VariableCollectionId:1:3",
|
|
4783
5603
|
"resolvedType": "COLOR",
|
|
4784
5604
|
"description": "",
|
|
4785
5605
|
"hiddenFromPublishing": false,
|
|
4786
5606
|
"valuesByMode": {
|
|
4787
5607
|
"1928:7": {
|
|
4788
|
-
"
|
|
4789
|
-
"
|
|
5608
|
+
"r": 0.9490196108818054,
|
|
5609
|
+
"g": 0.9411764740943909,
|
|
5610
|
+
"b": 0.9333333373069763,
|
|
5611
|
+
"a": 1
|
|
4790
5612
|
},
|
|
4791
5613
|
"1928:8": {
|
|
4792
|
-
"
|
|
4793
|
-
"
|
|
5614
|
+
"r": 0.18431372940540314,
|
|
5615
|
+
"g": 0.16862745583057404,
|
|
5616
|
+
"b": 0.15294118225574493,
|
|
5617
|
+
"a": 1
|
|
4794
5618
|
}
|
|
4795
5619
|
},
|
|
4796
5620
|
"scopes": [
|
|
4797
|
-
"
|
|
4798
|
-
"SHAPE_FILL",
|
|
4799
|
-
"STROKE_COLOR"
|
|
5621
|
+
"ALL_SCOPES"
|
|
4800
5622
|
],
|
|
4801
5623
|
"codeSyntax": {}
|
|
4802
5624
|
},
|
|
4803
|
-
"VariableID:
|
|
4804
|
-
"name": "
|
|
4805
|
-
"id": "VariableID:
|
|
5625
|
+
"VariableID:54897:41772": {
|
|
5626
|
+
"name": "banner/yellow",
|
|
5627
|
+
"id": "VariableID:54897:41772",
|
|
4806
5628
|
"remote": false,
|
|
4807
|
-
"key": "
|
|
5629
|
+
"key": "dc09473d4db3cb127f45ee30f88ecb682d25d723",
|
|
4808
5630
|
"variableCollectionId": "VariableCollectionId:1:3",
|
|
4809
5631
|
"resolvedType": "COLOR",
|
|
4810
5632
|
"description": "",
|
|
4811
5633
|
"hiddenFromPublishing": false,
|
|
4812
5634
|
"valuesByMode": {
|
|
4813
5635
|
"1928:7": {
|
|
4814
|
-
"
|
|
4815
|
-
"
|
|
5636
|
+
"r": 1,
|
|
5637
|
+
"g": 0.9803921580314636,
|
|
5638
|
+
"b": 0.8823529481887817,
|
|
5639
|
+
"a": 1
|
|
4816
5640
|
},
|
|
4817
5641
|
"1928:8": {
|
|
4818
|
-
"
|
|
4819
|
-
"
|
|
5642
|
+
"r": 0.24313725531101227,
|
|
5643
|
+
"g": 0.16862745583057404,
|
|
5644
|
+
"b": 0,
|
|
5645
|
+
"a": 1
|
|
4820
5646
|
}
|
|
4821
5647
|
},
|
|
4822
5648
|
"scopes": [
|
|
@@ -11378,26 +12204,6 @@ const FIGMA_VARIABLES = {
|
|
|
11378
12204
|
}
|
|
11379
12205
|
};
|
|
11380
12206
|
|
|
11381
|
-
const templateBannerDetach = {
|
|
11382
|
-
"name": "templateBannerDetach",
|
|
11383
|
-
"key": "b9670e4d68d2b1057f28916728a845dc9c160c0f",
|
|
11384
|
-
"componentPropertyDefinitions": {
|
|
11385
|
-
"Layout": {
|
|
11386
|
-
"type": "VARIANT",
|
|
11387
|
-
"variantOptions": [
|
|
11388
|
-
"Title + Description",
|
|
11389
|
-
"Description + Title"
|
|
11390
|
-
]
|
|
11391
|
-
},
|
|
11392
|
-
"Rounded": {
|
|
11393
|
-
"type": "VARIANT",
|
|
11394
|
-
"variantOptions": [
|
|
11395
|
-
"True",
|
|
11396
|
-
"False"
|
|
11397
|
-
]
|
|
11398
|
-
}
|
|
11399
|
-
}
|
|
11400
|
-
};
|
|
11401
12207
|
const templateButtonGroup = {
|
|
11402
12208
|
"name": "templateButtonGroup",
|
|
11403
12209
|
"key": "29109a34197f2eb5d390b1d9ebba270979a7b302",
|
|
@@ -11482,70 +12288,18 @@ const templateCustomPickerField = {
|
|
|
11482
12288
|
}
|
|
11483
12289
|
}
|
|
11484
12290
|
};
|
|
11485
|
-
const
|
|
11486
|
-
"name": "
|
|
11487
|
-
"key": "
|
|
12291
|
+
const templateDisclaimer = {
|
|
12292
|
+
"name": "templateDisclaimer",
|
|
12293
|
+
"key": "e08d2594b76c6c0107e34c0071cab8ef844c8998",
|
|
11488
12294
|
"componentPropertyDefinitions": {
|
|
11489
|
-
"Title#
|
|
11490
|
-
"type": "TEXT"
|
|
11491
|
-
},
|
|
11492
|
-
"Description#16237:5": {
|
|
11493
|
-
"type": "TEXT"
|
|
11494
|
-
},
|
|
11495
|
-
"Asset Type#45154:9": {
|
|
11496
|
-
"type": "INSTANCE_SWAP",
|
|
11497
|
-
"preferredValues": [
|
|
11498
|
-
{
|
|
11499
|
-
"type": "COMPONENT",
|
|
11500
|
-
"key": "3f2ed06bd34fbaf24d371cefa973e09e2c2572bf"
|
|
11501
|
-
},
|
|
11502
|
-
{
|
|
11503
|
-
"type": "COMPONENT",
|
|
11504
|
-
"key": "bf1ad3ad5c45a2e94fd800f7f6ecbe52ba0667ab"
|
|
11505
|
-
},
|
|
11506
|
-
{
|
|
11507
|
-
"type": "COMPONENT",
|
|
11508
|
-
"key": "d357dcf0fbff80f3bfa70fe4fd5d48a9bddd1b49"
|
|
11509
|
-
},
|
|
11510
|
-
{
|
|
11511
|
-
"type": "COMPONENT",
|
|
11512
|
-
"key": "a53df434b562c1eeb04dab9abd88431989c5fc33"
|
|
11513
|
-
},
|
|
11514
|
-
{
|
|
11515
|
-
"type": "COMPONENT",
|
|
11516
|
-
"key": "5e53811a1e1444deccb5147b6a57196a3be467c9"
|
|
11517
|
-
},
|
|
11518
|
-
{
|
|
11519
|
-
"type": "COMPONENT",
|
|
11520
|
-
"key": "3ff3999d2d2bbed2c7656210793d4f083901f73b"
|
|
11521
|
-
},
|
|
11522
|
-
{
|
|
11523
|
-
"type": "COMPONENT",
|
|
11524
|
-
"key": "56fcf964b7784ca83eaf6c9b1531de6150d23a0d"
|
|
11525
|
-
},
|
|
11526
|
-
{
|
|
11527
|
-
"type": "COMPONENT",
|
|
11528
|
-
"key": "5652618ddd66c844ab977d083d0dc41cb98f98ae"
|
|
11529
|
-
}
|
|
11530
|
-
]
|
|
11531
|
-
},
|
|
11532
|
-
"Show Asset#45154:14": {
|
|
11533
|
-
"type": "BOOLEAN"
|
|
11534
|
-
},
|
|
11535
|
-
"Show Buttons#53435:0": {
|
|
11536
|
-
"type": "BOOLEAN"
|
|
11537
|
-
},
|
|
11538
|
-
"ㄴShow First Button#53766:0": {
|
|
11539
|
-
"type": "BOOLEAN"
|
|
11540
|
-
},
|
|
11541
|
-
"ㄴShow Second Button#53766:3": {
|
|
12295
|
+
"Show Title#54910:2": {
|
|
11542
12296
|
"type": "BOOLEAN"
|
|
11543
12297
|
},
|
|
11544
12298
|
"Size": {
|
|
11545
12299
|
"type": "VARIANT",
|
|
11546
12300
|
"variantOptions": [
|
|
11547
|
-
"
|
|
11548
|
-
"
|
|
12301
|
+
"t4(14pt)",
|
|
12302
|
+
"t5(16pt)"
|
|
11549
12303
|
]
|
|
11550
12304
|
}
|
|
11551
12305
|
}
|
|
@@ -12561,17 +13315,16 @@ const menuSheet = {
|
|
|
12561
13315
|
"Menu Group Count": {
|
|
12562
13316
|
"type": "VARIANT",
|
|
12563
13317
|
"variantOptions": [
|
|
13318
|
+
"1",
|
|
12564
13319
|
"2",
|
|
12565
|
-
"3"
|
|
12566
|
-
"1"
|
|
13320
|
+
"3"
|
|
12567
13321
|
]
|
|
12568
13322
|
},
|
|
12569
13323
|
"Layout": {
|
|
12570
13324
|
"type": "VARIANT",
|
|
12571
13325
|
"variantOptions": [
|
|
12572
13326
|
"Text Only",
|
|
12573
|
-
"Text with Icon"
|
|
12574
|
-
"Text with Subtext"
|
|
13327
|
+
"Text with Icon"
|
|
12575
13328
|
]
|
|
12576
13329
|
}
|
|
12577
13330
|
}
|
|
@@ -12594,10 +13347,10 @@ const pageBanner = {
|
|
|
12594
13347
|
"type": "VARIANT",
|
|
12595
13348
|
"variantOptions": [
|
|
12596
13349
|
"Display",
|
|
13350
|
+
"Display (With Action)",
|
|
12597
13351
|
"Actionable",
|
|
12598
13352
|
"Dismissible",
|
|
12599
|
-
"
|
|
12600
|
-
"Custom"
|
|
13353
|
+
"Actionable (Custom)"
|
|
12601
13354
|
]
|
|
12602
13355
|
},
|
|
12603
13356
|
"Tone": {
|
|
@@ -12704,8 +13457,8 @@ const radio = {
|
|
|
12704
13457
|
}
|
|
12705
13458
|
}
|
|
12706
13459
|
};
|
|
12707
|
-
const
|
|
12708
|
-
"name": "
|
|
13460
|
+
const radiomark = {
|
|
13461
|
+
"name": "radiomark",
|
|
12709
13462
|
"key": "832d696d6e9566610968cd70f128f500ec009d6a",
|
|
12710
13463
|
"componentPropertyDefinitions": {
|
|
12711
13464
|
"Size": {
|
|
@@ -12817,6 +13570,74 @@ const resizableChild = {
|
|
|
12817
13570
|
}
|
|
12818
13571
|
}
|
|
12819
13572
|
};
|
|
13573
|
+
const resultSection = {
|
|
13574
|
+
"name": "resultSection",
|
|
13575
|
+
"key": "fabd52c41c63d921e37e0a1de373e4df2b496f30",
|
|
13576
|
+
"componentPropertyDefinitions": {
|
|
13577
|
+
"Title#16237:0": {
|
|
13578
|
+
"type": "TEXT"
|
|
13579
|
+
},
|
|
13580
|
+
"Description#16237:5": {
|
|
13581
|
+
"type": "TEXT"
|
|
13582
|
+
},
|
|
13583
|
+
"Asset Type#45154:9": {
|
|
13584
|
+
"type": "INSTANCE_SWAP",
|
|
13585
|
+
"preferredValues": [
|
|
13586
|
+
{
|
|
13587
|
+
"type": "COMPONENT",
|
|
13588
|
+
"key": "3f2ed06bd34fbaf24d371cefa973e09e2c2572bf"
|
|
13589
|
+
},
|
|
13590
|
+
{
|
|
13591
|
+
"type": "COMPONENT",
|
|
13592
|
+
"key": "bf1ad3ad5c45a2e94fd800f7f6ecbe52ba0667ab"
|
|
13593
|
+
},
|
|
13594
|
+
{
|
|
13595
|
+
"type": "COMPONENT",
|
|
13596
|
+
"key": "d357dcf0fbff80f3bfa70fe4fd5d48a9bddd1b49"
|
|
13597
|
+
},
|
|
13598
|
+
{
|
|
13599
|
+
"type": "COMPONENT",
|
|
13600
|
+
"key": "a53df434b562c1eeb04dab9abd88431989c5fc33"
|
|
13601
|
+
},
|
|
13602
|
+
{
|
|
13603
|
+
"type": "COMPONENT",
|
|
13604
|
+
"key": "5e53811a1e1444deccb5147b6a57196a3be467c9"
|
|
13605
|
+
},
|
|
13606
|
+
{
|
|
13607
|
+
"type": "COMPONENT",
|
|
13608
|
+
"key": "3ff3999d2d2bbed2c7656210793d4f083901f73b"
|
|
13609
|
+
},
|
|
13610
|
+
{
|
|
13611
|
+
"type": "COMPONENT",
|
|
13612
|
+
"key": "56fcf964b7784ca83eaf6c9b1531de6150d23a0d"
|
|
13613
|
+
},
|
|
13614
|
+
{
|
|
13615
|
+
"type": "COMPONENT",
|
|
13616
|
+
"key": "5652618ddd66c844ab977d083d0dc41cb98f98ae"
|
|
13617
|
+
}
|
|
13618
|
+
]
|
|
13619
|
+
},
|
|
13620
|
+
"Show Asset#45154:14": {
|
|
13621
|
+
"type": "BOOLEAN"
|
|
13622
|
+
},
|
|
13623
|
+
"Show Buttons#53435:0": {
|
|
13624
|
+
"type": "BOOLEAN"
|
|
13625
|
+
},
|
|
13626
|
+
"ㄴShow First Button#53766:0": {
|
|
13627
|
+
"type": "BOOLEAN"
|
|
13628
|
+
},
|
|
13629
|
+
"ㄴShow Second Button#53766:3": {
|
|
13630
|
+
"type": "BOOLEAN"
|
|
13631
|
+
},
|
|
13632
|
+
"Size": {
|
|
13633
|
+
"type": "VARIANT",
|
|
13634
|
+
"variantOptions": [
|
|
13635
|
+
"Large",
|
|
13636
|
+
"Medium"
|
|
13637
|
+
]
|
|
13638
|
+
}
|
|
13639
|
+
}
|
|
13640
|
+
};
|
|
12820
13641
|
const rootTopNavigationGlobal = {
|
|
12821
13642
|
"name": "rootTopNavigationGlobal",
|
|
12822
13643
|
"key": "a694a1da14a5c1d7d5c66bc78218c0c61fb388ab",
|
|
@@ -13049,8 +13870,8 @@ const _switch = {
|
|
|
13049
13870
|
}
|
|
13050
13871
|
}
|
|
13051
13872
|
};
|
|
13052
|
-
const
|
|
13053
|
-
"name": "
|
|
13873
|
+
const switchmark = {
|
|
13874
|
+
"name": "switchmark",
|
|
13054
13875
|
"key": "bc53f269089e02a1d241e2a21ac7631bfa49834e",
|
|
13055
13876
|
"componentPropertyDefinitions": {
|
|
13056
13877
|
"Size": {
|
|
@@ -13317,10 +14138,11 @@ var FIGMA_COMPONENTS = {
|
|
|
13317
14138
|
pageBanner: pageBanner,
|
|
13318
14139
|
progressCircle: progressCircle,
|
|
13319
14140
|
radio: radio,
|
|
13320
|
-
|
|
14141
|
+
radiomark: radiomark,
|
|
13321
14142
|
reactionButton: reactionButton,
|
|
13322
14143
|
resizableChild: resizableChild,
|
|
13323
14144
|
resizableIcon: resizableIcon,
|
|
14145
|
+
resultSection: resultSection,
|
|
13324
14146
|
rootTopNavigationGlobal: rootTopNavigationGlobal,
|
|
13325
14147
|
rootTopNavigationKr: rootTopNavigationKr,
|
|
13326
14148
|
segmentedControl: segmentedControl,
|
|
@@ -13329,14 +14151,13 @@ var FIGMA_COMPONENTS = {
|
|
|
13329
14151
|
slider: slider,
|
|
13330
14152
|
snackbar: snackbar,
|
|
13331
14153
|
superscriptChild: superscriptChild,
|
|
13332
|
-
|
|
14154
|
+
switchmark: switchmark,
|
|
13333
14155
|
tabs: tabs,
|
|
13334
14156
|
tagGroup: tagGroup,
|
|
13335
|
-
templateBannerDetach: templateBannerDetach,
|
|
13336
14157
|
templateButtonGroup: templateButtonGroup,
|
|
13337
14158
|
templateChipGroup: templateChipGroup,
|
|
13338
14159
|
templateCustomPickerField: templateCustomPickerField,
|
|
13339
|
-
|
|
14160
|
+
templateDisclaimer: templateDisclaimer,
|
|
13340
14161
|
templateSelectBoxGroup: templateSelectBoxGroup,
|
|
13341
14162
|
templateSliderField: templateSliderField,
|
|
13342
14163
|
templateTextField: templateTextField,
|