@nakafa/aksara-contracts 6.5.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assessment/catalog.d.ts +18 -5
- package/dist/assessment/catalog.js +18 -8
- package/dist/assessment/choice.d.ts +10 -0
- package/dist/assessment/closure.d.ts +2 -1
- package/dist/assessment/closure.js +43 -62
- package/dist/assessment/document.d.ts +18 -0
- package/dist/assessment/document.js +10 -0
- package/dist/assessment/figure.d.ts +25 -2676
- package/dist/assessment/figure.js +17 -216
- package/dist/assessment/hash.d.ts +274 -4
- package/dist/assessment/inline.d.ts +25 -0
- package/dist/assessment/inline.js +22 -3
- package/dist/assessment/interaction.d.ts +10 -0
- package/dist/assessment/item.d.ts +864 -0
- package/dist/assessment/item.js +10 -2
- package/dist/assessment/locales.d.ts +10 -0
- package/dist/assessment/locales.js +58 -0
- package/dist/assessment/paper.d.ts +1349 -12
- package/dist/assessment/paper.js +93 -9
- package/dist/assessment/part.d.ts +5 -0
- package/dist/assessment/profile.d.ts +4 -4
- package/dist/assessment/rows.d.ts +1409 -0
- package/dist/assessment/rows.js +44 -0
- package/dist/assessment/scalar.d.ts +1 -1
- package/dist/assessment/scoring.d.ts +1 -1
- package/dist/assessment/snapshot.d.ts +372 -20
- package/dist/assessment/structure.d.ts +6 -0
- package/dist/assessment/structure.js +22 -2
- package/dist/locale.d.ts +9 -9
- package/dist/locale.js +4 -3
- package/dist/program/snapshot/hash.d.ts +2 -2
- package/dist/program/snapshot/spec.d.ts +2 -2
- package/dist/projection/material.d.ts +10 -0
- package/dist/projection/material.js +1 -1
- package/dist/quran/attribution.d.ts +2 -2
- package/dist/quran/identity.d.ts +31 -10
- package/dist/quran/identity.js +15 -3
- package/dist/quran/provenance.d.ts +16 -16
- package/dist/quran/provenance.js +4 -1
- package/dist/quran/snapshot/hash.d.ts +2 -2
- package/dist/quran/snapshot/row/hash.d.ts +48 -15
- package/dist/quran/snapshot/row.d.ts +18 -8
- package/dist/quran/snapshot/spec.d.ts +2 -2
- package/dist/quran/source.d.ts +17 -7
- package/dist/quran/source.js +13 -1
- package/dist/quran/spec.d.ts +4 -4
- package/dist/quran/spec.js +2 -1
- package/dist/release/current/evidence.d.ts +9 -9
- package/dist/release/current/state.d.ts +11 -11
- package/dist/release/hash.d.ts +2 -2
- package/dist/release/identity.d.ts +1 -1
- package/dist/release/lifecycle.d.ts +7 -7
- package/dist/release/policy.d.ts +1 -1
- package/dist/release/snapshot/data.d.ts +36 -11
- package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
- package/dist/release/snapshot/evidence/program.d.ts +1 -1
- package/dist/release/snapshot/evidence/quran.d.ts +1 -1
- package/dist/release/snapshot/evidence.d.ts +3 -3
- package/dist/release/snapshot/verify.d.ts +179 -12
- package/dist/release/spec.d.ts +13 -13
- package/dist/release/verify.d.ts +2 -2
- package/dist/runtime/spec.d.ts +6 -6
- package/dist/runtime/verify.d.ts +4 -4
- package/dist/transport/group.d.ts +108 -33
- package/dist/transport/request.d.ts +1166 -114
- package/dist/transport/response.d.ts +64 -64
- package/dist/transport/snapshot.d.ts +72 -22
- package/dist/visual/base/layout.d.ts +27 -0
- package/dist/visual/base/layout.js +35 -0
- package/dist/visual/base/math.d.ts +523 -0
- package/dist/visual/base/math.js +72 -0
- package/dist/visual/base/media.d.ts +13 -0
- package/dist/visual/base/media.js +25 -0
- 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 +203 -0
- package/dist/visual/biology.js +108 -0
- package/dist/visual/card.d.ts +32 -0
- package/dist/visual/card.js +30 -0
- package/dist/visual/catalog.d.ts +3372 -0
- package/dist/visual/catalog.js +119 -0
- package/dist/visual/chemistry/atom.d.ts +79 -0
- package/dist/visual/chemistry/atom.js +109 -0
- 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 +41 -0
- package/dist/visual/chemistry/electron.js +69 -0
- package/dist/visual/chemistry/laws.d.ts +86 -0
- package/dist/visual/chemistry/laws.js +117 -0
- package/dist/visual/chemistry/particles.d.ts +114 -0
- package/dist/visual/chemistry/particles.js +149 -0
- package/dist/visual/chemistry/periodic.d.ts +52 -0
- package/dist/visual/chemistry/periodic.js +85 -0
- package/dist/visual/chemistry/reaction.d.ts +60 -0
- package/dist/visual/chemistry/reaction.js +76 -0
- package/dist/visual/entry.d.ts +42 -0
- package/dist/visual/entry.js +48 -0
- package/dist/visual/mathematics/chart.d.ts +30 -0
- package/dist/{assessment → visual/mathematics}/chart.js +26 -18
- package/dist/visual/mathematics/charts.d.ts +118 -0
- package/dist/visual/mathematics/charts.js +100 -0
- package/dist/visual/mathematics/function.d.ts +82 -0
- package/dist/visual/mathematics/function.js +102 -0
- package/dist/visual/mathematics/geometry.d.ts +222 -0
- package/dist/visual/mathematics/geometry.js +81 -0
- package/dist/visual/mathematics/line.d.ts +179 -0
- package/dist/visual/mathematics/line.js +156 -0
- package/dist/visual/mathematics/number.d.ts +21 -0
- package/dist/visual/mathematics/number.js +53 -0
- 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 +66 -0
- package/dist/visual/physics/measurement.js +85 -0
- package/dist/visual/physics/motion.d.ts +85 -0
- package/dist/visual/physics/motion.js +110 -0
- package/dist/visual/physics/parabolic.d.ts +42 -0
- package/dist/visual/physics/parabolic.js +56 -0
- 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 +112 -0
- package/dist/visual/physics/velocity.js +144 -0
- package/dist/visual/politics.d.ts +92 -0
- package/dist/visual/politics.js +76 -0
- package/package.json +13 -5
- package/dist/assessment/chart.d.ts +0 -62
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Array as Arr, Order, Record as Rec, Schema } from "effect";
|
|
2
|
+
import { RichTextSchema } from "#contracts/assessment/inline";
|
|
3
|
+
import { layoutVisuals } from "#contracts/visual/base/layout";
|
|
4
|
+
import { mathVisuals } from "#contracts/visual/base/math";
|
|
5
|
+
import { mediaVisuals } from "#contracts/visual/base/media";
|
|
6
|
+
import { biologyVisuals } from "#contracts/visual/biology";
|
|
7
|
+
import { bacteriaVisuals } from "#contracts/visual/biology/bacteria";
|
|
8
|
+
import { cellVisuals } from "#contracts/visual/biology/cell";
|
|
9
|
+
import { climateVisuals } from "#contracts/visual/biology/climate";
|
|
10
|
+
import { ecologyVisuals } from "#contracts/visual/biology/ecology";
|
|
11
|
+
import { atomVisuals } from "#contracts/visual/chemistry/atom";
|
|
12
|
+
import { balanceVisuals } from "#contracts/visual/chemistry/balance";
|
|
13
|
+
import { bondingVisuals } from "#contracts/visual/chemistry/bonding";
|
|
14
|
+
import { discoveryVisuals } from "#contracts/visual/chemistry/discovery";
|
|
15
|
+
import { electronVisuals } from "#contracts/visual/chemistry/electron";
|
|
16
|
+
import { lawVisuals } from "#contracts/visual/chemistry/laws";
|
|
17
|
+
import { particleVisuals } from "#contracts/visual/chemistry/particles";
|
|
18
|
+
import { periodicVisuals } from "#contracts/visual/chemistry/periodic";
|
|
19
|
+
import { reactionVisuals } from "#contracts/visual/chemistry/reaction";
|
|
20
|
+
import { chartVisuals } from "#contracts/visual/mathematics/charts";
|
|
21
|
+
import { functionVisuals } from "#contracts/visual/mathematics/function";
|
|
22
|
+
import { geometryVisuals } from "#contracts/visual/mathematics/geometry";
|
|
23
|
+
import { brakingVisuals } from "#contracts/visual/physics/braking";
|
|
24
|
+
import { circularVisuals } from "#contracts/visual/physics/circular";
|
|
25
|
+
import { efficiencyVisuals } from "#contracts/visual/physics/efficiency";
|
|
26
|
+
import { fallingVisuals } from "#contracts/visual/physics/falling";
|
|
27
|
+
import { forceVisuals } from "#contracts/visual/physics/force";
|
|
28
|
+
import { instrumentVisuals } from "#contracts/visual/physics/instrument";
|
|
29
|
+
import { measurementVisuals } from "#contracts/visual/physics/measurement";
|
|
30
|
+
import { motionVisuals } from "#contracts/visual/physics/motion";
|
|
31
|
+
import { parabolicVisuals } from "#contracts/visual/physics/parabolic";
|
|
32
|
+
import { positionVisuals } from "#contracts/visual/physics/position";
|
|
33
|
+
import { powerVisuals } from "#contracts/visual/physics/power";
|
|
34
|
+
import { precisionVisuals } from "#contracts/visual/physics/precision";
|
|
35
|
+
import { productVisuals } from "#contracts/visual/physics/product";
|
|
36
|
+
import { recordVisuals } from "#contracts/visual/physics/record";
|
|
37
|
+
import { relativeVisuals } from "#contracts/visual/physics/relative";
|
|
38
|
+
import { solarVisuals } from "#contracts/visual/physics/solar";
|
|
39
|
+
import { vectorVisuals } from "#contracts/visual/physics/vector";
|
|
40
|
+
import { velocityVisuals } from "#contracts/visual/physics/velocity";
|
|
41
|
+
import { politicsVisuals } from "#contracts/visual/politics";
|
|
42
|
+
/**
|
|
43
|
+
* The Visual Catalog: every component Nakafa's renderer draws, each with the
|
|
44
|
+
* schema of its props and the reader of the answer state they hold. It is the
|
|
45
|
+
* one list of visuals. A lesson element and an assessment figure check the same
|
|
46
|
+
* component against the same schema; only the schema of rich text differs by
|
|
47
|
+
* document kind, so `rich` is the schema a document kind writes rich text in,
|
|
48
|
+
* and every kind decodes it to the same inline nodes.
|
|
49
|
+
* Nakafa's renderer manifest names exactly these components.
|
|
50
|
+
*/
|
|
51
|
+
export function visualCatalog(rich) {
|
|
52
|
+
return {
|
|
53
|
+
...layoutVisuals(),
|
|
54
|
+
...mathVisuals(rich),
|
|
55
|
+
...mediaVisuals(rich),
|
|
56
|
+
...biologyVisuals(rich),
|
|
57
|
+
...atomVisuals(rich),
|
|
58
|
+
...electronVisuals(rich),
|
|
59
|
+
...lawVisuals(rich),
|
|
60
|
+
...particleVisuals(rich),
|
|
61
|
+
...periodicVisuals(rich),
|
|
62
|
+
...reactionVisuals(rich),
|
|
63
|
+
...chartVisuals(rich),
|
|
64
|
+
...functionVisuals(rich),
|
|
65
|
+
...geometryVisuals(rich),
|
|
66
|
+
...measurementVisuals(rich),
|
|
67
|
+
...motionVisuals(rich),
|
|
68
|
+
...parabolicVisuals(rich),
|
|
69
|
+
...velocityVisuals(rich),
|
|
70
|
+
...bacteriaVisuals(rich),
|
|
71
|
+
...cellVisuals(rich),
|
|
72
|
+
...climateVisuals(rich),
|
|
73
|
+
...ecologyVisuals(rich),
|
|
74
|
+
...balanceVisuals(rich),
|
|
75
|
+
...bondingVisuals(rich),
|
|
76
|
+
...discoveryVisuals(rich),
|
|
77
|
+
...brakingVisuals(rich),
|
|
78
|
+
...circularVisuals(rich),
|
|
79
|
+
...efficiencyVisuals(rich),
|
|
80
|
+
...fallingVisuals(rich),
|
|
81
|
+
...forceVisuals(rich),
|
|
82
|
+
...instrumentVisuals(rich),
|
|
83
|
+
...positionVisuals(rich),
|
|
84
|
+
...powerVisuals(rich),
|
|
85
|
+
...precisionVisuals(rich),
|
|
86
|
+
...productVisuals(rich),
|
|
87
|
+
...recordVisuals(rich),
|
|
88
|
+
...relativeVisuals(rich),
|
|
89
|
+
...solarVisuals(rich),
|
|
90
|
+
...vectorVisuals(rich),
|
|
91
|
+
...politicsVisuals(rich),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The catalog of an assessment, which stores rich text as inline nodes. Its
|
|
96
|
+
* names, kinds, and answer state are the same in every document kind.
|
|
97
|
+
*/
|
|
98
|
+
export const assessmentVisuals = visualCatalog(RichTextSchema);
|
|
99
|
+
/** The catalog read for the parts that no document kind changes. */
|
|
100
|
+
const plainCatalog = assessmentVisuals;
|
|
101
|
+
/** Every catalog name, in code-unit order. */
|
|
102
|
+
export const VISUAL_NAMES = Arr.sort(Rec.keys(plainCatalog), Order.String);
|
|
103
|
+
/** Whether a document draws one catalog component as a figure, as its entry's kind says. */
|
|
104
|
+
function isFigure(name) {
|
|
105
|
+
return plainCatalog[name].kind === "figure";
|
|
106
|
+
}
|
|
107
|
+
/** The catalog components a document draws as a figure, in code-unit order. */
|
|
108
|
+
export const FIGURE_NAMES = Arr.filter(VISUAL_NAMES, isFigure);
|
|
109
|
+
/** The name of one catalog component. */
|
|
110
|
+
export const VisualNameSchema = Schema.Literals(VISUAL_NAMES);
|
|
111
|
+
/** The name of one catalog component that a document draws as a figure. */
|
|
112
|
+
export const FigureNameSchema = Schema.Literals(FIGURE_NAMES);
|
|
113
|
+
/**
|
|
114
|
+
* Lists the answer state that the props of one component hold, each as the
|
|
115
|
+
* dotted path of a present prop. A prompt or a reading may show none of it.
|
|
116
|
+
*/
|
|
117
|
+
export function answerState(component, props) {
|
|
118
|
+
return plainCatalog[component].answer(props);
|
|
119
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The atoms the shell model lab can show. */
|
|
4
|
+
export declare const SHELL_SAMPLES: readonly ["neon", "magnesium", "chlorine", "argon", "potassium", "calcium"];
|
|
5
|
+
/**
|
|
6
|
+
* The atom labs. A sample note of the shell model states the configuration
|
|
7
|
+
* and the outer shell it leads to, so it is answer state; every other label
|
|
8
|
+
* names what the lab draws.
|
|
9
|
+
*/
|
|
10
|
+
export declare function atomVisuals<E>(rich: RichSlot<E>): {
|
|
11
|
+
AncientAtomLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
12
|
+
readonly description: RichSlot<E>;
|
|
13
|
+
readonly title: RichSlot<E>;
|
|
14
|
+
readonly labels: Schema.Struct<{
|
|
15
|
+
readonly aristotleBody: RichSlot<E>;
|
|
16
|
+
readonly aristotleLabel: Schema.Trimmed;
|
|
17
|
+
readonly chooseLevel: Schema.Trimmed;
|
|
18
|
+
readonly democritusBody: RichSlot<E>;
|
|
19
|
+
readonly democritusLabel: Schema.Trimmed;
|
|
20
|
+
readonly levels: Schema.$Record<Schema.Literals<readonly ["whole", "first-cut", "second-cut", "fine-cut"]>, Schema.Struct<{
|
|
21
|
+
readonly tab: Schema.Trimmed;
|
|
22
|
+
}>>;
|
|
23
|
+
}>;
|
|
24
|
+
}>, "figure">;
|
|
25
|
+
AtomShellLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
26
|
+
readonly defaultSampleId: Schema.optionalKey<Schema.Literals<readonly ["neon", "magnesium", "chlorine", "argon", "potassium", "calcium"]>>;
|
|
27
|
+
readonly description: Schema.optionalKey<RichSlot<E>>;
|
|
28
|
+
readonly labels: Schema.Struct<{
|
|
29
|
+
readonly atomicNumber: Schema.Trimmed;
|
|
30
|
+
readonly chooseAtom: Schema.Trimmed;
|
|
31
|
+
readonly configuration: Schema.Trimmed;
|
|
32
|
+
readonly electronTotal: Schema.Trimmed;
|
|
33
|
+
readonly maximumCapacity: Schema.Trimmed;
|
|
34
|
+
readonly outerShell: Schema.Trimmed;
|
|
35
|
+
readonly samples: Schema.$Record<Schema.Literals<readonly ["neon", "magnesium", "chlorine", "argon", "potassium", "calcium"]>, Schema.Struct<{
|
|
36
|
+
readonly name: Schema.optionalKey<Schema.Trimmed>;
|
|
37
|
+
readonly note: Schema.optionalKey<RichSlot<E>>;
|
|
38
|
+
readonly tab: Schema.Trimmed;
|
|
39
|
+
}>>;
|
|
40
|
+
}>;
|
|
41
|
+
readonly title: Schema.optionalKey<RichSlot<E>>;
|
|
42
|
+
}>, "figure">;
|
|
43
|
+
AtomSymbolLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
44
|
+
readonly description: RichSlot<E>;
|
|
45
|
+
readonly title: RichSlot<E>;
|
|
46
|
+
readonly labels: Schema.Struct<{
|
|
47
|
+
readonly atomicNumber: Schema.Trimmed;
|
|
48
|
+
readonly chooseAtom: Schema.Trimmed;
|
|
49
|
+
readonly electronCount: Schema.Trimmed;
|
|
50
|
+
readonly elementSymbol: Schema.Trimmed;
|
|
51
|
+
readonly massNumber: Schema.Trimmed;
|
|
52
|
+
readonly neutralAtom: Schema.Trimmed;
|
|
53
|
+
readonly neutronCount: Schema.Trimmed;
|
|
54
|
+
readonly protonCount: Schema.Trimmed;
|
|
55
|
+
readonly samples: Schema.$Record<Schema.Literals<readonly ["carbon-12", "oxygen-16", "sodium-23", "chlorine-35"]>, Schema.Struct<{
|
|
56
|
+
readonly ariaName: Schema.Trimmed;
|
|
57
|
+
readonly name: RichSlot<E>;
|
|
58
|
+
readonly tab: RichSlot<E>;
|
|
59
|
+
}>>;
|
|
60
|
+
}>;
|
|
61
|
+
}>, "figure">;
|
|
62
|
+
DaltonEvidenceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
63
|
+
readonly description: RichSlot<E>;
|
|
64
|
+
readonly title: RichSlot<E>;
|
|
65
|
+
readonly labels: Schema.Struct<{
|
|
66
|
+
readonly chooseMode: Schema.Trimmed;
|
|
67
|
+
readonly modes: Schema.$Record<Schema.Literals<readonly ["conservation", "fixed", "multiple"]>, Schema.Struct<{
|
|
68
|
+
readonly afterTitle: Schema.Trimmed;
|
|
69
|
+
readonly beforeTitle: Schema.Trimmed;
|
|
70
|
+
readonly expression: Schema.Trimmed;
|
|
71
|
+
readonly facts: Schema.$Array<Schema.Struct<{
|
|
72
|
+
readonly label: Schema.Trimmed;
|
|
73
|
+
readonly value: Schema.Trimmed;
|
|
74
|
+
}>>;
|
|
75
|
+
readonly tab: Schema.Trimmed;
|
|
76
|
+
}>>;
|
|
77
|
+
}>;
|
|
78
|
+
}>, "figure">;
|
|
79
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The cutting stages of the ancient atom thought experiment. */
|
|
5
|
+
const ANCIENT_LEVELS = [
|
|
6
|
+
"whole",
|
|
7
|
+
"first-cut",
|
|
8
|
+
"second-cut",
|
|
9
|
+
"fine-cut",
|
|
10
|
+
];
|
|
11
|
+
/** The atoms the shell model lab can show. */
|
|
12
|
+
export const SHELL_SAMPLES = [
|
|
13
|
+
"neon",
|
|
14
|
+
"magnesium",
|
|
15
|
+
"chlorine",
|
|
16
|
+
"argon",
|
|
17
|
+
"potassium",
|
|
18
|
+
"calcium",
|
|
19
|
+
];
|
|
20
|
+
/** The nuclides the atom symbol lab reads. */
|
|
21
|
+
const SYMBOL_SAMPLES = [
|
|
22
|
+
"carbon-12",
|
|
23
|
+
"oxygen-16",
|
|
24
|
+
"sodium-23",
|
|
25
|
+
"chlorine-35",
|
|
26
|
+
];
|
|
27
|
+
/** The three pieces of evidence for Dalton's atomic theory. */
|
|
28
|
+
const DALTON_MODES = ["conservation", "fixed", "multiple"];
|
|
29
|
+
/** Props of `AncientAtomLab`: cutting matter until it can be cut no more. */
|
|
30
|
+
function ancientAtomLab(rich) {
|
|
31
|
+
return figure(Schema.Struct({
|
|
32
|
+
...cardFields(rich),
|
|
33
|
+
labels: Schema.Struct({
|
|
34
|
+
aristotleBody: rich,
|
|
35
|
+
aristotleLabel: TextSchema,
|
|
36
|
+
chooseLevel: TextSchema,
|
|
37
|
+
democritusBody: rich,
|
|
38
|
+
democritusLabel: TextSchema,
|
|
39
|
+
levels: byIds(ANCIENT_LEVELS, Schema.Struct({ tab: TextSchema })),
|
|
40
|
+
}),
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/** Props of `AtomShellLab`: the electron shells of one atom at a time. */
|
|
44
|
+
function atomShellLab(rich) {
|
|
45
|
+
return figure(Schema.Struct({
|
|
46
|
+
defaultSampleId: Schema.optionalKey(Schema.Literals(SHELL_SAMPLES)),
|
|
47
|
+
description: Schema.optionalKey(rich),
|
|
48
|
+
labels: Schema.Struct({
|
|
49
|
+
atomicNumber: TextSchema,
|
|
50
|
+
chooseAtom: TextSchema,
|
|
51
|
+
configuration: TextSchema,
|
|
52
|
+
electronTotal: TextSchema,
|
|
53
|
+
maximumCapacity: TextSchema,
|
|
54
|
+
outerShell: TextSchema,
|
|
55
|
+
samples: byIds(SHELL_SAMPLES, Schema.Struct({
|
|
56
|
+
name: Schema.optionalKey(TextSchema),
|
|
57
|
+
note: Schema.optionalKey(rich),
|
|
58
|
+
tab: TextSchema,
|
|
59
|
+
})),
|
|
60
|
+
}),
|
|
61
|
+
title: Schema.optionalKey(rich),
|
|
62
|
+
}), answerAt(["labels", "samples", "*", "note"]));
|
|
63
|
+
}
|
|
64
|
+
/** Props of `AtomSymbolLab`: reading the particles of a nuclide from its symbol. */
|
|
65
|
+
function atomSymbolLab(rich) {
|
|
66
|
+
return figure(Schema.Struct({
|
|
67
|
+
...cardFields(rich),
|
|
68
|
+
labels: Schema.Struct({
|
|
69
|
+
atomicNumber: TextSchema,
|
|
70
|
+
chooseAtom: TextSchema,
|
|
71
|
+
electronCount: TextSchema,
|
|
72
|
+
elementSymbol: TextSchema,
|
|
73
|
+
massNumber: TextSchema,
|
|
74
|
+
neutralAtom: TextSchema,
|
|
75
|
+
neutronCount: TextSchema,
|
|
76
|
+
protonCount: TextSchema,
|
|
77
|
+
samples: byIds(SYMBOL_SAMPLES, Schema.Struct({ ariaName: TextSchema, name: rich, tab: rich })),
|
|
78
|
+
}),
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
/** Props of `DaltonEvidenceLab`: the reactions behind Dalton's theory. */
|
|
82
|
+
function daltonEvidenceLab(rich) {
|
|
83
|
+
return figure(Schema.Struct({
|
|
84
|
+
...cardFields(rich),
|
|
85
|
+
labels: Schema.Struct({
|
|
86
|
+
chooseMode: TextSchema,
|
|
87
|
+
modes: byIds(DALTON_MODES, Schema.Struct({
|
|
88
|
+
afterTitle: TextSchema,
|
|
89
|
+
beforeTitle: TextSchema,
|
|
90
|
+
expression: TextSchema,
|
|
91
|
+
facts: Schema.Array(Schema.Struct({ label: TextSchema, value: TextSchema })),
|
|
92
|
+
tab: TextSchema,
|
|
93
|
+
})),
|
|
94
|
+
}),
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The atom labs. A sample note of the shell model states the configuration
|
|
99
|
+
* and the outer shell it leads to, so it is answer state; every other label
|
|
100
|
+
* names what the lab draws.
|
|
101
|
+
*/
|
|
102
|
+
export function atomVisuals(rich) {
|
|
103
|
+
return {
|
|
104
|
+
AncientAtomLab: ancientAtomLab(rich),
|
|
105
|
+
AtomShellLab: atomShellLab(rich),
|
|
106
|
+
AtomSymbolLab: atomSymbolLab(rich),
|
|
107
|
+
DaltonEvidenceLab: daltonEvidenceLab(rich),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the mass conservation and equation balancing labs. No prop
|
|
5
|
+
* states the conclusion a lab leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function balanceVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
FizzBalanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly chooseSeal: Schema.Trimmed;
|
|
13
|
+
readonly gasEscaped: RichSlot<E>;
|
|
14
|
+
readonly gasFormed: RichSlot<E>;
|
|
15
|
+
readonly readingAfter: RichSlot<E>;
|
|
16
|
+
readonly readingBefore: RichSlot<E>;
|
|
17
|
+
readonly seals: Schema.$Record<Schema.Literals<readonly ["open", "closed"]>, Schema.Trimmed>;
|
|
18
|
+
readonly viewLabel: Schema.Trimmed;
|
|
19
|
+
}>;
|
|
20
|
+
}>, "figure">;
|
|
21
|
+
LavoisierCalxLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
22
|
+
readonly description: RichSlot<E>;
|
|
23
|
+
readonly title: RichSlot<E>;
|
|
24
|
+
readonly labels: Schema.Struct<{
|
|
25
|
+
readonly air: RichSlot<E>;
|
|
26
|
+
readonly airUnit: Schema.Trimmed;
|
|
27
|
+
readonly calx: RichSlot<E>;
|
|
28
|
+
readonly calxUnit: Schema.Trimmed;
|
|
29
|
+
readonly day: Schema.Trimmed;
|
|
30
|
+
readonly reverse: RichSlot<E>;
|
|
31
|
+
readonly reverseLabel: RichSlot<E>;
|
|
32
|
+
readonly viewLabel: Schema.Trimmed;
|
|
33
|
+
}>;
|
|
34
|
+
}>, "figure">;
|
|
35
|
+
PrecipitateLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
36
|
+
readonly description: RichSlot<E>;
|
|
37
|
+
readonly title: RichSlot<E>;
|
|
38
|
+
readonly labels: Schema.Struct<{
|
|
39
|
+
readonly precipitate: RichSlot<E>;
|
|
40
|
+
readonly readingAfter: RichSlot<E>;
|
|
41
|
+
readonly readingBefore: RichSlot<E>;
|
|
42
|
+
readonly viewLabel: Schema.Trimmed;
|
|
43
|
+
}>;
|
|
44
|
+
}>, "figure">;
|
|
45
|
+
SteelWoolLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
46
|
+
readonly description: RichSlot<E>;
|
|
47
|
+
readonly title: RichSlot<E>;
|
|
48
|
+
readonly labels: Schema.Struct<{
|
|
49
|
+
readonly chooseSeal: Schema.Trimmed;
|
|
50
|
+
readonly oxygenJoined: RichSlot<E>;
|
|
51
|
+
readonly readingAfter: RichSlot<E>;
|
|
52
|
+
readonly readingBefore: RichSlot<E>;
|
|
53
|
+
readonly seals: Schema.$Record<Schema.Literals<readonly ["open", "closed"]>, Schema.Trimmed>;
|
|
54
|
+
readonly viewLabel: Schema.Trimmed;
|
|
55
|
+
}>;
|
|
56
|
+
}>, "figure">;
|
|
57
|
+
ReactionBalanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
58
|
+
readonly description: RichSlot<E>;
|
|
59
|
+
readonly title: RichSlot<E>;
|
|
60
|
+
readonly labels: Schema.Struct<{
|
|
61
|
+
readonly atoms: RichSlot<E>;
|
|
62
|
+
readonly choose: Schema.Trimmed;
|
|
63
|
+
readonly economy: Schema.optionalKey<RichSlot<E>>;
|
|
64
|
+
readonly equation: RichSlot<E>;
|
|
65
|
+
readonly mass: RichSlot<E>;
|
|
66
|
+
readonly molecules: Schema.optionalKey<RichSlot<E>>;
|
|
67
|
+
readonly products: RichSlot<E>;
|
|
68
|
+
readonly progress: Schema.Trimmed;
|
|
69
|
+
readonly reactants: RichSlot<E>;
|
|
70
|
+
readonly view: Schema.Trimmed;
|
|
71
|
+
}>;
|
|
72
|
+
readonly reactions: Schema.$Array<Schema.Struct<{
|
|
73
|
+
readonly id: Schema.Literals<readonly ["water-synthesis", "hydrogen-chloride-synthesis", "ammonia-synthesis", "methane-combustion", "propane-combustion", "ethanol-combustion", "peroxide-decomposition", "water-electrolysis", "carbon-monoxide-oxidation", "nitrogen-monoxide-oxidation", "nitrogen-fixation", "sulfur-dioxide-oxidation", "ethene-hydrogenation", "ethene-hydration", "ethanol-dehydration", "ozone-formation", "methanol-synthesis", "carbon-monoxide-methanol"]>;
|
|
74
|
+
readonly name: Schema.Trimmed;
|
|
75
|
+
readonly tab: RichSlot<E>;
|
|
76
|
+
}>>;
|
|
77
|
+
readonly reading: Schema.Literals<readonly ["economy", "molecules"]>;
|
|
78
|
+
}>, "figure">;
|
|
79
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
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 `FizzBalanceLab`: baking soda drops into vinegar in a flask that
|
|
6
|
+
* stands on a balance with everything else.
|
|
7
|
+
*/
|
|
8
|
+
function fizzBalanceLab(rich) {
|
|
9
|
+
return figure(Schema.Struct({
|
|
10
|
+
...cardFields(rich),
|
|
11
|
+
labels: Schema.Struct({
|
|
12
|
+
chooseSeal: TextSchema,
|
|
13
|
+
gasEscaped: rich,
|
|
14
|
+
gasFormed: rich,
|
|
15
|
+
readingAfter: rich,
|
|
16
|
+
readingBefore: rich,
|
|
17
|
+
seals: byIds(["open", "closed"], TextSchema),
|
|
18
|
+
viewLabel: TextSchema,
|
|
19
|
+
}),
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Props of `LavoisierCalxLab`: Lavoisier's experiment of 1776 as he describes
|
|
24
|
+
* it in "Elements of Chemistry".
|
|
25
|
+
*/
|
|
26
|
+
function lavoisierCalxLab(rich) {
|
|
27
|
+
return figure(Schema.Struct({
|
|
28
|
+
...cardFields(rich),
|
|
29
|
+
labels: Schema.Struct({
|
|
30
|
+
air: rich,
|
|
31
|
+
airUnit: TextSchema,
|
|
32
|
+
calx: rich,
|
|
33
|
+
calxUnit: TextSchema,
|
|
34
|
+
day: TextSchema,
|
|
35
|
+
reverse: rich,
|
|
36
|
+
reverseLabel: rich,
|
|
37
|
+
viewLabel: TextSchema,
|
|
38
|
+
}),
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props of `PrecipitateLab`: two clear solutions stand side by side on a
|
|
43
|
+
* balance.
|
|
44
|
+
*/
|
|
45
|
+
function precipitateLab(rich) {
|
|
46
|
+
return figure(Schema.Struct({
|
|
47
|
+
...cardFields(rich),
|
|
48
|
+
labels: Schema.Struct({
|
|
49
|
+
precipitate: rich,
|
|
50
|
+
readingAfter: rich,
|
|
51
|
+
readingBefore: rich,
|
|
52
|
+
viewLabel: TextSchema,
|
|
53
|
+
}),
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Props of `SteelWoolLab`: a tuft of steel wool on a heatproof tile on a
|
|
58
|
+
* balance.
|
|
59
|
+
*/
|
|
60
|
+
function steelWoolLab(rich) {
|
|
61
|
+
return figure(Schema.Struct({
|
|
62
|
+
...cardFields(rich),
|
|
63
|
+
labels: Schema.Struct({
|
|
64
|
+
chooseSeal: TextSchema,
|
|
65
|
+
oxygenJoined: rich,
|
|
66
|
+
readingAfter: rich,
|
|
67
|
+
readingBefore: rich,
|
|
68
|
+
seals: byIds(["open", "closed"], TextSchema),
|
|
69
|
+
viewLabel: TextSchema,
|
|
70
|
+
}),
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
/** Props of `ReactionBalanceLab`: a reaction lab. */
|
|
74
|
+
function reactionBalanceLab(rich) {
|
|
75
|
+
return figure(Schema.Struct({
|
|
76
|
+
...cardFields(rich),
|
|
77
|
+
labels: Schema.Struct({
|
|
78
|
+
atoms: rich,
|
|
79
|
+
choose: TextSchema,
|
|
80
|
+
economy: Schema.optionalKey(rich),
|
|
81
|
+
equation: rich,
|
|
82
|
+
mass: rich,
|
|
83
|
+
molecules: Schema.optionalKey(rich),
|
|
84
|
+
products: rich,
|
|
85
|
+
progress: TextSchema,
|
|
86
|
+
reactants: rich,
|
|
87
|
+
view: TextSchema,
|
|
88
|
+
}),
|
|
89
|
+
reactions: Schema.Array(Schema.Struct({
|
|
90
|
+
id: Schema.Literals([
|
|
91
|
+
"water-synthesis",
|
|
92
|
+
"hydrogen-chloride-synthesis",
|
|
93
|
+
"ammonia-synthesis",
|
|
94
|
+
"methane-combustion",
|
|
95
|
+
"propane-combustion",
|
|
96
|
+
"ethanol-combustion",
|
|
97
|
+
"peroxide-decomposition",
|
|
98
|
+
"water-electrolysis",
|
|
99
|
+
"carbon-monoxide-oxidation",
|
|
100
|
+
"nitrogen-monoxide-oxidation",
|
|
101
|
+
"nitrogen-fixation",
|
|
102
|
+
"sulfur-dioxide-oxidation",
|
|
103
|
+
"ethene-hydrogenation",
|
|
104
|
+
"ethene-hydration",
|
|
105
|
+
"ethanol-dehydration",
|
|
106
|
+
"ozone-formation",
|
|
107
|
+
"methanol-synthesis",
|
|
108
|
+
"carbon-monoxide-methanol",
|
|
109
|
+
]),
|
|
110
|
+
name: TextSchema,
|
|
111
|
+
tab: rich,
|
|
112
|
+
})),
|
|
113
|
+
reading: Schema.Literals(["economy", "molecules"]),
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The props of the mass conservation and equation balancing labs. No prop
|
|
118
|
+
* states the conclusion a lab leads to, so none holds answer state.
|
|
119
|
+
*/
|
|
120
|
+
export function balanceVisuals(rich) {
|
|
121
|
+
return {
|
|
122
|
+
FizzBalanceLab: fizzBalanceLab(rich),
|
|
123
|
+
LavoisierCalxLab: lavoisierCalxLab(rich),
|
|
124
|
+
PrecipitateLab: precipitateLab(rich),
|
|
125
|
+
SteelWoolLab: steelWoolLab(rich),
|
|
126
|
+
ReactionBalanceLab: reactionBalanceLab(rich),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the labs of orbitals, ions, and bonds. No prop states the
|
|
5
|
+
* conclusion a lab leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function bondingVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
AlkaliWaterLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly labels: Schema.Struct<{
|
|
12
|
+
readonly choose: Schema.Trimmed;
|
|
13
|
+
readonly density: RichSlot<E>;
|
|
14
|
+
readonly equation: RichSlot<E>;
|
|
15
|
+
readonly ionization: RichSlot<E>;
|
|
16
|
+
readonly melting: RichSlot<E>;
|
|
17
|
+
readonly radius: RichSlot<E>;
|
|
18
|
+
readonly view: Schema.Trimmed;
|
|
19
|
+
}>;
|
|
20
|
+
readonly metals: Schema.$Array<Schema.Literals<readonly ["lithium", "sodium", "potassium", "magnesium", "calcium"]>>;
|
|
21
|
+
}>, "figure">;
|
|
22
|
+
IonLatticeLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
23
|
+
readonly description: RichSlot<E>;
|
|
24
|
+
readonly title: RichSlot<E>;
|
|
25
|
+
readonly crystals: Schema.$Array<Schema.Literals<readonly ["sodium-chloride", "magnesium-oxide", "lithium-fluoride", "potassium-chloride", "sodium-fluoride", "sodium-bromide"]>>;
|
|
26
|
+
readonly labels: Schema.Struct<{
|
|
27
|
+
readonly cells: Schema.Trimmed;
|
|
28
|
+
readonly choose: Schema.Trimmed;
|
|
29
|
+
readonly count: RichSlot<E>;
|
|
30
|
+
readonly formula: RichSlot<E>;
|
|
31
|
+
readonly ions: RichSlot<E>;
|
|
32
|
+
readonly lattice: RichSlot<E>;
|
|
33
|
+
readonly view: Schema.Trimmed;
|
|
34
|
+
}>;
|
|
35
|
+
}>, "figure">;
|
|
36
|
+
IonFormationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
37
|
+
readonly description: RichSlot<E>;
|
|
38
|
+
readonly title: RichSlot<E>;
|
|
39
|
+
readonly labels: Schema.Struct<{
|
|
40
|
+
readonly choose: Schema.Trimmed;
|
|
41
|
+
readonly metalRadius: RichSlot<E>;
|
|
42
|
+
readonly metalShells: RichSlot<E>;
|
|
43
|
+
readonly nonmetalRadius: RichSlot<E>;
|
|
44
|
+
readonly nonmetalShells: RichSlot<E>;
|
|
45
|
+
readonly progress: Schema.Trimmed;
|
|
46
|
+
readonly view: Schema.Trimmed;
|
|
47
|
+
}>;
|
|
48
|
+
readonly pairs: Schema.$Array<Schema.Literals<readonly ["sodium-chlorine", "magnesium-oxygen", "lithium-fluorine", "potassium-chlorine"]>>;
|
|
49
|
+
}>, "figure">;
|
|
50
|
+
MoleculeShapeLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
51
|
+
readonly description: RichSlot<E>;
|
|
52
|
+
readonly title: RichSlot<E>;
|
|
53
|
+
readonly labels: Schema.Struct<{
|
|
54
|
+
readonly atoms: RichSlot<E>;
|
|
55
|
+
readonly choose: Schema.Trimmed;
|
|
56
|
+
readonly fill: RichSlot<E>;
|
|
57
|
+
readonly formula: RichSlot<E>;
|
|
58
|
+
readonly mass: RichSlot<E>;
|
|
59
|
+
readonly shape: RichSlot<E>;
|
|
60
|
+
readonly view: Schema.Trimmed;
|
|
61
|
+
}>;
|
|
62
|
+
readonly molecules: Schema.$Array<Schema.Struct<{
|
|
63
|
+
readonly id: Schema.Literals<readonly ["hydrogen", "oxygen", "nitrogen", "chlorine", "hydrogen-chloride", "carbon-monoxide", "nitrogen-monoxide", "water", "hydrogen-peroxide", "carbon-dioxide", "sulfur-dioxide", "nitrogen-dioxide", "dinitrogen-monoxide", "ozone", "sulfur-trioxide", "ammonia", "methane", "ethene", "ethane", "ethyne", "propane", "ethanol", "methanol"]>;
|
|
64
|
+
readonly name: Schema.Trimmed;
|
|
65
|
+
}>>;
|
|
66
|
+
}>, "figure">;
|
|
67
|
+
OrbitalCloudLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
68
|
+
readonly description: RichSlot<E>;
|
|
69
|
+
readonly title: RichSlot<E>;
|
|
70
|
+
readonly labels: Schema.Struct<{
|
|
71
|
+
readonly angular: RichSlot<E>;
|
|
72
|
+
readonly choose: Schema.Trimmed;
|
|
73
|
+
readonly numbers: RichSlot<E>;
|
|
74
|
+
readonly orbital: RichSlot<E>;
|
|
75
|
+
readonly radial: RichSlot<E>;
|
|
76
|
+
readonly view: Schema.Trimmed;
|
|
77
|
+
}>;
|
|
78
|
+
readonly orbitals: Schema.$Array<Schema.Literals<readonly ["1s", "2s", "2px", "2pz", "3s", "3pz", "3dz2", "3dxy"]>>;
|
|
79
|
+
}>, "figure">;
|
|
80
|
+
};
|