reactive-md 0.4.1 → 0.5.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 +144 -113
- package/CHANGELOG.md +144 -113
- package/LICENSE +21 -21
- package/README-ch.md +154 -123
- package/README-en.md +179 -147
- package/README.md +179 -147
- package/SECURITY-ch.md +4 -3
- package/SECURITY.md +4 -3
- package/THIRD_PARTY_NOTICES.md +138 -1
- package/bin/reactive-md.mjs +1 -1
- package/dist-library/reactive-md-editor.css +2 -0
- package/dist-library/reactive-md-editor.js +3834 -0
- package/dist-library/reactive-md-react.js +9324 -1670
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +426 -305
- package/dist-library/{runtime-D3QTVYaz.js → runtime-CXBdLQ3A.js} +8950 -2895
- 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 +109 -0
- package/dist-library/types/editor/editor-toolbar.d.ts +24 -0
- package/dist-library/types/editor/editor-view-bar.d.ts +11 -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 +51 -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/LocalDocumentView.d.ts +10 -3
- package/dist-library/types/local/code-block.d.ts +26 -0
- package/dist-library/types/local/diagnostics.d.ts +25 -0
- package/dist-library/types/local/footnotes.d.ts +51 -0
- package/dist-library/types/local/heading-anchors.d.ts +2 -0
- package/dist-library/types/local/html.d.ts +16 -0
- package/dist-library/types/local/image-view.d.ts +23 -0
- package/dist-library/types/local/index.d.ts +1 -1
- package/dist-library/types/local/options.d.ts +29 -0
- package/dist-library/types/local/types.d.ts +42 -1
- package/dist-library/types/local/worker.d.ts +18 -6
- package/dist-library/types/shareable.d.ts +9 -1
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +49 -38
- 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 +235 -0
- package/docs/editor-en.md +235 -0
- package/docs/html-compatibility-ch.md +98 -0
- package/docs/html-compatibility-en.md +98 -0
- package/docs/local-guide-ch.md +11 -5
- package/docs/local-guide-en.md +11 -5
- package/docs/local-integration-ch.md +4 -1
- package/docs/local-integration-en.md +4 -1
- package/docs/local-interaction-syntax-ch.md +9 -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/release-0.5.1-ch.md +39 -0
- package/docs/release-0.5.1-en.md +39 -0
- package/docs/releasing-ch.md +108 -101
- package/docs/releasing-en.md +108 -101
- package/docs/shareable-export-ch.md +6 -2
- package/docs/shareable-export-en.md +6 -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/README.md +2 -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/html-compat.reactive.md +24 -0
- 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 +135 -91
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "reactive-md-core-example",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"engines": { "node": ">=22.12.0" },
|
|
6
|
-
"scripts": { "start": "node index.mjs" }
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "reactive-md-core-example",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": { "node": ">=22.12.0" },
|
|
6
|
+
"scripts": { "start": "node index.mjs" }
|
|
7
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Reactive MD integration</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="/main.jsx"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Reactive MD integration</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/main.jsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { LocalReactiveDocument } from 'reactive-md/react';
|
|
4
|
-
import 'reactive-md/styles.css';
|
|
5
|
-
|
|
6
|
-
const source = `# Cost estimate
|
|
7
|
-
|
|
8
|
-
<panel title="Adjust the plan">
|
|
9
|
-
<slider bind="people" label="People" initial="2" min="1" max="20">
|
|
10
|
-
<toggle bind="annual" label="Annual billing">
|
|
11
|
-
</panel>
|
|
12
|
-
|
|
13
|
-
Monthly cost: **{{ people * (annual ? 80 : 100) }} USD**.`;
|
|
14
|
-
|
|
15
|
-
createRoot(document.getElementById('root')).render(
|
|
16
|
-
<React.StrictMode>
|
|
17
|
-
<main style={{ padding: 24 }}>
|
|
18
|
-
<LocalReactiveDocument source={source} />
|
|
19
|
-
</main>
|
|
20
|
-
</React.StrictMode>,
|
|
21
|
-
);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { LocalReactiveDocument } from 'reactive-md/react';
|
|
4
|
+
import 'reactive-md/styles.css';
|
|
5
|
+
|
|
6
|
+
const source = `# Cost estimate
|
|
7
|
+
|
|
8
|
+
<panel title="Adjust the plan">
|
|
9
|
+
<slider bind="people" label="People" initial="2" min="1" max="20">
|
|
10
|
+
<toggle bind="annual" label="Annual billing">
|
|
11
|
+
</panel>
|
|
12
|
+
|
|
13
|
+
Monthly cost: **{{ people * (annual ? 80 : 100) }} USD**.`;
|
|
14
|
+
|
|
15
|
+
createRoot(document.getElementById('root')).render(
|
|
16
|
+
<React.StrictMode>
|
|
17
|
+
<main style={{ padding: 24 }}>
|
|
18
|
+
<LocalReactiveDocument source={source} />
|
|
19
|
+
</main>
|
|
20
|
+
</React.StrictMode>,
|
|
21
|
+
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "reactive-md-react-example",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"engines": { "node": ">=22.12.0" },
|
|
6
|
-
"scripts": { "dev": "vite --host 127.0.0.1", "build": "vite build" },
|
|
7
|
-
"dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" },
|
|
8
|
-
"devDependencies": { "vite": "^8.3.5" }
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "reactive-md-react-example",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": { "node": ">=22.12.0" },
|
|
6
|
+
"scripts": { "dev": "vite --host 127.0.0.1", "build": "vite build" },
|
|
7
|
+
"dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" },
|
|
8
|
+
"devDependencies": { "vite": "^8.3.5" }
|
|
9
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { compileLocal } from 'reactive-md';
|
|
3
|
+
import {
|
|
4
|
+
ReactiveMarkdownEditor,
|
|
5
|
+
type ReactiveMarkdownEditorHandle,
|
|
6
|
+
} from 'reactive-md/editor';
|
|
7
|
+
import 'reactive-md/editor/styles.css';
|
|
8
|
+
import { LocalReactiveDocument } from 'reactive-md/react';
|
|
9
|
+
import 'reactive-md/styles.css';
|
|
10
|
+
|
|
11
|
+
const documents = {
|
|
12
|
+
estimate: `# Cost estimate
|
|
13
|
+
|
|
14
|
+
<panel title="Adjust the plan">
|
|
15
|
+
<slider bind="people" label="People" initial="2" min="1" max="20">
|
|
16
|
+
<toggle bind="annual" label="Annual billing">
|
|
17
|
+
</panel>
|
|
18
|
+
|
|
19
|
+
Monthly cost: **{{ people * (annual ? 80 : 100) }} USD**.`,
|
|
20
|
+
notes: `# Notes
|
|
21
|
+
|
|
22
|
+
Write Markdown here. The source stays in React state.
|
|
23
|
+
|
|
24
|
+
- The editor owns formatting and undo history.
|
|
25
|
+
- The host owns compilation, preview and saving.`,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type DocumentId = keyof typeof documents;
|
|
29
|
+
|
|
30
|
+
export function SourceAndPreview() {
|
|
31
|
+
const [documentId, setDocumentId] = useState<DocumentId>('estimate');
|
|
32
|
+
const [source, setSource] = useState(documents.estimate);
|
|
33
|
+
const editor = useRef<ReactiveMarkdownEditorHandle>(null);
|
|
34
|
+
const result = useMemo(() => compileLocal(source), [source]);
|
|
35
|
+
|
|
36
|
+
function openDocument(id: DocumentId) {
|
|
37
|
+
setDocumentId(id);
|
|
38
|
+
setSource(documents[id]);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div style={{ display: 'grid', gap: 16 }}>
|
|
43
|
+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
|
44
|
+
<button type="button" onClick={() => openDocument('estimate')}>Estimate</button>
|
|
45
|
+
<button type="button" onClick={() => openDocument('notes')}>Notes</button>
|
|
46
|
+
<button type="button" onClick={() => editor.current?.undo()}>Undo</button>
|
|
47
|
+
<button type="button" onClick={() => editor.current?.redo()}>Redo</button>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<ReactiveMarkdownEditor
|
|
51
|
+
ref={editor}
|
|
52
|
+
value={source}
|
|
53
|
+
onChange={setSource}
|
|
54
|
+
documentKey={documentId}
|
|
55
|
+
diagnostics={result.diagnostics}
|
|
56
|
+
document={result.ok ? result.document : null}
|
|
57
|
+
ariaLabel="Reactive MD source"
|
|
58
|
+
onExport={() => {
|
|
59
|
+
const blob = new Blob([source], { type: 'text/markdown;charset=utf-8' });
|
|
60
|
+
const url = URL.createObjectURL(blob);
|
|
61
|
+
const link = document.createElement('a');
|
|
62
|
+
link.href = url;
|
|
63
|
+
link.download = `${documentId}.reactive.md`;
|
|
64
|
+
link.click();
|
|
65
|
+
URL.revokeObjectURL(url);
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
{result.ok
|
|
70
|
+
? <LocalReactiveDocument source={source} />
|
|
71
|
+
: <pre>{result.diagnostics.map(item => `${item.line}:${item.column} ${item.message}`).join('\n')}</pre>}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
package/examples/local/README.md
CHANGED
|
@@ -4,6 +4,8 @@ These are standalone authoring examples for `local-draft-2`, described in the [l
|
|
|
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
|
+
The new [HTML compatibility example](html-compat.reactive.md) combines rich disclosures, Markdown and a bound counter. See the [temporary HTML routing policy](../../docs/html-compatibility-en.md) before enabling author CSS, JavaScript or extended HTML.
|
|
8
|
+
|
|
7
9
|
## Start with the short examples
|
|
8
10
|
|
|
9
11
|
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.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Find components in the document
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
<panel title="Local component catalog">
|
|
6
|
-
<table label="Component catalog" page-size="4">
|
|
7
|
-
| Name | Category | Purpose |
|
|
8
|
-
| --- | --- | --- |
|
|
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
|
-
</table>
|
|
18
|
-
</panel>
|
|
19
|
-
|
|
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
|
+
# Find components in the document
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
<panel title="Local component catalog">
|
|
6
|
+
<table label="Component catalog" page-size="4">
|
|
7
|
+
| Name | Category | Purpose |
|
|
8
|
+
| --- | --- | --- |
|
|
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
|
+
</table>
|
|
18
|
+
</panel>
|
|
19
|
+
|
|
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,32 +1,32 @@
|
|
|
1
|
-
# Organize a walkthrough with a checklist
|
|
2
|
-
|
|
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
|
-
</checklist>
|
|
9
|
-
|
|
10
|
-
Done: **{{ len(done) }} / 3**.
|
|
11
|
-
|
|
12
|
-
<progress label="Completion" value="{{ len(done) / 3 * 100 }}">
|
|
13
|
-
|
|
14
|
-
<if when="{{ len(done) == 3 }}">
|
|
15
|
-
<alert tone="success" title="Walkthrough complete">
|
|
16
|
-
You have read the source, tried the interactions and checked the narrow layout.
|
|
17
|
-
</alert>
|
|
18
|
-
</if>
|
|
19
|
-
</panel>
|
|
20
|
-
|
|
21
|
-
## Search, sorting and paging
|
|
22
|
-
|
|
23
|
-
<table label="Component price examples" page-size="3">
|
|
24
|
-
| Name | Category | Price |
|
|
25
|
-
| --- | --- | ---: |
|
|
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
|
-
</table>
|
|
1
|
+
# Organize a walkthrough with a checklist
|
|
2
|
+
|
|
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
|
+
</checklist>
|
|
9
|
+
|
|
10
|
+
Done: **{{ len(done) }} / 3**.
|
|
11
|
+
|
|
12
|
+
<progress label="Completion" value="{{ len(done) / 3 * 100 }}">
|
|
13
|
+
|
|
14
|
+
<if when="{{ len(done) == 3 }}">
|
|
15
|
+
<alert tone="success" title="Walkthrough complete">
|
|
16
|
+
You have read the source, tried the interactions and checked the narrow layout.
|
|
17
|
+
</alert>
|
|
18
|
+
</if>
|
|
19
|
+
</panel>
|
|
20
|
+
|
|
21
|
+
## Search, sorting and paging
|
|
22
|
+
|
|
23
|
+
<table label="Component price examples" page-size="3">
|
|
24
|
+
| Name | Category | Price |
|
|
25
|
+
| --- | --- | ---: |
|
|
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
|
+
</table>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# Side by side, easier to compare
|
|
2
|
-
|
|
3
|
-
<panel title="Payment method">
|
|
4
|
-
<toggle bind="annual" label="Pay annually and save 20%">
|
|
5
|
-
</panel>
|
|
6
|
-
|
|
7
|
-
<grid>
|
|
8
|
-
<card title="Basic plan">
|
|
9
|
-
For individuals and small projects.
|
|
10
|
-
|
|
11
|
-
**{{ annual ? 80 : 100 }} USD per month**.
|
|
12
|
-
|
|
13
|
-
<badge>Local documents</badge>
|
|
14
|
-
</card>
|
|
15
|
-
|
|
16
|
-
<card title="Pro plan">
|
|
17
|
-
For teams that need collaboration and room to grow.
|
|
18
|
-
|
|
19
|
-
**{{ annual ? 160 : 200 }} USD per month**.
|
|
20
|
-
|
|
21
|
-
<badge tone="success">More components</badge>
|
|
22
|
-
</card>
|
|
23
|
-
</grid>
|
|
24
|
-
|
|
25
|
-
<tabs label="Plan details">
|
|
26
|
-
<tab label="Feature comparison">
|
|
27
|
-
| Capability | Basic plan | Pro plan |
|
|
28
|
-
| --- | --- | --- |
|
|
29
|
-
| Parameter adjustment | Included | Included |
|
|
30
|
-
| Text binding | Included | Included |
|
|
31
|
-
| Content organization | Basic layout | Charts and diagrams |
|
|
32
|
-
</tab>
|
|
33
|
-
|
|
34
|
-
<tab label="Buying advice">
|
|
35
|
-
Choose a plan for what you need, then compare how the billing cycle changes the cost.
|
|
36
|
-
</tab>
|
|
37
|
-
</tabs>
|
|
38
|
-
|
|
39
|
-
<accordion>
|
|
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
|
-
</disclosure>
|
|
43
|
-
|
|
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
|
-
</disclosure>
|
|
47
|
-
</accordion>
|
|
1
|
+
# Side by side, easier to compare
|
|
2
|
+
|
|
3
|
+
<panel title="Payment method">
|
|
4
|
+
<toggle bind="annual" label="Pay annually and save 20%">
|
|
5
|
+
</panel>
|
|
6
|
+
|
|
7
|
+
<grid>
|
|
8
|
+
<card title="Basic plan">
|
|
9
|
+
For individuals and small projects.
|
|
10
|
+
|
|
11
|
+
**{{ annual ? 80 : 100 }} USD per month**.
|
|
12
|
+
|
|
13
|
+
<badge>Local documents</badge>
|
|
14
|
+
</card>
|
|
15
|
+
|
|
16
|
+
<card title="Pro plan">
|
|
17
|
+
For teams that need collaboration and room to grow.
|
|
18
|
+
|
|
19
|
+
**{{ annual ? 160 : 200 }} USD per month**.
|
|
20
|
+
|
|
21
|
+
<badge tone="success">More components</badge>
|
|
22
|
+
</card>
|
|
23
|
+
</grid>
|
|
24
|
+
|
|
25
|
+
<tabs label="Plan details">
|
|
26
|
+
<tab label="Feature comparison">
|
|
27
|
+
| Capability | Basic plan | Pro plan |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| Parameter adjustment | Included | Included |
|
|
30
|
+
| Text binding | Included | Included |
|
|
31
|
+
| Content organization | Basic layout | Charts and diagrams |
|
|
32
|
+
</tab>
|
|
33
|
+
|
|
34
|
+
<tab label="Buying advice">
|
|
35
|
+
Choose a plan for what you need, then compare how the billing cycle changes the cost.
|
|
36
|
+
</tab>
|
|
37
|
+
</tabs>
|
|
38
|
+
|
|
39
|
+
<accordion>
|
|
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
|
+
</disclosure>
|
|
43
|
+
|
|
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
|
+
</disclosure>
|
|
47
|
+
</accordion>
|
|
@@ -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>
|