@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,145 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /** The body planes lab. Every prop names what the learner explores; none is answer state. */
4
+ export declare function planesVisuals<E>(rich: RichSlot<E>): {
5
+ BodyPlanesLab: 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 pair: Schema.optionalKey<Schema.Trimmed>;
127
+ readonly pairs: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["vertical", "front", "side", "limb"]>, Schema.Struct<{
128
+ readonly meaning: RichSlot<E>;
129
+ readonly name: Schema.Trimmed;
130
+ }>>>;
131
+ readonly plane: Schema.optionalKey<Schema.Trimmed>;
132
+ readonly planes: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["sagittal", "frontal", "transverse"]>, Schema.Struct<{
133
+ readonly name: Schema.Trimmed;
134
+ readonly separates: RichSlot<E>;
135
+ }>>>;
136
+ readonly section: Schema.optionalKey<Schema.Trimmed>;
137
+ readonly sections: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["transverse", "longitudinal"]>, Schema.Trimmed>>;
138
+ readonly position: Schema.Trimmed;
139
+ readonly subject: Schema.Trimmed;
140
+ readonly subjects: Schema.$Record<Schema.Literals<readonly ["body", "stem"]>, Schema.optionalKey<Schema.Trimmed>>;
141
+ readonly view: Schema.Trimmed;
142
+ }>;
143
+ readonly subjects: Schema.NonEmptyArray<Schema.Literals<readonly ["body", "stem"]>>;
144
+ }>, "figure">;
145
+ };
@@ -0,0 +1,62 @@
1
+ import { Array as Arr, Schema } from "effect";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ const SUBJECTS = ["body", "stem"];
5
+ /** The words of a human body: its three planes and the paired direction terms. */
6
+ function bodyWords(rich) {
7
+ return {
8
+ pair: Schema.optionalKey(TextSchema),
9
+ pairs: Schema.optionalKey(byIds(["vertical", "front", "side", "limb"], Schema.Struct({ meaning: rich, name: TextSchema }))),
10
+ plane: Schema.optionalKey(TextSchema),
11
+ planes: Schema.optionalKey(byIds(["sagittal", "frontal", "transverse"], Schema.Struct({ name: TextSchema, separates: rich }))),
12
+ };
13
+ }
14
+ /** The words of a dicot stem: the toggle between its two sections. */
15
+ const stemWords = {
16
+ section: Schema.optionalKey(TextSchema),
17
+ sections: Schema.optionalKey(byIds(["transverse", "longitudinal"], TextSchema)),
18
+ };
19
+ /** Checks that some words are all given when their subject is shown, and none otherwise. */
20
+ function wordsMatch(shown, words) {
21
+ return Arr.every(words, (word) => (word !== undefined) === shown);
22
+ }
23
+ /**
24
+ * Props of `BodyPlanesLab`: a human body in the anatomical position, a dicot
25
+ * stem, or both (`subjects`, each once, in the order the toggle lists them).
26
+ * On the body the learner picks the sagittal, frontal or transverse plane and
27
+ * slides its cut, and the readouts name the plane, which parts it separates
28
+ * and the paired direction terms (superior and inferior, anterior and
29
+ * posterior, medial and lateral, proximal and distal). On the stem the
30
+ * learner switches between a transverse and a longitudinal section. Each
31
+ * subject's words are given exactly when that subject is shown.
32
+ */
33
+ function bodyPlanesLab(rich) {
34
+ return figure(Schema.Struct({
35
+ ...cardFields(rich),
36
+ labels: Schema.Struct({
37
+ ...bodyWords(rich),
38
+ ...stemWords,
39
+ position: TextSchema,
40
+ subject: TextSchema,
41
+ subjects: byPickedIds(SUBJECTS, TextSchema),
42
+ view: TextSchema,
43
+ }),
44
+ subjects: Schema.NonEmptyArray(Schema.Literals(SUBJECTS)).check(Schema.isUnique()),
45
+ }).check(Schema.makeFilter(({ labels, subjects }) => namesEach(subjects, labels.subjects) &&
46
+ wordsMatch(Arr.contains(subjects, "body"), [
47
+ labels.pair,
48
+ labels.pairs,
49
+ labels.plane,
50
+ labels.planes,
51
+ ]) &&
52
+ wordsMatch(Arr.contains(subjects, "stem"), [
53
+ labels.section,
54
+ labels.sections,
55
+ ]), {
56
+ message: "Expected a name for every subject shown, the planes and direction terms exactly when the body is shown, and the sections exactly when the stem is shown.",
57
+ })));
58
+ }
59
+ /** The body planes lab. Every prop names what the learner explores; none is answer state. */
60
+ export function planesVisuals(rich) {
61
+ return { BodyPlanesLab: bodyPlanesLab(rich) };
62
+ }
@@ -0,0 +1,142 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /** The protein lab. Every prop names what the learner explores; none is answer state. */
4
+ export declare function proteinVisuals<E>(rich: RichSlot<E>): {
5
+ ProteinFoldLab: 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 conditions: Schema.NonEmptyArray<Schema.Literals<readonly ["normal", "heated", "acid"]>>;
126
+ readonly labels: Schema.Struct<{
127
+ readonly bonds: Schema.$Record<Schema.Literals<readonly ["peptide", "hydrogen", "ionic", "hydrophobic"]>, RichSlot<E>>;
128
+ readonly condition: Schema.Trimmed;
129
+ readonly conditions: Schema.$Record<Schema.Literals<readonly ["normal", "heated", "acid"]>, Schema.optionalKey<Schema.Trimmed>>;
130
+ readonly holds: RichSlot<E>;
131
+ readonly level: Schema.Trimmed;
132
+ readonly levels: Schema.$Record<Schema.Literals<readonly ["primary", "secondary", "tertiary", "quaternary"]>, Schema.optionalKey<Schema.Trimmed>>;
133
+ readonly no: RichSlot<E>;
134
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["chain", "helix", "sheet", "haem"]>, Schema.Trimmed>;
135
+ readonly peptide: RichSlot<E>;
136
+ readonly view: Schema.Trimmed;
137
+ readonly works: RichSlot<E>;
138
+ readonly yes: RichSlot<E>;
139
+ }>;
140
+ readonly levels: Schema.NonEmptyArray<Schema.Literals<readonly ["primary", "secondary", "tertiary", "quaternary"]>>;
141
+ }>, "figure">;
142
+ };
@@ -0,0 +1,41 @@
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 LEVELS = ["primary", "secondary", "tertiary", "quaternary"];
5
+ const CONDITIONS = ["normal", "heated", "acid"];
6
+ /**
7
+ * Props of `ProteinFoldLab`: one protein from its chain of amino acids to its
8
+ * folded working shape. The learner steps through `levels` of structure and
9
+ * sets one of `conditions` (each once, in the order the toggles list them);
10
+ * heat and acid break the bonds that hold the fold while the peptide bonds
11
+ * stay, and the readouts say which bonds hold the level, whether the peptide
12
+ * bonds stay and whether the protein still works.
13
+ */
14
+ function proteinFoldLab(rich) {
15
+ return figure(Schema.Struct({
16
+ ...cardFields(rich),
17
+ conditions: Schema.NonEmptyArray(Schema.Literals(CONDITIONS)).check(Schema.isUnique()),
18
+ labels: Schema.Struct({
19
+ bonds: byIds(["peptide", "hydrogen", "ionic", "hydrophobic"], rich),
20
+ condition: TextSchema,
21
+ conditions: byPickedIds(CONDITIONS, TextSchema),
22
+ holds: rich,
23
+ level: TextSchema,
24
+ levels: byPickedIds(LEVELS, TextSchema),
25
+ no: rich,
26
+ parts: byIds(["chain", "helix", "sheet", "haem"], TextSchema),
27
+ peptide: rich,
28
+ view: TextSchema,
29
+ works: rich,
30
+ yes: rich,
31
+ }),
32
+ levels: Schema.NonEmptyArray(Schema.Literals(LEVELS)).check(Schema.isUnique()),
33
+ }).check(Schema.makeFilter(({ conditions, labels, levels }) => namesEach(levels, labels.levels) &&
34
+ namesEach(conditions, labels.conditions), {
35
+ message: "Expected a name for every level and condition the lab shows, and no other.",
36
+ })));
37
+ }
38
+ /** The protein lab. Every prop names what the learner explores; none is answer state. */
39
+ export function proteinVisuals(rich) {
40
+ return { ProteinFoldLab: proteinFoldLab(rich) };
41
+ }
@@ -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
+ }