Expand description
The theme guest→host element-declaration seam (TC.4).
A theme-contributing plugin implements the theme-plugin world: it
imports the theme API (register-element) and exports
register-theme-elements, which the host calls once to drive declaration.
This module holds the bindgen! for that world plus the host-side
conversion from the WIT style-spec to a native
StyleSpec, factored out so it is unit-testable
without a Store (the config_host precedent).
The canonical API is the WIT (theme.wit) — any component-model
language calls register-element directly. A plugin element lands in the
SAME registry builtins use, so themes override it, :customize edits it and
:describe-element documents it with NO host kind-branch.
This closes theme-system.md’s deferred WIT-registration item, which was
designed there and waited for a real consumer.
Functions§
- register_
plugin_ element - The
register-elementhost-service body. Registers into the SAME registry builtins use, owned by the plugin so unload can reverse it. - set_
plugin_ element_ override - TK.5: the
set-element-overridebody — an override for an element this plugin owns, above the theme. - style_
spec_ from_ wit - Convert a WIT
style-specto the nativeStyleSpec.