conductor-figma 3.3.0 → 3.3.1
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/figma-plugin/code.js +5 -4
- package/package.json +1 -1
- package/src/tools/handlers.js +2 -3
- package/src/tools/registry.js +14 -22
package/figma-plugin/code.js
CHANGED
|
@@ -123,8 +123,9 @@ async function executeCommand(cmd, data) {
|
|
|
123
123
|
frame.name = data.name || 'Frame'
|
|
124
124
|
if (data.width) frame.resize(data.width, data.height || data.width)
|
|
125
125
|
frame.layoutMode = data.direction || 'VERTICAL'
|
|
126
|
-
frame.primaryAxisSizingMode = data.primaryAxisSizingMode === 'FILL' ? 'FIXED' : (data.primaryAxisSizingMode
|
|
127
|
-
frame.counterAxisSizingMode = data.counterAxisSizingMode
|
|
126
|
+
frame.primaryAxisSizingMode = data.primaryAxisSizingMode === 'FILL' ? 'FIXED' : (data.primaryAxisSizingMode === 'FIXED' ? 'FIXED' : 'AUTO')
|
|
127
|
+
frame.counterAxisSizingMode = data.counterAxisSizingMode === 'FILL' ? 'FIXED' : (data.counterAxisSizingMode === 'FIXED' ? 'FIXED' : 'AUTO')
|
|
128
|
+
if (data.primaryAxisSizingMode === 'FILL') frame.layoutGrow = 1
|
|
128
129
|
if (data.paddingTop !== undefined) frame.paddingTop = data.paddingTop
|
|
129
130
|
if (data.paddingRight !== undefined) frame.paddingRight = data.paddingRight
|
|
130
131
|
if (data.paddingBottom !== undefined) frame.paddingBottom = data.paddingBottom
|
|
@@ -303,8 +304,8 @@ async function executeCommand(cmd, data) {
|
|
|
303
304
|
if (data.gap !== undefined) node.itemSpacing = data.gap
|
|
304
305
|
if (data.primaryAxisAlignItems) node.primaryAxisAlignItems = data.primaryAxisAlignItems
|
|
305
306
|
if (data.counterAxisAlignItems) node.counterAxisAlignItems = data.counterAxisAlignItems
|
|
306
|
-
if (data.primaryAxisSizingMode) node.primaryAxisSizingMode = data.primaryAxisSizingMode === 'FILL' ? 'FIXED' : data.primaryAxisSizingMode
|
|
307
|
-
if (data.counterAxisSizingMode) node.counterAxisSizingMode = data.counterAxisSizingMode === 'FILL' ? 'FIXED' : data.counterAxisSizingMode
|
|
307
|
+
if (data.primaryAxisSizingMode) node.primaryAxisSizingMode = data.primaryAxisSizingMode === 'FILL' ? 'FIXED' : (data.primaryAxisSizingMode === 'FIXED' ? 'FIXED' : 'AUTO')
|
|
308
|
+
if (data.counterAxisSizingMode) node.counterAxisSizingMode = data.counterAxisSizingMode === 'FILL' ? 'FIXED' : (data.counterAxisSizingMode === 'FIXED' ? 'FIXED' : 'AUTO')
|
|
308
309
|
return { id: node.id, layout: 'set' }
|
|
309
310
|
}
|
|
310
311
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-figma",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "Design-intelligent MCP server for Figma. 201 design-intelligent tools for Figma. Every tool knows typography, spacing, color, accessibility. Not a shape proxy — a design engine.",
|
|
5
5
|
"author": "0xDragoon",
|
|
6
6
|
"license": "MIT",
|
package/src/tools/handlers.js
CHANGED
|
@@ -81,7 +81,7 @@ export async function handleTool(name, args, bridge) {
|
|
|
81
81
|
var rootResult = await bridge.send('create_frame', {
|
|
82
82
|
name: interpretation.industry + ' — ' + interpretation.mood,
|
|
83
83
|
direction: 'VERTICAL', width: W, gap: 0,
|
|
84
|
-
fill: pageColors.bg
|
|
84
|
+
fill: pageColors.bg
|
|
85
85
|
})
|
|
86
86
|
|
|
87
87
|
var totalElements = 1
|
|
@@ -133,8 +133,7 @@ export async function handleTool(name, args, bridge) {
|
|
|
133
133
|
var rootResult = await bridge.send('create_frame', {
|
|
134
134
|
name: (args.type || 'Page').charAt(0).toUpperCase() + (args.type || 'page').slice(1) + ' Page',
|
|
135
135
|
direction: 'VERTICAL', width: pageSpec.width, gap: 0,
|
|
136
|
-
fill: semanticColors(pageSpec.brand, pageSpec.mode || 'dark').bg
|
|
137
|
-
primaryAxisSizingMode: 'HUG'
|
|
136
|
+
fill: semanticColors(pageSpec.brand, pageSpec.mode || 'dark').bg
|
|
138
137
|
})
|
|
139
138
|
// Build each section inside the page
|
|
140
139
|
var totalElements = 1
|
package/src/tools/registry.js
CHANGED
|
@@ -1116,6 +1116,18 @@ const EFFECTS = {
|
|
|
1116
1116
|
}, 'effects'),
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
|
+
// ═══ DESIGN FROM PROMPT (2) ═══
|
|
1120
|
+
const INTERPRET = {
|
|
1121
|
+
design_from_prompt: tool('design_from_prompt', 'Takes any natural language description and generates a complete Figma design. Analyzes mood (minimal, bold, playful, luxury, corporate, techy, organic, brutalist, editorial), detects industry (fintech, health, saas, ecommerce, etc.), picks appropriate colors, spacing density, shadow depth, corner radii, and typography. Then composes a multi-section design with 30-300+ elements.', {
|
|
1122
|
+
prompt: req('string', 'Natural language description. Examples: "A dark fintech dashboard with metrics and charts", "A playful education landing page with pricing", "A minimal luxury brand site for a candle company called Ember"'),
|
|
1123
|
+
width: opt('number', 'Frame width', 1440),
|
|
1124
|
+
}, 'interpret'),
|
|
1125
|
+
|
|
1126
|
+
interpret_prompt: tool('interpret_prompt', 'Analyzes a design prompt and returns the interpretation without generating anything. Shows what mood, industry, colors, and sections would be used. Good for previewing before generating.', {
|
|
1127
|
+
prompt: req('string', 'Design description to analyze'),
|
|
1128
|
+
}, 'interpret'),
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1119
1131
|
// ═══ ASSEMBLE ALL TOOLS ═══
|
|
1120
1132
|
export const ALL_TOOLS = {
|
|
1121
1133
|
...CREATE, ...MODIFY, ...VECTOR, ...READ,
|
|
@@ -1123,6 +1135,7 @@ export const ALL_TOOLS = {
|
|
|
1123
1135
|
...BATCH, ...DESIGN_SYSTEM, ...RESPONSIVE,
|
|
1124
1136
|
...TYPOGRAPHY, ...COLOR, ...PROTOTYPE,
|
|
1125
1137
|
...PAGE, ...LIBRARY, ...ANNOTATION, ...EFFECTS,
|
|
1138
|
+
...INTERPRET,
|
|
1126
1139
|
}
|
|
1127
1140
|
|
|
1128
1141
|
export const TOOL_LIST = Object.values(ALL_TOOLS)
|
|
@@ -1146,29 +1159,8 @@ export const CATEGORIES = {
|
|
|
1146
1159
|
library: Object.keys(LIBRARY),
|
|
1147
1160
|
annotation: Object.keys(ANNOTATION),
|
|
1148
1161
|
effects: Object.keys(EFFECTS),
|
|
1162
|
+
interpret: Object.keys(INTERPRET),
|
|
1149
1163
|
}
|
|
1150
1164
|
|
|
1151
1165
|
export function getTool(name) { return ALL_TOOLS[name] || null }
|
|
1152
1166
|
export function getToolsByCategory(cat) { return CATEGORIES[cat] || [] }
|
|
1153
|
-
|
|
1154
|
-
// ═══ DESIGN FROM PROMPT (1) ═══
|
|
1155
|
-
const INTERPRET = {
|
|
1156
|
-
design_from_prompt: tool('design_from_prompt', 'Takes any natural language description and generates a complete Figma design. Analyzes mood (minimal, bold, playful, luxury, corporate, techy, organic, brutalist, editorial), detects industry (fintech, health, saas, ecommerce, etc.), picks appropriate colors, spacing density, shadow depth, corner radii, and typography. Then composes a multi-section design with 30-300+ elements.', {
|
|
1157
|
-
prompt: req('string', 'Natural language description. Examples: "A dark fintech dashboard with metrics and charts", "A playful education landing page with pricing", "A minimal luxury brand site for a candle company called Ember"'),
|
|
1158
|
-
width: opt('number', 'Frame width', 1440),
|
|
1159
|
-
}, 'interpret'),
|
|
1160
|
-
|
|
1161
|
-
interpret_prompt: tool('interpret_prompt', 'Analyzes a design prompt and returns the interpretation without generating anything. Shows what mood, industry, colors, and sections would be used. Good for previewing before generating.', {
|
|
1162
|
-
prompt: req('string', 'Design description to analyze'),
|
|
1163
|
-
}, 'interpret'),
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
// Update ALL_TOOLS
|
|
1167
|
-
Object.assign(ALL_TOOLS, INTERPRET)
|
|
1168
|
-
|
|
1169
|
-
// Refresh counts
|
|
1170
|
-
const _newList = Object.values(ALL_TOOLS)
|
|
1171
|
-
const _newCount = Object.keys(ALL_TOOLS).length
|
|
1172
|
-
|
|
1173
|
-
// Add category
|
|
1174
|
-
CATEGORIES.interpret = Object.keys(INTERPRET)
|