← Commit history

Publish 1.1.3

Ray ·6f2683b5fc ·2mo ago ·parent 03bdaf6
3 files changed +12−5
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "component-widgets",   "title": "Component Widgets",   "type": "app",-  "version": "1.1.2",+  "version": "1.1.3",   "description": "Reusable, dependency-free web-component widgets to drop into any component or molecule page: <adom-pinout> (datasheet-style pin diagram + synced table), <adom-heatsink-via> (exposed-pad thermal via array, only when the part has an EP), <adom-molecule> (ganged part set + nets), and <adom-chip-thumbnail> (rendered part image). Each is one custom element, self-contained (Shadow DOM, no deps), theme-aware (light + dark), fed by inline JSON or el.data, and all on one lbr-hover cross-highlight bus so a pin hovered in one lights the same pin everywhere. Symbol, footprint, and 3D stay with adom-lbr; the datasheet renders via the native viewer. Installs the widget JS, iframe-embeddable viewers, example data, and an AI skill to ~/.claude/skills/component-widgets. Live reference page renders them all as a readme.html.",   "license": "MIT",   "dependencies": {},
page.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Component Widgets",   "brief": "One home for the reusable, readme-instantiable component/molecule widgets (pinout, heat-sink via, chip thumbnail, molecule) — self-contained web components on the shared adom-lbr hover bus.",-  "version": "1.1.2",+  "version": "1.1.3",   "visibility": "private",   "author": {     "name": "Ray",
skills/component-widgets/widgets/moleculize-widget.js+10−3
@@ -178,15 +178,22 @@     // Read a dropped/selected .kicad_pcb, parse its Edge.Cuts bbox, render the plan.     _loadFile(file) {       if (!file) return;+      const name = file.name || '';+      const fail = (msg) => { this._err = msg; this._data = null; this._render(); };+      // The board outline lives in the .kicad_pcb, not the sibling files. Point the+      // user at the right one rather than parsing a settings/schematic file.+      if (/\.kicad_pro$/i.test(name)) return fail('That is the KiCad project file (settings, no board outline). Drop the board file ' + name.replace(/\.kicad_pro$/i, '.kicad_pcb') + ' instead.');+      if (/\.kicad_sch$/i.test(name)) return fail('That is the schematic. Drop the PCB layout ' + name.replace(/\.kicad_sch$/i, '.kicad_pcb') + ' instead.');+      if (!/\.kicad_pcb$/i.test(name)) return fail('Drop a .kicad_pcb (the KiCad board layout file), not ' + (name || 'that file') + '.');       const rdr = new FileReader();       rdr.onload = () => {         const bb = edgeCutsBBox(String(rdr.result || ''));-        if (!bb || !(bb.w > 0) || !(bb.h > 0)) { this._err = 'No Edge.Cuts outline found in ' + file.name; this._data = null; this._render(); return; }+        if (!bb || !(bb.w > 0) || !(bb.h > 0)) return fail('No Edge.Cuts outline found in ' + name + '. Draw the board outline on the Edge.Cuts layer, then drop it again.');         this._err = null;-        this._data = { name: file.name.replace(/\.kicad_pcb$/i, ''), width_mm: bb.w, height_mm: bb.h, kicad_pcb: file.name };+        this._data = { name: name.replace(/\.kicad_pcb$/i, ''), width_mm: bb.w, height_mm: bb.h, kicad_pcb: name };         this._render();       };-      rdr.onerror = () => { this._err = 'could not read ' + file.name; this._render(); };+      rdr.onerror = () => fail('Could not read ' + name + '.');       rdr.readAsText(file);     }