reactive-md 0.5.3 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-ch.md +195 -165
- package/CHANGELOG.md +195 -165
- package/CONTRIBUTING-ch.md +67 -62
- package/CONTRIBUTING.md +69 -64
- package/README-ch.md +157 -155
- package/README-en.md +184 -181
- package/README.md +184 -181
- package/SECURITY-ch.md +81 -81
- package/SECURITY.md +81 -81
- package/THIRD_PARTY_NOTICES.md +585 -1
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +181 -181
- package/cli/assets.mjs +390 -390
- package/cli/build.mjs +268 -268
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +138 -138
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +55 -55
- package/cli/migrate.mjs +368 -368
- package/cli/package.mjs +210 -210
- package/dist-library/{authoring-DJJjKYg9.js → authoring-BEVyth5X.js} +58 -58
- package/dist-library/compiler-Cm3ppMxG.js +46044 -0
- package/dist-library/react-Bh7_oxZp.js +59655 -0
- package/dist-library/reactive-md-authoring.js +2 -2
- package/dist-library/reactive-md-editor.js +13 -0
- package/dist-library/reactive-md-print.css +284 -284
- package/dist-library/reactive-md-react-unstyled.js +1 -1
- package/dist-library/reactive-md-react.js +1 -1
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +123 -123
- package/dist-library/{runtime-DXtle_6c.js → runtime-DlFYQ4s_.js} +151 -151
- package/dist-library/types/editor/types.d.ts +2 -0
- package/dist-library/types/local/code-block.d.ts +3 -1
- package/dist-library/types/local/code-languages.d.ts +7 -0
- package/dist-library/types/local/compiled-data.d.ts +6 -0
- package/dist-library/types/local/compiler.d.ts +1 -0
- package/dist-library/types/local/diagnostics.d.ts +31 -0
- package/dist-library/types/local/diagram-layout.d.ts +69 -0
- package/dist-library/types/local/html-names.d.ts +6 -0
- package/dist-library/types/local/html-table.d.ts +25 -0
- package/dist-library/types/local/math-display.d.ts +22 -22
- package/dist-library/types/local/math-view.d.ts +6 -7
- package/dist-library/types/local/table-surface.d.ts +10 -0
- package/dist-library/types/local/types.d.ts +2 -0
- package/dist-library/types/local/visuals.d.ts +9 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +331 -51
- package/docs/README.md +84 -0
- package/docs/{compatibility-ch.md → compatibility/compatibility-ch.md} +121 -109
- package/docs/{compatibility-en.md → compatibility/compatibility-en.md} +121 -109
- package/docs/{source-versioning-ch.md → compatibility/source-versioning-ch.md} +159 -159
- package/docs/{source-versioning-en.md → compatibility/source-versioning-en.md} +159 -159
- package/docs/{component-development-ch.md → development/component-development-ch.md} +210 -210
- package/docs/{component-development-en.md → development/component-development-en.md} +210 -210
- package/docs/{component-protocol-ch.md → development/component-protocol-ch.md} +747 -747
- package/docs/{component-protocol-en.md → development/component-protocol-en.md} +747 -747
- package/docs/{performance-ch.md → development/performance-ch.md} +76 -76
- package/docs/{performance-en.md → development/performance-en.md} +76 -76
- package/docs/{releasing-ch.md → development/releasing-ch.md} +108 -108
- package/docs/{releasing-en.md → development/releasing-en.md} +108 -108
- package/docs/guides/local-guide-ch.md +513 -0
- package/docs/guides/local-guide-en.md +513 -0
- package/docs/{author-tools-ch.md → integration/author-tools-ch.md} +57 -57
- package/docs/{author-tools-en.md → integration/author-tools-en.md} +57 -57
- package/docs/{editor-ch.md → integration/editor-ch.md} +7 -6
- package/docs/{editor-en.md → integration/editor-en.md} +7 -6
- package/docs/{local-integration-ch.md → integration/local-integration-ch.md} +33 -15
- package/docs/{local-integration-en.md → integration/local-integration-en.md} +33 -15
- package/docs/{shareable-export-ch.md → integration/shareable-export-ch.md} +221 -209
- package/docs/{shareable-export-en.md → integration/shareable-export-en.md} +223 -211
- package/docs/{computations-formatting-ch.md → reference/computations-formatting-ch.md} +87 -87
- package/docs/{computations-formatting-en.md → reference/computations-formatting-en.md} +87 -87
- package/docs/{constraints-collections-ch.md → reference/constraints-collections-ch.md} +84 -84
- package/docs/{constraints-collections-en.md → reference/constraints-collections-en.md} +84 -84
- package/docs/{diagnostics-counting-ch.md → reference/diagnostics-counting-ch.md} +104 -84
- package/docs/{diagnostics-counting-en.md → reference/diagnostics-counting-en.md} +104 -84
- package/docs/{html-compatibility-ch.md → reference/html-compatibility-ch.md} +42 -4
- package/docs/{html-compatibility-en.md → reference/html-compatibility-en.md} +42 -4
- package/docs/{local-components-v2-ch.md → reference/local-components-v2-ch.md} +138 -138
- package/docs/{local-components-v2-en.md → reference/local-components-v2-en.md} +104 -104
- package/docs/{local-interaction-syntax-ch.md → reference/local-interaction-syntax-ch.md} +515 -492
- package/docs/{local-interaction-syntax-en.md → reference/local-interaction-syntax-en.md} +511 -488
- package/docs/{theme-protocol-ch.md → reference/theme-protocol-ch.md} +107 -107
- package/docs/{theme-protocol-en.md → reference/theme-protocol-en.md} +107 -107
- package/docs/{release-0.4.0-ch.md → releases/release-0.4.0-ch.md} +89 -89
- package/docs/{release-0.4.0-en.md → releases/release-0.4.0-en.md} +89 -89
- package/docs/{release-0.4.1-ch.md → releases/release-0.4.1-ch.md} +23 -23
- package/docs/{release-0.4.1-en.md → releases/release-0.4.1-en.md} +23 -23
- package/docs/{release-0.5.0-ch.md → releases/release-0.5.0-ch.md} +4 -4
- package/docs/{release-0.5.0-en.md → releases/release-0.5.0-en.md} +4 -4
- package/docs/{release-0.5.1-ch.md → releases/release-0.5.1-ch.md} +4 -4
- package/docs/{release-0.5.1-en.md → releases/release-0.5.1-en.md} +4 -4
- package/docs/{release-0.5.2-ch.md → releases/release-0.5.2-ch.md} +3 -3
- package/docs/{release-0.5.2-en.md → releases/release-0.5.2-en.md} +3 -3
- package/docs/{release-0.5.3-ch.md → releases/release-0.5.3-ch.md} +1 -1
- package/docs/{release-0.5.3-en.md → releases/release-0.5.3-en.md} +1 -1
- package/docs/releases/release-0.6.0-ch.md +57 -0
- package/docs/releases/release-0.6.0-en.md +57 -0
- package/docs/releases/release-0.6.1-ch.md +27 -0
- package/docs/releases/release-0.6.1-en.md +27 -0
- package/examples/conformance/README.md +53 -53
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/integration/README.md +47 -45
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README.md +74 -74
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/html-compat.reactive.md +19 -0
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README.md +25 -25
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/package.json +152 -145
- package/dist-library/compiler-UyPwGzJZ.js +0 -22109
- package/dist-library/react-fizgU3i8.js +0 -12764
- package/docs/local-guide-ch.md +0 -967
- package/docs/local-guide-en.md +0 -967
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
# New components and migration: local-draft-2
|
|
2
|
-
|
|
3
|
-
This page describes the new components in `0.4.0` and the `local-draft-2` syntax. It supplements the [syntax reference](local-interaction-syntax-en.md). The contribution protocol remains component-protocol-1; its portable fixture format is unchanged.
|
|
4
|
-
|
|
5
|
-
## Navigation and text color
|
|
6
|
-
|
|
7
|
-
```markdown
|
|
8
|
-
<jump to="result" appearance="button" color="#2563eb">View results</jump>
|
|
9
|
-
|
|
10
|
-
<section color="#45536f">
|
|
11
|
-
Ordinary prose with <text color="#a2273a">**an important reminder**</text>.
|
|
12
|
-
|
|
13
|
-
Another paragraph inherits the section color.
|
|
14
|
-
</section>
|
|
15
|
-
|
|
16
|
-
<anchor id="result">
|
|
17
|
-
|
|
18
|
-
## Results
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
jump and text are paired inline components with inline Markdown children. section is a paired block container with no extra border or background. anchor is a leaf. jump.to is a static heading slug or explicit anchor ID without a leading #. appearance is link (default) or button. Explicit IDs match `[A-Za-z_][A-Za-z0-9_-]*`; duplicates, heading collisions and missing targets are compile errors. DOM IDs are namespaced per rendered document. Jumps scroll and move focus; hidden targets show local feedback. Existing Markdown fragment links also resolve explicit anchors.
|
|
22
|
-
|
|
23
|
-
text/section require color. Other supported components accept an optional color: jump, badge, progress, slider, toggle, checkbox, select, choices, radio-group, checklist, multi-select, range-slider and coordinate. Static named colors from the shared table and #RGB/#RRGGBB are accepted. Expressions, CSS functions, variables and declarations are rejected. Text containers set foreground color; inner values override inheritance. Links and controls keep their own appearance. Other components use color for their accent, selected state or progress fill; tone keeps its semantic meaning. Omitted values use the theme.
|
|
24
|
-
|
|
25
|
-
## Todo lists and multiple selection
|
|
26
|
-
|
|
27
|
-
Existing checklist syntax is unchanged. Checked item text is struck through and muted, including initial `[x]` items; unchecking restores it. Only the checked item changes.
|
|
28
|
-
|
|
29
|
-
```markdown
|
|
30
|
-
<multi-select bind="subjects" label="Subjects" max-selected="2" initial="math">
|
|
31
|
-
<option value="math">Math</option>
|
|
32
|
-
<option value="physics">Physics</option>
|
|
33
|
-
</multi-select>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
multi-select requires a label and one or more option children; bind is optional. Its exclusive string-array binding defaults to empty. initial is a comma-separated list of static values; values must be nonempty, unique and comma-free. max-selected is a nonnegative integer, defaulting to the option count. Writes normalize to source order and obey existing array budgets. Search and Clear are built in. Selected items remain removable at the limit. disabled may be dynamic; reset clears local search and restores initial selection, while hiding preserves them.
|
|
37
|
-
|
|
38
|
-
## Range and coordinate inputs
|
|
39
|
-
|
|
40
|
-
```markdown
|
|
41
|
-
<range-slider label="Interval" bind-start="low" bind-end="high"
|
|
42
|
-
initial-start="20" initial-end="80" min="0" max="100" step="1">
|
|
43
|
-
|
|
44
|
-
<coordinate label="Point" bind-x="px" bind-y="py"
|
|
45
|
-
initial-x="1" initial-y="2"
|
|
46
|
-
x-min="-5" x-max="5" y-min="-5" y-max="5" step="1">
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Both are leaves with required label, optional color and dynamic disabled. Bounds and positive step are static finite numbers. range-slider defaults to 0/100/1, with start=min and end=the largest valid step not exceeding max. Crossing is rejected rather than swapping endpoints. coordinate defaults to -5…5 on both axes, step 1, and the nearest legal zero per axis. It supports pointer dragging, keyboard control and numeric alternatives.
|
|
50
|
-
|
|
51
|
-
Each optional bind names one exclusive numeric slot; omitted names use internal state. x/y remain reserved parameter names. Slots initialize at compile time and reset atomically. Host APIs extend to `runtime.get(node, slot?)`, `runtime.set(node, value, slot?)` and `runtime.setMany(node, values)`. Slots are start/end for ranges and x/y for coordinates. Every write validates canonical registered slots; invalid batches preserve the entire snapshot and revision. Existing one-value calls remain valid.
|
|
52
|
-
|
|
53
|
-
## Questions and guided reading
|
|
54
|
-
|
|
55
|
-
```markdown
|
|
56
|
-
<quiz type="choice" label="What is 2 + 3?" answer="b" explanation="The sum is 5.">
|
|
57
|
-
<option value="a">4</option>
|
|
58
|
-
<option value="b">5</option>
|
|
59
|
-
</quiz>
|
|
60
|
-
|
|
61
|
-
<quiz type="number" label="Approximate pi" answer="3.14" tolerance="0.01">
|
|
62
|
-
</quiz>
|
|
63
|
-
|
|
64
|
-
<steps label="Learning path" bind="lesson">
|
|
65
|
-
<step label="Observe" value="observe">
|
|
66
|
-
Change a parameter.
|
|
67
|
-
</step>
|
|
68
|
-
<step label="Practice" value="practice">
|
|
69
|
-
Check an answer.
|
|
70
|
-
</step>
|
|
71
|
-
</steps>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
quiz requires label/answer. type defaults to choice, with option children and a matching answer. Numeric quizzes have an empty body, finite answer and nonnegative absolute tolerance (default 0). explanation is optional and supports text interpolation. Check answer, feedback and Try again are built in. Draft and feedback stay internal; this revision has no quiz bind. Hiding preserves them and panel reset clears them. Answers are supplied in source for self-study.
|
|
75
|
-
|
|
76
|
-
steps accepts one or more step children, optional label and exclusive string bind. initial defaults to the first step. Each step requires label; omitted values become step-1, step-2 and so on. Values are unique within a group. Previous/Next and position are built in. Only active content is visible; all bindings still initialize, state persists between steps, and hidden timers pause. Reset restores the initial step and its subtree.
|
|
77
|
-
|
|
78
|
-
## Table and chart selection
|
|
79
|
-
|
|
80
|
-
```markdown
|
|
81
|
-
<table bind="project" key="Project" initial="Content">
|
|
82
|
-
| Project | Cost |
|
|
83
|
-
| --- | ---: |
|
|
84
|
-
| Content | 120 |
|
|
85
|
-
| Visual | 230 |
|
|
86
|
-
</table>
|
|
87
|
-
|
|
88
|
-
<chart bind="project" key="Project">
|
|
89
|
-
| Project | Cost |
|
|
90
|
-
| --- | ---: |
|
|
91
|
-
| Content | 120 |
|
|
92
|
-
| Visual | 230 |
|
|
93
|
-
</chart>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
key names a column of static, nonempty, unique text identifiers. Selection is enabled only when key is present; bind/initial require key. Empty string means no selection by default. Explicit initial must match a row. Table/chart can share a selection binding only with identical ordered keys and at most one explicit initial. Mouse or keyboard selection writes row identity. Sorting, searching, pagination and hidden legends preserve selection; table filters still affect only that table. Existing components without key gain no implicit binding.
|
|
97
|
-
|
|
98
|
-
## Compatibility and acceptance
|
|
99
|
-
|
|
100
|
-
Previously supported local-draft-1 source remains valid. Ten new names arrive with this extension: jump, anchor, text, section, multi-select, range-slider, coordinate, quiz, steps and step. The same release also adds the declaration tags computed, const and validation and the structural tags data-table and column, for 48 tag names in the complete `local-draft-2` set; the leading `<theme>` declaration is metadata, not a component. Old builds displayed these unknown regions as inert source; this build interprets their supported content. Put literal examples inside code spans or fences. Checklist completion appearance changes visibly.
|
|
101
|
-
|
|
102
|
-
Portable fixture syntaxVersion advances to local-draft-2; component-protocol-1 and its data format stay unchanged. local-draft-1.json is retained as historical data. New tests cover compiler/runtime, SSR rendering and visual selection. Canonical state, atomic rejection/reset, instance isolation, hidden-state retention, positioned diagnostics, existing resource budgets and the core/React boundary follow the component protocol. The same release also reserves new expression function names; see [0.4.0 release and migration](release-0.4.0-en.md) for the full rename list.
|
|
103
|
-
|
|
104
|
-
Run `npm test`, `npm run test:components`, `npm run build:demo` and `npm run test:docs`. Browser checks and the complete release gate use `npm run verify:release`; see the [contributing guide](
|
|
1
|
+
# New components and migration: local-draft-2
|
|
2
|
+
|
|
3
|
+
This page describes the new components in `0.4.0` and the `local-draft-2` syntax. It supplements the [syntax reference](local-interaction-syntax-en.md). The contribution protocol remains component-protocol-1; its portable fixture format is unchanged.
|
|
4
|
+
|
|
5
|
+
## Navigation and text color
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
<jump to="result" appearance="button" color="#2563eb">View results</jump>
|
|
9
|
+
|
|
10
|
+
<section color="#45536f">
|
|
11
|
+
Ordinary prose with <text color="#a2273a">**an important reminder**</text>.
|
|
12
|
+
|
|
13
|
+
Another paragraph inherits the section color.
|
|
14
|
+
</section>
|
|
15
|
+
|
|
16
|
+
<anchor id="result">
|
|
17
|
+
|
|
18
|
+
## Results
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
jump and text are paired inline components with inline Markdown children. section is a paired block container with no extra border or background. anchor is a leaf. jump.to is a static heading slug or explicit anchor ID without a leading #. appearance is link (default) or button. Explicit IDs match `[A-Za-z_][A-Za-z0-9_-]*`; duplicates, heading collisions and missing targets are compile errors. DOM IDs are namespaced per rendered document. Jumps scroll and move focus; hidden targets show local feedback. Existing Markdown fragment links also resolve explicit anchors.
|
|
22
|
+
|
|
23
|
+
text/section require color. Other supported components accept an optional color: jump, badge, progress, slider, toggle, checkbox, select, choices, radio-group, checklist, multi-select, range-slider and coordinate. Static named colors from the shared table and #RGB/#RRGGBB are accepted. Expressions, CSS functions, variables and declarations are rejected. Text containers set foreground color; inner values override inheritance. Links and controls keep their own appearance. Other components use color for their accent, selected state or progress fill; tone keeps its semantic meaning. Omitted values use the theme.
|
|
24
|
+
|
|
25
|
+
## Todo lists and multiple selection
|
|
26
|
+
|
|
27
|
+
Existing checklist syntax is unchanged. Checked item text is struck through and muted, including initial `[x]` items; unchecking restores it. Only the checked item changes.
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
<multi-select bind="subjects" label="Subjects" max-selected="2" initial="math">
|
|
31
|
+
<option value="math">Math</option>
|
|
32
|
+
<option value="physics">Physics</option>
|
|
33
|
+
</multi-select>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
multi-select requires a label and one or more option children; bind is optional. Its exclusive string-array binding defaults to empty. initial is a comma-separated list of static values; values must be nonempty, unique and comma-free. max-selected is a nonnegative integer, defaulting to the option count. Writes normalize to source order and obey existing array budgets. Search and Clear are built in. Selected items remain removable at the limit. disabled may be dynamic; reset clears local search and restores initial selection, while hiding preserves them.
|
|
37
|
+
|
|
38
|
+
## Range and coordinate inputs
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
<range-slider label="Interval" bind-start="low" bind-end="high"
|
|
42
|
+
initial-start="20" initial-end="80" min="0" max="100" step="1">
|
|
43
|
+
|
|
44
|
+
<coordinate label="Point" bind-x="px" bind-y="py"
|
|
45
|
+
initial-x="1" initial-y="2"
|
|
46
|
+
x-min="-5" x-max="5" y-min="-5" y-max="5" step="1">
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Both are leaves with required label, optional color and dynamic disabled. Bounds and positive step are static finite numbers. range-slider defaults to 0/100/1, with start=min and end=the largest valid step not exceeding max. Crossing is rejected rather than swapping endpoints. coordinate defaults to -5…5 on both axes, step 1, and the nearest legal zero per axis. It supports pointer dragging, keyboard control and numeric alternatives.
|
|
50
|
+
|
|
51
|
+
Each optional bind names one exclusive numeric slot; omitted names use internal state. x/y remain reserved parameter names. Slots initialize at compile time and reset atomically. Host APIs extend to `runtime.get(node, slot?)`, `runtime.set(node, value, slot?)` and `runtime.setMany(node, values)`. Slots are start/end for ranges and x/y for coordinates. Every write validates canonical registered slots; invalid batches preserve the entire snapshot and revision. Existing one-value calls remain valid.
|
|
52
|
+
|
|
53
|
+
## Questions and guided reading
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
<quiz type="choice" label="What is 2 + 3?" answer="b" explanation="The sum is 5.">
|
|
57
|
+
<option value="a">4</option>
|
|
58
|
+
<option value="b">5</option>
|
|
59
|
+
</quiz>
|
|
60
|
+
|
|
61
|
+
<quiz type="number" label="Approximate pi" answer="3.14" tolerance="0.01">
|
|
62
|
+
</quiz>
|
|
63
|
+
|
|
64
|
+
<steps label="Learning path" bind="lesson">
|
|
65
|
+
<step label="Observe" value="observe">
|
|
66
|
+
Change a parameter.
|
|
67
|
+
</step>
|
|
68
|
+
<step label="Practice" value="practice">
|
|
69
|
+
Check an answer.
|
|
70
|
+
</step>
|
|
71
|
+
</steps>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
quiz requires label/answer. type defaults to choice, with option children and a matching answer. Numeric quizzes have an empty body, finite answer and nonnegative absolute tolerance (default 0). explanation is optional and supports text interpolation. Check answer, feedback and Try again are built in. Draft and feedback stay internal; this revision has no quiz bind. Hiding preserves them and panel reset clears them. Answers are supplied in source for self-study.
|
|
75
|
+
|
|
76
|
+
steps accepts one or more step children, optional label and exclusive string bind. initial defaults to the first step. Each step requires label; omitted values become step-1, step-2 and so on. Values are unique within a group. Previous/Next and position are built in. Only active content is visible; all bindings still initialize, state persists between steps, and hidden timers pause. Reset restores the initial step and its subtree.
|
|
77
|
+
|
|
78
|
+
## Table and chart selection
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
<table bind="project" key="Project" initial="Content">
|
|
82
|
+
| Project | Cost |
|
|
83
|
+
| --- | ---: |
|
|
84
|
+
| Content | 120 |
|
|
85
|
+
| Visual | 230 |
|
|
86
|
+
</table>
|
|
87
|
+
|
|
88
|
+
<chart bind="project" key="Project">
|
|
89
|
+
| Project | Cost |
|
|
90
|
+
| --- | ---: |
|
|
91
|
+
| Content | 120 |
|
|
92
|
+
| Visual | 230 |
|
|
93
|
+
</chart>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
key names a column of static, nonempty, unique text identifiers. Selection is enabled only when key is present; bind/initial require key. Empty string means no selection by default. Explicit initial must match a row. Table/chart can share a selection binding only with identical ordered keys and at most one explicit initial. Mouse or keyboard selection writes row identity. Sorting, searching, pagination and hidden legends preserve selection; table filters still affect only that table. Existing components without key gain no implicit binding.
|
|
97
|
+
|
|
98
|
+
## Compatibility and acceptance
|
|
99
|
+
|
|
100
|
+
Previously supported local-draft-1 source remains valid. Ten new names arrive with this extension: jump, anchor, text, section, multi-select, range-slider, coordinate, quiz, steps and step. The same release also adds the declaration tags computed, const and validation and the structural tags data-table and column, for 48 tag names in the complete `local-draft-2` set; the leading `<theme>` declaration is metadata, not a component. Old builds displayed these unknown regions as inert source; this build interprets their supported content. Put literal examples inside code spans or fences. Checklist completion appearance changes visibly.
|
|
101
|
+
|
|
102
|
+
Portable fixture syntaxVersion advances to local-draft-2; component-protocol-1 and its data format stay unchanged. local-draft-1.json is retained as historical data. New tests cover compiler/runtime, SSR rendering and visual selection. Canonical state, atomic rejection/reset, instance isolation, hidden-state retention, positioned diagnostics, existing resource budgets and the core/React boundary follow the component protocol. The same release also reserves new expression function names; see [0.4.0 release and migration](../releases/release-0.4.0-en.md) for the full rename list.
|
|
103
|
+
|
|
104
|
+
Run `npm test`, `npm run test:components`, `npm run build:demo` and `npm run test:docs`. Browser checks and the complete release gate use `npm run verify:release`; see the [contributing guide](../../CONTRIBUTING.md). Record actual run results with the gate rather than copying an old script name. The bilingual [six scenarios](../../examples/local/showcase/README.md) cover all components: ranges, coordinates and numeric questions in Functions; multiple selection in Forms; linked selection in Data; jumps and prose colors in Layout; steps and choice questions in Flow; todos and timing in Checklists.
|