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,126 +1,126 @@
|
|
|
1
|
-
<computed name="organizer" value="{{ trim(name) == '' ? 'Your group' : trim(name) }}">
|
|
2
|
-
<computed name="unitCost" value="{{ (format == 'onsite' ? 80 : 60) + (equipment ? 20 : 0) }}">
|
|
3
|
-
<computed name="total" value="{{ seats * unitCost }}">
|
|
4
|
-
<computed name="datesReady" value="{{ date != '' && deadline != '' && dateCompare(deadline, date) <= 0 }}">
|
|
5
|
-
<computed name="registrationGap" value="{{ datesReady ? dateDiff(date, deadline) : null }}">
|
|
6
|
-
|
|
7
|
-
# Build a workshop plan
|
|
8
|
-
|
|
9
|
-
Change the name, headcount and format. Lower the budget or move the registration deadline past the workshop to see a hint; choose subjects to generate a preparation plan.
|
|
10
|
-
|
|
11
|
-
<grid>
|
|
12
|
-
<card>
|
|
13
|
-
<panel title="Workshop details">
|
|
14
|
-
<input bind="name" label="Organizer" initial="Alex" placeholder="Your name">
|
|
15
|
-
<choices bind="format" label="Format" initial="onsite">
|
|
16
|
-
<option value="onsite">In person</option>
|
|
17
|
-
<option value="online">Online</option>
|
|
18
|
-
</choices>
|
|
19
|
-
<slider bind="seats" label="Participants" initial="4" min="1" max="20">
|
|
20
|
-
<date bind="date" label="Workshop date" initial="2026-11-01">
|
|
21
|
-
<date bind="deadline" label="Registration deadline" initial="2026-10-25">
|
|
22
|
-
<number bind="budget" label="Spending limit" initial="500" min="0" max="5000" step="10">
|
|
23
|
-
<validation when="{{ datesReady }}" message="Fill both dates and close registration on or before the workshop date." fields="deadline date">
|
|
24
|
-
<validation when="{{ total <= budget }}" message="Estimate exceeds the limit by {{ formatCurrency(total - budget, 'USD', 2, 'en-US') }}; adjust participants, materials or the limit." fields="seats equipment budget">
|
|
25
|
-
<textarea bind="notes" label="Special requests" placeholder="What would help your group?">
|
|
26
|
-
<toggle bind="equipment" label="Include a materials kit (20 per person)">
|
|
27
|
-
</panel>
|
|
28
|
-
</card>
|
|
29
|
-
|
|
30
|
-
<card title="Your workshop at a glance">
|
|
31
|
-
**{{ organizer }}** · {{ date }}
|
|
32
|
-
|
|
33
|
-
{{ format == 'onsite' ? 'In-person workshop' : 'Online workshop' }} · **{{ seats }}** participants
|
|
34
|
-
|
|
35
|
-
Per person: **{{ formatCurrency(unitCost, 'USD', 2, 'en-US') }}**
|
|
36
|
-
|
|
37
|
-
Estimated total: **{{ formatCurrency(total, 'USD', 2, 'en-US') }}**
|
|
38
|
-
|
|
39
|
-
<badge tone="{{ total <= budget ? 'success' : 'warning' }}">Spending limit: {{ formatCurrency(budget, 'USD', 2, 'en-US') }}</badge>
|
|
40
|
-
|
|
41
|
-
<if when="{{ datesReady }}">
|
|
42
|
-
Registration closes **{{ deadline }}**, **{{ registrationGap }}** days before the workshop.
|
|
43
|
-
</if>
|
|
44
|
-
|
|
45
|
-
Requests: {{ trim(notes) == '' ? 'No special requests yet.' : trim(notes) }}
|
|
46
|
-
|
|
47
|
-
<if when="{{ format == 'onsite' }}">
|
|
48
|
-
<alert title="Prepare the room">Reserve a room with at least {{ seats }} seats and arrange a shared display.</alert>
|
|
49
|
-
</if>
|
|
50
|
-
<if when="{{ format == 'online' }}">
|
|
51
|
-
<alert title="Prepare the call">Share the meeting link and check that everyone can open the workshop document.</alert>
|
|
52
|
-
</if>
|
|
53
|
-
</card>
|
|
54
|
-
</grid>
|
|
55
|
-
|
|
56
|
-
## Try a complete change
|
|
57
|
-
|
|
58
|
-
Choose Online, set 6 participants and add materials: the estimate becomes **{{ formatCurrency(480, 'USD', 2, 'en-US') }}**. Reset Workshop details to return to the original **{{ formatCurrency(320, 'USD', 2, 'en-US') }}**.
|
|
59
|
-
|
|
60
|
-
## Tailor the workshop to your group
|
|
61
|
-
|
|
62
|
-
Choose the level, pace and subjects. These details shape the learning plan alongside the cost estimate above.
|
|
63
|
-
|
|
64
|
-
<panel title="Learning preferences">
|
|
65
|
-
<select bind="level" label="Experience level" initial="intro">
|
|
66
|
-
<option value="intro">First workshop</option>
|
|
67
|
-
<option value="advanced">Already familiar</option>
|
|
68
|
-
</select>
|
|
69
|
-
|
|
70
|
-
<radio-group bind="pace" label="Session pace" initial="guided">
|
|
71
|
-
<option value="guided">Guided practice</option>
|
|
72
|
-
<option value="independent">Independent exploration</option>
|
|
73
|
-
</radio-group>
|
|
74
|
-
|
|
75
|
-
<multi-select bind="subjects" label="Workshop subjects" max-selected="2" color="#167875">
|
|
76
|
-
<option value="math">Mathematics</option>
|
|
77
|
-
<option value="physics">Physics</option>
|
|
78
|
-
<option value="chemistry">Chemistry</option>
|
|
79
|
-
</multi-select>
|
|
80
|
-
|
|
81
|
-
<checkbox bind="accessible" label="Include a written step-by-step guide">
|
|
82
|
-
|
|
83
|
-
| Detail | Your choice |
|
|
84
|
-
| --- | --- |
|
|
85
|
-
| Level | {{ level == 'intro' ? 'Start with a worked example' : 'Compare several approaches' }} |
|
|
86
|
-
| Pace | {{ pace == 'guided' ? 'Work through the steps together' : 'Leave time to explore independently' }} |
|
|
87
|
-
| Subjects | {{ len(subjects) }} / 2 selected |
|
|
88
|
-
|
|
89
|
-
<data-table label="Subject preparation" rows="{{ subjects }}" key="{{ item }}" max-rows="2">
|
|
90
|
-
<column label="Subject" value="{{ item == 'math' ? 'Mathematics' : item == 'physics' ? 'Physics' : 'Chemistry' }}">
|
|
91
|
-
<column label="Preparation" value="{{ item == 'chemistry' ? 'Prepare materials and instructions' : 'Prepare a worked example' }}">
|
|
92
|
-
<column label="Guide" value="{{ accessible ? 'Written steps included' : 'Live explanation' }}">
|
|
93
|
-
</data-table>
|
|
94
|
-
|
|
95
|
-
<if when="{{ contains(subjects, 'chemistry') }}">
|
|
96
|
-
<badge color="#167875">Include a chemistry example</badge>
|
|
97
|
-
</if>
|
|
98
|
-
<if when="{{ accessible }}">
|
|
99
|
-
<alert title="Prepare the written guide">Include the parameter names and the expected result for each step.</alert>
|
|
100
|
-
</if>
|
|
101
|
-
</panel>
|
|
102
|
-
|
|
103
|
-
## How it is written
|
|
104
|
-
|
|
105
|
-
<accordion>
|
|
106
|
-
<disclosure label="Show the key source">
|
|
107
|
-
|
|
108
|
-
```markdown
|
|
109
|
-
<const name="rate" value="{{ 80 }}">
|
|
110
|
-
<computed name="total" value="{{ seats * rate }}">
|
|
111
|
-
<slider bind="seats" label="Participants" initial="4" min="1" max="20">
|
|
112
|
-
<number bind="budget" label="Spending limit" initial="500" min="0" max="5000">
|
|
113
|
-
<validation when="{{ total <= budget }}" message="Adjust participants or the spending limit." fields="seats budget">
|
|
114
|
-
<badge tone="{{ total <= budget ? 'success' : 'warning' }}">{{ formatCurrency(total, 'USD', 2, 'en-US') }}</badge>
|
|
115
|
-
|
|
116
|
-
<multi-select bind="subjects" label="Subjects" max-selected="2">
|
|
117
|
-
<option value="math">Mathematics</option>
|
|
118
|
-
<option value="physics">Physics</option>
|
|
119
|
-
</multi-select>
|
|
120
|
-
<data-table label="Preparation" rows="{{ subjects }}" key="{{ item }}" max-rows="2">
|
|
121
|
-
<column label="Subject" value="{{ item == 'math' ? 'Mathematics' : 'Physics' }}">
|
|
122
|
-
</data-table>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
</disclosure>
|
|
126
|
-
</accordion>
|
|
1
|
+
<computed name="organizer" value="{{ trim(name) == '' ? 'Your group' : trim(name) }}">
|
|
2
|
+
<computed name="unitCost" value="{{ (format == 'onsite' ? 80 : 60) + (equipment ? 20 : 0) }}">
|
|
3
|
+
<computed name="total" value="{{ seats * unitCost }}">
|
|
4
|
+
<computed name="datesReady" value="{{ date != '' && deadline != '' && dateCompare(deadline, date) <= 0 }}">
|
|
5
|
+
<computed name="registrationGap" value="{{ datesReady ? dateDiff(date, deadline) : null }}">
|
|
6
|
+
|
|
7
|
+
# Build a workshop plan
|
|
8
|
+
|
|
9
|
+
Change the name, headcount and format. Lower the budget or move the registration deadline past the workshop to see a hint; choose subjects to generate a preparation plan.
|
|
10
|
+
|
|
11
|
+
<grid>
|
|
12
|
+
<card>
|
|
13
|
+
<panel title="Workshop details">
|
|
14
|
+
<input bind="name" label="Organizer" initial="Alex" placeholder="Your name">
|
|
15
|
+
<choices bind="format" label="Format" initial="onsite">
|
|
16
|
+
<option value="onsite">In person</option>
|
|
17
|
+
<option value="online">Online</option>
|
|
18
|
+
</choices>
|
|
19
|
+
<slider bind="seats" label="Participants" initial="4" min="1" max="20">
|
|
20
|
+
<date bind="date" label="Workshop date" initial="2026-11-01">
|
|
21
|
+
<date bind="deadline" label="Registration deadline" initial="2026-10-25">
|
|
22
|
+
<number bind="budget" label="Spending limit" initial="500" min="0" max="5000" step="10">
|
|
23
|
+
<validation when="{{ datesReady }}" message="Fill both dates and close registration on or before the workshop date." fields="deadline date">
|
|
24
|
+
<validation when="{{ total <= budget }}" message="Estimate exceeds the limit by {{ formatCurrency(total - budget, 'USD', 2, 'en-US') }}; adjust participants, materials or the limit." fields="seats equipment budget">
|
|
25
|
+
<textarea bind="notes" label="Special requests" placeholder="What would help your group?">
|
|
26
|
+
<toggle bind="equipment" label="Include a materials kit (20 per person)">
|
|
27
|
+
</panel>
|
|
28
|
+
</card>
|
|
29
|
+
|
|
30
|
+
<card title="Your workshop at a glance">
|
|
31
|
+
**{{ organizer }}** · {{ date }}
|
|
32
|
+
|
|
33
|
+
{{ format == 'onsite' ? 'In-person workshop' : 'Online workshop' }} · **{{ seats }}** participants
|
|
34
|
+
|
|
35
|
+
Per person: **{{ formatCurrency(unitCost, 'USD', 2, 'en-US') }}**
|
|
36
|
+
|
|
37
|
+
Estimated total: **{{ formatCurrency(total, 'USD', 2, 'en-US') }}**
|
|
38
|
+
|
|
39
|
+
<badge tone="{{ total <= budget ? 'success' : 'warning' }}">Spending limit: {{ formatCurrency(budget, 'USD', 2, 'en-US') }}</badge>
|
|
40
|
+
|
|
41
|
+
<if when="{{ datesReady }}">
|
|
42
|
+
Registration closes **{{ deadline }}**, **{{ registrationGap }}** days before the workshop.
|
|
43
|
+
</if>
|
|
44
|
+
|
|
45
|
+
Requests: {{ trim(notes) == '' ? 'No special requests yet.' : trim(notes) }}
|
|
46
|
+
|
|
47
|
+
<if when="{{ format == 'onsite' }}">
|
|
48
|
+
<alert title="Prepare the room">Reserve a room with at least {{ seats }} seats and arrange a shared display.</alert>
|
|
49
|
+
</if>
|
|
50
|
+
<if when="{{ format == 'online' }}">
|
|
51
|
+
<alert title="Prepare the call">Share the meeting link and check that everyone can open the workshop document.</alert>
|
|
52
|
+
</if>
|
|
53
|
+
</card>
|
|
54
|
+
</grid>
|
|
55
|
+
|
|
56
|
+
## Try a complete change
|
|
57
|
+
|
|
58
|
+
Choose Online, set 6 participants and add materials: the estimate becomes **{{ formatCurrency(480, 'USD', 2, 'en-US') }}**. Reset Workshop details to return to the original **{{ formatCurrency(320, 'USD', 2, 'en-US') }}**.
|
|
59
|
+
|
|
60
|
+
## Tailor the workshop to your group
|
|
61
|
+
|
|
62
|
+
Choose the level, pace and subjects. These details shape the learning plan alongside the cost estimate above.
|
|
63
|
+
|
|
64
|
+
<panel title="Learning preferences">
|
|
65
|
+
<select bind="level" label="Experience level" initial="intro">
|
|
66
|
+
<option value="intro">First workshop</option>
|
|
67
|
+
<option value="advanced">Already familiar</option>
|
|
68
|
+
</select>
|
|
69
|
+
|
|
70
|
+
<radio-group bind="pace" label="Session pace" initial="guided">
|
|
71
|
+
<option value="guided">Guided practice</option>
|
|
72
|
+
<option value="independent">Independent exploration</option>
|
|
73
|
+
</radio-group>
|
|
74
|
+
|
|
75
|
+
<multi-select bind="subjects" label="Workshop subjects" max-selected="2" color="#167875">
|
|
76
|
+
<option value="math">Mathematics</option>
|
|
77
|
+
<option value="physics">Physics</option>
|
|
78
|
+
<option value="chemistry">Chemistry</option>
|
|
79
|
+
</multi-select>
|
|
80
|
+
|
|
81
|
+
<checkbox bind="accessible" label="Include a written step-by-step guide">
|
|
82
|
+
|
|
83
|
+
| Detail | Your choice |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Level | {{ level == 'intro' ? 'Start with a worked example' : 'Compare several approaches' }} |
|
|
86
|
+
| Pace | {{ pace == 'guided' ? 'Work through the steps together' : 'Leave time to explore independently' }} |
|
|
87
|
+
| Subjects | {{ len(subjects) }} / 2 selected |
|
|
88
|
+
|
|
89
|
+
<data-table label="Subject preparation" rows="{{ subjects }}" key="{{ item }}" max-rows="2">
|
|
90
|
+
<column label="Subject" value="{{ item == 'math' ? 'Mathematics' : item == 'physics' ? 'Physics' : 'Chemistry' }}">
|
|
91
|
+
<column label="Preparation" value="{{ item == 'chemistry' ? 'Prepare materials and instructions' : 'Prepare a worked example' }}">
|
|
92
|
+
<column label="Guide" value="{{ accessible ? 'Written steps included' : 'Live explanation' }}">
|
|
93
|
+
</data-table>
|
|
94
|
+
|
|
95
|
+
<if when="{{ contains(subjects, 'chemistry') }}">
|
|
96
|
+
<badge color="#167875">Include a chemistry example</badge>
|
|
97
|
+
</if>
|
|
98
|
+
<if when="{{ accessible }}">
|
|
99
|
+
<alert title="Prepare the written guide">Include the parameter names and the expected result for each step.</alert>
|
|
100
|
+
</if>
|
|
101
|
+
</panel>
|
|
102
|
+
|
|
103
|
+
## How it is written
|
|
104
|
+
|
|
105
|
+
<accordion>
|
|
106
|
+
<disclosure label="Show the key source">
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
<const name="rate" value="{{ 80 }}">
|
|
110
|
+
<computed name="total" value="{{ seats * rate }}">
|
|
111
|
+
<slider bind="seats" label="Participants" initial="4" min="1" max="20">
|
|
112
|
+
<number bind="budget" label="Spending limit" initial="500" min="0" max="5000">
|
|
113
|
+
<validation when="{{ total <= budget }}" message="Adjust participants or the spending limit." fields="seats budget">
|
|
114
|
+
<badge tone="{{ total <= budget ? 'success' : 'warning' }}">{{ formatCurrency(total, 'USD', 2, 'en-US') }}</badge>
|
|
115
|
+
|
|
116
|
+
<multi-select bind="subjects" label="Subjects" max-selected="2">
|
|
117
|
+
<option value="math">Mathematics</option>
|
|
118
|
+
<option value="physics">Physics</option>
|
|
119
|
+
</multi-select>
|
|
120
|
+
<data-table label="Preparation" rows="{{ subjects }}" key="{{ item }}" max-rows="2">
|
|
121
|
+
<column label="Subject" value="{{ item == 'math' ? 'Mathematics' : 'Physics' }}">
|
|
122
|
+
</data-table>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
</disclosure>
|
|
126
|
+
</accordion>
|
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
<const name="monthsPerYear" value="{{ 12 }}">
|
|
2
|
-
<computed name="monthlyRate" value="{{ r / (100 * monthsPerYear) }}">
|
|
3
|
-
<computed name="growthFactor" value="{{ pow(1 + monthlyRate, monthsPerYear * t) }}">
|
|
4
|
-
<computed name="endingBalance" value="{{ monthlyRate == 0 ? P + monthsPerYear * m * t : P * growthFactor + m * (growthFactor - 1) / monthlyRate }}">
|
|
5
|
-
<computed name="deposits" value="{{ P + monthsPerYear * m * t }}">
|
|
6
|
-
<computed name="distance" value="{{ sqrt(px * px + py * py) }}">
|
|
7
|
-
<computed name="waveHeight" value="{{ a * sin(f * px) }}">
|
|
8
|
-
<computed name="insideInterval" value="{{ px >= low && px <= high }}">
|
|
9
|
-
|
|
10
|
-
# Functions you can shape
|
|
11
|
-
|
|
12
|
-
Drag Amplitude to 0: the wave becomes a flat line. Restore it, then increase Frequency to fit more waves into the same interval.
|
|
13
|
-
|
|
14
|
-
<grid>
|
|
15
|
-
<card>
|
|
16
|
-
<panel title="Shape the wave">
|
|
17
|
-
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
18
|
-
<slider bind="f" label="Frequency" initial="1" min="0.5" max="3" step="0.5">
|
|
19
|
-
</panel>
|
|
20
|
-
|
|
21
|
-
Amplitude **{{ a }}**, frequency **{{ f }}**.
|
|
22
|
-
|
|
23
|
-
<if when="{{ a == 0 }}">
|
|
24
|
-
<alert title="The wave is flat">Multiplying by zero makes every output zero, whatever the frequency.</alert>
|
|
25
|
-
</if>
|
|
26
|
-
</card>
|
|
27
|
-
<card>
|
|
28
|
-
<plot min="0" max="12.56" label="Adjustable sine wave" x-label="x" y-label="y">
|
|
29
|
-
$$ y = a\sin(fx) $$
|
|
30
|
-
</plot>
|
|
31
|
-
</card>
|
|
32
|
-
</grid>
|
|
33
|
-
|
|
34
|
-
## Explore the same parameters
|
|
35
|
-
|
|
36
|
-
<tabs label="Function explorations">
|
|
37
|
-
<tab label="Compare curves">
|
|
38
|
-
Both curves share the amplitude and frequency above. Compare their peaks and zero crossings.
|
|
39
|
-
|
|
40
|
-
<plot min="0" max="12.56" label="Sine and cosine">
|
|
41
|
-
$$ y = a\sin(fx) $$
|
|
42
|
-
$$ y = a\cos(fx) $$
|
|
43
|
-
</plot>
|
|
44
|
-
</tab>
|
|
45
|
-
<tab label="Piecewise function">
|
|
46
|
-
The negative side is linear; the positive side is quadratic. Amplitude scales both branches.
|
|
47
|
-
|
|
48
|
-
<plot min="-3" max="3" label="Linear meets quadratic">
|
|
49
|
-
$$
|
|
50
|
-
y = \begin{cases}
|
|
51
|
-
ax, & x < 0 \\
|
|
52
|
-
ax^2, & x \ge 0
|
|
53
|
-
\end{cases}
|
|
54
|
-
$$
|
|
55
|
-
</plot>
|
|
56
|
-
</tab>
|
|
57
|
-
<tab label="Savings application">
|
|
58
|
-
Monthly deposits and monthly compounding turn a formula into a small planning tool. Set the annual rate to zero to compare deposits alone.
|
|
59
|
-
|
|
60
|
-
<panel title="Savings parameters">
|
|
61
|
-
<number bind="P" label="Starting amount" initial="10000" min="0" step="100">
|
|
62
|
-
<number bind="m" label="Monthly deposit" initial="500" min="0" step="100">
|
|
63
|
-
<slider bind="r" label="Annual rate (%)" initial="5" min="0" max="10" step="0.5">
|
|
64
|
-
<slider bind="t" label="Years" initial="20" min="1" max="40">
|
|
65
|
-
</panel>
|
|
66
|
-
|
|
67
|
-
<plot min="0" max="{{ t }}" label="Savings growth" x-label="Years" y-label="Amount">
|
|
68
|
-
$$
|
|
69
|
-
y = \begin{cases}
|
|
70
|
-
P + 12mx, & r = 0 \\
|
|
71
|
-
P\left(1+\mathrm{monthlyRate}\right)^{12x} + m\frac{\left(1+\mathrm{monthlyRate}\right)^{12x}-1}{\mathrm{monthlyRate}}, & r \ne 0
|
|
72
|
-
\end{cases}
|
|
73
|
-
$$
|
|
74
|
-
</plot>
|
|
75
|
-
|
|
76
|
-
At year **{{ t }}**, the ending balance is **{{ formatCurrency(endingBalance, 'USD', 2, 'en-US') }}**: deposits of **{{ formatCurrency(deposits, 'USD', 2, 'en-US') }}** and interest of **{{ formatCurrency(endingBalance - deposits, 'USD', 2, 'en-US') }}**. The annual rate is **{{ formatPercent(r / 100, 1, 'en-US') }}**. The curve and ending balance share the monthly rate; at zero rate they count deposits directly.
|
|
77
|
-
</tab>
|
|
78
|
-
</tabs>
|
|
79
|
-
|
|
80
|
-
## Explore a point and an interval
|
|
81
|
-
|
|
82
|
-
Choose an interval, then drag the point. Compare its horizontal position with the interval and read the wave height at that position.
|
|
83
|
-
|
|
84
|
-
<panel title="Point and interval">
|
|
85
|
-
<range-slider label="Observation interval" bind-start="low" bind-end="high" initial-start="-3" initial-end="3" min="-5" max="5" color="#7c3aed">
|
|
86
|
-
|
|
87
|
-
Interval: **{{ low }}–{{ high }}**. Width: **{{ high - low }}**.
|
|
88
|
-
|
|
89
|
-
<coordinate label="Point position" bind-x="px" bind-y="py" initial-x="1" initial-y="2" x-min="-5" x-max="5" y-min="-5" y-max="5" color="#2563eb">
|
|
90
|
-
|
|
91
|
-
Point: **({{ px }}, {{ py }})**. Distance from the origin: **{{ formatNumber(distance, 2, 'en-US') }}**.
|
|
92
|
-
|
|
93
|
-
{{ insideInterval ? 'The point lies inside the horizontal interval.' : 'The point lies outside the horizontal interval.' }} Wave height at this x: **{{ formatNumber(waveHeight, 2, 'en-US') }}**.
|
|
94
|
-
|
|
95
|
-
The same height in scientific notation is **{{ formatScientific(waveHeight, 2, 'en-US') }}**, useful when comparing values near zero.
|
|
96
|
-
|
|
97
|
-
<quiz type="number" label="How far is (3, 4) from the origin?" answer="5" tolerance="0.01" explanation="The square root of 3² + 4² is 5. Try placing the point at (3, 4).">
|
|
98
|
-
</quiz>
|
|
99
|
-
</panel>
|
|
100
|
-
|
|
101
|
-
## How it is written
|
|
102
|
-
|
|
103
|
-
<accordion>
|
|
104
|
-
<disclosure label="Show the key source">
|
|
105
|
-
|
|
106
|
-
```markdown
|
|
107
|
-
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
108
|
-
<slider bind="f" label="Frequency" initial="1" min="0.5" max="3" step="0.5">
|
|
109
|
-
<coordinate label="Point position" bind-x="px" bind-y="py" initial-x="1" initial-y="2" x-min="-5" x-max="5" y-min="-5" y-max="5">
|
|
110
|
-
<computed name="waveHeight" value="{{ a * sin(f * px) }}">
|
|
111
|
-
Height: {{ formatNumber(waveHeight, 2) }} · {{ formatScientific(waveHeight, 2) }}
|
|
112
|
-
|
|
113
|
-
<plot min="0" max="12.56" label="Sine wave">
|
|
114
|
-
$$ y = a\sin(fx) $$
|
|
115
|
-
</plot>
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
</disclosure>
|
|
119
|
-
</accordion>
|
|
1
|
+
<const name="monthsPerYear" value="{{ 12 }}">
|
|
2
|
+
<computed name="monthlyRate" value="{{ r / (100 * monthsPerYear) }}">
|
|
3
|
+
<computed name="growthFactor" value="{{ pow(1 + monthlyRate, monthsPerYear * t) }}">
|
|
4
|
+
<computed name="endingBalance" value="{{ monthlyRate == 0 ? P + monthsPerYear * m * t : P * growthFactor + m * (growthFactor - 1) / monthlyRate }}">
|
|
5
|
+
<computed name="deposits" value="{{ P + monthsPerYear * m * t }}">
|
|
6
|
+
<computed name="distance" value="{{ sqrt(px * px + py * py) }}">
|
|
7
|
+
<computed name="waveHeight" value="{{ a * sin(f * px) }}">
|
|
8
|
+
<computed name="insideInterval" value="{{ px >= low && px <= high }}">
|
|
9
|
+
|
|
10
|
+
# Functions you can shape
|
|
11
|
+
|
|
12
|
+
Drag Amplitude to 0: the wave becomes a flat line. Restore it, then increase Frequency to fit more waves into the same interval.
|
|
13
|
+
|
|
14
|
+
<grid>
|
|
15
|
+
<card>
|
|
16
|
+
<panel title="Shape the wave">
|
|
17
|
+
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
18
|
+
<slider bind="f" label="Frequency" initial="1" min="0.5" max="3" step="0.5">
|
|
19
|
+
</panel>
|
|
20
|
+
|
|
21
|
+
Amplitude **{{ a }}**, frequency **{{ f }}**.
|
|
22
|
+
|
|
23
|
+
<if when="{{ a == 0 }}">
|
|
24
|
+
<alert title="The wave is flat">Multiplying by zero makes every output zero, whatever the frequency.</alert>
|
|
25
|
+
</if>
|
|
26
|
+
</card>
|
|
27
|
+
<card>
|
|
28
|
+
<plot min="0" max="12.56" label="Adjustable sine wave" x-label="x" y-label="y">
|
|
29
|
+
$$ y = a\sin(fx) $$
|
|
30
|
+
</plot>
|
|
31
|
+
</card>
|
|
32
|
+
</grid>
|
|
33
|
+
|
|
34
|
+
## Explore the same parameters
|
|
35
|
+
|
|
36
|
+
<tabs label="Function explorations">
|
|
37
|
+
<tab label="Compare curves">
|
|
38
|
+
Both curves share the amplitude and frequency above. Compare their peaks and zero crossings.
|
|
39
|
+
|
|
40
|
+
<plot min="0" max="12.56" label="Sine and cosine">
|
|
41
|
+
$$ y = a\sin(fx) $$
|
|
42
|
+
$$ y = a\cos(fx) $$
|
|
43
|
+
</plot>
|
|
44
|
+
</tab>
|
|
45
|
+
<tab label="Piecewise function">
|
|
46
|
+
The negative side is linear; the positive side is quadratic. Amplitude scales both branches.
|
|
47
|
+
|
|
48
|
+
<plot min="-3" max="3" label="Linear meets quadratic">
|
|
49
|
+
$$
|
|
50
|
+
y = \begin{cases}
|
|
51
|
+
ax, & x < 0 \\
|
|
52
|
+
ax^2, & x \ge 0
|
|
53
|
+
\end{cases}
|
|
54
|
+
$$
|
|
55
|
+
</plot>
|
|
56
|
+
</tab>
|
|
57
|
+
<tab label="Savings application">
|
|
58
|
+
Monthly deposits and monthly compounding turn a formula into a small planning tool. Set the annual rate to zero to compare deposits alone.
|
|
59
|
+
|
|
60
|
+
<panel title="Savings parameters">
|
|
61
|
+
<number bind="P" label="Starting amount" initial="10000" min="0" step="100">
|
|
62
|
+
<number bind="m" label="Monthly deposit" initial="500" min="0" step="100">
|
|
63
|
+
<slider bind="r" label="Annual rate (%)" initial="5" min="0" max="10" step="0.5">
|
|
64
|
+
<slider bind="t" label="Years" initial="20" min="1" max="40">
|
|
65
|
+
</panel>
|
|
66
|
+
|
|
67
|
+
<plot min="0" max="{{ t }}" label="Savings growth" x-label="Years" y-label="Amount">
|
|
68
|
+
$$
|
|
69
|
+
y = \begin{cases}
|
|
70
|
+
P + 12mx, & r = 0 \\
|
|
71
|
+
P\left(1+\mathrm{monthlyRate}\right)^{12x} + m\frac{\left(1+\mathrm{monthlyRate}\right)^{12x}-1}{\mathrm{monthlyRate}}, & r \ne 0
|
|
72
|
+
\end{cases}
|
|
73
|
+
$$
|
|
74
|
+
</plot>
|
|
75
|
+
|
|
76
|
+
At year **{{ t }}**, the ending balance is **{{ formatCurrency(endingBalance, 'USD', 2, 'en-US') }}**: deposits of **{{ formatCurrency(deposits, 'USD', 2, 'en-US') }}** and interest of **{{ formatCurrency(endingBalance - deposits, 'USD', 2, 'en-US') }}**. The annual rate is **{{ formatPercent(r / 100, 1, 'en-US') }}**. The curve and ending balance share the monthly rate; at zero rate they count deposits directly.
|
|
77
|
+
</tab>
|
|
78
|
+
</tabs>
|
|
79
|
+
|
|
80
|
+
## Explore a point and an interval
|
|
81
|
+
|
|
82
|
+
Choose an interval, then drag the point. Compare its horizontal position with the interval and read the wave height at that position.
|
|
83
|
+
|
|
84
|
+
<panel title="Point and interval">
|
|
85
|
+
<range-slider label="Observation interval" bind-start="low" bind-end="high" initial-start="-3" initial-end="3" min="-5" max="5" color="#7c3aed">
|
|
86
|
+
|
|
87
|
+
Interval: **{{ low }}–{{ high }}**. Width: **{{ high - low }}**.
|
|
88
|
+
|
|
89
|
+
<coordinate label="Point position" bind-x="px" bind-y="py" initial-x="1" initial-y="2" x-min="-5" x-max="5" y-min="-5" y-max="5" color="#2563eb">
|
|
90
|
+
|
|
91
|
+
Point: **({{ px }}, {{ py }})**. Distance from the origin: **{{ formatNumber(distance, 2, 'en-US') }}**.
|
|
92
|
+
|
|
93
|
+
{{ insideInterval ? 'The point lies inside the horizontal interval.' : 'The point lies outside the horizontal interval.' }} Wave height at this x: **{{ formatNumber(waveHeight, 2, 'en-US') }}**.
|
|
94
|
+
|
|
95
|
+
The same height in scientific notation is **{{ formatScientific(waveHeight, 2, 'en-US') }}**, useful when comparing values near zero.
|
|
96
|
+
|
|
97
|
+
<quiz type="number" label="How far is (3, 4) from the origin?" answer="5" tolerance="0.01" explanation="The square root of 3² + 4² is 5. Try placing the point at (3, 4).">
|
|
98
|
+
</quiz>
|
|
99
|
+
</panel>
|
|
100
|
+
|
|
101
|
+
## How it is written
|
|
102
|
+
|
|
103
|
+
<accordion>
|
|
104
|
+
<disclosure label="Show the key source">
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
108
|
+
<slider bind="f" label="Frequency" initial="1" min="0.5" max="3" step="0.5">
|
|
109
|
+
<coordinate label="Point position" bind-x="px" bind-y="py" initial-x="1" initial-y="2" x-min="-5" x-max="5" y-min="-5" y-max="5">
|
|
110
|
+
<computed name="waveHeight" value="{{ a * sin(f * px) }}">
|
|
111
|
+
Height: {{ formatNumber(waveHeight, 2) }} · {{ formatScientific(waveHeight, 2) }}
|
|
112
|
+
|
|
113
|
+
<plot min="0" max="12.56" label="Sine wave">
|
|
114
|
+
$$ y = a\sin(fx) $$
|
|
115
|
+
</plot>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
</disclosure>
|
|
119
|
+
</accordion>
|