@figma/code-connect 1.1.0 → 1.1.2
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/README.md +102 -2
- package/dist/connect/index_common.js +1 -1
- package/dist/connect/index_common.js.map +1 -1
- package/package.json +3 -2
- package/dist/common/__test__/project.test.d.ts +0 -2
- package/dist/common/__test__/project.test.d.ts.map +0 -1
- package/dist/common/__test__/project.test.js +0 -14
- package/dist/common/__test__/project.test.js.map +0 -1
- package/dist/common/api.d.ts +0 -224
- package/dist/common/api.d.ts.map +0 -1
- package/dist/common/api.js +0 -3
- package/dist/common/api.js.map +0 -1
- package/dist/common/external.d.ts +0 -14
- package/dist/common/external.d.ts.map +0 -1
- package/dist/common/external.js +0 -65
- package/dist/common/external.js.map +0 -1
- package/dist/common/figma_connect.d.ts +0 -26
- package/dist/common/figma_connect.d.ts.map +0 -1
- package/dist/common/figma_connect.js +0 -3
- package/dist/common/figma_connect.js.map +0 -1
- package/dist/common/intrinsics.d.ts +0 -93
- package/dist/common/intrinsics.d.ts.map +0 -1
- package/dist/common/intrinsics.js +0 -377
- package/dist/common/intrinsics.js.map +0 -1
- package/dist/common/project.d.ts +0 -86
- package/dist/common/project.d.ts.map +0 -1
- package/dist/common/project.js +0 -138
- package/dist/common/project.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -53
- package/dist/index.js.map +0 -1
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.parsePropsObject = exports.intrinsicToString = exports.valueMappingToString = exports.parseIntrinsic = exports.IntrinsicKind = exports.FIGMA_CONNECT_CALL = exports.API_PREFIX = void 0;
|
|
27
|
-
const ts = __importStar(require("typescript"));
|
|
28
|
-
const parser_1 = require("../react/parser");
|
|
29
|
-
const compiler_1 = require("../typescript/compiler");
|
|
30
|
-
const compiler_2 = require("../typescript/compiler");
|
|
31
|
-
const compiler_3 = require("../typescript/compiler");
|
|
32
|
-
const parser_template_helpers_1 = require("../react/parser_template_helpers");
|
|
33
|
-
exports.API_PREFIX = 'figma';
|
|
34
|
-
exports.FIGMA_CONNECT_CALL = `${exports.API_PREFIX}.connect`;
|
|
35
|
-
var IntrinsicKind;
|
|
36
|
-
(function (IntrinsicKind) {
|
|
37
|
-
IntrinsicKind["Enum"] = "enum";
|
|
38
|
-
IntrinsicKind["String"] = "string";
|
|
39
|
-
IntrinsicKind["Boolean"] = "boolean";
|
|
40
|
-
IntrinsicKind["Instance"] = "instance";
|
|
41
|
-
IntrinsicKind["Children"] = "children";
|
|
42
|
-
IntrinsicKind["NestedProps"] = "nested-props";
|
|
43
|
-
IntrinsicKind["ClassName"] = "className";
|
|
44
|
-
IntrinsicKind["TextContent"] = "text-content";
|
|
45
|
-
})(IntrinsicKind || (exports.IntrinsicKind = IntrinsicKind = {}));
|
|
46
|
-
const Intrinsics = {};
|
|
47
|
-
/**
|
|
48
|
-
* These functions are used to convert "intrinsic" parser types (which are calls to helper functions
|
|
49
|
-
* like `Figma.boolean() in code)` to an object representing that intrinsic that we can serialize to JSON.
|
|
50
|
-
*
|
|
51
|
-
* Each call to `makeIntrinsic` should take a function from the {@link FigmaConnectAPI},
|
|
52
|
-
* ensuring that the name of the intrinsic that we're parsing matches the name of the function
|
|
53
|
-
*
|
|
54
|
-
* @param staticFunctionMember
|
|
55
|
-
* @param obj
|
|
56
|
-
*/
|
|
57
|
-
function makeIntrinsic(intrinsicName, obj) {
|
|
58
|
-
const name = `${exports.API_PREFIX}.${intrinsicName}`;
|
|
59
|
-
Intrinsics[name] = {
|
|
60
|
-
match: (exp) => {
|
|
61
|
-
return ts.isCallExpression(exp) && exp.getText().startsWith(name);
|
|
62
|
-
},
|
|
63
|
-
...obj(name),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
makeIntrinsic('boolean', (name) => {
|
|
67
|
-
return {
|
|
68
|
-
parse: (exp, ctx) => {
|
|
69
|
-
const figmaPropNameIdentifier = exp.arguments?.[0];
|
|
70
|
-
(0, compiler_1.assertIsStringLiteral)(figmaPropNameIdentifier, ctx.sourceFile, `${name} takes at least one argument, which is the Figma property name`);
|
|
71
|
-
const valueMappingArg = exp.arguments?.[1];
|
|
72
|
-
let valueMapping;
|
|
73
|
-
if (valueMappingArg) {
|
|
74
|
-
(0, compiler_3.assertIsObjectLiteralExpression)(valueMappingArg, ctx.sourceFile, `${name} second argument should be an object literal, that sets values for 'true' and 'false'`);
|
|
75
|
-
valueMapping = parsePropsObject(valueMappingArg, ctx);
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
kind: IntrinsicKind.Boolean,
|
|
79
|
-
args: {
|
|
80
|
-
figmaPropName: (0, compiler_1.stripQuotes)(figmaPropNameIdentifier),
|
|
81
|
-
valueMapping,
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
makeIntrinsic('enum', (name) => {
|
|
88
|
-
return {
|
|
89
|
-
parse: (exp, ctx) => {
|
|
90
|
-
const { sourceFile } = ctx;
|
|
91
|
-
const figmaPropNameIdentifier = exp.arguments?.[0];
|
|
92
|
-
(0, compiler_1.assertIsStringLiteral)(figmaPropNameIdentifier, sourceFile, `${name} takes at least one argument, which is the Figma property name`);
|
|
93
|
-
const valueMapping = exp.arguments?.[1];
|
|
94
|
-
(0, compiler_3.assertIsObjectLiteralExpression)(valueMapping, sourceFile, `${name} second argument should be an object literal, that maps Figma prop values to code`);
|
|
95
|
-
return {
|
|
96
|
-
kind: IntrinsicKind.Enum,
|
|
97
|
-
args: {
|
|
98
|
-
figmaPropName: (0, compiler_1.stripQuotes)(figmaPropNameIdentifier),
|
|
99
|
-
valueMapping: parsePropsObject(valueMapping, ctx),
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
makeIntrinsic('string', (name) => {
|
|
106
|
-
return {
|
|
107
|
-
parse: (exp, ctx) => {
|
|
108
|
-
const { sourceFile } = ctx;
|
|
109
|
-
const figmaPropNameIdentifier = exp.arguments?.[0];
|
|
110
|
-
(0, compiler_1.assertIsStringLiteral)(figmaPropNameIdentifier, sourceFile, `${name} takes at least one argument, which is the Figma property name`);
|
|
111
|
-
return {
|
|
112
|
-
kind: IntrinsicKind.String,
|
|
113
|
-
args: {
|
|
114
|
-
figmaPropName: (0, compiler_1.stripQuotes)(figmaPropNameIdentifier),
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
makeIntrinsic('instance', (name) => {
|
|
121
|
-
return {
|
|
122
|
-
parse: (exp, ctx) => {
|
|
123
|
-
const { sourceFile } = ctx;
|
|
124
|
-
const figmaPropNameIdentifier = exp.arguments?.[0];
|
|
125
|
-
(0, compiler_1.assertIsStringLiteral)(figmaPropNameIdentifier, sourceFile, `${name} takes at least one argument, which is the Figma property name`);
|
|
126
|
-
return {
|
|
127
|
-
kind: IntrinsicKind.Instance,
|
|
128
|
-
args: {
|
|
129
|
-
figmaPropName: (0, compiler_1.stripQuotes)(figmaPropNameIdentifier),
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
});
|
|
135
|
-
makeIntrinsic('children', (name) => {
|
|
136
|
-
return {
|
|
137
|
-
parse: (exp, ctx) => {
|
|
138
|
-
const { sourceFile } = ctx;
|
|
139
|
-
const layerName = exp.arguments?.[0];
|
|
140
|
-
const layers = [];
|
|
141
|
-
if (ts.isStringLiteral(layerName)) {
|
|
142
|
-
layers.push((0, compiler_1.stripQuotes)(layerName));
|
|
143
|
-
}
|
|
144
|
-
else if (ts.isArrayLiteralExpression(layerName) && layerName.elements.length > 0) {
|
|
145
|
-
layerName.elements.forEach((el) => {
|
|
146
|
-
(0, compiler_1.assertIsStringLiteral)(el, sourceFile);
|
|
147
|
-
const name = (0, compiler_1.stripQuotes)(el);
|
|
148
|
-
if (name.includes('*')) {
|
|
149
|
-
throw new parser_1.ParserError(`Wildcards can not be used with an array of strings. Use a single string literal instead.`, {
|
|
150
|
-
node: layerName,
|
|
151
|
-
sourceFile,
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
layers.push((0, compiler_1.stripQuotes)(el));
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
throw new parser_1.ParserError(`Invalid argument to ${name}, should be a string literal or an array of strings`, {
|
|
159
|
-
node: layerName,
|
|
160
|
-
sourceFile,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
kind: IntrinsicKind.Children,
|
|
165
|
-
args: {
|
|
166
|
-
layers,
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
makeIntrinsic('nestedProps', (name) => {
|
|
173
|
-
return {
|
|
174
|
-
parse: (exp, ctx) => {
|
|
175
|
-
const { sourceFile } = ctx;
|
|
176
|
-
const layerName = exp.arguments?.[0];
|
|
177
|
-
const mapping = exp.arguments?.[1];
|
|
178
|
-
(0, compiler_1.assertIsStringLiteral)(layerName, sourceFile, `Invalid argument to ${name}, \`layerName\` should be a string literal`);
|
|
179
|
-
(0, compiler_3.assertIsObjectLiteralExpression)(mapping, sourceFile, `Invalid argument to ${name}, \`props\` should be an object literal`);
|
|
180
|
-
return {
|
|
181
|
-
kind: IntrinsicKind.NestedProps,
|
|
182
|
-
args: {
|
|
183
|
-
layer: (0, compiler_1.stripQuotes)(layerName),
|
|
184
|
-
props: parsePropsObject(mapping, ctx),
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
});
|
|
190
|
-
makeIntrinsic('className', (name) => {
|
|
191
|
-
return {
|
|
192
|
-
parse: (exp, ctx) => {
|
|
193
|
-
const { sourceFile } = ctx;
|
|
194
|
-
const classNameArg = exp.arguments?.[0];
|
|
195
|
-
const className = [];
|
|
196
|
-
(0, compiler_1.assertIsArrayLiteralExpression)(classNameArg, sourceFile, `${name} takes an array of strings`);
|
|
197
|
-
classNameArg.elements.forEach((el) => {
|
|
198
|
-
if (ts.isStringLiteral(el)) {
|
|
199
|
-
className.push((0, compiler_1.stripQuotes)(el));
|
|
200
|
-
}
|
|
201
|
-
else if (ts.isCallExpression(el)) {
|
|
202
|
-
className.push(parseIntrinsic(el, ctx));
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
return {
|
|
206
|
-
kind: IntrinsicKind.ClassName,
|
|
207
|
-
args: {
|
|
208
|
-
className,
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
});
|
|
214
|
-
makeIntrinsic('textContent', (name) => {
|
|
215
|
-
return {
|
|
216
|
-
parse: (exp, ctx) => {
|
|
217
|
-
const { sourceFile } = ctx;
|
|
218
|
-
const layerNameArg = exp.arguments?.[0];
|
|
219
|
-
(0, compiler_1.assertIsStringLiteral)(layerNameArg, sourceFile, `${name} takes a single argument which is the Figma layer name`);
|
|
220
|
-
return {
|
|
221
|
-
kind: IntrinsicKind.TextContent,
|
|
222
|
-
args: {
|
|
223
|
-
layer: (0, compiler_1.stripQuotes)(layerNameArg),
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
});
|
|
229
|
-
/**
|
|
230
|
-
* Parses a call expression to an intrinsic
|
|
231
|
-
*
|
|
232
|
-
* @param exp Expression to parse
|
|
233
|
-
* @param parserContext parser context
|
|
234
|
-
* @returns
|
|
235
|
-
*/
|
|
236
|
-
function parseIntrinsic(exp, parserContext) {
|
|
237
|
-
for (const key in Intrinsics) {
|
|
238
|
-
if (Intrinsics[key].match(exp)) {
|
|
239
|
-
return Intrinsics[key].parse(exp, parserContext);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
throw new parser_1.ParserError(`Unknown intrinsic: ${exp.getText()}`, {
|
|
243
|
-
node: exp,
|
|
244
|
-
sourceFile: parserContext.sourceFile,
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
exports.parseIntrinsic = parseIntrinsic;
|
|
248
|
-
/**
|
|
249
|
-
* Replace newlines in enum values with \\n so that we don't output
|
|
250
|
-
* broken JS with newlines inside the string
|
|
251
|
-
*/
|
|
252
|
-
function replaceNewlines(str) {
|
|
253
|
-
return str.toString().replaceAll('\n', '\\n').replaceAll("'", "\\'");
|
|
254
|
-
}
|
|
255
|
-
function valueMappingToString(valueMapping, childLayer) {
|
|
256
|
-
// For enums (and booleans with a valueMapping provided), convert the
|
|
257
|
-
// value mapping to an object.
|
|
258
|
-
return ('{\n' +
|
|
259
|
-
Object.entries(valueMapping)
|
|
260
|
-
.map(([key, value]) => {
|
|
261
|
-
if (typeof value === 'boolean' ||
|
|
262
|
-
typeof value === 'number' ||
|
|
263
|
-
typeof value === 'undefined') {
|
|
264
|
-
return `"${key}": ${value}`;
|
|
265
|
-
}
|
|
266
|
-
if (typeof value === 'string') {
|
|
267
|
-
return `"${key}": '${replaceNewlines(value)}'`;
|
|
268
|
-
}
|
|
269
|
-
if ('kind' in value) {
|
|
270
|
-
// Mappings can be nested, e.g. an enum value can be figma.instance(...)
|
|
271
|
-
return `"${key}": ${intrinsicToString(value, childLayer)}`;
|
|
272
|
-
}
|
|
273
|
-
const v = replaceNewlines(value.value);
|
|
274
|
-
switch (value.type) {
|
|
275
|
-
case 'function':
|
|
276
|
-
return `"${key}": _fcc_function('${v}')`;
|
|
277
|
-
case 'identifier':
|
|
278
|
-
return `"${key}": _fcc_identifier('${v}')`;
|
|
279
|
-
case 'object':
|
|
280
|
-
return `"${key}": _fcc_object('${v}')`;
|
|
281
|
-
case 'template-string':
|
|
282
|
-
return `"${key}": _fcc_templateString('${v}')`;
|
|
283
|
-
case 'jsx-element':
|
|
284
|
-
return `"${key}": _fcc_jsxElement('${v}')`;
|
|
285
|
-
default:
|
|
286
|
-
throw new parser_1.InternalError(`Unknown helper type: ${value}`);
|
|
287
|
-
}
|
|
288
|
-
})
|
|
289
|
-
.join(',\n') +
|
|
290
|
-
'}');
|
|
291
|
-
}
|
|
292
|
-
exports.valueMappingToString = valueMappingToString;
|
|
293
|
-
function intrinsicToString({ kind, args }, childLayer) {
|
|
294
|
-
const selector = childLayer ?? `figma.currentLayer`;
|
|
295
|
-
switch (kind) {
|
|
296
|
-
case IntrinsicKind.String:
|
|
297
|
-
case IntrinsicKind.Instance: {
|
|
298
|
-
// Outputs:
|
|
299
|
-
// `const propName = figma.properties.string('propName')`, or
|
|
300
|
-
// `const propName = figma.properties.boolean('propName')`, or
|
|
301
|
-
// `const propName = figma.properties.instance('propName')`
|
|
302
|
-
return `${selector}.__properties__.${kind}('${args.figmaPropName}')`;
|
|
303
|
-
}
|
|
304
|
-
case IntrinsicKind.Boolean: {
|
|
305
|
-
if (args.valueMapping) {
|
|
306
|
-
const mappingString = valueMappingToString(args.valueMapping, childLayer);
|
|
307
|
-
// Outputs: `const propName = figma.properties.boolean('propName', { ... mapping object from above ... })`
|
|
308
|
-
return `${selector}.__properties__.boolean('${args.figmaPropName}', ${mappingString})`;
|
|
309
|
-
}
|
|
310
|
-
return `${selector}.__properties__.boolean('${args.figmaPropName}')`;
|
|
311
|
-
}
|
|
312
|
-
case IntrinsicKind.Enum: {
|
|
313
|
-
const mappingString = valueMappingToString(args.valueMapping, childLayer);
|
|
314
|
-
// Outputs: `const propName = figma.properties.enum('propName', { ... mapping object from above ... })`
|
|
315
|
-
return `${selector}.__properties__.enum('${args.figmaPropName}', ${mappingString})`;
|
|
316
|
-
}
|
|
317
|
-
case IntrinsicKind.Children: {
|
|
318
|
-
// Outputs: `const propName = figma.properties.children(["Layer 1", "Layer 2"])`
|
|
319
|
-
return `${selector}.__properties__.children([${args.layers.map((layerName) => `"${layerName}"`).join(',')}])`;
|
|
320
|
-
}
|
|
321
|
-
case IntrinsicKind.ClassName: {
|
|
322
|
-
// Outputs: `const propName = ['btn-base', figma.currentLayer.__properties__.enum('Size, { Large: 'btn-large' })].join(" ")`
|
|
323
|
-
return `[${args.className.map((className) => (typeof className === 'string' ? `"${className}"` : `${intrinsicToString(className, childLayer)}`)).join(', ')}].filter(v => !!v).join(' ')`;
|
|
324
|
-
}
|
|
325
|
-
case IntrinsicKind.TextContent: {
|
|
326
|
-
return `${selector}.__findChildWithCriteria__({ name: '${args.layer}', type: "TEXT" }).__render__()`;
|
|
327
|
-
}
|
|
328
|
-
case IntrinsicKind.NestedProps: {
|
|
329
|
-
throw new parser_1.ParserError(`Deeply nested props should be expressed on the root level by passing the name of the inner layer`);
|
|
330
|
-
}
|
|
331
|
-
default:
|
|
332
|
-
throw new parser_1.InternalError(`Unknown intrinsic: ${kind}`);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
exports.intrinsicToString = intrinsicToString;
|
|
336
|
-
function expressionToFccEnumValue(valueNode, sourceFile) {
|
|
337
|
-
if (ts.isParenthesizedExpression(valueNode)) {
|
|
338
|
-
return expressionToFccEnumValue(valueNode.expression, sourceFile);
|
|
339
|
-
}
|
|
340
|
-
if (ts.isJsxElement(valueNode) || ts.isJsxSelfClosingElement(valueNode)) {
|
|
341
|
-
return (0, parser_template_helpers_1._fcc_jsxElement)(valueNode.getText());
|
|
342
|
-
}
|
|
343
|
-
if (ts.isArrowFunction(valueNode) || ts.isFunctionExpression(valueNode)) {
|
|
344
|
-
return (0, parser_template_helpers_1._fcc_function)(valueNode.getText());
|
|
345
|
-
}
|
|
346
|
-
if (ts.isObjectLiteralExpression(valueNode)) {
|
|
347
|
-
return (0, parser_template_helpers_1._fcc_object)(valueNode.getText());
|
|
348
|
-
}
|
|
349
|
-
if (ts.isTemplateLiteral(valueNode)) {
|
|
350
|
-
const str = valueNode.getText().replaceAll('`', '');
|
|
351
|
-
return (0, parser_template_helpers_1._fcc_templateString)(str);
|
|
352
|
-
}
|
|
353
|
-
if (ts.isPropertyAccessExpression(valueNode)) {
|
|
354
|
-
return (0, parser_template_helpers_1._fcc_identifier)(valueNode.getText());
|
|
355
|
-
}
|
|
356
|
-
// Fall back to the default conversion in `convertObjectLiteralToJs`
|
|
357
|
-
return undefined;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Parses the `props` field in a `figma.connect()` call, returning a mapping of
|
|
361
|
-
* prop names to their respective intrinsic types
|
|
362
|
-
*
|
|
363
|
-
* @param objectLiteral An object literal expression
|
|
364
|
-
* @param parserContext Parser context
|
|
365
|
-
* @returns
|
|
366
|
-
*/
|
|
367
|
-
function parsePropsObject(objectLiteral, parserContext) {
|
|
368
|
-
const { sourceFile, checker } = parserContext;
|
|
369
|
-
return (0, compiler_2.convertObjectLiteralToJs)(objectLiteral, sourceFile, checker, (valueNode) => {
|
|
370
|
-
if (ts.isCallExpression(valueNode)) {
|
|
371
|
-
return parseIntrinsic(valueNode, parserContext);
|
|
372
|
-
}
|
|
373
|
-
return expressionToFccEnumValue(valueNode, sourceFile);
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
exports.parsePropsObject = parsePropsObject;
|
|
377
|
-
//# sourceMappingURL=intrinsics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intrinsics.js","sourceRoot":"","sources":["../../src/common/intrinsics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,4CAA2E;AAC3E,qDAI+B;AAC/B,qDAAiE;AACjE,qDAAwE;AAExE,8EAOyC;AAE5B,QAAA,UAAU,GAAG,OAAO,CAAA;AACpB,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAA;AAEzD,IAAY,aASX;AATD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,6CAA4B,CAAA;IAC5B,wCAAuB,CAAA;IACvB,6CAA4B,CAAA;AAC9B,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB;AA8ED,MAAM,UAAU,GAKZ,EAAE,CAAA;AAEN;;;;;;;;;GASG;AACH,SAAS,aAAa,CACpB,aAAgB,EAChB,GAA0B;IAE1B,MAAM,IAAI,GAAG,GAAG,kBAAU,IAAI,aAAa,EAAE,CAAA;IAC7C,UAAU,CAAC,IAAI,CAAC,GAAG;QACjB,KAAK,EAAE,CAAC,GAAsB,EAAE,EAAE;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,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gB,CAC9B,aAAyC,EACzC,aAA4B;IAE5B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,aAAa,CAAA;IAC7C,OAAO,IAAA,mCAAwB,EAAC,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE;QAChF,IAAI,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC;YACnC,OAAO,cAAc,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;QACjD,CAAC;QACD,OAAO,wBAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IACxD,CAAC,CAAiB,CAAA;AACpB,CAAC;AAXD,4CAWC"}
|
package/dist/common/project.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
2
|
-
export interface CodeConnectConfig {
|
|
3
|
-
/**
|
|
4
|
-
* Specify glob patterns for files (relative to the project root) to be
|
|
5
|
-
* included when looking for source files. If not specified, all files
|
|
6
|
-
* (except any specified in `exclude`) will be included.
|
|
7
|
-
*/
|
|
8
|
-
include?: string[];
|
|
9
|
-
/**
|
|
10
|
-
* Specify glob patterns for files (relative to the project root) to be
|
|
11
|
-
* excluded when looking for source files. If not specified, only
|
|
12
|
-
* `node_modules` will be excluded.
|
|
13
|
-
*/
|
|
14
|
-
exclude?: string[];
|
|
15
|
-
/**
|
|
16
|
-
* Optional object of substitutions applied to document URLs (in the format {
|
|
17
|
-
* fromString, toString }) for testing (e.g. remapping a production URL to a
|
|
18
|
-
* staging URL). Not publicly documented.
|
|
19
|
-
*/
|
|
20
|
-
documentUrlSubstitutions?: Record<string, string>;
|
|
21
|
-
/**
|
|
22
|
-
* React specific configuration
|
|
23
|
-
*/
|
|
24
|
-
react?: {
|
|
25
|
-
/**
|
|
26
|
-
* Maps imports from their path on disk to the specified path.
|
|
27
|
-
* This will rewrite the imports in generated code examples, so it works with
|
|
28
|
-
* relative imports such as `import { Button } from "./"`.
|
|
29
|
-
*
|
|
30
|
-
* Example: { "src/components/*": "@ui/components" }
|
|
31
|
-
* Would rewrite imports for components located in `src/components` to `@ui/components` in
|
|
32
|
-
* generated code examples.
|
|
33
|
-
* `import { Button } from "./"` -> `import { Button } from "@ui/components/Button"`
|
|
34
|
-
*/
|
|
35
|
-
importPaths?: Record<string, string>;
|
|
36
|
-
/**
|
|
37
|
-
* For import resolution - this is a temporary solution to support projects that use
|
|
38
|
-
* pnpm workspaces, as the compiler doesn't seem to be able to resolve imports when
|
|
39
|
-
* the package in node_modules is a symlink. Need to look into this more and find a
|
|
40
|
-
* better solution.
|
|
41
|
-
*/
|
|
42
|
-
paths?: Record<string, string[]>;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Storybook specific configuration
|
|
46
|
-
*/
|
|
47
|
-
storybook?: {
|
|
48
|
-
/**
|
|
49
|
-
* The URL of the Storybook instance for the project
|
|
50
|
-
*/
|
|
51
|
-
url: string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export declare function getGitRemoteURL(repoPath: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* Finds the URL of a remote file
|
|
57
|
-
* @param filePath absolute file path on disk
|
|
58
|
-
* @param repoURL remote URL
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
export declare function getRemoteFileUrl(filePath: string, repoURL?: string): string;
|
|
62
|
-
export declare function getStorybookUrl(filePath: string, storybookUrl: string): string;
|
|
63
|
-
export interface ProjectInfo {
|
|
64
|
-
/**
|
|
65
|
-
* Absolute path of the project directory
|
|
66
|
-
*/
|
|
67
|
-
absPath: string;
|
|
68
|
-
/**
|
|
69
|
-
* An array of all tsx files in the project
|
|
70
|
-
*/
|
|
71
|
-
files: string[];
|
|
72
|
-
/**
|
|
73
|
-
* The git remote URL of the project
|
|
74
|
-
*/
|
|
75
|
-
remoteUrl: string;
|
|
76
|
-
/**
|
|
77
|
-
* The parsed Code Connect config file
|
|
78
|
-
*/
|
|
79
|
-
config?: CodeConnectConfig;
|
|
80
|
-
/**
|
|
81
|
-
* TS program containing all tsx files in the project
|
|
82
|
-
*/
|
|
83
|
-
tsProgram: ts.Program;
|
|
84
|
-
}
|
|
85
|
-
export declare function resolveImportPath(filePath: string, config: CodeConnectConfig): string | null;
|
|
86
|
-
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjD;;OAEG;IACH,KAAK,CAAC,EAAE;QACN;;;;;;;;;WASG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACpC;;;;;WAKG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;KACjC,CAAA;IACD;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;CACF;AAqBD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,UAW/C;AAkBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAqBlE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAkBrE;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B;;OAEG;IACH,SAAS,EAAE,EAAE,CAAC,OAAO,CAAA;CACtB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA0B5F"}
|
package/dist/common/project.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
getGitRemoteURL: function() {
|
|
13
|
-
return getGitRemoteURL;
|
|
14
|
-
},
|
|
15
|
-
getRemoteFileUrl: function() {
|
|
16
|
-
return getRemoteFileUrl;
|
|
17
|
-
},
|
|
18
|
-
getStorybookUrl: function() {
|
|
19
|
-
return getStorybookUrl;
|
|
20
|
-
},
|
|
21
|
-
resolveImportPath: function() {
|
|
22
|
-
return resolveImportPath;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const _child_process = require("child_process");
|
|
26
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
27
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
28
|
-
function _interop_require_default(obj) {
|
|
29
|
-
return obj && obj.__esModule ? obj : {
|
|
30
|
-
default: obj
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const DEFAULT_CONFIG_FILE_NAME = 'figma.config.json';
|
|
34
|
-
function parseConfig(configFilePath) {
|
|
35
|
-
if (!_fs.default.existsSync(configFilePath)) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
const rawData = _fs.default.readFileSync(configFilePath, 'utf-8');
|
|
40
|
-
const config = JSON.parse(rawData);
|
|
41
|
-
return config;
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.error('Error parsing config file:', error);
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function getGitRemoteURL(repoPath) {
|
|
48
|
-
try {
|
|
49
|
-
const spawn = (0, _child_process.spawnSync)('git', [
|
|
50
|
-
'config',
|
|
51
|
-
'--get',
|
|
52
|
-
'remote.origin.url'
|
|
53
|
-
], {
|
|
54
|
-
cwd: repoPath
|
|
55
|
-
});
|
|
56
|
-
const output = spawn.stdout;
|
|
57
|
-
return (output || '').toString().trim();
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error('Error getting git remote URL:', error);
|
|
60
|
-
return '';
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Uses `git rev-parse` to find absolute path to the root of the git repository
|
|
65
|
-
*/ function getGitRepoAbsolutePath(filePath) {
|
|
66
|
-
try {
|
|
67
|
-
const spawn = (0, _child_process.spawnSync)('git', [
|
|
68
|
-
'rev-parse',
|
|
69
|
-
'--show-toplevel'
|
|
70
|
-
], {
|
|
71
|
-
cwd: _path.default.dirname(filePath)
|
|
72
|
-
});
|
|
73
|
-
const output = spawn.stdout;
|
|
74
|
-
return (output || '').toString().trim();
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error('Error running `git rev-parse`:', error);
|
|
77
|
-
return '';
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function getRemoteFileUrl(filePath, repoURL) {
|
|
81
|
-
if (!repoURL) {
|
|
82
|
-
return '';
|
|
83
|
-
}
|
|
84
|
-
let url = repoURL.trim();
|
|
85
|
-
url = url.replace(':', '/');
|
|
86
|
-
url = url.replace('git@', 'https://');
|
|
87
|
-
url = url.replace(/\.git$/, '');
|
|
88
|
-
// the folder of the git repo on disk could be named differently,
|
|
89
|
-
// so we need to find the relative path of the file to the root of the repo
|
|
90
|
-
// and append that to the remote URL
|
|
91
|
-
const repoAbsPath = getGitRepoAbsolutePath(filePath);
|
|
92
|
-
const index = filePath.indexOf(repoAbsPath);
|
|
93
|
-
if (index === -1) {
|
|
94
|
-
return '';
|
|
95
|
-
}
|
|
96
|
-
const relativeFilePath = filePath.substring(index + repoAbsPath.length);
|
|
97
|
-
return `${url}/tree/master${relativeFilePath}`;
|
|
98
|
-
}
|
|
99
|
-
function getStorybookUrl(filePath, storybookUrl) {
|
|
100
|
-
// the folder of the git repo on disk could be named differently,
|
|
101
|
-
// so we need to find the relative path of the file to the root of the repo
|
|
102
|
-
// and append that to the remote URL
|
|
103
|
-
const repoAbsPath = getGitRepoAbsolutePath(filePath);
|
|
104
|
-
const index = filePath.indexOf(repoAbsPath);
|
|
105
|
-
if (index === -1) {
|
|
106
|
-
return '';
|
|
107
|
-
}
|
|
108
|
-
const relativeFilePath = filePath.substring(index + repoAbsPath.length + 1) // +1 to remove the leading slash
|
|
109
|
-
;
|
|
110
|
-
const storybookComponentPath = relativeFilePath.trim().replace(/[\s|_]/g, '-').replace(/\.[jt]sx?$/, '').split('/').join('-');
|
|
111
|
-
return `${storybookUrl}/?path=/docs/${storybookComponentPath}`;
|
|
112
|
-
}
|
|
113
|
-
function resolveImportPath(filePath, config) {
|
|
114
|
-
function isMatch(patternParts, pathParts) {
|
|
115
|
-
for(let i = 0; i < patternParts.length; i++){
|
|
116
|
-
if (patternParts[i] !== '*' && patternParts[i] !== pathParts[i]) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
for (const [key, value] of Object.entries(config.react?.importPaths || {})){
|
|
123
|
-
// Do a partial match from the end of the path
|
|
124
|
-
const patternParts = key.split('/').reverse();
|
|
125
|
-
const pathParts = filePath.split('/').reverse();
|
|
126
|
-
if (pathParts.length < patternParts.length) {
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
// If the mapped path ends with a wildcard we want to keep the filename in
|
|
130
|
-
// the final path (for non-index imports)
|
|
131
|
-
if (isMatch(patternParts, pathParts)) {
|
|
132
|
-
return value.endsWith('*') ? `${value.slice(0, -1)}${pathParts[0].split('.')[0]}` : value;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
//# sourceMappingURL=project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["project.ts"],"sourcesContent":["import { spawnSync } from 'child_process'\nimport { globSync } from 'glob'\nimport path from 'path'\nimport fs from 'fs'\nimport ts from 'typescript'\nimport { logger } from './logging'\n\nconst DEFAULT_CONFIG_FILE_NAME = 'figma.config.json'\nexport interface CodeConnectConfig {\n /**\n * Specify glob patterns for files (relative to the project root) to be\n * included when looking for source files. If not specified, all files\n * (except any specified in `exclude`) will be included.\n */\n include?: string[]\n /**\n * Specify glob patterns for files (relative to the project root) to be\n * excluded when looking for source files. If not specified, only\n * `node_modules` will be excluded.\n */\n exclude?: string[]\n /**\n * Optional object of substitutions applied to document URLs (in the format {\n * fromString, toString }) for testing (e.g. remapping a production URL to a\n * staging URL). Not publicly documented.\n */\n documentUrlSubstitutions?: Record<string, string>\n /**\n * React specific configuration\n */\n react?: {\n /**\n * Maps imports from their path on disk to the specified path.\n * This will rewrite the imports in generated code examples, so it works with\n * relative imports such as `import { Button } from \"./\"`.\n *\n * Example: { \"src/components/*\": \"@ui/components\" }\n * Would rewrite imports for components located in `src/components` to `@ui/components` in\n * generated code examples.\n * `import { Button } from \"./\"` -> `import { Button } from \"@ui/components/Button\"`\n */\n importPaths?: Record<string, string>\n /**\n * For import resolution - this is a temporary solution to support projects that use\n * pnpm workspaces, as the compiler doesn't seem to be able to resolve imports when\n * the package in node_modules is a symlink. Need to look into this more and find a\n * better solution.\n */\n paths?: Record<string, string[]>\n }\n /**\n * Storybook specific configuration\n */\n storybook?: {\n /**\n * The URL of the Storybook instance for the project\n */\n url: string\n }\n}\n\ninterface FigmaConfig {\n codeConnect?: CodeConnectConfig\n}\n\nfunction parseConfig(configFilePath: string): FigmaConfig | undefined {\n if (!fs.existsSync(configFilePath)) {\n return undefined\n }\n\n try {\n const rawData = fs.readFileSync(configFilePath, 'utf-8')\n const config = JSON.parse(rawData)\n return config\n } catch (error) {\n console.error('Error parsing config file:', error)\n return undefined\n }\n}\n\nexport function getGitRemoteURL(repoPath: string) {\n try {\n const spawn = spawnSync('git', ['config', '--get', 'remote.origin.url'], {\n cwd: repoPath,\n })\n const output = spawn.stdout\n return (output || '').toString().trim()\n } catch (error) {\n console.error('Error getting git remote URL:', error)\n return ''\n }\n}\n\n/**\n * Uses `git rev-parse` to find absolute path to the root of the git repository\n */\nfunction getGitRepoAbsolutePath(filePath: string) {\n try {\n const spawn = spawnSync('git', ['rev-parse', '--show-toplevel'], {\n cwd: path.dirname(filePath),\n })\n const output = spawn.stdout\n return (output || '').toString().trim()\n } catch (error) {\n console.error('Error running `git rev-parse`:', error)\n return ''\n }\n}\n\n/**\n * Finds the URL of a remote file\n * @param filePath absolute file path on disk\n * @param repoURL remote URL\n * @returns\n */\nexport function getRemoteFileUrl(filePath: string, repoURL?: string) {\n if (!repoURL) {\n return ''\n }\n\n let url = repoURL.trim()\n url = url.replace(':', '/')\n url = url.replace('git@', 'https://')\n url = url.replace(/\\.git$/, '')\n\n // the folder of the git repo on disk could be named differently,\n // so we need to find the relative path of the file to the root of the repo\n // and append that to the remote URL\n const repoAbsPath = getGitRepoAbsolutePath(filePath)\n const index = filePath.indexOf(repoAbsPath)\n if (index === -1) {\n return ''\n }\n const relativeFilePath = filePath.substring(index + repoAbsPath.length)\n\n return `${url}/tree/master${relativeFilePath}`\n}\n\nexport function getStorybookUrl(filePath: string, storybookUrl: string) {\n // the folder of the git repo on disk could be named differently,\n // so we need to find the relative path of the file to the root of the repo\n // and append that to the remote URL\n const repoAbsPath = getGitRepoAbsolutePath(filePath)\n const index = filePath.indexOf(repoAbsPath)\n if (index === -1) {\n return ''\n }\n const relativeFilePath = filePath.substring(index + repoAbsPath.length + 1) // +1 to remove the leading slash\n const storybookComponentPath = relativeFilePath\n .trim()\n .replace(/[\\s|_]/g, '-')\n .replace(/\\.[jt]sx?$/, '')\n .split('/')\n .join('-')\n\n return `${storybookUrl}/?path=/docs/${storybookComponentPath}`\n}\n\nexport interface ProjectInfo {\n /**\n * Absolute path of the project directory\n */\n absPath: string\n /**\n * An array of all tsx files in the project\n */\n files: string[]\n /**\n * The git remote URL of the project\n */\n remoteUrl: string\n /**\n * The parsed Code Connect config file\n */\n config?: CodeConnectConfig\n /**\n * TS program containing all tsx files in the project\n */\n tsProgram: ts.Program\n}\n\nexport function resolveImportPath(filePath: string, config: CodeConnectConfig): string | null {\n function isMatch(patternParts: string[], pathParts: string[]) {\n for (let i = 0; i < patternParts.length; i++) {\n if (patternParts[i] !== '*' && patternParts[i] !== pathParts[i]) {\n return false\n }\n }\n return true\n }\n\n for (const [key, value] of Object.entries(config.react?.importPaths || {})) {\n // Do a partial match from the end of the path\n const patternParts = key.split('/').reverse()\n const pathParts = filePath.split('/').reverse()\n if (pathParts.length < patternParts.length) {\n continue\n }\n\n // If the mapped path ends with a wildcard we want to keep the filename in\n // the final path (for non-index imports)\n if (isMatch(patternParts, pathParts)) {\n return value.endsWith('*') ? `${value.slice(0, -1)}${pathParts[0].split('.')[0]}` : value\n }\n }\n\n return null\n}\n"],"names":["getGitRemoteURL","getRemoteFileUrl","getStorybookUrl","resolveImportPath","DEFAULT_CONFIG_FILE_NAME","parseConfig","configFilePath","fs","existsSync","undefined","rawData","readFileSync","config","JSON","parse","error","console","repoPath","spawn","spawnSync","cwd","output","stdout","toString","trim","getGitRepoAbsolutePath","filePath","path","dirname","repoURL","url","replace","repoAbsPath","index","indexOf","relativeFilePath","substring","length","storybookUrl","storybookComponentPath","split","join","isMatch","patternParts","pathParts","i","key","value","Object","entries","react","importPaths","reverse","endsWith","slice"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,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACrC,OAAOsC,KAAK,EAAEC,eAAe,CAAC,GAAI;QAC1E,8CAA8C;QAC9C,MAAMR,eAAeG,IAAIN,KAAK,CAAC,KAAKY,OAAO;QAC3C,MAAMR,YAAYlB,SAASc,KAAK,CAAC,KAAKY,OAAO;QAC7C,IAAIR,UAAUP,MAAM,GAAGM,aAAaN,MAAM,EAAE;YAC1C;QACF;QAEA,0EAA0E;QAC1E,yCAAyC;QACzC,IAAIK,QAAQC,cAAcC,YAAY;YACpC,OAAOG,MAAMM,QAAQ,CAAC,OAAO,CAAC,EAAEN,MAAMO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAEV,SAAS,CAAC,EAAE,CAACJ,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAGO;QACtF;IACF;IAEA,OAAO;AACT"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FigmaConnectAPI } from './common/api';
|
|
2
|
-
import * as StorybookTypes from './storybook/external';
|
|
3
|
-
import { FigmaConnectClient } from './client/figma_client';
|
|
4
|
-
declare const _client: FigmaConnectClient;
|
|
5
|
-
declare const _figma: FigmaConnectAPI;
|
|
6
|
-
export { _figma as figma, _client as client };
|
|
7
|
-
export default _figma;
|
|
8
|
-
export type StoryParameters<T = {}> = StorybookTypes.StoryParameters<T>;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAkB1D,QAAA,MAAM,OAAO,EAAE,kBAA2B,CAAA;AAC1C,QAAA,MAAM,MAAM,EAAE,eAAuB,CAAA;AAErC,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA;AAC7C,eAAe,MAAM,CAAA;AAErB,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,EAAE,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA"}
|