@nakafa/aksara-contracts 8.4.0 → 8.8.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 (238) hide show
  1. package/dist/assessment/document.d.ts +1 -1
  2. package/dist/assessment/document.js +1 -1
  3. package/dist/assessment/figure.d.ts +1 -1
  4. package/dist/assessment/figure.js +1 -1
  5. package/dist/assessment/fit.d.ts +3 -3
  6. package/dist/assessment/fit.js +3 -3
  7. package/dist/assessment/locales.d.ts +1 -1
  8. package/dist/assessment/scoring.d.ts +1 -1
  9. package/dist/assessment/scoring.js +1 -1
  10. package/dist/cache/content.d.ts +1 -1
  11. package/dist/cache/content.js +1 -1
  12. package/dist/content.d.ts +3 -2
  13. package/dist/graph/identity.d.ts +1 -1
  14. package/dist/graph/identity.js +1 -1
  15. package/dist/hash/sha256.d.ts +16 -0
  16. package/dist/hash/sha256.js +164 -0
  17. package/dist/hash/stream.d.ts +7 -5
  18. package/dist/hash/stream.js +13 -18
  19. package/dist/math/boundary.js +3 -22
  20. package/dist/math/bounds.d.ts +1 -1
  21. package/dist/math/collision.d.ts +1 -1
  22. package/dist/math/coordinate.d.ts +6 -5
  23. package/dist/math/coordinate.js +2 -2
  24. package/dist/math/edge.d.ts +11 -0
  25. package/dist/math/edge.js +74 -0
  26. package/dist/math/formula/compile.d.ts +1 -1
  27. package/dist/math/formula/compile.js +1 -1
  28. package/dist/math/formula/contour.d.ts +1 -1
  29. package/dist/math/formula/contour.js +1 -1
  30. package/dist/math/formula/field.js +1 -1
  31. package/dist/math/formula/mesh.d.ts +1 -1
  32. package/dist/math/formula/mesh.js +1 -1
  33. package/dist/math/formula/names.d.ts +1 -1
  34. package/dist/math/formula/names.js +1 -1
  35. package/dist/math/formula/parse.d.ts +1 -1
  36. package/dist/math/formula/parse.js +1 -1
  37. package/dist/math/formula/plane.d.ts +2 -2
  38. package/dist/math/formula/plane.js +3 -3
  39. package/dist/math/formula/reader.d.ts +2 -1
  40. package/dist/math/formula/reader.js +1 -1
  41. package/dist/math/formula/region.d.ts +2 -2
  42. package/dist/math/formula/region.js +3 -3
  43. package/dist/math/formula/sample.d.ts +1 -1
  44. package/dist/math/formula/scan.d.ts +1 -1
  45. package/dist/math/formula/scan.js +1 -1
  46. package/dist/math/formula/slider.d.ts +2 -2
  47. package/dist/math/formula/slider.js +1 -1
  48. package/dist/math/formula/space.d.ts +1 -1
  49. package/dist/math/formula/space.js +1 -1
  50. package/dist/math/graph.d.ts +9 -0
  51. package/dist/math/graph.js +66 -0
  52. package/dist/math/plane.js +6 -0
  53. package/dist/math/precision.d.ts +1 -1
  54. package/dist/math/precision.js +1 -1
  55. package/dist/math/resolution.js +1 -1
  56. package/dist/math/scene.d.ts +2 -2
  57. package/dist/math/shape.d.ts +392 -0
  58. package/dist/math/shape.js +59 -0
  59. package/dist/math/straight.d.ts +13 -0
  60. package/dist/math/straight.js +26 -0
  61. package/dist/math/vector.d.ts +1 -1
  62. package/dist/preview/spec.js +1 -1
  63. package/dist/program/curriculum.d.ts +1 -1
  64. package/dist/program/curriculum.js +1 -1
  65. package/dist/program/snapshot/digest.d.ts +1 -1
  66. package/dist/program/snapshot/digest.js +2 -2
  67. package/dist/program/snapshot/hash.d.ts +2 -2
  68. package/dist/projection/digest.d.ts +1 -1
  69. package/dist/projection/digest.js +1 -1
  70. package/dist/projection/hash.js +1 -1
  71. package/dist/projection/material.d.ts +1 -1
  72. package/dist/projection/material.js +1 -1
  73. package/dist/projection/verify.js +1 -1
  74. package/dist/quran/identity.d.ts +2 -1
  75. package/dist/quran/provenance.d.ts +2 -2
  76. package/dist/quran/provenance.js +1 -1
  77. package/dist/quran/snapshot/hash.d.ts +1 -1
  78. package/dist/quran/snapshot/row/hash.d.ts +1 -1
  79. package/dist/quran/snapshot/row/hash.js +1 -1
  80. package/dist/quran/snapshot/spec.js +1 -1
  81. package/dist/quran/source.d.ts +2 -2
  82. package/dist/release/current/evidence.d.ts +1 -1
  83. package/dist/release/current/evidence.js +1 -1
  84. package/dist/release/current/state.d.ts +1 -1
  85. package/dist/release/current/state.js +1 -1
  86. package/dist/release/head.js +1 -1
  87. package/dist/release/items.d.ts +1 -1
  88. package/dist/release/items.js +1 -1
  89. package/dist/release/policy.d.ts +1 -1
  90. package/dist/release/policy.js +1 -1
  91. package/dist/release/result/digest.d.ts +3 -3
  92. package/dist/release/result/digest.js +2 -2
  93. package/dist/release/rollback/digest.d.ts +1 -1
  94. package/dist/release/rollback/digest.js +1 -1
  95. package/dist/release/route/digest.d.ts +1 -1
  96. package/dist/release/route/digest.js +1 -1
  97. package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
  98. package/dist/release/snapshot/evidence/assessment.js +1 -1
  99. package/dist/release/snapshot/evidence/program.d.ts +1 -1
  100. package/dist/release/snapshot/evidence/program.js +1 -1
  101. package/dist/release/snapshot/evidence/quran.d.ts +1 -1
  102. package/dist/release/snapshot/evidence/quran.js +1 -1
  103. package/dist/release/snapshot/evidence/requirement.d.ts +3 -2
  104. package/dist/release/snapshot/evidence/requirement.js +1 -1
  105. package/dist/release/snapshot/spec.d.ts +2 -2
  106. package/dist/release/snapshot/spec.js +1 -1
  107. package/dist/release/snapshot/verify.d.ts +1 -1
  108. package/dist/release/snapshot/verify.js +1 -1
  109. package/dist/release/spec.d.ts +1 -1
  110. package/dist/release/verify.d.ts +1 -1
  111. package/dist/release/verify.js +1 -1
  112. package/dist/renderer/compatibility.d.ts +1 -1
  113. package/dist/renderer/compatibility.js +2 -2
  114. package/dist/renderer/contract.d.ts +1 -1
  115. package/dist/renderer/contract.js +1 -1
  116. package/dist/runtime/spec.js +2 -2
  117. package/dist/signature/spec.d.ts +3 -2
  118. package/dist/signature/verify.d.ts +2 -1
  119. package/dist/transport/request.d.ts +1 -1
  120. package/dist/visual/base/math.d.ts +1 -1
  121. package/dist/visual/base/media.d.ts +1 -1
  122. package/dist/visual/biology/bacteria.d.ts +1 -1
  123. package/dist/visual/biology/bacteria.js +1 -1
  124. package/dist/visual/biology/blood.d.ts +91 -0
  125. package/dist/visual/biology/blood.js +55 -0
  126. package/dist/visual/biology/cell.d.ts +1 -1
  127. package/dist/visual/biology/climate.d.ts +1 -1
  128. package/dist/visual/biology/climate.js +1 -1
  129. package/dist/visual/biology/ecology.d.ts +1 -1
  130. package/dist/visual/biology/heart.d.ts +92 -0
  131. package/dist/visual/biology/heart.js +54 -0
  132. package/dist/visual/biology/mitochondrion.d.ts +91 -0
  133. package/dist/visual/biology/mitochondrion.js +45 -0
  134. package/dist/visual/biology/muscle.d.ts +103 -0
  135. package/dist/visual/biology/muscle.js +62 -0
  136. package/dist/visual/biology/neuron.d.ts +97 -0
  137. package/dist/visual/biology/neuron.js +48 -0
  138. package/dist/visual/biology/paddy.d.ts +100 -0
  139. package/dist/visual/biology/paddy.js +54 -0
  140. package/dist/visual/biology/physiology.d.ts +1 -1
  141. package/dist/visual/biology/physiology.js +1 -1
  142. package/dist/visual/biology/plant.d.ts +1 -1
  143. package/dist/visual/biology/plant.js +1 -1
  144. package/dist/visual/biology/synapse.d.ts +101 -0
  145. package/dist/visual/biology/synapse.js +46 -0
  146. package/dist/visual/biology/vessel.d.ts +104 -0
  147. package/dist/visual/biology/vessel.js +60 -0
  148. package/dist/visual/biology/yeast.d.ts +108 -0
  149. package/dist/visual/biology/yeast.js +61 -0
  150. package/dist/visual/biology.d.ts +1 -1
  151. package/dist/visual/catalog.d.ts +2177 -778
  152. package/dist/visual/catalog.js +28 -0
  153. package/dist/visual/chemistry/atom.d.ts +1 -1
  154. package/dist/visual/chemistry/atom.js +1 -1
  155. package/dist/visual/chemistry/balance.d.ts +1 -1
  156. package/dist/visual/chemistry/balance.js +1 -1
  157. package/dist/visual/chemistry/bonding.d.ts +1 -1
  158. package/dist/visual/chemistry/discovery.d.ts +1 -1
  159. package/dist/visual/chemistry/electrochemistry.d.ts +1 -1
  160. package/dist/visual/chemistry/electrochemistry.js +1 -1
  161. package/dist/visual/chemistry/electron.d.ts +1 -1
  162. package/dist/visual/chemistry/electron.js +1 -1
  163. package/dist/visual/chemistry/laws.d.ts +1 -1
  164. package/dist/visual/chemistry/laws.js +1 -1
  165. package/dist/visual/chemistry/particles.d.ts +1 -1
  166. package/dist/visual/chemistry/periodic.d.ts +1 -1
  167. package/dist/visual/chemistry/periodic.js +1 -1
  168. package/dist/visual/chemistry/rate.d.ts +1 -1
  169. package/dist/visual/chemistry/rate.js +1 -1
  170. package/dist/visual/chemistry/reaction.d.ts +1 -1
  171. package/dist/visual/chemistry/reaction.js +1 -1
  172. package/dist/visual/chemistry/titration.d.ts +1 -1
  173. package/dist/visual/chemistry/titration.js +1 -1
  174. package/dist/visual/mathematics/chance.d.ts +1 -1
  175. package/dist/visual/mathematics/chance.js +1 -1
  176. package/dist/visual/mathematics/chart.d.ts +1 -1
  177. package/dist/visual/mathematics/charts.d.ts +1 -1
  178. package/dist/visual/mathematics/function.d.ts +1 -1
  179. package/dist/visual/mathematics/journey.d.ts +118 -0
  180. package/dist/visual/mathematics/journey.js +125 -0
  181. package/dist/visual/mathematics/logic.d.ts +90 -0
  182. package/dist/visual/mathematics/logic.js +49 -0
  183. package/dist/visual/mathematics/network.d.ts +101 -0
  184. package/dist/visual/mathematics/network.js +97 -0
  185. package/dist/visual/mathematics/numeral.d.ts +82 -1
  186. package/dist/visual/mathematics/numeral.js +49 -1
  187. package/dist/visual/mathematics/sets.d.ts +92 -0
  188. package/dist/visual/mathematics/sets.js +95 -0
  189. package/dist/visual/physics/braking.d.ts +1 -1
  190. package/dist/visual/physics/braking.js +1 -1
  191. package/dist/visual/physics/circuit.d.ts +1 -1
  192. package/dist/visual/physics/circular.d.ts +1 -1
  193. package/dist/visual/physics/circular.js +1 -1
  194. package/dist/visual/physics/dynamics.d.ts +1 -1
  195. package/dist/visual/physics/dynamics.js +1 -1
  196. package/dist/visual/physics/efficiency.d.ts +1 -1
  197. package/dist/visual/physics/efficiency.js +1 -1
  198. package/dist/visual/physics/electronics.d.ts +1 -1
  199. package/dist/visual/physics/falling.d.ts +1 -1
  200. package/dist/visual/physics/falling.js +1 -1
  201. package/dist/visual/physics/field.d.ts +1 -1
  202. package/dist/visual/physics/fluid.d.ts +1 -1
  203. package/dist/visual/physics/fluid.js +1 -1
  204. package/dist/visual/physics/force.d.ts +1 -1
  205. package/dist/visual/physics/gravity.d.ts +1 -1
  206. package/dist/visual/physics/heat.d.ts +1 -1
  207. package/dist/visual/physics/heat.js +1 -1
  208. package/dist/visual/physics/instrument.d.ts +1 -1
  209. package/dist/visual/physics/light.d.ts +1 -1
  210. package/dist/visual/physics/light.js +1 -1
  211. package/dist/visual/physics/measurement.d.ts +1 -1
  212. package/dist/visual/physics/measurement.js +1 -1
  213. package/dist/visual/physics/motion.d.ts +1 -1
  214. package/dist/visual/physics/nuclear.d.ts +1 -1
  215. package/dist/visual/physics/parabolic.d.ts +1 -1
  216. package/dist/visual/physics/position.d.ts +1 -1
  217. package/dist/visual/physics/position.js +1 -1
  218. package/dist/visual/physics/power.d.ts +1 -1
  219. package/dist/visual/physics/power.js +1 -1
  220. package/dist/visual/physics/precision.d.ts +1 -1
  221. package/dist/visual/physics/precision.js +1 -1
  222. package/dist/visual/physics/product.d.ts +1 -1
  223. package/dist/visual/physics/reading.d.ts +1 -1
  224. package/dist/visual/physics/reading.js +1 -1
  225. package/dist/visual/physics/record.d.ts +1 -1
  226. package/dist/visual/physics/record.js +1 -1
  227. package/dist/visual/physics/relative.d.ts +1 -1
  228. package/dist/visual/physics/relative.js +1 -1
  229. package/dist/visual/physics/solar.d.ts +1 -1
  230. package/dist/visual/physics/solar.js +1 -1
  231. package/dist/visual/physics/thermodynamics.d.ts +117 -0
  232. package/dist/visual/physics/thermodynamics.js +95 -0
  233. package/dist/visual/physics/vector.d.ts +1 -1
  234. package/dist/visual/physics/vector.js +1 -1
  235. package/dist/visual/physics/velocity.d.ts +1 -1
  236. package/dist/visual/physics/wave.d.ts +1 -1
  237. package/dist/visual/politics.d.ts +1 -1
  238. package/package.json +2 -2
@@ -0,0 +1,100 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The visuals of the paddy lab. Its props set up the field and name its words;
5
+ * none states the conclusion the lab leads to, so none holds answer state.
6
+ */
7
+ export declare function paddyVisuals<E>(rich: RichSlot<E>): {
8
+ PaddyRootLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly attrs: {
12
+ readonly latex: string;
13
+ };
14
+ readonly type: "mathInline";
15
+ } | {
16
+ readonly marks?: readonly [{
17
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly href: string;
21
+ };
22
+ readonly type: "link";
23
+ } | {
24
+ readonly attrs: {
25
+ readonly variant: "success" | "warning" | null;
26
+ };
27
+ readonly type: "highlight";
28
+ }, ...({
29
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly href: string;
33
+ };
34
+ readonly type: "link";
35
+ } | {
36
+ readonly attrs: {
37
+ readonly variant: "success" | "warning" | null;
38
+ };
39
+ readonly type: "highlight";
40
+ })[]];
41
+ readonly text: string;
42
+ readonly type: "text";
43
+ }, ...({
44
+ readonly attrs: {
45
+ readonly latex: string;
46
+ };
47
+ readonly type: "mathInline";
48
+ } | {
49
+ readonly marks?: readonly [{
50
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
51
+ } | {
52
+ readonly attrs: {
53
+ readonly href: string;
54
+ };
55
+ readonly type: "link";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly variant: "success" | "warning" | null;
59
+ };
60
+ readonly type: "highlight";
61
+ }, ...({
62
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
63
+ } | {
64
+ readonly attrs: {
65
+ readonly href: string;
66
+ };
67
+ readonly type: "link";
68
+ } | {
69
+ readonly attrs: {
70
+ readonly variant: "success" | "warning" | null;
71
+ };
72
+ readonly type: "highlight";
73
+ })[]];
74
+ readonly text: string;
75
+ readonly type: "text";
76
+ })[]], E, never, never>>;
77
+ readonly title: RichSlot<E>;
78
+ readonly atp: Schema.Int;
79
+ readonly labels: Schema.Struct<{
80
+ readonly damaged: RichSlot<E>;
81
+ readonly ethanol: RichSlot<E>;
82
+ readonly fermentation: RichSlot<E>;
83
+ readonly healthy: RichSlot<E>;
84
+ readonly oxygen: RichSlot<E>;
85
+ readonly parts: Schema.Struct<{
86
+ readonly aerenchyma: Schema.Trimmed;
87
+ readonly mud: Schema.Trimmed;
88
+ readonly root: Schema.Trimmed;
89
+ readonly water: Schema.Trimmed;
90
+ }>;
91
+ readonly plant: Schema.Trimmed;
92
+ readonly plants: Schema.$Record<Schema.Literals<readonly ["rice", "dryland"]>, Schema.Trimmed>;
93
+ readonly roots: RichSlot<E>;
94
+ readonly view: Schema.Trimmed;
95
+ readonly water: Schema.Trimmed;
96
+ readonly waters: Schema.$Record<Schema.Literals<readonly ["drained", "flooded"]>, Schema.Trimmed>;
97
+ }>;
98
+ readonly plants: Schema.NonEmptyArray<Schema.Literals<readonly ["rice", "dryland"]>>;
99
+ }>, "figure">;
100
+ };
@@ -0,0 +1,54 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /** ATP from one glucose in aerobic respiration: a whole number above zero. */
5
+ const AtpSchema = Schema.Int.check(Schema.isGreaterThan(0));
6
+ /**
7
+ * The crops the lab grows: paddy rice, a wetland crop with air channels
8
+ * (aerenchyma) in its roots, and a dryland crop with almost none, drawn as
9
+ * maize.
10
+ */
11
+ const PlantSchema = Schema.Literals(["rice", "dryland"]);
12
+ /**
13
+ * Props of `PaddyRootLab`: a paddy field at real size in endless terrain,
14
+ * flooded or drained, with rice or a dryland crop growing in it, the soil and
15
+ * roots seen in an X-ray view through the mud, an oxygen strip down the soil,
16
+ * and a lens on one root's cross-section. `atp` is the ATP one glucose yields in aerobic respiration as the
17
+ * lesson counts it; fermentation yields 2. `plants` lists the crops in tab
18
+ * order. The lab reads out the soil's oxygen at the root tips, the share of
19
+ * the roots' energy from fermentation, the ethanol made per glucose, and
20
+ * whether the roots stay healthy (`healthy`) or their tips die (`damaged`).
21
+ */
22
+ function paddyRootLab(rich) {
23
+ return figure(Schema.Struct({
24
+ ...cardFields(rich),
25
+ atp: AtpSchema,
26
+ labels: Schema.Struct({
27
+ damaged: rich,
28
+ ethanol: rich,
29
+ fermentation: rich,
30
+ healthy: rich,
31
+ oxygen: rich,
32
+ parts: Schema.Struct({
33
+ aerenchyma: TextSchema,
34
+ mud: TextSchema,
35
+ root: TextSchema,
36
+ water: TextSchema,
37
+ }),
38
+ plant: TextSchema,
39
+ plants: byIds(["rice", "dryland"], TextSchema),
40
+ roots: rich,
41
+ view: TextSchema,
42
+ water: TextSchema,
43
+ waters: byIds(["drained", "flooded"], TextSchema),
44
+ }),
45
+ plants: Schema.NonEmptyArray(PlantSchema),
46
+ }));
47
+ }
48
+ /**
49
+ * The visuals of the paddy lab. Its props set up the field and name its words;
50
+ * none states the conclusion the lab leads to, so none holds answer state.
51
+ */
52
+ export function paddyVisuals(rich) {
53
+ return { PaddyRootLab: paddyRootLab(rich) };
54
+ }
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The props of the physiology labs. Each prop sets up an instrument or names
5
5
  * its words; none states the conclusion the lab leads to, so none holds answer
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { figure } from "#contracts/visual/entry";
4
4
  /** A measure the lab divides by: a finite number above zero. */
5
5
  const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The props of the plant labs. Each prop sets up an apparatus or names its
5
5
  * words; none states the conclusion the lab leads to, so none holds answer
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { figure } from "#contracts/visual/entry";
4
4
  /** A count or a measure the lab divides by: a finite number above zero. */
5
5
  const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
@@ -0,0 +1,101 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The synapse labs. Each prop sets up the synapse or names its words; none
5
+ * states the conclusion the lab leads to.
6
+ */
7
+ export declare function synapseVisuals<E>(rich: RichSlot<E>): {
8
+ SynapseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly attrs: {
12
+ readonly latex: string;
13
+ };
14
+ readonly type: "mathInline";
15
+ } | {
16
+ readonly marks?: readonly [{
17
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly href: string;
21
+ };
22
+ readonly type: "link";
23
+ } | {
24
+ readonly attrs: {
25
+ readonly variant: "success" | "warning" | null;
26
+ };
27
+ readonly type: "highlight";
28
+ }, ...({
29
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly href: string;
33
+ };
34
+ readonly type: "link";
35
+ } | {
36
+ readonly attrs: {
37
+ readonly variant: "success" | "warning" | null;
38
+ };
39
+ readonly type: "highlight";
40
+ })[]];
41
+ readonly text: string;
42
+ readonly type: "text";
43
+ }, ...({
44
+ readonly attrs: {
45
+ readonly latex: string;
46
+ };
47
+ readonly type: "mathInline";
48
+ } | {
49
+ readonly marks?: readonly [{
50
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
51
+ } | {
52
+ readonly attrs: {
53
+ readonly href: string;
54
+ };
55
+ readonly type: "link";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly variant: "success" | "warning" | null;
59
+ };
60
+ readonly type: "highlight";
61
+ }, ...({
62
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
63
+ } | {
64
+ readonly attrs: {
65
+ readonly href: string;
66
+ };
67
+ readonly type: "link";
68
+ } | {
69
+ readonly attrs: {
70
+ readonly variant: "success" | "warning" | null;
71
+ };
72
+ readonly type: "highlight";
73
+ })[]];
74
+ readonly text: string;
75
+ readonly type: "text";
76
+ })[]], E, never, never>>;
77
+ readonly title: RichSlot<E>;
78
+ readonly drugs: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["nicotine", "curare", "organophosphate", "botulinum"]>>>;
79
+ readonly labels: Schema.Struct<{
80
+ readonly drug: Schema.Trimmed;
81
+ readonly drugs: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["nicotine", "curare", "organophosphate", "botulinum"]>, Schema.Trimmed>>;
82
+ readonly fires: RichSlot<E>;
83
+ readonly none: Schema.Trimmed;
84
+ readonly parts: Schema.Struct<{
85
+ readonly channel: RichSlot<E>;
86
+ readonly cleft: RichSlot<E>;
87
+ readonly enzyme: RichSlot<E>;
88
+ readonly mitochondrion: RichSlot<E>;
89
+ readonly receptor: RichSlot<E>;
90
+ readonly transporter: RichSlot<E>;
91
+ readonly vesicle: RichSlot<E>;
92
+ }>;
93
+ readonly potential: RichSlot<E>;
94
+ readonly rate: Schema.Trimmed;
95
+ readonly rests: RichSlot<E>;
96
+ readonly response: RichSlot<E>;
97
+ readonly transmitter: RichSlot<E>;
98
+ readonly view: Schema.Trimmed;
99
+ }>;
100
+ }>, "figure">;
101
+ };
@@ -0,0 +1,46 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /** The drugs the synapse lab can add to the cleft. */
5
+ const DRUGS = ["nicotine", "curare", "organophosphate", "botulinum"];
6
+ /**
7
+ * Props of `SynapseLab`: a cholinergic synapse between two neurons. Impulses
8
+ * arrive at the presynaptic bouton at a rate the reader sets, and each of the
9
+ * `drugs` can be added to see how it changes the transmission. `labels.parts`
10
+ * names the parts the scene points at; `labels.drugs` names the drugs, and is
11
+ * needed whenever `drugs` is set.
12
+ */
13
+ function synapseLab(rich) {
14
+ return figure(Schema.Struct({
15
+ ...cardFields(rich),
16
+ drugs: Schema.optionalKey(Schema.NonEmptyArray(Schema.Literals(DRUGS))),
17
+ labels: Schema.Struct({
18
+ drug: TextSchema,
19
+ drugs: Schema.optionalKey(byIds(DRUGS, TextSchema)),
20
+ fires: rich,
21
+ none: TextSchema,
22
+ parts: Schema.Struct({
23
+ channel: rich,
24
+ cleft: rich,
25
+ enzyme: rich,
26
+ mitochondrion: rich,
27
+ receptor: rich,
28
+ transporter: rich,
29
+ vesicle: rich,
30
+ }),
31
+ potential: rich,
32
+ rate: TextSchema,
33
+ rests: rich,
34
+ response: rich,
35
+ transmitter: rich,
36
+ view: TextSchema,
37
+ }),
38
+ }).check(Schema.makeFilter(({ drugs, labels }) => drugs === undefined || labels.drugs !== undefined, { message: "Expected names for the drugs whenever drugs are offered." })));
39
+ }
40
+ /**
41
+ * The synapse labs. Each prop sets up the synapse or names its words; none
42
+ * states the conclusion the lab leads to.
43
+ */
44
+ export function synapseVisuals(rich) {
45
+ return { SynapseLab: synapseLab(rich) };
46
+ }
@@ -0,0 +1,104 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The blood vessel labs. Each prop sets up the vessels or names its words;
5
+ * none states the conclusion the lab leads to.
6
+ */
7
+ export declare function vesselVisuals<E>(rich: RichSlot<E>): {
8
+ CapillaryBedLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly attrs: {
12
+ readonly latex: string;
13
+ };
14
+ readonly type: "mathInline";
15
+ } | {
16
+ readonly marks?: readonly [{
17
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly href: string;
21
+ };
22
+ readonly type: "link";
23
+ } | {
24
+ readonly attrs: {
25
+ readonly variant: "success" | "warning" | null;
26
+ };
27
+ readonly type: "highlight";
28
+ }, ...({
29
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly href: string;
33
+ };
34
+ readonly type: "link";
35
+ } | {
36
+ readonly attrs: {
37
+ readonly variant: "success" | "warning" | null;
38
+ };
39
+ readonly type: "highlight";
40
+ })[]];
41
+ readonly text: string;
42
+ readonly type: "text";
43
+ }, ...({
44
+ readonly attrs: {
45
+ readonly latex: string;
46
+ };
47
+ readonly type: "mathInline";
48
+ } | {
49
+ readonly marks?: readonly [{
50
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
51
+ } | {
52
+ readonly attrs: {
53
+ readonly href: string;
54
+ };
55
+ readonly type: "link";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly variant: "success" | "warning" | null;
59
+ };
60
+ readonly type: "highlight";
61
+ }, ...({
62
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
63
+ } | {
64
+ readonly attrs: {
65
+ readonly href: string;
66
+ };
67
+ readonly type: "link";
68
+ } | {
69
+ readonly attrs: {
70
+ readonly variant: "success" | "warning" | null;
71
+ };
72
+ readonly type: "highlight";
73
+ })[]];
74
+ readonly text: string;
75
+ readonly type: "text";
76
+ })[]], E, never, never>>;
77
+ readonly title: RichSlot<E>;
78
+ readonly labels: Schema.Struct<{
79
+ readonly arterial: Schema.Trimmed;
80
+ readonly inward: RichSlot<E>;
81
+ readonly lymph: RichSlot<E>;
82
+ readonly oncotic: Schema.Trimmed;
83
+ readonly outward: RichSlot<E>;
84
+ readonly parts: Schema.Struct<{
85
+ readonly arteriole: RichSlot<E>;
86
+ readonly capillary: RichSlot<E>;
87
+ readonly cell: RichSlot<E>;
88
+ readonly lymph: RichSlot<E>;
89
+ readonly venule: RichSlot<E>;
90
+ }>;
91
+ readonly turning: RichSlot<E>;
92
+ readonly view: Schema.Trimmed;
93
+ }>;
94
+ readonly oncotic: Schema.Finite;
95
+ readonly pressure: Schema.Struct<{
96
+ readonly arterial: Schema.Finite;
97
+ readonly venous: Schema.Finite;
98
+ }>;
99
+ readonly tissue: Schema.Struct<{
100
+ readonly oncotic: Schema.Finite;
101
+ readonly pressure: Schema.Finite;
102
+ }>;
103
+ }>, "figure">;
104
+ };
@@ -0,0 +1,60 @@
1
+ import { Schema } from "effect";
2
+ import { cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /** A pressure in millimetres of mercury, never below zero. */
5
+ const PressureSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
6
+ /**
7
+ * The blood pressure at the two ends of a capillary, in millimetres of
8
+ * mercury. Blood flows from the arterial end to the venous end, so the
9
+ * pressure falls along it and the arterial end is always the higher.
10
+ */
11
+ const EndsSchema = Schema.Struct({
12
+ arterial: PressureSchema,
13
+ venous: PressureSchema,
14
+ }).check(Schema.makeFilter(({ arterial, venous }) => arterial > venous, {
15
+ message: "Expected a higher blood pressure at the arterial end than at the venous end.",
16
+ }));
17
+ /**
18
+ * Props of `CapillaryBedLab`: an arteriole, the capillaries it feeds, the
19
+ * venule they drain into, and a lymph capillary among the tissue cells. Blood
20
+ * enters the capillaries at `pressure.arterial` and leaves at
21
+ * `pressure.venous` millimetres of mercury, against the osmotic pull of the
22
+ * plasma proteins, `oncotic`. The tissue fluid around the cells pushes back
23
+ * with `tissue.pressure` and pulls with `tissue.oncotic`. The tissue fluid's
24
+ * pressure may be below zero, as it is in loose tissue under the skin, where
25
+ * the lymph vessels draw it down to about -3 millimetres of mercury.
26
+ */
27
+ function capillaryBedLab(rich) {
28
+ return figure(Schema.Struct({
29
+ ...cardFields(rich),
30
+ labels: Schema.Struct({
31
+ arterial: TextSchema,
32
+ inward: rich,
33
+ lymph: rich,
34
+ oncotic: TextSchema,
35
+ outward: rich,
36
+ parts: Schema.Struct({
37
+ arteriole: rich,
38
+ capillary: rich,
39
+ cell: rich,
40
+ lymph: rich,
41
+ venule: rich,
42
+ }),
43
+ turning: rich,
44
+ view: TextSchema,
45
+ }),
46
+ oncotic: PressureSchema,
47
+ pressure: EndsSchema,
48
+ tissue: Schema.Struct({
49
+ oncotic: PressureSchema,
50
+ pressure: Schema.Finite,
51
+ }),
52
+ }));
53
+ }
54
+ /**
55
+ * The blood vessel labs. Each prop sets up the vessels or names its words;
56
+ * none states the conclusion the lab leads to.
57
+ */
58
+ export function vesselVisuals(rich) {
59
+ return { CapillaryBedLab: capillaryBedLab(rich) };
60
+ }
@@ -0,0 +1,108 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The visuals of this lab. Each prop sets up the experiment or names its
5
+ * words; none states what the learner should conclude, so none holds answer
6
+ * state.
7
+ */
8
+ export declare function yeastVisuals<E>(rich: RichSlot<E>): {
9
+ YeastFermentationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
10
+ readonly description: RichSlot<E>;
11
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
12
+ readonly attrs: {
13
+ readonly latex: string;
14
+ };
15
+ readonly type: "mathInline";
16
+ } | {
17
+ readonly marks?: readonly [{
18
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
19
+ } | {
20
+ readonly attrs: {
21
+ readonly href: string;
22
+ };
23
+ readonly type: "link";
24
+ } | {
25
+ readonly attrs: {
26
+ readonly variant: "success" | "warning" | null;
27
+ };
28
+ readonly type: "highlight";
29
+ }, ...({
30
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
31
+ } | {
32
+ readonly attrs: {
33
+ readonly href: string;
34
+ };
35
+ readonly type: "link";
36
+ } | {
37
+ readonly attrs: {
38
+ readonly variant: "success" | "warning" | null;
39
+ };
40
+ readonly type: "highlight";
41
+ })[]];
42
+ readonly text: string;
43
+ readonly type: "text";
44
+ }, ...({
45
+ readonly attrs: {
46
+ readonly latex: string;
47
+ };
48
+ readonly type: "mathInline";
49
+ } | {
50
+ readonly marks?: readonly [{
51
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
52
+ } | {
53
+ readonly attrs: {
54
+ readonly href: string;
55
+ };
56
+ readonly type: "link";
57
+ } | {
58
+ readonly attrs: {
59
+ readonly variant: "success" | "warning" | null;
60
+ };
61
+ readonly type: "highlight";
62
+ }, ...({
63
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
64
+ } | {
65
+ readonly attrs: {
66
+ readonly href: string;
67
+ };
68
+ readonly type: "link";
69
+ } | {
70
+ readonly attrs: {
71
+ readonly variant: "success" | "warning" | null;
72
+ };
73
+ readonly type: "highlight";
74
+ })[]];
75
+ readonly text: string;
76
+ readonly type: "text";
77
+ })[]], E, never, never>>;
78
+ readonly title: RichSlot<E>;
79
+ readonly glucose: Schema.Finite;
80
+ readonly labels: Schema.Struct<{
81
+ readonly clear: RichSlot<E>;
82
+ readonly collected: RichSlot<E>;
83
+ readonly control: Schema.Trimmed;
84
+ readonly ethanol: RichSlot<E>;
85
+ readonly limewater: RichSlot<E>;
86
+ readonly milky: RichSlot<E>;
87
+ readonly none: RichSlot<E>;
88
+ readonly parts: Schema.Struct<{
89
+ readonly bath: Schema.Trimmed;
90
+ readonly limewater: Schema.Trimmed;
91
+ readonly paraffin: Schema.Trimmed;
92
+ readonly thermometer: Schema.Trimmed;
93
+ }>;
94
+ readonly rate: RichSlot<E>;
95
+ readonly smell: RichSlot<E>;
96
+ readonly temperature: Schema.Trimmed;
97
+ readonly time: Schema.Trimmed;
98
+ readonly view: Schema.Trimmed;
99
+ readonly warmth: RichSlot<E>;
100
+ readonly yeast: Schema.Trimmed;
101
+ }>;
102
+ readonly temperature: Schema.Struct<{
103
+ readonly max: Schema.Finite;
104
+ readonly min: Schema.Finite;
105
+ readonly value: Schema.Finite;
106
+ }>;
107
+ }>, "figure">;
108
+ };
@@ -0,0 +1,61 @@
1
+ import { Schema } from "effect";
2
+ import { cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /**
5
+ * The water bath's temperatures in °C: the slider's range and where it
6
+ * starts. Water stays liquid from 0 to 100 °C, and the start lies in range.
7
+ */
8
+ const BathSchema = Schema.Struct({
9
+ max: Schema.Finite.check(Schema.isLessThanOrEqualTo(100)),
10
+ min: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),
11
+ value: Schema.Finite,
12
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && value >= min && value <= max, {
13
+ message: "Expected a bath range whose minimum is below its maximum and holds its starting value.",
14
+ }));
15
+ /**
16
+ * Props of `YeastFermentationLab`: the KSSM experiment on fermentation in
17
+ * yeast and its control, in one water bath. `glucose` is the strength of the
18
+ * boiled and cooled glucose solution, in per cent (w/v); `temperature` is the
19
+ * bath's range and starting value, in °C. The labels name the slider and the
20
+ * run's clock, the readings (bubbles a minute, carbon dioxide into the
21
+ * limewater, the limewater's state, the temperature in each tube, and the
22
+ * smell of the yeast tube), the two tubes, and the parts written in the
23
+ * scene.
24
+ */
25
+ function yeastFermentationLab(rich) {
26
+ return figure(Schema.Struct({
27
+ ...cardFields(rich),
28
+ glucose: Schema.Finite.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(100)),
29
+ labels: Schema.Struct({
30
+ clear: rich,
31
+ collected: rich,
32
+ control: TextSchema,
33
+ ethanol: rich,
34
+ limewater: rich,
35
+ milky: rich,
36
+ none: rich,
37
+ parts: Schema.Struct({
38
+ bath: TextSchema,
39
+ limewater: TextSchema,
40
+ paraffin: TextSchema,
41
+ thermometer: TextSchema,
42
+ }),
43
+ rate: rich,
44
+ smell: rich,
45
+ temperature: TextSchema,
46
+ time: TextSchema,
47
+ view: TextSchema,
48
+ warmth: rich,
49
+ yeast: TextSchema,
50
+ }),
51
+ temperature: BathSchema,
52
+ }));
53
+ }
54
+ /**
55
+ * The visuals of this lab. Each prop sets up the experiment or names its
56
+ * words; none states what the learner should conclude, so none holds answer
57
+ * state.
58
+ */
59
+ export function yeastVisuals(rich) {
60
+ return { YeastFermentationLab: yeastFermentationLab(rich) };
61
+ }
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The biology labs, each a three-dimensional scene. The meaning of the
5
5
  * greenhouse lab states what the gas level does to the heat, so it is answer