reactive-md 0.6.1 → 0.8.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 +66 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING-ch.md +6 -62
- package/CONTRIBUTING.md +5 -63
- package/README-ch.md +232 -67
- package/README-en.md +209 -71
- package/README.md +209 -71
- package/SECURITY-ch.md +3 -1
- package/SECURITY.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1909 -87
- package/cli/args.mjs +33 -1
- package/cli/build.mjs +62 -1
- package/cli/check.mjs +444 -0
- package/cli/help.mjs +181 -3
- package/cli/init.mjs +1577 -0
- package/cli/main.mjs +11 -1
- package/cli/package-loader.mjs +41 -0
- package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
- package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
- package/dist-library/compiler--ea2CKQF.js +61 -0
- package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
- package/dist-library/component-state-Cq2K5gkS.js +490 -0
- package/dist-library/component-state-D_cw_EHe.js +54 -0
- package/dist-library/config-validation-DXTynAw7.js +3005 -0
- package/dist-library/default-components-Z_YMio5P.js +2346 -0
- package/dist-library/identity-MYJXKSkB.js +1443 -0
- package/dist-library/math-display-BJz4gbFc.js +24000 -0
- package/dist-library/math-sample-BGEW49zY.js +1124 -0
- package/dist-library/options-CX5m5n-J.js +115 -0
- package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
- package/dist-library/props-DGlBk0e5.js +183 -0
- package/dist-library/react-ByOHunUW.js +122 -0
- package/dist-library/reactive-md-authoring.js +712 -1077
- package/dist-library/reactive-md-build.js +7966 -0
- package/dist-library/reactive-md-compiler-standard.js +33 -0
- package/dist-library/reactive-md-compiler.js +22 -0
- package/dist-library/reactive-md-default-packs.js +71 -0
- package/dist-library/reactive-md-default-preset.js +10 -0
- package/dist-library/reactive-md-export.js +111 -0
- package/dist-library/reactive-md-print.css +18 -3
- package/dist-library/reactive-md-react-runtime.js +251 -0
- package/dist-library/reactive-md-react-server.js +55 -0
- package/dist-library/reactive-md-react-unstyled.js +9 -1
- package/dist-library/reactive-md-react.js +9 -1
- package/dist-library/reactive-md-runtime-browser.js +51 -0
- package/dist-library/reactive-md-runtime.js +3 -0
- package/dist-library/reactive-md-sdk.js +6 -0
- package/dist-library/reactive-md-standalone-host.js +442 -0
- package/dist-library/reactive-md-testing-browser.js +523 -0
- package/dist-library/reactive-md-testing-react.js +221 -0
- package/dist-library/reactive-md-testing.js +638 -0
- package/dist-library/reactive-md-vite.js +959 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1080 -795
- package/dist-library/registry-B9Jc3FVe.js +1174 -0
- package/dist-library/resources-BGt8mpDA.js +204 -0
- package/dist-library/runtime-C-sbfpOX.js +1157 -0
- package/dist-library/runtime-Dkq7ldyg.js +172 -0
- package/dist-library/schema-ZFufO8V0.js +39 -0
- package/dist-library/shareable-DDVL4Fi9.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +168 -0
- package/dist-library/types/authoring/conformance.d.ts +24 -0
- package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
- package/dist-library/types/authoring/extensions.d.ts +13 -0
- package/dist-library/types/authoring/index.d.ts +14 -11
- package/dist-library/types/authoring/insert.d.ts +16 -0
- package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
- package/dist-library/types/authoring/templates.d.ts +65 -0
- package/dist-library/types/build/diagnostics.d.ts +8 -0
- package/dist-library/types/build/digest.d.ts +5 -0
- package/dist-library/types/build/entry.d.ts +9 -0
- package/dist-library/types/build/host.d.ts +36 -0
- package/dist-library/types/build/index.d.ts +99 -0
- package/dist-library/types/build/notices.d.ts +29 -0
- package/dist-library/types/build/resources.d.ts +60 -0
- package/dist-library/types/build/vite.d.ts +15 -0
- package/dist-library/types/compiler/index.d.ts +22 -0
- package/dist-library/types/compiler/result.d.ts +30 -0
- package/dist-library/types/compiler/standard.d.ts +16 -0
- package/dist-library/types/compiler/types.d.ts +69 -0
- package/dist-library/types/components/chart-motion.d.ts +12 -0
- package/dist-library/types/components/controls.d.ts +21 -0
- package/dist-library/types/{local → components}/data-table.d.ts +10 -24
- package/dist-library/types/components/default-chart-types.d.ts +22 -0
- package/dist-library/types/components/default-chart.d.ts +2 -0
- package/dist-library/types/components/default-preset.d.ts +10 -0
- package/dist-library/types/components/diagram-inspector.d.ts +24 -0
- package/dist-library/types/components/gallery.d.ts +6 -0
- package/dist-library/types/components/layout.d.ts +23 -0
- package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
- package/dist-library/types/components/mafs-visuals.d.ts +40 -0
- package/dist-library/types/components/numeric-sliders.d.ts +3 -0
- package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
- package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
- package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
- package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
- package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
- package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
- package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
- package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
- package/dist-library/types/components/use-hydrated.d.ts +6 -0
- package/dist-library/types/components/visuals.d.ts +13 -0
- package/dist-library/types/export/component-state.d.ts +39 -0
- package/dist-library/types/export/index.d.ts +47 -0
- package/dist-library/types/export/requirements.d.ts +23 -0
- package/dist-library/types/export/resources.d.ts +8 -0
- package/dist-library/types/export/restoration.d.ts +52 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
- package/dist-library/types/local/compilation/compiler.d.ts +34 -0
- package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
- package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
- package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
- package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
- package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
- package/dist-library/types/local/configuration/options-core.d.ts +120 -0
- package/dist-library/types/local/configuration/options.d.ts +17 -0
- package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
- package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
- package/dist-library/types/local/configuration/schema.d.ts +12 -0
- package/dist-library/types/local/contracts/types.d.ts +519 -0
- package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
- package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
- package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
- package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
- package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
- package/dist-library/types/local/evaluation/math.d.ts +73 -0
- package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
- package/dist-library/types/local/html/html-details.d.ts +16 -0
- package/dist-library/types/local/html/html-entities.d.ts +7 -0
- package/dist-library/types/local/html/html-policy.d.ts +43 -0
- package/dist-library/types/local/html/html-recovery.d.ts +16 -0
- package/dist-library/types/local/html/html-table-names.d.ts +9 -0
- package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
- package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
- package/dist-library/types/local/index.d.ts +31 -24
- package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
- package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
- package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
- package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
- package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
- package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
- package/dist-library/types/local/parsing/lexical.d.ts +21 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
- package/dist-library/types/local/parsing/parser.d.ts +16 -0
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
- package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
- package/dist-library/types/local/rendering/render-types.d.ts +57 -0
- package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
- package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
- package/dist-library/types/local/runtime/runtime.d.ts +34 -0
- package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
- package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
- package/dist-library/types/local/session/incremental.d.ts +48 -0
- package/dist-library/types/local/session/parse-session.d.ts +62 -0
- package/dist-library/types/local/session/row-reuse.d.ts +46 -0
- package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
- package/dist-library/types/local/source/node-walk.d.ts +3 -0
- package/dist-library/types/local/source/source-context.d.ts +63 -0
- package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
- package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
- package/dist-library/types/local/theme/theme-name.d.ts +3 -0
- package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
- package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
- package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
- package/dist-library/types/local/transport/shared-data.d.ts +10 -0
- package/dist-library/types/local/transport/worker.d.ts +265 -0
- package/dist-library/types/local/widgets/visuals.d.ts +25 -0
- package/dist-library/types/presets/default-authoring.d.ts +50 -0
- package/dist-library/types/presets/default-components.d.ts +4 -0
- package/dist-library/types/presets/default-semantics.d.ts +8 -0
- package/dist-library/types/presets/default.d.ts +11 -0
- package/dist-library/types/presets/identity.d.ts +7 -0
- package/dist-library/types/presets/packs.d.ts +4 -0
- package/dist-library/types/react/component-api.d.ts +260 -0
- package/dist-library/types/react/component-primitives.d.ts +21 -0
- package/dist-library/types/react/component-utils.d.ts +125 -0
- package/dist-library/types/react/default-theme.d.ts +6 -0
- package/dist-library/types/react/field-validation.d.ts +11 -0
- package/dist-library/types/react/index.d.ts +17 -5
- package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
- package/dist-library/types/react/package.d.ts +69 -0
- package/dist-library/types/react/runtime/common.d.ts +4 -0
- package/dist-library/types/react/runtime/index.d.ts +8 -0
- package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
- package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
- package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
- package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
- package/dist-library/types/react/sdk.d.ts +110 -0
- package/dist-library/types/react/server.d.ts +15 -0
- package/dist-library/types/react/tooltip-layer.d.ts +10 -0
- package/dist-library/types/react/use-draft-field.d.ts +17 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
- package/dist-library/types/runtime-services/component-state.d.ts +152 -0
- package/dist-library/types/runtime-services/identity.d.ts +41 -0
- package/dist-library/types/runtime-services/index.d.ts +10 -0
- package/dist-library/types/runtime-services/random.d.ts +42 -0
- package/dist-library/types/runtime-services/runtime.d.ts +51 -0
- package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
- package/dist-library/types/sdk/assembly.d.ts +73 -0
- package/dist-library/types/sdk/compat-profile.d.ts +57 -0
- package/dist-library/types/sdk/compiler-config.d.ts +33 -0
- package/dist-library/types/sdk/config-validation.d.ts +33 -0
- package/dist-library/types/sdk/config.d.ts +35 -0
- package/dist-library/types/sdk/hash.d.ts +9 -0
- package/dist-library/types/sdk/index.d.ts +10 -0
- package/dist-library/types/sdk/manifest.d.ts +49 -0
- package/dist-library/types/sdk/pattern.d.ts +11 -0
- package/dist-library/types/sdk/preset-core.d.ts +11 -0
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +33 -0
- package/dist-library/types/sdk/registry-core.d.ts +16 -0
- package/dist-library/types/sdk/registry.d.ts +18 -0
- package/dist-library/types/sdk/theme.d.ts +73 -0
- package/dist-library/types/sdk/types.d.ts +221 -0
- package/dist-library/types/sdk/version.d.ts +49 -0
- package/dist-library/types/shareable.d.ts +29 -3
- package/dist-library/types/standalone/diagnostics.d.ts +16 -0
- package/dist-library/types/standalone/events.d.ts +4 -0
- package/dist-library/types/standalone/library.d.ts +6 -0
- package/dist-library/types/standalone/payload.d.ts +15 -0
- package/dist-library/types/standalone/prepare.d.ts +21 -0
- package/dist-library/types/standalone/session.d.ts +68 -0
- package/dist-library/types/standalone/version.d.ts +7 -0
- package/dist-library/types/testing/behavior.d.ts +19 -0
- package/dist-library/types/testing/browser.d.ts +126 -0
- package/dist-library/types/testing/cases.d.ts +16 -0
- package/dist-library/types/testing/index.d.ts +13 -0
- package/dist-library/types/testing/manifest.d.ts +10 -0
- package/dist-library/types/testing/react.d.ts +45 -0
- package/dist-library/types/testing/report.d.ts +20 -0
- package/dist-library/types/testing/types.d.ts +125 -0
- package/dist-library/types/testing/values.d.ts +22 -0
- package/dist-library/types/vite/client.d.ts +36 -0
- package/dist-library/types/vite/discovery.d.ts +51 -0
- package/dist-library/types/vite/index.d.ts +31 -0
- package/dist-library/types/vite/registration.d.ts +109 -0
- package/dist-library/types-BFCrMrg0.js +52 -0
- package/dist-library/validation-W-bmny-x.js +2253 -0
- package/dist-library/values-CIt8AjiU.js +134 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +591 -95
- package/docs/README-ch.md +90 -0
- package/docs/README.md +87 -81
- package/docs/compatibility/compatibility-ch.md +22 -14
- package/docs/compatibility/compatibility-en.md +22 -14
- package/docs/compatibility/source-versioning-ch.md +15 -12
- package/docs/compatibility/source-versioning-en.md +16 -13
- package/docs/development/component-development-ch.md +51 -195
- package/docs/development/component-development-en.md +51 -195
- package/docs/development/component-development-reference-ch.md +253 -0
- package/docs/development/component-development-reference-en.md +238 -0
- package/docs/development/component-protocol-ch.md +51 -50
- package/docs/development/component-protocol-en.md +52 -49
- package/docs/development/local-module-layout-ch.md +59 -0
- package/docs/development/local-module-layout-en.md +59 -0
- package/docs/development/performance-overview-ch.md +402 -0
- package/docs/development/performance-overview-en.md +402 -0
- package/docs/development/releasing-ch.md +8 -104
- package/docs/development/releasing-en.md +8 -104
- package/docs/guides/local-guide-ch.md +28 -9
- package/docs/guides/local-guide-en.md +31 -12
- package/docs/integration/author-tools-ch.md +4 -2
- package/docs/integration/author-tools-en.md +4 -2
- package/docs/integration/codemirror-ch.md +52 -0
- package/docs/integration/codemirror-en.md +29 -0
- package/docs/integration/compiler-ch.md +47 -0
- package/docs/integration/compiler-en.md +34 -0
- package/docs/integration/directory-discovery-ch.md +53 -0
- package/docs/integration/directory-discovery-en.md +31 -0
- package/docs/integration/editor-ch.md +48 -21
- package/docs/integration/editor-en.md +48 -21
- package/docs/integration/extension-sdk-ch.md +392 -0
- package/docs/integration/extension-sdk-en.md +377 -0
- package/docs/integration/local-integration-ch.md +63 -9
- package/docs/integration/local-integration-en.md +89 -13
- package/docs/integration/repository-split-ch.md +40 -0
- package/docs/integration/repository-split-en.md +23 -0
- package/docs/integration/shareable-export-ch.md +46 -2
- package/docs/integration/shareable-export-en.md +46 -2
- package/docs/reference/computations-formatting-ch.md +4 -2
- package/docs/reference/computations-formatting-en.md +4 -2
- package/docs/reference/constraints-collections-ch.md +21 -1
- package/docs/reference/constraints-collections-en.md +21 -1
- package/docs/reference/diagnostics-counting-ch.md +1 -1
- package/docs/reference/diagnostics-counting-en.md +1 -1
- package/docs/reference/html-compatibility-ch.md +4 -0
- package/docs/reference/html-compatibility-en.md +4 -0
- package/docs/reference/local-components-v2-ch.md +2 -0
- package/docs/reference/local-components-v2-en.md +2 -0
- package/docs/reference/local-interaction-syntax-ch.md +51 -15
- package/docs/reference/local-interaction-syntax-en.md +58 -14
- package/docs/reference/theme-protocol-ch.md +79 -7
- package/docs/reference/theme-protocol-en.md +79 -7
- package/docs/reference/tolerance-ch.md +64 -0
- package/docs/reference/tolerance-en.md +57 -0
- package/docs/releases/release-0.4.0-ch.md +2 -0
- package/docs/releases/release-0.4.0-en.md +2 -0
- package/docs/releases/release-0.4.1-ch.md +2 -0
- package/docs/releases/release-0.4.1-en.md +2 -0
- package/docs/releases/release-0.5.0-ch.md +2 -0
- package/docs/releases/release-0.5.0-en.md +2 -0
- package/docs/releases/release-0.5.1-ch.md +2 -0
- package/docs/releases/release-0.5.1-en.md +2 -0
- package/docs/releases/release-0.5.2-ch.md +2 -0
- package/docs/releases/release-0.5.2-en.md +2 -0
- package/docs/releases/release-0.5.3-ch.md +2 -0
- package/docs/releases/release-0.5.3-en.md +2 -0
- package/docs/releases/release-0.6.0-ch.md +2 -0
- package/docs/releases/release-0.6.0-en.md +2 -0
- package/docs/releases/release-0.6.1-ch.md +2 -0
- package/docs/releases/release-0.6.1-en.md +2 -0
- package/docs/releases/release-0.7.0-ch.md +86 -0
- package/docs/releases/release-0.7.0-en.md +86 -0
- package/docs/releases/release-0.8.0-ch.md +126 -0
- package/docs/releases/release-0.8.0-en.md +126 -0
- package/examples/component-package/LICENSE +21 -0
- package/examples/component-package/NOTICES.md +12 -0
- package/examples/component-package/README-ch.md +101 -0
- package/examples/component-package/README.md +133 -0
- package/examples/component-package/package.json +35 -0
- package/examples/component-package/sample/document.reactive.md +14 -0
- package/examples/component-package/scripts/build-export.mjs +44 -0
- package/examples/component-package/scripts/build.mjs +130 -0
- package/examples/component-package/scripts/verify.mjs +257 -0
- package/examples/component-package/src/assets/notice.svg +4 -0
- package/examples/component-package/src/component.css +40 -0
- package/examples/component-package/src/components.tsx +105 -0
- package/examples/component-package/src/harness.tsx +34 -0
- package/examples/component-package/src/manifests.ts +71 -0
- package/examples/component-package/src/node-entry.ts +18 -0
- package/examples/component-package/src/sample.ts +4 -0
- package/examples/component-package/src/theme.css +44 -0
- package/examples/component-package/src/theme.ts +22 -0
- package/examples/component-package/tsconfig.json +15 -0
- package/examples/conformance/README-ch.md +55 -0
- package/examples/conformance/README.md +2 -0
- package/examples/conformance/local-draft-3.json +296 -0
- package/examples/game-2048-package/LICENSE +21 -0
- package/examples/game-2048-package/NOTICES.md +11 -0
- package/examples/game-2048-package/README-ch.md +97 -0
- package/examples/game-2048-package/README.md +102 -0
- package/examples/game-2048-package/package.json +35 -0
- package/examples/game-2048-package/sample/document.reactive.md +17 -0
- package/examples/game-2048-package/scripts/build-export.mjs +44 -0
- package/examples/game-2048-package/scripts/build.mjs +130 -0
- package/examples/game-2048-package/scripts/verify.mjs +180 -0
- package/examples/game-2048-package/src/component.css +161 -0
- package/examples/game-2048-package/src/components.tsx +326 -0
- package/examples/game-2048-package/src/game-engine.ts +228 -0
- package/examples/game-2048-package/src/harness.tsx +34 -0
- package/examples/game-2048-package/src/manifest.ts +85 -0
- package/examples/game-2048-package/src/node-entry.ts +30 -0
- package/examples/game-2048-package/src/sample.ts +4 -0
- package/examples/game-2048-package/tsconfig.json +15 -0
- package/examples/integration/README-ch.md +63 -0
- package/examples/integration/README.md +17 -1
- package/examples/integration/extension-sdk/README-ch.md +24 -0
- package/examples/integration/extension-sdk/README.md +24 -0
- package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
- package/examples/integration/extension-sdk/advanced.tsx +101 -0
- package/examples/integration/extension-sdk/env.d.ts +2 -0
- package/examples/integration/extension-sdk/extensions.tsx +97 -0
- package/examples/integration/extension-sdk/index.html +3 -0
- package/examples/integration/extension-sdk/main.tsx +10 -0
- package/examples/integration/extension-sdk/package.json +6 -0
- package/examples/integration/extension-sdk/standalone.ts +7 -0
- package/examples/integration/extension-sdk/tsconfig.json +8 -0
- package/examples/integration/react-comprehensive/index.html +12 -0
- package/examples/integration/react-comprehensive/main.jsx +123 -0
- package/examples/integration/react-comprehensive/package.json +18 -0
- package/examples/local/README-ch.md +76 -0
- package/examples/local/README.md +4 -2
- package/examples/local/scenarios/blog-zh.reactive.md +71 -0
- package/examples/local/scenarios/blog.reactive.md +71 -0
- package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
- package/examples/local/scenarios/classroom.reactive.md +97 -0
- package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
- package/examples/local/scenarios/proposal.reactive.md +79 -0
- package/examples/local/scenarios/survey-zh.reactive.md +74 -0
- package/examples/local/scenarios/survey.reactive.md +74 -0
- package/examples/local/showcase/README-ch.md +22 -0
- package/examples/local/showcase/README.md +9 -3
- package/examples/local/showcase/features.reactive.md +637 -0
- package/examples/local/showcase/zh/features.reactive.md +637 -0
- package/examples/sci-fi-theme/README-ch.md +131 -0
- package/examples/sci-fi-theme/README.md +146 -0
- package/examples/sci-fi-theme/demo/demo.css +532 -0
- package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
- package/examples/sci-fi-theme/demo/index.html +13 -0
- package/examples/sci-fi-theme/demo/main.tsx +180 -0
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
- package/examples/sci-fi-theme/docs/design-system.md +474 -0
- package/examples/sci-fi-theme/package.json +27 -0
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
- package/examples/sci-fi-theme/src/components.css +1460 -0
- package/examples/sci-fi-theme/src/index.ts +6 -0
- package/examples/sci-fi-theme/src/sci-fi.css +5 -0
- package/examples/sci-fi-theme/src/theme.ts +37 -0
- package/examples/sci-fi-theme/src/tokens.css +408 -0
- package/examples/sci-fi-theme/tsconfig.json +20 -0
- package/examples/sci-fi-theme/vite.config.ts +24 -0
- package/examples/tetris-package/LICENSE +21 -0
- package/examples/tetris-package/NOTICES.md +11 -0
- package/examples/tetris-package/README-ch.md +91 -0
- package/examples/tetris-package/README.md +95 -0
- package/examples/tetris-package/package.json +35 -0
- package/examples/tetris-package/sample/document.reactive.md +16 -0
- package/examples/tetris-package/scripts/build-export.mjs +44 -0
- package/examples/tetris-package/scripts/build.mjs +130 -0
- package/examples/tetris-package/scripts/verify.mjs +173 -0
- package/examples/tetris-package/src/component.css +145 -0
- package/examples/tetris-package/src/components.tsx +334 -0
- package/examples/tetris-package/src/harness.tsx +34 -0
- package/examples/tetris-package/src/manifests.ts +93 -0
- package/examples/tetris-package/src/node-entry.ts +16 -0
- package/examples/tetris-package/src/sample.ts +4 -0
- package/examples/tetris-package/src/tetris-engine.ts +325 -0
- package/examples/tetris-package/tsconfig.json +15 -0
- package/package.json +98 -44
- package/dist-library/compiler-Cm3ppMxG.js +0 -46044
- package/dist-library/react-Bh7_oxZp.js +0 -59655
- package/dist-library/reactive-md-editor.css +0 -2
- package/dist-library/reactive-md-editor.js +0 -3853
- package/dist-library/runtime-DlFYQ4s_.js +0 -498
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
- package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
- package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
- package/dist-library/types/editor/extended-native-components.d.ts +0 -58
- package/dist-library/types/editor/index.d.ts +0 -9
- package/dist-library/types/editor/locale.d.ts +0 -13
- package/dist-library/types/editor/source-authoring.d.ts +0 -59
- package/dist-library/types/editor/types.d.ts +0 -48
- package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
- package/dist-library/types/editor/use-source-history.d.ts +0 -16
- package/dist-library/types/local/compiler.d.ts +0 -4
- package/dist-library/types/local/math.d.ts +0 -48
- package/dist-library/types/local/options.d.ts +0 -36
- package/dist-library/types/local/parser.d.ts +0 -13
- package/dist-library/types/local/render-types.d.ts +0 -27
- package/dist-library/types/local/runtime.d.ts +0 -2
- package/dist-library/types/local/schema.d.ts +0 -77
- package/dist-library/types/local/types.d.ts +0 -263
- package/dist-library/types/local/visuals.d.ts +0 -12
- package/dist-library/types/local/worker.d.ts +0 -98
- package/docs/development/performance-ch.md +0 -76
- package/docs/development/performance-en.md +0 -76
- /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
- /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
- /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
- /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
- /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
- /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
- /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
- /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
- /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
- /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
- /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
- /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# 本地交互语法演示
|
|
2
|
+
|
|
3
|
+
**中文** · [English](README.md)
|
|
4
|
+
|
|
5
|
+
这些是 `local-draft-2` 的独立创作示例,说明见[本地交互语法规范](../../docs/reference/local-interaction-syntax-ch.md)。Playground 以[快速计算器](pricing.reactive.md)开始,随后是六个聚焦的[功能演示](showcase/README-ch.md)。组块分布在这六个场景中;诊断有独立的辅助菜单。宿主可通过[本地模式 API](../../docs/integration/local-integration-ch.md) 编译并渲染每份文档。
|
|
6
|
+
|
|
7
|
+
原有的十一个工作示例和一份故意损坏的诊断文档仍保留在本目录,中文版本在 [zh/](zh/)。六个功能演示位于 [showcase/](showcase/README-ch.md),中文源码在 [showcase/zh/](showcase/zh/)。每个文件都可独立运行。控件、表达式和可视化都使用本地状态。
|
|
8
|
+
|
|
9
|
+
新增的 [HTML 兼容示例](html-compat.reactive.md) 组合了富文本 disclosure、Markdown 和绑定计数器。启用作者 CSS、JavaScript 或扩展 HTML 前,请先阅读[临时 HTML 分流政策](../../docs/reference/html-compatibility-ch.md)。
|
|
10
|
+
|
|
11
|
+
## 从简短示例开始
|
|
12
|
+
|
|
13
|
+
[工作坊配方](recipes/workshop.reactive.md)([中文](recipes/workshop-zh.reactive.md))组合了跨字段校验、条件色调、数字聚合和生成表格行。规则与预算见[条件、校验与集合参考](../../docs/reference/constraints-collections-ch.md)。
|
|
14
|
+
|
|
15
|
+
[账单配方](recipes/invoice.reactive.md)([中文](recipes/invoice-zh.reactive.md))演示共享计算、常量、格式化和 UTC 日期差。[计算参考](../../docs/reference/computations-formatting-ch.md)解释其规则。
|
|
16
|
+
|
|
17
|
+
从[套餐计算器](pricing.reactive.md)开始,然后选择一个[功能演示](showcase/README-ch.md)。如需最小的状态示例,请阅读最初的[计数器](counter.reactive.md)。如果你刚接触该语法,请阅读[新用户指南](../../docs/guides/local-guide-ch.md)。
|
|
18
|
+
|
|
19
|
+
## 原有独立示例目录
|
|
20
|
+
|
|
21
|
+
| 文件 | 内容 |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| [counter.reactive.md](counter.reactive.md) | 单行计数器,内置加、减和重置 |
|
|
24
|
+
| [pricing.reactive.md](pricing.reactive.md) | 套餐计算器,参数在面板内联动 |
|
|
25
|
+
| [comparison.reactive.md](comparison.reactive.md) | 并排比较、就地声明的开关、自行管理选择的标签页 |
|
|
26
|
+
| [parameters.reactive.md](parameters.reactive.md) | 实时参数面板,含文本、日期和选项输入 |
|
|
27
|
+
| [checklist.reactive.md](checklist.reactive.md) | 固定可勾选列表和增强表格 |
|
|
28
|
+
| [charts.reactive.md](charts.reactive.md) | 由表格构建的图表,含 LaTeX 复利公式 |
|
|
29
|
+
| [diagram.reactive.md](diagram.reactive.md) | 自动布局的交互图与曲线 |
|
|
30
|
+
| [catalog.reactive.md](catalog.reactive.md) | 本地目录搜索、排序和分页 |
|
|
31
|
+
| [planning.reactive.md](planning.reactive.md) | 时间线、计时器和分摊计算 |
|
|
32
|
+
| [components.reactive.md](components.reactive.md) | 内容卡片、disclosure、标签页和提示组块 |
|
|
33
|
+
| [gallery.reactive.md](gallery.reactive.md) | 常用输入、独立组块和原样展示的代码 |
|
|
34
|
+
| [diagnostics.reactive.md](diagnostics.reactive.md) | 故意损坏的诊断示例 |
|
|
35
|
+
|
|
36
|
+
Playground 的示例索引维护在仓库的演示应用中。
|
|
37
|
+
|
|
38
|
+
## 工作示例的预期行为
|
|
39
|
+
|
|
40
|
+
下表列出每份文档的初始值和交互检查点。数字遵循正文中的公式。
|
|
41
|
+
|
|
42
|
+
| 示例 | 初始显示 | 交互检查 |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| comparison | Basic 100 USD,Pro 200 USD | 切换年付后变为 80/160;切换标签页无需声明变量;重置后恢复月付 |
|
|
45
|
+
| parameters | 日期 2026-10-22、个人用途、名称为空 | 输入名称会更新卡片;选择团队用途会更新描述;勾选开关会显示准备清单;面板重置会恢复字段和开关 |
|
|
46
|
+
| checklist | 1/3 项,进度约 33.33% | 全选后显示完成提示;重置只恢复第一项;表格可按价格排序、搜索和分页 |
|
|
47
|
+
| charts | 4 项预算对比;储蓄参数 10000、500、5%、20 年;方案柱 40/70 | 利率为 0 时曲线末端读数为 130000;默认复利读数约为 232643.24;5 人时柱为 100/175 |
|
|
48
|
+
| diagram | 选中输入节点,a=1,f=1 | 点击计算节点会更新详情和正文;a=0 时曲线变平并出现提示;两条固定曲线同时显示 |
|
|
49
|
+
| catalog | 8 行目录,每页 4 行 | 搜索 "visual" 返回 chart/plot/diagram;无匹配时显示空状态;重置会清除查询、排序和页码 |
|
|
50
|
+
| planning | 45 分钟时间线,倒计时暂停在 60 秒,每人 88 USD | 计时器启动/暂停/重置;额外费用为 0 时每人支付 80 USD;从 15 开始的参考任务与主段重叠 |
|
|
51
|
+
| components | 简明说明,第一个 disclosure 展开 | 选择详细会切换正文;工具提示可通过键盘聚焦;其他 disclosure 可独立展开 |
|
|
52
|
+
| pricing | 2 人,每人 100 USD,共 200 USD | 年付为 160 USD;5 人年付为 400 USD 并显示团队提示;重置恢复 200 USD |
|
|
53
|
+
| counter | 0 | 三次增量显示 3;三次减量回到 0 并禁用减号;重置回到 0 |
|
|
54
|
+
| gallery | Alex、数量 3、Pro、月付、费用 240 USD | 年付为 192 USD;隐藏再显示快递段会保留其勾选;独立计数器和计时器无需 bind;代码块中的 `example` 不会创建变量 |
|
|
55
|
+
|
|
56
|
+
在 parameters 中,条件清单位于面板之外:其现有勾选在隐藏后仍保留,也不在该面板的重置范围内。gallery 中的独立计数器和计时器同样位于输入面板之外,因此重置输入面板不会影响它们。
|
|
57
|
+
|
|
58
|
+
## 诊断示例的预期结果
|
|
59
|
+
|
|
60
|
+
[diagnostics.reactive.md](diagnostics.reactive.md) 故意包含以下 9 类错误。编辑器应收集可恢复的独立诊断,整份文档不得激活交互。
|
|
61
|
+
|
|
62
|
+
1. `seat` 未声明;消息可以建议已有的参数 `seats`。
|
|
63
|
+
2. `seats` 有重复的显式初始值;两处来源都会被报告。
|
|
64
|
+
3. `ratio` 的初始值为 12,超过最大值 10。
|
|
65
|
+
4. if.when 收到数字 `seats`,但需要布尔值。
|
|
66
|
+
5. `slidr` 是未知组块;消息可以建议 `slider`。
|
|
67
|
+
6. `on-click` 不属于 counter 或本地交互事件语法。
|
|
68
|
+
7. 边目标 `missing` 不存在。
|
|
69
|
+
8. 积分可以显示,但在第一版 plot 中不是可计算结构。
|
|
70
|
+
9. 图表的 cost 列包含 `20 USD`,即需要纯数字处出现文本。
|
|
71
|
+
|
|
72
|
+
## 检查入口
|
|
73
|
+
|
|
74
|
+
`npm test` 检查解析、绑定、表达式、LaTeX、运行时和示例;`npm test (in ReactiveMD-Demo)` 检查 Playground 索引;`npm run check` 运行完整的 Node 端和浏览器门禁,包括实际 tarball 消费和 HTML 导出。各命令见[参与开发指南](../../CONTRIBUTING-ch.md)。
|
|
75
|
+
|
|
76
|
+
[六个场景](showcase/README-ch.md)包含全部 49 个标签名:Functions 中的区间、坐标和数值题;Forms 中的输入选项;Data 中的联动选择;Layout 中的跳转和正文颜色;Flow 中的分步引导和选择题;Checklists 中的待办和计时。独立 gallery 和交互演示源文件仍作为创作示例保留。
|
package/examples/local/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Local interaction syntax demo
|
|
2
2
|
|
|
3
|
+
**English** · [中文](README-ch.md)
|
|
4
|
+
|
|
3
5
|
These are standalone authoring examples for `local-draft-2`, described in the [local interaction syntax specification](../../docs/reference/local-interaction-syntax-en.md). The Playground starts with a [quick calculator](pricing.reactive.md), followed by six focused [feature tours](showcase/README.md). Components are distributed across these six scenarios; diagnostics has an auxiliary menu. Hosts can compile and render every document through the [local mode API](../../docs/integration/local-integration-en.md).
|
|
4
6
|
|
|
5
7
|
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.
|
|
@@ -69,6 +71,6 @@ In parameters, the conditional checklist sits outside the panel: its existing ch
|
|
|
69
71
|
|
|
70
72
|
## Check entry points
|
|
71
73
|
|
|
72
|
-
`npm test` checks parsing, bindings, expressions, LaTeX, the runtime and examples; `npm
|
|
74
|
+
`npm test` checks parsing, bindings, expressions, LaTeX, the runtime and examples; `npm test (in ReactiveMD-Demo)` checks the Playground index; `npm run check` runs the complete Node-side and browser gate, including real-tarball consumption and HTML export. See the [contributing guide](../../CONTRIBUTING.md) for individual commands.
|
|
73
75
|
|
|
74
|
-
The [six scenarios](showcase/README.md) include all
|
|
76
|
+
The [six scenarios](showcase/README.md) include all 49 tag names: intervals, coordinates and numeric questions in Functions; input choices in Forms; linked selection in Data; jumps and prose colors in Layout; guided steps and choice questions in Flow; todos and timing in Checklists. The standalone gallery and interaction-tour sources remain available as authoring examples.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 重读《背影》,我先注意到了那件棉袍
|
|
2
|
+
|
|
3
|
+
林的读书笔记 · 文学短评与生活随记 · 示例博客
|
|
4
|
+
|
|
5
|
+
前几天整理旧书,翻到《背影》,页边还留着中学时划的线。买橘子那一段几乎能背下来,真往下读,却在父亲扑掉衣上泥土的地方停了一下。
|
|
6
|
+
|
|
7
|
+
小时候读这篇文章,我知道该在哪里感动。现在再读,反而想把那些熟悉的结论先放一放:看看一个人怎么走路、怎么转身,怎么把一句要紧的话说得很平常。
|
|
8
|
+
|
|
9
|
+
## 先不急着给父亲下定义
|
|
10
|
+
|
|
11
|
+
父亲到车站送行,照看行李、讲价、嘱托茶房。年轻的叙述者觉得这些安排多余,还嫌父亲说话不够漂亮。文章保留了这份不耐烦,没有把送别从头写得温情脉脉。
|
|
12
|
+
|
|
13
|
+
这让我觉得,后面的眼泪有了来处。回头讲述这件事的人,已经能看见当时自己没有看见的东西;可他仍然把那个急于证明自己长大了的年轻人留在文中。读的时候,我也会跟着尴尬一下。
|
|
14
|
+
|
|
15
|
+
<choices bind="detail" label="这次重读,你最先留意哪个细节?" initial="steps">
|
|
16
|
+
<option value="steps">爬上月台的动作</option>
|
|
17
|
+
<option value="dust">扑掉衣上的泥土</option>
|
|
18
|
+
<option value="words">临走前的叮嘱</option>
|
|
19
|
+
</choices>
|
|
20
|
+
|
|
21
|
+
<if when="{{ detail == 'steps' }}">
|
|
22
|
+
<card title="动作写得很慢">
|
|
23
|
+
穿过铁道、用手攀住月台、把脚往上缩,几句动作把一段很短的路写长了。读者跟着那副身体移动,先感觉到费力,随后才接住儿子的反应。
|
|
24
|
+
</card>
|
|
25
|
+
</if>
|
|
26
|
+
<if when="{{ detail == 'dust' }}">
|
|
27
|
+
<card title="他终于把橘子送到了">
|
|
28
|
+
扑泥土是个收尾的小动作。前面那么费劲,到这里,父亲好像只是办好了一件该办的事。那一点轻松,和儿子刚刚流过的泪放在一起,很有分量。
|
|
29
|
+
</card>
|
|
30
|
+
</if>
|
|
31
|
+
<if when="{{ detail == 'words' }}">
|
|
32
|
+
<card title="一句再普通不过的话">
|
|
33
|
+
父亲说:"我走了;到那边来信!" 他已经照料了很多事,临走还要留下一个可以继续联系的由头。我读到这里想到的,是家里人反复问的那句到了没有。
|
|
34
|
+
</card>
|
|
35
|
+
</if>
|
|
36
|
+
|
|
37
|
+
## 我喜欢文章没有抹掉那些别扭
|
|
38
|
+
|
|
39
|
+
这次重读,我还注意到末尾说起父亲的脾气,以及父子这些年的隔阂。车站里的片刻没有把一段关系里所有难相处的地方都解决掉。
|
|
40
|
+
|
|
41
|
+
这反倒让我愿意多读一遍。一个人的关心和他的固执,可以同时存在;孩子明白了他的辛苦,也未必立刻知道怎样好好说话。文章写的是多年后回望,理解来得慢,有些话也已经错过了时机。
|
|
42
|
+
|
|
43
|
+
文学里这种不够整齐的感受,比一句写好的道理更容易留在我心里。
|
|
44
|
+
|
|
45
|
+
## 合上书以后,我想起一只保温袋
|
|
46
|
+
|
|
47
|
+
有一次从家里返程,我嫌包太满,把母亲塞进来的保温袋又拿了出来。她没有坚持,只说路上饿了可以买点吃的。
|
|
48
|
+
|
|
49
|
+
后来到了车站,我才发现侧袋里多了一小包饼干。这件事没有什么戏剧性,我当时也只是把饼干吃了。重读《背影》时,它忽然浮上来:原来有些回应是在事情过去很久之后,才慢慢补上的。
|
|
50
|
+
|
|
51
|
+
我不想因此把每次打电话都变得郑重。前天晚饭后,我给家里发了张自己炒的菜,母亲回我一句,盐是不是放多了。我看着笑了,接着聊起附近那家菜店。
|
|
52
|
+
|
|
53
|
+
## 留一句自己的话
|
|
54
|
+
|
|
55
|
+
<panel title="读到这里,想记下什么?">
|
|
56
|
+
<textarea bind="note" label="我的阅读旁注" placeholder="可以是一处不同的理解,也可以是一件忽然想起的小事。">
|
|
57
|
+
</panel>
|
|
58
|
+
|
|
59
|
+
<if when="{{ trim(note) != '' }}">
|
|
60
|
+
<card title="这次读完留下的旁注">
|
|
61
|
+
{{ trim(note) }}
|
|
62
|
+
</card>
|
|
63
|
+
</if>
|
|
64
|
+
|
|
65
|
+
这段旁注留在当前阅读页里,刷新前可以复制到自己的笔记。也可以先空着。书有时候要隔几年再翻,才会在另一个地方停下来。
|
|
66
|
+
|
|
67
|
+
## 这次先读到这里
|
|
68
|
+
|
|
69
|
+
那本旧书我没有重新划线,只把折着的书角压平了。下一次读,也许会留意开头的家事,或者结尾那封信。现在记得最清楚的,仍然是父亲把橘子放好以后,伸手扑了扑衣服。
|
|
70
|
+
|
|
71
|
+
原文:[朱自清《背影》](https://zh.wikisource.org/zh-hans/%E8%83%8C%E5%BD%B1)。本文中的生活片段为示例写作。
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Rereading The Back View, I noticed the coat first
|
|
2
|
+
|
|
3
|
+
Lin's reading notebook · Literary reflection and a personal note · Sample blog
|
|
4
|
+
|
|
5
|
+
While sorting old books, I found my school copy of Zhu Ziqing's The Back View. My underlining was still there. I could almost recite the passage about the oranges, but this time I stopped when the father brushed the dirt from his clothes.
|
|
6
|
+
|
|
7
|
+
At school, I knew where I was supposed to feel moved. Reading it now, I wanted to set those familiar conclusions aside for a moment. I watched someone walk, turn around and say something important in an ordinary voice.
|
|
8
|
+
|
|
9
|
+
## Don't define the father too quickly
|
|
10
|
+
|
|
11
|
+
At the station, the father minds the luggage, bargains and asks an attendant to look after his son. The younger narrator finds this unnecessary and dislikes the way his father speaks. The essay keeps that impatience. The farewell doesn't begin as an uncomplicated scene of affection.
|
|
12
|
+
|
|
13
|
+
That gives the later tears somewhere to come from. The person telling the story can now see what his younger self missed, but he leaves that young man, eager to prove his independence, in the scene. I feel a little embarrassed for him as I read.
|
|
14
|
+
|
|
15
|
+
<choices bind="detail" label="Which detail caught your attention this time?" initial="steps">
|
|
16
|
+
<option value="steps">Climbing onto the platform</option>
|
|
17
|
+
<option value="dust">Brushing dirt off the clothes</option>
|
|
18
|
+
<option value="words">The words before leaving</option>
|
|
19
|
+
</choices>
|
|
20
|
+
|
|
21
|
+
<if when="{{ detail == 'steps' }}">
|
|
22
|
+
<card title="The movements slow the scene down">
|
|
23
|
+
Crossing the tracks, gripping the platform, drawing his feet upward: a few actions stretch a short distance. We follow the effort of a body before reaching the son's response.
|
|
24
|
+
</card>
|
|
25
|
+
</if>
|
|
26
|
+
<if when="{{ detail == 'dust' }}">
|
|
27
|
+
<card title="The oranges have finally arrived">
|
|
28
|
+
Brushing off the dirt is a small finishing gesture. After the difficult crossing, the father seems simply to have completed a task. His relief sits beside the son's tears; that difference stays with me.
|
|
29
|
+
</card>
|
|
30
|
+
</if>
|
|
31
|
+
<if when="{{ detail == 'words' }}">
|
|
32
|
+
<card title="An ordinary request">
|
|
33
|
+
Before leaving, he asks his son to write after arriving. He has already arranged so much, and this last request keeps a thread of contact open. It reminds me of the repeated messages from home asking whether I've arrived.
|
|
34
|
+
</card>
|
|
35
|
+
</if>
|
|
36
|
+
|
|
37
|
+
## I'm glad the awkwardness remains
|
|
38
|
+
|
|
39
|
+
This time I also noticed the account of the father's temper and the distance between father and son. The moment at the station doesn't settle everything that has been difficult between them.
|
|
40
|
+
|
|
41
|
+
I wanted to reread it because of that. Care and stubbornness can belong to the same person. Recognising a parent's effort doesn't immediately teach a child how to speak well to them. The narrator looks back after years have passed; understanding arrives slowly, and some chances to say something have gone.
|
|
42
|
+
|
|
43
|
+
That unfinished feeling stays with me longer than a lesson already neatly stated.
|
|
44
|
+
|
|
45
|
+
## Closing the book, I remembered a lunch bag
|
|
46
|
+
|
|
47
|
+
Once, before travelling back from home, I took out the insulated lunch bag my mother had added to an already full backpack. She didn't insist. I could buy something on the way if I got hungry, she said.
|
|
48
|
+
|
|
49
|
+
At the station I discovered a small packet of biscuits in a side pocket. Nothing dramatic happened. I ate them. Rereading The Back View brought that little incident back to me. Some responses seem to arrive long after the event.
|
|
50
|
+
|
|
51
|
+
I don't want every call home to become solemn. After dinner the other day, I sent a photo of something I'd cooked. My mother asked whether I'd used too much salt. I laughed, and we went on to talk about the vegetable shop near my flat.
|
|
52
|
+
|
|
53
|
+
## Leave a sentence of your own
|
|
54
|
+
|
|
55
|
+
<panel title="What would you like to keep from this reading?">
|
|
56
|
+
<textarea bind="note" label="My reading note" placeholder="A different interpretation, perhaps, or a small incident the essay brought back.">
|
|
57
|
+
</panel>
|
|
58
|
+
|
|
59
|
+
<if when="{{ trim(note) != '' }}">
|
|
60
|
+
<card title="A note from this reading">
|
|
61
|
+
{{ trim(note) }}
|
|
62
|
+
</card>
|
|
63
|
+
</if>
|
|
64
|
+
|
|
65
|
+
This note stays in the current reading page. Copy it into your own notebook before refreshing, if you'd like to keep it. You can also leave it empty. Sometimes a book needs a few years between readings before we pause at a different sentence.
|
|
66
|
+
|
|
67
|
+
## I'll stop here for now
|
|
68
|
+
|
|
69
|
+
I didn't underline the old copy again. I flattened a folded page corner. Next time, perhaps I'll notice the family circumstances at the beginning, or the letter near the end. For now, I remember the father putting down the oranges and brushing his clothes.
|
|
70
|
+
|
|
71
|
+
Original Chinese text: [Zhu Ziqing, The Back View](https://zh.wikisource.org/zh-hans/%E8%83%8C%E5%BD%B1). The personal incidents above were written for this sample.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<computed name="b1" value="{{ 4 / pi }}">
|
|
2
|
+
<computed name="b3" value="{{ terms >= 2 ? 4 / (3 * pi) : 0 }}">
|
|
3
|
+
<computed name="b5" value="{{ terms >= 3 ? 4 / (5 * pi) : 0 }}">
|
|
4
|
+
<computed name="b7" value="{{ terms >= 4 ? 4 / (7 * pi) : 0 }}">
|
|
5
|
+
<computed name="b9" value="{{ terms >= 5 ? 4 / (9 * pi) : 0 }}">
|
|
6
|
+
<computed name="b11" value="{{ terms >= 6 ? 4 / (11 * pi) : 0 }}">
|
|
7
|
+
<computed name="b13" value="{{ terms >= 7 ? 4 / (13 * pi) : 0 }}">
|
|
8
|
+
<computed name="b15" value="{{ terms >= 8 ? 4 / (15 * pi) : 0 }}">
|
|
9
|
+
<computed name="approx" value="{{ b1*sin(probe)+b3*sin(3*probe)+b5*sin(5*probe)+b7*sin(7*probe)+b9*sin(9*probe)+b11*sin(11*probe)+b13*sin(13*probe)+b15*sin(15*probe) }}">
|
|
10
|
+
<computed name="coefficient" value="{{ n % 2 == 0 ? 0 : 4 / (n * pi) }}">
|
|
11
|
+
|
|
12
|
+
# 用正弦波拼出一个方波
|
|
13
|
+
|
|
14
|
+
傅里叶级数小课堂 · 约 25 分钟 · 需要定积分基础
|
|
15
|
+
|
|
16
|
+
一条光滑的正弦曲线,怎样拼出平顶、陡边的方波?先看曲线,再推导每一项前面的系数。最后回到图上,检查项数增加后,哪些地方变好了,哪些地方仍然有振荡。
|
|
17
|
+
|
|
18
|
+
## 先看一个周期
|
|
19
|
+
|
|
20
|
+
我们研究周期为 $2\pi$ 的方波。在一个周期内:
|
|
21
|
+
|
|
22
|
+
$$ f(x)=\begin{cases}-1,&-\pi<x<0,\\1,&0<x<\pi.\end{cases} $$
|
|
23
|
+
|
|
24
|
+
在跳跃点取左右极限的平均值 0,再作周期延拓。这个函数是奇函数,因此可以只用正弦项展开。
|
|
25
|
+
|
|
26
|
+
<panel title="调整部分和">
|
|
27
|
+
<slider bind="terms" label="保留的非零项数 N" initial="3" min="1" max="8">
|
|
28
|
+
<slider bind="probe" label="观察位置 x" initial="1" min="-3" max="3" step="0.05">
|
|
29
|
+
</panel>
|
|
30
|
+
|
|
31
|
+
<plot min="-3.141592653589793" max="3.141592653589793" label="方波与傅里叶部分和" x-label="x" y-label="函数值">
|
|
32
|
+
$$ y = \begin{cases} -1,&x<0\\0,&x=0\\1,&x>0 \end{cases} $$
|
|
33
|
+
$$ y = \mathrm{b1}\sin(x)+\mathrm{b3}\sin(3x)+\mathrm{b5}\sin(5x)+\mathrm{b7}\sin(7x)+\mathrm{b9}\sin(9x)+\mathrm{b11}\sin(11x)+\mathrm{b13}\sin(13x)+\mathrm{b15}\sin(15x) $$
|
|
34
|
+
</plot>
|
|
35
|
+
|
|
36
|
+
当前保留 {{ terms }} 个非零项,最高谐波为 **{{ 2 * terms - 1 }}** 次。在 x = {{ formatNumber(probe, 2, 'zh-CN') }} 处,部分和为 **{{ formatNumber(approx, 4, 'zh-CN') }}**,方波取值为 {{ probe > 0 ? 1 : probe < 0 ? -1 : 0 }}。
|
|
37
|
+
|
|
38
|
+
把 N 从 1 慢慢调到 8。先看远离跳跃的位置,再看 $x=0$ 附近。图中的端点显示一个周期内的曲线;周期拼接处同样存在跳跃。
|
|
39
|
+
|
|
40
|
+
## 系数从哪里来
|
|
41
|
+
|
|
42
|
+
周期为 $2\pi$ 的傅里叶展开写作
|
|
43
|
+
|
|
44
|
+
$$ f(x)\sim\frac{a_0}{2}+\sum_{n=1}^{\infty}\left(a_n\cos nx+b_n\sin nx\right). $$
|
|
45
|
+
|
|
46
|
+
利用三角函数在 $[-\pi,\pi]$ 上的正交性,将两边乘以 $\sin(mx)$ 后积分,除第 $m$ 项外的积分都为零,便得到
|
|
47
|
+
|
|
48
|
+
$$ b_n=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin(nx)\,dx. $$
|
|
49
|
+
|
|
50
|
+
$f$ 是奇函数,余弦是偶函数,所以 $a_0=a_n=0$。而 $f(x)\sin(nx)$ 是偶函数,正半周期内 $f(x)=1$,于是
|
|
51
|
+
|
|
52
|
+
$$
|
|
53
|
+
\begin{aligned}
|
|
54
|
+
b_n&=\frac{2}{\pi}\int_0^\pi \sin(nx)\,dx\\
|
|
55
|
+
&=\frac{2}{n\pi}\left(1-\cos n\pi\right)\\
|
|
56
|
+
&=\frac{2}{n\pi}\left(1-(-1)^n\right)\\
|
|
57
|
+
&=\begin{cases}\frac{4}{n\pi},&n\text{ 为奇数},\\0,&n\text{ 为偶数}.\end{cases}
|
|
58
|
+
\end{aligned}
|
|
59
|
+
$$
|
|
60
|
+
|
|
61
|
+
<panel title="检查一个系数">
|
|
62
|
+
<slider bind="n" label="谐波编号 n" initial="3" min="1" max="10">
|
|
63
|
+
第 {{ n }} 个正弦系数为 **{{ formatNumber(coefficient, 6, 'zh-CN') }}**。{{ n % 2 == 0 ? '这一项为零,不进入上方的部分和。' : '它属于奇次谐波;保留到这一阶时才进入部分和。' }}
|
|
64
|
+
</panel>
|
|
65
|
+
|
|
66
|
+
## 把结果写回曲线
|
|
67
|
+
|
|
68
|
+
只保留前 N 个非零项:
|
|
69
|
+
|
|
70
|
+
$$ S_N(x)=\frac{4}{\pi}\sum_{k=1}^{N}\frac{\sin((2k-1)x)}{2k-1}. $$
|
|
71
|
+
|
|
72
|
+
N 数的是非零项,最高频率是 $2N-1$。例如 N=3 时,实际保留的是 1、3、5 次谐波。
|
|
73
|
+
|
|
74
|
+
<steps label="带着问题观察" bind="discussion">
|
|
75
|
+
<step label="平顶" value="flat">固定 x=1,比较 N=1、3、8 的数值。误差的绝对值不一定随每次加项都减小,但整体形状会逐渐接近方波。</step>
|
|
76
|
+
<step label="跳跃" value="jump">把观察位置调到 0。每一个正弦项在这里都为零,级数收敛到左右极限的平均值。</step>
|
|
77
|
+
<step label="过冲" value="overshoot">看跳跃附近超过 1 的小峰。增加项数会让振荡区域变窄,过冲高度不会随项数增加而消失,这就是 Gibbs 现象。</step>
|
|
78
|
+
</steps>
|
|
79
|
+
|
|
80
|
+
## 用两道题检查理解
|
|
81
|
+
|
|
82
|
+
<quiz type="choice" label="为什么 b₂ 等于零?" answer="even" explanation="代入 n=2,1-(-1)²=0。奇函数只说明余弦系数为零,还需要计算正弦系数。">
|
|
83
|
+
<option value="odd">因为奇函数的所有正弦系数都为零</option>
|
|
84
|
+
<option value="even">因为 1-(-1)² 等于零</option>
|
|
85
|
+
<option value="small">因为高频项总是可以忽略</option>
|
|
86
|
+
</quiz>
|
|
87
|
+
|
|
88
|
+
<quiz type="number" label="在 x=0 处,S₈(x) 等于多少?" answer="0" tolerance="0.000001" explanation="每一项都含 sin((2k-1)x),在 x=0 处全为零。">
|
|
89
|
+
</quiz>
|
|
90
|
+
|
|
91
|
+
<accordion>
|
|
92
|
+
<disclosure label="课后再想一步">
|
|
93
|
+
如果把整个方波向右平移,展开式里通常会同时出现正弦项和余弦项。可以先用和差公式展开每个平移后的正弦项,再观察平移改变了哪些系数。
|
|
94
|
+
</disclosure>
|
|
95
|
+
</accordion>
|
|
96
|
+
|
|
97
|
+
参考:[MIT 18.03 课程讲义](https://math.mit.edu/~dunkel/Teach/18.03/2018_CourseNotes.pdf)。
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<computed name="b1" value="{{ 4 / pi }}">
|
|
2
|
+
<computed name="b3" value="{{ terms >= 2 ? 4 / (3 * pi) : 0 }}">
|
|
3
|
+
<computed name="b5" value="{{ terms >= 3 ? 4 / (5 * pi) : 0 }}">
|
|
4
|
+
<computed name="b7" value="{{ terms >= 4 ? 4 / (7 * pi) : 0 }}">
|
|
5
|
+
<computed name="b9" value="{{ terms >= 5 ? 4 / (9 * pi) : 0 }}">
|
|
6
|
+
<computed name="b11" value="{{ terms >= 6 ? 4 / (11 * pi) : 0 }}">
|
|
7
|
+
<computed name="b13" value="{{ terms >= 7 ? 4 / (13 * pi) : 0 }}">
|
|
8
|
+
<computed name="b15" value="{{ terms >= 8 ? 4 / (15 * pi) : 0 }}">
|
|
9
|
+
<computed name="approx" value="{{ b1*sin(probe)+b3*sin(3*probe)+b5*sin(5*probe)+b7*sin(7*probe)+b9*sin(9*probe)+b11*sin(11*probe)+b13*sin(13*probe)+b15*sin(15*probe) }}">
|
|
10
|
+
<computed name="coefficient" value="{{ n % 2 == 0 ? 0 : 4 / (n * pi) }}">
|
|
11
|
+
|
|
12
|
+
# Building a square wave from sine waves
|
|
13
|
+
|
|
14
|
+
A Fourier series lesson · About 25 minutes · Assumes definite integrals
|
|
15
|
+
|
|
16
|
+
How can smooth sine curves produce the flat tops and steep edges of a square wave? Start with the graph, derive its coefficients, then return to the graph to see what improves as more terms are retained.
|
|
17
|
+
|
|
18
|
+
## Start with one period
|
|
19
|
+
|
|
20
|
+
Take a square wave of period $2\pi$:
|
|
21
|
+
|
|
22
|
+
$$ f(x)=\begin{cases}-1,&-\pi<x<0,\\1,&0<x<\pi.\end{cases} $$
|
|
23
|
+
|
|
24
|
+
Set its value at each jump to the mean of its two limits, zero, and extend periodically. The function is odd, so its Fourier expansion needs only sine terms.
|
|
25
|
+
|
|
26
|
+
<panel title="Adjust the partial sum">
|
|
27
|
+
<slider bind="terms" label="Nonzero terms N" initial="3" min="1" max="8">
|
|
28
|
+
<slider bind="probe" label="Observation point x" initial="1" min="-3" max="3" step="0.05">
|
|
29
|
+
</panel>
|
|
30
|
+
|
|
31
|
+
<plot min="-3.141592653589793" max="3.141592653589793" label="Square wave and Fourier partial sum" x-label="x" y-label="function value">
|
|
32
|
+
$$ y = \begin{cases} -1,&x<0\\0,&x=0\\1,&x>0 \end{cases} $$
|
|
33
|
+
$$ y = \mathrm{b1}\sin(x)+\mathrm{b3}\sin(3x)+\mathrm{b5}\sin(5x)+\mathrm{b7}\sin(7x)+\mathrm{b9}\sin(9x)+\mathrm{b11}\sin(11x)+\mathrm{b13}\sin(13x)+\mathrm{b15}\sin(15x) $$
|
|
34
|
+
</plot>
|
|
35
|
+
|
|
36
|
+
With {{ terms }} nonzero terms, the highest harmonic is **{{ 2 * terms - 1 }}**. At x = {{ formatNumber(probe, 2, 'en-US') }}, the partial sum is **{{ formatNumber(approx, 4, 'en-US') }}** and the square wave's value is {{ probe > 0 ? 1 : probe < 0 ? -1 : 0 }}.
|
|
37
|
+
|
|
38
|
+
Move N from 1 to 8. Look away from the jump first, then near $x=0$. The graph's endpoints display the shape within one period; the periodic joins also have jumps.
|
|
39
|
+
|
|
40
|
+
## Where do the coefficients come from?
|
|
41
|
+
|
|
42
|
+
For a function of period $2\pi$, write
|
|
43
|
+
|
|
44
|
+
$$ f(x)\sim\frac{a_0}{2}+\sum_{n=1}^{\infty}\left(a_n\cos nx+b_n\sin nx\right). $$
|
|
45
|
+
|
|
46
|
+
Multiply by $\sin(mx)$ and integrate over $[-\pi,\pi]$. Orthogonality removes every other term, giving
|
|
47
|
+
|
|
48
|
+
$$ b_n=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin(nx)\,dx. $$
|
|
49
|
+
|
|
50
|
+
Since $f$ is odd and cosine is even, $a_0=a_n=0$. The product $f(x)\sin(nx)$ is even, with $f(x)=1$ on the positive half-period. Therefore,
|
|
51
|
+
|
|
52
|
+
$$
|
|
53
|
+
\begin{aligned}
|
|
54
|
+
b_n&=\frac{2}{\pi}\int_0^\pi\sin(nx)\,dx\\
|
|
55
|
+
&=\frac{2}{n\pi}(1-\cos n\pi)\\
|
|
56
|
+
&=\frac{2}{n\pi}(1-(-1)^n)\\
|
|
57
|
+
&=\begin{cases}\frac{4}{n\pi},&n\text{ odd},\\0,&n\text{ even}.\end{cases}
|
|
58
|
+
\end{aligned}
|
|
59
|
+
$$
|
|
60
|
+
|
|
61
|
+
<panel title="Inspect a coefficient">
|
|
62
|
+
<slider bind="n" label="Harmonic number n" initial="3" min="1" max="10">
|
|
63
|
+
Sine coefficient {{ n }} is **{{ formatNumber(coefficient, 6, 'en-US') }}**. {{ n % 2 == 0 ? 'This term is zero and is absent from the partial sum.' : 'This odd harmonic appears only when enough terms are retained.' }}
|
|
64
|
+
</panel>
|
|
65
|
+
|
|
66
|
+
## Put the result back on the graph
|
|
67
|
+
|
|
68
|
+
Retaining the first N nonzero terms gives
|
|
69
|
+
|
|
70
|
+
$$ S_N(x)=\frac{4}{\pi}\sum_{k=1}^{N}\frac{\sin((2k-1)x)}{2k-1}. $$
|
|
71
|
+
|
|
72
|
+
N counts nonzero terms; the highest frequency is $2N-1$. For N=3, the retained harmonics are 1, 3 and 5.
|
|
73
|
+
|
|
74
|
+
<steps label="Questions for the graph" bind="discussion">
|
|
75
|
+
<step label="Flat sections" value="flat">Fix x=1 and compare N=1, 3 and 8. The pointwise absolute error need not decrease after every added term, although the overall shape approaches the square wave.</step>
|
|
76
|
+
<step label="Jumps" value="jump">Set x=0. Every sine term vanishes here, so the series gives the mean of the left and right limits.</step>
|
|
77
|
+
<step label="Overshoot" value="overshoot">Inspect the peak above 1 near a jump. More terms narrow the oscillating region, but the overshoot does not disappear. This is the Gibbs phenomenon.</step>
|
|
78
|
+
</steps>
|
|
79
|
+
|
|
80
|
+
## Check your understanding
|
|
81
|
+
|
|
82
|
+
<quiz type="choice" label="Why is b₂ zero?" answer="even" explanation="For n=2, 1-(-1)²=0. Oddness removes cosine coefficients; the sine coefficients still need calculating.">
|
|
83
|
+
<option value="odd">Every sine coefficient of an odd function is zero</option>
|
|
84
|
+
<option value="even">Because 1-(-1)² is zero</option>
|
|
85
|
+
<option value="small">High-frequency terms can always be ignored</option>
|
|
86
|
+
</quiz>
|
|
87
|
+
|
|
88
|
+
<quiz type="number" label="What is S₈(x) at x=0?" answer="0" tolerance="0.000001" explanation="Every term contains sin((2k-1)x), which is zero at x=0.">
|
|
89
|
+
</quiz>
|
|
90
|
+
|
|
91
|
+
<accordion>
|
|
92
|
+
<disclosure label="A question to take away">
|
|
93
|
+
Shift the square wave to the right. Its expansion will generally contain both sine and cosine terms. Expand each shifted sine with the angle subtraction formula and identify which coefficients change.
|
|
94
|
+
</disclosure>
|
|
95
|
+
</accordion>
|
|
96
|
+
|
|
97
|
+
Reference: [MIT 18.03 lecture notes](https://math.mit.edu/~dunkel/Teach/18.03/2018_CourseNotes.pdf).
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<computed name="shelfCost" value="{{ shelves * (reuse ? 360 : 480) }}">
|
|
2
|
+
<computed name="bookCost" value="{{ books * 18 }}">
|
|
3
|
+
<computed name="seatCost" value="{{ seats * 80 }}">
|
|
4
|
+
<computed name="subtotal" value="{{ shelfCost + bookCost + seatCost + 600 }}">
|
|
5
|
+
<computed name="reserve" value="{{ subtotal * 0.1 }}">
|
|
6
|
+
<computed name="total" value="{{ subtotal + reserve }}">
|
|
7
|
+
|
|
8
|
+
# 把社区活动室的一角留给阅读
|
|
9
|
+
|
|
10
|
+
居民议事会提案 · 四周试用计划 · 以下金额为可调整的估算
|
|
11
|
+
|
|
12
|
+
活动室靠窗的一排桌子平时闲着。我们想先布置一个小阅读角,让放学后的孩子有地方翻书,也让周末的共读活动有个固定集合点。
|
|
13
|
+
|
|
14
|
+
这次先采购书架和一批基础读物,保留现有桌子。试用四周后,再根据座位使用情况和借阅记录决定是否扩大。
|
|
15
|
+
|
|
16
|
+
## 这次准备做多大?
|
|
17
|
+
|
|
18
|
+
<grid>
|
|
19
|
+
<card title="调整采购范围">
|
|
20
|
+
<number bind="shelves" label="书架数量" initial="2" min="1" max="6">
|
|
21
|
+
<number bind="books" label="首批图书(本)" initial="80" min="20" max="200" step="10">
|
|
22
|
+
<slider bind="seats" label="阅读座位" initial="12" min="4" max="24" step="2">
|
|
23
|
+
<toggle bind="reuse" label="采用翻新书架">
|
|
24
|
+
<number bind="budget" label="可用预算(元)" initial="5000" min="1000" max="15000" step="100">
|
|
25
|
+
</card>
|
|
26
|
+
<card title="提交议事会的金额">
|
|
27
|
+
采购及布置 {{ formatCurrency(subtotal, 'CNY', 2, 'zh-CN') }},另留 10% 机动金。
|
|
28
|
+
|
|
29
|
+
申请总额:**{{ formatCurrency(total, 'CNY', 2, 'zh-CN') }}**。
|
|
30
|
+
|
|
31
|
+
预算余额:**{{ formatCurrency(budget - total, 'CNY', 2, 'zh-CN') }}**。
|
|
32
|
+
|
|
33
|
+
<if when="{{ total <= budget }}">
|
|
34
|
+
<badge tone="success">当前范围在预算内</badge>
|
|
35
|
+
</if>
|
|
36
|
+
<if when="{{ total > budget }}">
|
|
37
|
+
<alert tone="warning" title="需要缩小采购范围">还差 {{ formatCurrency(total - budget, 'CNY', 2, 'zh-CN') }}。可以先减少首批图书,或比较翻新书架的报价。</alert>
|
|
38
|
+
</if>
|
|
39
|
+
</card>
|
|
40
|
+
</grid>
|
|
41
|
+
|
|
42
|
+
## 钱花在哪里
|
|
43
|
+
|
|
44
|
+
<chart title="阅读角采购明细" y-label="元">
|
|
45
|
+
| 项目 | 金额 |
|
|
46
|
+
| --- | ---: |
|
|
47
|
+
| 书架 | {{ shelfCost }} |
|
|
48
|
+
| 图书 | {{ bookCost }} |
|
|
49
|
+
| 座位 | {{ seatCost }} |
|
|
50
|
+
| 灯具与标识 | 600 |
|
|
51
|
+
| 机动金 | {{ reserve }} |
|
|
52
|
+
</chart>
|
|
53
|
+
|
|
54
|
+
图书按每本 18 元、座位按每个 80 元估算。灯具和分区标识合计 600 元。翻新书架按每个 360 元计算,新书架按每个 480 元计算,实际采购前再核对报价。
|
|
55
|
+
|
|
56
|
+
## 什么时候可以用
|
|
57
|
+
|
|
58
|
+
<timeline title="从方案获批起计算(周)">
|
|
59
|
+
| 事项 | 开始 | 时长 | 说明 |
|
|
60
|
+
| --- | ---: | ---: | --- |
|
|
61
|
+
| 确认场地 | 0 | 1 | 量尺寸、确认通道和插座位置,征集首批书单 |
|
|
62
|
+
| 采购与布置 | 1 | 1 | 两位志愿者清点到货,贴好分类和借阅说明 |
|
|
63
|
+
| 开放试用 | 2 | 4 | 每周六共读,记录到访、座位使用和借还情况 |
|
|
64
|
+
| 回到议事会 | 6 | 1 | 根据四周记录讨论添书、开放时段和座位 |
|
|
65
|
+
</timeline>
|
|
66
|
+
|
|
67
|
+
## 请议事会决定什么
|
|
68
|
+
|
|
69
|
+
<checklist label="会前确认">
|
|
70
|
+
- [ ] 同意使用靠窗区域,保留日常活动通道
|
|
71
|
+
- [ ] 确认采购上限及报销负责人
|
|
72
|
+
- [ ] 为四周试用排好志愿者值班
|
|
73
|
+
</checklist>
|
|
74
|
+
|
|
75
|
+
<accordion>
|
|
76
|
+
<disclosure label="如果试用后使用率不高呢?">
|
|
77
|
+
先查看是开放时间不合适,还是书目与居民需要不匹配。下一轮只调整其中一项,再记录两周。可移动书架和座椅能够重新布置,未使用的机动金留在预算内。
|
|
78
|
+
</disclosure>
|
|
79
|
+
</accordion>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<computed name="shelfCost" value="{{ shelves * (reuse ? 360 : 480) }}">
|
|
2
|
+
<computed name="bookCost" value="{{ books * 18 }}">
|
|
3
|
+
<computed name="seatCost" value="{{ seats * 80 }}">
|
|
4
|
+
<computed name="subtotal" value="{{ shelfCost + bookCost + seatCost + 600 }}">
|
|
5
|
+
<computed name="reserve" value="{{ subtotal * 0.1 }}">
|
|
6
|
+
<computed name="total" value="{{ subtotal + reserve }}">
|
|
7
|
+
|
|
8
|
+
# A reading corner for the community room
|
|
9
|
+
|
|
10
|
+
Residents' meeting proposal · Four-week trial · All costs are adjustable estimates in CNY
|
|
11
|
+
|
|
12
|
+
The tables by the window are often empty. We want to try a small reading corner where children can browse books after school and weekend reading groups can meet.
|
|
13
|
+
|
|
14
|
+
For the first round, buy shelves and a starter collection while keeping the existing tables. After four weeks, use seat counts and borrowing records to decide whether to expand.
|
|
15
|
+
|
|
16
|
+
## How much should we start with?
|
|
17
|
+
|
|
18
|
+
<grid>
|
|
19
|
+
<card title="Adjust the shopping list">
|
|
20
|
+
<number bind="shelves" label="Bookshelves" initial="2" min="1" max="6">
|
|
21
|
+
<number bind="books" label="Starter books" initial="80" min="20" max="200" step="10">
|
|
22
|
+
<slider bind="seats" label="Reading seats" initial="12" min="4" max="24" step="2">
|
|
23
|
+
<toggle bind="reuse" label="Use refurbished shelves">
|
|
24
|
+
<number bind="budget" label="Available budget (CNY)" initial="5000" min="1000" max="15000" step="100">
|
|
25
|
+
</card>
|
|
26
|
+
<card title="Amount for approval">
|
|
27
|
+
Purchases and setup cost {{ formatCurrency(subtotal, 'CNY', 2, 'en-US') }}, plus a 10% contingency.
|
|
28
|
+
|
|
29
|
+
Requested total: **{{ formatCurrency(total, 'CNY', 2, 'en-US') }}**.
|
|
30
|
+
|
|
31
|
+
Budget remaining: **{{ formatCurrency(budget - total, 'CNY', 2, 'en-US') }}**.
|
|
32
|
+
|
|
33
|
+
<if when="{{ total <= budget }}">
|
|
34
|
+
<badge tone="success">The current scope fits the budget</badge>
|
|
35
|
+
</if>
|
|
36
|
+
<if when="{{ total > budget }}">
|
|
37
|
+
<alert tone="warning" title="Reduce the initial scope">We need another {{ formatCurrency(total - budget, 'CNY', 2, 'en-US') }}. Start with fewer books or compare refurbished shelf prices.</alert>
|
|
38
|
+
</if>
|
|
39
|
+
</card>
|
|
40
|
+
</grid>
|
|
41
|
+
|
|
42
|
+
## Where the money goes
|
|
43
|
+
|
|
44
|
+
<chart title="Reading corner purchases" y-label="CNY">
|
|
45
|
+
| Item | Cost |
|
|
46
|
+
| --- | ---: |
|
|
47
|
+
| Shelves | {{ shelfCost }} |
|
|
48
|
+
| Books | {{ bookCost }} |
|
|
49
|
+
| Seats | {{ seatCost }} |
|
|
50
|
+
| Lighting and signs | 600 |
|
|
51
|
+
| Contingency | {{ reserve }} |
|
|
52
|
+
</chart>
|
|
53
|
+
|
|
54
|
+
The estimate allows CNY 18 per book and CNY 80 per seat. Lighting and section signs cost CNY 600 together. Refurbished shelves are estimated at CNY 360 each, new ones at CNY 480. Check supplier quotes before ordering.
|
|
55
|
+
|
|
56
|
+
## When can it open?
|
|
57
|
+
|
|
58
|
+
<timeline title="Weeks from approval">
|
|
59
|
+
| Task | Start | Duration | Notes |
|
|
60
|
+
| --- | ---: | ---: | --- |
|
|
61
|
+
| Confirm the space | 0 | 1 | Measure the corner, check routes and sockets, collect book suggestions |
|
|
62
|
+
| Buy and set up | 1 | 1 | Two volunteers check deliveries, add categories and borrowing instructions |
|
|
63
|
+
| Run the trial | 2 | 4 | Saturday reading sessions; record visits, seat use and loans |
|
|
64
|
+
| Report to residents | 6 | 1 | Use four weeks of records to discuss books, hours and seating |
|
|
65
|
+
</timeline>
|
|
66
|
+
|
|
67
|
+
## What does the meeting need to decide?
|
|
68
|
+
|
|
69
|
+
<checklist label="Before the meeting">
|
|
70
|
+
- [ ] Approve the window area while keeping routes clear
|
|
71
|
+
- [ ] Confirm a spending limit and a reimbursement contact
|
|
72
|
+
- [ ] Fill the volunteer rota for the four-week trial
|
|
73
|
+
</checklist>
|
|
74
|
+
|
|
75
|
+
<accordion>
|
|
76
|
+
<disclosure label="What if few people use it?">
|
|
77
|
+
Check whether the opening hours or the book selection caused the problem. Change one of them and record another two weeks. The movable shelves and chairs can be rearranged; unused contingency stays in the budget.
|
|
78
|
+
</disclosure>
|
|
79
|
+
</accordion>
|