@atezer/figma-mcp-bridge 1.7.23 → 1.7.24
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/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/core/config.d.ts +1 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +11 -111
- package/dist/core/config.js.map +1 -1
- package/dist/core/plugin-bridge-server.d.ts.map +1 -1
- package/dist/core/plugin-bridge-server.js +1 -2
- package/dist/core/plugin-bridge-server.js.map +1 -1
- package/dist/core/types/index.d.ts +2 -98
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/local-plugin-only.d.ts.map +1 -1
- package/dist/local-plugin-only.js +14 -13
- package/dist/local-plugin-only.js.map +1 -1
- package/f-mcp-plugin/README.md +8 -15
- package/f-mcp-plugin/manifest.json +1 -3
- package/package.json +8 -31
- package/dist/browser/base.d.ts +0 -50
- package/dist/browser/base.d.ts.map +0 -1
- package/dist/browser/base.js +0 -6
- package/dist/browser/base.js.map +0 -1
- package/dist/browser/local.d.ts +0 -81
- package/dist/browser/local.d.ts.map +0 -1
- package/dist/browser/local.js +0 -283
- package/dist/browser/local.js.map +0 -1
- package/dist/core/console-monitor.d.ts +0 -82
- package/dist/core/console-monitor.d.ts.map +0 -1
- package/dist/core/console-monitor.js +0 -428
- package/dist/core/console-monitor.js.map +0 -1
- package/dist/core/design-system-manifest.d.ts +0 -272
- package/dist/core/design-system-manifest.d.ts.map +0 -1
- package/dist/core/design-system-manifest.js +0 -261
- package/dist/core/design-system-manifest.js.map +0 -1
- package/dist/core/enrichment/enrichment-service.d.ts +0 -52
- package/dist/core/enrichment/enrichment-service.d.ts.map +0 -1
- package/dist/core/enrichment/enrichment-service.js +0 -272
- package/dist/core/enrichment/enrichment-service.js.map +0 -1
- package/dist/core/enrichment/index.d.ts +0 -8
- package/dist/core/enrichment/index.d.ts.map +0 -1
- package/dist/core/enrichment/index.js +0 -8
- package/dist/core/enrichment/index.js.map +0 -1
- package/dist/core/enrichment/relationship-mapper.d.ts +0 -106
- package/dist/core/enrichment/relationship-mapper.d.ts.map +0 -1
- package/dist/core/enrichment/relationship-mapper.js +0 -352
- package/dist/core/enrichment/relationship-mapper.js.map +0 -1
- package/dist/core/enrichment/style-resolver.d.ts +0 -80
- package/dist/core/enrichment/style-resolver.d.ts.map +0 -1
- package/dist/core/enrichment/style-resolver.js +0 -327
- package/dist/core/enrichment/style-resolver.js.map +0 -1
- package/dist/core/figma-api.d.ts +0 -137
- package/dist/core/figma-api.d.ts.map +0 -1
- package/dist/core/figma-api.js +0 -274
- package/dist/core/figma-api.js.map +0 -1
- package/dist/core/figma-desktop-connector.d.ts +0 -242
- package/dist/core/figma-desktop-connector.d.ts.map +0 -1
- package/dist/core/figma-desktop-connector.js +0 -1042
- package/dist/core/figma-desktop-connector.js.map +0 -1
- package/dist/core/figma-reconstruction-spec.d.ts +0 -162
- package/dist/core/figma-reconstruction-spec.d.ts.map +0 -1
- package/dist/core/figma-reconstruction-spec.js +0 -387
- package/dist/core/figma-reconstruction-spec.js.map +0 -1
- package/dist/core/figma-tools.d.ts +0 -21
- package/dist/core/figma-tools.d.ts.map +0 -1
- package/dist/core/figma-tools.js +0 -2920
- package/dist/core/figma-tools.js.map +0 -1
- package/dist/core/snippet-injector.d.ts +0 -24
- package/dist/core/snippet-injector.d.ts.map +0 -1
- package/dist/core/snippet-injector.js +0 -97
- package/dist/core/snippet-injector.js.map +0 -1
- package/dist/core/types/enriched.d.ts +0 -213
- package/dist/core/types/enriched.d.ts.map +0 -1
- package/dist/core/types/enriched.js +0 -6
- package/dist/core/types/enriched.js.map +0 -1
- package/dist/local.d.ts +0 -73
- package/dist/local.d.ts.map +0 -1
- package/dist/local.js +0 -2605
- package/dist/local.js.map +0 -1
package/dist/core/figma-api.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Figma REST API Client
|
|
3
|
-
* Handles HTTP calls to Figma's REST API for file data, variables, components, and styles
|
|
4
|
-
*/
|
|
5
|
-
import { createChildLogger } from './logger.js';
|
|
6
|
-
const logger = createChildLogger({ component: 'figma-api' });
|
|
7
|
-
const FIGMA_API_BASE = 'https://api.figma.com/v1';
|
|
8
|
-
/**
|
|
9
|
-
* Extract file key from Figma URL
|
|
10
|
-
* @example https://www.figma.com/design/abc123/My-File -> abc123
|
|
11
|
-
*/
|
|
12
|
-
export function extractFileKey(url) {
|
|
13
|
-
try {
|
|
14
|
-
const urlObj = new URL(url);
|
|
15
|
-
// Match patterns like /design/FILE_KEY or /file/FILE_KEY
|
|
16
|
-
const match = urlObj.pathname.match(/\/(design|file)\/([a-zA-Z0-9]+)/);
|
|
17
|
-
return match ? match[2] : null;
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
logger.error({ error, url }, 'Failed to extract file key from URL');
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Figma API Client
|
|
26
|
-
* Makes authenticated requests to Figma REST API
|
|
27
|
-
*/
|
|
28
|
-
export class FigmaAPI {
|
|
29
|
-
constructor(config) {
|
|
30
|
-
this.accessToken = config.accessToken;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Make authenticated request to Figma API
|
|
34
|
-
*/
|
|
35
|
-
async request(endpoint, options = {}) {
|
|
36
|
-
const url = `${FIGMA_API_BASE}${endpoint}`;
|
|
37
|
-
// Detect token type and use appropriate authentication header
|
|
38
|
-
// OAuth tokens start with 'figu_' and require Authorization: Bearer header
|
|
39
|
-
// Personal Access Tokens use X-Figma-Token header
|
|
40
|
-
const isOAuthToken = this.accessToken.startsWith('figu_');
|
|
41
|
-
// Debug logging to verify token is being used
|
|
42
|
-
const tokenPreview = this.accessToken ? `${this.accessToken.substring(0, 10)}...` : 'NO TOKEN';
|
|
43
|
-
logger.info({
|
|
44
|
-
url,
|
|
45
|
-
tokenPreview,
|
|
46
|
-
hasToken: !!this.accessToken,
|
|
47
|
-
tokenLength: this.accessToken?.length,
|
|
48
|
-
isOAuthToken,
|
|
49
|
-
authMethod: isOAuthToken ? 'Bearer' : 'X-Figma-Token'
|
|
50
|
-
}, 'Making Figma API request with token');
|
|
51
|
-
const headers = {
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
...(options.headers || {}),
|
|
54
|
-
};
|
|
55
|
-
// Add authentication header based on token type
|
|
56
|
-
if (isOAuthToken) {
|
|
57
|
-
headers['Authorization'] = `Bearer ${this.accessToken}`;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
headers['X-Figma-Token'] = this.accessToken;
|
|
61
|
-
}
|
|
62
|
-
const response = await fetch(url, {
|
|
63
|
-
...options,
|
|
64
|
-
headers,
|
|
65
|
-
});
|
|
66
|
-
if (!response.ok) {
|
|
67
|
-
const errorText = await response.text();
|
|
68
|
-
logger.error({ status: response.status, statusText: response.statusText, body: errorText }, 'Figma API request failed');
|
|
69
|
-
throw new Error(`Figma API error (${response.status}): ${errorText}`);
|
|
70
|
-
}
|
|
71
|
-
const data = await response.json();
|
|
72
|
-
return data;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* GET /v1/files/:file_key
|
|
76
|
-
* Get full file data including document tree, components, and styles
|
|
77
|
-
*/
|
|
78
|
-
async getFile(fileKey, options) {
|
|
79
|
-
let endpoint = `/files/${fileKey}`;
|
|
80
|
-
const params = new URLSearchParams();
|
|
81
|
-
if (options?.version)
|
|
82
|
-
params.append('version', options.version);
|
|
83
|
-
if (options?.ids)
|
|
84
|
-
params.append('ids', options.ids.join(','));
|
|
85
|
-
if (options?.depth !== undefined)
|
|
86
|
-
params.append('depth', options.depth.toString());
|
|
87
|
-
if (options?.geometry)
|
|
88
|
-
params.append('geometry', options.geometry);
|
|
89
|
-
if (options?.plugin_data)
|
|
90
|
-
params.append('plugin_data', options.plugin_data);
|
|
91
|
-
if (options?.branch_data)
|
|
92
|
-
params.append('branch_data', 'true');
|
|
93
|
-
if (params.toString()) {
|
|
94
|
-
endpoint += `?${params.toString()}`;
|
|
95
|
-
}
|
|
96
|
-
return this.request(endpoint);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* GET /v1/files/:file_key/variables/local
|
|
100
|
-
* Get local variables (design tokens) from a file
|
|
101
|
-
*/
|
|
102
|
-
async getLocalVariables(fileKey) {
|
|
103
|
-
const response = await this.request(`/files/${fileKey}/variables/local`);
|
|
104
|
-
// Figma API returns {status, error, meta: {variableCollections, variables}}
|
|
105
|
-
// Extract meta to match expected format
|
|
106
|
-
return response.meta || response;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* GET /v1/files/:file_key/variables/published
|
|
110
|
-
* Get published variables from a file
|
|
111
|
-
*/
|
|
112
|
-
async getPublishedVariables(fileKey) {
|
|
113
|
-
const response = await this.request(`/files/${fileKey}/variables/published`);
|
|
114
|
-
// Figma API returns {status, error, meta: {variableCollections, variables}}
|
|
115
|
-
// Extract meta to match expected format
|
|
116
|
-
return response.meta || response;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* GET /v1/files/:file_key/nodes
|
|
120
|
-
* Get specific nodes by ID
|
|
121
|
-
*/
|
|
122
|
-
async getNodes(fileKey, nodeIds, options) {
|
|
123
|
-
let endpoint = `/files/${fileKey}/nodes`;
|
|
124
|
-
const params = new URLSearchParams();
|
|
125
|
-
params.append('ids', nodeIds.join(','));
|
|
126
|
-
if (options?.version)
|
|
127
|
-
params.append('version', options.version);
|
|
128
|
-
if (options?.depth !== undefined)
|
|
129
|
-
params.append('depth', options.depth.toString());
|
|
130
|
-
if (options?.geometry)
|
|
131
|
-
params.append('geometry', options.geometry);
|
|
132
|
-
if (options?.plugin_data)
|
|
133
|
-
params.append('plugin_data', options.plugin_data);
|
|
134
|
-
endpoint += `?${params.toString()}`;
|
|
135
|
-
return this.request(endpoint);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* GET /v1/files/:file_key/styles
|
|
139
|
-
* Get styles from a file
|
|
140
|
-
*/
|
|
141
|
-
async getStyles(fileKey) {
|
|
142
|
-
return this.request(`/files/${fileKey}/styles`);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* GET /v1/files/:file_key/components
|
|
146
|
-
* Get components from a file
|
|
147
|
-
*/
|
|
148
|
-
async getComponents(fileKey) {
|
|
149
|
-
return this.request(`/files/${fileKey}/components`);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* GET /v1/files/:file_key/component_sets
|
|
153
|
-
* Get component sets (variants) from a file
|
|
154
|
-
*/
|
|
155
|
-
async getComponentSets(fileKey) {
|
|
156
|
-
return this.request(`/files/${fileKey}/component_sets`);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* GET /v1/images/:file_key
|
|
160
|
-
* Renders images for specified nodes
|
|
161
|
-
* @param fileKey - The file key
|
|
162
|
-
* @param nodeIds - Node IDs to render (single string or array)
|
|
163
|
-
* @param options - Rendering options
|
|
164
|
-
* @returns Map of node IDs to image URLs (URLs expire after 30 days)
|
|
165
|
-
*/
|
|
166
|
-
async getImages(fileKey, nodeIds, options) {
|
|
167
|
-
const params = new URLSearchParams();
|
|
168
|
-
// Handle single or multiple node IDs
|
|
169
|
-
const ids = Array.isArray(nodeIds) ? nodeIds.join(',') : nodeIds;
|
|
170
|
-
params.append('ids', ids);
|
|
171
|
-
// Add optional parameters
|
|
172
|
-
if (options?.scale !== undefined)
|
|
173
|
-
params.append('scale', options.scale.toString());
|
|
174
|
-
if (options?.format)
|
|
175
|
-
params.append('format', options.format);
|
|
176
|
-
if (options?.svg_outline_text !== undefined)
|
|
177
|
-
params.append('svg_outline_text', options.svg_outline_text.toString());
|
|
178
|
-
if (options?.svg_include_id !== undefined)
|
|
179
|
-
params.append('svg_include_id', options.svg_include_id.toString());
|
|
180
|
-
if (options?.svg_include_node_id !== undefined)
|
|
181
|
-
params.append('svg_include_node_id', options.svg_include_node_id.toString());
|
|
182
|
-
if (options?.svg_simplify_stroke !== undefined)
|
|
183
|
-
params.append('svg_simplify_stroke', options.svg_simplify_stroke.toString());
|
|
184
|
-
if (options?.contents_only !== undefined)
|
|
185
|
-
params.append('contents_only', options.contents_only.toString());
|
|
186
|
-
const endpoint = `/images/${fileKey}?${params.toString()}`;
|
|
187
|
-
logger.info({ fileKey, ids, options }, 'Rendering images');
|
|
188
|
-
return this.request(endpoint);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Helper: Get all design tokens (variables) with formatted output
|
|
192
|
-
*/
|
|
193
|
-
async getAllVariables(fileKey) {
|
|
194
|
-
// Don't catch errors - let them bubble up so proper error messages are shown
|
|
195
|
-
const [local, published] = await Promise.all([
|
|
196
|
-
this.getLocalVariables(fileKey),
|
|
197
|
-
this.getPublishedVariables(fileKey).catch(() => ({ variables: {} })), // Published can fail gracefully
|
|
198
|
-
]);
|
|
199
|
-
return { local, published };
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Helper: Get component metadata with properties
|
|
203
|
-
*/
|
|
204
|
-
async getComponentData(fileKey, nodeId) {
|
|
205
|
-
const response = await this.getNodes(fileKey, [nodeId], { depth: 2 });
|
|
206
|
-
return response.nodes?.[nodeId];
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Helper: Search for components by name
|
|
210
|
-
*/
|
|
211
|
-
async searchComponents(fileKey, searchTerm) {
|
|
212
|
-
const { meta } = await this.getComponents(fileKey);
|
|
213
|
-
const components = meta?.components || [];
|
|
214
|
-
return components.filter((comp) => comp.name?.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Helper function to format variables for display
|
|
219
|
-
*/
|
|
220
|
-
export function formatVariables(variablesData) {
|
|
221
|
-
const collections = Object.entries(variablesData.variableCollections || {}).map(([id, collection]) => ({
|
|
222
|
-
id,
|
|
223
|
-
name: collection.name,
|
|
224
|
-
key: collection.key,
|
|
225
|
-
modes: collection.modes,
|
|
226
|
-
variableIds: collection.variableIds,
|
|
227
|
-
}));
|
|
228
|
-
const variables = Object.entries(variablesData.variables || {}).map(([id, variable]) => ({
|
|
229
|
-
id,
|
|
230
|
-
name: variable.name,
|
|
231
|
-
key: variable.key,
|
|
232
|
-
resolvedType: variable.resolvedType,
|
|
233
|
-
valuesByMode: variable.valuesByMode,
|
|
234
|
-
variableCollectionId: variable.variableCollectionId,
|
|
235
|
-
scopes: variable.scopes,
|
|
236
|
-
description: variable.description,
|
|
237
|
-
}));
|
|
238
|
-
const variablesByType = variables.reduce((acc, v) => {
|
|
239
|
-
acc[v.resolvedType] = (acc[v.resolvedType] || 0) + 1;
|
|
240
|
-
return acc;
|
|
241
|
-
}, {});
|
|
242
|
-
return {
|
|
243
|
-
collections,
|
|
244
|
-
variables,
|
|
245
|
-
summary: {
|
|
246
|
-
totalCollections: collections.length,
|
|
247
|
-
totalVariables: variables.length,
|
|
248
|
-
variablesByType,
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Helper function to format component data for display
|
|
254
|
-
*/
|
|
255
|
-
export function formatComponentData(componentNode) {
|
|
256
|
-
return {
|
|
257
|
-
id: componentNode.id,
|
|
258
|
-
name: componentNode.name,
|
|
259
|
-
type: componentNode.type,
|
|
260
|
-
description: componentNode.description,
|
|
261
|
-
descriptionMarkdown: componentNode.descriptionMarkdown,
|
|
262
|
-
properties: componentNode.componentPropertyDefinitions,
|
|
263
|
-
children: componentNode.children?.map((child) => ({
|
|
264
|
-
id: child.id,
|
|
265
|
-
name: child.name,
|
|
266
|
-
type: child.type,
|
|
267
|
-
})),
|
|
268
|
-
bounds: componentNode.absoluteBoundingBox,
|
|
269
|
-
fills: componentNode.fills,
|
|
270
|
-
strokes: componentNode.strokes,
|
|
271
|
-
effects: componentNode.effects,
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
//# sourceMappingURL=figma-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
|
2
|
-
* Figma Desktop Connector
|
|
3
|
-
*
|
|
4
|
-
* This service connects directly to Figma Desktop's plugin context
|
|
5
|
-
* to execute code with access to the full Figma Plugin API,
|
|
6
|
-
* including variables without Enterprise access.
|
|
7
|
-
*
|
|
8
|
-
* Uses Puppeteer's Worker API to directly access plugin workers,
|
|
9
|
-
* bypassing CDP context enumeration limitations.
|
|
10
|
-
*/
|
|
11
|
-
import { Page } from 'puppeteer-core';
|
|
12
|
-
export declare class FigmaDesktopConnector {
|
|
13
|
-
private page;
|
|
14
|
-
constructor(page: Page);
|
|
15
|
-
/**
|
|
16
|
-
* Initialize connection to Figma Desktop's plugin context
|
|
17
|
-
* No setup needed - Puppeteer handles worker access automatically
|
|
18
|
-
*/
|
|
19
|
-
initialize(): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Execute code in Figma's plugin context where the figma API is available
|
|
22
|
-
* Uses Puppeteer's direct worker access instead of CDP context enumeration
|
|
23
|
-
*/
|
|
24
|
-
executeInPluginContext<T = any>(code: string): Promise<T>;
|
|
25
|
-
/**
|
|
26
|
-
* Get Figma variables from plugin UI window object
|
|
27
|
-
* This bypasses Figma's plugin sandbox security restrictions
|
|
28
|
-
* by accessing data that the plugin posted to its UI iframe
|
|
29
|
-
*/
|
|
30
|
-
getVariablesFromPluginUI(fileKey?: string): Promise<any>;
|
|
31
|
-
/**
|
|
32
|
-
* Get component data by node ID from plugin UI window object
|
|
33
|
-
* This bypasses the REST API bug where descriptions are missing
|
|
34
|
-
* by accessing data from the F-MCP ATezer Bridge plugin via its UI iframe
|
|
35
|
-
*/
|
|
36
|
-
getComponentFromPluginUI(nodeId: string): Promise<any>;
|
|
37
|
-
/**
|
|
38
|
-
* Get Figma variables using the desktop connection
|
|
39
|
-
* This bypasses the Enterprise requirement!
|
|
40
|
-
*/
|
|
41
|
-
getVariables(fileKey?: string): Promise<any>;
|
|
42
|
-
/**
|
|
43
|
-
* Clean up resources (no-op since we use Puppeteer's built-in worker management)
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* Get component data by node ID using Plugin API
|
|
47
|
-
* This bypasses the REST API bug where descriptions are missing
|
|
48
|
-
*/
|
|
49
|
-
getComponentByNodeId(nodeId: string): Promise<any>;
|
|
50
|
-
dispose(): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Find the F-MCP ATezer Bridge plugin UI iframe
|
|
53
|
-
* Returns the frame that has the write operation functions
|
|
54
|
-
* Handles detached frame errors gracefully
|
|
55
|
-
*/
|
|
56
|
-
private findPluginUIFrame;
|
|
57
|
-
/**
|
|
58
|
-
* Execute arbitrary code in Figma's plugin context
|
|
59
|
-
* This is the power tool that can run any Figma Plugin API code
|
|
60
|
-
* Includes retry logic for detached frame errors
|
|
61
|
-
*/
|
|
62
|
-
executeCodeViaUI(code: string, timeout?: number): Promise<any>;
|
|
63
|
-
/**
|
|
64
|
-
* Update a variable's value in a specific mode
|
|
65
|
-
*/
|
|
66
|
-
updateVariable(variableId: string, modeId: string, value: any): Promise<any>;
|
|
67
|
-
/**
|
|
68
|
-
* Create a new variable in a collection
|
|
69
|
-
*/
|
|
70
|
-
createVariable(name: string, collectionId: string, resolvedType: 'COLOR' | 'FLOAT' | 'STRING' | 'BOOLEAN', options?: {
|
|
71
|
-
valuesByMode?: Record<string, any>;
|
|
72
|
-
description?: string;
|
|
73
|
-
scopes?: string[];
|
|
74
|
-
}): Promise<any>;
|
|
75
|
-
/**
|
|
76
|
-
* Create a new variable collection
|
|
77
|
-
*/
|
|
78
|
-
createVariableCollection(name: string, options?: {
|
|
79
|
-
initialModeName?: string;
|
|
80
|
-
additionalModes?: string[];
|
|
81
|
-
}): Promise<any>;
|
|
82
|
-
/**
|
|
83
|
-
* Delete a variable
|
|
84
|
-
*/
|
|
85
|
-
deleteVariable(variableId: string): Promise<any>;
|
|
86
|
-
/**
|
|
87
|
-
* Delete a variable collection
|
|
88
|
-
*/
|
|
89
|
-
deleteVariableCollection(collectionId: string): Promise<any>;
|
|
90
|
-
/**
|
|
91
|
-
* Refresh variables data from Figma
|
|
92
|
-
*/
|
|
93
|
-
refreshVariables(): Promise<any>;
|
|
94
|
-
/**
|
|
95
|
-
* Rename a variable
|
|
96
|
-
*/
|
|
97
|
-
renameVariable(variableId: string, newName: string): Promise<any>;
|
|
98
|
-
/**
|
|
99
|
-
* Add a mode to a variable collection
|
|
100
|
-
*/
|
|
101
|
-
addMode(collectionId: string, modeName: string): Promise<any>;
|
|
102
|
-
/**
|
|
103
|
-
* Rename a mode in a variable collection
|
|
104
|
-
*/
|
|
105
|
-
renameMode(collectionId: string, modeId: string, newName: string): Promise<any>;
|
|
106
|
-
/**
|
|
107
|
-
* Get all local components for design system manifest generation.
|
|
108
|
-
* Defaults to currentPageOnly: true to avoid timeout on large files (dynamic-page).
|
|
109
|
-
*/
|
|
110
|
-
getLocalComponents(opts?: {
|
|
111
|
-
currentPageOnly?: boolean;
|
|
112
|
-
limit?: number;
|
|
113
|
-
}): Promise<{
|
|
114
|
-
success: boolean;
|
|
115
|
-
data?: {
|
|
116
|
-
components: any[];
|
|
117
|
-
componentSets: any[];
|
|
118
|
-
totalComponents: number;
|
|
119
|
-
totalComponentSets: number;
|
|
120
|
-
fileKey: string;
|
|
121
|
-
timestamp: number;
|
|
122
|
-
};
|
|
123
|
-
error?: string;
|
|
124
|
-
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Instantiate a component with overrides
|
|
127
|
-
* Supports both published library components (by key) and local components (by nodeId)
|
|
128
|
-
*/
|
|
129
|
-
instantiateComponent(componentKey: string, options?: {
|
|
130
|
-
nodeId?: string;
|
|
131
|
-
position?: {
|
|
132
|
-
x: number;
|
|
133
|
-
y: number;
|
|
134
|
-
};
|
|
135
|
-
size?: {
|
|
136
|
-
width: number;
|
|
137
|
-
height: number;
|
|
138
|
-
};
|
|
139
|
-
overrides?: Record<string, any>;
|
|
140
|
-
variant?: Record<string, string>;
|
|
141
|
-
parentId?: string;
|
|
142
|
-
}): Promise<{
|
|
143
|
-
success: boolean;
|
|
144
|
-
instance?: {
|
|
145
|
-
id: string;
|
|
146
|
-
name: string;
|
|
147
|
-
x: number;
|
|
148
|
-
y: number;
|
|
149
|
-
width: number;
|
|
150
|
-
height: number;
|
|
151
|
-
};
|
|
152
|
-
error?: string;
|
|
153
|
-
}>;
|
|
154
|
-
/**
|
|
155
|
-
* Set description on a component or style
|
|
156
|
-
*/
|
|
157
|
-
setNodeDescription(nodeId: string, description: string, descriptionMarkdown?: string): Promise<any>;
|
|
158
|
-
/**
|
|
159
|
-
* Add a component property
|
|
160
|
-
*/
|
|
161
|
-
addComponentProperty(nodeId: string, propertyName: string, type: 'BOOLEAN' | 'TEXT' | 'INSTANCE_SWAP' | 'VARIANT', defaultValue: any, options?: {
|
|
162
|
-
preferredValues?: any[];
|
|
163
|
-
}): Promise<any>;
|
|
164
|
-
/**
|
|
165
|
-
* Edit an existing component property
|
|
166
|
-
*/
|
|
167
|
-
editComponentProperty(nodeId: string, propertyName: string, newValue: {
|
|
168
|
-
name?: string;
|
|
169
|
-
defaultValue?: any;
|
|
170
|
-
preferredValues?: any[];
|
|
171
|
-
}): Promise<any>;
|
|
172
|
-
/**
|
|
173
|
-
* Delete a component property
|
|
174
|
-
*/
|
|
175
|
-
deleteComponentProperty(nodeId: string, propertyName: string): Promise<any>;
|
|
176
|
-
/**
|
|
177
|
-
* Resize a node
|
|
178
|
-
*/
|
|
179
|
-
resizeNode(nodeId: string, width: number, height: number, withConstraints?: boolean): Promise<any>;
|
|
180
|
-
/**
|
|
181
|
-
* Move/position a node
|
|
182
|
-
*/
|
|
183
|
-
moveNode(nodeId: string, x: number, y: number): Promise<any>;
|
|
184
|
-
/**
|
|
185
|
-
* Set fills (colors) on a node
|
|
186
|
-
*/
|
|
187
|
-
setNodeFills(nodeId: string, fills: any[]): Promise<any>;
|
|
188
|
-
/**
|
|
189
|
-
* Set strokes on a node
|
|
190
|
-
*/
|
|
191
|
-
setNodeStrokes(nodeId: string, strokes: any[], strokeWeight?: number): Promise<any>;
|
|
192
|
-
/**
|
|
193
|
-
* Set opacity on a node
|
|
194
|
-
*/
|
|
195
|
-
setNodeOpacity(nodeId: string, opacity: number): Promise<any>;
|
|
196
|
-
/**
|
|
197
|
-
* Set corner radius on a node
|
|
198
|
-
*/
|
|
199
|
-
setNodeCornerRadius(nodeId: string, radius: number): Promise<any>;
|
|
200
|
-
/**
|
|
201
|
-
* Clone/duplicate a node
|
|
202
|
-
*/
|
|
203
|
-
cloneNode(nodeId: string): Promise<any>;
|
|
204
|
-
/**
|
|
205
|
-
* Delete a node
|
|
206
|
-
*/
|
|
207
|
-
deleteNode(nodeId: string): Promise<any>;
|
|
208
|
-
/**
|
|
209
|
-
* Rename a node
|
|
210
|
-
*/
|
|
211
|
-
renameNode(nodeId: string, newName: string): Promise<any>;
|
|
212
|
-
/**
|
|
213
|
-
* Set text content on a text node
|
|
214
|
-
*/
|
|
215
|
-
setTextContent(nodeId: string, text: string, options?: {
|
|
216
|
-
fontSize?: number;
|
|
217
|
-
}): Promise<any>;
|
|
218
|
-
/**
|
|
219
|
-
* Create a child node
|
|
220
|
-
*/
|
|
221
|
-
createChildNode(parentId: string, nodeType: 'RECTANGLE' | 'ELLIPSE' | 'FRAME' | 'TEXT' | 'LINE' | 'POLYGON' | 'STAR' | 'VECTOR', properties?: {
|
|
222
|
-
name?: string;
|
|
223
|
-
x?: number;
|
|
224
|
-
y?: number;
|
|
225
|
-
width?: number;
|
|
226
|
-
height?: number;
|
|
227
|
-
fills?: any[];
|
|
228
|
-
text?: string;
|
|
229
|
-
}): Promise<any>;
|
|
230
|
-
/**
|
|
231
|
-
* Capture screenshot via plugin UI (for visual validation)
|
|
232
|
-
*/
|
|
233
|
-
captureScreenshot(nodeId: string | null, options?: {
|
|
234
|
-
format?: string;
|
|
235
|
-
scale?: number;
|
|
236
|
-
}): Promise<any>;
|
|
237
|
-
/**
|
|
238
|
-
* Set instance properties via plugin UI
|
|
239
|
-
*/
|
|
240
|
-
setInstanceProperties(nodeId: string, properties: Record<string, unknown>): Promise<any>;
|
|
241
|
-
}
|
|
242
|
-
//# sourceMappingURL=figma-desktop-connector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figma-desktop-connector.d.ts","sourceRoot":"","sources":["../../src/core/figma-desktop-connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtC,qBAAa,qBAAqB;IAChC,OAAO,CAAC,IAAI,CAAO;gBAEP,IAAI,EAAE,IAAI;IAItB;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;;OAGG;IACG,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAkE/D;;;;OAIG;IACG,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IA2F9D;;;;OAIG;IACG,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmF5D;;;OAGG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAkFlD;;OAEG;IAEH;;;OAGG;IACG,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAwGlD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;;;OAIG;YACW,iBAAiB;IAoC/B;;;;OAIG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,GAAG,CAAC;IA6E1E;;OAEG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IA2BlF;;OAEG;IACG,cAAc,CAClB,I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