@nakafa/aksara-contracts 8.10.0 → 8.12.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/biology/binomial.d.ts +139 -0
- package/dist/visual/biology/binomial.js +46 -0
- package/dist/visual/biology/bone.d.ts +141 -0
- package/dist/visual/biology/bone.js +46 -0
- package/dist/visual/biology/chromosome.d.ts +139 -0
- package/dist/visual/biology/chromosome.js +42 -0
- package/dist/visual/biology/control.d.ts +17 -0
- package/dist/visual/biology/control.js +21 -0
- package/dist/visual/biology/denature.d.ts +159 -0
- package/dist/visual/biology/denature.js +74 -0
- package/dist/visual/biology/drawing.d.ts +151 -0
- package/dist/visual/biology/drawing.js +69 -0
- package/dist/visual/biology/enzyme.d.ts +145 -0
- package/dist/visual/biology/enzyme.js +54 -0
- package/dist/visual/biology/equipment.d.ts +140 -0
- package/dist/visual/biology/equipment.js +64 -0
- package/dist/visual/biology/gametogenesis.d.ts +145 -0
- package/dist/visual/biology/gametogenesis.js +83 -0
- package/dist/visual/biology/implantation.d.ts +138 -0
- package/dist/visual/biology/implantation.js +44 -0
- package/dist/visual/biology/joint.d.ts +140 -0
- package/dist/visual/biology/joint.js +47 -0
- package/dist/visual/biology/key.d.ts +141 -0
- package/dist/visual/biology/key.js +58 -0
- package/dist/visual/biology/kingdom.d.ts +142 -0
- package/dist/visual/biology/kingdom.js +82 -0
- package/dist/visual/biology/lactase.d.ts +147 -0
- package/dist/visual/biology/lactase.js +48 -0
- package/dist/visual/biology/limb.d.ts +139 -0
- package/dist/visual/biology/limb.js +44 -0
- package/dist/visual/biology/lipid.d.ts +144 -0
- package/dist/visual/biology/lipid.js +43 -0
- package/dist/visual/biology/locomotion.d.ts +141 -0
- package/dist/visual/biology/locomotion.js +48 -0
- package/dist/visual/biology/menstrual.d.ts +148 -0
- package/dist/visual/biology/menstrual.js +65 -0
- package/dist/visual/biology/metamorphosis.d.ts +140 -0
- package/dist/visual/biology/metamorphosis.js +34 -0
- package/dist/visual/biology/placenta.d.ts +139 -0
- package/dist/visual/biology/placenta.js +52 -0
- package/dist/visual/biology/planes.d.ts +145 -0
- package/dist/visual/biology/planes.js +62 -0
- package/dist/visual/biology/protein.d.ts +142 -0
- package/dist/visual/biology/protein.js +41 -0
- package/dist/visual/biology/saturation.d.ts +149 -0
- package/dist/visual/biology/saturation.js +40 -0
- package/dist/visual/biology/secretion.d.ts +149 -0
- package/dist/visual/biology/secretion.js +79 -0
- package/dist/visual/biology/spill.d.ts +165 -0
- package/dist/visual/biology/spill.js +58 -0
- package/dist/visual/biology/sugar.d.ts +152 -0
- package/dist/visual/biology/sugar.js +59 -0
- package/dist/visual/biology/taxon.d.ts +138 -0
- package/dist/visual/biology/taxon.js +50 -0
- package/dist/visual/biology/twins.d.ts +144 -0
- package/dist/visual/biology/twins.js +60 -0
- package/dist/visual/biology/vernacular.d.ts +141 -0
- package/dist/visual/biology/vernacular.js +57 -0
- package/dist/visual/biology/vertebra.d.ts +141 -0
- package/dist/visual/biology/vertebra.js +59 -0
- package/dist/visual/biology/waste.d.ts +140 -0
- package/dist/visual/biology/waste.js +57 -0
- package/dist/visual/biology/water.d.ts +152 -0
- package/dist/visual/biology/water.js +54 -0
- package/dist/visual/card.d.ts +11 -0
- package/dist/visual/card.js +17 -1
- package/dist/visual/catalog.d.ts +5345 -498
- package/dist/visual/catalog.js +66 -0
- package/dist/visual/mathematics/argument.d.ts +226 -0
- package/dist/visual/mathematics/argument.js +150 -0
- package/dist/visual/mathematics/counterexample.d.ts +340 -0
- package/dist/visual/mathematics/counterexample.js +157 -0
- package/package.json +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The saturation lab. The learner reads the limiting factor by trying, so none is answer state. */
|
|
4
|
+
export declare function saturationVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
EnzymeSaturationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
6
|
+
readonly description: RichSlot<E>;
|
|
7
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
8
|
+
readonly marks?: readonly [{
|
|
9
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
10
|
+
} | {
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "link";
|
|
15
|
+
} | {
|
|
16
|
+
readonly attrs: {
|
|
17
|
+
readonly variant: "success" | "warning" | null;
|
|
18
|
+
};
|
|
19
|
+
readonly type: "highlight";
|
|
20
|
+
}, ...({
|
|
21
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
22
|
+
} | {
|
|
23
|
+
readonly attrs: {
|
|
24
|
+
readonly href: string;
|
|
25
|
+
};
|
|
26
|
+
readonly type: "link";
|
|
27
|
+
} | {
|
|
28
|
+
readonly attrs: {
|
|
29
|
+
readonly variant: "success" | "warning" | null;
|
|
30
|
+
};
|
|
31
|
+
readonly type: "highlight";
|
|
32
|
+
})[]];
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly latex: string;
|
|
38
|
+
};
|
|
39
|
+
readonly marks?: readonly [{
|
|
40
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
41
|
+
} | {
|
|
42
|
+
readonly attrs: {
|
|
43
|
+
readonly href: string;
|
|
44
|
+
};
|
|
45
|
+
readonly type: "link";
|
|
46
|
+
} | {
|
|
47
|
+
readonly attrs: {
|
|
48
|
+
readonly variant: "success" | "warning" | null;
|
|
49
|
+
};
|
|
50
|
+
readonly type: "highlight";
|
|
51
|
+
}, ...({
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
})[]];
|
|
64
|
+
readonly type: "mathInline";
|
|
65
|
+
}, ...({
|
|
66
|
+
readonly marks?: readonly [{
|
|
67
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly href: string;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "link";
|
|
73
|
+
} | {
|
|
74
|
+
readonly attrs: {
|
|
75
|
+
readonly variant: "success" | "warning" | null;
|
|
76
|
+
};
|
|
77
|
+
readonly type: "highlight";
|
|
78
|
+
}, ...({
|
|
79
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
80
|
+
} | {
|
|
81
|
+
readonly attrs: {
|
|
82
|
+
readonly href: string;
|
|
83
|
+
};
|
|
84
|
+
readonly type: "link";
|
|
85
|
+
} | {
|
|
86
|
+
readonly attrs: {
|
|
87
|
+
readonly variant: "success" | "warning" | null;
|
|
88
|
+
};
|
|
89
|
+
readonly type: "highlight";
|
|
90
|
+
})[]];
|
|
91
|
+
readonly text: string;
|
|
92
|
+
readonly type: "text";
|
|
93
|
+
} | {
|
|
94
|
+
readonly attrs: {
|
|
95
|
+
readonly latex: string;
|
|
96
|
+
};
|
|
97
|
+
readonly marks?: readonly [{
|
|
98
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
99
|
+
} | {
|
|
100
|
+
readonly attrs: {
|
|
101
|
+
readonly href: string;
|
|
102
|
+
};
|
|
103
|
+
readonly type: "link";
|
|
104
|
+
} | {
|
|
105
|
+
readonly attrs: {
|
|
106
|
+
readonly variant: "success" | "warning" | null;
|
|
107
|
+
};
|
|
108
|
+
readonly type: "highlight";
|
|
109
|
+
}, ...({
|
|
110
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
111
|
+
} | {
|
|
112
|
+
readonly attrs: {
|
|
113
|
+
readonly href: string;
|
|
114
|
+
};
|
|
115
|
+
readonly type: "link";
|
|
116
|
+
} | {
|
|
117
|
+
readonly attrs: {
|
|
118
|
+
readonly variant: "success" | "warning" | null;
|
|
119
|
+
};
|
|
120
|
+
readonly type: "highlight";
|
|
121
|
+
})[]];
|
|
122
|
+
readonly type: "mathInline";
|
|
123
|
+
})[]], E, never, never>>;
|
|
124
|
+
readonly title: RichSlot<E>;
|
|
125
|
+
readonly enzymes: Schema.Struct<{
|
|
126
|
+
readonly max: Schema.Codec<number, number, never, never>;
|
|
127
|
+
readonly min: Schema.Codec<number, number, never, never>;
|
|
128
|
+
readonly value: Schema.Codec<number, number, never, never>;
|
|
129
|
+
}>;
|
|
130
|
+
readonly labels: Schema.Struct<{
|
|
131
|
+
readonly busy: RichSlot<E>;
|
|
132
|
+
readonly curve: RichSlot<E>;
|
|
133
|
+
readonly enzymes: Schema.Trimmed;
|
|
134
|
+
readonly limiting: RichSlot<E>;
|
|
135
|
+
readonly limits: Schema.$Record<Schema.Literals<readonly ["substrate", "enzyme"]>, RichSlot<E>>;
|
|
136
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["enzyme", "substrate", "product"]>, Schema.Trimmed>;
|
|
137
|
+
readonly rate: RichSlot<E>;
|
|
138
|
+
readonly substrates: Schema.Trimmed;
|
|
139
|
+
readonly time: Schema.Trimmed;
|
|
140
|
+
readonly view: Schema.Trimmed;
|
|
141
|
+
}>;
|
|
142
|
+
readonly substrates: Schema.Struct<{
|
|
143
|
+
readonly max: Schema.Codec<number, number, never, never>;
|
|
144
|
+
readonly min: Schema.Codec<number, number, never, never>;
|
|
145
|
+
readonly value: Schema.Codec<number, number, never, never>;
|
|
146
|
+
}>;
|
|
147
|
+
readonly turnover: Schema.Finite;
|
|
148
|
+
}>, "figure">;
|
|
149
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { sliderOf } from "#contracts/visual/biology/control";
|
|
3
|
+
import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
|
|
4
|
+
import { figure } from "#contracts/visual/entry";
|
|
5
|
+
/** How many enzyme molecules the scene draws: one up to forty. */
|
|
6
|
+
const EnzymeCountSchema = Schema.Int.check(Schema.isBetween({ maximum: 40, minimum: 1 }));
|
|
7
|
+
/** How many substrate molecules the scene draws: none up to four hundred. */
|
|
8
|
+
const SubstrateCountSchema = Schema.Int.check(Schema.isBetween({ maximum: 400, minimum: 0 }));
|
|
9
|
+
/**
|
|
10
|
+
* Props of `EnzymeSaturationLab`: enzyme and substrate molecules in solution,
|
|
11
|
+
* seen close up and slowed down. The learner sets how many of each there are
|
|
12
|
+
* with the `enzymes` and `substrates` sliders; one busy active site finishes
|
|
13
|
+
* `turnover` substrates per second. The readouts give the busy active sites,
|
|
14
|
+
* the rate, which factor limits it, and the rate curve against substrate
|
|
15
|
+
* concentration.
|
|
16
|
+
*/
|
|
17
|
+
function enzymeSaturationLab(rich) {
|
|
18
|
+
return figure(Schema.Struct({
|
|
19
|
+
...cardFields(rich),
|
|
20
|
+
enzymes: sliderOf(EnzymeCountSchema),
|
|
21
|
+
labels: Schema.Struct({
|
|
22
|
+
busy: rich,
|
|
23
|
+
curve: rich,
|
|
24
|
+
enzymes: TextSchema,
|
|
25
|
+
limiting: rich,
|
|
26
|
+
limits: byIds(["substrate", "enzyme"], rich),
|
|
27
|
+
parts: byIds(["enzyme", "substrate", "product"], TextSchema),
|
|
28
|
+
rate: rich,
|
|
29
|
+
substrates: TextSchema,
|
|
30
|
+
time: TextSchema,
|
|
31
|
+
view: TextSchema,
|
|
32
|
+
}),
|
|
33
|
+
substrates: sliderOf(SubstrateCountSchema),
|
|
34
|
+
turnover: Schema.Finite.check(Schema.isGreaterThan(0)),
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
/** The saturation lab. The learner reads the limiting factor by trying, so none is answer state. */
|
|
38
|
+
export function saturationVisuals(rich) {
|
|
39
|
+
return { EnzymeSaturationLab: enzymeSaturationLab(rich) };
|
|
40
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The secretion lab. Every stage is taught as it plays, so none is answer state. */
|
|
4
|
+
export declare function secretionVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
EnzymeSecretionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
6
|
+
readonly description: RichSlot<E>;
|
|
7
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
8
|
+
readonly marks?: readonly [{
|
|
9
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
10
|
+
} | {
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "link";
|
|
15
|
+
} | {
|
|
16
|
+
readonly attrs: {
|
|
17
|
+
readonly variant: "success" | "warning" | null;
|
|
18
|
+
};
|
|
19
|
+
readonly type: "highlight";
|
|
20
|
+
}, ...({
|
|
21
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
22
|
+
} | {
|
|
23
|
+
readonly attrs: {
|
|
24
|
+
readonly href: string;
|
|
25
|
+
};
|
|
26
|
+
readonly type: "link";
|
|
27
|
+
} | {
|
|
28
|
+
readonly attrs: {
|
|
29
|
+
readonly variant: "success" | "warning" | null;
|
|
30
|
+
};
|
|
31
|
+
readonly type: "highlight";
|
|
32
|
+
})[]];
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly latex: string;
|
|
38
|
+
};
|
|
39
|
+
readonly marks?: readonly [{
|
|
40
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
41
|
+
} | {
|
|
42
|
+
readonly attrs: {
|
|
43
|
+
readonly href: string;
|
|
44
|
+
};
|
|
45
|
+
readonly type: "link";
|
|
46
|
+
} | {
|
|
47
|
+
readonly attrs: {
|
|
48
|
+
readonly variant: "success" | "warning" | null;
|
|
49
|
+
};
|
|
50
|
+
readonly type: "highlight";
|
|
51
|
+
}, ...({
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
})[]];
|
|
64
|
+
readonly type: "mathInline";
|
|
65
|
+
}, ...({
|
|
66
|
+
readonly marks?: readonly [{
|
|
67
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly href: string;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "link";
|
|
73
|
+
} | {
|
|
74
|
+
readonly attrs: {
|
|
75
|
+
readonly variant: "success" | "warning" | null;
|
|
76
|
+
};
|
|
77
|
+
readonly type: "highlight";
|
|
78
|
+
}, ...({
|
|
79
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
80
|
+
} | {
|
|
81
|
+
readonly attrs: {
|
|
82
|
+
readonly href: string;
|
|
83
|
+
};
|
|
84
|
+
readonly type: "link";
|
|
85
|
+
} | {
|
|
86
|
+
readonly attrs: {
|
|
87
|
+
readonly variant: "success" | "warning" | null;
|
|
88
|
+
};
|
|
89
|
+
readonly type: "highlight";
|
|
90
|
+
})[]];
|
|
91
|
+
readonly text: string;
|
|
92
|
+
readonly type: "text";
|
|
93
|
+
} | {
|
|
94
|
+
readonly attrs: {
|
|
95
|
+
readonly latex: string;
|
|
96
|
+
};
|
|
97
|
+
readonly marks?: readonly [{
|
|
98
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
99
|
+
} | {
|
|
100
|
+
readonly attrs: {
|
|
101
|
+
readonly href: string;
|
|
102
|
+
};
|
|
103
|
+
readonly type: "link";
|
|
104
|
+
} | {
|
|
105
|
+
readonly attrs: {
|
|
106
|
+
readonly variant: "success" | "warning" | null;
|
|
107
|
+
};
|
|
108
|
+
readonly type: "highlight";
|
|
109
|
+
}, ...({
|
|
110
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
111
|
+
} | {
|
|
112
|
+
readonly attrs: {
|
|
113
|
+
readonly href: string;
|
|
114
|
+
};
|
|
115
|
+
readonly type: "link";
|
|
116
|
+
} | {
|
|
117
|
+
readonly attrs: {
|
|
118
|
+
readonly variant: "success" | "warning" | null;
|
|
119
|
+
};
|
|
120
|
+
readonly type: "highlight";
|
|
121
|
+
})[]];
|
|
122
|
+
readonly type: "mathInline";
|
|
123
|
+
})[]], E, never, never>>;
|
|
124
|
+
readonly title: RichSlot<E>;
|
|
125
|
+
readonly labels: Schema.Struct<{
|
|
126
|
+
readonly example: RichSlot<E>;
|
|
127
|
+
readonly examples: Schema.$Record<Schema.Literals<readonly ["intracellular", "extracellular"]>, Schema.optionalKey<RichSlot<E>>>;
|
|
128
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["nucleus", "ribosome", "reticulum", "golgi", "vesicle", "membrane", "duct"]>, Schema.Trimmed>;
|
|
129
|
+
readonly place: RichSlot<E>;
|
|
130
|
+
readonly places: Schema.$Record<Schema.Literals<readonly ["intracellular", "extracellular"]>, Schema.optionalKey<RichSlot<E>>>;
|
|
131
|
+
readonly route: Schema.Trimmed;
|
|
132
|
+
readonly routes: Schema.$Record<Schema.Literals<readonly ["intracellular", "extracellular"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
133
|
+
readonly step: RichSlot<E>;
|
|
134
|
+
readonly steps: Schema.Struct<{
|
|
135
|
+
readonly boundRibosome: Schema.optionalKey<RichSlot<E>>;
|
|
136
|
+
readonly cytoplasm: Schema.optionalKey<RichSlot<E>>;
|
|
137
|
+
readonly exocytosis: Schema.optionalKey<RichSlot<E>>;
|
|
138
|
+
readonly freeRibosome: Schema.optionalKey<RichSlot<E>>;
|
|
139
|
+
readonly golgi: Schema.optionalKey<RichSlot<E>>;
|
|
140
|
+
readonly nucleus: Schema.optionalKey<RichSlot<E>>;
|
|
141
|
+
readonly reticulum: Schema.optionalKey<RichSlot<E>>;
|
|
142
|
+
readonly secretory: Schema.optionalKey<RichSlot<E>>;
|
|
143
|
+
readonly transport: Schema.optionalKey<RichSlot<E>>;
|
|
144
|
+
}>;
|
|
145
|
+
readonly view: Schema.Trimmed;
|
|
146
|
+
}>;
|
|
147
|
+
readonly routes: Schema.NonEmptyArray<Schema.Literals<readonly ["intracellular", "extracellular"]>>;
|
|
148
|
+
}>, "figure">;
|
|
149
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Array as Arr, Schema } from "effect";
|
|
2
|
+
import { pickedFrom } from "#contracts/visual/biology/control";
|
|
3
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
4
|
+
import { figure } from "#contracts/visual/entry";
|
|
5
|
+
const ROUTES = ["intracellular", "extracellular"];
|
|
6
|
+
/**
|
|
7
|
+
* The stages of each route, in the order the scene plays them. An
|
|
8
|
+
* intracellular enzyme is built on a free ribosome and stays in the
|
|
9
|
+
* cytoplasm; an extracellular enzyme is built on the rough endoplasmic
|
|
10
|
+
* reticulum, folds inside it, travels in a transport vesicle to the Golgi
|
|
11
|
+
* apparatus and leaves in a secretory vesicle by exocytosis.
|
|
12
|
+
*/
|
|
13
|
+
const ROUTE_STEPS = {
|
|
14
|
+
extracellular: [
|
|
15
|
+
"nucleus",
|
|
16
|
+
"boundRibosome",
|
|
17
|
+
"reticulum",
|
|
18
|
+
"transport",
|
|
19
|
+
"golgi",
|
|
20
|
+
"secretory",
|
|
21
|
+
"exocytosis",
|
|
22
|
+
],
|
|
23
|
+
intracellular: ["nucleus", "freeRibosome", "cytoplasm"],
|
|
24
|
+
};
|
|
25
|
+
/** The words of every stage, each given exactly when a shown route plays it. */
|
|
26
|
+
function stepWords(rich) {
|
|
27
|
+
return Schema.Struct({
|
|
28
|
+
boundRibosome: Schema.optionalKey(rich),
|
|
29
|
+
cytoplasm: Schema.optionalKey(rich),
|
|
30
|
+
exocytosis: Schema.optionalKey(rich),
|
|
31
|
+
freeRibosome: Schema.optionalKey(rich),
|
|
32
|
+
golgi: Schema.optionalKey(rich),
|
|
33
|
+
nucleus: Schema.optionalKey(rich),
|
|
34
|
+
reticulum: Schema.optionalKey(rich),
|
|
35
|
+
secretory: Schema.optionalKey(rich),
|
|
36
|
+
transport: Schema.optionalKey(rich),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props of `EnzymeSecretionLab`: one acinar cell of the pancreas opened up to
|
|
41
|
+
* show its organelles. The learner picks one of `routes` (each once, in
|
|
42
|
+
* toggle order) and plays the enzyme's path one stage at a time; the
|
|
43
|
+
* readouts give the stage, an example enzyme and where it works.
|
|
44
|
+
*/
|
|
45
|
+
function enzymeSecretionLab(rich) {
|
|
46
|
+
return figure(Schema.Struct({
|
|
47
|
+
...cardFields(rich),
|
|
48
|
+
labels: Schema.Struct({
|
|
49
|
+
example: rich,
|
|
50
|
+
examples: byPickedIds(ROUTES, rich),
|
|
51
|
+
parts: byIds([
|
|
52
|
+
"nucleus",
|
|
53
|
+
"ribosome",
|
|
54
|
+
"reticulum",
|
|
55
|
+
"golgi",
|
|
56
|
+
"vesicle",
|
|
57
|
+
"membrane",
|
|
58
|
+
"duct",
|
|
59
|
+
], TextSchema),
|
|
60
|
+
place: rich,
|
|
61
|
+
places: byPickedIds(ROUTES, rich),
|
|
62
|
+
route: TextSchema,
|
|
63
|
+
routes: byPickedIds(ROUTES, TextSchema),
|
|
64
|
+
step: rich,
|
|
65
|
+
steps: stepWords(rich),
|
|
66
|
+
view: TextSchema,
|
|
67
|
+
}),
|
|
68
|
+
routes: pickedFrom(ROUTES),
|
|
69
|
+
}).check(Schema.makeFilter(({ labels, routes }) => namesEach(routes, labels.routes) &&
|
|
70
|
+
namesEach(routes, labels.examples) &&
|
|
71
|
+
namesEach(routes, labels.places) &&
|
|
72
|
+
namesEach(Arr.flatMap(routes, (route) => ROUTE_STEPS[route]), labels.steps), {
|
|
73
|
+
message: "Expected a name, an example and a workplace for every route the lab shows, and words for exactly the stages those routes play.",
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
/** The secretion lab. Every stage is taught as it plays, so none is answer state. */
|
|
77
|
+
export function secretionVisuals(rich) {
|
|
78
|
+
return { EnzymeSecretionLab: enzymeSecretionLab(rich) };
|
|
79
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The accident lab. Each response is taught step by step, so none is answer state. */
|
|
4
|
+
export declare function spillVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
SpillResponseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
6
|
+
readonly description: RichSlot<E>;
|
|
7
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
8
|
+
readonly marks?: readonly [{
|
|
9
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
10
|
+
} | {
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "link";
|
|
15
|
+
} | {
|
|
16
|
+
readonly attrs: {
|
|
17
|
+
readonly variant: "success" | "warning" | null;
|
|
18
|
+
};
|
|
19
|
+
readonly type: "highlight";
|
|
20
|
+
}, ...({
|
|
21
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
22
|
+
} | {
|
|
23
|
+
readonly attrs: {
|
|
24
|
+
readonly href: string;
|
|
25
|
+
};
|
|
26
|
+
readonly type: "link";
|
|
27
|
+
} | {
|
|
28
|
+
readonly attrs: {
|
|
29
|
+
readonly variant: "success" | "warning" | null;
|
|
30
|
+
};
|
|
31
|
+
readonly type: "highlight";
|
|
32
|
+
})[]];
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly latex: string;
|
|
38
|
+
};
|
|
39
|
+
readonly marks?: readonly [{
|
|
40
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
41
|
+
} | {
|
|
42
|
+
readonly attrs: {
|
|
43
|
+
readonly href: string;
|
|
44
|
+
};
|
|
45
|
+
readonly type: "link";
|
|
46
|
+
} | {
|
|
47
|
+
readonly attrs: {
|
|
48
|
+
readonly variant: "success" | "warning" | null;
|
|
49
|
+
};
|
|
50
|
+
readonly type: "highlight";
|
|
51
|
+
}, ...({
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
})[]];
|
|
64
|
+
readonly type: "mathInline";
|
|
65
|
+
}, ...({
|
|
66
|
+
readonly marks?: readonly [{
|
|
67
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly href: string;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "link";
|
|
73
|
+
} | {
|
|
74
|
+
readonly attrs: {
|
|
75
|
+
readonly variant: "success" | "warning" | null;
|
|
76
|
+
};
|
|
77
|
+
readonly type: "highlight";
|
|
78
|
+
}, ...({
|
|
79
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
80
|
+
} | {
|
|
81
|
+
readonly attrs: {
|
|
82
|
+
readonly href: string;
|
|
83
|
+
};
|
|
84
|
+
readonly type: "link";
|
|
85
|
+
} | {
|
|
86
|
+
readonly attrs: {
|
|
87
|
+
readonly variant: "success" | "warning" | null;
|
|
88
|
+
};
|
|
89
|
+
readonly type: "highlight";
|
|
90
|
+
})[]];
|
|
91
|
+
readonly text: string;
|
|
92
|
+
readonly type: "text";
|
|
93
|
+
} | {
|
|
94
|
+
readonly attrs: {
|
|
95
|
+
readonly latex: string;
|
|
96
|
+
};
|
|
97
|
+
readonly marks?: readonly [{
|
|
98
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
99
|
+
} | {
|
|
100
|
+
readonly attrs: {
|
|
101
|
+
readonly href: string;
|
|
102
|
+
};
|
|
103
|
+
readonly type: "link";
|
|
104
|
+
} | {
|
|
105
|
+
readonly attrs: {
|
|
106
|
+
readonly variant: "success" | "warning" | null;
|
|
107
|
+
};
|
|
108
|
+
readonly type: "highlight";
|
|
109
|
+
}, ...({
|
|
110
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
111
|
+
} | {
|
|
112
|
+
readonly attrs: {
|
|
113
|
+
readonly href: string;
|
|
114
|
+
};
|
|
115
|
+
readonly type: "link";
|
|
116
|
+
} | {
|
|
117
|
+
readonly attrs: {
|
|
118
|
+
readonly variant: "success" | "warning" | null;
|
|
119
|
+
};
|
|
120
|
+
readonly type: "highlight";
|
|
121
|
+
})[]];
|
|
122
|
+
readonly type: "mathInline";
|
|
123
|
+
})[]], E, never, never>>;
|
|
124
|
+
readonly title: RichSlot<E>;
|
|
125
|
+
readonly incidents: Schema.NonEmptyArray<Schema.Literals<readonly ["eye", "mercury", "culture", "glass", "fire"]>>;
|
|
126
|
+
readonly labels: Schema.Struct<{
|
|
127
|
+
readonly incident: Schema.Trimmed;
|
|
128
|
+
readonly incidents: Schema.$Record<Schema.Literals<readonly ["eye", "mercury", "culture", "glass", "fire"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
129
|
+
readonly step: RichSlot<E>;
|
|
130
|
+
readonly steps: Schema.Struct<{
|
|
131
|
+
readonly culture: Schema.optionalKey<Schema.Struct<{
|
|
132
|
+
readonly alert: RichSlot<E>;
|
|
133
|
+
readonly collect: RichSlot<E>;
|
|
134
|
+
readonly cover: RichSlot<E>;
|
|
135
|
+
readonly soak: RichSlot<E>;
|
|
136
|
+
}>>;
|
|
137
|
+
readonly eye: Schema.optionalKey<Schema.Struct<{
|
|
138
|
+
readonly alert: RichSlot<E>;
|
|
139
|
+
readonly help: RichSlot<E>;
|
|
140
|
+
readonly open: RichSlot<E>;
|
|
141
|
+
readonly rinse: RichSlot<E>;
|
|
142
|
+
}>>;
|
|
143
|
+
readonly fire: Schema.optionalKey<Schema.Struct<{
|
|
144
|
+
readonly extinguish: RichSlot<E>;
|
|
145
|
+
readonly gas: RichSlot<E>;
|
|
146
|
+
readonly leave: RichSlot<E>;
|
|
147
|
+
readonly smother: RichSlot<E>;
|
|
148
|
+
}>>;
|
|
149
|
+
readonly glass: Schema.optionalKey<Schema.Struct<{
|
|
150
|
+
readonly alert: RichSlot<E>;
|
|
151
|
+
readonly box: RichSlot<E>;
|
|
152
|
+
readonly sweep: RichSlot<E>;
|
|
153
|
+
}>>;
|
|
154
|
+
readonly mercury: Schema.optionalKey<Schema.Struct<{
|
|
155
|
+
readonly air: RichSlot<E>;
|
|
156
|
+
readonly clear: RichSlot<E>;
|
|
157
|
+
readonly gather: RichSlot<E>;
|
|
158
|
+
readonly seal: RichSlot<E>;
|
|
159
|
+
readonly sulfur: RichSlot<E>;
|
|
160
|
+
}>>;
|
|
161
|
+
}>;
|
|
162
|
+
readonly view: Schema.Trimmed;
|
|
163
|
+
}>;
|
|
164
|
+
}>, "figure">;
|
|
165
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
const INCIDENTS = ["eye", "mercury", "culture", "glass", "fire"];
|
|
5
|
+
/**
|
|
6
|
+
* The stages of each response, in the order the scene plays them:
|
|
7
|
+
* - `eye`: `alert` the teacher and reach the eyewash, hold the lids `open`,
|
|
8
|
+
* `rinse` for at least 15 minutes, get medical `help` with the chemical's name.
|
|
9
|
+
* - `mercury`: `clear` the area, let in `air`, `gather` the beads with a card
|
|
10
|
+
* and dropper, cover the rest with `sulfur`, `seal` the waste in a labelled jar.
|
|
11
|
+
* - `culture`: `alert` and keep people away, `cover` with paper towels, `soak`
|
|
12
|
+
* them in disinfectant for its contact time, `collect` into a biohazard bag.
|
|
13
|
+
* - `glass`: `alert` and never pick it up by hand, `sweep` it up, put it in the `box`.
|
|
14
|
+
* - `fire`: shut off the `gas`, `smother` with the fire blanket, `extinguish`
|
|
15
|
+
* with carbon dioxide and never water, `leave` and raise the alarm if it grows.
|
|
16
|
+
*/
|
|
17
|
+
function responseSteps(rich) {
|
|
18
|
+
return Schema.Struct({
|
|
19
|
+
culture: Schema.optionalKey(Schema.Struct({ alert: rich, collect: rich, cover: rich, soak: rich })),
|
|
20
|
+
eye: Schema.optionalKey(Schema.Struct({ alert: rich, help: rich, open: rich, rinse: rich })),
|
|
21
|
+
fire: Schema.optionalKey(Schema.Struct({ extinguish: rich, gas: rich, leave: rich, smother: rich })),
|
|
22
|
+
glass: Schema.optionalKey(Schema.Struct({ alert: rich, box: rich, sweep: rich })),
|
|
23
|
+
mercury: Schema.optionalKey(Schema.Struct({
|
|
24
|
+
air: rich,
|
|
25
|
+
clear: rich,
|
|
26
|
+
gather: rich,
|
|
27
|
+
seal: rich,
|
|
28
|
+
sulfur: rich,
|
|
29
|
+
})),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Props of `SpillResponseLab`: a lab bench where one of `incidents` has just
|
|
34
|
+
* happened, each listed once in the order the toggle shows them. The learner
|
|
35
|
+
* plays the response one stage at a time; the scene acts each stage out and
|
|
36
|
+
* the readout gives its words from `labels.steps`, one ordered response for
|
|
37
|
+
* each incident and no other.
|
|
38
|
+
*/
|
|
39
|
+
function spillResponseLab(rich) {
|
|
40
|
+
return figure(Schema.Struct({
|
|
41
|
+
...cardFields(rich),
|
|
42
|
+
incidents: Schema.NonEmptyArray(Schema.Literals(INCIDENTS)).check(Schema.isUnique()),
|
|
43
|
+
labels: Schema.Struct({
|
|
44
|
+
incident: TextSchema,
|
|
45
|
+
incidents: byPickedIds(INCIDENTS, TextSchema),
|
|
46
|
+
step: rich,
|
|
47
|
+
steps: responseSteps(rich),
|
|
48
|
+
view: TextSchema,
|
|
49
|
+
}),
|
|
50
|
+
}).check(Schema.makeFilter(({ incidents, labels }) => namesEach(incidents, labels.incidents) &&
|
|
51
|
+
namesEach(incidents, labels.steps), {
|
|
52
|
+
message: "Expected a name and a response for every incident the lab shows, and for no other.",
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
/** The accident lab. Each response is taught step by step, so none is answer state. */
|
|
56
|
+
export function spillVisuals(rich) {
|
|
57
|
+
return { SpillResponseLab: spillResponseLab(rich) };
|
|
58
|
+
}
|