@clovis500c/figma-bridge 1.5.0 → 1.12.0
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/README.md +56 -14
- package/dist/server.js +6557 -983
- package/package.json +9 -3
- package/plugin/code.js +1480 -47
- package/plugin/manifest.json +2 -1
- package/plugin/ui.html +11 -3
package/plugin/manifest.json
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
"api": "1.0.0",
|
|
5
5
|
"main": "code.js",
|
|
6
6
|
"ui": "ui.html",
|
|
7
|
-
"editorType": ["figma"],
|
|
7
|
+
"editorType": ["figma", "figjam", "slides"],
|
|
8
8
|
"documentAccess": "dynamic-page",
|
|
9
|
+
"enablePrivatePluginApi": true,
|
|
9
10
|
"networkAccess": {
|
|
10
11
|
"allowedDomains": ["none"],
|
|
11
12
|
"devAllowedDomains": ["http://localhost:3055", "ws://localhost:3055"],
|
package/plugin/ui.html
CHANGED
|
@@ -473,6 +473,7 @@ const METHODS = {
|
|
|
473
473
|
find: { label: "Find", color: "#64748b", icon: "i-search" },
|
|
474
474
|
get_design_system: { label: "Design system", color: "#64748b", icon: "i-swatch" },
|
|
475
475
|
design_tokens: { label: "Design tokens", color: "#0d99ff", icon: "i-swatch" },
|
|
476
|
+
export_tokens: { label: "Export tokens", color: "#64748b", icon: "i-swatch" },
|
|
476
477
|
audit: { label: "Audit", color: "#16a34a", icon: "i-shield" },
|
|
477
478
|
get_css: { label: "CSS", color: "#64748b", icon: "i-braces" },
|
|
478
479
|
checkpoint: { label: "Checkpoint", color: "#64748b", icon: "i-history" },
|
|
@@ -486,6 +487,9 @@ const METHODS = {
|
|
|
486
487
|
prototype: { label: "Prototype", color: "#8b5cf6", icon: "i-play" },
|
|
487
488
|
annotate: { label: "Annotate", color: "#f59e0b", icon: "i-note" },
|
|
488
489
|
export_tree: { label: "Export code", color: "#64748b", icon: "i-braces" },
|
|
490
|
+
node_info: { label: "Layer names", color: "#64748b", icon: "i-tree" },
|
|
491
|
+
roblox_tree: { label: "Roblox export", color: "#e11d48", icon: "i-braces" },
|
|
492
|
+
roblox_images: { label: "Roblox images", color: "#e11d48", icon: "i-image" },
|
|
489
493
|
ping: { label: "Ping", color: "#64748b", icon: "i-pulse" },
|
|
490
494
|
};
|
|
491
495
|
const methodOf = (m) => METHODS[m] || { label: m, color: "#64748b", icon: "i-pulse" };
|
|
@@ -773,13 +777,16 @@ function summarize(msg) {
|
|
|
773
777
|
return action.charAt(0).toUpperCase() + action.slice(1) + (p.nodeId ? " · " + p.nodeId : "");
|
|
774
778
|
}
|
|
775
779
|
case "export_tree": return p.nodeId ? "Node " + p.nodeId : "Selection";
|
|
780
|
+
case "roblox_tree": return p.nodeId ? "Node " + p.nodeId : "Selection";
|
|
781
|
+
case "roblox_images": return (p.items || []).length + " picture" + ((p.items || []).length === 1 ? "" : "s") + " at " + ((p.items && p.items[0] && p.items[0].scale) || 2) + "×";
|
|
782
|
+
case "node_info": return (p.ids || []).length + " layer" + ((p.ids || []).length === 1 ? "" : "s");
|
|
776
783
|
case "wait_for_selection": return p.message || "Select layers";
|
|
777
784
|
case "build": {
|
|
778
785
|
let count = 0;
|
|
779
786
|
const walk = (n) => { if (!n || typeof n !== "object") return; if (Array.isArray(n)) return n.forEach(walk); count++; if (Array.isArray(n.children)) n.children.forEach(walk); if (Array.isArray(n.variants)) n.variants.forEach(walk); };
|
|
780
787
|
walk(p.spec);
|
|
781
788
|
const root = Array.isArray(p.spec) ? p.spec[0] : p.spec;
|
|
782
|
-
return ((root && root.name) || "Layout") + " · " + count + " layer" + (count === 1 ? "" : "s");
|
|
789
|
+
return (p.label ? p.label + " · " : "") + ((root && root.name) || "Layout") + " · " + count + " layer" + (count === 1 ? "" : "s");
|
|
783
790
|
}
|
|
784
791
|
case "find": {
|
|
785
792
|
const parts = [];
|
|
@@ -798,7 +805,8 @@ function summarize(msg) {
|
|
|
798
805
|
const styles = (st.colors || []).length + (st.text || []).length + (st.effects || []).length;
|
|
799
806
|
return vars + " variable" + (vars === 1 ? "" : "s") + " · " + styles + " style" + (styles === 1 ? "" : "s");
|
|
800
807
|
}
|
|
801
|
-
case "
|
|
808
|
+
case "export_tokens": return p.collections && p.collections.length ? p.collections.join(", ") : "Variables and styles";
|
|
809
|
+
case "audit": return (p.fix || p.fixes ? "Fix · " : p.scope === "design-system" ? "Design system health · " : "") + (p.nodeId ? "Node " + p.nodeId : p.scope === "design-system" && !p.fix ? "Whole file" : "Selection");
|
|
802
810
|
case "get_css": return p.nodeId ? "Node " + p.nodeId : "Selection";
|
|
803
811
|
case "checkpoint": return p.action.charAt(0).toUpperCase() + p.action.slice(1) + (p.label ? " · " + p.label : p.id ? " · " + p.id : "");
|
|
804
812
|
default: return "";
|
|
@@ -1182,7 +1190,7 @@ window.onmessage = (ev) => {
|
|
|
1182
1190
|
} else if (msg.t === "info") {
|
|
1183
1191
|
session = msg.session;
|
|
1184
1192
|
renderSession();
|
|
1185
|
-
send({ t: "info", fileName: session.fileName, page: session.page });
|
|
1193
|
+
send({ t: "info", fileName: session.fileName, page: session.page, pageId: session.pageId });
|
|
1186
1194
|
} else if (msg.t === "res") {
|
|
1187
1195
|
onResult(msg);
|
|
1188
1196
|
} else if (msg.t === "progress") {
|