@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,147 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The immobilised lactase lab. The learner compares the methods by trying, so none is answer state. */
|
|
4
|
+
export declare function lactaseVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
LactaseColumnLab: 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 flow: 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 batches: RichSlot<E>;
|
|
132
|
+
readonly enzyme: RichSlot<E>;
|
|
133
|
+
readonly flow: Schema.Trimmed;
|
|
134
|
+
readonly glucose: RichSlot<E>;
|
|
135
|
+
readonly lactose: RichSlot<E>;
|
|
136
|
+
readonly method: Schema.Trimmed;
|
|
137
|
+
readonly methods: Schema.$Record<Schema.Literals<readonly ["immobilised", "free"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
138
|
+
readonly negative: RichSlot<E>;
|
|
139
|
+
readonly none: RichSlot<E>;
|
|
140
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["column", "beads", "milk", "strip"]>, Schema.Trimmed>;
|
|
141
|
+
readonly positive: RichSlot<E>;
|
|
142
|
+
readonly present: RichSlot<E>;
|
|
143
|
+
readonly view: Schema.Trimmed;
|
|
144
|
+
}>;
|
|
145
|
+
readonly methods: Schema.NonEmptyArray<Schema.Literals<readonly ["immobilised", "free"]>>;
|
|
146
|
+
}>, "figure">;
|
|
147
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { pickedFrom, sliderOf } from "#contracts/visual/biology/control";
|
|
3
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
4
|
+
import { figure } from "#contracts/visual/entry";
|
|
5
|
+
/**
|
|
6
|
+
* The two ways to make lactose-reduced milk: lactase held in alginate beads
|
|
7
|
+
* in a column the milk flows through, or lactase stirred straight into the
|
|
8
|
+
* milk, which then leaves with it.
|
|
9
|
+
*/
|
|
10
|
+
const METHODS = ["immobilised", "free"];
|
|
11
|
+
/** A milk flow rate through the column in millilitres per minute, up to twenty. */
|
|
12
|
+
const FlowSchema = Schema.Finite.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(20));
|
|
13
|
+
/**
|
|
14
|
+
* Props of `LactaseColumnLab`: a glass column of alginate beads with milk
|
|
15
|
+
* flowing through it, or a beaker of milk with lactase stirred in, picked
|
|
16
|
+
* from `methods` (each once, in toggle order). The learner sets the milk
|
|
17
|
+
* `flow`; the readouts give the lactose left, the glucose test strip result,
|
|
18
|
+
* whether lactase leaves in the milk, and how many batches the same lactase
|
|
19
|
+
* treats.
|
|
20
|
+
*/
|
|
21
|
+
function lactaseColumnLab(rich) {
|
|
22
|
+
return figure(Schema.Struct({
|
|
23
|
+
...cardFields(rich),
|
|
24
|
+
flow: sliderOf(FlowSchema),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
batches: rich,
|
|
27
|
+
enzyme: rich,
|
|
28
|
+
flow: TextSchema,
|
|
29
|
+
glucose: rich,
|
|
30
|
+
lactose: rich,
|
|
31
|
+
method: TextSchema,
|
|
32
|
+
methods: byPickedIds(METHODS, TextSchema),
|
|
33
|
+
negative: rich,
|
|
34
|
+
none: rich,
|
|
35
|
+
parts: byIds(["column", "beads", "milk", "strip"], TextSchema),
|
|
36
|
+
positive: rich,
|
|
37
|
+
present: rich,
|
|
38
|
+
view: TextSchema,
|
|
39
|
+
}),
|
|
40
|
+
methods: pickedFrom(METHODS),
|
|
41
|
+
}).check(Schema.makeFilter(({ labels, methods }) => namesEach(methods, labels.methods), {
|
|
42
|
+
message: "Expected a name for every method the lab shows, and no other.",
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
/** The immobilised lactase lab. The learner compares the methods by trying, so none is answer state. */
|
|
46
|
+
export function lactaseVisuals(rich) {
|
|
47
|
+
return { LactaseColumnLab: lactaseColumnLab(rich) };
|
|
48
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The muscle pair lab. Which muscle contracts is shown as the learner moves; no prop is answer state. */
|
|
4
|
+
export declare function limbVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
MusclePairLab: 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 angle: Schema.Trimmed;
|
|
127
|
+
readonly contracting: RichSlot<E>;
|
|
128
|
+
readonly limb: Schema.Trimmed;
|
|
129
|
+
readonly limbs: Schema.$Record<Schema.Literals<readonly ["arm", "leg"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
130
|
+
readonly movement: Schema.Trimmed;
|
|
131
|
+
readonly movements: Schema.$Record<Schema.Literals<readonly ["heel", "toes", "bend", "straighten"]>, Schema.Trimmed>;
|
|
132
|
+
readonly muscles: Schema.$Record<Schema.Literals<readonly ["biceps", "triceps", "quadriceps", "hamstrings", "gastrocnemius", "tibialis"]>, Schema.Trimmed>;
|
|
133
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["humerus", "radius", "ulna", "femur", "tibia", "tendon"]>, Schema.Trimmed>;
|
|
134
|
+
readonly relaxing: RichSlot<E>;
|
|
135
|
+
readonly view: Schema.Trimmed;
|
|
136
|
+
}>;
|
|
137
|
+
readonly limbs: Schema.NonEmptyArray<Schema.Literals<readonly ["arm", "leg"]>>;
|
|
138
|
+
}>, "figure">;
|
|
139
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
const LIMBS = ["arm", "leg"];
|
|
5
|
+
/**
|
|
6
|
+
* Props of `MusclePairLab`: antagonistic muscles in a human arm, a human leg,
|
|
7
|
+
* or both (`limbs`, each once, in the order the toggle lists them). In the arm
|
|
8
|
+
* the learner sets the elbow angle (`labels.angle`) and the biceps and triceps
|
|
9
|
+
* take turns; in the leg the learner picks a movement of the knee or ankle
|
|
10
|
+
* (`labels.movements`) and the quadriceps, hamstrings, gastrocnemius and
|
|
11
|
+
* tibialis anterior take turns. The readouts name the muscle that contracts and
|
|
12
|
+
* the one that relaxes; the scene labels the bones and a tendon.
|
|
13
|
+
*/
|
|
14
|
+
function musclePairLab(rich) {
|
|
15
|
+
return figure(Schema.Struct({
|
|
16
|
+
...cardFields(rich),
|
|
17
|
+
labels: Schema.Struct({
|
|
18
|
+
angle: TextSchema,
|
|
19
|
+
contracting: rich,
|
|
20
|
+
limb: TextSchema,
|
|
21
|
+
limbs: byPickedIds(LIMBS, TextSchema),
|
|
22
|
+
movement: TextSchema,
|
|
23
|
+
movements: byIds(["heel", "toes", "bend", "straighten"], TextSchema),
|
|
24
|
+
muscles: byIds([
|
|
25
|
+
"biceps",
|
|
26
|
+
"triceps",
|
|
27
|
+
"quadriceps",
|
|
28
|
+
"hamstrings",
|
|
29
|
+
"gastrocnemius",
|
|
30
|
+
"tibialis",
|
|
31
|
+
], TextSchema),
|
|
32
|
+
parts: byIds(["humerus", "radius", "ulna", "femur", "tibia", "tendon"], TextSchema),
|
|
33
|
+
relaxing: rich,
|
|
34
|
+
view: TextSchema,
|
|
35
|
+
}),
|
|
36
|
+
limbs: Schema.NonEmptyArray(Schema.Literals(LIMBS)).check(Schema.isUnique()),
|
|
37
|
+
}).check(Schema.makeFilter(({ labels, limbs }) => namesEach(limbs, labels.limbs), {
|
|
38
|
+
message: "Expected a name for every limb the lab shows, and no other.",
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
41
|
+
/** The muscle pair lab. Which muscle contracts is shown as the learner moves; no prop is answer state. */
|
|
42
|
+
export function limbVisuals(rich) {
|
|
43
|
+
return { MusclePairLab: musclePairLab(rich) };
|
|
44
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The lipid lab. Every prop names what the learner explores; none is answer state. */
|
|
4
|
+
export declare function lipidVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
LipidLab: 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 chains: Schema.NonEmptyArray<Schema.Literals<readonly ["saturated", "unsaturated"]>>;
|
|
126
|
+
readonly labels: Schema.Struct<{
|
|
127
|
+
readonly bilayer: RichSlot<E>;
|
|
128
|
+
readonly chain: Schema.Trimmed;
|
|
129
|
+
readonly chains: Schema.$Record<Schema.Literals<readonly ["saturated", "unsaturated"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
130
|
+
readonly droplet: RichSlot<E>;
|
|
131
|
+
readonly form: RichSlot<E>;
|
|
132
|
+
readonly liquid: RichSlot<E>;
|
|
133
|
+
readonly molecule: Schema.Trimmed;
|
|
134
|
+
readonly molecules: Schema.$Record<Schema.Literals<readonly ["triglyceride", "phospholipid"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
135
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["glycerol", "fatty", "ester", "phosphate", "head", "tail", "kink"]>, Schema.Trimmed>;
|
|
136
|
+
readonly scale: Schema.Trimmed;
|
|
137
|
+
readonly scales: Schema.$Record<Schema.Literals<readonly ["molecule", "water"]>, Schema.Trimmed>;
|
|
138
|
+
readonly solid: RichSlot<E>;
|
|
139
|
+
readonly state: RichSlot<E>;
|
|
140
|
+
readonly view: Schema.Trimmed;
|
|
141
|
+
}>;
|
|
142
|
+
readonly molecules: Schema.NonEmptyArray<Schema.Literals<readonly ["triglyceride", "phospholipid"]>>;
|
|
143
|
+
}>, "figure">;
|
|
144
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
const MOLECULES = ["triglyceride", "phospholipid"];
|
|
5
|
+
const CHAINS = ["saturated", "unsaturated"];
|
|
6
|
+
/**
|
|
7
|
+
* Props of `LipidLab`: a triglyceride and a phospholipid, at the scale of one
|
|
8
|
+
* molecule or of many molecules in water. The learner picks one of
|
|
9
|
+
* `molecules` and one of `chains` (each once, in the order the toggles list
|
|
10
|
+
* them); a kinked unsaturated chain packs loosely and stays liquid, a straight
|
|
11
|
+
* saturated chain packs tightly and turns solid, and in water triglycerides
|
|
12
|
+
* gather into a droplet while phospholipids form a bilayer.
|
|
13
|
+
*/
|
|
14
|
+
function lipidLab(rich) {
|
|
15
|
+
return figure(Schema.Struct({
|
|
16
|
+
...cardFields(rich),
|
|
17
|
+
chains: Schema.NonEmptyArray(Schema.Literals(CHAINS)).check(Schema.isUnique()),
|
|
18
|
+
labels: Schema.Struct({
|
|
19
|
+
bilayer: rich,
|
|
20
|
+
chain: TextSchema,
|
|
21
|
+
chains: byPickedIds(CHAINS, TextSchema),
|
|
22
|
+
droplet: rich,
|
|
23
|
+
form: rich,
|
|
24
|
+
liquid: rich,
|
|
25
|
+
molecule: TextSchema,
|
|
26
|
+
molecules: byPickedIds(MOLECULES, TextSchema),
|
|
27
|
+
parts: byIds(["glycerol", "fatty", "ester", "phosphate", "head", "tail", "kink"], TextSchema),
|
|
28
|
+
scale: TextSchema,
|
|
29
|
+
scales: byIds(["molecule", "water"], TextSchema),
|
|
30
|
+
solid: rich,
|
|
31
|
+
state: rich,
|
|
32
|
+
view: TextSchema,
|
|
33
|
+
}),
|
|
34
|
+
molecules: Schema.NonEmptyArray(Schema.Literals(MOLECULES)).check(Schema.isUnique()),
|
|
35
|
+
}).check(Schema.makeFilter(({ chains, labels, molecules }) => namesEach(molecules, labels.molecules) &&
|
|
36
|
+
namesEach(chains, labels.chains), {
|
|
37
|
+
message: "Expected a name for every molecule and chain the lab shows, and no other.",
|
|
38
|
+
})));
|
|
39
|
+
}
|
|
40
|
+
/** The lipid lab. Every prop names what the learner explores; none is answer state. */
|
|
41
|
+
export function lipidVisuals(rich) {
|
|
42
|
+
return { LipidLab: lipidLab(rich) };
|
|
43
|
+
}
|