@nakafa/aksara-contracts 8.13.0 → 8.15.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/assessment/document.d.ts +15 -2
- package/dist/assessment/document.js +12 -3
- package/dist/visual/biology/flower.d.ts +276 -0
- package/dist/visual/biology/flower.js +76 -0
- package/dist/visual/biology/homeostasis.d.ts +284 -0
- package/dist/visual/biology/homeostasis.js +101 -0
- package/dist/visual/biology/membrane.d.ts +421 -0
- package/dist/visual/biology/membrane.js +129 -0
- package/dist/visual/biology/mendelian.d.ts +410 -0
- package/dist/visual/biology/mendelian.js +107 -0
- package/dist/visual/biology/neuron.d.ts +136 -1
- package/dist/visual/biology/neuron.js +41 -2
- package/dist/visual/biology/nutrition.d.ts +410 -0
- package/dist/visual/biology/nutrition.js +112 -0
- package/dist/visual/biology/phytohormone.d.ts +275 -0
- package/dist/visual/biology/phytohormone.js +75 -0
- package/dist/visual/biology/variation.d.ts +421 -0
- package/dist/visual/biology/variation.js +123 -0
- package/dist/visual/biology/vascular.d.ts +425 -0
- package/dist/visual/biology/vascular.js +107 -0
- package/dist/visual/biology.d.ts +2169 -0
- package/dist/visual/biology.js +12 -0
- package/dist/visual/catalog.d.ts +7460 -3208
- package/dist/visual/catalog.js +6 -0
- package/dist/visual/chemistry/rate.d.ts +280 -1
- package/dist/visual/chemistry/rate.js +81 -3
- package/dist/visual/physics/electronics.d.ts +163 -24
- package/dist/visual/physics/electronics.js +50 -5
- package/dist/visual/physics/gravity.d.ts +139 -4
- package/dist/visual/physics/gravity.js +46 -4
- package/dist/visual/physics/heat.d.ts +307 -12
- package/dist/visual/physics/heat.js +84 -5
- package/dist/visual/physics/nuclear.d.ts +150 -13
- package/dist/visual/physics/nuclear.js +44 -5
- package/dist/visual/physics/quantum.d.ts +282 -0
- package/dist/visual/physics/quantum.js +87 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/** A strictly positive finite setting for quantum physics sliders. */
|
|
5
|
+
const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
|
|
6
|
+
/** A strictly positive slider whose minimum sits below its maximum. */
|
|
7
|
+
const PositiveSliderSchema = Schema.Struct({
|
|
8
|
+
max: PositiveSchema,
|
|
9
|
+
min: PositiveSchema,
|
|
10
|
+
value: PositiveSchema,
|
|
11
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
12
|
+
message: "Expected a positive slider range whose minimum is below its maximum, with the starting value between them.",
|
|
13
|
+
}));
|
|
14
|
+
const PARTICLES = ["electron", "proton", "neutron", "alpha"];
|
|
15
|
+
const RADIATION_MODELS = ["planck", "classical"];
|
|
16
|
+
/**
|
|
17
|
+
* Props of `DeBroglieMatterWaveLab`: a 3D electron-diffraction tube and
|
|
18
|
+
* standing matter-wave view linking accelerating voltage and particle mass to
|
|
19
|
+
* de Broglie wavelength and diffraction ring spacing. Wavelength and
|
|
20
|
+
* diffraction readouts are optional answer state.
|
|
21
|
+
*/
|
|
22
|
+
function deBroglieMatterWaveLab(rich) {
|
|
23
|
+
return figure(Schema.Struct({
|
|
24
|
+
...cardFields(rich),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
diffraction: Schema.optionalKey(rich),
|
|
27
|
+
momentum: rich,
|
|
28
|
+
particle: TextSchema,
|
|
29
|
+
particles: byPickedIds(PARTICLES, TextSchema),
|
|
30
|
+
parts: byIds([
|
|
31
|
+
"electronGun",
|
|
32
|
+
"graphiteTarget",
|
|
33
|
+
"matterWave",
|
|
34
|
+
"diffractionRings",
|
|
35
|
+
"screen",
|
|
36
|
+
], TextSchema),
|
|
37
|
+
view: TextSchema,
|
|
38
|
+
voltage: TextSchema,
|
|
39
|
+
wavelength: Schema.optionalKey(rich),
|
|
40
|
+
}),
|
|
41
|
+
particles: Schema.NonEmptyArray(Schema.Literals(PARTICLES)).check(Schema.isUnique()),
|
|
42
|
+
voltage: PositiveSliderSchema,
|
|
43
|
+
}).check(Schema.makeFilter(({ labels, particles }) => namesEach(particles, labels.particles), {
|
|
44
|
+
message: "Expected a name for every particle shown in the matter-wave lab, and no other.",
|
|
45
|
+
})), answerAt(["labels", "diffraction"], ["labels", "wavelength"]));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props of `PlanckBlackbodyLab`: a 3D heated cavity radiator synchronized with
|
|
49
|
+
* Planck's quantized blackbody spectrum and the classical Rayleigh-Jeans curve
|
|
50
|
+
* across Kelvin temperature. Peak wavelength and photon energy readouts are
|
|
51
|
+
* optional answer state.
|
|
52
|
+
*/
|
|
53
|
+
function planckBlackbodyLab(rich) {
|
|
54
|
+
return figure(Schema.Struct({
|
|
55
|
+
...cardFields(rich),
|
|
56
|
+
labels: Schema.Struct({
|
|
57
|
+
model: TextSchema,
|
|
58
|
+
models: byPickedIds(RADIATION_MODELS, TextSchema),
|
|
59
|
+
parts: byIds([
|
|
60
|
+
"cavity",
|
|
61
|
+
"planckCurve",
|
|
62
|
+
"classicalCurve",
|
|
63
|
+
"visibleBand",
|
|
64
|
+
"peakMarker",
|
|
65
|
+
], TextSchema),
|
|
66
|
+
peakWavelength: Schema.optionalKey(rich),
|
|
67
|
+
photonEnergy: Schema.optionalKey(rich),
|
|
68
|
+
spectrum: rich,
|
|
69
|
+
temperature: TextSchema,
|
|
70
|
+
view: TextSchema,
|
|
71
|
+
}),
|
|
72
|
+
models: Schema.NonEmptyArray(Schema.Literals(RADIATION_MODELS)).check(Schema.isUnique()),
|
|
73
|
+
temperature: PositiveSliderSchema,
|
|
74
|
+
}).check(Schema.makeFilter(({ labels, models }) => namesEach(models, labels.models), {
|
|
75
|
+
message: "Expected a name for every radiation model shown, and no other.",
|
|
76
|
+
})), answerAt(["labels", "peakWavelength"], ["labels", "photonEnergy"]));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Quantum physics labs covering de Broglie matter-wave diffraction and
|
|
80
|
+
* Planck blackbody quantization.
|
|
81
|
+
*/
|
|
82
|
+
export function quantumVisuals(rich) {
|
|
83
|
+
return {
|
|
84
|
+
DeBroglieMatterWaveLab: deBroglieMatterWaveLab(rich),
|
|
85
|
+
PlanckBlackbodyLab: planckBlackbodyLab(rich),
|
|
86
|
+
};
|
|
87
|
+
}
|
package/package.json
CHANGED