@nakafa/aksara-contracts 6.5.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/assessment/catalog.d.ts +18 -5
  2. package/dist/assessment/catalog.js +18 -8
  3. package/dist/assessment/choice.d.ts +10 -0
  4. package/dist/assessment/closure.d.ts +2 -1
  5. package/dist/assessment/closure.js +43 -62
  6. package/dist/assessment/document.d.ts +18 -0
  7. package/dist/assessment/document.js +10 -0
  8. package/dist/assessment/figure.d.ts +25 -2676
  9. package/dist/assessment/figure.js +17 -216
  10. package/dist/assessment/hash.d.ts +274 -4
  11. package/dist/assessment/inline.d.ts +25 -0
  12. package/dist/assessment/inline.js +22 -3
  13. package/dist/assessment/interaction.d.ts +10 -0
  14. package/dist/assessment/item.d.ts +864 -0
  15. package/dist/assessment/item.js +10 -2
  16. package/dist/assessment/locales.d.ts +10 -0
  17. package/dist/assessment/locales.js +58 -0
  18. package/dist/assessment/paper.d.ts +1349 -12
  19. package/dist/assessment/paper.js +93 -9
  20. package/dist/assessment/part.d.ts +5 -0
  21. package/dist/assessment/profile.d.ts +4 -4
  22. package/dist/assessment/rows.d.ts +1409 -0
  23. package/dist/assessment/rows.js +44 -0
  24. package/dist/assessment/scalar.d.ts +1 -1
  25. package/dist/assessment/scoring.d.ts +1 -1
  26. package/dist/assessment/snapshot.d.ts +372 -20
  27. package/dist/assessment/structure.d.ts +6 -0
  28. package/dist/assessment/structure.js +22 -2
  29. package/dist/locale.d.ts +9 -9
  30. package/dist/locale.js +4 -3
  31. package/dist/program/snapshot/hash.d.ts +2 -2
  32. package/dist/program/snapshot/spec.d.ts +2 -2
  33. package/dist/projection/material.d.ts +10 -0
  34. package/dist/projection/material.js +1 -1
  35. package/dist/quran/attribution.d.ts +2 -2
  36. package/dist/quran/identity.d.ts +31 -10
  37. package/dist/quran/identity.js +15 -3
  38. package/dist/quran/provenance.d.ts +16 -16
  39. package/dist/quran/provenance.js +4 -1
  40. package/dist/quran/snapshot/hash.d.ts +2 -2
  41. package/dist/quran/snapshot/row/hash.d.ts +48 -15
  42. package/dist/quran/snapshot/row.d.ts +18 -8
  43. package/dist/quran/snapshot/spec.d.ts +2 -2
  44. package/dist/quran/source.d.ts +17 -7
  45. package/dist/quran/source.js +13 -1
  46. package/dist/quran/spec.d.ts +4 -4
  47. package/dist/quran/spec.js +2 -1
  48. package/dist/release/current/evidence.d.ts +9 -9
  49. package/dist/release/current/state.d.ts +11 -11
  50. package/dist/release/hash.d.ts +2 -2
  51. package/dist/release/identity.d.ts +1 -1
  52. package/dist/release/lifecycle.d.ts +7 -7
  53. package/dist/release/policy.d.ts +1 -1
  54. package/dist/release/snapshot/data.d.ts +36 -11
  55. package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
  56. package/dist/release/snapshot/evidence/program.d.ts +1 -1
  57. package/dist/release/snapshot/evidence/quran.d.ts +1 -1
  58. package/dist/release/snapshot/evidence.d.ts +3 -3
  59. package/dist/release/snapshot/verify.d.ts +179 -12
  60. package/dist/release/spec.d.ts +13 -13
  61. package/dist/release/verify.d.ts +2 -2
  62. package/dist/runtime/spec.d.ts +6 -6
  63. package/dist/runtime/verify.d.ts +4 -4
  64. package/dist/transport/group.d.ts +108 -33
  65. package/dist/transport/request.d.ts +1166 -114
  66. package/dist/transport/response.d.ts +64 -64
  67. package/dist/transport/snapshot.d.ts +72 -22
  68. package/dist/visual/base/layout.d.ts +27 -0
  69. package/dist/visual/base/layout.js +35 -0
  70. package/dist/visual/base/math.d.ts +523 -0
  71. package/dist/visual/base/math.js +72 -0
  72. package/dist/visual/base/media.d.ts +13 -0
  73. package/dist/visual/base/media.js +25 -0
  74. package/dist/visual/biology/bacteria.d.ts +55 -0
  75. package/dist/visual/biology/bacteria.js +79 -0
  76. package/dist/visual/biology/cell.d.ts +89 -0
  77. package/dist/visual/biology/cell.js +95 -0
  78. package/dist/visual/biology/climate.d.ts +75 -0
  79. package/dist/visual/biology/climate.js +94 -0
  80. package/dist/visual/biology/ecology.d.ts +75 -0
  81. package/dist/visual/biology/ecology.js +94 -0
  82. package/dist/visual/biology.d.ts +203 -0
  83. package/dist/visual/biology.js +108 -0
  84. package/dist/visual/card.d.ts +32 -0
  85. package/dist/visual/card.js +30 -0
  86. package/dist/visual/catalog.d.ts +3372 -0
  87. package/dist/visual/catalog.js +119 -0
  88. package/dist/visual/chemistry/atom.d.ts +79 -0
  89. package/dist/visual/chemistry/atom.js +109 -0
  90. package/dist/visual/chemistry/balance.d.ts +79 -0
  91. package/dist/visual/chemistry/balance.js +128 -0
  92. package/dist/visual/chemistry/bonding.d.ts +80 -0
  93. package/dist/visual/chemistry/bonding.js +147 -0
  94. package/dist/visual/chemistry/discovery.d.ts +96 -0
  95. package/dist/visual/chemistry/discovery.js +137 -0
  96. package/dist/visual/chemistry/electron.d.ts +41 -0
  97. package/dist/visual/chemistry/electron.js +69 -0
  98. package/dist/visual/chemistry/laws.d.ts +86 -0
  99. package/dist/visual/chemistry/laws.js +117 -0
  100. package/dist/visual/chemistry/particles.d.ts +114 -0
  101. package/dist/visual/chemistry/particles.js +149 -0
  102. package/dist/visual/chemistry/periodic.d.ts +52 -0
  103. package/dist/visual/chemistry/periodic.js +85 -0
  104. package/dist/visual/chemistry/reaction.d.ts +60 -0
  105. package/dist/visual/chemistry/reaction.js +76 -0
  106. package/dist/visual/entry.d.ts +42 -0
  107. package/dist/visual/entry.js +48 -0
  108. package/dist/visual/mathematics/chart.d.ts +30 -0
  109. package/dist/{assessment → visual/mathematics}/chart.js +26 -18
  110. package/dist/visual/mathematics/charts.d.ts +118 -0
  111. package/dist/visual/mathematics/charts.js +100 -0
  112. package/dist/visual/mathematics/function.d.ts +82 -0
  113. package/dist/visual/mathematics/function.js +102 -0
  114. package/dist/visual/mathematics/geometry.d.ts +222 -0
  115. package/dist/visual/mathematics/geometry.js +81 -0
  116. package/dist/visual/mathematics/line.d.ts +179 -0
  117. package/dist/visual/mathematics/line.js +156 -0
  118. package/dist/visual/mathematics/number.d.ts +21 -0
  119. package/dist/visual/mathematics/number.js +53 -0
  120. package/dist/visual/physics/braking.d.ts +62 -0
  121. package/dist/visual/physics/braking.js +83 -0
  122. package/dist/visual/physics/circular.d.ts +36 -0
  123. package/dist/visual/physics/circular.js +51 -0
  124. package/dist/visual/physics/efficiency.d.ts +93 -0
  125. package/dist/visual/physics/efficiency.js +129 -0
  126. package/dist/visual/physics/falling.d.ts +56 -0
  127. package/dist/visual/physics/falling.js +77 -0
  128. package/dist/visual/physics/force.d.ts +88 -0
  129. package/dist/visual/physics/force.js +115 -0
  130. package/dist/visual/physics/instrument.d.ts +93 -0
  131. package/dist/visual/physics/instrument.js +135 -0
  132. package/dist/visual/physics/measurement.d.ts +66 -0
  133. package/dist/visual/physics/measurement.js +85 -0
  134. package/dist/visual/physics/motion.d.ts +85 -0
  135. package/dist/visual/physics/motion.js +110 -0
  136. package/dist/visual/physics/parabolic.d.ts +42 -0
  137. package/dist/visual/physics/parabolic.js +56 -0
  138. package/dist/visual/physics/position.d.ts +87 -0
  139. package/dist/visual/physics/position.js +123 -0
  140. package/dist/visual/physics/power.d.ts +121 -0
  141. package/dist/visual/physics/power.js +162 -0
  142. package/dist/visual/physics/precision.d.ts +96 -0
  143. package/dist/visual/physics/precision.js +137 -0
  144. package/dist/visual/physics/product.d.ts +73 -0
  145. package/dist/visual/physics/product.js +96 -0
  146. package/dist/visual/physics/record.d.ts +34 -0
  147. package/dist/visual/physics/record.js +46 -0
  148. package/dist/visual/physics/relative.d.ts +55 -0
  149. package/dist/visual/physics/relative.js +76 -0
  150. package/dist/visual/physics/solar.d.ts +91 -0
  151. package/dist/visual/physics/solar.js +126 -0
  152. package/dist/visual/physics/vector.d.ts +103 -0
  153. package/dist/visual/physics/vector.js +123 -0
  154. package/dist/visual/physics/velocity.d.ts +112 -0
  155. package/dist/visual/physics/velocity.js +144 -0
  156. package/dist/visual/politics.d.ts +92 -0
  157. package/dist/visual/politics.js +76 -0
  158. package/package.json +13 -5
  159. package/dist/assessment/chart.d.ts +0 -62
@@ -0,0 +1,203 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The biology labs, each a three-dimensional scene. The meaning of the
5
+ * greenhouse lab states what the gas level does to the heat, so it is answer
6
+ * state.
7
+ */
8
+ export declare function biologyVisuals<E>(rich: RichSlot<E>): {
9
+ BacteriaStructureLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
10
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
11
+ description: Schema.optionalKey<RichSlot<E>>;
12
+ labels: Schema.Struct<{
13
+ readonly chooseMode: Schema.Trimmed;
14
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
15
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
16
+ readonly callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
17
+ readonly id: Schema.Trimmed;
18
+ readonly label: RichSlot<E>;
19
+ }>>>;
20
+ readonly caption: Schema.optionalKey<RichSlot<E>>;
21
+ readonly focus: Schema.optionalKey<RichSlot<E>>;
22
+ readonly tab: Schema.Trimmed;
23
+ readonly takeaway: Schema.optionalKey<RichSlot<E>>;
24
+ readonly scene: Schema.Union<readonly [Schema.Struct<{
25
+ readonly bacillusLabel: Schema.optionalKey<RichSlot<E>>;
26
+ readonly coccusLabel: Schema.optionalKey<RichSlot<E>>;
27
+ readonly kind: Schema.Literal<"shape">;
28
+ readonly spiralLabel: Schema.optionalKey<RichSlot<E>>;
29
+ }>, Schema.Struct<{
30
+ readonly kind: Schema.Literal<"structure">;
31
+ readonly nucleoidDnaLabel: Schema.optionalKey<RichSlot<E>>;
32
+ }>, Schema.Struct<{
33
+ readonly gramNegativeLabel: Schema.optionalKey<RichSlot<E>>;
34
+ readonly gramPositiveLabel: Schema.optionalKey<RichSlot<E>>;
35
+ readonly kind: Schema.Literal<"wall">;
36
+ }>]>;
37
+ }>>;
38
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
39
+ readonly viewLabel: Schema.Trimmed;
40
+ }>;
41
+ title: Schema.optionalKey<RichSlot<E>>;
42
+ }>, "figure">;
43
+ ClimateObservationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
44
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
45
+ description: Schema.optionalKey<RichSlot<E>>;
46
+ labels: Schema.Struct<{
47
+ readonly chooseMode: Schema.Trimmed;
48
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
49
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
50
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
51
+ readonly id: Schema.Trimmed;
52
+ readonly label: RichSlot<E>;
53
+ }>>>;
54
+ caption: Schema.optionalKey<RichSlot<E>>;
55
+ focus: Schema.optionalKey<RichSlot<E>>;
56
+ tab: Schema.Trimmed;
57
+ takeaway: Schema.optionalKey<RichSlot<E>>;
58
+ }>>;
59
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
60
+ readonly viewLabel: Schema.Trimmed;
61
+ }>;
62
+ title: Schema.optionalKey<RichSlot<E>>;
63
+ }>, "figure">;
64
+ FungiMyceliumLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
65
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
66
+ description: Schema.optionalKey<RichSlot<E>>;
67
+ labels: Schema.Struct<{
68
+ readonly chooseMode: Schema.Trimmed;
69
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
70
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
71
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
72
+ readonly id: Schema.Trimmed;
73
+ readonly label: RichSlot<E>;
74
+ }>>>;
75
+ caption: Schema.optionalKey<RichSlot<E>>;
76
+ focus: Schema.optionalKey<RichSlot<E>>;
77
+ tab: Schema.Trimmed;
78
+ takeaway: Schema.optionalKey<RichSlot<E>>;
79
+ }>>;
80
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
81
+ readonly viewLabel: Schema.Trimmed;
82
+ }>;
83
+ title: Schema.optionalKey<RichSlot<E>>;
84
+ }>, "figure">;
85
+ GreenhouseEffectLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
86
+ readonly description: RichSlot<E>;
87
+ readonly labels: Schema.Struct<{
88
+ readonly gasControl: Schema.Trimmed;
89
+ readonly heatFlow: RichSlot<E>;
90
+ readonly heatFlowLabel: Schema.Trimmed;
91
+ readonly meaning: RichSlot<E>;
92
+ readonly meaningLabel: Schema.Trimmed;
93
+ readonly viewLabel: Schema.Trimmed;
94
+ }>;
95
+ readonly title: RichSlot<E>;
96
+ }>, "figure">;
97
+ SarsCov2VirionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
98
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
99
+ description: Schema.optionalKey<RichSlot<E>>;
100
+ labels: Schema.Struct<{
101
+ readonly chooseMode: Schema.Trimmed;
102
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
103
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
104
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
105
+ readonly id: Schema.Trimmed;
106
+ readonly label: RichSlot<E>;
107
+ }>>>;
108
+ caption: Schema.optionalKey<RichSlot<E>>;
109
+ focus: Schema.optionalKey<RichSlot<E>>;
110
+ tab: Schema.Trimmed;
111
+ takeaway: Schema.optionalKey<RichSlot<E>>;
112
+ }>>;
113
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
114
+ readonly viewLabel: Schema.Trimmed;
115
+ }>;
116
+ title: Schema.optionalKey<RichSlot<E>>;
117
+ }>, "figure">;
118
+ VirusMorphologyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
119
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
120
+ description: Schema.optionalKey<RichSlot<E>>;
121
+ labels: Schema.Struct<{
122
+ readonly chooseMode: Schema.Trimmed;
123
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
124
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
125
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
126
+ readonly id: Schema.Trimmed;
127
+ readonly label: RichSlot<E>;
128
+ }>>>;
129
+ caption: Schema.optionalKey<RichSlot<E>>;
130
+ focus: Schema.optionalKey<RichSlot<E>>;
131
+ tab: Schema.Trimmed;
132
+ takeaway: Schema.optionalKey<RichSlot<E>>;
133
+ }>>;
134
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
135
+ readonly viewLabel: Schema.Trimmed;
136
+ }>;
137
+ title: Schema.optionalKey<RichSlot<E>>;
138
+ }>, "figure">;
139
+ VirusReplicationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
140
+ readonly defaultItemIndex: Schema.optionalKey<Schema.Int>;
141
+ readonly description: Schema.optionalKey<RichSlot<E>>;
142
+ readonly labels: Schema.Struct<{
143
+ readonly chooseMode: Schema.Trimmed;
144
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
145
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
146
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
147
+ readonly id: Schema.Trimmed;
148
+ readonly label: RichSlot<E>;
149
+ }>>>;
150
+ caption: Schema.optionalKey<RichSlot<E>>;
151
+ focus: Schema.optionalKey<RichSlot<E>>;
152
+ tab: Schema.Trimmed;
153
+ takeaway: Schema.optionalKey<RichSlot<E>>;
154
+ }>>;
155
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
156
+ readonly viewLabel: Schema.Trimmed;
157
+ }>;
158
+ readonly title: Schema.optionalKey<RichSlot<E>>;
159
+ readonly mode: Schema.optionalKey<Schema.Literals<readonly ["both", "lytic", "lysogenic"]>>;
160
+ }>, "figure">;
161
+ VirusRoleLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
162
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
163
+ description: Schema.optionalKey<RichSlot<E>>;
164
+ labels: Schema.Struct<{
165
+ readonly chooseMode: Schema.Trimmed;
166
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
167
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
168
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
169
+ readonly id: Schema.Trimmed;
170
+ readonly label: RichSlot<E>;
171
+ }>>>;
172
+ caption: Schema.optionalKey<RichSlot<E>>;
173
+ focus: Schema.optionalKey<RichSlot<E>>;
174
+ tab: Schema.Trimmed;
175
+ takeaway: Schema.optionalKey<RichSlot<E>>;
176
+ }>>;
177
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
178
+ readonly viewLabel: Schema.Trimmed;
179
+ }>;
180
+ title: Schema.optionalKey<RichSlot<E>>;
181
+ }>, "figure">;
182
+ VirusStructureLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
183
+ defaultItemIndex: Schema.optionalKey<Schema.Int>;
184
+ description: Schema.optionalKey<RichSlot<E>>;
185
+ labels: Schema.Struct<{
186
+ readonly chooseMode: Schema.Trimmed;
187
+ readonly focusLabel: Schema.optionalKey<Schema.Trimmed>;
188
+ readonly items: Schema.NonEmptyArray<Schema.Struct<{
189
+ callouts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
190
+ readonly id: Schema.Trimmed;
191
+ readonly label: RichSlot<E>;
192
+ }>>>;
193
+ caption: Schema.optionalKey<RichSlot<E>>;
194
+ focus: Schema.optionalKey<RichSlot<E>>;
195
+ tab: Schema.Trimmed;
196
+ takeaway: Schema.optionalKey<RichSlot<E>>;
197
+ }>>;
198
+ readonly takeawayLabel: Schema.optionalKey<Schema.Trimmed>;
199
+ readonly viewLabel: Schema.Trimmed;
200
+ }>;
201
+ title: Schema.optionalKey<RichSlot<E>>;
202
+ }>, "figure">;
203
+ };
@@ -0,0 +1,108 @@
1
+ import { Schema } from "effect";
2
+ import { TextSchema } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** The ways a virus replicates that the replication lab can show. */
5
+ const REPLICATION_MODES = ["both", "lytic", "lysogenic"];
6
+ /** The fields every item of a biology lab may carry. */
7
+ function itemFields(rich) {
8
+ return {
9
+ callouts: Schema.optionalKey(Schema.Array(Schema.Struct({ id: TextSchema, label: rich }))),
10
+ caption: Schema.optionalKey(rich),
11
+ focus: Schema.optionalKey(rich),
12
+ tab: TextSchema,
13
+ takeaway: Schema.optionalKey(rich),
14
+ };
15
+ }
16
+ /**
17
+ * The props every biology lab shares: its items, one scene each, and the
18
+ * words of its controls. The lab opens on `defaultItemIndex`, the first item
19
+ * unless it is set.
20
+ */
21
+ function biologyFields(item, rich) {
22
+ return {
23
+ defaultItemIndex: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
24
+ description: Schema.optionalKey(rich),
25
+ labels: Schema.Struct({
26
+ chooseMode: TextSchema,
27
+ focusLabel: Schema.optionalKey(TextSchema),
28
+ items: Schema.NonEmptyArray(item),
29
+ takeawayLabel: Schema.optionalKey(TextSchema),
30
+ viewLabel: TextSchema,
31
+ }),
32
+ title: Schema.optionalKey(rich),
33
+ };
34
+ }
35
+ /** Props of a biology lab whose items need nothing but their words. */
36
+ function biologyLab(rich) {
37
+ return Schema.Struct(biologyFields(Schema.Struct(itemFields(rich)), rich));
38
+ }
39
+ /** The scene of one bacteria item: shapes, inner structure, or the Gram wall. */
40
+ function bacteriaScene(rich) {
41
+ return Schema.Union([
42
+ Schema.Struct({
43
+ bacillusLabel: Schema.optionalKey(rich),
44
+ coccusLabel: Schema.optionalKey(rich),
45
+ kind: Schema.Literal("shape"),
46
+ spiralLabel: Schema.optionalKey(rich),
47
+ }),
48
+ Schema.Struct({
49
+ kind: Schema.Literal("structure"),
50
+ nucleoidDnaLabel: Schema.optionalKey(rich),
51
+ }),
52
+ Schema.Struct({
53
+ gramNegativeLabel: Schema.optionalKey(rich),
54
+ gramPositiveLabel: Schema.optionalKey(rich),
55
+ kind: Schema.Literal("wall"),
56
+ }),
57
+ ]);
58
+ }
59
+ /** Props of `BacteriaStructureLab`: shapes, anatomy, and the cell wall of bacteria. */
60
+ function bacteriaStructureLab(rich) {
61
+ const item = Schema.Struct({
62
+ ...itemFields(rich),
63
+ scene: bacteriaScene(rich),
64
+ });
65
+ return Schema.Struct(biologyFields(item, rich));
66
+ }
67
+ /** Props of `VirusReplicationLab`: the lytic and the lysogenic cycle. */
68
+ function virusReplicationLab(rich) {
69
+ return Schema.Struct({
70
+ ...biologyFields(Schema.Struct(itemFields(rich)), rich),
71
+ mode: Schema.optionalKey(Schema.Literals(REPLICATION_MODES)),
72
+ });
73
+ }
74
+ /** Props of `GreenhouseEffectLab`: heat that greenhouse gases keep in. */
75
+ function greenhouseEffectLab(rich) {
76
+ return Schema.Struct({
77
+ description: rich,
78
+ labels: Schema.Struct({
79
+ gasControl: TextSchema,
80
+ heatFlow: rich,
81
+ heatFlowLabel: TextSchema,
82
+ meaning: rich,
83
+ meaningLabel: TextSchema,
84
+ viewLabel: TextSchema,
85
+ }),
86
+ title: rich,
87
+ });
88
+ }
89
+ /** The takeaway of an item states what the scene shows, so it is answer state. */
90
+ const takeaway = answerAt(["labels", "items", "*", "takeaway"]);
91
+ /**
92
+ * The biology labs, each a three-dimensional scene. The meaning of the
93
+ * greenhouse lab states what the gas level does to the heat, so it is answer
94
+ * state.
95
+ */
96
+ export function biologyVisuals(rich) {
97
+ return {
98
+ BacteriaStructureLab: figure(bacteriaStructureLab(rich), takeaway),
99
+ ClimateObservationLab: figure(biologyLab(rich), takeaway),
100
+ FungiMyceliumLab: figure(biologyLab(rich), takeaway),
101
+ GreenhouseEffectLab: figure(greenhouseEffectLab(rich), answerAt(["labels", "meaning"])),
102
+ SarsCov2VirionLab: figure(biologyLab(rich), takeaway),
103
+ VirusMorphologyLab: figure(biologyLab(rich), takeaway),
104
+ VirusReplicationLab: figure(virusReplicationLab(rich), takeaway),
105
+ VirusRoleLab: figure(biologyLab(rich), takeaway),
106
+ VirusStructureLab: figure(biologyLab(rich), takeaway),
107
+ };
108
+ }
@@ -0,0 +1,32 @@
1
+ import { Schema } from "effect";
2
+ import type { RichText } from "#contracts/assessment/inline";
3
+ /**
4
+ * The schema of rich text in one document kind. Every kind decodes rich text
5
+ * to the same inline nodes, whatever form it writes them in: an assessment
6
+ * stores them as they are, and a lesson writes them as elements of its tree.
7
+ */
8
+ export type RichSlot<Encoded = unknown> = Schema.Codec<RichText, Encoded>;
9
+ /**
10
+ * Plain text a component draws as a string: an axis label, a tab, or the name
11
+ * a screen reader announces. It is trimmed and never empty.
12
+ */
13
+ export declare const TextSchema: Schema.Trimmed;
14
+ /** The title and description every card shows, each rich text. */
15
+ export declare function cardFields<E>(rich: RichSlot<E>): {
16
+ description: RichSlot<E>;
17
+ title: RichSlot<E>;
18
+ };
19
+ /**
20
+ * The words of one component for each of its fixed options, such as the
21
+ * samples of a lab: one value for every identifier, and no other key.
22
+ */
23
+ export declare function byIds<const Ids extends readonly [string, ...string[]], Value extends Schema.Top>(ids: Ids, value: Value): Schema.$Record<Schema.Literals<Ids>, Value>;
24
+ /** One fact a lab lists: a plain label and a rich value. */
25
+ export declare function factSchema<E>(rich: RichSlot<E>): Schema.Struct<{
26
+ readonly label: Schema.Trimmed;
27
+ readonly value: RichSlot<E>;
28
+ }>;
29
+ /** Three finite numbers, such as a camera position: x, y, and z. */
30
+ export declare const TripleSchema: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
31
+ /** How a kinematics lab writes a decimal number: with a comma or a dot. */
32
+ export declare const DecimalSeparatorSchema: Schema.Literals<readonly ["comma", "dot"]>;
@@ -0,0 +1,30 @@
1
+ import { Schema } from "effect";
2
+ import { PlainTextSchema } from "#contracts/assessment/scalar";
3
+ /**
4
+ * Plain text a component draws as a string: an axis label, a tab, or the name
5
+ * a screen reader announces. It is trimmed and never empty.
6
+ */
7
+ export const TextSchema = PlainTextSchema;
8
+ /** The title and description every card shows, each rich text. */
9
+ export function cardFields(rich) {
10
+ return { description: rich, title: rich };
11
+ }
12
+ /**
13
+ * The words of one component for each of its fixed options, such as the
14
+ * samples of a lab: one value for every identifier, and no other key.
15
+ */
16
+ export function byIds(ids, value) {
17
+ return Schema.Record(Schema.Literals(ids), value);
18
+ }
19
+ /** One fact a lab lists: a plain label and a rich value. */
20
+ export function factSchema(rich) {
21
+ return Schema.Struct({ label: TextSchema, value: rich });
22
+ }
23
+ /** Three finite numbers, such as a camera position: x, y, and z. */
24
+ export const TripleSchema = Schema.Tuple([
25
+ Schema.Finite,
26
+ Schema.Finite,
27
+ Schema.Finite,
28
+ ]);
29
+ /** How a kinematics lab writes a decimal number: with a comma or a dot. */
30
+ export const DecimalSeparatorSchema = Schema.Literals(["comma", "dot"]);