跳到主要內容

ARC 2.0.0-beta.25

Semantic tree

Describe interface intent with stable ids, types, props, bindings, and children rather than pixels for one device.

The smallest AUP unit is a node. A tree says what exists in an interface, how nodes nest, and which data or events relate to them. It does not make browser CSS, an iOS view, or terminal character art into protocol facts.

The current AUPNode has these core fields:

FieldPurposeConstraint for an author
idStable identity in a treeUnique within that tree; do not use mutable display text as an id
typeA primitive, Web widget, or registered custom typeCheck target support first
propsStatic, type-specific attributesUse only keys supported for that type
childrenChild nodesNest only where the container semantics allow it
srcRead-only AFS data bindingExpresses a read, not write authority
bindRead/write AFS binding, often for inputUse only on an authorized writable path
stateLocal UI stateDo not treat it as persistent business data
eventsDeclared user interactionUse the event contract rather than hiding business logic in a renderer

A conceptual tree can be written as:

text
view (id: profile)
├── text (id: profile-title)
└── action (id: open-settings)

Here view expresses a container, while text and action express content and an operation. How a device arranges the nodes, how a button looks, or whether a fallback is needed are target-presentation concerns. An author should not rely on incidental CSS in one renderer to change the meaning of the tree.

Primitives and Web widgets

The current core type table defines 18 cross-device primitives, including view, text, media, input, action, table, chat, editor, canvas, and afs-list. The Web runtime additionally registers Web-only widgets such as frame, terminal, breadcrumb, pagination, and tooltip. The latter can be implemented by a Web renderer but are not automatically cross-device primitives, and do not automatically occur in every device's DeviceCaps.primitives map.

Do not claim that an unknown or custom type works cross-device merely because a parser accepts it. Build a small example for the target renderer and accept it in a real device/browser. For fallback behavior, see Device capabilities and degradation.

Keep data separate from UI state

src expresses a read-only data path; bind expresses a read/write binding. Both are UI-to-AFS path contracts and do not grant read or write permission by themselves. state is UI-local state such as the selected tab or expansion; input validation can also be renderer-transient state and should not be mistaken for a persistent AFS record.

Read Events, state, and bindings next to decide whether an operation should execute an AFS action, change the tree, or perform browser-level navigation.