@nakafa/aksara-contracts 8.10.0 → 8.13.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.
Files changed (79) hide show
  1. package/dist/visual/biology/binomial.d.ts +139 -0
  2. package/dist/visual/biology/binomial.js +46 -0
  3. package/dist/visual/biology/bone.d.ts +141 -0
  4. package/dist/visual/biology/bone.js +46 -0
  5. package/dist/visual/biology/chromosome.d.ts +139 -0
  6. package/dist/visual/biology/chromosome.js +42 -0
  7. package/dist/visual/biology/control.d.ts +17 -0
  8. package/dist/visual/biology/control.js +21 -0
  9. package/dist/visual/biology/denature.d.ts +159 -0
  10. package/dist/visual/biology/denature.js +74 -0
  11. package/dist/visual/biology/drawing.d.ts +151 -0
  12. package/dist/visual/biology/drawing.js +69 -0
  13. package/dist/visual/biology/enzyme.d.ts +145 -0
  14. package/dist/visual/biology/enzyme.js +54 -0
  15. package/dist/visual/biology/equipment.d.ts +140 -0
  16. package/dist/visual/biology/equipment.js +64 -0
  17. package/dist/visual/biology/gametogenesis.d.ts +145 -0
  18. package/dist/visual/biology/gametogenesis.js +83 -0
  19. package/dist/visual/biology/implantation.d.ts +138 -0
  20. package/dist/visual/biology/implantation.js +44 -0
  21. package/dist/visual/biology/joint.d.ts +140 -0
  22. package/dist/visual/biology/joint.js +47 -0
  23. package/dist/visual/biology/key.d.ts +141 -0
  24. package/dist/visual/biology/key.js +58 -0
  25. package/dist/visual/biology/kingdom.d.ts +142 -0
  26. package/dist/visual/biology/kingdom.js +82 -0
  27. package/dist/visual/biology/lactase.d.ts +147 -0
  28. package/dist/visual/biology/lactase.js +48 -0
  29. package/dist/visual/biology/leaf.d.ts +436 -0
  30. package/dist/visual/biology/leaf.js +151 -0
  31. package/dist/visual/biology/limb.d.ts +139 -0
  32. package/dist/visual/biology/limb.js +44 -0
  33. package/dist/visual/biology/lipid.d.ts +144 -0
  34. package/dist/visual/biology/lipid.js +43 -0
  35. package/dist/visual/biology/locomotion.d.ts +141 -0
  36. package/dist/visual/biology/locomotion.js +48 -0
  37. package/dist/visual/biology/menstrual.d.ts +148 -0
  38. package/dist/visual/biology/menstrual.js +65 -0
  39. package/dist/visual/biology/metamorphosis.d.ts +140 -0
  40. package/dist/visual/biology/metamorphosis.js +34 -0
  41. package/dist/visual/biology/placenta.d.ts +139 -0
  42. package/dist/visual/biology/placenta.js +52 -0
  43. package/dist/visual/biology/planes.d.ts +145 -0
  44. package/dist/visual/biology/planes.js +62 -0
  45. package/dist/visual/biology/protein.d.ts +142 -0
  46. package/dist/visual/biology/protein.js +41 -0
  47. package/dist/visual/biology/saturation.d.ts +149 -0
  48. package/dist/visual/biology/saturation.js +40 -0
  49. package/dist/visual/biology/secretion.d.ts +149 -0
  50. package/dist/visual/biology/secretion.js +79 -0
  51. package/dist/visual/biology/spill.d.ts +165 -0
  52. package/dist/visual/biology/spill.js +58 -0
  53. package/dist/visual/biology/sugar.d.ts +152 -0
  54. package/dist/visual/biology/sugar.js +59 -0
  55. package/dist/visual/biology/taxon.d.ts +138 -0
  56. package/dist/visual/biology/taxon.js +50 -0
  57. package/dist/visual/biology/tissue.d.ts +424 -0
  58. package/dist/visual/biology/tissue.js +140 -0
  59. package/dist/visual/biology/twins.d.ts +144 -0
  60. package/dist/visual/biology/twins.js +60 -0
  61. package/dist/visual/biology/vernacular.d.ts +141 -0
  62. package/dist/visual/biology/vernacular.js +57 -0
  63. package/dist/visual/biology/vertebra.d.ts +141 -0
  64. package/dist/visual/biology/vertebra.js +59 -0
  65. package/dist/visual/biology/waste.d.ts +140 -0
  66. package/dist/visual/biology/waste.js +57 -0
  67. package/dist/visual/biology/water.d.ts +152 -0
  68. package/dist/visual/biology/water.js +54 -0
  69. package/dist/visual/card.d.ts +11 -0
  70. package/dist/visual/card.js +17 -1
  71. package/dist/visual/catalog.d.ts +6886 -754
  72. package/dist/visual/catalog.js +72 -0
  73. package/dist/visual/chemistry/equilibrium.d.ts +449 -0
  74. package/dist/visual/chemistry/equilibrium.js +135 -0
  75. package/dist/visual/mathematics/argument.d.ts +226 -0
  76. package/dist/visual/mathematics/argument.js +150 -0
  77. package/dist/visual/mathematics/counterexample.d.ts +340 -0
  78. package/dist/visual/mathematics/counterexample.js +157 -0
  79. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** A strictly positive finite upper bound for environmental sliders. */
5
+ const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
6
+ /** A non-negative finite environmental setting. */
7
+ const NonNegativeSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
8
+ /** A numeric slider whose minimum is strictly below its maximum. */
9
+ const SliderSchema = Schema.Struct({
10
+ max: PositiveSchema,
11
+ min: NonNegativeSchema,
12
+ value: NonNegativeSchema,
13
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
14
+ message: "Expected a slider range whose minimum is below its maximum, with the starting value between them.",
15
+ }));
16
+ const LEAF_LAYERS = [
17
+ "cuticle",
18
+ "upperEpidermis",
19
+ "palisade",
20
+ "spongy",
21
+ "vascular",
22
+ "lowerEpidermis",
23
+ "stoma",
24
+ ];
25
+ const STOMATA_CONDITIONS = ["light", "dark", "drought"];
26
+ const CHLOROPLAST_STAGES = [
27
+ "lightDependent",
28
+ "calvinCycle",
29
+ "compensation",
30
+ ];
31
+ /**
32
+ * Props of `LeafLaminaCrossSectionLab`: a 3D histological leaf lamina slice
33
+ * from waxy cuticle through palisade and spongy mesophyll and vascular bundle
34
+ * to lower epidermis and stoma. Adaptation and chloroplast density readouts
35
+ * show only when named so questions can withhold them.
36
+ */
37
+ function leafLaminaCrossSectionLab(rich) {
38
+ return figure(Schema.Struct({
39
+ ...cardFields(rich),
40
+ labels: Schema.Struct({
41
+ adaptation: Schema.optionalKey(rich),
42
+ chloroplasts: Schema.optionalKey(rich),
43
+ densities: byIds(["high", "moderate", "guardOnly", "none"], TextSchema),
44
+ layer: TextSchema,
45
+ layers: byPickedIds(LEAF_LAYERS, Schema.Struct({
46
+ adaptation: rich,
47
+ name: TextSchema,
48
+ })),
49
+ parts: byIds(["xylem", "phloem", "airSpace", "chloroplast", "guardCell"], TextSchema),
50
+ view: TextSchema,
51
+ }),
52
+ layers: Schema.NonEmptyArray(Schema.Literals(LEAF_LAYERS)).check(Schema.isUnique()),
53
+ }).check(Schema.makeFilter(({ labels, layers }) => namesEach(layers, labels.layers), {
54
+ message: "Expected a name and adaptation note for every leaf layer shown, and no other.",
55
+ })), answerAt(["labels", "adaptation"], ["labels", "chloroplasts"]));
56
+ }
57
+ /**
58
+ * Props of `StomatalGuardCellLab`: a 3D osmotic pair of kidney-shaped guard
59
+ * cells with thick inner walls that bow open when potassium ions and water
60
+ * enter in light and flatten shut in darkness or drought, tracking carbon
61
+ * dioxide intake and transpiration. Aperture and mechanism readouts are
62
+ * optional answer state.
63
+ */
64
+ function stomatalGuardCellLab(rich) {
65
+ return figure(Schema.Struct({
66
+ ...cardFields(rich),
67
+ conditions: Schema.NonEmptyArray(Schema.Literals(STOMATA_CONDITIONS)).check(Schema.isUnique()),
68
+ labels: Schema.Struct({
69
+ aperture: Schema.optionalKey(rich),
70
+ apertures: byIds(["open", "narrow", "closed"], TextSchema),
71
+ co2Intake: rich,
72
+ condition: TextSchema,
73
+ conditions: byPickedIds(STOMATA_CONDITIONS, TextSchema),
74
+ light: TextSchema,
75
+ mechanism: Schema.optionalKey(rich),
76
+ mechanisms: byPickedIds(STOMATA_CONDITIONS, rich),
77
+ parts: byIds([
78
+ "guardCell",
79
+ "thickInnerWall",
80
+ "thinOuterWall",
81
+ "chloroplast",
82
+ "vacuole",
83
+ "pore",
84
+ "potassiumIon",
85
+ "water",
86
+ ], TextSchema),
87
+ transpiration: rich,
88
+ turgor: rich,
89
+ turgors: byIds(["turgid", "flaccid"], TextSchema),
90
+ view: TextSchema,
91
+ }),
92
+ light: SliderSchema,
93
+ }).check(Schema.makeFilter(({ conditions, labels }) => namesEach(conditions, labels.conditions) &&
94
+ namesEach(conditions, labels.mechanisms), {
95
+ message: "Expected a name and mechanism note for every stomatal condition shown, and no other.",
96
+ })), answerAt(["labels", "aperture"], ["labels", "mechanism"]));
97
+ }
98
+ /**
99
+ * Props of `ChloroplastStageLab`: a 3D chloroplast showing thylakoid grana for
100
+ * the light-dependent reaction and stroma for the Calvin cycle, plus live
101
+ * limiting-factor controls (light, CO2, temperature) and the compensation
102
+ * point where photosynthesis balances respiration. Limiting factor and net gas
103
+ * exchange readouts are optional answer state.
104
+ */
105
+ function chloroplastStageLab(rich) {
106
+ return figure(Schema.Struct({
107
+ ...cardFields(rich),
108
+ co2: SliderSchema,
109
+ labels: Schema.Struct({
110
+ co2: TextSchema,
111
+ factors: byIds(["light", "co2", "temperature", "balanced"], TextSchema),
112
+ gasStates: byIds(["netRelease", "compensation", "netUptake"], TextSchema),
113
+ light: TextSchema,
114
+ limitingFactor: Schema.optionalKey(rich),
115
+ netGas: Schema.optionalKey(rich),
116
+ parts: byIds([
117
+ "thylakoid",
118
+ "granum",
119
+ "stroma",
120
+ "water",
121
+ "oxygen",
122
+ "atp",
123
+ "nadph",
124
+ "co2",
125
+ "glucose",
126
+ ], TextSchema),
127
+ site: rich,
128
+ sites: byPickedIds(CHLOROPLAST_STAGES, rich),
129
+ stage: TextSchema,
130
+ stages: byPickedIds(CHLOROPLAST_STAGES, TextSchema),
131
+ temperature: TextSchema,
132
+ view: TextSchema,
133
+ }),
134
+ light: SliderSchema,
135
+ stages: Schema.NonEmptyArray(Schema.Literals(CHLOROPLAST_STAGES)).check(Schema.isUnique()),
136
+ temperature: SliderSchema,
137
+ }).check(Schema.makeFilter(({ labels, stages }) => namesEach(stages, labels.stages) && namesEach(stages, labels.sites), {
138
+ message: "Expected a name and reaction site note for every chloroplast stage shown, and no other.",
139
+ })), answerAt(["labels", "limitingFactor"], ["labels", "netGas"]));
140
+ }
141
+ /**
142
+ * Leaf structure and photosynthesis organellar labs covering leaf lamina
143
+ * anatomy, stomatal guard-cell osmosis, and chloroplast reaction stages.
144
+ */
145
+ export function leafVisuals(rich) {
146
+ return {
147
+ ChloroplastStageLab: chloroplastStageLab(rich),
148
+ LeafLaminaCrossSectionLab: leafLaminaCrossSectionLab(rich),
149
+ StomatalGuardCellLab: stomatalGuardCellLab(rich),
150
+ };
151
+ }
@@ -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
+ }
@@ -0,0 +1,141 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /** The locomotion lab. Every prop names what the learner explores; none is answer state. */
4
+ export declare function locomotionVisuals<E>(rich: RichSlot<E>): {
5
+ AnimalLocomotionLab: 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 animals: Schema.NonEmptyArray<Schema.Literals<readonly ["earthworm", "fish", "grasshopper", "bird"]>>;
126
+ readonly labels: Schema.Struct<{
127
+ readonly against: RichSlot<E>;
128
+ readonly animal: Schema.Trimmed;
129
+ readonly animals: Schema.$Record<Schema.Literals<readonly ["earthworm", "fish", "grasshopper", "bird"]>, Schema.optionalKey<Schema.Struct<{
130
+ readonly against: RichSlot<E>;
131
+ readonly name: Schema.Trimmed;
132
+ readonly skeleton: RichSlot<E>;
133
+ }>>>;
134
+ readonly contracting: RichSlot<E>;
135
+ readonly muscles: Schema.$Record<Schema.Literals<readonly ["circular", "longitudinal", "left", "right", "extensor", "flexor", "pectoralis", "supracoracoideus"]>, Schema.Trimmed>;
136
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["chaetae", "fluid", "myotome", "fin", "femur", "tibia", "keel"]>, Schema.Trimmed>;
137
+ readonly skeleton: RichSlot<E>;
138
+ readonly view: Schema.Trimmed;
139
+ }>;
140
+ }>, "figure">;
141
+ };