@classytic/labs 0.1.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/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/biology/enzyme-rate/index.d.mts +1 -0
- package/dist/biology/enzyme-rate/preset.d.mts +25 -0
- package/dist/biology/enzyme-rate/preset.mjs +256 -0
- package/dist/biology/genetic-cross/core.d.mts +64 -0
- package/dist/biology/genetic-cross/core.mjs +147 -0
- package/dist/biology/genetic-cross/grid.mjs +239 -0
- package/dist/biology/genetic-cross/index.d.mts +3 -0
- package/dist/biology/genetic-cross/preset.d.mts +26 -0
- package/dist/biology/genetic-cross/preset.mjs +184 -0
- package/dist/biology/genetic-cross/sex-linked.d.mts +27 -0
- package/dist/biology/genetic-cross/sex-linked.mjs +226 -0
- package/dist/biology/index.d.mts +11 -0
- package/dist/biology/index.mjs +12 -0
- package/dist/biology/photosynthesis-factors/index.d.mts +1 -0
- package/dist/biology/photosynthesis-factors/preset.d.mts +25 -0
- package/dist/biology/photosynthesis-factors/preset.mjs +270 -0
- package/dist/biology/punnett-cross/index.d.mts +1 -0
- package/dist/biology/punnett-cross/preset.d.mts +27 -0
- package/dist/biology/punnett-cross/preset.mjs +21 -0
- package/dist/biology/respiration/index.d.mts +1 -0
- package/dist/biology/respiration/preset.d.mts +17 -0
- package/dist/biology/respiration/preset.mjs +179 -0
- package/dist/biology/sequence/central-dogma.d.mts +17 -0
- package/dist/biology/sequence/central-dogma.mjs +339 -0
- package/dist/biology/sequence/core.d.mts +38 -0
- package/dist/biology/sequence/core.mjs +178 -0
- package/dist/biology/sequence/index.d.mts +3 -0
- package/dist/biology/sequence/preset.d.mts +20 -0
- package/dist/biology/sequence/preset.mjs +235 -0
- package/dist/blocks/accounting.d.mts +142 -0
- package/dist/blocks/accounting.mjs +446 -0
- package/dist/blocks/authoring.d.mts +12 -0
- package/dist/blocks/authoring.mjs +705 -0
- package/dist/blocks/biology.d.mts +197 -0
- package/dist/blocks/biology.mjs +513 -0
- package/dist/blocks/chem.d.mts +128 -0
- package/dist/blocks/chem.mjs +486 -0
- package/dist/blocks/circuits.d.mts +86 -0
- package/dist/blocks/circuits.mjs +348 -0
- package/dist/blocks/discrete.d.mts +62 -0
- package/dist/blocks/discrete.mjs +314 -0
- package/dist/blocks/economics.d.mts +56 -0
- package/dist/blocks/economics.mjs +203 -0
- package/dist/blocks/geography.d.mts +58 -0
- package/dist/blocks/geography.mjs +115 -0
- package/dist/blocks/geometry.d.mts +28 -0
- package/dist/blocks/geometry.mjs +160 -0
- package/dist/blocks/ict.d.mts +65 -0
- package/dist/blocks/ict.mjs +197 -0
- package/dist/blocks/index.d.mts +4555 -0
- package/dist/blocks/index.mjs +120 -0
- package/dist/blocks/lab-block.d.mts +16 -0
- package/dist/blocks/lab-block.mjs +74 -0
- package/dist/blocks/lab-config.d.mts +23 -0
- package/dist/blocks/lab-config.mjs +200 -0
- package/dist/blocks/lab-gallery.d.mts +30 -0
- package/dist/blocks/lab-gallery.mjs +208 -0
- package/dist/blocks/language.d.mts +349 -0
- package/dist/blocks/language.mjs +750 -0
- package/dist/blocks/lesson.d.mts +43 -0
- package/dist/blocks/lesson.mjs +140 -0
- package/dist/blocks/math.d.mts +411 -0
- package/dist/blocks/math.mjs +1536 -0
- package/dist/blocks/ml.d.mts +84 -0
- package/dist/blocks/ml.mjs +146 -0
- package/dist/blocks/physics.d.mts +259 -0
- package/dist/blocks/physics.mjs +868 -0
- package/dist/blocks/statistics.d.mts +29 -0
- package/dist/blocks/statistics.mjs +123 -0
- package/dist/catalog/index.d.mts +3 -0
- package/dist/catalog/index.mjs +8 -0
- package/dist/catalog/registry.d.mts +46 -0
- package/dist/catalog/registry.mjs +56 -0
- package/dist/catalog/templates.d.mts +11 -0
- package/dist/catalog/templates.mjs +141 -0
- package/dist/chem/battery.d.mts +16 -0
- package/dist/chem/battery.mjs +311 -0
- package/dist/chem/bohr-atom.d.mts +16 -0
- package/dist/chem/bohr-atom.mjs +212 -0
- package/dist/chem/diffusion/asset.mjs +76 -0
- package/dist/chem/diffusion/index.d.mts +1 -0
- package/dist/chem/diffusion/preset.d.mts +15 -0
- package/dist/chem/diffusion/preset.mjs +188 -0
- package/dist/chem/electrochem/index.d.mts +1 -0
- package/dist/chem/electrochem/preset.d.mts +23 -0
- package/dist/chem/electrochem/preset.mjs +402 -0
- package/dist/chem/equilibrium/index.d.mts +1 -0
- package/dist/chem/equilibrium/preset.d.mts +36 -0
- package/dist/chem/equilibrium/preset.mjs +416 -0
- package/dist/chem/gas-box/index.d.mts +1 -0
- package/dist/chem/gas-box/preset.d.mts +27 -0
- package/dist/chem/gas-box/preset.mjs +395 -0
- package/dist/chem/index.d.mts +16 -0
- package/dist/chem/index.mjs +17 -0
- package/dist/chem/kinetics/index.d.mts +1 -0
- package/dist/chem/kinetics/preset.d.mts +31 -0
- package/dist/chem/kinetics/preset.mjs +478 -0
- package/dist/chem/periodic-trends/index.d.mts +1 -0
- package/dist/chem/periodic-trends/preset.d.mts +21 -0
- package/dist/chem/periodic-trends/preset.mjs +831 -0
- package/dist/chem/reaction-lab.d.mts +18 -0
- package/dist/chem/reaction-lab.mjs +165 -0
- package/dist/chem/reaction-profile.d.mts +21 -0
- package/dist/chem/reaction-profile.mjs +287 -0
- package/dist/chem/solution/dilution.d.mts +27 -0
- package/dist/chem/solution/dilution.mjs +199 -0
- package/dist/chem/solution/field.d.mts +30 -0
- package/dist/chem/solution/field.mjs +145 -0
- package/dist/chem/solution/index.d.mts +3 -0
- package/dist/chem/solution/solution-box.d.mts +28 -0
- package/dist/chem/solution/solution-box.mjs +140 -0
- package/dist/chem/stoichiometry/index.d.mts +1 -0
- package/dist/chem/stoichiometry/preset.d.mts +29 -0
- package/dist/chem/stoichiometry/preset.mjs +392 -0
- package/dist/chem/titration/index.d.mts +1 -0
- package/dist/chem/titration/preset.d.mts +29 -0
- package/dist/chem/titration/preset.mjs +436 -0
- package/dist/circuits/ac-dc/asset.mjs +295 -0
- package/dist/circuits/ac-dc/index.d.mts +1 -0
- package/dist/circuits/ac-dc/preset.d.mts +16 -0
- package/dist/circuits/ac-dc/preset.mjs +134 -0
- package/dist/circuits/capacitor-leak/index.d.mts +1 -0
- package/dist/circuits/capacitor-leak/preset.d.mts +32 -0
- package/dist/circuits/capacitor-leak/preset.mjs +271 -0
- package/dist/circuits/circuit/asset.d.mts +6 -0
- package/dist/circuits/circuit/asset.mjs +367 -0
- package/dist/circuits/circuit/index.d.mts +2 -0
- package/dist/circuits/circuit/preset.d.mts +46 -0
- package/dist/circuits/circuit/preset.mjs +235 -0
- package/dist/circuits/circuit-builder.d.mts +30 -0
- package/dist/circuits/circuit-builder.mjs +412 -0
- package/dist/circuits/circuit-lab.d.mts +20 -0
- package/dist/circuits/circuit-lab.mjs +400 -0
- package/dist/circuits/index.d.mts +7 -0
- package/dist/circuits/index.mjs +8 -0
- package/dist/commerce/accounting/core.d.mts +48 -0
- package/dist/commerce/accounting/core.mjs +57 -0
- package/dist/commerce/accounting/equation-balance.d.mts +35 -0
- package/dist/commerce/accounting/equation-balance.mjs +292 -0
- package/dist/commerce/accounting/index.d.mts +4 -0
- package/dist/commerce/accounting/journal-poster.d.mts +29 -0
- package/dist/commerce/accounting/journal-poster.mjs +472 -0
- package/dist/commerce/accounting/statement-sorter.d.mts +25 -0
- package/dist/commerce/accounting/statement-sorter.mjs +304 -0
- package/dist/commerce/economics/core.d.mts +33 -0
- package/dist/commerce/economics/core.mjs +26 -0
- package/dist/commerce/economics/demand-shift-vs-move.d.mts +35 -0
- package/dist/commerce/economics/demand-shift-vs-move.mjs +324 -0
- package/dist/commerce/economics/elasticity-revenue.d.mts +31 -0
- package/dist/commerce/economics/elasticity-revenue.mjs +253 -0
- package/dist/commerce/economics/index.d.mts +4 -0
- package/dist/commerce/economics/market-equilibrium.d.mts +33 -0
- package/dist/commerce/economics/market-equilibrium.mjs +340 -0
- package/dist/commerce/index.d.mts +9 -0
- package/dist/commerce/index.mjs +10 -0
- package/dist/core/easing.d.mts +28 -0
- package/dist/core/easing.mjs +66 -0
- package/dist/core/index.d.mts +10 -0
- package/dist/core/index.mjs +11 -0
- package/dist/core/numeric.d.mts +37 -0
- package/dist/core/numeric.mjs +75 -0
- package/dist/core/reactive.d.mts +24 -0
- package/dist/core/reactive.mjs +51 -0
- package/dist/core/rng.d.mts +21 -0
- package/dist/core/rng.mjs +39 -0
- package/dist/core/tex.d.mts +14 -0
- package/dist/core/tex.mjs +44 -0
- package/dist/core/timeline.d.mts +34 -0
- package/dist/core/timeline.mjs +77 -0
- package/dist/core/util.d.mts +19 -0
- package/dist/core/util.mjs +31 -0
- package/dist/discrete/arrangements/preset.d.mts +28 -0
- package/dist/discrete/arrangements/preset.mjs +304 -0
- package/dist/discrete/bayes/preset.d.mts +33 -0
- package/dist/discrete/bayes/preset.mjs +476 -0
- package/dist/discrete/binomial/preset.d.mts +25 -0
- package/dist/discrete/binomial/preset.mjs +333 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -0
- package/dist/discrete/core/combinatorics.mjs +57 -0
- package/dist/discrete/core/inclusionExclusion.d.mts +19 -0
- package/dist/discrete/core/inclusionExclusion.mjs +30 -0
- package/dist/discrete/core/pigeonhole.d.mts +15 -0
- package/dist/discrete/core/pigeonhole.mjs +24 -0
- package/dist/discrete/core/probability.d.mts +29 -0
- package/dist/discrete/core/probability.mjs +43 -0
- package/dist/discrete/core/sets.d.mts +21 -0
- package/dist/discrete/core/sets.mjs +45 -0
- package/dist/discrete/counting-slots/preset.d.mts +30 -0
- package/dist/discrete/counting-slots/preset.mjs +553 -0
- package/dist/discrete/counting-tree/index.d.mts +1 -0
- package/dist/discrete/counting-tree/preset.d.mts +44 -0
- package/dist/discrete/counting-tree/preset.mjs +364 -0
- package/dist/discrete/expected-value/preset.d.mts +28 -0
- package/dist/discrete/expected-value/preset.mjs +352 -0
- package/dist/discrete/hypergeometric/preset.d.mts +25 -0
- package/dist/discrete/hypergeometric/preset.mjs +330 -0
- package/dist/discrete/index.d.mts +26 -0
- package/dist/discrete/index.mjs +27 -0
- package/dist/discrete/karnaugh/index.d.mts +1 -0
- package/dist/discrete/karnaugh/preset.d.mts +30 -0
- package/dist/discrete/karnaugh/preset.mjs +452 -0
- package/dist/discrete/lln/asset.mjs +206 -0
- package/dist/discrete/lln/index.d.mts +1 -0
- package/dist/discrete/lln/preset.d.mts +17 -0
- package/dist/discrete/lln/preset.mjs +152 -0
- package/dist/discrete/logic-circuit/index.d.mts +1 -0
- package/dist/discrete/logic-circuit/preset.d.mts +47 -0
- package/dist/discrete/logic-circuit/preset.mjs +307 -0
- package/dist/discrete/monte-carlo/index.d.mts +1 -0
- package/dist/discrete/monte-carlo/preset.d.mts +64 -0
- package/dist/discrete/monte-carlo/preset.mjs +446 -0
- package/dist/discrete/monty-hall/index.d.mts +1 -0
- package/dist/discrete/monty-hall/preset.d.mts +23 -0
- package/dist/discrete/monty-hall/preset.mjs +491 -0
- package/dist/discrete/outcome-builder/preset.d.mts +24 -0
- package/dist/discrete/outcome-builder/preset.mjs +283 -0
- package/dist/discrete/pascal/preset.d.mts +24 -0
- package/dist/discrete/pascal/preset.mjs +372 -0
- package/dist/discrete/sample-space/index.d.mts +1 -0
- package/dist/discrete/sample-space/preset.d.mts +42 -0
- package/dist/discrete/sample-space/preset.mjs +395 -0
- package/dist/discrete/selection/preset.d.mts +33 -0
- package/dist/discrete/selection/preset.mjs +406 -0
- package/dist/discrete/truth-table/index.d.mts +1 -0
- package/dist/discrete/truth-table/preset.d.mts +30 -0
- package/dist/discrete/truth-table/preset.mjs +456 -0
- package/dist/discrete/venn/index.d.mts +1 -0
- package/dist/discrete/venn/preset.d.mts +32 -0
- package/dist/discrete/venn/preset.mjs +461 -0
- package/dist/geography/cycle-lab/index.d.mts +1 -0
- package/dist/geography/cycle-lab/preset.d.mts +25 -0
- package/dist/geography/cycle-lab/preset.mjs +254 -0
- package/dist/geography/cycles.d.mts +21 -0
- package/dist/geography/cycles.mjs +205 -0
- package/dist/geography/index.d.mts +4 -0
- package/dist/geography/index.mjs +5 -0
- package/dist/geometry/board/index.d.mts +1 -0
- package/dist/geometry/board/preset.d.mts +71 -0
- package/dist/geometry/board/preset.mjs +148 -0
- package/dist/geometry/builder.d.mts +18 -0
- package/dist/geometry/builder.mjs +332 -0
- package/dist/geometry/index.d.mts +4 -0
- package/dist/geometry/index.mjs +5 -0
- package/dist/geometry/intersecting-circles.d.mts +17 -0
- package/dist/geometry/intersecting-circles.mjs +104 -0
- package/dist/ict/index.d.mts +5 -0
- package/dist/ict/index.mjs +6 -0
- package/dist/ict/number-systems/base-odometer.d.mts +34 -0
- package/dist/ict/number-systems/base-odometer.mjs +160 -0
- package/dist/ict/number-systems/bit-grouper.d.mts +32 -0
- package/dist/ict/number-systems/bit-grouper.mjs +190 -0
- package/dist/ict/number-systems/index.d.mts +4 -0
- package/dist/ict/number-systems/place-value-dial.d.mts +29 -0
- package/dist/ict/number-systems/place-value-dial.mjs +153 -0
- package/dist/ict/number-systems/wheel.d.mts +73 -0
- package/dist/ict/number-systems/wheel.mjs +279 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +11 -0
- package/dist/kit/anim.mjs +52 -0
- package/dist/kit/annotate.mjs +116 -0
- package/dist/kit/answer-check.d.mts +38 -0
- package/dist/kit/answer-check.mjs +65 -0
- package/dist/kit/asset-util.mjs +15 -0
- package/dist/kit/controls.mjs +77 -0
- package/dist/kit/cycle.d.mts +44 -0
- package/dist/kit/cycle.mjs +188 -0
- package/dist/kit/diagram.mjs +176 -0
- package/dist/kit/electronics.mjs +357 -0
- package/dist/kit/expr-analysis.d.mts +37 -0
- package/dist/kit/expr-analysis.mjs +111 -0
- package/dist/kit/frame.d.mts +70 -0
- package/dist/kit/frame.mjs +205 -0
- package/dist/kit/freq-tree.mjs +99 -0
- package/dist/kit/gameshow.mjs +315 -0
- package/dist/kit/index.d.mts +5 -0
- package/dist/kit/index.mjs +6 -0
- package/dist/kit/logic-gates.d.mts +6 -0
- package/dist/kit/logic-gates.mjs +210 -0
- package/dist/kit/molecules.mjs +178 -0
- package/dist/kit/pedagogy.d.mts +126 -0
- package/dist/kit/pedagogy.mjs +331 -0
- package/dist/kit/play.d.mts +21 -0
- package/dist/kit/play.mjs +52 -0
- package/dist/kit/probability.mjs +141 -0
- package/dist/kit/proportion.mjs +112 -0
- package/dist/kit/reaction.mjs +102 -0
- package/dist/kit/rich.d.mts +10 -0
- package/dist/kit/rich.mjs +21 -0
- package/dist/kit/scale.mjs +230 -0
- package/dist/kit/space.mjs +326 -0
- package/dist/kit/steps.d.mts +24 -0
- package/dist/kit/steps.mjs +57 -0
- package/dist/kit/thermal.mjs +289 -0
- package/dist/language/agreement/index.d.mts +1 -0
- package/dist/language/agreement/preset.d.mts +27 -0
- package/dist/language/agreement/preset.mjs +113 -0
- package/dist/language/article-lens/index.d.mts +1 -0
- package/dist/language/article-lens/preset.d.mts +31 -0
- package/dist/language/article-lens/preset.mjs +125 -0
- package/dist/language/deck.d.mts +45 -0
- package/dist/language/deck.mjs +61 -0
- package/dist/language/icon.d.mts +40 -0
- package/dist/language/icon.mjs +73 -0
- package/dist/language/index.d.mts +10 -0
- package/dist/language/index.mjs +11 -0
- package/dist/language/preposition-scene/index.d.mts +1 -0
- package/dist/language/preposition-scene/preset.d.mts +34 -0
- package/dist/language/preposition-scene/preset.mjs +234 -0
- package/dist/language/sentence-builder/index.d.mts +1 -0
- package/dist/language/sentence-builder/preset.d.mts +32 -0
- package/dist/language/sentence-builder/preset.mjs +122 -0
- package/dist/language/transform/index.d.mts +1 -0
- package/dist/language/transform/preset.d.mts +31 -0
- package/dist/language/transform/preset.mjs +137 -0
- package/dist/language/ui.d.mts +53 -0
- package/dist/language/ui.mjs +88 -0
- package/dist/language/word-match/index.d.mts +1 -0
- package/dist/language/word-match/preset.d.mts +22 -0
- package/dist/language/word-match/preset.mjs +148 -0
- package/dist/math/area-model/asset.d.mts +6 -0
- package/dist/math/area-model/asset.mjs +270 -0
- package/dist/math/area-model/index.d.mts +2 -0
- package/dist/math/area-model/preset.d.mts +29 -0
- package/dist/math/area-model/preset.mjs +243 -0
- package/dist/math/balance-algebra/asset.d.mts +6 -0
- package/dist/math/balance-algebra/asset.mjs +150 -0
- package/dist/math/balance-algebra/index.d.mts +2 -0
- package/dist/math/balance-algebra/preset.d.mts +30 -0
- package/dist/math/balance-algebra/preset.mjs +228 -0
- package/dist/math/derivation.d.mts +22 -0
- package/dist/math/derivation.mjs +113 -0
- package/dist/math/derivative-explorer/index.d.mts +1 -0
- package/dist/math/derivative-explorer/preset.d.mts +19 -0
- package/dist/math/derivative-explorer/preset.mjs +227 -0
- package/dist/math/function-machine/index.d.mts +1 -0
- package/dist/math/function-machine/preset.d.mts +21 -0
- package/dist/math/function-machine/preset.mjs +177 -0
- package/dist/math/gradient-descent.d.mts +23 -0
- package/dist/math/gradient-descent.mjs +473 -0
- package/dist/math/grapher/index.d.mts +1 -0
- package/dist/math/grapher/preset.d.mts +40 -0
- package/dist/math/grapher/preset.mjs +313 -0
- package/dist/math/harmonic-form/index.d.mts +1 -0
- package/dist/math/harmonic-form/preset.d.mts +21 -0
- package/dist/math/harmonic-form/preset.mjs +387 -0
- package/dist/math/index.d.mts +25 -0
- package/dist/math/index.mjs +26 -0
- package/dist/math/integral-explorer/index.d.mts +1 -0
- package/dist/math/integral-explorer/preset.d.mts +23 -0
- package/dist/math/integral-explorer/preset.mjs +217 -0
- package/dist/math/interactive/index.d.mts +1 -0
- package/dist/math/interactive/preset.d.mts +72 -0
- package/dist/math/interactive/preset.mjs +202 -0
- package/dist/math/limit-explorer/index.d.mts +1 -0
- package/dist/math/limit-explorer/preset.d.mts +19 -0
- package/dist/math/limit-explorer/preset.mjs +216 -0
- package/dist/math/linear-system/index.d.mts +1 -0
- package/dist/math/linear-system/preset.d.mts +28 -0
- package/dist/math/linear-system/preset.mjs +164 -0
- package/dist/math/mystery-bucket/asset.d.mts +6 -0
- package/dist/math/mystery-bucket/asset.mjs +145 -0
- package/dist/math/mystery-bucket/index.d.mts +2 -0
- package/dist/math/mystery-bucket/preset.d.mts +36 -0
- package/dist/math/mystery-bucket/preset.mjs +116 -0
- package/dist/math/number-line/index.d.mts +1 -0
- package/dist/math/number-line/preset.d.mts +24 -0
- package/dist/math/number-line/preset.mjs +142 -0
- package/dist/math/parabola/index.d.mts +1 -0
- package/dist/math/parabola/preset.d.mts +13 -0
- package/dist/math/parabola/preset.mjs +79 -0
- package/dist/math/pattern/asset.d.mts +6 -0
- package/dist/math/pattern/asset.mjs +102 -0
- package/dist/math/pattern/index.d.mts +2 -0
- package/dist/math/pattern/preset.d.mts +32 -0
- package/dist/math/pattern/preset.mjs +294 -0
- package/dist/math/triangle-trig/index.d.mts +1 -0
- package/dist/math/triangle-trig/preset.d.mts +47 -0
- package/dist/math/triangle-trig/preset.mjs +245 -0
- package/dist/math/trig-explorer.d.mts +18 -0
- package/dist/math/trig-explorer.mjs +209 -0
- package/dist/ml/boundary/index.d.mts +1 -0
- package/dist/ml/boundary/preset.d.mts +24 -0
- package/dist/ml/boundary/preset.mjs +385 -0
- package/dist/ml/classifier/index.d.mts +1 -0
- package/dist/ml/classifier/preset.d.mts +25 -0
- package/dist/ml/classifier/preset.mjs +315 -0
- package/dist/ml/index.d.mts +6 -0
- package/dist/ml/index.mjs +7 -0
- package/dist/ml/kmeans/index.d.mts +1 -0
- package/dist/ml/kmeans/preset.d.mts +33 -0
- package/dist/ml/kmeans/preset.mjs +236 -0
- package/dist/ml/knn/index.d.mts +1 -0
- package/dist/ml/knn/preset.d.mts +28 -0
- package/dist/ml/knn/preset.mjs +279 -0
- package/dist/ml/regression/index.d.mts +1 -0
- package/dist/ml/regression/preset.d.mts +32 -0
- package/dist/ml/regression/preset.mjs +394 -0
- package/dist/physics/atwood/index.d.mts +1 -0
- package/dist/physics/atwood/preset.d.mts +23 -0
- package/dist/physics/atwood/preset.mjs +312 -0
- package/dist/physics/bullet-walls/index.d.mts +1 -0
- package/dist/physics/bullet-walls/preset.d.mts +28 -0
- package/dist/physics/bullet-walls/preset.mjs +373 -0
- package/dist/physics/carnot/index.d.mts +1 -0
- package/dist/physics/carnot/preset.d.mts +27 -0
- package/dist/physics/carnot/preset.mjs +427 -0
- package/dist/physics/circular-motion/index.d.mts +1 -0
- package/dist/physics/circular-motion/preset.d.mts +25 -0
- package/dist/physics/circular-motion/preset.mjs +293 -0
- package/dist/physics/collision-track/index.d.mts +1 -0
- package/dist/physics/collision-track/preset.d.mts +27 -0
- package/dist/physics/collision-track/preset.mjs +352 -0
- package/dist/physics/efficiency/index.d.mts +1 -0
- package/dist/physics/efficiency/preset.d.mts +33 -0
- package/dist/physics/efficiency/preset.mjs +343 -0
- package/dist/physics/electric-field/index.d.mts +1 -0
- package/dist/physics/electric-field/preset.d.mts +15 -0
- package/dist/physics/electric-field/preset.mjs +306 -0
- package/dist/physics/energy-skate/index.d.mts +1 -0
- package/dist/physics/energy-skate/preset.d.mts +25 -0
- package/dist/physics/energy-skate/preset.mjs +254 -0
- package/dist/physics/entropy/index.d.mts +1 -0
- package/dist/physics/entropy/preset.d.mts +18 -0
- package/dist/physics/entropy/preset.mjs +416 -0
- package/dist/physics/expansion/index.d.mts +1 -0
- package/dist/physics/expansion/preset.d.mts +26 -0
- package/dist/physics/expansion/preset.mjs +609 -0
- package/dist/physics/exponential/asset.mjs +221 -0
- package/dist/physics/exponential/index.d.mts +1 -0
- package/dist/physics/exponential/preset.d.mts +17 -0
- package/dist/physics/exponential/preset.mjs +182 -0
- package/dist/physics/gas-process/index.d.mts +1 -0
- package/dist/physics/gas-process/preset.d.mts +30 -0
- package/dist/physics/gas-process/preset.mjs +384 -0
- package/dist/physics/gravitation/index.d.mts +1 -0
- package/dist/physics/gravitation/preset.d.mts +24 -0
- package/dist/physics/gravitation/preset.mjs +345 -0
- package/dist/physics/gravity-drop.d.mts +9 -0
- package/dist/physics/gravity-drop.mjs +187 -0
- package/dist/physics/heat-transfer/index.d.mts +1 -0
- package/dist/physics/heat-transfer/preset.d.mts +27 -0
- package/dist/physics/heat-transfer/preset.mjs +626 -0
- package/dist/physics/impulse/index.d.mts +1 -0
- package/dist/physics/impulse/preset.d.mts +29 -0
- package/dist/physics/impulse/preset.mjs +453 -0
- package/dist/physics/index.d.mts +43 -0
- package/dist/physics/index.mjs +44 -0
- package/dist/physics/kepler/index.d.mts +1 -0
- package/dist/physics/kepler/preset.d.mts +27 -0
- package/dist/physics/kepler/preset.mjs +257 -0
- package/dist/physics/lever/asset.d.mts +6 -0
- package/dist/physics/lever/asset.mjs +220 -0
- package/dist/physics/lever/index.d.mts +2 -0
- package/dist/physics/lever/preset.d.mts +31 -0
- package/dist/physics/lever/preset.mjs +261 -0
- package/dist/physics/lorentz/index.d.mts +1 -0
- package/dist/physics/lorentz/preset.d.mts +29 -0
- package/dist/physics/lorentz/preset.mjs +367 -0
- package/dist/physics/magnetism/index.d.mts +1 -0
- package/dist/physics/magnetism/preset.d.mts +15 -0
- package/dist/physics/magnetism/preset.mjs +334 -0
- package/dist/physics/optics/asset.d.mts +6 -0
- package/dist/physics/optics/asset.mjs +234 -0
- package/dist/physics/optics/index.d.mts +2 -0
- package/dist/physics/optics/preset.d.mts +14 -0
- package/dist/physics/optics/preset.mjs +202 -0
- package/dist/physics/orbit-lab.d.mts +6 -0
- package/dist/physics/orbit-lab.mjs +222 -0
- package/dist/physics/projectile-lab.d.mts +10 -0
- package/dist/physics/projectile-lab.mjs +354 -0
- package/dist/physics/rain-relative/index.d.mts +1 -0
- package/dist/physics/rain-relative/preset.d.mts +19 -0
- package/dist/physics/rain-relative/preset.mjs +358 -0
- package/dist/physics/ramp-forces/index.d.mts +1 -0
- package/dist/physics/ramp-forces/preset.d.mts +36 -0
- package/dist/physics/ramp-forces/preset.mjs +550 -0
- package/dist/physics/river-boat.d.mts +22 -0
- package/dist/physics/river-boat.mjs +498 -0
- package/dist/physics/shm/index.d.mts +1 -0
- package/dist/physics/shm/preset.d.mts +33 -0
- package/dist/physics/shm/preset.mjs +554 -0
- package/dist/physics/stopping-distance/index.d.mts +1 -0
- package/dist/physics/stopping-distance/preset.d.mts +29 -0
- package/dist/physics/stopping-distance/preset.mjs +662 -0
- package/dist/physics/temperature-scales/index.d.mts +1 -0
- package/dist/physics/temperature-scales/preset.d.mts +15 -0
- package/dist/physics/temperature-scales/preset.mjs +353 -0
- package/dist/physics/terminal-velocity/index.d.mts +1 -0
- package/dist/physics/terminal-velocity/preset.d.mts +26 -0
- package/dist/physics/terminal-velocity/preset.mjs +404 -0
- package/dist/physics/thermal/index.d.mts +1 -0
- package/dist/physics/thermal/preset.d.mts +44 -0
- package/dist/physics/thermal/preset.mjs +373 -0
- package/dist/physics/vector-board/index.d.mts +1 -0
- package/dist/physics/vector-board/preset.d.mts +65 -0
- package/dist/physics/vector-board/preset.mjs +273 -0
- package/dist/physics/vector-board/view.d.mts +49 -0
- package/dist/physics/vector-board/view.mjs +58 -0
- package/dist/physics/vector-scene.d.mts +41 -0
- package/dist/physics/vector-scene.mjs +211 -0
- package/dist/physics/vector-types/index.d.mts +1 -0
- package/dist/physics/vector-types/preset.d.mts +27 -0
- package/dist/physics/vector-types/preset.mjs +192 -0
- package/dist/physics/water-density/index.d.mts +1 -0
- package/dist/physics/water-density/preset.d.mts +18 -0
- package/dist/physics/water-density/preset.mjs +439 -0
- package/dist/physics/waves/core.mjs +33 -0
- package/dist/physics/waves/doppler.d.mts +23 -0
- package/dist/physics/waves/doppler.mjs +260 -0
- package/dist/physics/waves/index.d.mts +4 -0
- package/dist/physics/waves/preset.d.mts +30 -0
- package/dist/physics/waves/preset.mjs +488 -0
- package/dist/physics/waves/ripple.d.mts +26 -0
- package/dist/physics/waves/ripple.mjs +234 -0
- package/dist/physics/waves/string.d.mts +29 -0
- package/dist/physics/waves/string.mjs +289 -0
- package/dist/physics/work-energy/index.d.mts +1 -0
- package/dist/physics/work-energy/preset.d.mts +17 -0
- package/dist/physics/work-energy/preset.mjs +341 -0
- package/dist/schemas/index.d.mts +235 -0
- package/dist/schemas/index.mjs +145 -0
- package/dist/statistics/center-spread/preset.d.mts +34 -0
- package/dist/statistics/center-spread/preset.mjs +323 -0
- package/dist/statistics/core/descriptive.d.mts +35 -0
- package/dist/statistics/core/descriptive.mjs +64 -0
- package/dist/statistics/core/normal.d.mts +21 -0
- package/dist/statistics/core/normal.mjs +37 -0
- package/dist/statistics/core/sequences.d.mts +27 -0
- package/dist/statistics/core/sequences.mjs +35 -0
- package/dist/statistics/galton/preset.d.mts +27 -0
- package/dist/statistics/galton/preset.mjs +331 -0
- package/dist/statistics/histogram/preset.d.mts +27 -0
- package/dist/statistics/histogram/preset.mjs +385 -0
- package/dist/statistics/index.d.mts +11 -0
- package/dist/statistics/index.mjs +12 -0
- package/dist/statistics/normal/preset.d.mts +30 -0
- package/dist/statistics/normal/preset.mjs +400 -0
- package/dist/statistics/sampling/preset.d.mts +32 -0
- package/dist/statistics/sampling/preset.mjs +406 -0
- package/dist/statistics/sequence/preset.d.mts +28 -0
- package/dist/statistics/sequence/preset.mjs +302 -0
- package/dist/statistics/z-table/preset.d.mts +28 -0
- package/dist/statistics/z-table/preset.mjs +348 -0
- package/package.json +266 -0
- package/styles.css +267 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CenterSpreadLab } from "../statistics/center-spread/preset.mjs";
|
|
2
|
+
import { SequenceLab } from "../statistics/sequence/preset.mjs";
|
|
3
|
+
import { GaltonBoardLab } from "../statistics/galton/preset.mjs";
|
|
4
|
+
import { HistogramBoxLab } from "../statistics/histogram/preset.mjs";
|
|
5
|
+
import { NormalDistributionLab } from "../statistics/normal/preset.mjs";
|
|
6
|
+
import { ZTableLab } from "../statistics/z-table/preset.mjs";
|
|
7
|
+
import { SamplingDistributionLab } from "../statistics/sampling/preset.mjs";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
//#region src/blocks/statistics.d.ts
|
|
11
|
+
declare const CenterSpreadBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
12
|
+
declare const SeriesBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
13
|
+
declare const GaltonBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
14
|
+
declare const HistogramBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
15
|
+
declare const NormalBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
16
|
+
declare const ZTableBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
17
|
+
declare const SamplingBlock: import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
18
|
+
declare const statisticsBlocks: readonly [import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>, import("@classytic/cms-ui/contract").CmsBlock<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>];
|
|
19
|
+
declare const statisticsComponents: {
|
|
20
|
+
readonly CenterSpread: typeof CenterSpreadLab;
|
|
21
|
+
readonly Series: typeof SequenceLab;
|
|
22
|
+
readonly GaltonBoard: typeof GaltonBoardLab;
|
|
23
|
+
readonly HistogramBox: typeof HistogramBoxLab;
|
|
24
|
+
readonly NormalDistribution: typeof NormalDistributionLab;
|
|
25
|
+
readonly ZTable: typeof ZTableLab;
|
|
26
|
+
readonly SamplingDistribution: typeof SamplingDistributionLab;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { CenterSpreadBlock, GaltonBlock, HistogramBlock, NormalBlock, SamplingBlock, SeriesBlock, ZTableBlock, statisticsBlocks, statisticsComponents };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { CenterSpreadLab } from "../statistics/center-spread/preset.mjs";
|
|
2
|
+
import { SequenceLab } from "../statistics/sequence/preset.mjs";
|
|
3
|
+
import { GaltonBoardLab } from "../statistics/galton/preset.mjs";
|
|
4
|
+
import { HistogramBoxLab } from "../statistics/histogram/preset.mjs";
|
|
5
|
+
import { NormalDistributionLab } from "../statistics/normal/preset.mjs";
|
|
6
|
+
import { ZTableLab } from "../statistics/z-table/preset.mjs";
|
|
7
|
+
import { SamplingDistributionLab } from "../statistics/sampling/preset.mjs";
|
|
8
|
+
import { LabConfig } from "./lab-config.mjs";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { defineBlock } from "@classytic/cms-ui/contract";
|
|
12
|
+
|
|
13
|
+
//#region src/blocks/statistics.tsx
|
|
14
|
+
const common = {
|
|
15
|
+
title: z.string().optional(),
|
|
16
|
+
prompt: z.string().optional(),
|
|
17
|
+
objectives: z.array(z.string()).optional(),
|
|
18
|
+
hints: z.array(z.string()).optional(),
|
|
19
|
+
controlId: z.string().optional()
|
|
20
|
+
};
|
|
21
|
+
function lab(key, tag, label, description, schema, Comp) {
|
|
22
|
+
return defineBlock({
|
|
23
|
+
key,
|
|
24
|
+
tag,
|
|
25
|
+
void: true,
|
|
26
|
+
label,
|
|
27
|
+
description,
|
|
28
|
+
category: "interactive",
|
|
29
|
+
schema,
|
|
30
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
31
|
+
const widget = Comp(attributes);
|
|
32
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(LabConfig, {
|
|
34
|
+
schema,
|
|
35
|
+
value: attributes,
|
|
36
|
+
onChange: updateAttributes
|
|
37
|
+
}), widget] });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const centerSchema = z.object({
|
|
42
|
+
data: z.array(z.number()).optional(),
|
|
43
|
+
min: z.number().optional(),
|
|
44
|
+
max: z.number().optional(),
|
|
45
|
+
step: z.number().optional(),
|
|
46
|
+
showSigma: z.boolean().optional(),
|
|
47
|
+
challenge: z.object({
|
|
48
|
+
stat: z.enum(["mean", "median"]),
|
|
49
|
+
target: z.number()
|
|
50
|
+
}).optional(),
|
|
51
|
+
...common
|
|
52
|
+
});
|
|
53
|
+
const CenterSpreadBlock = lab("center-spread", "CenterSpread", "Centre & spread (mean as balance point)", "Drag data points on a number line: the mean rides as a balance-point fulcrum, the median holds, the mode lights up, and a σ band breathes. Outliers move the mean, not the median.", centerSchema, (a) => /* @__PURE__ */ jsx(CenterSpreadLab, { ...a }));
|
|
54
|
+
const seqSchema = z.object({
|
|
55
|
+
kind: z.enum(["arithmetic", "geometric"]).optional(),
|
|
56
|
+
first: z.number().optional(),
|
|
57
|
+
step: z.number().optional(),
|
|
58
|
+
count: z.number().optional(),
|
|
59
|
+
...common
|
|
60
|
+
});
|
|
61
|
+
const SeriesBlock = lab("series", "Series", "Sequences & series", "Arithmetic / geometric sequences as bars with a running-total line; for |r|<1 the total converges onto the dashed S∞ guide.", seqSchema, (a) => /* @__PURE__ */ jsx(SequenceLab, { ...a }));
|
|
62
|
+
const galtonSchema = z.object({
|
|
63
|
+
rows: z.number().optional(),
|
|
64
|
+
seed: z.number().optional(),
|
|
65
|
+
showCurve: z.boolean().optional(),
|
|
66
|
+
...common
|
|
67
|
+
});
|
|
68
|
+
const GaltonBlock = lab("galton", "GaltonBoard", "Galton board (central limit theorem)", "Balls bounce through pegs (each a coin-flip) and pile into a bell curve hugging the theoretical normal — the CLT made visible.", galtonSchema, (a) => /* @__PURE__ */ jsx(GaltonBoardLab, { ...a }));
|
|
69
|
+
const histoSchema = z.object({
|
|
70
|
+
data: z.array(z.number()).optional(),
|
|
71
|
+
bins: z.number().optional(),
|
|
72
|
+
min: z.number().optional(),
|
|
73
|
+
max: z.number().optional(),
|
|
74
|
+
...common
|
|
75
|
+
});
|
|
76
|
+
const HistogramBlock = lab("histogram", "HistogramBox", "Histogram & box plot", "The shape of data: a binned histogram + a box-and-whisker on a shared axis. Click to drop points; symmetric/skewed/bimodal presets; outliers beyond 1.5·IQR.", histoSchema, (a) => /* @__PURE__ */ jsx(HistogramBoxLab, { ...a }));
|
|
77
|
+
const normalSchema = z.object({
|
|
78
|
+
mu: z.number().optional(),
|
|
79
|
+
sigma: z.number().optional(),
|
|
80
|
+
a: z.number().optional(),
|
|
81
|
+
b: z.number().optional(),
|
|
82
|
+
mode: z.enum(["area", "rule"]).optional(),
|
|
83
|
+
...common
|
|
84
|
+
});
|
|
85
|
+
const NormalBlock = lab("normal", "NormalDistribution", "Normal curve, area & z-scores", "Drag the shaded bounds → P(a≤X≤b) as area, with z-scores; or the 68-95-99.7 rule view. Slide μ and σ to reshape it.", normalSchema, (a) => /* @__PURE__ */ jsx(NormalDistributionLab, { ...a }));
|
|
86
|
+
const ztableSchema = z.object({
|
|
87
|
+
x: z.number().optional(),
|
|
88
|
+
mu: z.number().optional(),
|
|
89
|
+
sigma: z.number().optional(),
|
|
90
|
+
tail: z.enum(["left", "right"]).optional(),
|
|
91
|
+
...common
|
|
92
|
+
});
|
|
93
|
+
const ZTableBlock = lab("z-table", "ZTable", "z-table (standardize & look up)", "Standardize x → z, and the live Φ(z) grid highlights the row/column/cell (auto-scrolled) while a mini curve shades the tail. Negative z via symmetry.", ztableSchema, (a) => /* @__PURE__ */ jsx(ZTableLab, { ...a }));
|
|
94
|
+
const samplingSchema = z.object({
|
|
95
|
+
mu: z.number().optional(),
|
|
96
|
+
sigma: z.number().optional(),
|
|
97
|
+
n: z.number().optional(),
|
|
98
|
+
confidence: z.number().optional(),
|
|
99
|
+
mode: z.enum(["sampling", "ci"]).optional(),
|
|
100
|
+
...common
|
|
101
|
+
});
|
|
102
|
+
const SamplingBlock = lab("sampling", "SamplingDistribution", "Sampling distribution & confidence intervals", "Stack confidence intervals → ~C% capture μ (what \"95% confident\" means), or watch sample means pile into Normal(μ, σ/√n).", samplingSchema, (a) => /* @__PURE__ */ jsx(SamplingDistributionLab, { ...a }));
|
|
103
|
+
const statisticsBlocks = [
|
|
104
|
+
CenterSpreadBlock,
|
|
105
|
+
SeriesBlock,
|
|
106
|
+
GaltonBlock,
|
|
107
|
+
HistogramBlock,
|
|
108
|
+
NormalBlock,
|
|
109
|
+
ZTableBlock,
|
|
110
|
+
SamplingBlock
|
|
111
|
+
];
|
|
112
|
+
const statisticsComponents = {
|
|
113
|
+
CenterSpread: CenterSpreadLab,
|
|
114
|
+
Series: SequenceLab,
|
|
115
|
+
GaltonBoard: GaltonBoardLab,
|
|
116
|
+
HistogramBox: HistogramBoxLab,
|
|
117
|
+
NormalDistribution: NormalDistributionLab,
|
|
118
|
+
ZTable: ZTableLab,
|
|
119
|
+
SamplingDistribution: SamplingDistributionLab
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { CenterSpreadBlock, GaltonBlock, HistogramBlock, NormalBlock, SamplingBlock, SeriesBlock, ZTableBlock, statisticsBlocks, statisticsComponents };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { registerBuiltinTemplates } from "./templates.mjs";
|
|
2
|
+
import { LabTemplate, getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerLabTemplate } from "./registry.mjs";
|
|
3
|
+
export { type LabTemplate, getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerBuiltinTemplates, registerLabTemplate };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerLabTemplate } from "./registry.mjs";
|
|
2
|
+
import { registerBuiltinTemplates } from "./templates.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/catalog/index.ts
|
|
5
|
+
registerBuiltinTemplates();
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerBuiltinTemplates, registerLabTemplate };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LabMeta, SceneDoc } from "@classytic/stage";
|
|
2
|
+
import { ZodTypeAny } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/catalog/registry.d.ts
|
|
5
|
+
interface LabTemplate {
|
|
6
|
+
/** Stable id, kebab-case (e.g. 'balance-algebra'). */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Human title for the catalog. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Domain bucket — 'algebra' | 'calculus' | 'physics' | 'circuits' | … */
|
|
11
|
+
category: string;
|
|
12
|
+
/** One-line description for the catalog card. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Zod schema validating the creator-facing params (optional). */
|
|
15
|
+
paramsSchema?: ZodTypeAny;
|
|
16
|
+
/** Params used when a creator first inserts the template. */
|
|
17
|
+
defaultParams: Record<string, unknown>;
|
|
18
|
+
/** Params → a portable SceneDoc (the asset self-registers on factory import). */
|
|
19
|
+
factory: (params: Record<string, unknown>) => SceneDoc;
|
|
20
|
+
/** Default pedagogy carried into the SceneDoc.meta. */
|
|
21
|
+
pedagogy?: LabMeta;
|
|
22
|
+
}
|
|
23
|
+
declare function registerLabTemplate(t: LabTemplate): void;
|
|
24
|
+
declare function listLabTemplates(): LabTemplate[];
|
|
25
|
+
declare function listLabTemplatesByCategory(category: string): LabTemplate[];
|
|
26
|
+
declare function getLabTemplate(id: string): LabTemplate | undefined;
|
|
27
|
+
/** Result of instantiating a template — typed errors before a bad scene is built. */
|
|
28
|
+
type InstantiateResult = {
|
|
29
|
+
ok: true;
|
|
30
|
+
doc: SceneDoc;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
error: string;
|
|
34
|
+
issues?: {
|
|
35
|
+
path: string;
|
|
36
|
+
message: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Validate params against the family's `paramsSchema` (zod), then build the
|
|
41
|
+
* SceneDoc. Returns typed errors so a marketplace/authoring UI can surface bad
|
|
42
|
+
* input WITHOUT producing a broken scene.
|
|
43
|
+
*/
|
|
44
|
+
declare function instantiateTemplate(id: string, params?: Record<string, unknown>): InstantiateResult;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { LabTemplate, getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerLabTemplate };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/catalog/registry.ts
|
|
2
|
+
const TEMPLATES = /* @__PURE__ */ new Map();
|
|
3
|
+
function registerLabTemplate(t) {
|
|
4
|
+
TEMPLATES.set(t.id, t);
|
|
5
|
+
}
|
|
6
|
+
function listLabTemplates() {
|
|
7
|
+
return [...TEMPLATES.values()];
|
|
8
|
+
}
|
|
9
|
+
function listLabTemplatesByCategory(category) {
|
|
10
|
+
return listLabTemplates().filter((t) => t.category === category);
|
|
11
|
+
}
|
|
12
|
+
function getLabTemplate(id) {
|
|
13
|
+
return TEMPLATES.get(id);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validate params against the family's `paramsSchema` (zod), then build the
|
|
17
|
+
* SceneDoc. Returns typed errors so a marketplace/authoring UI can surface bad
|
|
18
|
+
* input WITHOUT producing a broken scene.
|
|
19
|
+
*/
|
|
20
|
+
function instantiateTemplate(id, params) {
|
|
21
|
+
const t = TEMPLATES.get(id);
|
|
22
|
+
if (!t) return {
|
|
23
|
+
ok: false,
|
|
24
|
+
error: `Unknown template: ${id}`
|
|
25
|
+
};
|
|
26
|
+
const merged = {
|
|
27
|
+
...t.defaultParams,
|
|
28
|
+
...params ?? {}
|
|
29
|
+
};
|
|
30
|
+
if (t.paramsSchema) {
|
|
31
|
+
const parsed = t.paramsSchema.safeParse(merged);
|
|
32
|
+
if (!parsed.success) {
|
|
33
|
+
const issues = parsed.error.issues.map((i) => ({
|
|
34
|
+
path: i.path.join("."),
|
|
35
|
+
message: i.message
|
|
36
|
+
}));
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
error: `Invalid params for "${id}": ${issues.map((i) => `${i.path || "(root)"} ${i.message}`).join("; ")}`,
|
|
40
|
+
issues
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const doc = t.factory(merged);
|
|
45
|
+
if (t.pedagogy && !doc.meta?.pedagogy) doc.meta = {
|
|
46
|
+
...doc.meta,
|
|
47
|
+
pedagogy: t.pedagogy
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
doc
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { getLabTemplate, instantiateTemplate, listLabTemplates, listLabTemplatesByCategory, registerLabTemplate };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/catalog/templates.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Register the built-in lab families. Importing this module imports each
|
|
4
|
+
* preset's doc factory — which self-registers its stage asset — and adds the
|
|
5
|
+
* family to the registry. New family = add one entry here.
|
|
6
|
+
*/
|
|
7
|
+
/** Register all built-in families. Called from the catalog entry (a used import
|
|
8
|
+
* so the registrations are never tree-shaken). Idempotent. */
|
|
9
|
+
declare function registerBuiltinTemplates(): void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { registerBuiltinTemplates };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { leverBalanceDoc } from "../physics/lever/preset.mjs";
|
|
2
|
+
import { opticsDoc } from "../physics/optics/preset.mjs";
|
|
3
|
+
import { areaModelDoc } from "../math/area-model/preset.mjs";
|
|
4
|
+
import { growingPatternDoc } from "../math/pattern/preset.mjs";
|
|
5
|
+
import { mysteryBucketDoc } from "../math/mystery-bucket/preset.mjs";
|
|
6
|
+
import { balanceAlgebraDoc } from "../math/balance-algebra/preset.mjs";
|
|
7
|
+
import { circuitDoc } from "../circuits/circuit/preset.mjs";
|
|
8
|
+
import { registerLabTemplate } from "./registry.mjs";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
//#region src/catalog/templates.ts
|
|
12
|
+
/**
|
|
13
|
+
* Register the built-in lab families. Importing this module imports each
|
|
14
|
+
* preset's doc factory — which self-registers its stage asset — and adds the
|
|
15
|
+
* family to the registry. New family = add one entry here.
|
|
16
|
+
*/
|
|
17
|
+
/** Register all built-in families. Called from the catalog entry (a used import
|
|
18
|
+
* so the registrations are never tree-shaken). Idempotent. */
|
|
19
|
+
function registerBuiltinTemplates() {
|
|
20
|
+
registerLabTemplate({
|
|
21
|
+
id: "mystery-bucket",
|
|
22
|
+
title: "Mystery bucket (weigh the unknown)",
|
|
23
|
+
category: "algebra",
|
|
24
|
+
description: "Add unit weights until a balance is level — discover the hidden weight (the unknown) with no symbols. The essentials opener.",
|
|
25
|
+
paramsSchema: z.object({
|
|
26
|
+
bucketWeight: z.number(),
|
|
27
|
+
maxWeights: z.number().optional()
|
|
28
|
+
}),
|
|
29
|
+
defaultParams: {
|
|
30
|
+
bucketWeight: 5,
|
|
31
|
+
maxWeights: 10
|
|
32
|
+
},
|
|
33
|
+
factory: (p) => mysteryBucketDoc({
|
|
34
|
+
bucketWeight: p.bucketWeight ?? 5,
|
|
35
|
+
count: 0,
|
|
36
|
+
maxWeights: p.maxWeights
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
registerLabTemplate({
|
|
40
|
+
id: "balance-algebra",
|
|
41
|
+
title: "Balance scale (algebra)",
|
|
42
|
+
category: "algebra",
|
|
43
|
+
description: "Solve a·x + b = c by keeping a scale balanced.",
|
|
44
|
+
paramsSchema: z.object({
|
|
45
|
+
coef: z.number(),
|
|
46
|
+
addend: z.number(),
|
|
47
|
+
rhs: z.number(),
|
|
48
|
+
answer: z.number()
|
|
49
|
+
}),
|
|
50
|
+
defaultParams: {
|
|
51
|
+
coef: 2,
|
|
52
|
+
addend: 1,
|
|
53
|
+
rhs: 7,
|
|
54
|
+
answer: 3
|
|
55
|
+
},
|
|
56
|
+
factory: (p) => balanceAlgebraDoc(p)
|
|
57
|
+
});
|
|
58
|
+
registerLabTemplate({
|
|
59
|
+
id: "area-model",
|
|
60
|
+
title: "Area model (algebra tiles)",
|
|
61
|
+
category: "algebra",
|
|
62
|
+
description: "(x+a)(x+b) as a partitioned rectangle — expand or factor.",
|
|
63
|
+
paramsSchema: z.object({
|
|
64
|
+
a: z.number(),
|
|
65
|
+
b: z.number(),
|
|
66
|
+
mode: z.enum(["expand", "factor"]).optional()
|
|
67
|
+
}),
|
|
68
|
+
defaultParams: {
|
|
69
|
+
a: 3,
|
|
70
|
+
b: 2,
|
|
71
|
+
mode: "expand"
|
|
72
|
+
},
|
|
73
|
+
factory: (p) => areaModelDoc(p)
|
|
74
|
+
});
|
|
75
|
+
registerLabTemplate({
|
|
76
|
+
id: "growing-pattern",
|
|
77
|
+
title: "Pattern → formula",
|
|
78
|
+
category: "algebra",
|
|
79
|
+
description: "Find the rule a·n + b from a growing figure.",
|
|
80
|
+
paramsSchema: z.object({
|
|
81
|
+
a: z.number(),
|
|
82
|
+
b: z.number(),
|
|
83
|
+
steps: z.number().optional()
|
|
84
|
+
}),
|
|
85
|
+
defaultParams: {
|
|
86
|
+
a: 2,
|
|
87
|
+
b: 3,
|
|
88
|
+
steps: 4
|
|
89
|
+
},
|
|
90
|
+
factory: (p) => growingPatternDoc(p)
|
|
91
|
+
});
|
|
92
|
+
registerLabTemplate({
|
|
93
|
+
id: "balance-lever",
|
|
94
|
+
title: "Lever / torque",
|
|
95
|
+
category: "physics",
|
|
96
|
+
description: "Balance the mobile — set the unknown weight so Σ(w·d) matches.",
|
|
97
|
+
paramsSchema: z.object({
|
|
98
|
+
items: z.array(z.unknown()).optional(),
|
|
99
|
+
start: z.number().optional(),
|
|
100
|
+
maxWeight: z.number().optional()
|
|
101
|
+
}),
|
|
102
|
+
defaultParams: {
|
|
103
|
+
start: 1,
|
|
104
|
+
maxWeight: 12
|
|
105
|
+
},
|
|
106
|
+
factory: (p) => leverBalanceDoc(p)
|
|
107
|
+
});
|
|
108
|
+
registerLabTemplate({
|
|
109
|
+
id: "optics",
|
|
110
|
+
title: "Optics — reflection",
|
|
111
|
+
category: "physics",
|
|
112
|
+
description: "Reflect a light ray off mirrors into the target.",
|
|
113
|
+
defaultParams: {},
|
|
114
|
+
factory: () => opticsDoc()
|
|
115
|
+
});
|
|
116
|
+
registerLabTemplate({
|
|
117
|
+
id: "circuit",
|
|
118
|
+
title: "Circuit",
|
|
119
|
+
category: "circuits",
|
|
120
|
+
description: "Battery + series/parallel branches — light the bulb.",
|
|
121
|
+
paramsSchema: z.object({
|
|
122
|
+
emf: z.number().optional(),
|
|
123
|
+
branches: z.array(z.unknown()).optional()
|
|
124
|
+
}),
|
|
125
|
+
defaultParams: {
|
|
126
|
+
emf: 6,
|
|
127
|
+
branches: [[{
|
|
128
|
+
type: "switch",
|
|
129
|
+
closed: false
|
|
130
|
+
}, {
|
|
131
|
+
type: "bulb",
|
|
132
|
+
ohms: 6
|
|
133
|
+
}]],
|
|
134
|
+
goal: { kind: "lightBulb" }
|
|
135
|
+
},
|
|
136
|
+
factory: (p) => circuitDoc(p)
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { registerBuiltinTemplates };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/chem/battery.d.ts
|
|
4
|
+
interface BatteryProps {
|
|
5
|
+
/** Cell EMF in volts (Zn–Cu Daniell ≈ 1.10). */
|
|
6
|
+
emf?: number | string;
|
|
7
|
+
title?: string;
|
|
8
|
+
height?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function Battery({
|
|
11
|
+
emf,
|
|
12
|
+
title,
|
|
13
|
+
height
|
|
14
|
+
}?: BatteryProps): ReactNode;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Battery, BatteryProps };
|