reactive-md 0.3.1 → 0.4.0
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 +96 -0
- package/CHANGELOG.md +82 -39
- package/CONTRIBUTING-ch.md +62 -0
- package/CONTRIBUTING.md +64 -65
- package/README-ch.md +122 -0
- package/README-en.md +146 -0
- package/README.md +146 -89
- package/SECURITY-ch.md +80 -0
- package/SECURITY.md +58 -49
- package/THIRD_PARTY_NOTICES.md +85 -1
- package/bin/reactive-md.mjs +40 -0
- package/cli/args.mjs +181 -0
- package/cli/assets.mjs +390 -0
- package/cli/build.mjs +268 -0
- package/cli/document.mjs +130 -0
- package/cli/errors.mjs +61 -0
- package/cli/fs-utils.mjs +133 -0
- package/cli/glob.mjs +203 -0
- package/cli/help.mjs +138 -0
- package/cli/lint.mjs +177 -0
- package/cli/main.mjs +55 -0
- package/cli/migrate.mjs +368 -0
- package/cli/package.mjs +209 -0
- package/dist-library/reactive-md-react.js +3425 -1647
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1798 -4
- package/dist-library/runtime-DtjdPXxJ.js +15410 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/LocalDocumentView.d.ts +66 -3
- package/dist-library/types/local/authoring.d.ts +63 -0
- package/dist-library/types/local/collection-functions.d.ts +4 -0
- package/dist-library/types/local/colors.d.ts +2 -0
- package/dist-library/types/local/computations.d.ts +53 -0
- package/dist-library/types/local/data-functions.d.ts +22 -0
- package/dist-library/types/local/data-table.d.ts +65 -0
- package/dist-library/types/local/dates.d.ts +2 -0
- package/dist-library/types/local/dependencies.d.ts +31 -0
- package/dist-library/types/local/diagnostics.d.ts +1450 -0
- package/dist-library/types/local/expression.d.ts +13 -3
- package/dist-library/types/local/formatting.d.ts +41 -0
- package/dist-library/types/local/heading-anchors.d.ts +13 -2
- package/dist-library/types/local/i18n.d.ts +18 -0
- package/dist-library/types/local/index.d.ts +18 -1
- package/dist-library/types/local/limits.d.ts +32 -1
- package/dist-library/types/local/locale.d.ts +1 -0
- package/dist-library/types/local/math.d.ts +6 -1
- package/dist-library/types/local/parser.d.ts +10 -4
- package/dist-library/types/local/render-types.d.ts +5 -1
- package/dist-library/types/local/retention.d.ts +23 -0
- package/dist-library/types/local/schema.d.ts +25 -3
- package/dist-library/types/local/source-migration.d.ts +35 -0
- package/dist-library/types/local/state.d.ts +80 -0
- package/dist-library/types/local/text-length.d.ts +13 -0
- package/dist-library/types/local/theme.d.ts +30 -0
- package/dist-library/types/local/types.d.ts +112 -4
- package/dist-library/types/local/validation.d.ts +32 -0
- package/dist-library/types/local/version.d.ts +1 -1
- package/dist-library/types/local/worker.d.ts +82 -0
- package/dist-library/types/react/index.d.ts +4 -1
- package/dist-library/types/shareable.d.ts +64 -0
- package/dist-standalone/reactive-md-standalone.css +2 -0
- package/dist-standalone/reactive-md-standalone.js +57 -0
- package/docs/author-tools-ch.md +56 -0
- package/docs/author-tools-en.md +56 -0
- package/docs/compatibility-ch.md +103 -0
- package/docs/compatibility-en.md +103 -0
- package/docs/{component-development.md → component-development-ch.md} +210 -206
- package/docs/component-development-en.md +210 -0
- package/docs/{component-protocol.md → component-protocol-ch.md} +710 -685
- package/docs/component-protocol-en.md +710 -0
- package/docs/computations-formatting-ch.md +87 -0
- package/docs/computations-formatting-en.md +87 -0
- package/docs/constraints-collections-ch.md +84 -0
- package/docs/constraints-collections-en.md +84 -0
- package/docs/diagnostics-counting-ch.md +84 -0
- package/docs/diagnostics-counting-en.md +84 -0
- package/docs/local-components-v2-ch.md +138 -0
- package/docs/local-components-v2-en.md +104 -0
- package/docs/{local-guide.md → local-guide-ch.md} +28 -8
- package/docs/local-guide-en.md +961 -0
- package/docs/local-integration-ch.md +363 -0
- package/docs/local-integration-en.md +363 -0
- package/docs/{local-interaction-syntax.md → local-interaction-syntax-ch.md} +66 -20
- package/docs/local-interaction-syntax-en.md +483 -0
- package/docs/{performance.md → performance-ch.md} +12 -3
- package/docs/performance-en.md +76 -0
- package/docs/release-0.4.0-ch.md +89 -0
- package/docs/release-0.4.0-en.md +89 -0
- package/docs/releasing-ch.md +101 -0
- package/docs/releasing-en.md +101 -0
- package/docs/shareable-export-ch.md +205 -0
- package/docs/shareable-export-en.md +207 -0
- package/docs/source-versioning-ch.md +159 -0
- package/docs/source-versioning-en.md +159 -0
- package/docs/theme-protocol-ch.md +107 -0
- package/docs/theme-protocol-en.md +107 -0
- package/examples/conformance/README.md +33 -31
- package/examples/conformance/component-protocol-1.json +482 -194
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/history/v0.3.1/catalog.reactive.md +20 -0
- package/examples/conformance/history/v0.3.1/charts.reactive.md +73 -0
- package/examples/conformance/history/v0.3.1/checklist.reactive.md +32 -0
- package/examples/conformance/history/v0.3.1/comparison.reactive.md +47 -0
- package/examples/conformance/history/v0.3.1/components.reactive.md +44 -0
- package/examples/conformance/history/v0.3.1/counter.reactive.md +7 -0
- package/examples/conformance/history/v0.3.1/diagnostics.reactive.md +54 -0
- package/examples/conformance/history/v0.3.1/diagram.reactive.md +44 -0
- package/examples/conformance/history/v0.3.1/gallery.reactive.md +61 -0
- package/examples/conformance/history/v0.3.1/local-draft-1.json +50 -0
- package/examples/conformance/history/v0.3.1/parameters.reactive.md +36 -0
- package/examples/conformance/history/v0.3.1/planning.reactive.md +24 -0
- package/examples/conformance/history/v0.3.1/pricing.reactive.md +20 -0
- package/examples/conformance/history/v0.3.1/provenance.json +72 -0
- package/examples/conformance/local-draft-2.json +212 -0
- package/examples/integration/README.md +45 -29
- package/examples/integration/core/index.mjs +32 -19
- package/examples/integration/react/index.html +1 -1
- package/examples/integration/react/main.jsx +5 -5
- package/examples/integration/worker/index.html +19 -0
- package/examples/integration/worker/main.js +61 -0
- package/examples/integration/worker/package.json +13 -0
- package/examples/integration/worker/worker.js +3 -0
- package/examples/local/README.md +64 -58
- package/examples/local/catalog.reactive.md +14 -14
- package/examples/local/charts.reactive.md +34 -34
- package/examples/local/checklist.reactive.md +19 -19
- package/examples/local/comparison.reactive.md +23 -23
- package/examples/local/components.reactive.md +20 -20
- package/examples/local/counter.reactive.md +4 -4
- package/examples/local/diagnostics.reactive.md +25 -25
- package/examples/local/diagram.reactive.md +20 -20
- package/examples/local/gallery.reactive.md +31 -31
- package/examples/local/parameters.reactive.md +19 -19
- package/examples/local/planning.reactive.md +15 -15
- package/examples/local/pricing.reactive.md +10 -10
- package/examples/local/recipes/invoice-zh.reactive.md +36 -0
- package/examples/local/recipes/invoice.reactive.md +36 -0
- package/examples/local/recipes/workshop-zh.reactive.md +33 -0
- package/examples/local/recipes/workshop.reactive.md +33 -0
- package/examples/local/showcase/README.md +25 -0
- package/examples/local/showcase/explore.reactive.md +102 -0
- package/examples/local/showcase/flow.reactive.md +86 -0
- package/examples/local/showcase/forms.reactive.md +126 -0
- package/examples/local/showcase/functions.reactive.md +119 -0
- package/examples/local/showcase/layout.reactive.md +100 -0
- package/examples/local/showcase/statistics.reactive.md +108 -0
- package/examples/local/showcase/tasks.reactive.md +89 -0
- package/examples/local/showcase/zh/explore.reactive.md +102 -0
- package/examples/local/showcase/zh/flow.reactive.md +86 -0
- package/examples/local/showcase/zh/forms.reactive.md +126 -0
- package/examples/local/showcase/zh/functions.reactive.md +119 -0
- package/examples/local/showcase/zh/layout.reactive.md +100 -0
- package/examples/local/showcase/zh/statistics.reactive.md +108 -0
- package/examples/local/showcase/zh/tasks.reactive.md +89 -0
- package/examples/local/zh/catalog.reactive.md +20 -0
- package/examples/local/zh/charts.reactive.md +73 -0
- package/examples/local/zh/checklist.reactive.md +32 -0
- package/examples/local/zh/comparison.reactive.md +47 -0
- package/examples/local/zh/components.reactive.md +44 -0
- package/examples/local/zh/counter.reactive.md +7 -0
- package/examples/local/zh/diagnostics.reactive.md +54 -0
- package/examples/local/zh/diagram.reactive.md +44 -0
- package/examples/local/zh/gallery.reactive.md +61 -0
- package/examples/local/zh/parameters.reactive.md +36 -0
- package/examples/local/zh/planning.reactive.md +24 -0
- package/examples/local/zh/pricing.reactive.md +20 -0
- package/package.json +16 -3
- package/README.en.md +0 -76
- package/dist-library/runtime-CPzMEMcW.js +0 -11111
- package/docs/compatibility.md +0 -68
- package/docs/local-integration.md +0 -218
- package/docs/releasing.md +0 -92
package/examples/local/README.md
CHANGED
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Local interaction syntax demo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/local-integration-en.md).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The original eleven working examples and one intentionally broken diagnostics document remain in this directory, with Chinese versions in [zh/](zh/). The six feature tours live in [showcase/](showcase/README.md), with Chinese sources in [showcase/zh/](showcase/zh/). Each file runs independently. Controls, expressions and visualizations use local state.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Start with the short examples
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The [workshop recipe](recipes/workshop.reactive.md) ([中文](recipes/workshop-zh.reactive.md)) combines cross-field validation, conditional tones, numeric aggregates and generated table rows. See the [constraints and collections reference](../../docs/constraints-collections-en.md) for rules and budgets.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The [invoice recipe](recipes/invoice.reactive.md) ([中文](recipes/invoice-zh.reactive.md)) demonstrates shared calculations, constants, formatting and UTC date differences. The [calculation reference](../../docs/computations-formatting-en.md) explains its rules.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Start with the [plan calculator](pricing.reactive.md), then choose a [feature tour](showcase/README.md). For the smallest possible state example, read the original [counter](counter.reactive.md). If you are new to the syntax, read the [new user guide](../../docs/local-guide-en.md).
|
|
14
|
+
|
|
15
|
+
## Original standalone catalog
|
|
16
|
+
|
|
17
|
+
| File | Contents |
|
|
14
18
|
| --- | --- |
|
|
15
|
-
| [counter.reactive.md](counter.reactive.md) |
|
|
16
|
-
| [pricing.reactive.md](pricing.reactive.md) |
|
|
17
|
-
| [comparison.reactive.md](comparison.reactive.md) |
|
|
18
|
-
| [parameters.reactive.md](parameters.reactive.md) |
|
|
19
|
-
| [checklist.reactive.md](checklist.reactive.md) |
|
|
20
|
-
| [charts.reactive.md](charts.reactive.md) |
|
|
21
|
-
| [diagram.reactive.md](diagram.reactive.md) |
|
|
22
|
-
| [catalog.reactive.md](catalog.reactive.md) |
|
|
23
|
-
| [planning.reactive.md](planning.reactive.md) |
|
|
24
|
-
| [components.reactive.md](components.reactive.md) |
|
|
25
|
-
| [gallery.reactive.md](gallery.reactive.md) |
|
|
26
|
-
| [diagnostics.reactive.md](diagnostics.reactive.md) |
|
|
27
|
-
|
|
28
|
-
Playground
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
19
|
+
| [counter.reactive.md](counter.reactive.md) | One-line counter with built-in plus, minus and reset |
|
|
20
|
+
| [pricing.reactive.md](pricing.reactive.md) | Plan calculator with parameters linked inside a panel |
|
|
21
|
+
| [comparison.reactive.md](comparison.reactive.md) | Side-by-side comparison, a switch declared in place, tabs that manage their own selection |
|
|
22
|
+
| [parameters.reactive.md](parameters.reactive.md) | Live parameter panel with text, date and choice inputs |
|
|
23
|
+
| [checklist.reactive.md](checklist.reactive.md) | Fixed checkable list and an enhanced table |
|
|
24
|
+
| [charts.reactive.md](charts.reactive.md) | Charts built from tables, with a compound-interest formula in LaTeX |
|
|
25
|
+
| [diagram.reactive.md](diagram.reactive.md) | Auto-laid-out interactive diagram and curves |
|
|
26
|
+
| [catalog.reactive.md](catalog.reactive.md) | Local catalog search, sorting and paging |
|
|
27
|
+
| [planning.reactive.md](planning.reactive.md) | Timeline, timer and bill-splitting calculation |
|
|
28
|
+
| [components.reactive.md](components.reactive.md) | Content cards, disclosures, tabs and hint components |
|
|
29
|
+
| [gallery.reactive.md](gallery.reactive.md) | Common inputs, standalone components and code shown as-is |
|
|
30
|
+
| [diagnostics.reactive.md](diagnostics.reactive.md) | Intentionally broken diagnostics example |
|
|
31
|
+
|
|
32
|
+
The Playground example index is maintained in the repository's demo application.
|
|
33
|
+
|
|
34
|
+
## Expected behavior of the working examples
|
|
35
|
+
|
|
36
|
+
The table below lists the initial values and interaction checkpoints for each document. Numbers follow the formulas in the prose.
|
|
37
|
+
|
|
38
|
+
| Example | Initial display | Interaction checks |
|
|
35
39
|
| --- | --- | --- |
|
|
36
|
-
| comparison |
|
|
37
|
-
| parameters |
|
|
38
|
-
| checklist | 1/3
|
|
39
|
-
| charts | 4
|
|
40
|
-
| diagram |
|
|
41
|
-
| catalog | 8
|
|
42
|
-
| planning | 45
|
|
43
|
-
| components |
|
|
44
|
-
| pricing | 2
|
|
45
|
-
| counter | 0 |
|
|
46
|
-
| gallery |
|
|
47
|
-
|
|
48
|
-
parameters
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
[diagnostics.reactive.md](diagnostics.reactive.md)
|
|
53
|
-
|
|
54
|
-
1. `seat`
|
|
55
|
-
2. `seats`
|
|
56
|
-
3. `ratio`
|
|
57
|
-
4. if.when
|
|
58
|
-
5. `slidr`
|
|
59
|
-
6. `on-click`
|
|
60
|
-
7. edge
|
|
61
|
-
8.
|
|
62
|
-
9.
|
|
63
|
-
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
`npm test`
|
|
40
|
+
| comparison | Basic 100 USD, Pro 200 USD | Annual billing changes them to 80/160; switching tabs needs no declared variable; reset returns to monthly billing |
|
|
41
|
+
| parameters | Date 2026-10-22, personal use, name empty | Entering a name updates the card; selecting team use updates the description; checking the switch shows the preparation checklist; panel reset restores fields and switches |
|
|
42
|
+
| checklist | 1/3 items, progress about 33.33% | Selecting all shows the completion notice; reset restores only the first item; the table sorts by price, searches and pages |
|
|
43
|
+
| charts | 4 budget comparisons; savings parameters 10000, 500, 5%, 20 years; plan bars 40/70 | With the rate at 0 the end-of-curve readout is 130000; the default compound readout is about 232643.24; with 5 people the bars are 100/175 |
|
|
44
|
+
| diagram | Input node selected, a=1, f=1 | Clicking the compute node updates the details and prose; at a=0 the curve flattens and a notice appears; both fixed curves are shown together |
|
|
45
|
+
| catalog | 8 catalog rows, 4 rows per page | Searching for "visual" returns chart/plot/diagram; no match shows the empty state; reset clears the query, sorting and page |
|
|
46
|
+
| planning | 45-minute timeline, countdown paused at 60 seconds, 88 USD per person | timer start/pause/reset; with the extra charge at 0 each person pays 80 USD; the reference task starting at 15 overlaps the main section |
|
|
47
|
+
| components | Concise explanation, first disclosure open | Selecting detailed switches the prose; the tooltip is keyboard-focusable; other disclosures open independently |
|
|
48
|
+
| pricing | 2 people, 100 USD each, 200 USD total | Annual billing gives 160 USD; annual billing for 5 people is 400 USD and shows the team notice; reset returns to 200 USD |
|
|
49
|
+
| counter | 0 | Three increments show 3; three decrements return to 0 and disable minus; reset returns to 0 |
|
|
50
|
+
| gallery | Alex, quantity 3, Pro, monthly billing, cost 240 USD | Annual billing gives 192 USD; hiding and showing the express section keeps its checks; the standalone counter and timer need no bind; `example` in the code block creates no variable |
|
|
51
|
+
|
|
52
|
+
In parameters, the conditional checklist sits outside the panel: its existing checks survive hiding and are outside that panel's reset scope. The standalone counter and timer in gallery also sit outside the input panel, so resetting the input panel does not affect them.
|
|
53
|
+
|
|
54
|
+
## Expected results of the diagnostics example
|
|
55
|
+
|
|
56
|
+
[diagnostics.reactive.md](diagnostics.reactive.md) intentionally contains the following 9 error classes. The editor should collect recoverable, independent diagnostics, and the document as a whole must not activate interactions.
|
|
57
|
+
|
|
58
|
+
1. `seat` is not declared; the message can suggest the existing parameter `seats`.
|
|
59
|
+
2. `seats` has a duplicate explicit initial; both sources are reported.
|
|
60
|
+
3. `ratio` has initial value 12, above the maximum 10.
|
|
61
|
+
4. if.when receives `seats`, a number, where a boolean is required.
|
|
62
|
+
5. `slidr` is an unknown component; the message can suggest `slider`.
|
|
63
|
+
6. `on-click` is not part of counter or the local interaction event syntax.
|
|
64
|
+
7. The edge target `missing` does not exist.
|
|
65
|
+
8. The integral can be displayed but is not a computable structure in the first plot version.
|
|
66
|
+
9. The chart's cost column contains `20 USD`, text where a plain number is required.
|
|
67
|
+
|
|
68
|
+
## Check entry points
|
|
69
|
+
|
|
70
|
+
`npm test` checks parsing, bindings, expressions, LaTeX, the runtime and examples; `npm run test:demo` checks the Playground index; `npm run verify:release` runs the complete Node-side and browser gate, including real-tarball consumption and HTML export. See the [contributing guide](../../CONTRIBUTING.md) for individual commands.
|
|
71
|
+
|
|
72
|
+
The [six scenarios](showcase/README.md) include all 48 tag names: intervals, coordinates and numeric questions in Functions; input choices in Forms; linked selection in Data; jumps and prose colors in Layout; guided steps and choice questions in Flow; todos and timing in Checklists. The standalone gallery and interaction-tour sources remain available as authoring examples.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Find components in the document
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Type "visual", "input" or another keyword into the search box above the table. Click a column name to sort, and use the paging controls to move between pages.
|
|
4
4
|
|
|
5
|
-
<panel title="
|
|
6
|
-
<table label="
|
|
7
|
-
|
|
|
5
|
+
<panel title="Local component catalog">
|
|
6
|
+
<table label="Component catalog" page-size="4">
|
|
7
|
+
| Name | Category | Purpose |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| slider |
|
|
10
|
-
| toggle |
|
|
11
|
-
| choices |
|
|
12
|
-
| chart |
|
|
13
|
-
| plot |
|
|
14
|
-
| diagram |
|
|
15
|
-
| checklist |
|
|
16
|
-
| timer |
|
|
9
|
+
| slider | Input | Drag to adjust a number |
|
|
10
|
+
| toggle | Input | Flip a switch |
|
|
11
|
+
| choices | Input | Pick from a few options |
|
|
12
|
+
| chart | Visual | Turn a Markdown table into a chart |
|
|
13
|
+
| plot | Visual | Draw a function with LaTeX |
|
|
14
|
+
| diagram | Visual | Select nodes to explore explanations |
|
|
15
|
+
| checklist | Content | Tick off completed items |
|
|
16
|
+
| timer | Utility | Start, pause and reset a countdown |
|
|
17
17
|
</table>
|
|
18
18
|
</panel>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
The catalog data lives in this document. Searching filters the table directly, and restoring the defaults clears the query and returns to the original order.
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Charts follow their inputs
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Comparing several budget series
|
|
4
4
|
|
|
5
|
-
<chart title="
|
|
6
|
-
|
|
|
5
|
+
<chart title="Actual cost vs budget" y-label="USD">
|
|
6
|
+
| Category | Actual cost | Budget |
|
|
7
7
|
| --- | ---: | ---: |
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
8
|
+
| Content | 120 | 150 |
|
|
9
|
+
| Visual | 230 | 200 |
|
|
10
|
+
| Interaction | 180 | 220 |
|
|
11
|
+
| Testing | 90 | 120 |
|
|
12
12
|
</chart>
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Savings curve
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Deposit a fixed amount at the end of every month, compounded monthly at a fixed annual rate. $P$ is the initial amount, $m$ is the monthly deposit, and $r$ is the annual rate in percent.
|
|
17
17
|
|
|
18
|
-
<panel title="
|
|
19
|
-
<number bind="P" label="
|
|
20
|
-
<number bind="m" label="
|
|
21
|
-
<slider bind="r" label="
|
|
22
|
-
<slider bind="t" label="
|
|
18
|
+
<panel title="Adjust savings parameters">
|
|
19
|
+
<number bind="P" label="Initial amount" initial="10000" min="0" step="100">
|
|
20
|
+
<number bind="m" label="Monthly deposit" initial="500" min="0" step="100">
|
|
21
|
+
<slider bind="r" label="Annual rate (%)" initial="5" min="0" max="10" step="0.5">
|
|
22
|
+
<slider bind="t" label="Years" initial="20" min="1" max="40">
|
|
23
23
|
</panel>
|
|
24
24
|
|
|
25
|
-
<plot min="0" max="{{ t }}" label="
|
|
25
|
+
<plot min="0" max="{{ t }}" label="Savings growth" x-label="Years" y-label="Amount">
|
|
26
26
|
$$
|
|
27
27
|
y =
|
|
28
28
|
\begin{cases}
|
|
@@ -33,25 +33,25 @@ P\left(1+\frac{r}{1200}\right)^{12x}
|
|
|
33
33
|
$$
|
|
34
34
|
</plot>
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Move the pointer to the end of the curve to read the balance at the end of year {{ t }}. Set the annual rate to 0 to compare growth from deposits alone.
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Shares and scatter
|
|
39
39
|
|
|
40
40
|
<grid>
|
|
41
|
-
<card title="
|
|
42
|
-
<chart kind="donut" title="
|
|
43
|
-
|
|
|
41
|
+
<card title="Cost share">
|
|
42
|
+
<chart kind="donut" title="Share of actual cost">
|
|
43
|
+
| Category | Actual cost |
|
|
44
44
|
| --- | ---: |
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
45
|
+
| Content | 120 |
|
|
46
|
+
| Visual | 230 |
|
|
47
|
+
| Interaction | 180 |
|
|
48
|
+
| Testing | 90 |
|
|
49
49
|
</chart>
|
|
50
50
|
</card>
|
|
51
51
|
|
|
52
|
-
<card title="
|
|
53
|
-
<chart kind="scatter" title="
|
|
54
|
-
|
|
|
52
|
+
<card title="Budget vs actual">
|
|
53
|
+
<chart kind="scatter" title="Budget scatter" x="Budget" y="Actual" x-label="Budget" y-label="Actual">
|
|
54
|
+
| Budget | Actual |
|
|
55
55
|
| ---: | ---: |
|
|
56
56
|
| 150 | 120 |
|
|
57
57
|
| 200 | 230 |
|
|
@@ -61,13 +61,13 @@ $$
|
|
|
61
61
|
</card>
|
|
62
62
|
</grid>
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## Charts read the same parameters
|
|
65
65
|
|
|
66
|
-
<slider bind="people" label="
|
|
66
|
+
<slider bind="people" label="People" initial="2" min="1" max="20">
|
|
67
67
|
|
|
68
|
-
<chart title="
|
|
69
|
-
|
|
|
68
|
+
<chart title="Plan cost by headcount" y-label="USD">
|
|
69
|
+
| Plan | Monthly cost |
|
|
70
70
|
| --- | ---: |
|
|
71
|
-
|
|
|
72
|
-
|
|
|
71
|
+
| Basic | {{ people * 20 }} |
|
|
72
|
+
| Pro | {{ people * 35 }} |
|
|
73
73
|
</chart>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Organize a walkthrough with a checklist
|
|
2
2
|
|
|
3
|
-
<panel title="
|
|
4
|
-
<checklist bind="done" label="
|
|
5
|
-
- [x]
|
|
6
|
-
- [ ]
|
|
7
|
-
- [ ]
|
|
3
|
+
<panel title="Walkthrough checklist">
|
|
4
|
+
<checklist bind="done" label="Complete these steps">
|
|
5
|
+
- [x] Read the source document
|
|
6
|
+
- [ ] Adjust parameters and watch the results
|
|
7
|
+
- [ ] Try it at phone width
|
|
8
8
|
</checklist>
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Done: **{{ len(done) }} / 3**.
|
|
11
11
|
|
|
12
|
-
<progress label="
|
|
12
|
+
<progress label="Completion" value="{{ len(done) / 3 * 100 }}">
|
|
13
13
|
|
|
14
14
|
<if when="{{ len(done) == 3 }}">
|
|
15
|
-
<alert tone="success" title="
|
|
16
|
-
|
|
15
|
+
<alert tone="success" title="Walkthrough complete">
|
|
16
|
+
You have read the source, tried the interactions and checked the narrow layout.
|
|
17
17
|
</alert>
|
|
18
18
|
</if>
|
|
19
19
|
</panel>
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Search, sorting and paging
|
|
22
22
|
|
|
23
|
-
<table label="
|
|
24
|
-
|
|
|
23
|
+
<table label="Component price examples" page-size="3">
|
|
24
|
+
| Name | Category | Price |
|
|
25
25
|
| --- | --- | ---: |
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
26
|
+
| Document | Basic | 20 |
|
|
27
|
+
| Parameter panel | Input | 45 |
|
|
28
|
+
| Chart | Visual | 80 |
|
|
29
|
+
| Diagram | Visual | 65 |
|
|
30
|
+
| Checklist | Basic | 30 |
|
|
31
|
+
| Plan | Utility | 35 |
|
|
32
32
|
</table>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Side by side, easier to compare
|
|
2
2
|
|
|
3
|
-
<panel title="
|
|
4
|
-
<toggle bind="annual" label="
|
|
3
|
+
<panel title="Payment method">
|
|
4
|
+
<toggle bind="annual" label="Pay annually and save 20%">
|
|
5
5
|
</panel>
|
|
6
6
|
|
|
7
7
|
<grid>
|
|
8
|
-
<card title="
|
|
9
|
-
|
|
8
|
+
<card title="Basic plan">
|
|
9
|
+
For individuals and small projects.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**{{ annual ? 80 : 100 }} USD per month**.
|
|
12
12
|
|
|
13
|
-
<badge
|
|
13
|
+
<badge>Local documents</badge>
|
|
14
14
|
</card>
|
|
15
15
|
|
|
16
|
-
<card title="
|
|
17
|
-
|
|
16
|
+
<card title="Pro plan">
|
|
17
|
+
For teams that need collaboration and room to grow.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**{{ annual ? 160 : 200 }} USD per month**.
|
|
20
20
|
|
|
21
|
-
<badge tone="success"
|
|
21
|
+
<badge tone="success">More components</badge>
|
|
22
22
|
</card>
|
|
23
23
|
</grid>
|
|
24
24
|
|
|
25
|
-
<tabs label="
|
|
26
|
-
<tab label="
|
|
27
|
-
|
|
|
25
|
+
<tabs label="Plan details">
|
|
26
|
+
<tab label="Feature comparison">
|
|
27
|
+
| Capability | Basic plan | Pro plan |
|
|
28
28
|
| --- | --- | --- |
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
29
|
+
| Parameter adjustment | Included | Included |
|
|
30
|
+
| Text binding | Included | Included |
|
|
31
|
+
| Content organization | Basic layout | Charts and diagrams |
|
|
32
32
|
</tab>
|
|
33
33
|
|
|
34
|
-
<tab label="
|
|
35
|
-
|
|
34
|
+
<tab label="Buying advice">
|
|
35
|
+
Choose a plan for what you need, then compare how the billing cycle changes the cost.
|
|
36
36
|
</tab>
|
|
37
37
|
</tabs>
|
|
38
38
|
|
|
39
39
|
<accordion>
|
|
40
|
-
<disclosure label="
|
|
41
|
-
|
|
40
|
+
<disclosure label="How is the cost calculated?">
|
|
41
|
+
Annual billing applies a 20% discount to the monthly list price, and the equivalent monthly cost is shown above.
|
|
42
42
|
</disclosure>
|
|
43
43
|
|
|
44
|
-
<disclosure label="
|
|
45
|
-
|
|
44
|
+
<disclosure label="Can I switch at any time?">
|
|
45
|
+
Toggle the switch above to compare the two billing cycles. This is a local calculation example.
|
|
46
46
|
</disclosure>
|
|
47
47
|
</accordion>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Organize interactions with content
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hover over <tooltip text="When an input changes, the related text and charts update automatically.">reactive bindings</tooltip>, or focus it with the keyboard to read the explanation.
|
|
4
4
|
|
|
5
|
-
<panel title="
|
|
6
|
-
<radio-group bind="preference" label="
|
|
7
|
-
<option value="concise"
|
|
8
|
-
<option value="detailed"
|
|
5
|
+
<panel title="Reading preferences">
|
|
6
|
+
<radio-group bind="preference" label="Explanation style">
|
|
7
|
+
<option value="concise">Concise</option>
|
|
8
|
+
<option value="detailed">Detailed</option>
|
|
9
9
|
</radio-group>
|
|
10
10
|
</panel>
|
|
11
11
|
|
|
12
12
|
<if when="{{ preference == 'concise' }}">
|
|
13
|
-
|
|
13
|
+
Name the input and reference it in the prose.
|
|
14
14
|
</if>
|
|
15
15
|
|
|
16
16
|
<if when="{{ preference == 'detailed' }}">
|
|
17
|
-
|
|
17
|
+
Name an input parameter with `bind` and read it with `{{ }}` to compute results. When readers adjust a control, the related content updates immediately.
|
|
18
18
|
</if>
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Read at your own pace
|
|
21
21
|
|
|
22
|
-
<accordion label="
|
|
23
|
-
<disclosure label="
|
|
24
|
-
|
|
22
|
+
<accordion label="Reading order">
|
|
23
|
+
<disclosure label="Understand the parameters" open>
|
|
24
|
+
Find what readers can change, such as headcount, unit price or amplitude.
|
|
25
25
|
</disclosure>
|
|
26
26
|
|
|
27
|
-
<disclosure label="
|
|
28
|
-
|
|
27
|
+
<disclosure label="Write down the relationship">
|
|
28
|
+
Connect inputs and results with an expression, for example `{{ people * 100 }}`.
|
|
29
29
|
</disclosure>
|
|
30
30
|
|
|
31
|
-
<disclosure label="
|
|
32
|
-
|
|
31
|
+
<disclosure label="Choose how to present it">
|
|
32
|
+
Use prose for a single result, charts for comparisons, and function curves for mathematical relationships.
|
|
33
33
|
</disclosure>
|
|
34
34
|
</accordion>
|
|
35
35
|
|
|
36
|
-
<alert title="
|
|
37
|
-
|
|
36
|
+
<alert title="Keep exploring">
|
|
37
|
+
Switch the option above and watch the explanation change.
|
|
38
38
|
</alert>
|
|
39
39
|
|
|
40
|
-
<badge tone="success"
|
|
40
|
+
<badge tone="success">Local interaction</badge>
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
>
|
|
44
|
+
> Headings, blockquotes, links and images still follow Markdown. Components only handle the parts that need interaction.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Counter
|
|
2
2
|
|
|
3
|
-
<counter bind="count" label="
|
|
3
|
+
<counter bind="count" label="Current value">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The prose can read it too: **{{ count }}**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Use the component's own plus, minus and reset buttons.
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Diagnostics example
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document intentionally keeps errors to exercise the diagnostic messages. Start with the other documents in this folder for correct examples.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Reference to a misspelled parameter name
|
|
6
6
|
|
|
7
|
-
<slider bind="seats" label="
|
|
7
|
+
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Current headcount: {{ seat }}.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Duplicate initial declaration
|
|
12
12
|
|
|
13
|
-
<number bind="seats" label="
|
|
13
|
+
<number bind="seats" label="Another headcount input" initial="3" min="1" max="20">
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Initial value out of range
|
|
16
16
|
|
|
17
|
-
<slider bind="ratio" label="
|
|
17
|
+
<slider bind="ratio" label="Ratio" initial="12" min="0" max="10">
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Condition type error
|
|
20
20
|
|
|
21
21
|
<if when="{{ seats }}">
|
|
22
|
-
|
|
22
|
+
This needs a boolean condition, such as seats greater than 5.
|
|
23
23
|
</if>
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Unknown tag
|
|
26
26
|
|
|
27
|
-
<slidr label="
|
|
27
|
+
<slidr label="Misspelled slider" />
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Event outside the local interaction language
|
|
30
30
|
|
|
31
|
-
<counter label="
|
|
31
|
+
<counter label="Counter" on-click="increment">
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Missing node
|
|
34
34
|
|
|
35
|
-
<diagram label="
|
|
36
|
-
<node id="input" label="
|
|
37
|
-
|
|
35
|
+
<diagram label="Broken edge">
|
|
36
|
+
<node id="input" label="Input">
|
|
37
|
+
This is the only node.
|
|
38
38
|
</node>
|
|
39
39
|
<edge from="input" to="missing">
|
|
40
40
|
</diagram>
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Unsupported math structure
|
|
43
43
|
|
|
44
|
-
<plot label="
|
|
44
|
+
<plot label="Integrals are not part of the plot grammar">
|
|
45
45
|
$$ y = \int_0^x t^2\,dt $$
|
|
46
46
|
</plot>
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Invalid chart data
|
|
49
49
|
|
|
50
|
-
<chart title="
|
|
51
|
-
|
|
|
50
|
+
<chart title="Units mixed into a numeric column">
|
|
51
|
+
| Item | Cost |
|
|
52
52
|
| --- | ---: |
|
|
53
|
-
|
|
|
53
|
+
| Content | 20 USD |
|
|
54
54
|
</chart>
|