Expand description
The surface DATA MODEL and A2UI’s dynamic values: a prop may be a {path}
binding (a JSON Pointer into the model, relative inside a template item)
or a {call, args} client function; resolve_value turns a prop tree
into literals for one pass. Round 1 (docs/round-1-contract.md §1): the
BIND pass of src/dynamic.ts — bind_tree (props resolved along their
schema with DATA props verbatim, styles, recipe props and accessibility
resolved at any depth, falsy visible dropped, $string.<id> through the
surface’s table, row-scoped slots left for bind_row_slot) and
run_action (evaluate, then set, then the event);
fixtures/bind-time.json locks both. The function table
= the core functions (expr::core_function) + the basic catalog’s
and/or/not/required with the core truthiness (0 is TRUE) + the
basic validators and formatters.
Re-exports§
pub use crate::expr::is_binding;pub use crate::expr::is_call;pub use crate::expr::is_dynamic;
Structs§
- Action
Call - A function other than
setthe host must run (openUrl…), args resolved. - Action
Event - An event an action dispatches, its context resolved BEFORE any write.
- Action
Outcome - What a press does (
src/dynamic.ts ActionOutcome). - Resolve
Context - What
resolve_valueneeds.
Functions§
- absolute_
path pathmade absolute against a template scope (/items/3):/a/bstays,b/cjoins the scope, `` (empty) is the scope itself.- bind_
row_ slot - A row-scoped slot cell bound for row
index(src/dynamic.ts bindRowSlot+rowScope).rows_prop= the UNBOUNDrowsvalue: a binding → relative paths read the row at<its pointer>/<index>in the data model (and asetwrites into it); a literal or a call → relative paths read insiderows[index](a relativesetwrites nothing).index= the row’s index inrowsas given, before any local sort. - bind_
section_ header - Round 2 (§4): a List’s
sectionheader bound for sectionindex(src/dynamic.ts bindSectionHeader+sectionScope): relative paths read the LITERAL item{value, count, index}, absolute ones the data. - bind_
tree - The BIND pass a renderer runs over an expanded tree for one data model:
every prop resolved along its schema (
resolve_node_props: DATA props verbatim), every style value, recipe prop andaccessibilityvalue resolved, a node whosevisibleresolves falsy dropped with its subtree,visibleitself removed. Actions stay unresolved (they evaluate at press time,run_action); atemplateand the slots of a ROW-SCOPED component (Table cells) stay UNBOUND — the painter binds them per item / per row (bind_row_slot). Pure;fixtures/bind-time.jsonlocks it. - binding_
paths - Every binding path a prop tree reads (absolute), for dependency tracking.
- call_
function - The function table: the six format functions through the context’s
formatter (round 2), the core functions, then the client functions of
the basic catalog (
and/or/not/requiredwith the core truthiness,src/dynamic.ts LOGIC_FUNCTIONS).openUrlreturns the url as a string the surface turns into an event for the host.None= unknown function or an undefined result. - get_
pointer - is_
data_ schema - A DATA schema: a shape-less
object(any object) or an array of them — Tablerowsin the core catalog. A literal value there is the author’s data, copied verbatim: no binding, call or$string.<id>inside it is interpreted. A dynamic value AT the position still resolves (and its result is never descended).src/dynamic.ts isDataSchema. - is_
visible - A node’s
visible: absent = shown; else its resolved truthiness. - pointer_
tokens - A pointer’s tokens; `` and
/are the whole model. - resolve_
node_ props - A node’s props resolved along its component’s schema (an unknown component’s props resolve at any depth).
- resolve_
prop - One prop value resolved along its schema: dynamic → resolved, DATA
literal → verbatim, arrays and shaped objects → per item / property,
anything else →
resolve_value(any depth). - resolve_
value - A prop or style value with its bindings and calls resolved at ANY depth
(
resolveDynamic). Plain objects recurse (a check’scondition, a menu item’s label);$string.<id>strings resolve through the context’s table.None= undefined. - run_
action - What a press does: resolve the function args and the event context
against the data AS IT IS, then apply
set(relative paths against the scope, missing objects created), then hand back the event. - set_
pointer - Set (or remove with
None) the value atpointer, creating OBJECTS on the way (the TSwritePointer); an array takes an index up to its length (lengthand-append). VAPP-103: refused (data unchanged): a pointer pastmaxPointerBytes/maxPointerSegments, a non-index token or an index past the end of an array. Iterative: any depth. - write_
tokens - A pointer’s tokens for a WRITE (`` and
/= the whole model), or the limit it breaks (maxPointerBytes,maxPointerSegments).