@pairdraw/kiwi 0.19.2 → 0.21.0
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/chunks/fig/codec.js.map +1 -1
- package/dist/fig/codec.d.ts +56 -3
- package/package.json +1 -1
- package/src/fig/codec.ts +56 -2
package/dist/fig/codec.d.ts
CHANGED
|
@@ -95,7 +95,11 @@ interface Paint {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
interface Effect {
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Every type the schema's `EffectType` has. `LAYER_BLUR` is the plugin API's name for
|
|
100
|
+
* `FOREGROUND_BLUR`, and `GRAIN` its `TEXTURE`.
|
|
101
|
+
*/
|
|
102
|
+
type: 'DROP_SHADOW' | 'INNER_SHADOW' | 'LAYER_BLUR' | 'BACKGROUND_BLUR' | 'FOREGROUND_BLUR' | 'GLASS' | 'NOISE' | 'GRAIN' | 'REPEAT' | 'SYMMETRY' | 'CUSTOM';
|
|
99
103
|
color?: Color;
|
|
100
104
|
offset?: Vector;
|
|
101
105
|
radius?: number;
|
|
@@ -103,6 +107,20 @@ interface Effect {
|
|
|
103
107
|
spread?: number;
|
|
104
108
|
blendMode?: string;
|
|
105
109
|
showShadowBehindNode?: boolean;
|
|
110
|
+
/** A noise effect's kind: one tone, two, or many. */
|
|
111
|
+
noiseType?: 'MONOTONE' | 'DUOTONE' | 'MULTITONE';
|
|
112
|
+
/** A noise effect's second tone, which a duotone draws as the first when it has none. */
|
|
113
|
+
secondaryColor?: Color;
|
|
114
|
+
/** A grain's size in px; Figma keeps it within 0 to 100. */
|
|
115
|
+
noiseSize?: Vector;
|
|
116
|
+
/** How much of the layer a noise effect's grains cover, 0 to 1. */
|
|
117
|
+
density?: number;
|
|
118
|
+
/** A multitone noise's grain opacity, 0 to 1. */
|
|
119
|
+
opacity?: number;
|
|
120
|
+
/** The pattern's seed, which Figma's plugin API neither shows nor sets. */
|
|
121
|
+
seed?: number;
|
|
122
|
+
/** Whether a texture keeps the roughened layer inside its own outline. */
|
|
123
|
+
clipToShape?: boolean;
|
|
106
124
|
}
|
|
107
125
|
interface VariableAnyValue {
|
|
108
126
|
boolValue?: boolean;
|
|
@@ -187,6 +205,29 @@ interface TextLineData {
|
|
|
187
205
|
listStartOffset?: number;
|
|
188
206
|
isFirstLineOfList?: boolean;
|
|
189
207
|
}
|
|
208
|
+
interface GridTrackInfo {
|
|
209
|
+
minSizing?: {
|
|
210
|
+
type?: string;
|
|
211
|
+
value?: number;
|
|
212
|
+
};
|
|
213
|
+
maxSizing?: {
|
|
214
|
+
type?: string;
|
|
215
|
+
value?: number;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
interface GUIDPositionMap {
|
|
219
|
+
entries?: Array<{
|
|
220
|
+
id?: GUID;
|
|
221
|
+
position?: string;
|
|
222
|
+
trackSize?: GridTrackInfo;
|
|
223
|
+
}>;
|
|
224
|
+
}
|
|
225
|
+
interface GridTrackSizeMap {
|
|
226
|
+
entries?: Array<{
|
|
227
|
+
id?: GUID;
|
|
228
|
+
trackSize?: GridTrackInfo;
|
|
229
|
+
}>;
|
|
230
|
+
}
|
|
190
231
|
interface NodeChange {
|
|
191
232
|
[key: string]: unknown;
|
|
192
233
|
guid?: GUID;
|
|
@@ -215,8 +256,19 @@ interface NodeChange {
|
|
|
215
256
|
maskIsOutline?: boolean;
|
|
216
257
|
exportSettings?: unknown[];
|
|
217
258
|
layoutGrids?: unknown[];
|
|
218
|
-
stackMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL';
|
|
259
|
+
stackMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'GRID';
|
|
219
260
|
stackSpacing?: number;
|
|
261
|
+
gridRows?: GUIDPositionMap;
|
|
262
|
+
gridColumns?: GUIDPositionMap;
|
|
263
|
+
gridRowsSizing?: GridTrackSizeMap;
|
|
264
|
+
gridColumnsSizing?: GridTrackSizeMap;
|
|
265
|
+
gridRowGap?: number;
|
|
266
|
+
gridColumnGap?: number;
|
|
267
|
+
gridAutoTracks?: string;
|
|
268
|
+
gridRowAnchor?: GUID;
|
|
269
|
+
gridColumnAnchor?: GUID;
|
|
270
|
+
gridRowSpan?: number;
|
|
271
|
+
gridColumnSpan?: number;
|
|
220
272
|
stackPadding?: number;
|
|
221
273
|
stackPaddingRight?: number;
|
|
222
274
|
stackPaddingBottom?: number;
|
|
@@ -244,6 +296,7 @@ interface NodeChange {
|
|
|
244
296
|
};
|
|
245
297
|
clipsContent?: boolean;
|
|
246
298
|
frameMaskDisabled?: boolean;
|
|
299
|
+
scrollDirection?: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'BOTH';
|
|
247
300
|
resizeToFit?: boolean;
|
|
248
301
|
booleanOperation?: 'UNION' | 'SUBTRACT' | 'INTERSECT' | 'XOR';
|
|
249
302
|
vectorData?: unknown;
|
|
@@ -475,5 +528,5 @@ declare function createNodeChange(opts: {
|
|
|
475
528
|
opacity?: number;
|
|
476
529
|
}): NodeChange;
|
|
477
530
|
//#endregion
|
|
478
|
-
export { AssetRef, Effect, FigmaMessage, ImageSource, NodeChange, Paint, ParentIndex, PluginData, PluginRelaunchData, StyleReference, TextLineData, VariableAnyValue, VariableConsumptionEntry, VariableDataEntry, VariableDataValuesEntry, compress, createNodeChange, createNodeChangesMessage, decodeMessage, decompress, encodeMessage, getCompiledSchema, getSchemaBytes, initCodec, isCodecReady, peekMessageType };
|
|
531
|
+
export { AssetRef, Effect, FigmaMessage, GUIDPositionMap, GridTrackInfo, GridTrackSizeMap, ImageSource, NodeChange, Paint, ParentIndex, PluginData, PluginRelaunchData, StyleReference, TextLineData, VariableAnyValue, VariableConsumptionEntry, VariableDataEntry, VariableDataValuesEntry, compress, createNodeChange, createNodeChangesMessage, decodeMessage, decompress, encodeMessage, getCompiledSchema, getSchemaBytes, initCodec, isCodecReady, peekMessageType };
|
|
479
532
|
//# sourceMappingURL=codec.d.ts.map
|
package/package.json
CHANGED
package/src/fig/codec.ts
CHANGED
|
@@ -161,7 +161,22 @@ export interface Paint {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export interface Effect {
|
|
164
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Every type the schema's `EffectType` has. `LAYER_BLUR` is the plugin API's name for
|
|
166
|
+
* `FOREGROUND_BLUR`, and `GRAIN` its `TEXTURE`.
|
|
167
|
+
*/
|
|
168
|
+
type:
|
|
169
|
+
| 'DROP_SHADOW'
|
|
170
|
+
| 'INNER_SHADOW'
|
|
171
|
+
| 'LAYER_BLUR'
|
|
172
|
+
| 'BACKGROUND_BLUR'
|
|
173
|
+
| 'FOREGROUND_BLUR'
|
|
174
|
+
| 'GLASS'
|
|
175
|
+
| 'NOISE'
|
|
176
|
+
| 'GRAIN'
|
|
177
|
+
| 'REPEAT'
|
|
178
|
+
| 'SYMMETRY'
|
|
179
|
+
| 'CUSTOM'
|
|
165
180
|
color?: Color
|
|
166
181
|
offset?: Vector
|
|
167
182
|
radius?: number
|
|
@@ -169,6 +184,20 @@ export interface Effect {
|
|
|
169
184
|
spread?: number
|
|
170
185
|
blendMode?: string
|
|
171
186
|
showShadowBehindNode?: boolean
|
|
187
|
+
/** A noise effect's kind: one tone, two, or many. */
|
|
188
|
+
noiseType?: 'MONOTONE' | 'DUOTONE' | 'MULTITONE'
|
|
189
|
+
/** A noise effect's second tone, which a duotone draws as the first when it has none. */
|
|
190
|
+
secondaryColor?: Color
|
|
191
|
+
/** A grain's size in px; Figma keeps it within 0 to 100. */
|
|
192
|
+
noiseSize?: Vector
|
|
193
|
+
/** How much of the layer a noise effect's grains cover, 0 to 1. */
|
|
194
|
+
density?: number
|
|
195
|
+
/** A multitone noise's grain opacity, 0 to 1. */
|
|
196
|
+
opacity?: number
|
|
197
|
+
/** The pattern's seed, which Figma's plugin API neither shows nor sets. */
|
|
198
|
+
seed?: number
|
|
199
|
+
/** Whether a texture keeps the roughened layer inside its own outline. */
|
|
200
|
+
clipToShape?: boolean
|
|
172
201
|
}
|
|
173
202
|
|
|
174
203
|
export interface VariableAnyValue {
|
|
@@ -240,6 +269,19 @@ export interface TextLineData {
|
|
|
240
269
|
isFirstLineOfList?: boolean
|
|
241
270
|
}
|
|
242
271
|
|
|
272
|
+
export interface GridTrackInfo {
|
|
273
|
+
minSizing?: { type?: string; value?: number }
|
|
274
|
+
maxSizing?: { type?: string; value?: number }
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface GUIDPositionMap {
|
|
278
|
+
entries?: Array<{ id?: GUID; position?: string; trackSize?: GridTrackInfo }>
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface GridTrackSizeMap {
|
|
282
|
+
entries?: Array<{ id?: GUID; trackSize?: GridTrackInfo }>
|
|
283
|
+
}
|
|
284
|
+
|
|
243
285
|
export interface NodeChange {
|
|
244
286
|
[key: string]: unknown
|
|
245
287
|
guid?: GUID
|
|
@@ -269,8 +311,19 @@ export interface NodeChange {
|
|
|
269
311
|
exportSettings?: unknown[]
|
|
270
312
|
layoutGrids?: unknown[]
|
|
271
313
|
// Layout
|
|
272
|
-
stackMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL'
|
|
314
|
+
stackMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'GRID'
|
|
273
315
|
stackSpacing?: number
|
|
316
|
+
gridRows?: GUIDPositionMap
|
|
317
|
+
gridColumns?: GUIDPositionMap
|
|
318
|
+
gridRowsSizing?: GridTrackSizeMap
|
|
319
|
+
gridColumnsSizing?: GridTrackSizeMap
|
|
320
|
+
gridRowGap?: number
|
|
321
|
+
gridColumnGap?: number
|
|
322
|
+
gridAutoTracks?: string
|
|
323
|
+
gridRowAnchor?: GUID
|
|
324
|
+
gridColumnAnchor?: GUID
|
|
325
|
+
gridRowSpan?: number
|
|
326
|
+
gridColumnSpan?: number
|
|
274
327
|
stackPadding?: number
|
|
275
328
|
stackPaddingRight?: number
|
|
276
329
|
stackPaddingBottom?: number
|
|
@@ -293,6 +346,7 @@ export interface NodeChange {
|
|
|
293
346
|
// Frame
|
|
294
347
|
clipsContent?: boolean
|
|
295
348
|
frameMaskDisabled?: boolean
|
|
349
|
+
scrollDirection?: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'BOTH'
|
|
296
350
|
resizeToFit?: boolean
|
|
297
351
|
// Vector
|
|
298
352
|
booleanOperation?: 'UNION' | 'SUBTRACT' | 'INTERSECT' | 'XOR'
|