@nakafa/aksara-contracts 8.15.0 → 8.17.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/visual/base.d.ts +785 -0
- package/dist/visual/base.js +13 -0
- package/dist/visual/biology/ecosystem.d.ts +425 -0
- package/dist/visual/biology/ecosystem.js +140 -0
- package/dist/visual/biology/respiration.d.ts +286 -0
- package/dist/visual/biology/respiration.js +97 -0
- package/dist/visual/biology.d.ts +11158 -205
- package/dist/visual/biology.js +104 -0
- package/dist/visual/catalog.d.ts +16 -41206
- package/dist/visual/catalog.js +8 -216
- package/dist/visual/chemistry/green.d.ts +282 -0
- package/dist/visual/chemistry/green.js +98 -0
- package/dist/visual/chemistry/groups.d.ts +276 -0
- package/dist/visual/chemistry/groups.js +85 -0
- package/dist/visual/chemistry/industry.d.ts +420 -0
- package/dist/visual/chemistry/industry.js +126 -0
- package/dist/visual/chemistry/materials.d.ts +416 -0
- package/dist/visual/chemistry/materials.js +116 -0
- package/dist/visual/chemistry/organic.d.ts +416 -0
- package/dist/visual/chemistry/organic.js +128 -0
- package/dist/visual/chemistry/polymer.d.ts +422 -0
- package/dist/visual/chemistry/polymer.js +126 -0
- package/dist/visual/chemistry/solution.d.ts +278 -0
- package/dist/visual/chemistry/solution.js +89 -0
- package/dist/visual/chemistry/stoichiometry.d.ts +287 -0
- package/dist/visual/chemistry/stoichiometry.js +83 -0
- package/dist/visual/chemistry.d.ts +8827 -0
- package/dist/visual/chemistry.js +50 -0
- package/dist/visual/mathematics/derivative.d.ts +425 -0
- package/dist/visual/mathematics/derivative.js +132 -0
- package/dist/visual/mathematics/integral.d.ts +428 -0
- package/dist/visual/mathematics/integral.js +146 -0
- package/dist/visual/mathematics/limit.d.ts +425 -0
- package/dist/visual/mathematics/limit.js +139 -0
- package/dist/visual/mathematics/linear.d.ts +425 -0
- package/dist/visual/mathematics/linear.js +140 -0
- package/dist/visual/mathematics/vector.d.ts +419 -0
- package/dist/visual/mathematics/vector.js +129 -0
- package/dist/visual/mathematics.d.ts +5148 -0
- package/dist/visual/mathematics.js +41 -0
- package/dist/visual/physics.d.ts +17875 -0
- package/dist/visual/physics.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
|
|
5
|
+
const PositiveSliderSchema = Schema.Struct({
|
|
6
|
+
max: PositiveSchema,
|
|
7
|
+
min: PositiveSchema,
|
|
8
|
+
value: PositiveSchema,
|
|
9
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
10
|
+
message: "Expected a positive slider range whose minimum is below its maximum, with the starting value between them.",
|
|
11
|
+
}));
|
|
12
|
+
const ENTHALPY_REACTIONS = [
|
|
13
|
+
"neutralisation",
|
|
14
|
+
"displacement",
|
|
15
|
+
"combustion",
|
|
16
|
+
"dissolution",
|
|
17
|
+
];
|
|
18
|
+
const GAS_CONDITIONS = ["stp", "rtp"];
|
|
19
|
+
/**
|
|
20
|
+
* Props of `CalorimeterEnthalpyLab`: a 3D polystyrene coffee-cup calorimeter
|
|
21
|
+
* measuring temperature rise or drop for exothermic and endothermic reactions
|
|
22
|
+
* as reacting moles vary. Enthalpy change and temperature change readouts are
|
|
23
|
+
* optional answer state.
|
|
24
|
+
*/
|
|
25
|
+
function calorimeterEnthalpyLab(rich) {
|
|
26
|
+
return figure(Schema.Struct({
|
|
27
|
+
...cardFields(rich),
|
|
28
|
+
labels: Schema.Struct({
|
|
29
|
+
deltaH: Schema.optionalKey(rich),
|
|
30
|
+
moles: TextSchema,
|
|
31
|
+
parts: byIds(["cup", "thermometer", "stirrer", "solution", "heatArrow"], TextSchema),
|
|
32
|
+
reaction: TextSchema,
|
|
33
|
+
reactions: byPickedIds(ENTHALPY_REACTIONS, Schema.Struct({
|
|
34
|
+
enthalpySign: rich,
|
|
35
|
+
name: TextSchema,
|
|
36
|
+
thermalNote: rich,
|
|
37
|
+
})),
|
|
38
|
+
tempChange: Schema.optionalKey(rich),
|
|
39
|
+
view: TextSchema,
|
|
40
|
+
}),
|
|
41
|
+
moles: PositiveSliderSchema,
|
|
42
|
+
reactions: Schema.NonEmptyArray(Schema.Literals(ENTHALPY_REACTIONS)).check(Schema.isUnique()),
|
|
43
|
+
}).check(Schema.makeFilter(({ labels, reactions }) => namesEach(reactions, labels.reactions), {
|
|
44
|
+
message: "Expected a name, enthalpy sign, and thermal note for every calorimeter reaction shown, and no other.",
|
|
45
|
+
})), answerAt(["labels", "deltaH"], ["labels", "tempChange"]));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props of `AvogadroGasVolumeLab`: a 3D graduated gas cylinder with moving
|
|
49
|
+
* piston illustrating Avogadro's molar volume at STP (22.4 dm3/mol) and RTP
|
|
50
|
+
* (24.0 dm3/mol) as moles vary. Gas volume and particle count readouts are
|
|
51
|
+
* optional answer state.
|
|
52
|
+
*/
|
|
53
|
+
function avogadroGasVolumeLab(rich) {
|
|
54
|
+
return figure(Schema.Struct({
|
|
55
|
+
...cardFields(rich),
|
|
56
|
+
conditions: Schema.NonEmptyArray(Schema.Literals(GAS_CONDITIONS)).check(Schema.isUnique()),
|
|
57
|
+
labels: Schema.Struct({
|
|
58
|
+
condition: TextSchema,
|
|
59
|
+
conditions: byPickedIds(GAS_CONDITIONS, Schema.Struct({
|
|
60
|
+
molarVolume: rich,
|
|
61
|
+
name: TextSchema,
|
|
62
|
+
})),
|
|
63
|
+
gasVolume: Schema.optionalKey(rich),
|
|
64
|
+
moles: TextSchema,
|
|
65
|
+
particleCount: Schema.optionalKey(rich),
|
|
66
|
+
parts: byIds(["piston", "cylinder", "gasParticles", "volumeScale", "thermometer"], TextSchema),
|
|
67
|
+
view: TextSchema,
|
|
68
|
+
}),
|
|
69
|
+
moles: PositiveSliderSchema,
|
|
70
|
+
}).check(Schema.makeFilter(({ conditions, labels }) => namesEach(conditions, labels.conditions), {
|
|
71
|
+
message: "Expected a name and molar volume note for every gas condition shown, and no other.",
|
|
72
|
+
})), answerAt(["labels", "gasVolume"], ["labels", "particleCount"]));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Quantitative thermochemistry and mole-concept labs covering calorimetry
|
|
76
|
+
* enthalpy measurement and Avogadro molar gas volume.
|
|
77
|
+
*/
|
|
78
|
+
export function stoichiometryVisuals(rich) {
|
|
79
|
+
return {
|
|
80
|
+
AvogadroGasVolumeLab: avogadroGasVolumeLab(rich),
|
|
81
|
+
CalorimeterEnthalpyLab: calorimeterEnthalpyLab(rich),
|
|
82
|
+
};
|
|
83
|
+
}
|