@sangheepark/figma-ds-mcp 0.2.9 → 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.
- package/dist/tools/pipeline-tools.js +41 -2
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
}
|
package/package.json
CHANGED