Skip to main content

Module data

Module data 

Source
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§

ActionCall
A function other than set the host must run (openUrl…), args resolved.
ActionEvent
An event an action dispatches, its context resolved BEFORE any write.
ActionOutcome
What a press does (src/dynamic.ts ActionOutcome).
ResolveContext
What resolve_value needs.

Functions§

absolute_path
path made absolute against a template scope (/items/3): /a/b stays, b/c joins 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 UNBOUND rows value: a binding → relative paths read the row at <its pointer>/<index> in the data model (and a set writes into it); a literal or a call → relative paths read inside rows[index] (a relative set writes nothing). index = the row’s index in rows as given, before any local sort.
bind_section_header
Round 2 (§4): a List’s section header bound for section index (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 and accessibility value resolved, a node whose visible resolves falsy dropped with its subtree, visible itself removed. Actions stay unresolved (they evaluate at press time, run_action); a template and 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.json locks 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/required with the core truthiness, src/dynamic.ts LOGIC_FUNCTIONS). openUrl returns 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 — Table rows in 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’s condition, 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 at pointer, creating OBJECTS on the way (the TS writePointer); an array takes an index up to its length (length and - append). VAPP-103: refused (data unchanged): a pointer past maxPointerBytes / 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).