Where the React adapter's widget registry stores function values
((props: RenderProps) => unknown), the Lit adapter stores Custom
Element tag names — because every renderer override on the Web
Components side IS a Custom Element. A schema field carrying
.meta({ component: "color-picker" }) is rendered by looking up
the tag name registered against "color-picker" and emitting an
instance of that element with the per-field props attached.
Two scopes are supported:
Global — registerLitWidget(name, tag) writes to a module-level
map shared by every <schema-component> in the document. Matches
the React registerWidget() global default behaviour.
Instance — the widgets property on <schema-component> (a
LitWidgetMap from lit/contexts.ts) overrides the global map
for the wrapped subtree.
Resolution order: instance widgets → global widgets → resolver →
default Custom Element registry. The same order the React adapter
implements; the only difference is the per-step lookup returns a
tag name rather than a function value.
Widget registry for the Lit adapter.
Where the React adapter's widget registry stores function values (
(props: RenderProps) => unknown), the Lit adapter stores Custom Element tag names — because every renderer override on the Web Components side IS a Custom Element. A schema field carrying.meta({ component: "color-picker" })is rendered by looking up the tag name registered against"color-picker"and emitting an instance of that element with the per-field props attached.Two scopes are supported:
registerLitWidget(name, tag)writes to a module-level map shared by every<schema-component>in the document. Matches the ReactregisterWidget()global default behaviour.widgetsproperty on<schema-component>(aLitWidgetMapfromlit/contexts.ts) overrides the global map for the wrapped subtree.Resolution order: instance widgets → global widgets → resolver → default Custom Element registry. The same order the React adapter implements; the only difference is the per-step lookup returns a tag name rather than a function value.