Widget Registry
!

Not installable via adom-wiki

This app has no published release. adom-wiki pkg install adom/widgets will not work until a maintainer publishes a tarball with install.sh and uninstall.sh.

See the publishing docs for the package.json schema and tarball layout required to ship this app.

Contents

README

markdown

Widget Registry

The reviewed list of widgets any wiki page can render from plain markdown (adom/wiki#152). Only widgets in widgets.json on THIS page render; adding one is an edit someone reads. That list is the entire trust model, so this page stays org-owned.

Using a widget

On its own line in any README.md:

::adom-pinout{src="/ray/stm32f103c8t6/render/pinout.json" layout="dual"}

It renders in place as a sandboxed frame: opaque origin, storage shimmed, connect-src limited to the wiki (plus a backend widget's registered origin). An unregistered tag renders as nothing for readers; pushing a README with one gets a WIDGET_TAG_UNREGISTERED hint.

Data files: pass src as an absolute path on the wiki, usually your own page's render route (/OWNER/SLUG/render/FILE.json). Relative paths resolve against the widget frame's route and will not find your file.

How scripts are served (read this before curling the raw URLs)

Readers' frames never load the script URLs above directly: they load /widget-script/<name>.js, a registry-gated route that serves only reviewed scripts with a JavaScript MIME, read straight from the page repo. So the host page's visibility does not matter, and the raw URL 404ing for anonymous callers is expected: in this file it is the repo pointer the route resolves, not the URL readers fetch.

Registering a widget

Append an entry to widgets.json:

{ "name": "adom-example", "mode": "frontend",
  "script": "https://wiki.adom.inc/OWNER/SLUG/render/widget.js",
  "element": "adom-example", "attrs": ["src"] }
  • name: the markdown tag (slug-safe, max 32 chars)
  • mode: frontend (wiki-served script) or backend (adds origin)
  • script: https URL of the script that defines the custom element
  • element: the dashed custom-element name the script defines
  • attrs: allowlist of attributes the tag may set (escaped, length-capped); anything else in a tag is dropped
  • origin (backend only): the PUBLIC https origin the frame's connect-src widens to; the widget_connect rules apply (no IP literals, loopback, or private TLDs)
  • height: auto (default, frames self-report via readme-height) or a fixed pixel number

Registry caps: 32 widgets, 12 attrs each. A malformed entry is dropped, never breaks rendering.

Current widgets

Five load from adom/component-widgets and take a JSON src; adom-symbol-variants loads from adom/adom-symbol and takes a component page.json src:

tag shows
::adom-pinout{src="..."} interactive pinout diagram
::adom-chip-thumbnail{src="..."} chip render thumbnail
::adom-molecule{src="..."} molecule viewer
::adom-heatsink-via{src="..."} thermal via layout
::adom-symbol-variants{src="..."} alternate schematic-symbol layouts (2-column, square, grouped, chip outline), generated in the browser
::adom-footprint-variants{src="..."} footprint-variant family (baseline, heatsink vias, 300 µm solder balls, rounded pads), parsed live from the page's .kicad_mod files; takes an adom-footprint variants.json src — loads from john/footprint-widgets
::adom-table{src="..."} any JSON array as a filterable, sortable table — generic, not component-specific; columns heading filter facet sort dim mark colorby