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,25 @@
---
markup: occlusion
title: About panel Markdown leaf
import:
component: ext/web/component/index.mq.md
fs: lib/fs.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
About is a terminal Markdown leaf, so further layout splitting would add no useful responsibility. Read its content through the native filesystem under the granted site root. The wrapper supplies only its client visibility id and initial hidden state. The page describes official host capabilities without embedding implementation JavaScript or an HTML shell.
We **source = [Read the literal About content](fs.read_text(path="content/about.md"))** and **children = [Keep it as ordinary Markdown](component.markdown(text=`source`, slot="about-content"))**.
`attrs` =
| id | hidden |
|---|---|
| panel-about | True |
Return *[Describe the initially hidden About panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="about"))*.
@@ -0,0 +1,70 @@
---
markup: occlusion
title: Native browser control leaves
import:
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## button
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| id | text | required | Event target shared with the client wire table |
| label | text | required | Literal visible action |
| secondary | bool | False | Use the retained secondary palette |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | One disabled native button awaiting successful runtime boot |
Use `id`, `label` and `secondary`=False for one leaf. The button starts disabled, carries type button and is enabled only after the official runtime boots successfully. Its label remains plain text. The caller chooses placement; this helper neither binds a click handler nor hides a sibling layout. Keep its id aligned with static/app.mq.md.
`attrs` =
| id | type | disabled |
|---|---|---|
| `id` | button | True |
We **style = ""**.
1. `secondary`
We **style = "secondary"**.
Return *[Describe one literal native action](component.element(kind="button", value=`label`, attrs=`attrs`, style=`style`, slot=`id`))*.
## input
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| id | text | required | Client value target |
| hint | text | required | Plain placeholder text |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | One disabled text input |
Use `id` and `hint` for the draft or socket message. A native text input preserves its ordinary editing semantics and starts disabled until WASM is ready. The hint is placeholder text rather than a markup template. The component owns one control; the client selects its value through the wire table when the adjacent action is clicked.
`attrs` =
| id | type | placeholder | disabled |
|---|---|---|---|
| `id` | text | `hint` | True |
Return *[Describe this native value input](component.element(kind="input", attrs=`attrs`, slot=`id`))*.
## text
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
| id | text | required | Stable output target |
| value | text | required | Literal initial text |
| kind | text | "text" | Native text or pre output |
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | One escaped text leaf |
Use `id`, `value` and `kind`="text" for an output target. Select pre for the runtime log and ordinary text for the path, tick count or network outcome. Initial and later content stays literal: the renderer escapes this value and callbacks use set_text. This leaf declares no timer or network operation; those belong to the browser program.
We **attrs = [Retain the exact output target](table.put(in=None, at="id", value=`id`))**.
Return *[Describe the literal output leaf](component.element(kind=`kind`, value=`value`, attrs=`attrs`, slot=`id`))*.
@@ -0,0 +1,33 @@
---
markup: occlusion
title: Draft and list editor
import:
controls: ../controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
The editor contains one draft input, three draft actions, the export actions and an initially empty native list. The client owns records, stable identities and delegated deletion; no authored list HTML is stored here. Save persists only the draft under this origin. Copy and Download export current item text while list state remains in browser session memory.
We **heading = [Read the plain editor heading](component.markdown(text="## 待办"))** and **input = [Describe the exact draft target](controls.input(id="draft", hint="新项…"))** and **children = [Place input after its heading](table.concat(a=`heading`, b=`input`))**.
`actions` =
| @ | id | label | secondary |
|---|---|---|---|
| 1 | add | 添加 | False |
| 2 | save | 存草稿 | True |
| 3 | load | 读草稿 | True |
| 4 | copy-log | 复制列表 | True |
| 5 | dl-list | 下载列表 | True |
- [Describe each native action leaf](for actions as action)
We **button = [Keep this action separate from state](controls.button(id=access(action, "id"), label=access(action, "label"), secondary=access(action, "secondary")))** and **children = [Preserve the authored action order](table.concat(a=`children`, b=`button`))**.
We **empty = [Start the empty native list](table.empty_list())** and **attrs = [Retain the delegated list target](table.put(in=None, at="id", value="items"))** and **list = [Describe the list container](component.wrap(children=`empty`, kind="list", attrs=`attrs`, slot="items"))**.
Return *[Keep the list after its editing controls](table.concat(a=`children`, b=`list`))*.
@@ -0,0 +1,20 @@
---
markup: occlusion
title: Home panel assembly
import:
editor: editor.mq.md
timer: timer.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
Home has two independent children: the list editor and the named timer. This parent expresses only that ordering and the panel identity used by the client. Start with Home visible; About and Network are hidden in their own definitions. State and transport do not belong in layout tables, and changing one child does not require copying the entire page.
We **list = [Assemble the editor responsibility](editor.nodes())** and **clock = [Assemble the timer responsibility](timer.nodes())** and **children = [Keep the two home regions ordered](table.concat(a=`list`, b=`clock`))** and **attrs = [Name the client visibility target](table.put(in=None, at="id", value="panel-home"))**.
Return *[Describe the initially visible Home panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="home"))*.
@@ -0,0 +1,19 @@
---
markup: occlusion
title: Named timer controls
import:
controls: ../controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
This region describes the tick output and its two actions. The client increments retained state only when the named timer actually calls back. Start replaces a timer with the same id; Stop preserves the count. This layout performs no sleeping or counting on the server, and its native text output can be tested independently of timer scheduling.
We **label = [Describe the timer label](component.markdown(text="计时(秒):"))** and **counter = [Describe the initial count](controls.text(id="tick", value="0"))** and **start = [Describe the explicit start action](controls.button(id="start-tick", label="开始"))** and **stop = [Describe the explicit stop action](controls.button(id="stop-tick", label="停止", secondary=True))** and **content = [Keep label before count](table.concat(a=`label`, b=`counter`))** and **actions = [Keep the two actions together](table.concat(a=`start`, b=`stop`))** and **children = [Place actions beside their output](table.concat(a=`content`, b=`actions`))**.
Return *[Wrap this one timer responsibility](component.wrap(children=`children`, kind="row", slot="timer"))*.
@@ -0,0 +1,50 @@
---
markup: occlusion
title: Browser example recursive page assembly
import:
navigation: navigation.mq.md
home: home/index.mq.md
about: about.mq.md
network: network/index.mq.md
controls: controls.mq.md
component: ext/web/component/index.mq.md
fs: lib/fs.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
Read this root to see the whole page: introduction, path, navigation, three panels, feedback and runtime. Follow one import at a time until a child is a plain Markdown leaf or native control. Business values never become a page HTML string. The official runtime starts only after the server has staged the current built assets and the actual client source. Controls stay disabled until boot succeeds; missing resources therefore remain visible as a loading failure. The readiness target and enable selectors are typed resource metadata, not executable snippets. Styles reference the generated stylesheet produced by serve. Server discovery reads the terminal content leaves under the granted root; the browser receives the same ordered region tree.
We **source = [Read the plain introduction](fs.read_text(path="content/intro.md"))** and **intro = [Retain its Markdown](component.markdown(text=`source`, slot="intro"))** and **path = [Describe the initial pathname](controls.text(id="path", value="path: /"))** and **nav = [Assemble the authored destinations](navigation.nodes())** and **home = [Assemble list and timer](home.nodes())** and **about = [Read the About leaf](about.nodes())** and **network = [Assemble independent network controls](network.nodes())** and **log = [Describe literal runtime feedback](controls.text(id="log", value="loading…", kind="pre"))** and **style = [Reference the compiled declarative theme](component.asset(url="/static/theme.css", kind="stylesheet"))**.
`runtime_attrs` =
| type | data-mq-wasm | data-mq-source-url | data-mq-ready | data-mq-enable |
|---|---|---|---|---|
| module | "/static/marqdo_wasm.wasm" | "/static/app.mq.md" | "#log" | "#draft,#add,#save,#load,#start-tick,#stop-tick,#fetch-all,#ws-open,#ws-msg,#ws-send,#ws-close,#copy-log,#dl-list" |
We **runtime = [Declare the official module and readiness targets](component.asset(url="/static/marqdo-bridge.js", attrs=`runtime_attrs`, slot="runtime"))**.
`groups` =
| rows |
|---|
| `intro` |
| `path` |
| `nav` |
| `home` |
| `about` |
| `network` |
| `log` |
| `style` |
| `runtime` |
We **children = [Start the complete ordered page](table.empty_list())**.
- [Retain each independently inspectable region](for groups as group)
We **children = [Keep typed children in reading order](table.concat(a=`children`, b=`group`))**.
Return *[Wrap the recursive page once](component.wrap(children=`children`, slot="browser-app", style="browser-app"))*.
@@ -0,0 +1,36 @@
---
markup: occlusion
title: Three browser panel destinations
import:
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
Navigation contains three ordinary links with stable ids. Their fragment destinations leave a readable fallback without issuing a server page request. The official wire table intercepts each click and requests one deliberate history entry. Back and Forward only repaint the already selected panel. This component does not own client state or generate navigation JavaScript.
`destinations` =
| @ | id | href | label |
|---|---|---|---|
| 1 | nav-home | "#/" | 首页 |
| 2 | nav-about | "#/about" | 关于 |
| 3 | nav-net | "#/net" | 网络 |
We **links = [Start the ordered native navigation](table.empty_list())**.
- [Declare each independently named destination](for destinations as destination)
We **label = [Read its literal label](access(destination, "label"))** and **id = [Read its stable event target](access(destination, "id"))** and **href = [Read its fallback destination](access(destination, "href"))**.
`attrs` =
| id | href |
|---|---|
| `id` | `href` |
We **link = [Describe this native destination](component.element(kind="link", value=`label`, attrs=`attrs`))** and **links = [Preserve navigation order](table.concat(a=`links`, b=`link`))**.
Return *[Place those links in a navigation region](component.wrap(children=`links`, kind="nav", slot="navigation"))*.
@@ -0,0 +1,27 @@
---
markup: occlusion
title: Network panel assembly
import:
socket: socket.mq.md
controls: ../controls.mq.md
component: ext/web/component/index.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
Network places plain explanatory content, the actual response output, a batch-fetch action and a local echo group. Batch requests retain the original public demonstration endpoint and may fail; ordered callback records show each status and body. Socket transport is local and independent. The panel starts hidden and the browser client alone selects it.
We **heading = [Describe the network responsibility](component.markdown(text="## 网络\n\n批量请求显示每项的实际状态;WebSocket 使用本机 /live 回声服务。"))** and **output = [Describe literal transport feedback](controls.text(id="net-out", value="idle"))** and **fetch = [Describe the batch request action](controls.button(id="fetch-all", label="fetch_all ×2 uuid"))** and **echo = [Assemble local socket controls](socket.nodes())** and **first = [Place feedback below its explanation](table.concat(a=`heading`, b=`output`))** and **last = [Keep fetch before socket interaction](table.concat(a=`fetch`, b=`echo`))** and **children = [Preserve the two network responsibilities](table.concat(a=`first`, b=`last`))**.
`attrs` =
| id | hidden |
|---|---|
| panel-net | True |
Return *[Describe the initially hidden Network panel](component.wrap(children=`children`, kind="section", attrs=`attrs`, slot="network"))*.
@@ -0,0 +1,18 @@
---
markup: occlusion
title: Local echo socket controls
import:
controls: ../controls.mq.md
table: lib/table.mq.md
---
## nodes
| 返回 | 类型 | 说明 |
|---|---|---|
| result | list | Structured View rows for this component |
The echo group contains Open, the message input, Send and Close as separate native leaves. The server binds /live, and the official bridge sends the browser program’s transport instructions. Actual lifecycle callbacks update the network output. This component performs no handshake itself and does not rely on availability of a public echo service.
We **open = [Describe the connection action](controls.button(id="ws-open", label="WS 打开"))** and **message = [Describe exact message input](controls.input(id="ws-msg", hint="ws 消息"))** and **send = [Describe the explicit send action](controls.button(id="ws-send", label="WS 发送"))** and **close = [Describe the explicit close action](controls.button(id="ws-close", label="WS 关闭", secondary=True))** and **first = [Keep open before message entry](table.concat(a=`open`, b=`message`))** and **last = [Keep send before close](table.concat(a=`send`, b=`close`))**.
Return *[Keep the local echo interaction ordered](table.concat(a=`first`, b=`last`))*.