@nakafa/aksara-contracts 7.0.0 → 8.0.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/figure.d.ts +24 -48725
- package/dist/assessment/figure.js +10 -6
- package/dist/visual/base/layout.d.ts +6 -6
- package/dist/visual/base/math.d.ts +4 -4
- package/dist/visual/base/media.d.ts +2 -2
- package/dist/visual/biology/bacteria.d.ts +55 -0
- package/dist/visual/biology/bacteria.js +79 -0
- package/dist/visual/biology/cell.d.ts +89 -0
- package/dist/visual/biology/cell.js +95 -0
- package/dist/visual/biology/climate.d.ts +75 -0
- package/dist/visual/biology/climate.js +94 -0
- package/dist/visual/biology/ecology.d.ts +75 -0
- package/dist/visual/biology/ecology.js +94 -0
- package/dist/visual/biology.d.ts +9 -9
- package/dist/visual/card.d.ts +0 -2
- package/dist/visual/card.js +0 -6
- package/dist/visual/catalog.d.ts +1610 -27079
- package/dist/visual/catalog.js +47 -1
- package/dist/visual/chemistry/atom.d.ts +4 -4
- package/dist/visual/chemistry/balance.d.ts +79 -0
- package/dist/visual/chemistry/balance.js +128 -0
- package/dist/visual/chemistry/bonding.d.ts +80 -0
- package/dist/visual/chemistry/bonding.js +147 -0
- package/dist/visual/chemistry/discovery.d.ts +96 -0
- package/dist/visual/chemistry/discovery.js +137 -0
- package/dist/visual/chemistry/electron.d.ts +2 -2
- package/dist/visual/chemistry/laws.d.ts +4 -4
- package/dist/visual/chemistry/particles.d.ts +5 -5
- package/dist/visual/chemistry/periodic.d.ts +2 -2
- package/dist/visual/chemistry/reaction.d.ts +3 -3
- package/dist/visual/entry.d.ts +4 -4
- package/dist/visual/mathematics/chart.d.ts +1 -1
- package/dist/visual/mathematics/charts.d.ts +5 -5
- package/dist/visual/mathematics/function.d.ts +7 -7
- package/dist/visual/mathematics/geometry.d.ts +4 -213
- package/dist/visual/mathematics/geometry.js +3 -65
- package/dist/visual/physics/braking.d.ts +62 -0
- package/dist/visual/physics/braking.js +83 -0
- package/dist/visual/physics/circular.d.ts +36 -0
- package/dist/visual/physics/circular.js +51 -0
- package/dist/visual/physics/efficiency.d.ts +93 -0
- package/dist/visual/physics/efficiency.js +129 -0
- package/dist/visual/physics/falling.d.ts +56 -0
- package/dist/visual/physics/falling.js +77 -0
- package/dist/visual/physics/force.d.ts +88 -0
- package/dist/visual/physics/force.js +115 -0
- package/dist/visual/physics/instrument.d.ts +93 -0
- package/dist/visual/physics/instrument.js +135 -0
- package/dist/visual/physics/measurement.d.ts +4 -4
- package/dist/visual/physics/motion.d.ts +6 -6
- package/dist/visual/physics/parabolic.d.ts +2 -2
- package/dist/visual/physics/position.d.ts +87 -0
- package/dist/visual/physics/position.js +123 -0
- package/dist/visual/physics/power.d.ts +121 -0
- package/dist/visual/physics/power.js +162 -0
- package/dist/visual/physics/precision.d.ts +96 -0
- package/dist/visual/physics/precision.js +137 -0
- package/dist/visual/physics/product.d.ts +73 -0
- package/dist/visual/physics/product.js +96 -0
- package/dist/visual/physics/record.d.ts +34 -0
- package/dist/visual/physics/record.js +46 -0
- package/dist/visual/physics/relative.d.ts +55 -0
- package/dist/visual/physics/relative.js +76 -0
- package/dist/visual/physics/solar.d.ts +91 -0
- package/dist/visual/physics/solar.js +126 -0
- package/dist/visual/physics/vector.d.ts +103 -0
- package/dist/visual/physics/vector.js +123 -0
- package/dist/visual/physics/velocity.d.ts +7 -7
- package/dist/visual/politics.d.ts +8 -8
- package/package.json +1 -1
- package/dist/visual/mathematics/line.d.ts +0 -179
- package/dist/visual/mathematics/line.js +0 -156
- package/dist/visual/mathematics/number.d.ts +0 -21
- package/dist/visual/mathematics/number.js +0 -53
|
@@ -1,63 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import { cardFields, TripleSchema, } from "#contracts/visual/card";
|
|
4
|
-
import { answerAt, figure } from "#contracts/visual/entry";
|
|
5
|
-
import { sceneLine } from "#contracts/visual/mathematics/line";
|
|
6
|
-
import { numberLine } from "#contracts/visual/mathematics/number";
|
|
7
|
-
/**
|
|
8
|
-
* Where the `LineEquation` card puts the camera when `cameraPosition` is left
|
|
9
|
-
* out: `DEFAULT_CAMERA_POSITION_X`, `_Y`, and `_Z` in
|
|
10
|
-
* `components/contents/mathematics/line/equation.tsx` of Nakafa's design system
|
|
11
|
-
* (read on 13 October 2026).
|
|
12
|
-
*/
|
|
13
|
-
const DEFAULT_CAMERA_POSITION = [10, 6, 10];
|
|
14
|
-
/**
|
|
15
|
-
* Where the scene looks when `cameraTarget` is left out: the origin, as
|
|
16
|
-
* `DEFAULT_CAMERA_TARGET` in `components/three/camera-controls.tsx` of the
|
|
17
|
-
* same package says (read on 13 October 2026).
|
|
18
|
-
*/
|
|
19
|
-
const DEFAULT_CAMERA_TARGET = [0, 0, 0];
|
|
20
|
-
/** The camera of a scene: where it sits and where it looks, each optional. */
|
|
21
|
-
const CameraPoseSchema = Schema.Struct({
|
|
22
|
-
cameraPosition: Schema.optionalKey(TripleSchema),
|
|
23
|
-
cameraTarget: Schema.optionalKey(TripleSchema),
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Checks that the camera sits away from the point it looks at, with the
|
|
27
|
-
* renderer's defaults for a pose that is left out. A camera on its target has
|
|
28
|
-
* no direction to look in, and the renderer measures its zoom and its distance
|
|
29
|
-
* limits from that distance, which is then zero.
|
|
30
|
-
*/
|
|
31
|
-
function hasCameraDistance({ cameraPosition = DEFAULT_CAMERA_POSITION, cameraTarget = DEFAULT_CAMERA_TARGET, }) {
|
|
32
|
-
const [x, y, z] = cameraPosition;
|
|
33
|
-
const [targetX, targetY, targetZ] = cameraTarget;
|
|
34
|
-
return x !== targetX || y !== targetY || z !== targetZ;
|
|
35
|
-
}
|
|
36
|
-
/** Props of `LineEquation`: lines, curves, and circle parts in three dimensions. */
|
|
37
|
-
function lineEquation(rich) {
|
|
38
|
-
return figure(Schema.Struct({
|
|
39
|
-
...cardFields(rich),
|
|
40
|
-
...CameraPoseSchema.fields,
|
|
41
|
-
data: Schema.NonEmptyArray(sceneLine(rich)),
|
|
42
|
-
showZAxis: Schema.optionalKey(Schema.Boolean),
|
|
43
|
-
}).check(Schema.makeFilter(hasCameraDistance, {
|
|
44
|
-
message: "Expected a camera that sits away from the point it looks at.",
|
|
45
|
-
})));
|
|
46
|
-
}
|
|
47
|
-
/** The exact sine, cosine, and tangent of the angle, each as LaTeX, such as `5/13`. */
|
|
48
|
-
const TrigValuesSchema = Schema.Struct({
|
|
49
|
-
cos: Schema.optionalKey(LatexSchema),
|
|
50
|
-
sin: Schema.optionalKey(LatexSchema),
|
|
51
|
-
tan: Schema.optionalKey(LatexSchema),
|
|
52
|
-
});
|
|
53
|
-
/** Props of `UnitCircle`: the angle in degrees and its exact values in LaTeX. */
|
|
54
|
-
function unitCircle(rich) {
|
|
55
|
-
return figure(Schema.Struct({
|
|
56
|
-
...cardFields(rich),
|
|
57
|
-
angle: Schema.optionalKey(Schema.Finite),
|
|
58
|
-
trigValues: Schema.optionalKey(TrigValuesSchema),
|
|
59
|
-
}), answerAt(["trigValues"]));
|
|
60
|
-
}
|
|
2
|
+
import { figure } from "#contracts/visual/entry";
|
|
61
3
|
/** Props of `QuadraticEquationReadingRoomProblem`: a room whose sides are unknown. */
|
|
62
4
|
function readingRoom(rich) {
|
|
63
5
|
return figure(Schema.Struct({
|
|
@@ -67,15 +9,11 @@ function readingRoom(rich) {
|
|
|
67
9
|
}));
|
|
68
10
|
}
|
|
69
11
|
/**
|
|
70
|
-
* The visuals
|
|
71
|
-
*
|
|
72
|
-
* state.
|
|
12
|
+
* The geometry visuals that a figure draws with its own model. Lines, number
|
|
13
|
+
* lines, and circles are MathVisual scenes, the one mathematics visual.
|
|
73
14
|
*/
|
|
74
15
|
export function geometryVisuals(rich) {
|
|
75
16
|
return {
|
|
76
|
-
LineEquation: lineEquation(rich),
|
|
77
|
-
NumberLine: numberLine(rich),
|
|
78
17
|
QuadraticEquationReadingRoomProblem: readingRoom(rich),
|
|
79
|
-
UnitCircle: unitCircle(rich),
|
|
80
18
|
};
|
|
81
19
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the braking and stopping labs. No prop states the conclusion a
|
|
5
|
+
* lab leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function brakingVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
BrakeHeatLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly chooseSpeed: Schema.Trimmed;
|
|
13
|
+
readonly discTemperature: RichSlot<E>;
|
|
14
|
+
readonly kineticEnergy: RichSlot<E>;
|
|
15
|
+
readonly temperatureRise: RichSlot<E>;
|
|
16
|
+
readonly thermal: Schema.Trimmed;
|
|
17
|
+
readonly viewLabel: Schema.Trimmed;
|
|
18
|
+
}>;
|
|
19
|
+
}>, "figure">;
|
|
20
|
+
BrakingSurfaceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
21
|
+
readonly description: RichSlot<E>;
|
|
22
|
+
readonly title: RichSlot<E>;
|
|
23
|
+
readonly labels: Schema.Struct<{
|
|
24
|
+
readonly brakingDistance: RichSlot<E>;
|
|
25
|
+
readonly brakingTime: RichSlot<E>;
|
|
26
|
+
readonly chooseSurface: Schema.Trimmed;
|
|
27
|
+
readonly deceleration: RichSlot<E>;
|
|
28
|
+
readonly friction: RichSlot<E>;
|
|
29
|
+
readonly surfaces: Schema.$Record<Schema.Literals<readonly ["dry", "wet", "gravel", "snow", "ice"]>, Schema.Trimmed>;
|
|
30
|
+
readonly viewLabel: Schema.Trimmed;
|
|
31
|
+
}>;
|
|
32
|
+
}>, "figure">;
|
|
33
|
+
FollowingDistanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
34
|
+
readonly description: RichSlot<E>;
|
|
35
|
+
readonly title: RichSlot<E>;
|
|
36
|
+
readonly labels: Schema.Struct<{
|
|
37
|
+
readonly chooseHeadway: Schema.Trimmed;
|
|
38
|
+
readonly crash: RichSlot<E>;
|
|
39
|
+
readonly finalGap: RichSlot<E>;
|
|
40
|
+
readonly impactSpeed: RichSlot<E>;
|
|
41
|
+
readonly initialGap: RichSlot<E>;
|
|
42
|
+
readonly reactionDistance: RichSlot<E>;
|
|
43
|
+
readonly reactionTime: Schema.Trimmed;
|
|
44
|
+
readonly safe: RichSlot<E>;
|
|
45
|
+
readonly viewLabel: Schema.Trimmed;
|
|
46
|
+
}>;
|
|
47
|
+
}>, "figure">;
|
|
48
|
+
ReactionTimeLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
49
|
+
readonly description: RichSlot<E>;
|
|
50
|
+
readonly title: RichSlot<E>;
|
|
51
|
+
readonly labels: Schema.Struct<{
|
|
52
|
+
readonly average: RichSlot<E>;
|
|
53
|
+
readonly best: RichSlot<E>;
|
|
54
|
+
readonly brake: Schema.Trimmed;
|
|
55
|
+
readonly early: RichSlot<E>;
|
|
56
|
+
readonly lastTime: RichSlot<E>;
|
|
57
|
+
readonly reactionDistance: RichSlot<E>;
|
|
58
|
+
readonly start: Schema.Trimmed;
|
|
59
|
+
readonly viewLabel: Schema.Trimmed;
|
|
60
|
+
}>;
|
|
61
|
+
}>, "figure">;
|
|
62
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Props of `BrakeHeatLab`: a front wheel seen up close while the car brakes to
|
|
6
|
+
* rest.
|
|
7
|
+
*/
|
|
8
|
+
function brakeHeatLab(rich) {
|
|
9
|
+
return figure(Schema.Struct({
|
|
10
|
+
...cardFields(rich),
|
|
11
|
+
labels: Schema.Struct({
|
|
12
|
+
chooseSpeed: TextSchema,
|
|
13
|
+
discTemperature: rich,
|
|
14
|
+
kineticEnergy: rich,
|
|
15
|
+
temperatureRise: rich,
|
|
16
|
+
thermal: TextSchema,
|
|
17
|
+
viewLabel: TextSchema,
|
|
18
|
+
}),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Props of `BrakingSurfaceLab`: a car at 20 m/s locks its wheels at the white
|
|
23
|
+
* line on the road surface the learner picks.
|
|
24
|
+
*/
|
|
25
|
+
function brakingSurfaceLab(rich) {
|
|
26
|
+
return figure(Schema.Struct({
|
|
27
|
+
...cardFields(rich),
|
|
28
|
+
labels: Schema.Struct({
|
|
29
|
+
brakingDistance: rich,
|
|
30
|
+
brakingTime: rich,
|
|
31
|
+
chooseSurface: TextSchema,
|
|
32
|
+
deceleration: rich,
|
|
33
|
+
friction: rich,
|
|
34
|
+
surfaces: byIds(["dry", "wet", "gravel", "snow", "ice"], TextSchema),
|
|
35
|
+
viewLabel: TextSchema,
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
/** Props of `FollowingDistanceLab`: two cars at 90 km/h on one lane. */
|
|
40
|
+
function followingDistanceLab(rich) {
|
|
41
|
+
return figure(Schema.Struct({
|
|
42
|
+
...cardFields(rich),
|
|
43
|
+
labels: Schema.Struct({
|
|
44
|
+
chooseHeadway: TextSchema,
|
|
45
|
+
crash: rich,
|
|
46
|
+
finalGap: rich,
|
|
47
|
+
impactSpeed: rich,
|
|
48
|
+
initialGap: rich,
|
|
49
|
+
reactionDistance: rich,
|
|
50
|
+
reactionTime: TextSchema,
|
|
51
|
+
safe: rich,
|
|
52
|
+
viewLabel: TextSchema,
|
|
53
|
+
}),
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
/** Props of `ReactionTimeLab`: a reaction test from the driver's seat. */
|
|
57
|
+
function reactionTimeLab(rich) {
|
|
58
|
+
return figure(Schema.Struct({
|
|
59
|
+
...cardFields(rich),
|
|
60
|
+
labels: Schema.Struct({
|
|
61
|
+
average: rich,
|
|
62
|
+
best: rich,
|
|
63
|
+
brake: TextSchema,
|
|
64
|
+
early: rich,
|
|
65
|
+
lastTime: rich,
|
|
66
|
+
reactionDistance: rich,
|
|
67
|
+
start: TextSchema,
|
|
68
|
+
viewLabel: TextSchema,
|
|
69
|
+
}),
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The props of the braking and stopping labs. No prop states the conclusion a
|
|
74
|
+
* lab leads to, so none holds answer state.
|
|
75
|
+
*/
|
|
76
|
+
export function brakingVisuals(rich) {
|
|
77
|
+
return {
|
|
78
|
+
BrakeHeatLab: brakeHeatLab(rich),
|
|
79
|
+
BrakingSurfaceLab: brakingSurfaceLab(rich),
|
|
80
|
+
FollowingDistanceLab: followingDistanceLab(rich),
|
|
81
|
+
ReactionTimeLab: reactionTimeLab(rich),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the circular motion labs. No prop states the conclusion a lab
|
|
5
|
+
* leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function circularVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
SatelliteOrbitCircularLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly acceleration: RichSlot<E>;
|
|
13
|
+
readonly chooseOrbit: Schema.Trimmed;
|
|
14
|
+
readonly orbits: Schema.$Record<Schema.Literals<readonly ["station", "gps", "geostationary"]>, RichSlot<E>>;
|
|
15
|
+
readonly period: RichSlot<E>;
|
|
16
|
+
readonly radius: RichSlot<E>;
|
|
17
|
+
readonly speed: RichSlot<E>;
|
|
18
|
+
readonly viewLabel: Schema.Trimmed;
|
|
19
|
+
}>;
|
|
20
|
+
}>, "figure">;
|
|
21
|
+
StringWhirlReleaseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
22
|
+
readonly description: RichSlot<E>;
|
|
23
|
+
readonly title: RichSlot<E>;
|
|
24
|
+
readonly labels: Schema.Struct<{
|
|
25
|
+
readonly acceleration: RichSlot<E>;
|
|
26
|
+
readonly chooseRelease: Schema.Trimmed;
|
|
27
|
+
readonly period: RichSlot<E>;
|
|
28
|
+
readonly radius: RichSlot<E>;
|
|
29
|
+
readonly releases: Schema.$Record<Schema.Literals<readonly ["east", "north", "west", "south"]>, RichSlot<E>>;
|
|
30
|
+
readonly speed: RichSlot<E>;
|
|
31
|
+
readonly viewLabel: Schema.Trimmed;
|
|
32
|
+
}>;
|
|
33
|
+
readonly period: Schema.Finite;
|
|
34
|
+
readonly radius: Schema.Finite;
|
|
35
|
+
}>, "figure">;
|
|
36
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Props of `SatelliteOrbitCircularLab`: three real satellites in circular
|
|
6
|
+
* orbits drawn to scale around the Earth.
|
|
7
|
+
*/
|
|
8
|
+
function satelliteOrbitCircularLab(rich) {
|
|
9
|
+
return figure(Schema.Struct({
|
|
10
|
+
...cardFields(rich),
|
|
11
|
+
labels: Schema.Struct({
|
|
12
|
+
acceleration: rich,
|
|
13
|
+
chooseOrbit: TextSchema,
|
|
14
|
+
orbits: byIds(["station", "gps", "geostationary"], rich),
|
|
15
|
+
period: rich,
|
|
16
|
+
radius: rich,
|
|
17
|
+
speed: rich,
|
|
18
|
+
viewLabel: TextSchema,
|
|
19
|
+
}),
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Props of `StringWhirlReleaseLab`: a ball whirled on a string, seen from
|
|
24
|
+
* above, let go at a point the learner picks.
|
|
25
|
+
*/
|
|
26
|
+
function stringWhirlReleaseLab(rich) {
|
|
27
|
+
return figure(Schema.Struct({
|
|
28
|
+
...cardFields(rich),
|
|
29
|
+
labels: Schema.Struct({
|
|
30
|
+
acceleration: rich,
|
|
31
|
+
chooseRelease: TextSchema,
|
|
32
|
+
period: rich,
|
|
33
|
+
radius: rich,
|
|
34
|
+
releases: byIds(["east", "north", "west", "south"], rich),
|
|
35
|
+
speed: rich,
|
|
36
|
+
viewLabel: TextSchema,
|
|
37
|
+
}),
|
|
38
|
+
period: Schema.Finite,
|
|
39
|
+
radius: Schema.Finite,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The props of the circular motion labs. No prop states the conclusion a lab
|
|
44
|
+
* leads to, so none holds answer state.
|
|
45
|
+
*/
|
|
46
|
+
export function circularVisuals(rich) {
|
|
47
|
+
return {
|
|
48
|
+
SatelliteOrbitCircularLab: satelliteOrbitCircularLab(rich),
|
|
49
|
+
StringWhirlReleaseLab: stringWhirlReleaseLab(rich),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the energy conversion and efficiency labs. No prop states the
|
|
5
|
+
* conclusion a lab leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function efficiencyVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
HoistWorkLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly chooseMotor: Schema.Trimmed;
|
|
13
|
+
readonly energy: RichSlot<E>;
|
|
14
|
+
readonly height: RichSlot<E>;
|
|
15
|
+
readonly speed: RichSlot<E>;
|
|
16
|
+
readonly time: RichSlot<E>;
|
|
17
|
+
readonly viewLabel: Schema.Trimmed;
|
|
18
|
+
readonly weight: RichSlot<E>;
|
|
19
|
+
}>;
|
|
20
|
+
readonly motor: Schema.optionalKey<Schema.Literals<readonly ["small", "medium", "large"]>>;
|
|
21
|
+
}>, "figure">;
|
|
22
|
+
KettleHeatingLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
23
|
+
readonly description: RichSlot<E>;
|
|
24
|
+
readonly title: RichSlot<E>;
|
|
25
|
+
readonly fill: Schema.optionalKey<Schema.Literals<readonly ["half", "full", "brim"]>>;
|
|
26
|
+
readonly labels: Schema.Struct<{
|
|
27
|
+
readonly chooseFill: Schema.Trimmed;
|
|
28
|
+
readonly energy: RichSlot<E>;
|
|
29
|
+
readonly power: RichSlot<E>;
|
|
30
|
+
readonly rise: RichSlot<E>;
|
|
31
|
+
readonly time: RichSlot<E>;
|
|
32
|
+
readonly viewLabel: Schema.Trimmed;
|
|
33
|
+
}>;
|
|
34
|
+
}>, "figure">;
|
|
35
|
+
FlashlightEfficiencyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
36
|
+
readonly description: RichSlot<E>;
|
|
37
|
+
readonly title: RichSlot<E>;
|
|
38
|
+
readonly bulb: Schema.optionalKey<Schema.Literals<readonly ["filament", "led"]>>;
|
|
39
|
+
readonly labels: Schema.Struct<{
|
|
40
|
+
readonly battery: RichSlot<E>;
|
|
41
|
+
readonly bulbs: Schema.$Record<Schema.Literals<readonly ["filament", "led"]>, RichSlot<E>>;
|
|
42
|
+
readonly chooseBulb: Schema.Trimmed;
|
|
43
|
+
readonly efficiency: RichSlot<E>;
|
|
44
|
+
readonly heat: RichSlot<E>;
|
|
45
|
+
readonly input: RichSlot<E>;
|
|
46
|
+
readonly light: RichSlot<E>;
|
|
47
|
+
readonly runTime: RichSlot<E>;
|
|
48
|
+
readonly viewLabel: Schema.Trimmed;
|
|
49
|
+
}>;
|
|
50
|
+
}>, "figure">;
|
|
51
|
+
PendulumEnergyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
52
|
+
readonly description: RichSlot<E>;
|
|
53
|
+
readonly title: RichSlot<E>;
|
|
54
|
+
readonly drag: Schema.optionalKey<Schema.Literals<readonly ["none", "light", "strong"]>>;
|
|
55
|
+
readonly labels: Schema.Struct<{
|
|
56
|
+
readonly chooseDrag: Schema.Trimmed;
|
|
57
|
+
readonly drags: Schema.$Record<Schema.Literals<readonly ["none", "light", "strong"]>, RichSlot<E>>;
|
|
58
|
+
readonly heat: RichSlot<E>;
|
|
59
|
+
readonly kinetic: RichSlot<E>;
|
|
60
|
+
readonly potential: RichSlot<E>;
|
|
61
|
+
readonly start: RichSlot<E>;
|
|
62
|
+
readonly viewLabel: Schema.Trimmed;
|
|
63
|
+
}>;
|
|
64
|
+
}>, "figure">;
|
|
65
|
+
WeightLampEnergyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
66
|
+
readonly description: RichSlot<E>;
|
|
67
|
+
readonly title: RichSlot<E>;
|
|
68
|
+
readonly descent: Schema.optionalKey<Schema.Literals<readonly ["fast", "steady", "slow"]>>;
|
|
69
|
+
readonly labels: Schema.Struct<{
|
|
70
|
+
readonly chooseDescent: Schema.Trimmed;
|
|
71
|
+
readonly drop: RichSlot<E>;
|
|
72
|
+
readonly energy: RichSlot<E>;
|
|
73
|
+
readonly mass: RichSlot<E>;
|
|
74
|
+
readonly power: RichSlot<E>;
|
|
75
|
+
readonly time: RichSlot<E>;
|
|
76
|
+
readonly viewLabel: Schema.Trimmed;
|
|
77
|
+
}>;
|
|
78
|
+
}>, "figure">;
|
|
79
|
+
EnergyFlowLossLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
80
|
+
readonly description: RichSlot<E>;
|
|
81
|
+
readonly title: RichSlot<E>;
|
|
82
|
+
readonly labels: Schema.Struct<{
|
|
83
|
+
readonly choosePlant: Schema.Trimmed;
|
|
84
|
+
readonly efficiency: RichSlot<E>;
|
|
85
|
+
readonly input: RichSlot<E>;
|
|
86
|
+
readonly lost: RichSlot<E>;
|
|
87
|
+
readonly plants: Schema.$Record<Schema.Literals<readonly ["solar", "wind", "hydro", "geothermal", "biogas"]>, RichSlot<E>>;
|
|
88
|
+
readonly useful: RichSlot<E>;
|
|
89
|
+
readonly viewLabel: Schema.Trimmed;
|
|
90
|
+
}>;
|
|
91
|
+
readonly plant: Schema.optionalKey<Schema.Literals<readonly ["solar", "wind", "hydro", "geothermal", "biogas"]>>;
|
|
92
|
+
}>, "figure">;
|
|
93
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Props of `HoistWorkLab`: a motor hoist lifts a 20 kg crate 5 m onto a
|
|
6
|
+
* platform.
|
|
7
|
+
*/
|
|
8
|
+
function hoistWorkLab(rich) {
|
|
9
|
+
return figure(Schema.Struct({
|
|
10
|
+
...cardFields(rich),
|
|
11
|
+
labels: Schema.Struct({
|
|
12
|
+
chooseMotor: TextSchema,
|
|
13
|
+
energy: rich,
|
|
14
|
+
height: rich,
|
|
15
|
+
speed: rich,
|
|
16
|
+
time: rich,
|
|
17
|
+
viewLabel: TextSchema,
|
|
18
|
+
weight: rich,
|
|
19
|
+
}),
|
|
20
|
+
motor: Schema.optionalKey(Schema.Literals(["small", "medium", "large"])),
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Props of `KettleHeatingLab`: an electric kettle boils 0.5 kg, 1 kg or 1.5 kg
|
|
25
|
+
* of water from 25 °C.
|
|
26
|
+
*/
|
|
27
|
+
function kettleHeatingLab(rich) {
|
|
28
|
+
return figure(Schema.Struct({
|
|
29
|
+
...cardFields(rich),
|
|
30
|
+
fill: Schema.optionalKey(Schema.Literals(["half", "full", "brim"])),
|
|
31
|
+
labels: Schema.Struct({
|
|
32
|
+
chooseFill: TextSchema,
|
|
33
|
+
energy: rich,
|
|
34
|
+
power: rich,
|
|
35
|
+
rise: rich,
|
|
36
|
+
time: rich,
|
|
37
|
+
viewLabel: TextSchema,
|
|
38
|
+
}),
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props of `FlashlightEfficiencyLab`: a flashlight in a dark room, its cells
|
|
43
|
+
* drawn in cutaway.
|
|
44
|
+
*/
|
|
45
|
+
function flashlightEfficiencyLab(rich) {
|
|
46
|
+
return figure(Schema.Struct({
|
|
47
|
+
...cardFields(rich),
|
|
48
|
+
bulb: Schema.optionalKey(Schema.Literals(["filament", "led"])),
|
|
49
|
+
labels: Schema.Struct({
|
|
50
|
+
battery: rich,
|
|
51
|
+
bulbs: byIds(["filament", "led"], rich),
|
|
52
|
+
chooseBulb: TextSchema,
|
|
53
|
+
efficiency: rich,
|
|
54
|
+
heat: rich,
|
|
55
|
+
input: rich,
|
|
56
|
+
light: rich,
|
|
57
|
+
runTime: rich,
|
|
58
|
+
viewLabel: TextSchema,
|
|
59
|
+
}),
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Props of `PendulumEnergyLab`: a 1 kg bob on a 2 m string, let go from 40°,
|
|
64
|
+
* with its energy stores read 10 s after the release.
|
|
65
|
+
*/
|
|
66
|
+
function pendulumEnergyLab(rich) {
|
|
67
|
+
return figure(Schema.Struct({
|
|
68
|
+
...cardFields(rich),
|
|
69
|
+
drag: Schema.optionalKey(Schema.Literals(["none", "light", "strong"])),
|
|
70
|
+
labels: Schema.Struct({
|
|
71
|
+
chooseDrag: TextSchema,
|
|
72
|
+
drags: byIds(["none", "light", "strong"], rich),
|
|
73
|
+
heat: rich,
|
|
74
|
+
kinetic: rich,
|
|
75
|
+
potential: rich,
|
|
76
|
+
start: rich,
|
|
77
|
+
viewLabel: TextSchema,
|
|
78
|
+
}),
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
/** Props of `WeightLampEnergyLab`: a gravity lamp in a dark room. */
|
|
82
|
+
function weightLampEnergyLab(rich) {
|
|
83
|
+
return figure(Schema.Struct({
|
|
84
|
+
...cardFields(rich),
|
|
85
|
+
descent: Schema.optionalKey(Schema.Literals(["fast", "steady", "slow"])),
|
|
86
|
+
labels: Schema.Struct({
|
|
87
|
+
chooseDescent: TextSchema,
|
|
88
|
+
drop: rich,
|
|
89
|
+
energy: rich,
|
|
90
|
+
mass: rich,
|
|
91
|
+
power: rich,
|
|
92
|
+
time: rich,
|
|
93
|
+
viewLabel: TextSchema,
|
|
94
|
+
}),
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Props of `EnergyFlowLossLab`: 100 J entering five kinds of power plant, drawn
|
|
99
|
+
* as a band of light that every machine thins out.
|
|
100
|
+
*/
|
|
101
|
+
function energyFlowLossLab(rich) {
|
|
102
|
+
return figure(Schema.Struct({
|
|
103
|
+
...cardFields(rich),
|
|
104
|
+
labels: Schema.Struct({
|
|
105
|
+
choosePlant: TextSchema,
|
|
106
|
+
efficiency: rich,
|
|
107
|
+
input: rich,
|
|
108
|
+
lost: rich,
|
|
109
|
+
plants: byIds(["solar", "wind", "hydro", "geothermal", "biogas"], rich),
|
|
110
|
+
useful: rich,
|
|
111
|
+
viewLabel: TextSchema,
|
|
112
|
+
}),
|
|
113
|
+
plant: Schema.optionalKey(Schema.Literals(["solar", "wind", "hydro", "geothermal", "biogas"])),
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The props of the energy conversion and efficiency labs. No prop states the
|
|
118
|
+
* conclusion a lab leads to, so none holds answer state.
|
|
119
|
+
*/
|
|
120
|
+
export function efficiencyVisuals(rich) {
|
|
121
|
+
return {
|
|
122
|
+
HoistWorkLab: hoistWorkLab(rich),
|
|
123
|
+
KettleHeatingLab: kettleHeatingLab(rich),
|
|
124
|
+
FlashlightEfficiencyLab: flashlightEfficiencyLab(rich),
|
|
125
|
+
PendulumEnergyLab: pendulumEnergyLab(rich),
|
|
126
|
+
WeightLampEnergyLab: weightLampEnergyLab(rich),
|
|
127
|
+
EnergyFlowLossLab: energyFlowLossLab(rich),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the falling and projectile labs. No prop states the conclusion a
|
|
5
|
+
* lab leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fallingVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
GalileoInclineBellsLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly acceleration: RichSlot<E>;
|
|
13
|
+
readonly chooseAngle: Schema.Trimmed;
|
|
14
|
+
readonly firstSecond: RichSlot<E>;
|
|
15
|
+
readonly gaps: RichSlot<E>;
|
|
16
|
+
readonly viewLabel: Schema.Trimmed;
|
|
17
|
+
}>;
|
|
18
|
+
}>, "figure">;
|
|
19
|
+
FeatherCoinVacuumLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
20
|
+
readonly description: RichSlot<E>;
|
|
21
|
+
readonly title: RichSlot<E>;
|
|
22
|
+
readonly labels: Schema.Struct<{
|
|
23
|
+
readonly airs: Schema.$Record<Schema.Literals<readonly ["air", "vacuum"]>, RichSlot<E>>;
|
|
24
|
+
readonly chooseAir: Schema.Trimmed;
|
|
25
|
+
readonly coinTime: RichSlot<E>;
|
|
26
|
+
readonly drop: RichSlot<E>;
|
|
27
|
+
readonly featherTime: RichSlot<E>;
|
|
28
|
+
readonly viewLabel: Schema.Trimmed;
|
|
29
|
+
}>;
|
|
30
|
+
}>, "figure">;
|
|
31
|
+
FallingTargetAimLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
32
|
+
readonly description: RichSlot<E>;
|
|
33
|
+
readonly title: RichSlot<E>;
|
|
34
|
+
readonly labels: Schema.Struct<{
|
|
35
|
+
readonly drop: RichSlot<E>;
|
|
36
|
+
readonly meetTime: RichSlot<E>;
|
|
37
|
+
readonly speed: RichSlot<E>;
|
|
38
|
+
readonly speedName: Schema.Trimmed;
|
|
39
|
+
readonly viewLabel: Schema.Trimmed;
|
|
40
|
+
}>;
|
|
41
|
+
readonly speed: Schema.optionalKey<Schema.Finite>;
|
|
42
|
+
}>, "figure">;
|
|
43
|
+
HoseJetProjectileLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
44
|
+
readonly description: RichSlot<E>;
|
|
45
|
+
readonly title: RichSlot<E>;
|
|
46
|
+
readonly angle: Schema.optionalKey<Schema.Literals<readonly [15, 30, 45, 60, 75, 90]>>;
|
|
47
|
+
readonly labels: Schema.Struct<{
|
|
48
|
+
readonly chooseAngle: Schema.Trimmed;
|
|
49
|
+
readonly flight: RichSlot<E>;
|
|
50
|
+
readonly range: RichSlot<E>;
|
|
51
|
+
readonly top: RichSlot<E>;
|
|
52
|
+
readonly viewLabel: Schema.Trimmed;
|
|
53
|
+
}>;
|
|
54
|
+
readonly speed: Schema.Finite;
|
|
55
|
+
}>, "figure">;
|
|
56
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** Props of `GalileoInclineBellsLab`: Galileo's inclined plane. */
|
|
5
|
+
function galileoInclineBellsLab(rich) {
|
|
6
|
+
return figure(Schema.Struct({
|
|
7
|
+
...cardFields(rich),
|
|
8
|
+
labels: Schema.Struct({
|
|
9
|
+
acceleration: rich,
|
|
10
|
+
chooseAngle: TextSchema,
|
|
11
|
+
firstSecond: rich,
|
|
12
|
+
gaps: rich,
|
|
13
|
+
viewLabel: TextSchema,
|
|
14
|
+
}),
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props of `FeatherCoinVacuumLab`: a coin and a feather let go together inside
|
|
19
|
+
* a tall glass tube.
|
|
20
|
+
*/
|
|
21
|
+
function featherCoinVacuumLab(rich) {
|
|
22
|
+
return figure(Schema.Struct({
|
|
23
|
+
...cardFields(rich),
|
|
24
|
+
labels: Schema.Struct({
|
|
25
|
+
airs: byIds(["air", "vacuum"], rich),
|
|
26
|
+
chooseAir: TextSchema,
|
|
27
|
+
coinTime: rich,
|
|
28
|
+
drop: rich,
|
|
29
|
+
featherTime: rich,
|
|
30
|
+
viewLabel: TextSchema,
|
|
31
|
+
}),
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/** Props of `FallingTargetAimLab`: the falling-target demonstration. */
|
|
35
|
+
function fallingTargetAimLab(rich) {
|
|
36
|
+
return figure(Schema.Struct({
|
|
37
|
+
...cardFields(rich),
|
|
38
|
+
labels: Schema.Struct({
|
|
39
|
+
drop: rich,
|
|
40
|
+
meetTime: rich,
|
|
41
|
+
speed: rich,
|
|
42
|
+
speedName: TextSchema,
|
|
43
|
+
viewLabel: TextSchema,
|
|
44
|
+
}),
|
|
45
|
+
speed: Schema.optionalKey(Schema.Finite),
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Props of `HoseJetProjectileLab`: a garden hose held at the ground and tilted
|
|
50
|
+
* to six angles.
|
|
51
|
+
*/
|
|
52
|
+
function hoseJetProjectileLab(rich) {
|
|
53
|
+
return figure(Schema.Struct({
|
|
54
|
+
...cardFields(rich),
|
|
55
|
+
angle: Schema.optionalKey(Schema.Literals([15, 30, 45, 60, 75, 90])),
|
|
56
|
+
labels: Schema.Struct({
|
|
57
|
+
chooseAngle: TextSchema,
|
|
58
|
+
flight: rich,
|
|
59
|
+
range: rich,
|
|
60
|
+
top: rich,
|
|
61
|
+
viewLabel: TextSchema,
|
|
62
|
+
}),
|
|
63
|
+
speed: Schema.Finite,
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The props of the falling and projectile labs. No prop states the conclusion a
|
|
68
|
+
* lab leads to, so none holds answer state.
|
|
69
|
+
*/
|
|
70
|
+
export function fallingVisuals(rich) {
|
|
71
|
+
return {
|
|
72
|
+
GalileoInclineBellsLab: galileoInclineBellsLab(rich),
|
|
73
|
+
FeatherCoinVacuumLab: featherCoinVacuumLab(rich),
|
|
74
|
+
FallingTargetAimLab: fallingTargetAimLab(rich),
|
|
75
|
+
HoseJetProjectileLab: hoseJetProjectileLab(rich),
|
|
76
|
+
};
|
|
77
|
+
}
|