openfig-cli 0.3.20 → 0.3.21

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.
@@ -1102,6 +1102,22 @@ function renderInstance(deck, node) {
1102
1102
  const symbol = deck.getNode(symNid);
1103
1103
  if (!symbol) return renderPlaceholder(deck, node);
1104
1104
 
1105
+ // Figma-parity: reject instances of symbols with invalid variant specs.
1106
+ // Figma Desktop silently shows blank slides for these. We match that behavior
1107
+ // deliberately so our preview catches invalid decks instead of hiding them.
1108
+ // Root cause: older tooling created SYMBOL variants with names (e.g.
1109
+ // "Size=Wide") that don't exist in the component set's variantPropSpecs.
1110
+ if (symbol.componentKey && symbol.variantPropSpecs) {
1111
+ const specValues = new Set(symbol.variantPropSpecs.map(s => s.value));
1112
+ const nameValues = (symbol.name || '').split(', ').map(p => p.split('=')[1]).filter(Boolean);
1113
+ const invalid = nameValues.some(v => !specValues.has(v));
1114
+ if (invalid) {
1115
+ const nid = `${node.guid.sessionID}:${node.guid.localID}`;
1116
+ console.warn(`⚠️ Skipping INSTANCE ${nid}: symbol ${symNid} "${symbol.name}" has invalid variant specs — Figma would show blank`);
1117
+ return renderPlaceholder(deck, node);
1118
+ }
1119
+ }
1120
+
1105
1121
  // Temporarily apply symbolOverrides so rendered content reflects overrides.
1106
1122
  // Override guidPaths may reference library-original IDs (e.g. 100:656) rather
1107
1123
  // than local node IDs (e.g. 1:1131). Nodes expose their library ID via the
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": "0.2",
3
3
  "name": "openfig",
4
- "version": "0.3.20",
4
+ "version": "0.3.21",
5
5
  "description": "Open-source tools for Figma file parsing and rendering",
6
6
  "author": {
7
7
  "name": "OpenFig Contributors"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfig-cli",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "OpenFig — Open-source tools for Figma file parsing and rendering",
5
5
  "type": "module",
6
6
  "bin": {