figma-relai 0.6.1 → 0.6.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/dist/{chunk-Y72VGT6Z.js → chunk-65NUOFLB.js} +27 -3
- package/dist/chunk-65NUOFLB.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{manifest-CB3QVMR6.js → manifest-LKF467MU.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-Y72VGT6Z.js.map +0 -1
- /package/dist/{manifest-CB3QVMR6.js.map → manifest-LKF467MU.js.map} +0 -0
|
@@ -15,7 +15,7 @@ function createServer() {
|
|
|
15
15
|
return new McpServer(
|
|
16
16
|
{
|
|
17
17
|
name: "Relai",
|
|
18
|
-
version: "0.6.
|
|
18
|
+
version: "0.6.2"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
instructions: `
|
|
@@ -165,6 +165,7 @@ var FIGMA_COMMANDS = [
|
|
|
165
165
|
"audit_token_debt",
|
|
166
166
|
"audit_property_bindings",
|
|
167
167
|
"audit_node_tokens",
|
|
168
|
+
"audit_dimension_stability",
|
|
168
169
|
"snapshot_variables",
|
|
169
170
|
"list_rulesets",
|
|
170
171
|
"save_ruleset",
|
|
@@ -3720,7 +3721,7 @@ function register21(server, sendCommand) {
|
|
|
3720
3721
|
);
|
|
3721
3722
|
server.tool(
|
|
3722
3723
|
"validate_design_rules",
|
|
3723
|
-
"Run design quality rules on a node: token coverage, token scopes, cross-component token borrowing, auto-layout usage, naming conventions, and accessibility basics. Use after modifications
|
|
3724
|
+
"Run design quality rules on a node: token coverage, token scopes, cross-component token borrowing, dimension stability across states, fixed-size text that would clip, auto-layout usage, naming conventions, and accessibility basics. Use after modifications and before calling a component done \u2014 these rules catch the faults that look perfect on the canvas and surface weeks later in someone else's file. Returns pass/fail for each rule with fix suggestions.",
|
|
3724
3725
|
{
|
|
3725
3726
|
nodeId: z22.string().optional().describe("Root node to validate (default: current selection)"),
|
|
3726
3727
|
platform: z22.enum(["desktop", "mobile"]).optional().describe("Target-size profile for the touch rule: desktop 24px (default), mobile 44px")
|
|
@@ -3852,6 +3853,29 @@ function register21(server, sendCommand) {
|
|
|
3852
3853
|
}
|
|
3853
3854
|
} catch {
|
|
3854
3855
|
}
|
|
3856
|
+
try {
|
|
3857
|
+
const dim = await sendCommand("audit_dimension_stability", { nodeId: targetId }, 6e4);
|
|
3858
|
+
if (dim && typeof dim.setsScanned === "number") {
|
|
3859
|
+
const jitter = dim.jitter ?? [];
|
|
3860
|
+
results.push({
|
|
3861
|
+
rule: "dimension_stability",
|
|
3862
|
+
passed: (dim.jitterCount ?? 0) === 0,
|
|
3863
|
+
severity: "error",
|
|
3864
|
+
message: jitter.length ? `${dim.jitterCount} state change(s) move the box: ${jitter.slice(0, 2).map((j) => `${j.set} [${j.holding}] ${j.axis} \u2192 ${j.spread}`).join("; ")}${(dim.jitterCount ?? 0) > 2 ? " \u2026" : ""}. Reserve the padding and the line box in every state so only the appearance changes.` : `No state changes the box across ${dim.setsScanned} set(s)`,
|
|
3865
|
+
nodeId: targetId,
|
|
3866
|
+
fix: jitter.length ? { tool: "set_properties", reason: "Give every state the same padding and height; change only the appearance", args: { nodeId: targetId } } : void 0
|
|
3867
|
+
});
|
|
3868
|
+
const fixed = dim.fixedText ?? [];
|
|
3869
|
+
results.push({
|
|
3870
|
+
rule: "text_can_grow",
|
|
3871
|
+
passed: true,
|
|
3872
|
+
severity: "info",
|
|
3873
|
+
message: fixed.length ? `${dim.fixedTextCount} fixed-size text node(s) \u2014 a fixed box clips instead of growing, so check the longest value: ${fixed.slice(0, 3).map((f) => `${f.node} "${f.text}" (${f.box})`).join("; ")}${(dim.fixedTextCount ?? 0) > 3 ? " \u2026" : ""}` : "No fixed-size text inside auto-layout \u2014 every label can grow to its longest value",
|
|
3874
|
+
nodeId: targetId
|
|
3875
|
+
});
|
|
3876
|
+
}
|
|
3877
|
+
} catch {
|
|
3878
|
+
}
|
|
3855
3879
|
const passed = results.filter((r) => r.passed).length;
|
|
3856
3880
|
const failed = results.filter((r) => !r.passed).length;
|
|
3857
3881
|
const data = {
|
|
@@ -4193,4 +4217,4 @@ export {
|
|
|
4193
4217
|
listToolCatalog,
|
|
4194
4218
|
registerPrompts
|
|
4195
4219
|
};
|
|
4196
|
-
//# sourceMappingURL=chunk-
|
|
4220
|
+
//# sourceMappingURL=chunk-65NUOFLB.js.map
|