You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`updateComponents`|Mergestheprovidedcomponentsintothesurface's component map by `id` — existing components are replaced, others are kept|
42
-
|`updateDataModel`|AppliesaJSONPointerpatchtothesurface's data model (see below)|
40
+
|`surfaceUpdate`|Deliversasurface's components — merges the provided components into the surface'scomponentmapby`id`soexistingcomponentsarereplacedandothersarekept|
41
+
|`dataModelUpdate`|AppliesaJSONPointerpatchtothesurface's data model (see below)|
Thesurface's `dataModel` is synchronized into the render-lib `StateStore` when `surfaceToSpec()` converts the surface to a spec. The conversion sets `state: surface.dataModel` on the produced `Spec`, which initializes the render-lib'sinternal`StateStore`withthesurfacedata. Whencomponentswith`_bindings`updatevalues (e.g., atextfieldchanging), thoseupdatesflowthroughtherender-lib`StateStore`, andeachmutationemitsa`RenderStateChangeEvent`throughtherender-libeventsystem. Thismeansconsumersobservingthe`events`outputon`A2uiSurfaceComponent`seealldatamodelchangesastyped`RenderStateChangeEvent`objectswith`path`, `value`, and`snapshot`fields.
|`get(name)`| Returns the component class for the given type name, or `undefined` if not registered |
42
+
|`getFallback(name)`| Returns the configured fallback renderer for a registered name -- the entry's own `fallback`, the library's default fallback if the entry omits one, or `undefined` if the name isn't registered. |
41
43
|`names()`| Returns an array of all registered type name strings |
Copy file name to clipboardExpand all lines: apps/website/content/docs/render/guides/events.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ const handlers = {
167
167
};
168
168
```
169
169
170
-
This works for handlers passed via `[handlers]` on `<render-spec>`, `provideRender()`, or `ChatComponent`.
170
+
This works for handlers passed via `[handlers]` on `<render-spec>`, `provideRender()`, or other render-enabled components like `ChatComponent` (from `@threadplane/chat`).
The returned `AngularRegistry` object has two methods:
24
+
The returned `AngularRegistry` object has three methods:
25
25
26
26
-`get(name: string)` -- returns the component class for the given type name, or `undefined` if not registered
27
+
-`getFallback(name: string)` -- returns the configured fallback renderer for a registered name -- the entry's own `fallback`, or the library's default fallback if the entry omits one, or `undefined` if the name isn't registered
27
28
-`names()` -- returns an array of all registered type names
When an element's type is not registered, it renders that type's configured fallback if one exists, and otherwise renders nothing. Fallbacks also fill a transient gap during rendering: while an element's state-bound props are still resolving, the library can render a fallback to give visual feedback until the real component is ready. Once the real component mounts, it stays mounted -- later re-renders never revert to the fallback.
40
+
35
41
## The Component Input Contract
36
42
37
43
Every component rendered by `@threadplane/render` receives inputs conforming to the `AngularComponentInputs` interface. Your custom props from the spec are spread as additional inputs alongside the standard ones.
0 commit comments