@sangheepark/figma-ds-mcp 0.2.8 → 0.2.10

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.
@@ -168,12 +168,51 @@ function enrichSpec(traversal, mapping) {
168
168
  node['overrides'] = overrides;
169
169
  }
170
170
  }
171
- // _overrides → overrides에 병합
171
+ // _overrides → overrides에 병합 (property name resolution 포함)
172
172
  if (node._overrides) {
173
173
  const existing = node['overrides'];
174
- node['overrides'] = { ...existing, ...node._overrides };
174
+ const resolved = { ...existing };
175
+ for (const [key, value] of Object.entries(node._overrides)) {
176
+ if (component.properties && key in component.properties) {
177
+ // exact property name match
178
+ resolved[key] = value;
179
+ }
180
+ else if (component.properties) {
181
+ // case-insensitive match
182
+ const ciMatch = Object.keys(component.properties).find(p => p.toLowerCase() === key.toLowerCase());
183
+ if (ciMatch) {
184
+ resolved[ciMatch] = value;
185
+ }
186
+ else if (typeof value === 'string') {
187
+ // TEXT property auto-map (단일 TEXT prop이면 자동 매핑)
188
+ const textProps = Object.entries(component.properties)
189
+ .filter(([, type]) => type === 'TEXT')
190
+ .map(([name]) => name);
191
+ if (textProps.length === 1) {
192
+ resolved[textProps[0]] = value;
193
+ }
194
+ else {
195
+ resolved[key] = value; // 매핑 실패 → 원본 유지
196
+ }
197
+ }
198
+ else {
199
+ resolved[key] = value;
200
+ }
201
+ }
202
+ else {
203
+ resolved[key] = value;
204
+ }
205
+ }
206
+ node['overrides'] = resolved;
175
207
  delete node._overrides;
176
208
  }
209
+ // variant-props → variant string 변환 (빌드 시스템 형식)
210
+ const vp = node['variant-props'];
211
+ if (vp && Object.keys(vp).length > 0) {
212
+ const variantStr = Object.entries(vp).map(([k, v]) => `${k}=${v}`).join(', ');
213
+ node['variant'] = variantStr;
214
+ delete node['variant-props'];
215
+ }
177
216
  delete node._ds;
178
217
  delete node._ds_props;
179
218
  }
@@ -233,6 +272,14 @@ function enrichSpec(traversal, mapping) {
233
272
  if (typeof lh === 'number') {
234
273
  node.style['line-height'] = `${Math.round(lh * 100)}%`;
235
274
  }
275
+ // opacity 정규화: string → number (V11 fix)
276
+ const op = node.style['opacity'];
277
+ if (typeof op === 'string') {
278
+ const parsed = parseFloat(op);
279
+ if (!isNaN(parsed)) {
280
+ node.style['opacity'] = parsed;
281
+ }
282
+ }
236
283
  }
237
284
  // _ds_type 제거 (downstream 미소비 — build 전에 정리)
238
285
  if ('_ds_type' in node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sangheepark/figma-ds-mcp",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "MCP server for Code to Figma Bridge — bridges Claude Code to Figma plugin via WebSocket",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",