Release 2.7.0: executable handbooks and native user-site workflows

This commit is contained in:
cflmy committed 2026-11-10 17:03:06 +08:00
1 parent aa0c4d0f55
commit d9aef957f7
562 files changed
+21064 -20387

No files matched your search

@@ -0,0 +1,47 @@
---
markup: occlusion
title: Native control leaves
import:
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
These small leaves retain accessible ids and plain text. Parent components decide their arrangement; callbacks use the same ids in the client wiring.
## button
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| id | text | required | Stable id used by the client event table |
| label | text | required | Plain button text |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | One native button leaf |
Use `id` and `label` for one event target. A button has type button so it does not accidentally submit a surrounding form. Its label stays plain text, including quotes and angle brackets. This function describes a control and performs no click, navigation or DOM mutation. The same leaf is reused by navigation, detail actions and editor actions.
`attrs` =
| id | type |
|---|---|
| `id` | button |
Return *[Describe this native action button](component.element(kind="button", value=`label`, attrs=`attrs`, slot=`id`))*.
## text
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| id | text | required | Stable client text target |
| value | text | "" | Initial plain text |
| kind | text | "text" | Native text, title or pre kind |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | One native text target |
Use `id`, `value`="" and `kind`="text" to declare a simple display leaf. Initial content is escaped by the renderer, and later updates use browser set_text rather than HTML. Select pre for a log or title for the page heading. The control carries no sibling layout, state machine or event handler; its parent owns placement.
We **attrs = [Retain the stable text target](table.put(in=None, at="id", value=`id`))**.
Return *[Describe the native text leaf](component.element(kind=`kind`, value=`value`, attrs=`attrs`, slot=`id`))*.
@@ -0,0 +1,24 @@
---
markup: occlusion
title: SPA homepage assembly
import:
nav: nav.mq.md
panels: panels/index.mq.md
controls: controls.mq.md
client: ext/web/client/index.mq.md
table: lib/table.mq.md
---
The homepage composes navigation, heading, independent panels, status and the official runtime Resource.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Complete structured homepage without raw HTML |
This root contains component relationships only. Navigation and panels are ordinary child modules; their content and controls are already simple leaves. The official client runtime is a script Resource referencing built static assets, so no page HTML or author JavaScript is needed. The title and log use stable text targets. A valid node tree does not prove the WASM asset exists; build it and mount the static directory before opening the page.
We **navigation = [Assemble the navigation component](nav.nodes())** and **title = [Describe the changing page heading](controls.text(id="title", value="Items", kind="title"))** and **content = [Assemble the independent panels](panels.nodes())** and **log = [Describe the status text leaf](controls.text(id="log", value="spa ready", kind="pre"))** and **runtime = [Reference the official client program](client.nodes(source="/static/client.mq.md"))**.
We **head = [Keep navigation before the heading](table.concat(a=`navigation`, b=`title`))** and **body = [Keep panels after the heading](table.concat(a=`head`, b=`content`))** and **visible = [Place feedback after the panels](table.concat(a=`body`, b=`log`))**.
Return *[Retain the runtime as a separate Resource](table.concat(a=`visible`, b=`runtime`))*.
+21
View File
@@ -0,0 +1,21 @@
---
markup: occlusion
title: SPA navigation
import:
controls: controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
Navigation composes reusable native buttons; the client owns their transitions.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Navigation containing Items and New controls |
The two buttons have independent stable ids and shared accessible button semantics. They contain labels only; selecting an item or opening an editor belongs to the client callbacks. Their parent is a nav region, so this file expresses one placement responsibility without duplicating the surrounding page.
We **items = [Describe the list action](controls.button(id="nav-list", label="Items"))** and **create = [Describe the creation action](controls.button(id="nav-new", label="New"))** and **children = [Keep their reading order](table.concat(a=`items`, b=`create`))**.
Return *[Place these actions in navigation](component.wrap(children=`children`, kind="nav", slot="navigation"))*.
@@ -0,0 +1,29 @@
---
markup: occlusion
title: Detail panel
import:
controls: ../controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
Detail separates its changing text from the reusable Edit and Back action leaves.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Initially hidden detail panel |
The body has id detail-body and receives plain text after selection. Edit retains the selected stable id; Back returns to the list. Neither action's behavior is embedded in markup. The panel starts hidden and the shared client paint function explicitly controls its hidden attribute, using the same ids as the other panels.
We **body = [Describe the selected record's text target](controls.text(id="detail-body"))** and **edit = [Describe the edit action](controls.button(id="btn-edit", label="Edit"))** and **back = [Describe the list action](controls.button(id="btn-back", label="Back"))**.
We **buttons = [Keep the action order](table.concat(a=`edit`, b=`back`))** and **actions = [Group only these detail actions](component.wrap(children=`buttons`, kind="row", slot="detail-actions"))** and **children = [Keep data before actions](table.concat(a=`body`, b=`actions`))**.
`attrs` =
| id | hidden |
|---|---|
| view-detail | True |
Return *[Describe the independent detail panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="detail-panel"))*.
@@ -0,0 +1,37 @@
---
markup: occlusion
title: Editor panel
import:
controls: ../controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
The editor is a native input plus reusable action leaves. Saving remains a client transition, not an implicit HTTP form.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Initially hidden editor with accessible label and native input |
The label's for attribute names edit-title, the same input read by the Save binding. The input keeps a plain text value. Save validates nonempty text in Marqdo before changing the record list; Cancel changes the route without calling that update. This component describes controls only and starts hidden. The parent keeps field content separate from the action row, allowing the existing responsive layout renderer to place them.
We **label_attrs = [Associate the label with its input](table.put(in=None, at="for", value="edit-title"))** and **label = [Describe the visible field label](component.element(kind="label", value="Title", attrs=`label_attrs`, slot="title-label"))**.
`input_attrs` =
| id | name | type |
|---|---|---|
| edit-title | title | text |
We **input = [Describe the native title input](component.element(kind="input", attrs=`input_attrs`, slot="title-input"))** and **field = [Keep label and input together](table.concat(a=`label`, b=`input`))**.
We **save = [Describe the save action](controls.button(id="btn-save", label="Save"))** and **cancel = [Describe the cancel action](controls.button(id="btn-cancel", label="Cancel"))** and **buttons = [Keep these editor actions ordered](table.concat(a=`save`, b=`cancel`))** and **actions = [Group the action row](component.wrap(children=`buttons`, kind="row", slot="editor-actions"))** and **children = [Place the field before its actions](table.concat(a=`field`, b=`actions`))**.
`attrs` =
| id | hidden |
|---|---|
| view-edit | True |
Return *[Describe the independent editor panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="editor-panel"))*.
@@ -0,0 +1,22 @@
---
markup: occlusion
title: SPA panel assembly
import:
listing: list.mq.md
detail: detail.mq.md
editor: edit.mq.md
table: lib/table.mq.md
---
This parent owns only the three sibling panel relationships.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Ordered list, detail and editor panel rows |
Each child owns one panel and names its own native controls. This function retains their structured values and stable order; the client independently selects visibility using hidden attributes. It does not render a second page or concatenate HTML. Changes to editor fields therefore remain inside the editor component instead of growing a single application string.
We **list = [Assemble the listing component](listing.nodes())** and **view = [Assemble the detail component](detail.nodes())** and **edit = [Assemble the editor component](editor.nodes())** and **first = [Retain list and detail order](table.concat(a=`list`, b=`view`))**.
Return *[Keep the editor as the third sibling](table.concat(a=`first`, b=`edit`))*.
@@ -0,0 +1,28 @@
---
markup: occlusion
title: List panel
import:
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
The existing list container is populated by the official bridge's structured render_list effect.
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Initially visible list panel with its Markdown hint |
The empty native list provides id items for delegated clicks. Its actual entries come from native client records and use stable data-id attributes. The hint is ordinary Markdown and knows nothing about item data or routing. Only this parent sets the list panel's visibility; detail and editor remain separate components.
We **empty = [Start with no server-owned item rows](table.empty_list())** and **target = [Name the client-owned list container](table.put(in=None, at="id", value="items"))** and **list = [Describe the native unordered list](component.wrap(children=`empty`, kind="list", attrs=`target`, slot="items"))**.
We **hint = [Keep the instruction as ordinary Markdown](component.markdown(text="Click an item for detail.", slot="list-hint"))** and **children = [Place the hint after its list](table.concat(a=`list`, b=`hint`))**.
`attrs` =
| id | hidden |
|---|---|
| view-list | False |
Return *[Describe the visible list panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="list-panel"))*.