@classytic/labs 0.1.0 → 0.2.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/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/biology/enzyme-rate/preset.mjs +5 -5
- package/dist/biology/genetic-cross/core.d.mts +7 -7
- package/dist/biology/genetic-cross/core.mjs +4 -4
- package/dist/biology/genetic-cross/grid.mjs +132 -123
- package/dist/biology/genetic-cross/preset.mjs +4 -4
- package/dist/biology/genetic-cross/sex-linked.mjs +7 -7
- package/dist/biology/photosynthesis-factors/preset.mjs +8 -8
- package/dist/biology/respiration/preset.mjs +4 -4
- package/dist/biology/sequence/central-dogma.mjs +5 -5
- package/dist/biology/sequence/core.d.mts +6 -6
- package/dist/biology/sequence/core.mjs +1 -1
- package/dist/biology/sequence/preset.mjs +6 -6
- package/dist/blocks/authoring.mjs +5 -5
- package/dist/blocks/biology.d.mts +2 -2
- package/dist/blocks/biology.mjs +5 -5
- package/dist/blocks/chem.d.mts +2 -2
- package/dist/blocks/chem.mjs +13 -13
- package/dist/blocks/circuits.d.mts +293 -4
- package/dist/blocks/circuits.mjs +874 -9
- package/dist/blocks/discrete.d.mts +30 -2
- package/dist/blocks/discrete.mjs +74 -4
- package/dist/blocks/economics.mjs +1 -1
- package/dist/blocks/geography.mjs +1 -1
- package/dist/blocks/geometry.mjs +3 -3
- package/dist/blocks/ict.d.mts +90 -1
- package/dist/blocks/ict.mjs +217 -7
- package/dist/blocks/index.d.mts +3064 -657
- package/dist/blocks/index.mjs +9 -9
- package/dist/blocks/lab-block.mjs +5 -5
- package/dist/blocks/lab-config.d.mts +1 -1
- package/dist/blocks/lab-config.mjs +4 -4
- package/dist/blocks/lab-gallery.d.mts +1 -1
- package/dist/blocks/lab-gallery.mjs +2 -2
- package/dist/blocks/language.d.mts +6 -6
- package/dist/blocks/language.mjs +12 -12
- package/dist/blocks/lesson.mjs +4 -4
- package/dist/blocks/math.d.mts +577 -11
- package/dist/blocks/math.mjs +1648 -14
- package/dist/blocks/ml.d.mts +45 -1
- package/dist/blocks/ml.mjs +80 -6
- package/dist/blocks/physics.d.mts +9 -4
- package/dist/blocks/physics.mjs +75 -28
- package/dist/blocks/statistics.mjs +1 -1
- package/dist/build/CircuitEditor.d.mts +14 -0
- package/dist/build/CircuitEditor.mjs +787 -0
- package/dist/build/CircuitPlayer.d.mts +19 -0
- package/dist/build/CircuitPlayer.mjs +53 -0
- package/dist/build/CircuitScene.d.mts +61 -0
- package/dist/build/CircuitScene.mjs +383 -0
- package/dist/build/contract.d.mts +116 -0
- package/dist/build/editor-ops.d.mts +65 -0
- package/dist/build/editor-ops.mjs +306 -0
- package/dist/build/editor-ui.mjs +121 -0
- package/dist/build/flow.d.mts +14 -0
- package/dist/build/flow.mjs +119 -0
- package/dist/build/index.d.mts +10 -0
- package/dist/build/index.mjs +10 -0
- package/dist/build/parts/ammeter.d.mts +1 -0
- package/dist/build/parts/ammeter.mjs +32 -0
- package/dist/build/parts/bulb.d.mts +1 -0
- package/dist/build/parts/bulb.mjs +50 -0
- package/dist/build/parts/capacitor.d.mts +1 -0
- package/dist/build/parts/capacitor.mjs +26 -0
- package/dist/build/parts/cell.d.mts +1 -0
- package/dist/build/parts/cell.mjs +40 -0
- package/dist/build/parts/diode.d.mts +1 -0
- package/dist/build/parts/diode.mjs +33 -0
- package/dist/build/parts/index.d.mts +5 -0
- package/dist/build/parts/index.mjs +43 -0
- package/dist/build/parts/mosfet.d.mts +1 -0
- package/dist/build/parts/mosfet.mjs +95 -0
- package/dist/build/parts/node.d.mts +1 -0
- package/dist/build/parts/node.mjs +32 -0
- package/dist/build/parts/resistor.d.mts +1 -0
- package/dist/build/parts/resistor.mjs +49 -0
- package/dist/build/parts/shared.mjs +42 -0
- package/dist/build/parts/switch.d.mts +1 -0
- package/dist/build/parts/switch.mjs +34 -0
- package/dist/build/parts.d.mts +1 -0
- package/dist/build/registry.d.mts +9 -0
- package/dist/build/registry.mjs +15 -0
- package/dist/build/solve.d.mts +8 -0
- package/dist/build/solve.mjs +0 -0
- package/dist/catalog/registry.d.mts +2 -2
- package/dist/catalog/templates.d.mts +1 -1
- package/dist/catalog/templates.mjs +6 -6
- package/dist/chem/battery.mjs +1 -1
- package/dist/chem/bohr-atom.mjs +4 -4
- package/dist/chem/diffusion/preset.mjs +4 -4
- package/dist/chem/electrochem/preset.mjs +5 -5
- package/dist/chem/equilibrium/preset.d.mts +1 -1
- package/dist/chem/equilibrium/preset.mjs +6 -6
- package/dist/chem/gas-box/preset.mjs +6 -6
- package/dist/chem/kinetics/preset.mjs +6 -6
- package/dist/chem/periodic-trends/preset.mjs +7 -7
- package/dist/chem/reaction-lab.mjs +3 -3
- package/dist/chem/reaction-profile.mjs +4 -4
- package/dist/chem/solution/dilution.mjs +6 -6
- package/dist/chem/solution/field.d.mts +2 -2
- package/dist/chem/solution/field.mjs +2 -2
- package/dist/chem/solution/solution-box.mjs +7 -7
- package/dist/chem/stoichiometry/preset.mjs +5 -5
- package/dist/chem/titration/preset.mjs +5 -5
- package/dist/circuits/ac-dc/asset.mjs +1 -1
- package/dist/circuits/ac-dc/preset.mjs +2 -2
- package/dist/circuits/brownout/index.d.mts +1 -0
- package/dist/circuits/brownout/preset.d.mts +22 -0
- package/dist/circuits/brownout/preset.mjs +399 -0
- package/dist/circuits/capacitor-leak/preset.mjs +13 -8
- package/dist/circuits/circuit/asset.mjs +71 -14
- package/dist/circuits/circuit/preset.mjs +23 -5
- package/dist/circuits/circuit-builder.mjs +60 -132
- package/dist/circuits/circuit-lab.mjs +60 -40
- package/dist/circuits/cmos-gate/index.d.mts +1 -0
- package/dist/circuits/cmos-gate/preset.d.mts +75 -0
- package/dist/circuits/cmos-gate/preset.mjs +1491 -0
- package/dist/circuits/diode/index.d.mts +1 -0
- package/dist/circuits/diode/preset.d.mts +25 -0
- package/dist/circuits/diode/preset.mjs +266 -0
- package/dist/circuits/index.d.mts +7 -1
- package/dist/circuits/index.mjs +7 -1
- package/dist/circuits/rc-charging/index.d.mts +1 -0
- package/dist/circuits/rc-charging/preset.d.mts +27 -0
- package/dist/circuits/rc-charging/preset.mjs +329 -0
- package/dist/circuits/semiconductor/index.d.mts +1 -0
- package/dist/circuits/semiconductor/preset.d.mts +102 -0
- package/dist/circuits/semiconductor/preset.mjs +1855 -0
- package/dist/circuits/transistor/index.d.mts +1 -0
- package/dist/circuits/transistor/preset.d.mts +27 -0
- package/dist/circuits/transistor/preset.mjs +329 -0
- package/dist/commerce/accounting/core.d.mts +1 -1
- package/dist/commerce/accounting/equation-balance.mjs +5 -5
- package/dist/commerce/accounting/journal-poster.mjs +8 -8
- package/dist/commerce/accounting/statement-sorter.mjs +4 -4
- package/dist/commerce/economics/core.d.mts +2 -2
- package/dist/commerce/economics/core.mjs +1 -1
- package/dist/commerce/economics/demand-shift-vs-move.mjs +6 -6
- package/dist/commerce/economics/elasticity-revenue.mjs +6 -6
- package/dist/commerce/economics/market-equilibrium.mjs +5 -5
- package/dist/core/easing.d.mts +3 -3
- package/dist/core/easing.mjs +2 -2
- package/dist/core/numeric.d.mts +3 -3
- package/dist/core/numeric.mjs +2 -2
- package/dist/core/reactive.d.mts +1 -1
- package/dist/core/reactive.mjs +1 -1
- package/dist/core/rng.d.mts +2 -2
- package/dist/core/rng.mjs +1 -1
- package/dist/core/tex.mjs +2 -2
- package/dist/core/timeline.d.mts +1 -1
- package/dist/core/timeline.mjs +1 -1
- package/dist/core/util.mjs +11 -1
- package/dist/discrete/arrangements/preset.mjs +6 -14
- package/dist/discrete/bayes/preset.mjs +43 -35
- package/dist/discrete/binomial/preset.mjs +2 -2
- package/dist/discrete/combination-studio/figure.d.mts +6 -0
- package/dist/discrete/combination-studio/figure.mjs +159 -0
- package/dist/discrete/combination-studio/index.d.mts +2 -0
- package/dist/discrete/combination-studio/preset.d.mts +44 -0
- package/dist/discrete/combination-studio/preset.mjs +440 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -3
- package/dist/discrete/core/combinatorics.mjs +38 -3
- package/dist/discrete/core/pigeonhole.d.mts +1 -1
- package/dist/discrete/core/pigeonhole.mjs +1 -1
- package/dist/discrete/core/probability.d.mts +3 -3
- package/dist/discrete/core/probability.mjs +3 -3
- package/dist/discrete/core/sets.d.mts +1 -1
- package/dist/discrete/counting-slots/preset.mjs +8 -8
- package/dist/discrete/counting-tree/preset.mjs +65 -8
- package/dist/discrete/expected-value/preset.mjs +13 -13
- package/dist/discrete/hypergeometric/preset.mjs +48 -15
- package/dist/discrete/index.d.mts +4 -2
- package/dist/discrete/index.mjs +4 -2
- package/dist/discrete/karnaugh/preset.mjs +26 -20
- package/dist/discrete/lln/preset.mjs +44 -3
- package/dist/discrete/logic-circuit/preset.mjs +2 -2
- package/dist/discrete/monte-carlo/preset.d.mts +1 -1
- package/dist/discrete/monte-carlo/preset.mjs +14 -14
- package/dist/discrete/monty-hall/preset.mjs +6 -6
- package/dist/discrete/outcome-builder/preset.mjs +3 -3
- package/dist/discrete/pascal/preset.mjs +37 -7
- package/dist/discrete/rules.d.mts +20 -0
- package/dist/discrete/rules.mjs +264 -0
- package/dist/discrete/sample-space/preset.mjs +4 -4
- package/dist/discrete/selection/preset.mjs +7 -13
- package/dist/discrete/truth-table/preset.mjs +32 -9
- package/dist/discrete/venn/preset.mjs +71 -48
- package/dist/geography/cycle-lab/preset.mjs +17 -10
- package/dist/geography/cycles.d.mts +3 -3
- package/dist/geography/cycles.mjs +3 -3
- package/dist/geometry/board/preset.d.mts +2 -0
- package/dist/geometry/board/preset.mjs +11 -15
- package/dist/geometry/builder.mjs +3 -3
- package/dist/ict/number-systems/base-odometer.mjs +4 -4
- package/dist/ict/number-systems/bit-grouper.d.mts +1 -1
- package/dist/ict/number-systems/bit-grouper.mjs +4 -4
- package/dist/ict/number-systems/place-value-dial.d.mts +1 -1
- package/dist/ict/number-systems/place-value-dial.mjs +3 -3
- package/dist/ict/number-systems/wheel.d.mts +3 -3
- package/dist/ict/number-systems/wheel.mjs +4 -4
- package/dist/kit/annotate.mjs +3 -3
- package/dist/kit/answer-check.d.mts +2 -2
- package/dist/kit/answer-check.mjs +34 -6
- package/dist/kit/ask.d.mts +19 -0
- package/dist/kit/ask.mjs +46 -0
- package/dist/kit/bar-strip.mjs +53 -0
- package/dist/kit/calc.d.mts +33 -0
- package/dist/kit/calc.mjs +27 -0
- package/dist/kit/carrier-engine.mjs +147 -0
- package/dist/kit/clue-scene.d.mts +86 -0
- package/dist/kit/clue-scene.mjs +424 -0
- package/dist/kit/cluster.d.mts +30 -0
- package/dist/kit/cluster.mjs +81 -0
- package/dist/kit/controls.mjs +11 -5
- package/dist/kit/coords.d.mts +88 -0
- package/dist/kit/coords.mjs +192 -0
- package/dist/kit/data-scene.d.mts +27 -0
- package/dist/kit/data-scene.mjs +199 -0
- package/dist/kit/diagram.mjs +111 -50
- package/dist/kit/electronics.mjs +552 -60
- package/dist/kit/expr-analysis.d.mts +18 -6
- package/dist/kit/expr-analysis.mjs +82 -28
- package/dist/kit/frame.d.mts +3 -3
- package/dist/kit/frame.mjs +25 -6
- package/dist/kit/gameshow.mjs +2 -2
- package/dist/kit/index.d.mts +14 -2
- package/dist/kit/index.mjs +13 -1
- package/dist/kit/logic-gates.mjs +246 -47
- package/dist/kit/palette.mjs +26 -0
- package/dist/kit/pedagogy.d.mts +4 -4
- package/dist/kit/pedagogy.mjs +21 -17
- package/dist/kit/play.d.mts +1 -1
- package/dist/kit/play.mjs +3 -3
- package/dist/kit/predict.d.mts +55 -0
- package/dist/kit/predict.mjs +146 -0
- package/dist/kit/receipt.d.mts +29 -0
- package/dist/kit/receipt.mjs +94 -0
- package/dist/kit/rich.mjs +2 -2
- package/dist/kit/rule.d.mts +59 -0
- package/dist/kit/rule.mjs +215 -0
- package/dist/kit/scale.mjs +1 -1
- package/dist/kit/scene-library.d.mts +22 -0
- package/dist/kit/scene-library.mjs +311 -0
- package/dist/kit/scene-studio.d.mts +14 -0
- package/dist/kit/scene-studio.mjs +338 -0
- package/dist/kit/scenes.d.mts +31 -0
- package/dist/kit/scenes.mjs +569 -0
- package/dist/kit/slot-fill.d.mts +61 -0
- package/dist/kit/slot-fill.mjs +207 -0
- package/dist/kit/solve.d.mts +21 -0
- package/dist/kit/solve.mjs +75 -0
- package/dist/kit/space.mjs +5 -5
- package/dist/kit/steps.mjs +2 -2
- package/dist/kit/vessel.d.mts +69 -0
- package/dist/kit/vessel.mjs +191 -0
- package/dist/language/agreement/preset.mjs +2 -2
- package/dist/language/article-lens/preset.d.mts +1 -1
- package/dist/language/article-lens/preset.mjs +8 -8
- package/dist/language/deck.d.mts +3 -3
- package/dist/language/deck.mjs +1 -1
- package/dist/language/preposition-scene/preset.d.mts +2 -2
- package/dist/language/preposition-scene/preset.mjs +5 -5
- package/dist/language/sentence-builder/preset.mjs +5 -5
- package/dist/language/transform/preset.d.mts +2 -2
- package/dist/language/transform/preset.mjs +5 -5
- package/dist/language/ui.d.mts +3 -3
- package/dist/language/ui.mjs +4 -4
- package/dist/language/word-match/preset.mjs +3 -3
- package/dist/logic/LogicBuildLab.d.mts +22 -0
- package/dist/logic/LogicBuildLab.mjs +170 -0
- package/dist/logic/LogicEditScene.d.mts +31 -0
- package/dist/logic/LogicEditScene.mjs +276 -0
- package/dist/logic/LogicEditor.d.mts +14 -0
- package/dist/logic/LogicEditor.mjs +413 -0
- package/dist/logic/LogicScene.d.mts +32 -0
- package/dist/logic/LogicScene.mjs +277 -0
- package/dist/logic/contract.d.mts +72 -0
- package/dist/logic/display.d.mts +24 -0
- package/dist/logic/display.mjs +127 -0
- package/dist/logic/edit-ops.d.mts +44 -0
- package/dist/logic/edit-ops.mjs +177 -0
- package/dist/logic/evaluate.d.mts +11 -0
- package/dist/logic/evaluate.mjs +93 -0
- package/dist/logic/gates.d.mts +10 -0
- package/dist/logic/gates.mjs +73 -0
- package/dist/logic/index.d.mts +14 -0
- package/dist/logic/index.mjs +13 -0
- package/dist/logic/lab.d.mts +32 -0
- package/dist/logic/lab.mjs +160 -0
- package/dist/logic/presets.d.mts +12 -0
- package/dist/logic/presets.mjs +241 -0
- package/dist/logic/registry.d.mts +9 -0
- package/dist/logic/registry.mjs +15 -0
- package/dist/math/area-model/preset.mjs +70 -44
- package/dist/math/balance-algebra/preset.mjs +14 -5
- package/dist/math/broken-tree/index.d.mts +1 -0
- package/dist/math/broken-tree/preset.d.mts +26 -0
- package/dist/math/broken-tree/preset.mjs +435 -0
- package/dist/math/circle/index.d.mts +1 -0
- package/dist/math/circle/preset.d.mts +44 -0
- package/dist/math/circle/preset.mjs +198 -0
- package/dist/math/complex/core.d.mts +93 -0
- package/dist/math/complex/core.mjs +239 -0
- package/dist/math/complex/index.d.mts +3 -0
- package/dist/math/complex/preset.d.mts +31 -0
- package/dist/math/complex/preset.mjs +377 -0
- package/dist/math/complex/rules.d.mts +6 -0
- package/dist/math/complex/rules.mjs +121 -0
- package/dist/math/conic/index.d.mts +1 -0
- package/dist/math/conic/preset.d.mts +30 -0
- package/dist/math/conic/preset.mjs +334 -0
- package/dist/math/derivation.mjs +5 -5
- package/dist/math/derivative-explorer/preset.mjs +5 -5
- package/dist/math/domain-range/index.d.mts +1 -0
- package/dist/math/domain-range/preset.d.mts +33 -0
- package/dist/math/domain-range/preset.mjs +313 -0
- package/dist/math/fraction-bar/index.d.mts +1 -0
- package/dist/math/fraction-bar/preset.d.mts +27 -0
- package/dist/math/fraction-bar/preset.mjs +197 -0
- package/dist/math/function-machine/preset.mjs +2 -2
- package/dist/math/gradient-descent.mjs +6 -6
- package/dist/math/grapher/preset.d.mts +1 -1
- package/dist/math/grapher/preset.mjs +4 -4
- package/dist/math/harmonic-form/preset.mjs +6 -6
- package/dist/math/index.d.mts +27 -2
- package/dist/math/index.mjs +27 -2
- package/dist/math/integral-explorer/preset.mjs +2 -2
- package/dist/math/interactive/preset.mjs +3 -3
- package/dist/math/limit-explorer/preset.mjs +4 -4
- package/dist/math/linear-model/index.d.mts +1 -0
- package/dist/math/linear-model/preset.d.mts +53 -0
- package/dist/math/linear-model/preset.mjs +164 -0
- package/dist/math/linear-system/preset.mjs +4 -4
- package/dist/math/mystery-bucket/preset.mjs +6 -6
- package/dist/math/number-line/preset.mjs +3 -2
- package/dist/math/parabola/preset.mjs +4 -3
- package/dist/math/pattern/preset.mjs +7 -13
- package/dist/math/percent-bar/index.d.mts +1 -0
- package/dist/math/percent-bar/preset.d.mts +37 -0
- package/dist/math/percent-bar/preset.mjs +275 -0
- package/dist/math/poly/core.d.mts +50 -0
- package/dist/math/poly/core.mjs +268 -0
- package/dist/math/poly/index.d.mts +3 -0
- package/dist/math/poly/preset.d.mts +23 -0
- package/dist/math/poly/preset.mjs +141 -0
- package/dist/math/poly/steps.d.mts +10 -0
- package/dist/math/poly/steps.mjs +99 -0
- package/dist/math/rate-machine/index.d.mts +1 -0
- package/dist/math/rate-machine/preset.d.mts +35 -0
- package/dist/math/rate-machine/preset.mjs +281 -0
- package/dist/math/ratio-share/index.d.mts +1 -0
- package/dist/math/ratio-share/preset.d.mts +24 -0
- package/dist/math/ratio-share/preset.mjs +204 -0
- package/dist/math/receipt/index.d.mts +1 -0
- package/dist/math/receipt/preset.d.mts +22 -0
- package/dist/math/receipt/preset.mjs +137 -0
- package/dist/math/sequence-predict/index.d.mts +1 -0
- package/dist/math/sequence-predict/preset.d.mts +34 -0
- package/dist/math/sequence-predict/preset.mjs +130 -0
- package/dist/math/straight-line/index.d.mts +1 -0
- package/dist/math/straight-line/preset.d.mts +37 -0
- package/dist/math/straight-line/preset.mjs +374 -0
- package/dist/math/system-solve/index.d.mts +1 -0
- package/dist/math/system-solve/preset.d.mts +21 -0
- package/dist/math/system-solve/preset.mjs +227 -0
- package/dist/math/transform/index.d.mts +1 -0
- package/dist/math/transform/preset.d.mts +41 -0
- package/dist/math/transform/preset.mjs +343 -0
- package/dist/math/triangle-trig/preset.mjs +12 -9
- package/dist/math/trig/core.d.mts +37 -0
- package/dist/math/trig/core.mjs +150 -0
- package/dist/math/trig/diagrams.d.mts +1 -0
- package/dist/math/trig/diagrams.mjs +321 -0
- package/dist/math/trig/index.d.mts +3 -0
- package/dist/math/trig/preset.d.mts +25 -0
- package/dist/math/trig/preset.mjs +260 -0
- package/dist/math/trig/rules.d.mts +6 -0
- package/dist/math/trig/rules.mjs +159 -0
- package/dist/math/trig-explorer.mjs +4 -4
- package/dist/ml/boundary/preset.mjs +8 -3
- package/dist/ml/classifier/preset.mjs +31 -6
- package/dist/ml/kmeans/preset.mjs +4 -4
- package/dist/ml/knn/preset.mjs +47 -12
- package/dist/ml/regression/preset.mjs +36 -7
- package/dist/physics/atwood/preset.mjs +4 -4
- package/dist/physics/bullet-walls/preset.d.mts +1 -1
- package/dist/physics/bullet-walls/preset.mjs +7 -7
- package/dist/physics/carnot/preset.mjs +6 -6
- package/dist/physics/circular-motion/preset.mjs +36 -5
- package/dist/physics/collision-track/preset.mjs +35 -5
- package/dist/physics/efficiency/preset.d.mts +2 -2
- package/dist/physics/efficiency/preset.mjs +5 -5
- package/dist/physics/electric-field/preset.mjs +32 -23
- package/dist/physics/electric-flux/index.d.mts +1 -0
- package/dist/physics/electric-flux/preset.d.mts +29 -0
- package/dist/physics/electric-flux/preset.mjs +264 -0
- package/dist/physics/energy-skate/preset.mjs +5 -5
- package/dist/physics/entropy/preset.mjs +7 -7
- package/dist/physics/expansion/preset.mjs +13 -13
- package/dist/physics/exponential/asset.mjs +1 -1
- package/dist/physics/exponential/preset.mjs +4 -4
- package/dist/physics/gas-process/preset.mjs +3 -3
- package/dist/physics/gauss-law/index.d.mts +1 -0
- package/dist/physics/gauss-law/preset.d.mts +20 -0
- package/dist/physics/gauss-law/preset.mjs +286 -0
- package/dist/physics/gravitation/preset.mjs +7 -7
- package/dist/physics/gravity-drop.mjs +4 -4
- package/dist/physics/heat-transfer/preset.d.mts +1 -1
- package/dist/physics/heat-transfer/preset.mjs +10 -10
- package/dist/physics/impulse/preset.mjs +5 -5
- package/dist/physics/index.d.mts +4 -1
- package/dist/physics/index.mjs +4 -1
- package/dist/physics/kepler/preset.mjs +4 -4
- package/dist/physics/lever/preset.mjs +3 -3
- package/dist/physics/lorentz/preset.mjs +11 -11
- package/dist/physics/magnetism/preset.mjs +3 -3
- package/dist/physics/optics/preset.mjs +2 -2
- package/dist/physics/orbit-lab.mjs +5 -5
- package/dist/physics/projectile-lab.mjs +4 -4
- package/dist/physics/rain-relative/preset.mjs +5 -5
- package/dist/physics/ramp-forces/preset.mjs +5 -5
- package/dist/physics/river-boat.mjs +6 -6
- package/dist/physics/shm/preset.mjs +9 -9
- package/dist/physics/stopping-distance/preset.mjs +3 -3
- package/dist/physics/temperature-scales/preset.mjs +105 -116
- package/dist/physics/terminal-velocity/preset.mjs +5 -5
- package/dist/physics/thermal/preset.mjs +5 -5
- package/dist/physics/vector-board/preset.mjs +7 -6
- package/dist/physics/vector-scene.mjs +2 -2
- package/dist/physics/vector-types/preset.mjs +37 -3
- package/dist/physics/water-density/preset.mjs +12 -12
- package/dist/physics/waves/doppler.mjs +2 -2
- package/dist/physics/waves/preset.mjs +4 -4
- package/dist/physics/waves/ripple.mjs +6 -6
- package/dist/physics/waves/string.mjs +5 -5
- package/dist/physics/work-energy/preset.mjs +4 -4
- package/dist/physics/work-potential/index.d.mts +1 -0
- package/dist/physics/work-potential/preset.d.mts +20 -0
- package/dist/physics/work-potential/preset.mjs +276 -0
- package/dist/schemas/index.d.mts +6 -6
- package/dist/schemas/index.mjs +3 -3
- package/dist/statistics/center-spread/preset.mjs +3 -3
- package/dist/statistics/core/descriptive.d.mts +2 -2
- package/dist/statistics/core/descriptive.mjs +2 -2
- package/dist/statistics/core/normal.d.mts +3 -3
- package/dist/statistics/core/normal.mjs +3 -3
- package/dist/statistics/core/sequences.d.mts +1 -1
- package/dist/statistics/galton/preset.mjs +2 -2
- package/dist/statistics/histogram/preset.mjs +6 -6
- package/dist/statistics/normal/preset.mjs +2 -2
- package/dist/statistics/sampling/preset.mjs +4 -4
- package/dist/statistics/sequence/preset.mjs +58 -15
- package/dist/statistics/z-table/preset.mjs +17 -4
- package/package.json +11 -3
- package/styles.css +4 -1
package/dist/blocks/circuits.mjs
CHANGED
|
@@ -2,6 +2,14 @@ import { CircuitNetworkLab } from "../circuits/circuit/preset.mjs";
|
|
|
2
2
|
import { CircuitLab } from "../circuits/circuit-lab.mjs";
|
|
3
3
|
import { CircuitBuilder } from "../circuits/circuit-builder.mjs";
|
|
4
4
|
import { CapacitorLeakLab } from "../circuits/capacitor-leak/preset.mjs";
|
|
5
|
+
import { RCChargingLab } from "../circuits/rc-charging/preset.mjs";
|
|
6
|
+
import { DiodeLab } from "../circuits/diode/preset.mjs";
|
|
7
|
+
import { TransistorLab } from "../circuits/transistor/preset.mjs";
|
|
8
|
+
import { CmosInverterLab, CmosNandLab, CmosNorLab, RNmosNotLab } from "../circuits/cmos-gate/preset.mjs";
|
|
9
|
+
import { BrownoutLab } from "../circuits/brownout/preset.mjs";
|
|
10
|
+
import { BjtInsideLab, ConductionLab, HallEffectLab, MosfetInsideLab, PnJunctionLab, SiliconLatticeLab } from "../circuits/semiconductor/preset.mjs";
|
|
11
|
+
import { CircuitPlayer } from "../build/CircuitPlayer.mjs";
|
|
12
|
+
import { CircuitEditor } from "../build/CircuitEditor.mjs";
|
|
5
13
|
import { ChipToggle, ConfigPanel, ConfigRow, NumField, SmallButton, TextField } from "./authoring.mjs";
|
|
6
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
15
|
import { z } from "zod";
|
|
@@ -12,7 +20,7 @@ const CircuitLabBlock = defineBlock({
|
|
|
12
20
|
key: "circuit-lab",
|
|
13
21
|
void: true,
|
|
14
22
|
label: "Circuit lab",
|
|
15
|
-
description: "Series/parallel resistors
|
|
23
|
+
description: "Series/parallel resistors, voltage & current divider rules, step by step.",
|
|
16
24
|
category: "interactive",
|
|
17
25
|
schema: z.object({
|
|
18
26
|
voltage: z.number().optional(),
|
|
@@ -87,7 +95,7 @@ const CircuitBuilderBlock = defineBlock({
|
|
|
87
95
|
key: "circuit-builder",
|
|
88
96
|
void: true,
|
|
89
97
|
label: "Circuit builder (play)",
|
|
90
|
-
description: "Build a loop
|
|
98
|
+
description: "Build a loop, battery, bulbs, switches, resistors. Flip switches, watch current & the bulb.",
|
|
91
99
|
category: "interactive",
|
|
92
100
|
schema: z.object({
|
|
93
101
|
battery: z.number().optional(),
|
|
@@ -215,7 +223,7 @@ const CircuitBlock = defineBlock({
|
|
|
215
223
|
tag: "Circuit",
|
|
216
224
|
void: true,
|
|
217
225
|
label: "Circuit (light the bulb)",
|
|
218
|
-
description: "Battery + switch + bulb
|
|
226
|
+
description: "Battery + switch + bulb, close the switch and tune the voltage to light it.",
|
|
219
227
|
category: "interactive",
|
|
220
228
|
schema: z.object({
|
|
221
229
|
emf: z.number().default(6),
|
|
@@ -266,8 +274,8 @@ const CapacitorLeakBlock = defineBlock({
|
|
|
266
274
|
key: "capacitor-leak",
|
|
267
275
|
tag: "CapacitorLeak",
|
|
268
276
|
void: true,
|
|
269
|
-
label: "Capacitor
|
|
270
|
-
description: "A cell charges a capacitor through R; flip to \"leak\" and it self-discharges through its leakage resistance
|
|
277
|
+
label: "Capacitor: charge & leak (RC)",
|
|
278
|
+
description: "A cell charges a capacitor through R; flip to \"leak\" and it self-discharges through its leakage resistance, the plate field thins, drips fall, Vc decays. Live Vc–t trace + τ readout.",
|
|
271
279
|
category: "interactive",
|
|
272
280
|
schema: z.object({
|
|
273
281
|
emf: z.number().default(6),
|
|
@@ -329,20 +337,877 @@ const CapacitorLeakBlock = defineBlock({
|
|
|
329
337
|
] }), widget] });
|
|
330
338
|
}
|
|
331
339
|
});
|
|
332
|
-
|
|
340
|
+
const cvec = z.object({
|
|
341
|
+
x: z.number(),
|
|
342
|
+
y: z.number()
|
|
343
|
+
});
|
|
344
|
+
const cPart = z.object({
|
|
345
|
+
id: z.string(),
|
|
346
|
+
kind: z.string(),
|
|
347
|
+
at: cvec,
|
|
348
|
+
orient: z.enum(["h", "v"]).optional(),
|
|
349
|
+
props: z.record(z.string(), z.union([
|
|
350
|
+
z.number(),
|
|
351
|
+
z.string(),
|
|
352
|
+
z.boolean()
|
|
353
|
+
])).optional(),
|
|
354
|
+
pins: z.record(z.string(), z.string())
|
|
355
|
+
});
|
|
356
|
+
const cDoc = z.object({
|
|
357
|
+
parts: z.array(cPart).default([]),
|
|
358
|
+
nodes: z.array(z.object({
|
|
359
|
+
id: z.string(),
|
|
360
|
+
at: cvec
|
|
361
|
+
})).default([]),
|
|
362
|
+
size: z.object({
|
|
363
|
+
w: z.number(),
|
|
364
|
+
h: z.number()
|
|
365
|
+
}).optional()
|
|
366
|
+
});
|
|
367
|
+
const EMPTY_DOC = {
|
|
368
|
+
parts: [],
|
|
369
|
+
nodes: [],
|
|
370
|
+
size: {
|
|
371
|
+
w: 560,
|
|
372
|
+
h: 300
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
/** Render a stored doc for learners: a CircuitPlayer they can operate (tap switches). */
|
|
376
|
+
function CircuitSceneView({ doc }) {
|
|
377
|
+
return /* @__PURE__ */ jsx(CircuitPlayer, { doc: doc ?? EMPTY_DOC });
|
|
378
|
+
}
|
|
379
|
+
const CircuitSceneBlock = defineBlock({
|
|
380
|
+
key: "circuit-scene",
|
|
381
|
+
tag: "CircuitScene",
|
|
382
|
+
void: true,
|
|
383
|
+
label: "Circuit builder (canvas)",
|
|
384
|
+
description: "Place parts on a canvas, drag to arrange, click pins to wire. Any topology (Kirchhoff), solved live. Learners tap switches to operate it.",
|
|
385
|
+
category: "interactive",
|
|
386
|
+
schema: z.object({
|
|
387
|
+
doc: cDoc.optional(),
|
|
388
|
+
title: z.string().optional()
|
|
389
|
+
}),
|
|
390
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
391
|
+
const doc = attributes.doc ?? EMPTY_DOC;
|
|
392
|
+
if (mode !== "editing" || !updateAttributes) return /* @__PURE__ */ jsx(CircuitSceneView, { doc });
|
|
393
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(ConfigPanel, { children: /* @__PURE__ */ jsx(ConfigRow, {
|
|
394
|
+
label: "Title",
|
|
395
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
396
|
+
value: attributes.title ?? "",
|
|
397
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
398
|
+
placeholder: "Build a circuit",
|
|
399
|
+
className: "flex-1"
|
|
400
|
+
})
|
|
401
|
+
}) }), /* @__PURE__ */ jsx(CircuitEditor, {
|
|
402
|
+
value: doc,
|
|
403
|
+
onChange: (d) => updateAttributes({ doc: d })
|
|
404
|
+
})] });
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
const MosfetInsideBlock = defineBlock({
|
|
408
|
+
key: "mosfet-inside",
|
|
409
|
+
tag: "MosfetInside",
|
|
410
|
+
void: true,
|
|
411
|
+
label: "Inside the transistor (NMOS channel)",
|
|
412
|
+
description: "Cross-section of an NMOS: raise the gate and watch a depletion region, then an electron channel, form between source and drain. Carriers move; engine-solved.",
|
|
413
|
+
category: "interactive",
|
|
414
|
+
schema: z.object({
|
|
415
|
+
pmos: z.boolean().default(false),
|
|
416
|
+
vth: z.number().default(1.5),
|
|
417
|
+
k: z.number().default(.02),
|
|
418
|
+
title: z.string().optional(),
|
|
419
|
+
prompt: z.string().optional()
|
|
420
|
+
}),
|
|
421
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
422
|
+
const widget = /* @__PURE__ */ jsx(MosfetInsideLab, {
|
|
423
|
+
pmos: attributes.pmos,
|
|
424
|
+
vth: attributes.vth,
|
|
425
|
+
k: attributes.k,
|
|
426
|
+
title: attributes.title,
|
|
427
|
+
prompt: attributes.prompt
|
|
428
|
+
});
|
|
429
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
430
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
431
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
432
|
+
label: "title",
|
|
433
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
434
|
+
value: attributes.title ?? "",
|
|
435
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
436
|
+
placeholder: "Inside the transistor",
|
|
437
|
+
className: "flex-1"
|
|
438
|
+
})
|
|
439
|
+
}),
|
|
440
|
+
/* @__PURE__ */ jsxs(ConfigRow, {
|
|
441
|
+
label: "type",
|
|
442
|
+
children: [/* @__PURE__ */ jsx(ChipToggle, {
|
|
443
|
+
active: !attributes.pmos,
|
|
444
|
+
onClick: () => updateAttributes({ pmos: false }),
|
|
445
|
+
children: "NMOS"
|
|
446
|
+
}), /* @__PURE__ */ jsx(ChipToggle, {
|
|
447
|
+
active: !!attributes.pmos,
|
|
448
|
+
onClick: () => updateAttributes({ pmos: true }),
|
|
449
|
+
children: "PMOS"
|
|
450
|
+
})]
|
|
451
|
+
}),
|
|
452
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
453
|
+
label: "threshold Vth (V)",
|
|
454
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
455
|
+
value: attributes.vth ?? 1.5,
|
|
456
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
457
|
+
})
|
|
458
|
+
}),
|
|
459
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
460
|
+
label: "gain k",
|
|
461
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
462
|
+
value: attributes.k ?? .02,
|
|
463
|
+
onChange: (v) => updateAttributes({ k: v })
|
|
464
|
+
})
|
|
465
|
+
})
|
|
466
|
+
] }), widget] });
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
const PnJunctionBlock = defineBlock({
|
|
470
|
+
key: "pn-junction",
|
|
471
|
+
tag: "PnJunction",
|
|
472
|
+
void: true,
|
|
473
|
+
label: "Inside the diode (PN junction)",
|
|
474
|
+
description: "Cross-section of a PN junction: n and p regions, the depletion region of fixed ions, and carriers flooding across under forward bias. Engine-solved diode current.",
|
|
475
|
+
category: "interactive",
|
|
476
|
+
schema: z.object({
|
|
477
|
+
title: z.string().optional(),
|
|
478
|
+
prompt: z.string().optional()
|
|
479
|
+
}),
|
|
480
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
481
|
+
const widget = /* @__PURE__ */ jsx(PnJunctionLab, {
|
|
482
|
+
title: attributes.title,
|
|
483
|
+
prompt: attributes.prompt
|
|
484
|
+
});
|
|
485
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
486
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(ConfigPanel, { children: /* @__PURE__ */ jsx(ConfigRow, {
|
|
487
|
+
label: "title",
|
|
488
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
489
|
+
value: attributes.title ?? "",
|
|
490
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
491
|
+
placeholder: "Inside the diode",
|
|
492
|
+
className: "flex-1"
|
|
493
|
+
})
|
|
494
|
+
}) }), widget] });
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
const BjtInsideBlock = defineBlock({
|
|
498
|
+
key: "bjt-inside",
|
|
499
|
+
tag: "BjtInside",
|
|
500
|
+
void: true,
|
|
501
|
+
label: "Inside the BJT (NPN / PNP)",
|
|
502
|
+
description: "Cross-section of a bipolar transistor: carriers stream emitter→thin base→collector, and a small base current controls a large collector current (β).",
|
|
503
|
+
category: "interactive",
|
|
504
|
+
schema: z.object({
|
|
505
|
+
pnp: z.boolean().default(false),
|
|
506
|
+
beta: z.number().default(100),
|
|
507
|
+
title: z.string().optional(),
|
|
508
|
+
prompt: z.string().optional()
|
|
509
|
+
}),
|
|
510
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
511
|
+
const widget = /* @__PURE__ */ jsx(BjtInsideLab, {
|
|
512
|
+
pnp: attributes.pnp,
|
|
513
|
+
beta: attributes.beta,
|
|
514
|
+
title: attributes.title,
|
|
515
|
+
prompt: attributes.prompt
|
|
516
|
+
});
|
|
517
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
518
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
520
|
+
label: "title",
|
|
521
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
522
|
+
value: attributes.title ?? "",
|
|
523
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
524
|
+
placeholder: "Inside the BJT",
|
|
525
|
+
className: "flex-1"
|
|
526
|
+
})
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ jsxs(ConfigRow, {
|
|
529
|
+
label: "type",
|
|
530
|
+
children: [/* @__PURE__ */ jsx(ChipToggle, {
|
|
531
|
+
active: !attributes.pnp,
|
|
532
|
+
onClick: () => updateAttributes({ pnp: false }),
|
|
533
|
+
children: "NPN"
|
|
534
|
+
}), /* @__PURE__ */ jsx(ChipToggle, {
|
|
535
|
+
active: !!attributes.pnp,
|
|
536
|
+
onClick: () => updateAttributes({ pnp: true }),
|
|
537
|
+
children: "PNP"
|
|
538
|
+
})]
|
|
539
|
+
}),
|
|
540
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
541
|
+
label: "gain β",
|
|
542
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
543
|
+
value: attributes.beta ?? 100,
|
|
544
|
+
onChange: (v) => updateAttributes({ beta: v })
|
|
545
|
+
})
|
|
546
|
+
})
|
|
547
|
+
] }), widget] });
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
const SiliconLatticeBlock = defineBlock({
|
|
551
|
+
key: "silicon-lattice",
|
|
552
|
+
tag: "SiliconLattice",
|
|
553
|
+
void: true,
|
|
554
|
+
label: "What is a semiconductor? (Si lattice + doping)",
|
|
555
|
+
description: "Silicon covalent lattice: switch between pure / n-type / p-type doping and raise temperature to free electron-hole pairs. The conceptual intro to diodes, MOSFETs and BJTs.",
|
|
556
|
+
category: "interactive",
|
|
557
|
+
schema: z.object({
|
|
558
|
+
mode: z.enum([
|
|
559
|
+
"intrinsic",
|
|
560
|
+
"n",
|
|
561
|
+
"p"
|
|
562
|
+
]).default("intrinsic"),
|
|
563
|
+
temperature: z.number().default(.2),
|
|
564
|
+
lockDoping: z.boolean().default(false),
|
|
565
|
+
showTemperature: z.boolean().default(true),
|
|
566
|
+
title: z.string().optional(),
|
|
567
|
+
prompt: z.string().optional()
|
|
568
|
+
}),
|
|
569
|
+
Component: ({ attributes, mode: editMode, updateAttributes }) => {
|
|
570
|
+
const widget = /* @__PURE__ */ jsx(SiliconLatticeLab, {
|
|
571
|
+
mode: attributes.mode,
|
|
572
|
+
temperature: attributes.temperature,
|
|
573
|
+
lockDoping: attributes.lockDoping,
|
|
574
|
+
showTemperature: attributes.showTemperature,
|
|
575
|
+
title: attributes.title,
|
|
576
|
+
prompt: attributes.prompt
|
|
577
|
+
});
|
|
578
|
+
if (editMode !== "editing" || !updateAttributes) return widget;
|
|
579
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
580
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
581
|
+
label: "title",
|
|
582
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
583
|
+
value: attributes.title ?? "",
|
|
584
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
585
|
+
placeholder: "What is a semiconductor?",
|
|
586
|
+
className: "flex-1"
|
|
587
|
+
})
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ jsxs(ConfigRow, {
|
|
590
|
+
label: "opens on",
|
|
591
|
+
children: [
|
|
592
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
593
|
+
active: (attributes.mode ?? "intrinsic") === "intrinsic",
|
|
594
|
+
onClick: () => updateAttributes({ mode: "intrinsic" }),
|
|
595
|
+
children: "pure"
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
598
|
+
active: attributes.mode === "n",
|
|
599
|
+
onClick: () => updateAttributes({ mode: "n" }),
|
|
600
|
+
children: "n-type"
|
|
601
|
+
}),
|
|
602
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
603
|
+
active: attributes.mode === "p",
|
|
604
|
+
onClick: () => updateAttributes({ mode: "p" }),
|
|
605
|
+
children: "p-type"
|
|
606
|
+
})
|
|
607
|
+
]
|
|
608
|
+
}),
|
|
609
|
+
/* @__PURE__ */ jsxs(ConfigRow, {
|
|
610
|
+
label: "focus on this doping (hide toggle)",
|
|
611
|
+
children: [/* @__PURE__ */ jsx(ChipToggle, {
|
|
612
|
+
active: !attributes.lockDoping,
|
|
613
|
+
onClick: () => updateAttributes({ lockDoping: false }),
|
|
614
|
+
children: "let learner switch"
|
|
615
|
+
}), /* @__PURE__ */ jsx(ChipToggle, {
|
|
616
|
+
active: !!attributes.lockDoping,
|
|
617
|
+
onClick: () => updateAttributes({ lockDoping: true }),
|
|
618
|
+
children: "lock"
|
|
619
|
+
})]
|
|
620
|
+
}),
|
|
621
|
+
/* @__PURE__ */ jsxs(ConfigRow, {
|
|
622
|
+
label: "temperature slider",
|
|
623
|
+
children: [/* @__PURE__ */ jsx(ChipToggle, {
|
|
624
|
+
active: attributes.showTemperature !== false,
|
|
625
|
+
onClick: () => updateAttributes({ showTemperature: true }),
|
|
626
|
+
children: "show"
|
|
627
|
+
}), /* @__PURE__ */ jsx(ChipToggle, {
|
|
628
|
+
active: attributes.showTemperature === false,
|
|
629
|
+
onClick: () => updateAttributes({ showTemperature: false }),
|
|
630
|
+
children: "hide"
|
|
631
|
+
})]
|
|
632
|
+
})
|
|
633
|
+
] }), widget] });
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
const ConductionBlock = defineBlock({
|
|
637
|
+
key: "conduction",
|
|
638
|
+
tag: "Conduction",
|
|
639
|
+
void: true,
|
|
640
|
+
label: "Why current flows (drift + Ohm's law)",
|
|
641
|
+
description: "Free electrons drift through a field among fixed ion cores: the field-driven drift IS the current, and current ∝ voltage is Ohm's law from the inside.",
|
|
642
|
+
category: "interactive",
|
|
643
|
+
schema: z.object({
|
|
644
|
+
title: z.string().optional(),
|
|
645
|
+
prompt: z.string().optional()
|
|
646
|
+
}),
|
|
647
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
648
|
+
const widget = /* @__PURE__ */ jsx(ConductionLab, {
|
|
649
|
+
title: attributes.title,
|
|
650
|
+
prompt: attributes.prompt
|
|
651
|
+
});
|
|
652
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
653
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(ConfigPanel, { children: /* @__PURE__ */ jsx(ConfigRow, {
|
|
654
|
+
label: "title",
|
|
655
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
656
|
+
value: attributes.title ?? "",
|
|
657
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
658
|
+
placeholder: "Why current flows",
|
|
659
|
+
className: "flex-1"
|
|
660
|
+
})
|
|
661
|
+
}) }), widget] });
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
const HallEffectBlock = defineBlock({
|
|
665
|
+
key: "hall-effect",
|
|
666
|
+
tag: "HallEffect",
|
|
667
|
+
void: true,
|
|
668
|
+
label: "The Hall effect (electrons vs holes)",
|
|
669
|
+
description: "A current in a magnetic field deflects carriers to one edge; the sign of the Hall voltage reveals whether they are electrons (n) or holes (p). How carrier type is measured.",
|
|
670
|
+
category: "interactive",
|
|
671
|
+
schema: z.object({
|
|
672
|
+
title: z.string().optional(),
|
|
673
|
+
prompt: z.string().optional()
|
|
674
|
+
}),
|
|
675
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
676
|
+
const widget = /* @__PURE__ */ jsx(HallEffectLab, {
|
|
677
|
+
title: attributes.title,
|
|
678
|
+
prompt: attributes.prompt
|
|
679
|
+
});
|
|
680
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
681
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(ConfigPanel, { children: /* @__PURE__ */ jsx(ConfigRow, {
|
|
682
|
+
label: "title",
|
|
683
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
684
|
+
value: attributes.title ?? "",
|
|
685
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
686
|
+
placeholder: "The Hall effect",
|
|
687
|
+
className: "flex-1"
|
|
688
|
+
})
|
|
689
|
+
}) }), widget] });
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
/** A "show" chooser shared by the labs that pair a schematic with a graph. */
|
|
693
|
+
function ShowRow({ value, onChange }) {
|
|
694
|
+
const v = value ?? "both";
|
|
695
|
+
return /* @__PURE__ */ jsxs(ConfigRow, {
|
|
696
|
+
label: "show",
|
|
697
|
+
children: [
|
|
698
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
699
|
+
active: v === "both",
|
|
700
|
+
onClick: () => onChange("both"),
|
|
701
|
+
children: "both"
|
|
702
|
+
}),
|
|
703
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
704
|
+
active: v === "circuit",
|
|
705
|
+
onClick: () => onChange("circuit"),
|
|
706
|
+
children: "schematic"
|
|
707
|
+
}),
|
|
708
|
+
/* @__PURE__ */ jsx(ChipToggle, {
|
|
709
|
+
active: v === "graph",
|
|
710
|
+
onClick: () => onChange("graph"),
|
|
711
|
+
children: "graph"
|
|
712
|
+
})
|
|
713
|
+
]
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
const RCChargingBlock = defineBlock({
|
|
717
|
+
key: "rc-charging",
|
|
718
|
+
tag: "RCCharging",
|
|
719
|
+
void: true,
|
|
720
|
+
label: "RC charging (fill the capacitor)",
|
|
721
|
+
description: "A capacitor fills through a resistor like a bucket through a pipe; the V(t) curve is the real Backward-Euler transient solve. Drag R and C to change τ = R·C, or flip to discharge.",
|
|
722
|
+
category: "interactive",
|
|
723
|
+
schema: z.object({
|
|
724
|
+
volts: z.number().optional(),
|
|
725
|
+
resistanceK: z.number().optional(),
|
|
726
|
+
capacitanceU: z.number().optional(),
|
|
727
|
+
show: z.enum([
|
|
728
|
+
"both",
|
|
729
|
+
"circuit",
|
|
730
|
+
"graph"
|
|
731
|
+
]).optional(),
|
|
732
|
+
title: z.string().optional(),
|
|
733
|
+
prompt: z.string().optional()
|
|
734
|
+
}),
|
|
735
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
736
|
+
const widget = /* @__PURE__ */ jsx(RCChargingLab, {
|
|
737
|
+
volts: attributes.volts,
|
|
738
|
+
resistanceK: attributes.resistanceK,
|
|
739
|
+
capacitanceU: attributes.capacitanceU,
|
|
740
|
+
show: attributes.show,
|
|
741
|
+
title: attributes.title,
|
|
742
|
+
prompt: attributes.prompt
|
|
743
|
+
});
|
|
744
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
745
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
746
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
747
|
+
label: "title",
|
|
748
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
749
|
+
value: attributes.title ?? "",
|
|
750
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
751
|
+
placeholder: "RC charging",
|
|
752
|
+
className: "flex-1"
|
|
753
|
+
})
|
|
754
|
+
}),
|
|
755
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
756
|
+
label: "supply (V)",
|
|
757
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
758
|
+
value: attributes.volts ?? 5,
|
|
759
|
+
onChange: (v) => updateAttributes({ volts: v })
|
|
760
|
+
})
|
|
761
|
+
}),
|
|
762
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
763
|
+
label: "R (kΩ)",
|
|
764
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
765
|
+
value: attributes.resistanceK ?? 10,
|
|
766
|
+
onChange: (v) => updateAttributes({ resistanceK: v })
|
|
767
|
+
})
|
|
768
|
+
}),
|
|
769
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
770
|
+
label: "C (µF)",
|
|
771
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
772
|
+
value: attributes.capacitanceU ?? 10,
|
|
773
|
+
onChange: (v) => updateAttributes({ capacitanceU: v })
|
|
774
|
+
})
|
|
775
|
+
}),
|
|
776
|
+
/* @__PURE__ */ jsx(ShowRow, {
|
|
777
|
+
value: attributes.show,
|
|
778
|
+
onChange: (v) => updateAttributes({ show: v })
|
|
779
|
+
})
|
|
780
|
+
] }), widget] });
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
const DiodeBlock = defineBlock({
|
|
784
|
+
key: "diode",
|
|
785
|
+
tag: "Diode",
|
|
786
|
+
void: true,
|
|
787
|
+
label: "Diode: a one-way valve",
|
|
788
|
+
description: "Drive a diode through a resistor. Forward, past the ~0.6 V knee, the valve opens; reverse it and it blocks. The operating point is the real nonlinear (Shockley) solve. Flip orientation and predict.",
|
|
789
|
+
category: "interactive",
|
|
790
|
+
schema: z.object({
|
|
791
|
+
volts: z.number().optional(),
|
|
792
|
+
resistanceK: z.number().optional(),
|
|
793
|
+
show: z.enum([
|
|
794
|
+
"both",
|
|
795
|
+
"circuit",
|
|
796
|
+
"graph"
|
|
797
|
+
]).optional(),
|
|
798
|
+
title: z.string().optional(),
|
|
799
|
+
prompt: z.string().optional()
|
|
800
|
+
}),
|
|
801
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
802
|
+
const widget = /* @__PURE__ */ jsx(DiodeLab, {
|
|
803
|
+
volts: attributes.volts,
|
|
804
|
+
resistanceK: attributes.resistanceK,
|
|
805
|
+
show: attributes.show,
|
|
806
|
+
title: attributes.title,
|
|
807
|
+
prompt: attributes.prompt
|
|
808
|
+
});
|
|
809
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
810
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
811
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
812
|
+
label: "title",
|
|
813
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
814
|
+
value: attributes.title ?? "",
|
|
815
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
816
|
+
placeholder: "The diode",
|
|
817
|
+
className: "flex-1"
|
|
818
|
+
})
|
|
819
|
+
}),
|
|
820
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
821
|
+
label: "battery (V)",
|
|
822
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
823
|
+
value: attributes.volts ?? 2,
|
|
824
|
+
onChange: (v) => updateAttributes({ volts: v })
|
|
825
|
+
})
|
|
826
|
+
}),
|
|
827
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
828
|
+
label: "R (kΩ)",
|
|
829
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
830
|
+
value: attributes.resistanceK ?? 1,
|
|
831
|
+
onChange: (v) => updateAttributes({ resistanceK: v })
|
|
832
|
+
})
|
|
833
|
+
}),
|
|
834
|
+
/* @__PURE__ */ jsx(ShowRow, {
|
|
835
|
+
value: attributes.show,
|
|
836
|
+
onChange: (v) => updateAttributes({ show: v })
|
|
837
|
+
})
|
|
838
|
+
] }), widget] });
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
const TransistorBlock = defineBlock({
|
|
842
|
+
key: "transistor",
|
|
843
|
+
tag: "Transistor",
|
|
844
|
+
void: true,
|
|
845
|
+
label: "Transistor: a small input controls a big current",
|
|
846
|
+
description: "Turn the gate voltage of an NMOS: below threshold the channel is shut, past it the gate steers a much larger drain current up the square-law transfer curve. The switch (and amplifier) at the heart of every chip.",
|
|
847
|
+
category: "interactive",
|
|
848
|
+
schema: z.object({
|
|
849
|
+
supply: z.number().optional(),
|
|
850
|
+
vth: z.number().optional(),
|
|
851
|
+
loadK: z.number().optional(),
|
|
852
|
+
show: z.enum([
|
|
853
|
+
"both",
|
|
854
|
+
"circuit",
|
|
855
|
+
"graph"
|
|
856
|
+
]).optional(),
|
|
857
|
+
title: z.string().optional(),
|
|
858
|
+
prompt: z.string().optional()
|
|
859
|
+
}),
|
|
860
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
861
|
+
const widget = /* @__PURE__ */ jsx(TransistorLab, {
|
|
862
|
+
supply: attributes.supply,
|
|
863
|
+
vth: attributes.vth,
|
|
864
|
+
loadK: attributes.loadK,
|
|
865
|
+
show: attributes.show,
|
|
866
|
+
title: attributes.title,
|
|
867
|
+
prompt: attributes.prompt
|
|
868
|
+
});
|
|
869
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
870
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
871
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
872
|
+
label: "title",
|
|
873
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
874
|
+
value: attributes.title ?? "",
|
|
875
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
876
|
+
placeholder: "The transistor",
|
|
877
|
+
className: "flex-1"
|
|
878
|
+
})
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
881
|
+
label: "supply (V)",
|
|
882
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
883
|
+
value: attributes.supply ?? 5,
|
|
884
|
+
onChange: (v) => updateAttributes({ supply: v })
|
|
885
|
+
})
|
|
886
|
+
}),
|
|
887
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
888
|
+
label: "threshold Vth (V)",
|
|
889
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
890
|
+
value: attributes.vth ?? 2,
|
|
891
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
892
|
+
})
|
|
893
|
+
}),
|
|
894
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
895
|
+
label: "load R (kΩ)",
|
|
896
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
897
|
+
value: attributes.loadK ?? 1,
|
|
898
|
+
onChange: (v) => updateAttributes({ loadK: v })
|
|
899
|
+
})
|
|
900
|
+
}),
|
|
901
|
+
/* @__PURE__ */ jsx(ShowRow, {
|
|
902
|
+
value: attributes.show,
|
|
903
|
+
onChange: (v) => updateAttributes({ show: v })
|
|
904
|
+
})
|
|
905
|
+
] }), widget] });
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
const RNmosNotBlock = defineBlock({
|
|
909
|
+
key: "rnmos-not",
|
|
910
|
+
tag: "RNmosNot",
|
|
911
|
+
void: true,
|
|
912
|
+
label: "NOT from one transistor (+ pull-up)",
|
|
913
|
+
description: "One NMOS and a pull-up resistor already invert: HIGH pulls the output to ground, LOW lets the resistor pull it up. Engine-solved. It also shows the static-power \"catch\" that motivated CMOS.",
|
|
914
|
+
category: "interactive",
|
|
915
|
+
schema: z.object({
|
|
916
|
+
vdd: z.number().optional(),
|
|
917
|
+
vth: z.number().optional(),
|
|
918
|
+
rpull: z.number().optional(),
|
|
919
|
+
title: z.string().optional(),
|
|
920
|
+
prompt: z.string().optional()
|
|
921
|
+
}),
|
|
922
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
923
|
+
const widget = /* @__PURE__ */ jsx(RNmosNotLab, {
|
|
924
|
+
vdd: attributes.vdd,
|
|
925
|
+
vth: attributes.vth,
|
|
926
|
+
rpull: attributes.rpull,
|
|
927
|
+
title: attributes.title,
|
|
928
|
+
prompt: attributes.prompt
|
|
929
|
+
});
|
|
930
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
931
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
932
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
933
|
+
label: "title",
|
|
934
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
935
|
+
value: attributes.title ?? "",
|
|
936
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
937
|
+
placeholder: "A NOT gate from one transistor",
|
|
938
|
+
className: "flex-1"
|
|
939
|
+
})
|
|
940
|
+
}),
|
|
941
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
942
|
+
label: "VDD (V)",
|
|
943
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
944
|
+
value: attributes.vdd ?? 5,
|
|
945
|
+
onChange: (v) => updateAttributes({ vdd: v })
|
|
946
|
+
})
|
|
947
|
+
}),
|
|
948
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
949
|
+
label: "threshold Vth (V)",
|
|
950
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
951
|
+
value: attributes.vth ?? 2,
|
|
952
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
953
|
+
})
|
|
954
|
+
}),
|
|
955
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
956
|
+
label: "pull-up R (Ω)",
|
|
957
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
958
|
+
value: attributes.rpull ?? 2e3,
|
|
959
|
+
onChange: (v) => updateAttributes({ rpull: v })
|
|
960
|
+
})
|
|
961
|
+
})
|
|
962
|
+
] }), widget] });
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
const CmosInverterBlock = defineBlock({
|
|
966
|
+
key: "cmos-inverter",
|
|
967
|
+
tag: "CmosInverter",
|
|
968
|
+
void: true,
|
|
969
|
+
label: "CMOS inverter (NOT gate)",
|
|
970
|
+
description: "A PMOS pull-up and an NMOS pull-down share one input and output: low in → high out, high in → low out. The output voltage is engine-solved, so the transfer curve shows the real sharp transition near VDD/2.",
|
|
971
|
+
category: "interactive",
|
|
972
|
+
schema: z.object({
|
|
973
|
+
vdd: z.number().optional(),
|
|
974
|
+
vth: z.number().optional(),
|
|
975
|
+
show: z.enum([
|
|
976
|
+
"both",
|
|
977
|
+
"circuit",
|
|
978
|
+
"graph"
|
|
979
|
+
]).optional(),
|
|
980
|
+
title: z.string().optional(),
|
|
981
|
+
prompt: z.string().optional()
|
|
982
|
+
}),
|
|
983
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
984
|
+
const widget = /* @__PURE__ */ jsx(CmosInverterLab, {
|
|
985
|
+
vdd: attributes.vdd,
|
|
986
|
+
vth: attributes.vth,
|
|
987
|
+
show: attributes.show,
|
|
988
|
+
title: attributes.title,
|
|
989
|
+
prompt: attributes.prompt
|
|
990
|
+
});
|
|
991
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
992
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
993
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
994
|
+
label: "title",
|
|
995
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
996
|
+
value: attributes.title ?? "",
|
|
997
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
998
|
+
placeholder: "CMOS inverter",
|
|
999
|
+
className: "flex-1"
|
|
1000
|
+
})
|
|
1001
|
+
}),
|
|
1002
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1003
|
+
label: "VDD (V)",
|
|
1004
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1005
|
+
value: attributes.vdd ?? 5,
|
|
1006
|
+
onChange: (v) => updateAttributes({ vdd: v })
|
|
1007
|
+
})
|
|
1008
|
+
}),
|
|
1009
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1010
|
+
label: "threshold Vth (V)",
|
|
1011
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1012
|
+
value: attributes.vth ?? 2,
|
|
1013
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
1014
|
+
})
|
|
1015
|
+
}),
|
|
1016
|
+
/* @__PURE__ */ jsx(ShowRow, {
|
|
1017
|
+
value: attributes.show,
|
|
1018
|
+
onChange: (v) => updateAttributes({ show: v })
|
|
1019
|
+
})
|
|
1020
|
+
] }), widget] });
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
const CmosNandBlock = defineBlock({
|
|
1024
|
+
key: "cmos-nand",
|
|
1025
|
+
tag: "CmosNand",
|
|
1026
|
+
void: true,
|
|
1027
|
+
label: "CMOS NAND (the universal gate)",
|
|
1028
|
+
description: "Four transistors: a parallel PMOS pull-up and a series NMOS pull-down make Y = (A·B)′, solved for all four inputs. NAND alone is universal, so this is the brick every gate and CPU is built from.",
|
|
1029
|
+
category: "interactive",
|
|
1030
|
+
schema: z.object({
|
|
1031
|
+
vdd: z.number().optional(),
|
|
1032
|
+
vth: z.number().optional(),
|
|
1033
|
+
title: z.string().optional(),
|
|
1034
|
+
prompt: z.string().optional()
|
|
1035
|
+
}),
|
|
1036
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
1037
|
+
const widget = /* @__PURE__ */ jsx(CmosNandLab, {
|
|
1038
|
+
vdd: attributes.vdd,
|
|
1039
|
+
vth: attributes.vth,
|
|
1040
|
+
title: attributes.title,
|
|
1041
|
+
prompt: attributes.prompt
|
|
1042
|
+
});
|
|
1043
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
1044
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
1045
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1046
|
+
label: "title",
|
|
1047
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
1048
|
+
value: attributes.title ?? "",
|
|
1049
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
1050
|
+
placeholder: "CMOS NAND",
|
|
1051
|
+
className: "flex-1"
|
|
1052
|
+
})
|
|
1053
|
+
}),
|
|
1054
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1055
|
+
label: "VDD (V)",
|
|
1056
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1057
|
+
value: attributes.vdd ?? 5,
|
|
1058
|
+
onChange: (v) => updateAttributes({ vdd: v })
|
|
1059
|
+
})
|
|
1060
|
+
}),
|
|
1061
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1062
|
+
label: "threshold Vth (V)",
|
|
1063
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1064
|
+
value: attributes.vth ?? 2,
|
|
1065
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
1066
|
+
})
|
|
1067
|
+
})
|
|
1068
|
+
] }), widget] });
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
const CmosNorBlock = defineBlock({
|
|
1072
|
+
key: "cmos-nor",
|
|
1073
|
+
tag: "CmosNor",
|
|
1074
|
+
void: true,
|
|
1075
|
+
label: "CMOS NOR (the De Morgan twin)",
|
|
1076
|
+
description: "The NAND with each network swapped: series PMOS pull-up, parallel NMOS pull-down, giving Y = (A+B)′. NOR is the other universal gate, so series-vs-parallel is AND-logic-vs-OR-logic in silicon.",
|
|
1077
|
+
category: "interactive",
|
|
1078
|
+
schema: z.object({
|
|
1079
|
+
vdd: z.number().optional(),
|
|
1080
|
+
vth: z.number().optional(),
|
|
1081
|
+
title: z.string().optional(),
|
|
1082
|
+
prompt: z.string().optional()
|
|
1083
|
+
}),
|
|
1084
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
1085
|
+
const widget = /* @__PURE__ */ jsx(CmosNorLab, {
|
|
1086
|
+
vdd: attributes.vdd,
|
|
1087
|
+
vth: attributes.vth,
|
|
1088
|
+
title: attributes.title,
|
|
1089
|
+
prompt: attributes.prompt
|
|
1090
|
+
});
|
|
1091
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
1092
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
1093
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1094
|
+
label: "title",
|
|
1095
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
1096
|
+
value: attributes.title ?? "",
|
|
1097
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
1098
|
+
placeholder: "CMOS NOR",
|
|
1099
|
+
className: "flex-1"
|
|
1100
|
+
})
|
|
1101
|
+
}),
|
|
1102
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1103
|
+
label: "VDD (V)",
|
|
1104
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1105
|
+
value: attributes.vdd ?? 5,
|
|
1106
|
+
onChange: (v) => updateAttributes({ vdd: v })
|
|
1107
|
+
})
|
|
1108
|
+
}),
|
|
1109
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1110
|
+
label: "threshold Vth (V)",
|
|
1111
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1112
|
+
value: attributes.vth ?? 2,
|
|
1113
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
1114
|
+
})
|
|
1115
|
+
})
|
|
1116
|
+
] }), widget] });
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
const BrownoutBlock = defineBlock({
|
|
1120
|
+
key: "brownout",
|
|
1121
|
+
tag: "Brownout",
|
|
1122
|
+
void: true,
|
|
1123
|
+
label: "Brown-out (supply too low → logic invalid)",
|
|
1124
|
+
description: "Drag the battery EMF down and the CMOS gate stops working: as VDD falls toward the transistor threshold the output loses its swing and drifts to mid-rail. Connects EMF and supply voltage to whether logic works at all.",
|
|
1125
|
+
category: "interactive",
|
|
1126
|
+
schema: z.object({
|
|
1127
|
+
vth: z.number().optional(),
|
|
1128
|
+
vmax: z.number().optional(),
|
|
1129
|
+
title: z.string().optional(),
|
|
1130
|
+
prompt: z.string().optional()
|
|
1131
|
+
}),
|
|
1132
|
+
Component: ({ attributes, mode, updateAttributes }) => {
|
|
1133
|
+
const widget = /* @__PURE__ */ jsx(BrownoutLab, {
|
|
1134
|
+
vth: attributes.vth,
|
|
1135
|
+
vmax: attributes.vmax,
|
|
1136
|
+
title: attributes.title,
|
|
1137
|
+
prompt: attributes.prompt
|
|
1138
|
+
});
|
|
1139
|
+
if (mode !== "editing" || !updateAttributes) return widget;
|
|
1140
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(ConfigPanel, { children: [
|
|
1141
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1142
|
+
label: "title",
|
|
1143
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
1144
|
+
value: attributes.title ?? "",
|
|
1145
|
+
onChange: (v) => updateAttributes({ title: v }),
|
|
1146
|
+
placeholder: "Brown-out",
|
|
1147
|
+
className: "flex-1"
|
|
1148
|
+
})
|
|
1149
|
+
}),
|
|
1150
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1151
|
+
label: "threshold Vth (V)",
|
|
1152
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1153
|
+
value: attributes.vth ?? 2,
|
|
1154
|
+
onChange: (v) => updateAttributes({ vth: v })
|
|
1155
|
+
})
|
|
1156
|
+
}),
|
|
1157
|
+
/* @__PURE__ */ jsx(ConfigRow, {
|
|
1158
|
+
label: "max supply (V)",
|
|
1159
|
+
children: /* @__PURE__ */ jsx(NumField, {
|
|
1160
|
+
value: attributes.vmax ?? 6,
|
|
1161
|
+
onChange: (v) => updateAttributes({ vmax: v })
|
|
1162
|
+
})
|
|
1163
|
+
})
|
|
1164
|
+
] }), widget] });
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
/** All circuits lab blocks, spread into the registry in `./index.ts`. */
|
|
333
1168
|
const circuitsBlocks = [
|
|
334
1169
|
CircuitLabBlock,
|
|
335
1170
|
CircuitBuilderBlock,
|
|
1171
|
+
CircuitSceneBlock,
|
|
336
1172
|
CircuitBlock,
|
|
337
|
-
|
|
1173
|
+
SiliconLatticeBlock,
|
|
1174
|
+
ConductionBlock,
|
|
1175
|
+
HallEffectBlock,
|
|
1176
|
+
PnJunctionBlock,
|
|
1177
|
+
MosfetInsideBlock,
|
|
1178
|
+
BjtInsideBlock,
|
|
1179
|
+
CapacitorLeakBlock,
|
|
1180
|
+
RCChargingBlock,
|
|
1181
|
+
DiodeBlock,
|
|
1182
|
+
TransistorBlock,
|
|
1183
|
+
RNmosNotBlock,
|
|
1184
|
+
CmosInverterBlock,
|
|
1185
|
+
CmosNandBlock,
|
|
1186
|
+
CmosNorBlock,
|
|
1187
|
+
BrownoutBlock
|
|
338
1188
|
];
|
|
339
1189
|
/** MDX tag → component render map slice for the circuits domain. */
|
|
340
1190
|
const circuitsComponents = {
|
|
341
1191
|
CapacitorLeak: CapacitorLeakLab,
|
|
342
1192
|
Circuit: CircuitPuzzle,
|
|
343
1193
|
CircuitBuilder,
|
|
344
|
-
CircuitLab
|
|
1194
|
+
CircuitLab,
|
|
1195
|
+
CircuitScene: CircuitSceneView,
|
|
1196
|
+
MosfetInside: MosfetInsideLab,
|
|
1197
|
+
PnJunction: PnJunctionLab,
|
|
1198
|
+
BjtInside: BjtInsideLab,
|
|
1199
|
+
SiliconLattice: SiliconLatticeLab,
|
|
1200
|
+
Conduction: ConductionLab,
|
|
1201
|
+
HallEffect: HallEffectLab,
|
|
1202
|
+
RCCharging: RCChargingLab,
|
|
1203
|
+
Diode: DiodeLab,
|
|
1204
|
+
Transistor: TransistorLab,
|
|
1205
|
+
RNmosNot: RNmosNotLab,
|
|
1206
|
+
CmosInverter: CmosInverterLab,
|
|
1207
|
+
CmosNand: CmosNandLab,
|
|
1208
|
+
CmosNor: CmosNorLab,
|
|
1209
|
+
Brownout: BrownoutLab
|
|
345
1210
|
};
|
|
346
1211
|
|
|
347
1212
|
//#endregion
|
|
348
|
-
export { CapacitorLeakBlock, CircuitBlock, CircuitBuilderBlock, CircuitLabBlock, CircuitPuzzle, circuitsBlocks, circuitsComponents };
|
|
1213
|
+
export { BjtInsideBlock, BrownoutBlock, CapacitorLeakBlock, CircuitBlock, CircuitBuilderBlock, CircuitLabBlock, CircuitPuzzle, CircuitSceneBlock, CircuitSceneView, CmosInverterBlock, CmosNandBlock, CmosNorBlock, ConductionBlock, DiodeBlock, HallEffectBlock, MosfetInsideBlock, PnJunctionBlock, RCChargingBlock, RNmosNotBlock, SiliconLatticeBlock, TransistorBlock, circuitsBlocks, circuitsComponents };
|