reactive-md 0.4.1 → 0.5.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 +128 -113
- package/CHANGELOG.md +128 -113
- package/LICENSE +21 -21
- package/README-ch.md +152 -123
- package/README-en.md +176 -147
- package/README.md +176 -147
- package/THIRD_PARTY_NOTICES.md +94 -1
- package/bin/reactive-md.mjs +1 -1
- package/dist-library/reactive-md-editor.css +2 -0
- package/dist-library/reactive-md-editor.js +3710 -0
- package/dist-library/reactive-md-react.js +9035 -1558
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +98 -97
- package/dist-library/{runtime-D3QTVYaz.js → runtime-DPuMxM_y.js} +1978 -1583
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +7 -0
- package/dist-library/types/editor/editor-commands.d.ts +50 -0
- package/dist-library/types/editor/editor-i18n.d.ts +102 -0
- package/dist-library/types/editor/editor-toolbar.d.ts +24 -0
- package/dist-library/types/editor/extended-native-components.d.ts +58 -0
- package/dist-library/types/editor/index.d.ts +9 -0
- package/dist-library/types/editor/locale.d.ts +13 -0
- package/dist-library/types/editor/native-components.d.ts +47 -0
- package/dist-library/types/editor/source-authoring.d.ts +57 -0
- package/dist-library/types/editor/types.d.ts +44 -0
- package/dist-library/types/editor/use-gutter-metrics.d.ts +5 -0
- package/dist-library/types/editor/use-source-history.d.ts +16 -0
- package/dist-library/types/local/code-block.d.ts +24 -0
- package/dist-library/types/local/footnotes.d.ts +51 -0
- package/dist-library/types/local/image-view.d.ts +21 -0
- package/dist-library/types/local/types.d.ts +7 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +47 -36
- package/docs/compatibility-ch.md +12 -8
- package/docs/compatibility-en.md +12 -8
- package/docs/component-protocol-ch.md +2 -2
- package/docs/component-protocol-en.md +2 -2
- package/docs/editor-ch.md +216 -0
- package/docs/editor-en.md +216 -0
- package/docs/local-guide-ch.md +11 -5
- package/docs/local-guide-en.md +11 -5
- package/docs/local-interaction-syntax-ch.md +7 -2
- package/docs/local-interaction-syntax-en.md +7 -2
- package/docs/release-0.4.1-ch.md +23 -23
- package/docs/release-0.4.1-en.md +23 -23
- package/docs/release-0.5.0-ch.md +41 -0
- package/docs/release-0.5.0-en.md +41 -0
- package/docs/releasing-ch.md +108 -101
- package/docs/releasing-en.md +108 -101
- package/docs/shareable-export-ch.md +4 -2
- package/docs/shareable-export-en.md +4 -2
- package/examples/integration/core/package.json +7 -7
- package/examples/integration/react/index.html +12 -12
- package/examples/integration/react/main.jsx +21 -21
- package/examples/integration/react/package.json +9 -9
- package/examples/integration/react-editor.tsx +74 -0
- package/examples/local/catalog.reactive.md +20 -20
- package/examples/local/checklist.reactive.md +32 -32
- package/examples/local/comparison.reactive.md +47 -47
- package/examples/local/components.reactive.md +44 -44
- package/examples/local/counter.reactive.md +7 -7
- package/examples/local/diagnostics.reactive.md +54 -54
- package/examples/local/diagram.reactive.md +44 -44
- package/examples/local/gallery.reactive.md +61 -61
- package/examples/local/parameters.reactive.md +36 -36
- package/examples/local/planning.reactive.md +24 -24
- package/examples/local/pricing.reactive.md +20 -20
- package/examples/local/zh/catalog.reactive.md +20 -20
- package/examples/local/zh/charts.reactive.md +73 -73
- package/examples/local/zh/checklist.reactive.md +32 -32
- package/examples/local/zh/comparison.reactive.md +47 -47
- package/examples/local/zh/components.reactive.md +44 -44
- package/examples/local/zh/counter.reactive.md +7 -7
- package/examples/local/zh/diagnostics.reactive.md +54 -54
- package/examples/local/zh/diagram.reactive.md +44 -44
- package/examples/local/zh/gallery.reactive.md +61 -61
- package/examples/local/zh/parameters.reactive.md +36 -36
- package/examples/local/zh/planning.reactive.md +24 -24
- package/examples/local/zh/pricing.reactive.md +20 -20
- package/package.json +133 -91
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# Organize interactions with content
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
</radio-group>
|
|
10
|
-
</panel>
|
|
11
|
-
|
|
12
|
-
<if when="{{ preference == 'concise' }}">
|
|
13
|
-
Name the input and reference it in the prose.
|
|
14
|
-
</if>
|
|
15
|
-
|
|
16
|
-
<if when="{{ preference == 'detailed' }}">
|
|
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
|
-
</if>
|
|
19
|
-
|
|
20
|
-
## Read at your own pace
|
|
21
|
-
|
|
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
|
-
</disclosure>
|
|
26
|
-
|
|
27
|
-
<disclosure label="Write down the relationship">
|
|
28
|
-
Connect inputs and results with an expression, for example `{{ people * 100 }}`.
|
|
29
|
-
</disclosure>
|
|
30
|
-
|
|
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
|
-
</disclosure>
|
|
34
|
-
</accordion>
|
|
35
|
-
|
|
36
|
-
<alert title="Keep exploring">
|
|
37
|
-
Switch the option above and watch the explanation change.
|
|
38
|
-
</alert>
|
|
39
|
-
|
|
40
|
-
<badge tone="success">Local interaction</badge>
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
> Headings, blockquotes, links and images still follow Markdown. Components only handle the parts that need interaction.
|
|
1
|
+
# Organize interactions with content
|
|
2
|
+
|
|
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
|
+
|
|
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
|
+
</radio-group>
|
|
10
|
+
</panel>
|
|
11
|
+
|
|
12
|
+
<if when="{{ preference == 'concise' }}">
|
|
13
|
+
Name the input and reference it in the prose.
|
|
14
|
+
</if>
|
|
15
|
+
|
|
16
|
+
<if when="{{ preference == 'detailed' }}">
|
|
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
|
+
</if>
|
|
19
|
+
|
|
20
|
+
## Read at your own pace
|
|
21
|
+
|
|
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
|
+
</disclosure>
|
|
26
|
+
|
|
27
|
+
<disclosure label="Write down the relationship">
|
|
28
|
+
Connect inputs and results with an expression, for example `{{ people * 100 }}`.
|
|
29
|
+
</disclosure>
|
|
30
|
+
|
|
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
|
+
</disclosure>
|
|
34
|
+
</accordion>
|
|
35
|
+
|
|
36
|
+
<alert title="Keep exploring">
|
|
37
|
+
Switch the option above and watch the explanation change.
|
|
38
|
+
</alert>
|
|
39
|
+
|
|
40
|
+
<badge tone="success">Local interaction</badge>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
> Headings, blockquotes, links and images still follow Markdown. Components only handle the parts that need interaction.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Counter
|
|
2
|
-
|
|
3
|
-
<counter bind="count" label="Current value">
|
|
4
|
-
|
|
5
|
-
The prose can read it too: **{{ count }}**.
|
|
6
|
-
|
|
7
|
-
Use the component's own plus, minus and reset buttons.
|
|
1
|
+
# Counter
|
|
2
|
+
|
|
3
|
+
<counter bind="count" label="Current value">
|
|
4
|
+
|
|
5
|
+
The prose can read it too: **{{ count }}**.
|
|
6
|
+
|
|
7
|
+
Use the component's own plus, minus and reset buttons.
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
# Diagnostics example
|
|
2
|
-
|
|
3
|
-
This document intentionally keeps errors to exercise the diagnostic messages. Start with the other documents in this folder for correct examples.
|
|
4
|
-
|
|
5
|
-
## Reference to a misspelled parameter name
|
|
6
|
-
|
|
7
|
-
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
8
|
-
|
|
9
|
-
Current headcount: {{ seat }}.
|
|
10
|
-
|
|
11
|
-
## Duplicate initial declaration
|
|
12
|
-
|
|
13
|
-
<number bind="seats" label="Another headcount input" initial="3" min="1" max="20">
|
|
14
|
-
|
|
15
|
-
## Initial value out of range
|
|
16
|
-
|
|
17
|
-
<slider bind="ratio" label="Ratio" initial="12" min="0" max="10">
|
|
18
|
-
|
|
19
|
-
## Condition type error
|
|
20
|
-
|
|
21
|
-
<if when="{{ seats }}">
|
|
22
|
-
This needs a boolean condition, such as seats greater than 5.
|
|
23
|
-
</if>
|
|
24
|
-
|
|
25
|
-
## Unknown tag
|
|
26
|
-
|
|
27
|
-
<slidr label="Misspelled slider" />
|
|
28
|
-
|
|
29
|
-
## Event outside the local interaction language
|
|
30
|
-
|
|
31
|
-
<counter label="Counter" on-click="increment">
|
|
32
|
-
|
|
33
|
-
## Missing node
|
|
34
|
-
|
|
35
|
-
<diagram label="Broken edge">
|
|
36
|
-
<node id="input" label="Input">
|
|
37
|
-
This is the only node.
|
|
38
|
-
</node>
|
|
39
|
-
<edge from="input" to="missing">
|
|
40
|
-
</diagram>
|
|
41
|
-
|
|
42
|
-
## Unsupported math structure
|
|
43
|
-
|
|
44
|
-
<plot label="Integrals are not part of the plot grammar">
|
|
45
|
-
$$ y = \int_0^x t^2\,dt $$
|
|
46
|
-
</plot>
|
|
47
|
-
|
|
48
|
-
## Invalid chart data
|
|
49
|
-
|
|
50
|
-
<chart title="Units mixed into a numeric column">
|
|
51
|
-
| Item | Cost |
|
|
52
|
-
| --- | ---: |
|
|
53
|
-
| Content | 20 USD |
|
|
54
|
-
</chart>
|
|
1
|
+
# Diagnostics example
|
|
2
|
+
|
|
3
|
+
This document intentionally keeps errors to exercise the diagnostic messages. Start with the other documents in this folder for correct examples.
|
|
4
|
+
|
|
5
|
+
## Reference to a misspelled parameter name
|
|
6
|
+
|
|
7
|
+
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
8
|
+
|
|
9
|
+
Current headcount: {{ seat }}.
|
|
10
|
+
|
|
11
|
+
## Duplicate initial declaration
|
|
12
|
+
|
|
13
|
+
<number bind="seats" label="Another headcount input" initial="3" min="1" max="20">
|
|
14
|
+
|
|
15
|
+
## Initial value out of range
|
|
16
|
+
|
|
17
|
+
<slider bind="ratio" label="Ratio" initial="12" min="0" max="10">
|
|
18
|
+
|
|
19
|
+
## Condition type error
|
|
20
|
+
|
|
21
|
+
<if when="{{ seats }}">
|
|
22
|
+
This needs a boolean condition, such as seats greater than 5.
|
|
23
|
+
</if>
|
|
24
|
+
|
|
25
|
+
## Unknown tag
|
|
26
|
+
|
|
27
|
+
<slidr label="Misspelled slider" />
|
|
28
|
+
|
|
29
|
+
## Event outside the local interaction language
|
|
30
|
+
|
|
31
|
+
<counter label="Counter" on-click="increment">
|
|
32
|
+
|
|
33
|
+
## Missing node
|
|
34
|
+
|
|
35
|
+
<diagram label="Broken edge">
|
|
36
|
+
<node id="input" label="Input">
|
|
37
|
+
This is the only node.
|
|
38
|
+
</node>
|
|
39
|
+
<edge from="input" to="missing">
|
|
40
|
+
</diagram>
|
|
41
|
+
|
|
42
|
+
## Unsupported math structure
|
|
43
|
+
|
|
44
|
+
<plot label="Integrals are not part of the plot grammar">
|
|
45
|
+
$$ y = \int_0^x t^2\,dt $$
|
|
46
|
+
</plot>
|
|
47
|
+
|
|
48
|
+
## Invalid chart data
|
|
49
|
+
|
|
50
|
+
<chart title="Units mixed into a numeric column">
|
|
51
|
+
| Item | Cost |
|
|
52
|
+
| --- | ---: |
|
|
53
|
+
| Content | 20 USD |
|
|
54
|
+
</chart>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# Make explanations explorable
|
|
2
|
-
|
|
3
|
-
Click a node or use the keyboard to select a step and read its description.
|
|
4
|
-
|
|
5
|
-
<diagram bind="selected" initial="input" label="Reactive state flow">
|
|
6
|
-
<node id="input" label="Input">
|
|
7
|
-
Readers change parameters with sliders, switches and text fields.
|
|
8
|
-
</node>
|
|
9
|
-
|
|
10
|
-
<node id="compute" label="Compute">
|
|
11
|
-
Formulas that depend on those parameters are recalculated.
|
|
12
|
-
</node>
|
|
13
|
-
|
|
14
|
-
<node id="view" label="View">
|
|
15
|
-
Prose, charts and hints update with the result.
|
|
16
|
-
</node>
|
|
17
|
-
|
|
18
|
-
<edge from="input" to="compute" label="Parameter change">
|
|
19
|
-
<edge from="compute" to="view" label="Updated result">
|
|
20
|
-
</diagram>
|
|
21
|
-
|
|
22
|
-
Current step: {{ selected == 'input' ? 'Input' : selected == 'compute' ? 'Compute' : 'View' }}.
|
|
23
|
-
|
|
24
|
-
## Change parameters and watch the curve
|
|
25
|
-
|
|
26
|
-
<panel title="Sine wave parameters">
|
|
27
|
-
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
28
|
-
<slider bind="f" label="Frequency parameter" initial="1" min="0.5" max="3" step="0.5">
|
|
29
|
-
</panel>
|
|
30
|
-
|
|
31
|
-
<plot min="0" max="12.56" label="Sine wave" x-label="x" y-label="Displacement">
|
|
32
|
-
$$ y = a\sin(fx) $$
|
|
33
|
-
</plot>
|
|
34
|
-
|
|
35
|
-
<if when="{{ a == 0 }}">
|
|
36
|
-
The amplitude is zero, so the curve lies flat on the horizontal axis.
|
|
37
|
-
</if>
|
|
38
|
-
|
|
39
|
-
## Overlay two curves
|
|
40
|
-
|
|
41
|
-
<plot min="-5" max="5" label="Parabola and line">
|
|
42
|
-
$$ y = x^2 $$
|
|
43
|
-
$$ y = 2x + 1 $$
|
|
44
|
-
</plot>
|
|
1
|
+
# Make explanations explorable
|
|
2
|
+
|
|
3
|
+
Click a node or use the keyboard to select a step and read its description.
|
|
4
|
+
|
|
5
|
+
<diagram bind="selected" initial="input" label="Reactive state flow">
|
|
6
|
+
<node id="input" label="Input">
|
|
7
|
+
Readers change parameters with sliders, switches and text fields.
|
|
8
|
+
</node>
|
|
9
|
+
|
|
10
|
+
<node id="compute" label="Compute">
|
|
11
|
+
Formulas that depend on those parameters are recalculated.
|
|
12
|
+
</node>
|
|
13
|
+
|
|
14
|
+
<node id="view" label="View">
|
|
15
|
+
Prose, charts and hints update with the result.
|
|
16
|
+
</node>
|
|
17
|
+
|
|
18
|
+
<edge from="input" to="compute" label="Parameter change">
|
|
19
|
+
<edge from="compute" to="view" label="Updated result">
|
|
20
|
+
</diagram>
|
|
21
|
+
|
|
22
|
+
Current step: {{ selected == 'input' ? 'Input' : selected == 'compute' ? 'Compute' : 'View' }}.
|
|
23
|
+
|
|
24
|
+
## Change parameters and watch the curve
|
|
25
|
+
|
|
26
|
+
<panel title="Sine wave parameters">
|
|
27
|
+
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
28
|
+
<slider bind="f" label="Frequency parameter" initial="1" min="0.5" max="3" step="0.5">
|
|
29
|
+
</panel>
|
|
30
|
+
|
|
31
|
+
<plot min="0" max="12.56" label="Sine wave" x-label="x" y-label="Displacement">
|
|
32
|
+
$$ y = a\sin(fx) $$
|
|
33
|
+
</plot>
|
|
34
|
+
|
|
35
|
+
<if when="{{ a == 0 }}">
|
|
36
|
+
The amplitude is zero, so the curve lies flat on the horizontal axis.
|
|
37
|
+
</if>
|
|
38
|
+
|
|
39
|
+
## Overlay two curves
|
|
40
|
+
|
|
41
|
+
<plot min="-5" max="5" label="Parabola and line">
|
|
42
|
+
$$ y = x^2 $$
|
|
43
|
+
$$ y = 2x + 1 $$
|
|
44
|
+
</plot>
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
# Common component gallery
|
|
2
|
-
|
|
3
|
-
## Inputs and live results
|
|
4
|
-
|
|
5
|
-
<panel title="Describe your plan">
|
|
6
|
-
<input bind="name" label="Name" initial="Alex" placeholder="Enter a name">
|
|
7
|
-
<number bind="quantity" label="Quantity" initial="3" min="1" max="20">
|
|
8
|
-
|
|
9
|
-
<select bind="plan" label="Plan" initial="pro">
|
|
10
|
-
<option value="basic">Basic</option>
|
|
11
|
-
<option value="pro">Pro</option>
|
|
12
|
-
</select>
|
|
13
|
-
|
|
14
|
-
<toggle bind="annual" label="Annual billing (20% off)">
|
|
15
|
-
<toggle bind="express" label="Show express checklist" initial="true">
|
|
16
|
-
<slider bind="budgetLevel" label="Budget level" initial="50" step="10">
|
|
17
|
-
</panel>
|
|
18
|
-
|
|
19
|
-
Hello, **{{ name }}**.
|
|
20
|
-
|
|
21
|
-
Estimated cost: **{{ round(quantity * 80 * (plan == 'pro' ? 1 : 0.8) * (annual ? 0.8 : 1)) }} USD**.
|
|
22
|
-
|
|
23
|
-
<if when="{{ quantity >= 5 }}">
|
|
24
|
-
<badge tone="success">Team tier reached</badge>
|
|
25
|
-
</if>
|
|
26
|
-
|
|
27
|
-
| Condition | Current choice |
|
|
28
|
-
| --- | --- |
|
|
29
|
-
| Plan | {{ plan == 'pro' ? 'Pro' : 'Basic' }} |
|
|
30
|
-
| Annual billing | {{ annual ? 'On' : 'Off' }} |
|
|
31
|
-
| Budget level | {{ budgetLevel }} |
|
|
32
|
-
|
|
33
|
-
<if when="{{ express }}">
|
|
34
|
-
<checklist label="Express preparation">
|
|
35
|
-
- [x] Express checklist shown
|
|
36
|
-
- [ ] Confirm the delivery time
|
|
37
|
-
</checklist>
|
|
38
|
-
</if>
|
|
39
|
-
|
|
40
|
-
## Components that work on their own
|
|
41
|
-
|
|
42
|
-
These components do not expose parameters to the prose, so they omit bind.
|
|
43
|
-
|
|
44
|
-
<grid>
|
|
45
|
-
<card title="People counter">
|
|
46
|
-
<counter label="Participants" initial="2" min="1" max="20">
|
|
47
|
-
</card>
|
|
48
|
-
|
|
49
|
-
<card title="Short focus">
|
|
50
|
-
<timer label="One-minute countdown">
|
|
51
|
-
</card>
|
|
52
|
-
</grid>
|
|
53
|
-
|
|
54
|
-
## Show code as-is
|
|
55
|
-
|
|
56
|
-
```markdown
|
|
57
|
-
<slider bind="example" label="Example parameter">
|
|
58
|
-
Current value: {{ example }}.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
The code above is displayed as an example only and does not create a control.
|
|
1
|
+
# Common component gallery
|
|
2
|
+
|
|
3
|
+
## Inputs and live results
|
|
4
|
+
|
|
5
|
+
<panel title="Describe your plan">
|
|
6
|
+
<input bind="name" label="Name" initial="Alex" placeholder="Enter a name">
|
|
7
|
+
<number bind="quantity" label="Quantity" initial="3" min="1" max="20">
|
|
8
|
+
|
|
9
|
+
<select bind="plan" label="Plan" initial="pro">
|
|
10
|
+
<option value="basic">Basic</option>
|
|
11
|
+
<option value="pro">Pro</option>
|
|
12
|
+
</select>
|
|
13
|
+
|
|
14
|
+
<toggle bind="annual" label="Annual billing (20% off)">
|
|
15
|
+
<toggle bind="express" label="Show express checklist" initial="true">
|
|
16
|
+
<slider bind="budgetLevel" label="Budget level" initial="50" step="10">
|
|
17
|
+
</panel>
|
|
18
|
+
|
|
19
|
+
Hello, **{{ name }}**.
|
|
20
|
+
|
|
21
|
+
Estimated cost: **{{ round(quantity * 80 * (plan == 'pro' ? 1 : 0.8) * (annual ? 0.8 : 1)) }} USD**.
|
|
22
|
+
|
|
23
|
+
<if when="{{ quantity >= 5 }}">
|
|
24
|
+
<badge tone="success">Team tier reached</badge>
|
|
25
|
+
</if>
|
|
26
|
+
|
|
27
|
+
| Condition | Current choice |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Plan | {{ plan == 'pro' ? 'Pro' : 'Basic' }} |
|
|
30
|
+
| Annual billing | {{ annual ? 'On' : 'Off' }} |
|
|
31
|
+
| Budget level | {{ budgetLevel }} |
|
|
32
|
+
|
|
33
|
+
<if when="{{ express }}">
|
|
34
|
+
<checklist label="Express preparation">
|
|
35
|
+
- [x] Express checklist shown
|
|
36
|
+
- [ ] Confirm the delivery time
|
|
37
|
+
</checklist>
|
|
38
|
+
</if>
|
|
39
|
+
|
|
40
|
+
## Components that work on their own
|
|
41
|
+
|
|
42
|
+
These components do not expose parameters to the prose, so they omit bind.
|
|
43
|
+
|
|
44
|
+
<grid>
|
|
45
|
+
<card title="People counter">
|
|
46
|
+
<counter label="Participants" initial="2" min="1" max="20">
|
|
47
|
+
</card>
|
|
48
|
+
|
|
49
|
+
<card title="Short focus">
|
|
50
|
+
<timer label="One-minute countdown">
|
|
51
|
+
</card>
|
|
52
|
+
</grid>
|
|
53
|
+
|
|
54
|
+
## Show code as-is
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
<slider bind="example" label="Example parameter">
|
|
58
|
+
Current value: {{ example }}.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The code above is displayed as an example only and does not create a control.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# Fill it in, watch the result
|
|
2
|
-
|
|
3
|
-
Enter your preferences and the description below updates immediately.
|
|
4
|
-
|
|
5
|
-
<panel title="Meeting preparation">
|
|
6
|
-
<input bind="name" label="Name" placeholder="What should we call you?">
|
|
7
|
-
|
|
8
|
-
<choices bind="role" label="Usage">
|
|
9
|
-
<option value="personal">Personal use</option>
|
|
10
|
-
<option value="team">Team use</option>
|
|
11
|
-
</choices>
|
|
12
|
-
|
|
13
|
-
<date bind="appointment" label="Preferred meeting date" initial="2026-10-22">
|
|
14
|
-
|
|
15
|
-
<textarea bind="message" label="What interactive document do you want to build?" placeholder="For example: a course handout with adjustable parameters">
|
|
16
|
-
|
|
17
|
-
<checkbox bind="showNotes" label="Show the preparation checklist">
|
|
18
|
-
</panel>
|
|
19
|
-
|
|
20
|
-
<card title="Current plan">
|
|
21
|
-
Name: **{{ name == '' ? 'Not provided yet' : name }}**.
|
|
22
|
-
|
|
23
|
-
Usage: {{ role == 'personal' ? 'Personal use' : 'Team use' }}.
|
|
24
|
-
|
|
25
|
-
Planned date: {{ appointment }}.
|
|
26
|
-
|
|
27
|
-
Idea: {{ message == '' ? 'Start with a small calculator.' : message }}
|
|
28
|
-
</card>
|
|
29
|
-
|
|
30
|
-
<if when="{{ showNotes }}">
|
|
31
|
-
<checklist label="Before the meeting">
|
|
32
|
-
- [ ] Decide which parameters readers need to adjust
|
|
33
|
-
- [ ] Prepare a concrete calculation or chart example
|
|
34
|
-
- [ ] Write down the changes you want readers to notice
|
|
35
|
-
</checklist>
|
|
36
|
-
</if>
|
|
1
|
+
# Fill it in, watch the result
|
|
2
|
+
|
|
3
|
+
Enter your preferences and the description below updates immediately.
|
|
4
|
+
|
|
5
|
+
<panel title="Meeting preparation">
|
|
6
|
+
<input bind="name" label="Name" placeholder="What should we call you?">
|
|
7
|
+
|
|
8
|
+
<choices bind="role" label="Usage">
|
|
9
|
+
<option value="personal">Personal use</option>
|
|
10
|
+
<option value="team">Team use</option>
|
|
11
|
+
</choices>
|
|
12
|
+
|
|
13
|
+
<date bind="appointment" label="Preferred meeting date" initial="2026-10-22">
|
|
14
|
+
|
|
15
|
+
<textarea bind="message" label="What interactive document do you want to build?" placeholder="For example: a course handout with adjustable parameters">
|
|
16
|
+
|
|
17
|
+
<checkbox bind="showNotes" label="Show the preparation checklist">
|
|
18
|
+
</panel>
|
|
19
|
+
|
|
20
|
+
<card title="Current plan">
|
|
21
|
+
Name: **{{ name == '' ? 'Not provided yet' : name }}**.
|
|
22
|
+
|
|
23
|
+
Usage: {{ role == 'personal' ? 'Personal use' : 'Team use' }}.
|
|
24
|
+
|
|
25
|
+
Planned date: {{ appointment }}.
|
|
26
|
+
|
|
27
|
+
Idea: {{ message == '' ? 'Start with a small calculator.' : message }}
|
|
28
|
+
</card>
|
|
29
|
+
|
|
30
|
+
<if when="{{ showNotes }}">
|
|
31
|
+
<checklist label="Before the meeting">
|
|
32
|
+
- [ ] Decide which parameters readers need to adjust
|
|
33
|
+
- [ ] Prepare a concrete calculation or chart example
|
|
34
|
+
- [ ] Write down the changes you want readers to notice
|
|
35
|
+
</checklist>
|
|
36
|
+
</if>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# Planning, timing and simple tools
|
|
2
|
-
|
|
3
|
-
<timeline title="45-minute work plan">
|
|
4
|
-
| Task | Start | Duration | Notes |
|
|
5
|
-
| --- | ---: | ---: | --- |
|
|
6
|
-
| Prepare materials | 0 | 10 | List what you need first |
|
|
7
|
-
| Draft the main section | 10 | 25 | Focus on the core content |
|
|
8
|
-
| Assemble references | 15 | 15 | Can run in parallel with the main section |
|
|
9
|
-
| Review and deliver | 35 | 10 | Leave time for a final check |
|
|
10
|
-
</timeline>
|
|
11
|
-
|
|
12
|
-
<timer label="One-minute focus timer" duration="60">
|
|
13
|
-
|
|
14
|
-
## Splitting a dinner bill
|
|
15
|
-
|
|
16
|
-
<panel title="Bill parameters">
|
|
17
|
-
<number bind="total" label="Bill amount" initial="240" min="0">
|
|
18
|
-
<slider bind="people" label="People" initial="3" min="1" max="12">
|
|
19
|
-
<slider bind="tip" label="Extra charge (%)" initial="10" min="0" max="20">
|
|
20
|
-
</panel>
|
|
21
|
-
|
|
22
|
-
Each person pays **{{ round(total * (1 + tip / 100) / people * 100) / 100 }} USD**.
|
|
23
|
-
|
|
24
|
-
Amounts are rounded to two decimals without padding trailing zeros.
|
|
1
|
+
# Planning, timing and simple tools
|
|
2
|
+
|
|
3
|
+
<timeline title="45-minute work plan">
|
|
4
|
+
| Task | Start | Duration | Notes |
|
|
5
|
+
| --- | ---: | ---: | --- |
|
|
6
|
+
| Prepare materials | 0 | 10 | List what you need first |
|
|
7
|
+
| Draft the main section | 10 | 25 | Focus on the core content |
|
|
8
|
+
| Assemble references | 15 | 15 | Can run in parallel with the main section |
|
|
9
|
+
| Review and deliver | 35 | 10 | Leave time for a final check |
|
|
10
|
+
</timeline>
|
|
11
|
+
|
|
12
|
+
<timer label="One-minute focus timer" duration="60">
|
|
13
|
+
|
|
14
|
+
## Splitting a dinner bill
|
|
15
|
+
|
|
16
|
+
<panel title="Bill parameters">
|
|
17
|
+
<number bind="total" label="Bill amount" initial="240" min="0">
|
|
18
|
+
<slider bind="people" label="People" initial="3" min="1" max="12">
|
|
19
|
+
<slider bind="tip" label="Extra charge (%)" initial="10" min="0" max="20">
|
|
20
|
+
</panel>
|
|
21
|
+
|
|
22
|
+
Each person pays **{{ round(total * (1 + tip / 100) / people * 100) / 100 }} USD**.
|
|
23
|
+
|
|
24
|
+
Amounts are rounded to two decimals without padding trailing zeros.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Plan calculator
|
|
2
|
-
|
|
3
|
-
Adjust the headcount and billing cycle to compare the average monthly cost. Each person costs 100 USD per month, and annual billing takes 20% off.
|
|
4
|
-
|
|
5
|
-
<panel title="Your plan">
|
|
6
|
-
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
7
|
-
<toggle bind="annual" label="Annual billing">
|
|
8
|
-
</panel>
|
|
9
|
-
|
|
10
|
-
Current headcount: **{{ seats }}**.
|
|
11
|
-
|
|
12
|
-
Per person per month: **{{ annual ? 80 : 100 }} USD**.
|
|
13
|
-
|
|
14
|
-
Monthly total: **{{ seats * (annual ? 80 : 100) }} USD**.
|
|
15
|
-
|
|
16
|
-
<if when="{{ seats >= 5 }}">
|
|
17
|
-
<alert title="Team plan">
|
|
18
|
-
You selected at least 5 people. Switch the billing cycle to compare costs.
|
|
19
|
-
</alert>
|
|
20
|
-
</if>
|
|
1
|
+
# Plan calculator
|
|
2
|
+
|
|
3
|
+
Adjust the headcount and billing cycle to compare the average monthly cost. Each person costs 100 USD per month, and annual billing takes 20% off.
|
|
4
|
+
|
|
5
|
+
<panel title="Your plan">
|
|
6
|
+
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
7
|
+
<toggle bind="annual" label="Annual billing">
|
|
8
|
+
</panel>
|
|
9
|
+
|
|
10
|
+
Current headcount: **{{ seats }}**.
|
|
11
|
+
|
|
12
|
+
Per person per month: **{{ annual ? 80 : 100 }} USD**.
|
|
13
|
+
|
|
14
|
+
Monthly total: **{{ seats * (annual ? 80 : 100) }} USD**.
|
|
15
|
+
|
|
16
|
+
<if when="{{ seats >= 5 }}">
|
|
17
|
+
<alert title="Team plan">
|
|
18
|
+
You selected at least 5 people. Switch the billing cycle to compare costs.
|
|
19
|
+
</alert>
|
|
20
|
+
</if>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# 在文档里查找组件
|
|
2
|
-
|
|
3
|
-
在表格的搜索框输入“视觉”“参数”或其他关键词。点击列名可以排序,分页控件用于翻页。
|
|
4
|
-
|
|
5
|
-
<panel title="本地组件目录">
|
|
6
|
-
<table label="组件目录" page-size="4">
|
|
7
|
-
| 名称 | 分类 | 用途 |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
| slider | 参数 | 拖动调整数字 |
|
|
10
|
-
| toggle | 参数 | 切换开关 |
|
|
11
|
-
| choices | 参数 | 从几个方案中选择 |
|
|
12
|
-
| chart | 视觉 | 把 Markdown 表格变成图表 |
|
|
13
|
-
| plot | 视觉 | 使用 LaTeX 绘制函数 |
|
|
14
|
-
| diagram | 视觉 | 点击节点探索说明 |
|
|
15
|
-
| checklist | 内容 | 勾选完成事项 |
|
|
16
|
-
| timer | 工具 | 开始、暂停和重置倒计时 |
|
|
17
|
-
</table>
|
|
18
|
-
</panel>
|
|
19
|
-
|
|
20
|
-
目录数据就在这份文档中。搜索时直接筛选表格内容,恢复默认会清空查询并回到原始顺序。
|
|
1
|
+
# 在文档里查找组件
|
|
2
|
+
|
|
3
|
+
在表格的搜索框输入“视觉”“参数”或其他关键词。点击列名可以排序,分页控件用于翻页。
|
|
4
|
+
|
|
5
|
+
<panel title="本地组件目录">
|
|
6
|
+
<table label="组件目录" page-size="4">
|
|
7
|
+
| 名称 | 分类 | 用途 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| slider | 参数 | 拖动调整数字 |
|
|
10
|
+
| toggle | 参数 | 切换开关 |
|
|
11
|
+
| choices | 参数 | 从几个方案中选择 |
|
|
12
|
+
| chart | 视觉 | 把 Markdown 表格变成图表 |
|
|
13
|
+
| plot | 视觉 | 使用 LaTeX 绘制函数 |
|
|
14
|
+
| diagram | 视觉 | 点击节点探索说明 |
|
|
15
|
+
| checklist | 内容 | 勾选完成事项 |
|
|
16
|
+
| timer | 工具 | 开始、暂停和重置倒计时 |
|
|
17
|
+
</table>
|
|
18
|
+
</panel>
|
|
19
|
+
|
|
20
|
+
目录数据就在这份文档中。搜索时直接筛选表格内容,恢复默认会清空查询并回到原始顺序。
|