@nakafa/aksara-contracts 7.0.0 → 8.0.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 (74) hide show
  1. package/dist/assessment/figure.d.ts +24 -48725
  2. package/dist/assessment/figure.js +10 -6
  3. package/dist/visual/base/layout.d.ts +6 -6
  4. package/dist/visual/base/math.d.ts +4 -4
  5. package/dist/visual/base/media.d.ts +2 -2
  6. package/dist/visual/biology/bacteria.d.ts +55 -0
  7. package/dist/visual/biology/bacteria.js +79 -0
  8. package/dist/visual/biology/cell.d.ts +89 -0
  9. package/dist/visual/biology/cell.js +95 -0
  10. package/dist/visual/biology/climate.d.ts +75 -0
  11. package/dist/visual/biology/climate.js +94 -0
  12. package/dist/visual/biology/ecology.d.ts +75 -0
  13. package/dist/visual/biology/ecology.js +94 -0
  14. package/dist/visual/biology.d.ts +9 -9
  15. package/dist/visual/card.d.ts +0 -2
  16. package/dist/visual/card.js +0 -6
  17. package/dist/visual/catalog.d.ts +1610 -27079
  18. package/dist/visual/catalog.js +47 -1
  19. package/dist/visual/chemistry/atom.d.ts +4 -4
  20. package/dist/visual/chemistry/balance.d.ts +79 -0
  21. package/dist/visual/chemistry/balance.js +128 -0
  22. package/dist/visual/chemistry/bonding.d.ts +80 -0
  23. package/dist/visual/chemistry/bonding.js +147 -0
  24. package/dist/visual/chemistry/discovery.d.ts +96 -0
  25. package/dist/visual/chemistry/discovery.js +137 -0
  26. package/dist/visual/chemistry/electron.d.ts +2 -2
  27. package/dist/visual/chemistry/laws.d.ts +4 -4
  28. package/dist/visual/chemistry/particles.d.ts +5 -5
  29. package/dist/visual/chemistry/periodic.d.ts +2 -2
  30. package/dist/visual/chemistry/reaction.d.ts +3 -3
  31. package/dist/visual/entry.d.ts +4 -4
  32. package/dist/visual/mathematics/chart.d.ts +1 -1
  33. package/dist/visual/mathematics/charts.d.ts +5 -5
  34. package/dist/visual/mathematics/function.d.ts +7 -7
  35. package/dist/visual/mathematics/geometry.d.ts +4 -213
  36. package/dist/visual/mathematics/geometry.js +3 -65
  37. package/dist/visual/physics/braking.d.ts +62 -0
  38. package/dist/visual/physics/braking.js +83 -0
  39. package/dist/visual/physics/circular.d.ts +36 -0
  40. package/dist/visual/physics/circular.js +51 -0
  41. package/dist/visual/physics/efficiency.d.ts +93 -0
  42. package/dist/visual/physics/efficiency.js +129 -0
  43. package/dist/visual/physics/falling.d.ts +56 -0
  44. package/dist/visual/physics/falling.js +77 -0
  45. package/dist/visual/physics/force.d.ts +88 -0
  46. package/dist/visual/physics/force.js +115 -0
  47. package/dist/visual/physics/instrument.d.ts +93 -0
  48. package/dist/visual/physics/instrument.js +135 -0
  49. package/dist/visual/physics/measurement.d.ts +4 -4
  50. package/dist/visual/physics/motion.d.ts +6 -6
  51. package/dist/visual/physics/parabolic.d.ts +2 -2
  52. package/dist/visual/physics/position.d.ts +87 -0
  53. package/dist/visual/physics/position.js +123 -0
  54. package/dist/visual/physics/power.d.ts +121 -0
  55. package/dist/visual/physics/power.js +162 -0
  56. package/dist/visual/physics/precision.d.ts +96 -0
  57. package/dist/visual/physics/precision.js +137 -0
  58. package/dist/visual/physics/product.d.ts +73 -0
  59. package/dist/visual/physics/product.js +96 -0
  60. package/dist/visual/physics/record.d.ts +34 -0
  61. package/dist/visual/physics/record.js +46 -0
  62. package/dist/visual/physics/relative.d.ts +55 -0
  63. package/dist/visual/physics/relative.js +76 -0
  64. package/dist/visual/physics/solar.d.ts +91 -0
  65. package/dist/visual/physics/solar.js +126 -0
  66. package/dist/visual/physics/vector.d.ts +103 -0
  67. package/dist/visual/physics/vector.js +123 -0
  68. package/dist/visual/physics/velocity.d.ts +7 -7
  69. package/dist/visual/politics.d.ts +8 -8
  70. package/package.json +1 -1
  71. package/dist/visual/mathematics/line.d.ts +0 -179
  72. package/dist/visual/mathematics/line.js +0 -156
  73. package/dist/visual/mathematics/number.d.ts +0 -21
  74. package/dist/visual/mathematics/number.js +0 -53
@@ -2,7 +2,7 @@ import { Array as Arr, Schema } from "effect";
2
2
  import { AssetIdSchema } from "#contracts/assessment/identity";
3
3
  import { RichTextSchema } from "#contracts/assessment/inline";
4
4
  import { PlainTextSchema, PositiveIntSchema, } from "#contracts/assessment/scalar";
5
- import { assessmentVisuals, FIGURE_NAMES } from "#contracts/visual/catalog";
5
+ import { assessmentVisuals, FIGURE_NAMES, } from "#contracts/visual/catalog";
6
6
  /**
7
7
  * One uploaded image. The text alternative is required, and the pixel size is
8
8
  * required so a page can reserve the space before the file loads.
@@ -22,17 +22,21 @@ const FigureFields = {
22
22
  alt: PlainTextSchema,
23
23
  caption: Schema.NullOr(RichTextSchema),
24
24
  };
25
+ /** One member of the figure union, for one catalog component. */
26
+ function figureMember(component) {
27
+ return Schema.Struct({
28
+ ...FigureFields,
29
+ component: Schema.Literal(component),
30
+ props: assessmentVisuals[component].props,
31
+ });
32
+ }
25
33
  /**
26
34
  * The attributes of a figure node: any figure component of the Visual
27
35
  * Catalog and the props its catalog schema takes, so a figure is checked,
28
36
  * edited, and exported through the schema of its component. The catalog is
29
37
  * the one list of visuals: a lesson and an assessment draw the same ones.
30
38
  */
31
- export const FigureAttrsSchema = Schema.Union(Arr.map(FIGURE_NAMES, (component) => Schema.Struct({
32
- ...FigureFields,
33
- component: Schema.Literal(component),
34
- props: assessmentVisuals[component].props,
35
- })));
39
+ export const FigureAttrsSchema = Schema.Union(Arr.map(FIGURE_NAMES, figureMember));
36
40
  /** A figure block: a catalog visual with a required text alternative. */
37
41
  export const FigureNodeSchema = Schema.Struct({
38
42
  attrs: FigureAttrsSchema,
@@ -10,18 +10,18 @@ export declare const NoPropsSchema: Schema.$Record<Schema.String, Schema.Never>;
10
10
  * children; a highlight marks a phrase; a code block shows sources.
11
11
  */
12
12
  export declare function layoutVisuals(): {
13
- AgentContext: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>>;
13
+ AgentContext: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>, "markup">;
14
14
  CodeBlock: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
15
15
  readonly data: Schema.NonEmptyArray<Schema.Struct<{
16
16
  readonly code: Schema.String;
17
17
  readonly filename: Schema.Trimmed;
18
18
  readonly language: Schema.Trimmed;
19
19
  }>>;
20
- }>>;
21
- ContentBlock: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>>;
22
- ContentGrid: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>>;
23
- ContentStack: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>>;
20
+ }>, "markup">;
21
+ ContentBlock: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>, "markup">;
22
+ ContentGrid: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>, "markup">;
23
+ ContentStack: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>, "markup">;
24
24
  Highlight: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
25
25
  readonly variant: Schema.optionalKey<Schema.Literals<readonly ["success", "warning"]>>;
26
- }>>;
26
+ }>, "markup">;
27
27
  };
@@ -8,11 +8,11 @@ import { type RichSlot } from "#contracts/visual/card";
8
8
  export declare function mathVisuals<E>(rich: RichSlot<E>): {
9
9
  BlockMath: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
10
10
  readonly math: Schema.String;
11
- }>>;
11
+ }>, "markup">;
12
12
  InlineMath: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
13
13
  readonly math: Schema.String;
14
- }>>;
15
- MathContainer: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>>;
14
+ }>, "markup">;
15
+ MathContainer: import("#contracts/visual/entry").VisualEntry<Schema.$Record<Schema.String, Schema.Never>, "markup">;
16
16
  MathVisual: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
17
17
  readonly description: RichSlot<E>;
18
18
  readonly title: RichSlot<E>;
@@ -519,5 +519,5 @@ export declare function mathVisuals<E>(rich: RichSlot<E>): {
519
519
  }>>;
520
520
  }>]>;
521
521
  }>]>;
522
- }>>;
522
+ }>, "figure">;
523
523
  };
@@ -6,8 +6,8 @@ export declare function mediaVisuals<E>(rich: RichSlot<E>): {
6
6
  readonly description: RichSlot<E>;
7
7
  readonly title: RichSlot<E>;
8
8
  readonly chart: Schema.String;
9
- }>>;
9
+ }>, "figure">;
10
10
  Youtube: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
11
11
  readonly videoId: Schema.String;
12
- }>>;
12
+ }>, "figure">;
13
13
  };
@@ -0,0 +1,55 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The props of the bacteria labs. No prop states the conclusion a lab leads to,
5
+ * so none holds answer state.
6
+ */
7
+ export declare function bacteriaVisuals<E>(rich: RichSlot<E>): {
8
+ BinaryFissionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly title: RichSlot<E>;
11
+ readonly labels: Schema.Struct<{
12
+ readonly cells: RichSlot<E>;
13
+ readonly generations: RichSlot<E>;
14
+ readonly minutes: Schema.Trimmed;
15
+ readonly viewLabel: Schema.Trimmed;
16
+ }>;
17
+ }>, "figure">;
18
+ ChemotaxisLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
19
+ readonly description: RichSlot<E>;
20
+ readonly title: RichSlot<E>;
21
+ readonly labels: Schema.Struct<{
22
+ readonly elapsed: RichSlot<E>;
23
+ readonly mutant: RichSlot<E>;
24
+ readonly sensing: RichSlot<E>;
25
+ readonly viewLabel: Schema.Trimmed;
26
+ }>;
27
+ }>, "figure">;
28
+ GramStainLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
29
+ readonly description: RichSlot<E>;
30
+ readonly title: RichSlot<E>;
31
+ readonly labels: Schema.Struct<{
32
+ readonly chooseStep: Schema.Trimmed;
33
+ readonly hues: Schema.$Record<Schema.Literals<readonly ["clear", "purple", "pink"]>, RichSlot<E>>;
34
+ readonly negative: RichSlot<E>;
35
+ readonly positive: RichSlot<E>;
36
+ readonly steps: Schema.$Record<Schema.Literals<readonly ["smear", "violet", "iodine", "alcohol", "safranin"]>, Schema.Trimmed>;
37
+ readonly viewLabel: Schema.Trimmed;
38
+ }>;
39
+ }>, "figure">;
40
+ YogurtLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
41
+ readonly description: RichSlot<E>;
42
+ readonly title: RichSlot<E>;
43
+ readonly labels: Schema.Struct<{
44
+ readonly hours: Schema.Trimmed;
45
+ readonly ph: RichSlot<E>;
46
+ readonly state: RichSlot<E>;
47
+ readonly states: Schema.Struct<{
48
+ readonly liquid: RichSlot<E>;
49
+ readonly set: RichSlot<E>;
50
+ }>;
51
+ readonly tilt: Schema.Trimmed;
52
+ readonly viewLabel: Schema.Trimmed;
53
+ }>;
54
+ }>, "figure">;
55
+ };
@@ -0,0 +1,79 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /**
5
+ * Props of `BinaryFissionLab`: one cell of Escherichia coli on agar becomes a
6
+ * colony by binary fission.
7
+ */
8
+ function binaryFissionLab(rich) {
9
+ return figure(Schema.Struct({
10
+ ...cardFields(rich),
11
+ labels: Schema.Struct({
12
+ cells: rich,
13
+ generations: rich,
14
+ minutes: TextSchema,
15
+ viewLabel: TextSchema,
16
+ }),
17
+ }));
18
+ }
19
+ /**
20
+ * Props of `ChemotaxisLab`: two Escherichia coli cells swim in a dish whose
21
+ * sugar comes from a crystal on the right.
22
+ */
23
+ function chemotaxisLab(rich) {
24
+ return figure(Schema.Struct({
25
+ ...cardFields(rich),
26
+ labels: Schema.Struct({
27
+ elapsed: rich,
28
+ mutant: rich,
29
+ sensing: rich,
30
+ viewLabel: TextSchema,
31
+ }),
32
+ }));
33
+ }
34
+ /**
35
+ * Props of `GramStainLab`: a Gram stain under the microscope, step by step, on
36
+ * a slide that carries three shapes of bacteria at 1000×.
37
+ */
38
+ function gramStainLab(rich) {
39
+ return figure(Schema.Struct({
40
+ ...cardFields(rich),
41
+ labels: Schema.Struct({
42
+ chooseStep: TextSchema,
43
+ hues: byIds(["clear", "purple", "pink"], rich),
44
+ negative: rich,
45
+ positive: rich,
46
+ steps: byIds(["smear", "violet", "iodine", "alcohol", "safranin"], TextSchema),
47
+ viewLabel: TextSchema,
48
+ }),
49
+ }));
50
+ }
51
+ /**
52
+ * Props of `YogurtLab`: milk with a spoonful of yoghurt culture sits in a
53
+ * yoghurt maker at 43 °C.
54
+ */
55
+ function yogurtLab(rich) {
56
+ return figure(Schema.Struct({
57
+ ...cardFields(rich),
58
+ labels: Schema.Struct({
59
+ hours: TextSchema,
60
+ ph: rich,
61
+ state: rich,
62
+ states: Schema.Struct({ liquid: rich, set: rich }),
63
+ tilt: TextSchema,
64
+ viewLabel: TextSchema,
65
+ }),
66
+ }));
67
+ }
68
+ /**
69
+ * The props of the bacteria labs. No prop states the conclusion a lab leads to,
70
+ * so none holds answer state.
71
+ */
72
+ export function bacteriaVisuals(rich) {
73
+ return {
74
+ BinaryFissionLab: binaryFissionLab(rich),
75
+ ChemotaxisLab: chemotaxisLab(rich),
76
+ GramStainLab: gramStainLab(rich),
77
+ YogurtLab: yogurtLab(rich),
78
+ };
79
+ }
@@ -0,0 +1,89 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The props of the cell and DNA labs. No prop states the conclusion a lab leads
5
+ * to, so none holds answer state.
6
+ */
7
+ export declare function cellVisuals<E>(rich: RichSlot<E>): {
8
+ CellCutawayLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly title: RichSlot<E>;
11
+ readonly cells: Schema.$Array<Schema.Literals<readonly ["animal", "plant", "yeast", "bacterium"]>>;
12
+ readonly labels: Schema.Struct<{
13
+ readonly cells: Schema.Struct<{
14
+ readonly animal: Schema.optionalKey<RichSlot<E>>;
15
+ readonly plant: Schema.optionalKey<RichSlot<E>>;
16
+ readonly yeast: Schema.optionalKey<RichSlot<E>>;
17
+ readonly bacterium: Schema.optionalKey<RichSlot<E>>;
18
+ }>;
19
+ readonly choose: Schema.Trimmed;
20
+ readonly facts: Schema.Struct<{
21
+ readonly animal: Schema.optionalKey<Schema.Struct<{
22
+ readonly nucleus: RichSlot<E>;
23
+ readonly power: RichSlot<E>;
24
+ readonly wall: RichSlot<E>;
25
+ }>>;
26
+ readonly bacterium: Schema.optionalKey<Schema.Struct<{
27
+ readonly nucleus: RichSlot<E>;
28
+ readonly power: RichSlot<E>;
29
+ readonly wall: RichSlot<E>;
30
+ }>>;
31
+ readonly plant: Schema.optionalKey<Schema.Struct<{
32
+ readonly nucleus: RichSlot<E>;
33
+ readonly power: RichSlot<E>;
34
+ readonly wall: RichSlot<E>;
35
+ }>>;
36
+ readonly yeast: Schema.optionalKey<Schema.Struct<{
37
+ readonly nucleus: RichSlot<E>;
38
+ readonly power: RichSlot<E>;
39
+ readonly wall: RichSlot<E>;
40
+ }>>;
41
+ }>;
42
+ readonly minutes: Schema.optionalKey<Schema.Trimmed>;
43
+ readonly nucleus: RichSlot<E>;
44
+ readonly power: RichSlot<E>;
45
+ readonly size: RichSlot<E>;
46
+ readonly viewLabel: Schema.Trimmed;
47
+ readonly wall: RichSlot<E>;
48
+ }>;
49
+ }>, "figure">;
50
+ CellScaleLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
51
+ readonly description: RichSlot<E>;
52
+ readonly title: RichSlot<E>;
53
+ readonly labels: Schema.Struct<{
54
+ readonly bacterium: RichSlot<E>;
55
+ readonly cell: RichSlot<E>;
56
+ readonly view: RichSlot<E>;
57
+ readonly viewLabel: Schema.Trimmed;
58
+ readonly virion: RichSlot<E>;
59
+ readonly zoom: Schema.Trimmed;
60
+ }>;
61
+ }>, "figure">;
62
+ DnaHelixLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
63
+ readonly description: RichSlot<E>;
64
+ readonly title: RichSlot<E>;
65
+ readonly copy: Schema.optionalKey<Schema.Boolean>;
66
+ readonly genome: Schema.optionalKey<Schema.Finite>;
67
+ readonly labels: Schema.Struct<{
68
+ readonly choose: Schema.optionalKey<Schema.Trimmed>;
69
+ readonly copied: Schema.optionalKey<RichSlot<E>>;
70
+ readonly copy: Schema.optionalKey<Schema.Trimmed>;
71
+ readonly differences: Schema.optionalKey<RichSlot<E>>;
72
+ readonly gc: Schema.optionalKey<RichSlot<E>>;
73
+ readonly identity: Schema.optionalKey<RichSlot<E>>;
74
+ readonly length: RichSlot<E>;
75
+ readonly share: Schema.optionalKey<RichSlot<E>>;
76
+ readonly span: RichSlot<E>;
77
+ readonly strands: Schema.optionalKey<Schema.Struct<{
78
+ readonly first: RichSlot<E>;
79
+ readonly second: RichSlot<E>;
80
+ }>>;
81
+ readonly turns: Schema.optionalKey<RichSlot<E>>;
82
+ readonly viewLabel: Schema.Trimmed;
83
+ readonly whole: Schema.optionalKey<RichSlot<E>>;
84
+ }>;
85
+ readonly nucleic: Schema.optionalKey<Schema.Literals<readonly ["dna", "rna"]>>;
86
+ readonly sequence: Schema.Trimmed;
87
+ readonly variant: Schema.optionalKey<Schema.Trimmed>;
88
+ }>, "figure">;
89
+ };
@@ -0,0 +1,95 @@
1
+ import { Schema } from "effect";
2
+ import { cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /** The facts the cell cutaway lab gives for one kind of cell. */
5
+ function cellFacts(rich) {
6
+ return Schema.Struct({ nucleus: rich, power: rich, wall: rich });
7
+ }
8
+ /**
9
+ * Props of `CellCutawayLab`: a cell cut in half, so the reader looks into it as
10
+ * into a bowl.
11
+ */
12
+ function cellCutawayLab(rich) {
13
+ return figure(Schema.Struct({
14
+ ...cardFields(rich),
15
+ cells: Schema.Array(Schema.Literals(["animal", "plant", "yeast", "bacterium"])),
16
+ labels: Schema.Struct({
17
+ cells: Schema.Struct({
18
+ animal: Schema.optionalKey(rich),
19
+ plant: Schema.optionalKey(rich),
20
+ yeast: Schema.optionalKey(rich),
21
+ bacterium: Schema.optionalKey(rich),
22
+ }),
23
+ choose: TextSchema,
24
+ facts: Schema.Struct({
25
+ animal: Schema.optionalKey(cellFacts(rich)),
26
+ bacterium: Schema.optionalKey(cellFacts(rich)),
27
+ plant: Schema.optionalKey(cellFacts(rich)),
28
+ yeast: Schema.optionalKey(cellFacts(rich)),
29
+ }),
30
+ minutes: Schema.optionalKey(TextSchema),
31
+ nucleus: rich,
32
+ power: rich,
33
+ size: rich,
34
+ viewLabel: TextSchema,
35
+ wall: rich,
36
+ }),
37
+ }));
38
+ }
39
+ /**
40
+ * Props of `CellScaleLab`: an animal cell, an Escherichia coli rod and a
41
+ * SARS-CoV-2 virion side by side at their real sizes.
42
+ */
43
+ function cellScaleLab(rich) {
44
+ return figure(Schema.Struct({
45
+ ...cardFields(rich),
46
+ labels: Schema.Struct({
47
+ bacterium: rich,
48
+ cell: rich,
49
+ view: rich,
50
+ viewLabel: TextSchema,
51
+ virion: rich,
52
+ zoom: TextSchema,
53
+ }),
54
+ }));
55
+ }
56
+ /**
57
+ * Props of `DnaHelixLab`: a stretch of DNA or RNA built base by base at B-DNA's
58
+ * real geometry.
59
+ */
60
+ function dnaHelixLab(rich) {
61
+ return figure(Schema.Struct({
62
+ ...cardFields(rich),
63
+ copy: Schema.optionalKey(Schema.Boolean),
64
+ genome: Schema.optionalKey(Schema.Finite),
65
+ labels: Schema.Struct({
66
+ choose: Schema.optionalKey(TextSchema),
67
+ copied: Schema.optionalKey(rich),
68
+ copy: Schema.optionalKey(TextSchema),
69
+ differences: Schema.optionalKey(rich),
70
+ gc: Schema.optionalKey(rich),
71
+ identity: Schema.optionalKey(rich),
72
+ length: rich,
73
+ share: Schema.optionalKey(rich),
74
+ span: rich,
75
+ strands: Schema.optionalKey(Schema.Struct({ first: rich, second: rich })),
76
+ turns: Schema.optionalKey(rich),
77
+ viewLabel: TextSchema,
78
+ whole: Schema.optionalKey(rich),
79
+ }),
80
+ nucleic: Schema.optionalKey(Schema.Literals(["dna", "rna"])),
81
+ sequence: TextSchema,
82
+ variant: Schema.optionalKey(TextSchema),
83
+ }));
84
+ }
85
+ /**
86
+ * The props of the cell and DNA labs. No prop states the conclusion a lab leads
87
+ * to, so none holds answer state.
88
+ */
89
+ export function cellVisuals(rich) {
90
+ return {
91
+ CellCutawayLab: cellCutawayLab(rich),
92
+ CellScaleLab: cellScaleLab(rich),
93
+ DnaHelixLab: dnaHelixLab(rich),
94
+ };
95
+ }
@@ -0,0 +1,75 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The props of the climate labs. No prop states the conclusion a lab leads to,
5
+ * so none holds answer state.
6
+ */
7
+ export declare function climateVisuals<E>(rich: RichSlot<E>): {
8
+ CarbonBudgetLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly title: RichSlot<E>;
11
+ readonly labels: Schema.Struct<{
12
+ readonly above: Schema.optionalKey<RichSlot<E>>;
13
+ readonly chooseRegions: Schema.optionalKey<Schema.Trimmed>;
14
+ readonly cut: Schema.optionalKey<Schema.Trimmed>;
15
+ readonly emissions: Schema.optionalKey<RichSlot<E>>;
16
+ readonly forest: Schema.optionalKey<Schema.Trimmed>;
17
+ readonly level: RichSlot<E>;
18
+ readonly peak: Schema.optionalKey<RichSlot<E>>;
19
+ readonly perYear: Schema.optionalKey<Schema.Trimmed>;
20
+ readonly rate: Schema.optionalKey<RichSlot<E>>;
21
+ readonly regions: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["china", "usa", "india", "europe", "rest"]>, RichSlot<E>>>;
22
+ readonly rise: Schema.optionalKey<RichSlot<E>>;
23
+ readonly viewLabel: Schema.Trimmed;
24
+ readonly warming: Schema.optionalKey<RichSlot<E>>;
25
+ readonly year: Schema.optionalKey<Schema.Trimmed>;
26
+ }>;
27
+ readonly mode: Schema.Literals<readonly ["cooperate", "mitigate", "record"]>;
28
+ }>, "figure">;
29
+ CoralBleachLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
30
+ readonly description: RichSlot<E>;
31
+ readonly title: RichSlot<E>;
32
+ readonly labels: Schema.Struct<{
33
+ readonly alert: RichSlot<E>;
34
+ readonly alerts: Schema.$Record<Schema.Literals<readonly ["calm", "watch", "warning", "bleaching", "dying"]>, RichSlot<E>>;
35
+ readonly dhw: RichSlot<E>;
36
+ readonly hotspot: RichSlot<E>;
37
+ readonly temperature: Schema.Trimmed;
38
+ readonly viewLabel: Schema.Trimmed;
39
+ readonly weeks: Schema.Trimmed;
40
+ }>;
41
+ }>, "figure">;
42
+ SeaLevelRiseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
43
+ readonly description: RichSlot<E>;
44
+ readonly title: RichSlot<E>;
45
+ readonly labels: Schema.Struct<{
46
+ readonly choose: Schema.optionalKey<Schema.Trimmed>;
47
+ readonly defences: Schema.optionalKey<Schema.Struct<{
48
+ readonly wall: Schema.optionalKey<RichSlot<E>>;
49
+ readonly mangrove: Schema.optionalKey<RichSlot<E>>;
50
+ readonly storm: Schema.optionalKey<RichSlot<E>>;
51
+ }>>;
52
+ readonly flooded: Schema.optionalKey<RichSlot<E>>;
53
+ readonly level: RichSlot<E>;
54
+ readonly perYear: Schema.optionalKey<Schema.Trimmed>;
55
+ readonly range: Schema.optionalKey<RichSlot<E>>;
56
+ readonly rate: Schema.optionalKey<RichSlot<E>>;
57
+ readonly retreat: RichSlot<E>;
58
+ readonly rise: Schema.optionalKey<Schema.Trimmed>;
59
+ readonly scenarios: Schema.optionalKey<Schema.Struct<{
60
+ readonly ssp119: Schema.optionalKey<RichSlot<E>>;
61
+ readonly ssp126: Schema.optionalKey<RichSlot<E>>;
62
+ readonly ssp245: Schema.optionalKey<RichSlot<E>>;
63
+ readonly ssp370: Schema.optionalKey<RichSlot<E>>;
64
+ readonly ssp585: Schema.optionalKey<RichSlot<E>>;
65
+ }>>;
66
+ readonly span: Schema.optionalKey<RichSlot<E>>;
67
+ readonly viewLabel: Schema.Trimmed;
68
+ readonly warming: Schema.optionalKey<RichSlot<E>>;
69
+ readonly wave: Schema.optionalKey<RichSlot<E>>;
70
+ readonly year: Schema.optionalKey<Schema.Trimmed>;
71
+ }>;
72
+ readonly mode: Schema.Literals<readonly ["adapt", "flood", "record", "scenario"]>;
73
+ readonly scenarios: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["ssp119", "ssp126", "ssp245", "ssp370", "ssp585"]>>>;
74
+ }>, "figure">;
75
+ };
@@ -0,0 +1,94 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
3
+ import { figure } from "#contracts/visual/entry";
4
+ /** Props of `CarbonBudgetLab`: the air as a bathtub. */
5
+ function carbonBudgetLab(rich) {
6
+ return figure(Schema.Struct({
7
+ ...cardFields(rich),
8
+ labels: Schema.Struct({
9
+ above: Schema.optionalKey(rich),
10
+ chooseRegions: Schema.optionalKey(TextSchema),
11
+ cut: Schema.optionalKey(TextSchema),
12
+ emissions: Schema.optionalKey(rich),
13
+ forest: Schema.optionalKey(TextSchema),
14
+ level: rich,
15
+ peak: Schema.optionalKey(rich),
16
+ perYear: Schema.optionalKey(TextSchema),
17
+ rate: Schema.optionalKey(rich),
18
+ regions: Schema.optionalKey(byIds(["china", "usa", "india", "europe", "rest"], rich)),
19
+ rise: Schema.optionalKey(rich),
20
+ viewLabel: TextSchema,
21
+ warming: Schema.optionalKey(rich),
22
+ year: Schema.optionalKey(TextSchema),
23
+ }),
24
+ mode: Schema.Literals(["cooperate", "mitigate", "record"]),
25
+ }));
26
+ }
27
+ /**
28
+ * Props of `CoralBleachLab`: a reef tank on a lab bench with corals from a reef
29
+ * whose warmest month averages 29 °C.
30
+ */
31
+ function coralBleachLab(rich) {
32
+ return figure(Schema.Struct({
33
+ ...cardFields(rich),
34
+ labels: Schema.Struct({
35
+ alert: rich,
36
+ alerts: byIds(["calm", "watch", "warning", "bleaching", "dying"], rich),
37
+ dhw: rich,
38
+ hotspot: rich,
39
+ temperature: TextSchema,
40
+ viewLabel: TextSchema,
41
+ weeks: TextSchema,
42
+ }),
43
+ }));
44
+ }
45
+ /**
46
+ * Props of `SeaLevelRiseLab`: a coastal village on a beach that climbs 1 m
47
+ * every 20 m inland, at real scale, with a tide gauge at today's high-tide
48
+ * line.
49
+ */
50
+ function seaLevelRiseLab(rich) {
51
+ return figure(Schema.Struct({
52
+ ...cardFields(rich),
53
+ labels: Schema.Struct({
54
+ choose: Schema.optionalKey(TextSchema),
55
+ defences: Schema.optionalKey(Schema.Struct({
56
+ wall: Schema.optionalKey(rich),
57
+ mangrove: Schema.optionalKey(rich),
58
+ storm: Schema.optionalKey(rich),
59
+ })),
60
+ flooded: Schema.optionalKey(rich),
61
+ level: rich,
62
+ perYear: Schema.optionalKey(TextSchema),
63
+ range: Schema.optionalKey(rich),
64
+ rate: Schema.optionalKey(rich),
65
+ retreat: rich,
66
+ rise: Schema.optionalKey(TextSchema),
67
+ scenarios: Schema.optionalKey(Schema.Struct({
68
+ ssp119: Schema.optionalKey(rich),
69
+ ssp126: Schema.optionalKey(rich),
70
+ ssp245: Schema.optionalKey(rich),
71
+ ssp370: Schema.optionalKey(rich),
72
+ ssp585: Schema.optionalKey(rich),
73
+ })),
74
+ span: Schema.optionalKey(rich),
75
+ viewLabel: TextSchema,
76
+ warming: Schema.optionalKey(rich),
77
+ wave: Schema.optionalKey(rich),
78
+ year: Schema.optionalKey(TextSchema),
79
+ }),
80
+ mode: Schema.Literals(["adapt", "flood", "record", "scenario"]),
81
+ scenarios: Schema.optionalKey(Schema.Array(Schema.Literals(["ssp119", "ssp126", "ssp245", "ssp370", "ssp585"]))),
82
+ }));
83
+ }
84
+ /**
85
+ * The props of the climate labs. No prop states the conclusion a lab leads to,
86
+ * so none holds answer state.
87
+ */
88
+ export function climateVisuals(rich) {
89
+ return {
90
+ CarbonBudgetLab: carbonBudgetLab(rich),
91
+ CoralBleachLab: coralBleachLab(rich),
92
+ SeaLevelRiseLab: seaLevelRiseLab(rich),
93
+ };
94
+ }
@@ -0,0 +1,75 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The props of the ecology and disease labs. No prop states the conclusion a
5
+ * lab leads to, so none holds answer state.
6
+ */
7
+ export declare function ecologyVisuals<E>(rich: RichSlot<E>): {
8
+ PredatorPreyLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly title: RichSlot<E>;
11
+ readonly capacity: Schema.optionalKey<Schema.Finite>;
12
+ readonly labels: Schema.Struct<{
13
+ readonly peak: RichSlot<E>;
14
+ readonly predators: RichSlot<E>;
15
+ readonly prey: RichSlot<E>;
16
+ readonly start: Schema.Trimmed;
17
+ readonly viewLabel: Schema.Trimmed;
18
+ readonly year: RichSlot<E>;
19
+ }>;
20
+ }>, "figure">;
21
+ EpidemicSpreadLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
22
+ readonly description: RichSlot<E>;
23
+ readonly title: RichSlot<E>;
24
+ readonly labels: Schema.Struct<{
25
+ readonly chooseRoute: Schema.optionalKey<Schema.Trimmed>;
26
+ readonly distancing: Schema.optionalKey<Schema.Trimmed>;
27
+ readonly immune: RichSlot<E>;
28
+ readonly infected: RichSlot<E>;
29
+ readonly masks: Schema.optionalKey<Schema.Trimmed>;
30
+ readonly peak: RichSlot<E>;
31
+ readonly recovered: RichSlot<E>;
32
+ readonly reproduction: RichSlot<E>;
33
+ readonly routes: Schema.optionalKey<Schema.Struct<{
34
+ readonly air: RichSlot<E>;
35
+ readonly touch: RichSlot<E>;
36
+ }>>;
37
+ readonly susceptible: RichSlot<E>;
38
+ readonly vaccinated: Schema.optionalKey<Schema.Trimmed>;
39
+ readonly viewLabel: Schema.Trimmed;
40
+ readonly washing: Schema.optionalKey<Schema.Trimmed>;
41
+ }>;
42
+ readonly measures: Schema.$Array<Schema.Literals<readonly ["masks", "washing", "vaccinated", "distancing"]>>;
43
+ readonly routes: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["air", "touch"]>>>;
44
+ }>, "figure">;
45
+ HyphaeDecayLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
46
+ readonly description: RichSlot<E>;
47
+ readonly title: RichSlot<E>;
48
+ readonly labels: Schema.Struct<{
49
+ readonly cover: RichSlot<E>;
50
+ readonly hours: Schema.Trimmed;
51
+ readonly length: RichSlot<E>;
52
+ readonly time: RichSlot<E>;
53
+ readonly tips: RichSlot<E>;
54
+ readonly viewLabel: Schema.Trimmed;
55
+ }>;
56
+ }>, "figure">;
57
+ AntibodyNeutralizeLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
58
+ readonly description: RichSlot<E>;
59
+ readonly title: RichSlot<E>;
60
+ readonly labels: Schema.Struct<{
61
+ readonly blocked: RichSlot<E>;
62
+ readonly chance: RichSlot<E>;
63
+ readonly choose: Schema.optionalKey<Schema.Trimmed>;
64
+ readonly covered: RichSlot<E>;
65
+ readonly day: Schema.optionalKey<Schema.Trimmed>;
66
+ readonly level: RichSlot<E>;
67
+ readonly people: Schema.optionalKey<Schema.Struct<{
68
+ readonly unvaccinated: RichSlot<E>;
69
+ readonly vaccinated: RichSlot<E>;
70
+ }>>;
71
+ readonly viewLabel: Schema.Trimmed;
72
+ }>;
73
+ readonly mode: Schema.Literals<readonly ["days", "vaccine"]>;
74
+ }>, "figure">;
75
+ };