@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,446 @@
|
|
|
1
|
+
import { EquationBalanceLab } from "../commerce/accounting/equation-balance.mjs";
|
|
2
|
+
import { JournalPosterLab } from "../commerce/accounting/journal-poster.mjs";
|
|
3
|
+
import { StatementSorterLab } from "../commerce/accounting/statement-sorter.mjs";
|
|
4
|
+
import { ChipToggle, ConfigPanel, ConfigRow, NumField, RowsEditor, SelectField, SmallButton, TextField } from "./authoring.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { defineBlock } from "@classytic/cms-ui/contract";
|
|
8
|
+
|
|
9
|
+
//#region src/blocks/accounting.tsx
|
|
10
|
+
const CATEGORIES = [
|
|
11
|
+
"Asset",
|
|
12
|
+
"Liability",
|
|
13
|
+
"Equity",
|
|
14
|
+
"Income",
|
|
15
|
+
"Expense"
|
|
16
|
+
];
|
|
17
|
+
/** Chart-of-accounts editor: id + name + a category dropdown (no raw JSON). */
|
|
18
|
+
function AccountsEditor({ accounts, onChange }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(RowsEditor, {
|
|
20
|
+
rows: accounts,
|
|
21
|
+
onChange,
|
|
22
|
+
addLabel: "account",
|
|
23
|
+
newRow: () => ({
|
|
24
|
+
id: "",
|
|
25
|
+
name: "",
|
|
26
|
+
category: "Asset"
|
|
27
|
+
}),
|
|
28
|
+
columns: [
|
|
29
|
+
{
|
|
30
|
+
key: "id",
|
|
31
|
+
label: "id"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "name",
|
|
35
|
+
label: "name",
|
|
36
|
+
grow: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "category",
|
|
40
|
+
label: "category",
|
|
41
|
+
type: "select",
|
|
42
|
+
options: CATEGORIES
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Transactions editor for the balance lab: a label + signed effects on accounts. */
|
|
48
|
+
function TxnEffectsEditor({ txns, accountIds, onChange }) {
|
|
49
|
+
const setTxn = (i, patch) => onChange(txns.map((t, j) => j === i ? {
|
|
50
|
+
...t,
|
|
51
|
+
...patch
|
|
52
|
+
} : t));
|
|
53
|
+
const setEffect = (ti, ei, patch) => setTxn(ti, { effects: txns[ti].effects.map((e, j) => j === ei ? {
|
|
54
|
+
...e,
|
|
55
|
+
...patch
|
|
56
|
+
} : e) });
|
|
57
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
58
|
+
className: "w-full space-y-2",
|
|
59
|
+
children: [txns.map((t, ti) => /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "space-y-1.5 rounded-md border border-border/60 bg-background/40 p-2",
|
|
61
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "flex items-center gap-1.5",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: "text-[11px] text-muted-foreground",
|
|
66
|
+
children: "when"
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ jsx(TextField, {
|
|
69
|
+
value: t.label,
|
|
70
|
+
placeholder: "Owner invests $10,000 cash",
|
|
71
|
+
onChange: (v) => setTxn(ti, { label: v }),
|
|
72
|
+
className: "flex-1 text-[11px]"
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx(SmallButton, {
|
|
75
|
+
tone: "danger",
|
|
76
|
+
onClick: () => onChange(txns.filter((_, j) => j !== ti)),
|
|
77
|
+
children: "✕"
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "space-y-1 pl-3",
|
|
82
|
+
children: [t.effects.map((e, ei) => /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "flex items-center gap-1.5",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(SelectField, {
|
|
86
|
+
value: e.account,
|
|
87
|
+
options: accountIds,
|
|
88
|
+
onChange: (v) => setEffect(ti, ei, { account: v })
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: "text-[11px] text-muted-foreground",
|
|
92
|
+
children: "changes by"
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx(NumField, {
|
|
95
|
+
value: e.delta,
|
|
96
|
+
onChange: (v) => setEffect(ti, ei, { delta: v })
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ jsx(SmallButton, {
|
|
99
|
+
tone: "danger",
|
|
100
|
+
onClick: () => setTxn(ti, { effects: t.effects.filter((_, j) => j !== ei) }),
|
|
101
|
+
children: "−"
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
}, ei)), /* @__PURE__ */ jsx(SmallButton, {
|
|
105
|
+
onClick: () => setTxn(ti, { effects: [...t.effects, {
|
|
106
|
+
account: accountIds[0] ?? "",
|
|
107
|
+
delta: 0
|
|
108
|
+
}] }),
|
|
109
|
+
children: "+ effect"
|
|
110
|
+
})]
|
|
111
|
+
})]
|
|
112
|
+
}, ti)), /* @__PURE__ */ jsx(SmallButton, {
|
|
113
|
+
onClick: () => onChange([...txns, {
|
|
114
|
+
id: `t${txns.length + 1}`,
|
|
115
|
+
label: "",
|
|
116
|
+
effects: []
|
|
117
|
+
}]),
|
|
118
|
+
children: "+ transaction"
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const DEFAULT_ACCOUNTS = [
|
|
123
|
+
{
|
|
124
|
+
id: "cash",
|
|
125
|
+
name: "Cash",
|
|
126
|
+
category: "Asset"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "equip",
|
|
130
|
+
name: "Equipment",
|
|
131
|
+
category: "Asset"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "loan",
|
|
135
|
+
name: "Bank loan",
|
|
136
|
+
category: "Liability"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "capital",
|
|
140
|
+
name: "Capital",
|
|
141
|
+
category: "Equity"
|
|
142
|
+
}
|
|
143
|
+
];
|
|
144
|
+
const DEFAULT_TXNS = [
|
|
145
|
+
{
|
|
146
|
+
id: "t1",
|
|
147
|
+
label: "Owner invests $10,000 cash",
|
|
148
|
+
effects: [{
|
|
149
|
+
account: "cash",
|
|
150
|
+
delta: 1e4
|
|
151
|
+
}, {
|
|
152
|
+
account: "capital",
|
|
153
|
+
delta: 1e4
|
|
154
|
+
}]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "t2",
|
|
158
|
+
label: "Take a $5,000 bank loan",
|
|
159
|
+
effects: [{
|
|
160
|
+
account: "cash",
|
|
161
|
+
delta: 5e3
|
|
162
|
+
}, {
|
|
163
|
+
account: "loan",
|
|
164
|
+
delta: 5e3
|
|
165
|
+
}]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "t3",
|
|
169
|
+
label: "Buy equipment for $3,000 cash",
|
|
170
|
+
effects: [{
|
|
171
|
+
account: "equip",
|
|
172
|
+
delta: 3e3
|
|
173
|
+
}, {
|
|
174
|
+
account: "cash",
|
|
175
|
+
delta: -3e3
|
|
176
|
+
}]
|
|
177
|
+
}
|
|
178
|
+
];
|
|
179
|
+
const asAccounts = (raw) => Array.isArray(raw) && raw.length ? raw : DEFAULT_ACCOUNTS;
|
|
180
|
+
const asTxns = (raw) => Array.isArray(raw) && raw.length ? raw : DEFAULT_TXNS;
|
|
181
|
+
const EquationBalanceBlock = defineBlock({
|
|
182
|
+
key: "equation-balance",
|
|
183
|
+
tag: "EquationBalance",
|
|
184
|
+
void: true,
|
|
185
|
+
label: "Accounting equation balance (A = L + E)",
|
|
186
|
+
description: "Apply transactions onto a two-pan scale (Assets vs Liabilities + Equity); the beam re-levels after each balanced entry, and a free-post mode tips the books to drill the misconception. Author the chart of accounts + transactions.",
|
|
187
|
+
category: "interactive",
|
|
188
|
+
schema: z.object({
|
|
189
|
+
accounts: z.array(z.object({
|
|
190
|
+
id: z.string(),
|
|
191
|
+
name: z.string(),
|
|
192
|
+
category: z.enum([
|
|
193
|
+
"Asset",
|
|
194
|
+
"Liability",
|
|
195
|
+
"Equity",
|
|
196
|
+
"Income",
|
|
197
|
+
"Expense"
|
|
198
|
+
])
|
|
199
|
+
})).default(DEFAULT_ACCOUNTS),
|
|
200
|
+
transactions: z.array(z.object({
|
|
201
|
+
id: z.string(),
|
|
202
|
+
label: z.string(),
|
|
203
|
+
effects: z.array(z.object({
|
|
204
|
+
account: z.string(),
|
|
205
|
+
delta: z.number()
|
|
206
|
+
}))
|
|
207
|
+
})).default(DEFAULT_TXNS),
|
|
208
|
+
freePost: z.boolean().default(false),
|
|
209
|
+
title: z.string().optional(),
|
|
210
|
+
prompt: z.string().optional()
|
|
211
|
+
}),
|
|
212
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
213
|
+
const accounts = asAccounts(attributes.accounts);
|
|
214
|
+
const transactions = asTxns(attributes.transactions);
|
|
215
|
+
const widget = /* @__PURE__ */ jsx(EquationBalanceLab, {
|
|
216
|
+
accounts,
|
|
217
|
+
transactions,
|
|
218
|
+
freePost: attributes.freePost,
|
|
219
|
+
title: attributes.title,
|
|
220
|
+
prompt: attributes.prompt
|
|
221
|
+
});
|
|
222
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
223
|
+
const upd = updateAttributes;
|
|
224
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
225
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
226
|
+
label: "title",
|
|
227
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
228
|
+
value: attributes.title ?? "",
|
|
229
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
230
|
+
placeholder: "The balance sheet that must stay level"
|
|
231
|
+
})
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
234
|
+
label: "free-post drill",
|
|
235
|
+
children: /* @__PURE__ */ jsx(ChipToggle, {
|
|
236
|
+
active: !!attributes.freePost,
|
|
237
|
+
onClick: () => updateAttributes({ freePost: !attributes.freePost }),
|
|
238
|
+
children: "tip the books"
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
242
|
+
label: "accounts",
|
|
243
|
+
children: /* @__PURE__ */ jsx(AccountsEditor, {
|
|
244
|
+
accounts,
|
|
245
|
+
onChange: (v) => upd({ accounts: v })
|
|
246
|
+
})
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
249
|
+
label: "transactions",
|
|
250
|
+
children: /* @__PURE__ */ jsx(TxnEffectsEditor, {
|
|
251
|
+
txns: transactions,
|
|
252
|
+
accountIds: accounts.map((a) => a.id),
|
|
253
|
+
onChange: (v) => upd({ transactions: v })
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
] }), widget] });
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const accountCatSchema = z.object({
|
|
260
|
+
id: z.string(),
|
|
261
|
+
name: z.string(),
|
|
262
|
+
category: z.enum([
|
|
263
|
+
"Asset",
|
|
264
|
+
"Liability",
|
|
265
|
+
"Equity",
|
|
266
|
+
"Income",
|
|
267
|
+
"Expense"
|
|
268
|
+
])
|
|
269
|
+
});
|
|
270
|
+
const asJournalTxns = (raw) => Array.isArray(raw) && raw.length ? raw : void 0;
|
|
271
|
+
const asSortAccounts = (raw) => Array.isArray(raw) && raw.length ? raw : void 0;
|
|
272
|
+
const JournalPosterBlock = defineBlock({
|
|
273
|
+
key: "journal-poster",
|
|
274
|
+
tag: "JournalPoster",
|
|
275
|
+
void: true,
|
|
276
|
+
label: "Journal poster (debits, credits & T-accounts)",
|
|
277
|
+
description: "Learner picks the debit (left) + credit (right) account for each authored event; instant coached feedback fills the T-accounts and a live trial balance. Author the chart of accounts + the events.",
|
|
278
|
+
category: "interactive",
|
|
279
|
+
schema: z.object({
|
|
280
|
+
accounts: z.array(accountCatSchema).optional(),
|
|
281
|
+
transactions: z.array(z.object({
|
|
282
|
+
id: z.string(),
|
|
283
|
+
prompt: z.string(),
|
|
284
|
+
debit: z.string(),
|
|
285
|
+
credit: z.string(),
|
|
286
|
+
amount: z.number()
|
|
287
|
+
})).optional(),
|
|
288
|
+
showTrialBalance: z.boolean().default(true),
|
|
289
|
+
title: z.string().optional(),
|
|
290
|
+
prompt: z.string().optional()
|
|
291
|
+
}),
|
|
292
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
293
|
+
const accounts = asAccounts(attributes.accounts);
|
|
294
|
+
const ids = accounts.map((a) => a.id);
|
|
295
|
+
const txns = asJournalTxns(attributes.transactions) ?? [];
|
|
296
|
+
const widget = /* @__PURE__ */ jsx(JournalPosterLab, {
|
|
297
|
+
accounts,
|
|
298
|
+
transactions: asJournalTxns(attributes.transactions),
|
|
299
|
+
showTrialBalance: attributes.showTrialBalance,
|
|
300
|
+
title: attributes.title,
|
|
301
|
+
prompt: attributes.prompt
|
|
302
|
+
});
|
|
303
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
304
|
+
const upd = updateAttributes;
|
|
305
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
306
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
307
|
+
label: "title",
|
|
308
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
309
|
+
value: attributes.title ?? "",
|
|
310
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
311
|
+
placeholder: "Post the entry"
|
|
312
|
+
})
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
315
|
+
label: "accounts",
|
|
316
|
+
children: /* @__PURE__ */ jsx(AccountsEditor, {
|
|
317
|
+
accounts,
|
|
318
|
+
onChange: (v) => upd({ accounts: v })
|
|
319
|
+
})
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
322
|
+
label: "events",
|
|
323
|
+
children: /* @__PURE__ */ jsx(RowsEditor, {
|
|
324
|
+
rows: txns,
|
|
325
|
+
onChange: (v) => upd({ transactions: v }),
|
|
326
|
+
addLabel: "event",
|
|
327
|
+
newRow: () => ({
|
|
328
|
+
id: `e${txns.length + 1}`,
|
|
329
|
+
prompt: "",
|
|
330
|
+
debit: ids[0] ?? "",
|
|
331
|
+
credit: ids[1] ?? ids[0] ?? "",
|
|
332
|
+
amount: 0
|
|
333
|
+
}),
|
|
334
|
+
columns: [
|
|
335
|
+
{
|
|
336
|
+
key: "prompt",
|
|
337
|
+
label: "event",
|
|
338
|
+
grow: true
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
key: "debit",
|
|
342
|
+
label: "debit",
|
|
343
|
+
type: "select",
|
|
344
|
+
options: ids
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
key: "credit",
|
|
348
|
+
label: "credit",
|
|
349
|
+
type: "select",
|
|
350
|
+
options: ids
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "amount",
|
|
354
|
+
label: "amount",
|
|
355
|
+
type: "number"
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
] }), widget] });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
const StatementSorterBlock = defineBlock({
|
|
364
|
+
key: "statement-sorter",
|
|
365
|
+
tag: "StatementSorter",
|
|
366
|
+
void: true,
|
|
367
|
+
label: "Statement sorter (the two statements)",
|
|
368
|
+
description: "Sort each account into the Income Statement or the Balance Sheet (coached), then close the books to carry net profit into Equity and watch A = L + E hold. Author the accounts + balances.",
|
|
369
|
+
category: "interactive",
|
|
370
|
+
schema: z.object({
|
|
371
|
+
accounts: z.array(accountCatSchema.extend({ balance: z.number() })).optional(),
|
|
372
|
+
asOfLabel: z.string().optional(),
|
|
373
|
+
showClosing: z.boolean().default(true),
|
|
374
|
+
title: z.string().optional(),
|
|
375
|
+
prompt: z.string().optional()
|
|
376
|
+
}),
|
|
377
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
378
|
+
const sortAccounts = asSortAccounts(attributes.accounts) ?? [];
|
|
379
|
+
const widget = /* @__PURE__ */ jsx(StatementSorterLab, {
|
|
380
|
+
accounts: asSortAccounts(attributes.accounts),
|
|
381
|
+
asOfLabel: attributes.asOfLabel,
|
|
382
|
+
showClosing: attributes.showClosing,
|
|
383
|
+
title: attributes.title,
|
|
384
|
+
prompt: attributes.prompt
|
|
385
|
+
});
|
|
386
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
387
|
+
const upd = updateAttributes;
|
|
388
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [/* @__PURE__ */ jsx(ConfigRow, {
|
|
389
|
+
label: "title",
|
|
390
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
391
|
+
value: attributes.title ?? "",
|
|
392
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
393
|
+
placeholder: "Sort into the statements"
|
|
394
|
+
})
|
|
395
|
+
}), /* @__PURE__ */ jsx(ConfigRow, {
|
|
396
|
+
label: "accounts + balances",
|
|
397
|
+
children: /* @__PURE__ */ jsx(RowsEditor, {
|
|
398
|
+
rows: sortAccounts,
|
|
399
|
+
onChange: (v) => upd({ accounts: v }),
|
|
400
|
+
addLabel: "account",
|
|
401
|
+
newRow: () => ({
|
|
402
|
+
id: "",
|
|
403
|
+
name: "",
|
|
404
|
+
category: "Asset",
|
|
405
|
+
balance: 0
|
|
406
|
+
}),
|
|
407
|
+
columns: [
|
|
408
|
+
{
|
|
409
|
+
key: "id",
|
|
410
|
+
label: "id"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
key: "name",
|
|
414
|
+
label: "name",
|
|
415
|
+
grow: true
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
key: "category",
|
|
419
|
+
label: "category",
|
|
420
|
+
type: "select",
|
|
421
|
+
options: CATEGORIES
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
key: "balance",
|
|
425
|
+
label: "balance",
|
|
426
|
+
type: "number"
|
|
427
|
+
}
|
|
428
|
+
]
|
|
429
|
+
})
|
|
430
|
+
})] }), widget] });
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
/** This domain's block specs + tag→component render map. */
|
|
434
|
+
const accountingBlocks = [
|
|
435
|
+
EquationBalanceBlock,
|
|
436
|
+
JournalPosterBlock,
|
|
437
|
+
StatementSorterBlock
|
|
438
|
+
];
|
|
439
|
+
const accountingComponents = {
|
|
440
|
+
EquationBalance: EquationBalanceLab,
|
|
441
|
+
JournalPoster: JournalPosterLab,
|
|
442
|
+
StatementSorter: StatementSorterLab
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
//#endregion
|
|
446
|
+
export { EquationBalanceBlock, JournalPosterBlock, StatementSorterBlock, accountingBlocks, accountingComponents };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/blocks/authoring.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Coerce a block attribute into an array. MDX↔Slate round-trips can hand an array
|
|
6
|
+
* attribute back as a JSON STRING (when a block has no `fromAttrs` parser), so a
|
|
7
|
+
* bare `attr ?? []` slips a string through and `.map` throws. Always read array
|
|
8
|
+
* attrs through this: array → as-is, JSON-string-of-array → parsed, else fallback.
|
|
9
|
+
*/
|
|
10
|
+
declare function coerceArray<T>(raw: unknown, fallback?: T[]): T[];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { coerceArray };
|