@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,117 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** The reactions of the law of combining volumes. */
5
+ const COMBINING_MODES = [
6
+ "water-vapor",
7
+ "ammonia-synthesis",
8
+ "ammonia-decomposition",
9
+ ];
10
+ /** The mixtures of the law of constant composition. */
11
+ const CONSTANT_MODES = ["exact", "hydrogen-excess", "oxygen-excess"];
12
+ /** The systems of the law of conservation of mass. */
13
+ const CONSERVATION_MODES = ["closed", "open"];
14
+ /** The compound pairs of the law of multiple proportions. */
15
+ const MULTIPLE_MODES = [
16
+ "water-peroxide",
17
+ "carbon-oxides",
18
+ "nitrogen-oxides",
19
+ ];
20
+ /** Props of `CombiningVolumesLab`: gas volumes that react in whole ratios. */
21
+ function combiningVolumesLab(rich) {
22
+ return figure(Schema.Struct({
23
+ ...cardFields(rich),
24
+ labels: Schema.Struct({
25
+ chooseMode: TextSchema,
26
+ exampleLabel: TextSchema,
27
+ modes: byIds(COMBINING_MODES, Schema.Struct({
28
+ example: rich,
29
+ helperCaption: rich,
30
+ ratio: rich,
31
+ tab: rich,
32
+ tabLabel: TextSchema,
33
+ })),
34
+ products: TextSchema,
35
+ ratioLabel: TextSchema,
36
+ reactants: TextSchema,
37
+ reactionView: TextSchema,
38
+ volumeUnit: TextSchema,
39
+ }),
40
+ }), answerAt(["labels", "modes", "*", "ratio"]));
41
+ }
42
+ /** Props of `ConstantCompositionLab`: one compound, one mass ratio. */
43
+ function constantCompositionLab(rich) {
44
+ return figure(Schema.Struct({
45
+ ...cardFields(rich),
46
+ labels: Schema.Struct({
47
+ after: TextSchema,
48
+ before: TextSchema,
49
+ chooseMode: TextSchema,
50
+ leftoverLabel: TextSchema,
51
+ modes: byIds(CONSTANT_MODES, Schema.Struct({
52
+ helperCaption: rich,
53
+ leftover: rich,
54
+ ratio: rich,
55
+ readoutAfter: rich,
56
+ readoutBefore: rich,
57
+ tab: rich,
58
+ tabLabel: TextSchema,
59
+ })),
60
+ ratioLabel: TextSchema,
61
+ reactionView: TextSchema,
62
+ }),
63
+ }), answerAt(["labels", "modes", "*", "leftover"], ["labels", "modes", "*", "ratio"]));
64
+ }
65
+ /** Props of `MassConservationLab`: the mass of a closed and an open system. */
66
+ function massConservationLab(rich) {
67
+ return figure(Schema.Struct({
68
+ ...cardFields(rich),
69
+ labels: Schema.Struct({
70
+ after: TextSchema,
71
+ before: TextSchema,
72
+ calculationLabel: TextSchema,
73
+ chooseMode: TextSchema,
74
+ modes: byIds(CONSERVATION_MODES, Schema.Struct({
75
+ calculation: rich,
76
+ helperCaption: rich,
77
+ readoutAfter: rich,
78
+ readoutBefore: rich,
79
+ system: rich,
80
+ tab: TextSchema,
81
+ })),
82
+ reactionView: TextSchema,
83
+ systemLabel: TextSchema,
84
+ }),
85
+ }), answerAt(["labels", "modes", "*", "calculation"]));
86
+ }
87
+ /** Props of `MultipleProportionsLab`: one element fixed, the other in small ratios. */
88
+ function multipleProportionsLab(rich) {
89
+ return figure(Schema.Struct({
90
+ ...cardFields(rich),
91
+ labels: Schema.Struct({
92
+ changingLabel: TextSchema,
93
+ chooseMode: TextSchema,
94
+ comparisonView: TextSchema,
95
+ fixedLabel: TextSchema,
96
+ modes: byIds(MULTIPLE_MODES, Schema.Struct({
97
+ changing: rich,
98
+ fixed: rich,
99
+ helperCaption: rich,
100
+ tab: rich,
101
+ tabLabel: TextSchema,
102
+ })),
103
+ }),
104
+ }), answerAt(["labels", "modes", "*", "changing"]));
105
+ }
106
+ /**
107
+ * The labs of the basic chemical laws. A ratio, a leftover, and a calculation
108
+ * state the result each law predicts, so they are answer state.
109
+ */
110
+ export function lawVisuals(rich) {
111
+ return {
112
+ CombiningVolumesLab: combiningVolumesLab(rich),
113
+ ConstantCompositionLab: constantCompositionLab(rich),
114
+ MassConservationLab: massConservationLab(rich),
115
+ MultipleProportionsLab: multipleProportionsLab(rich),
116
+ };
117
+ }
@@ -0,0 +1,114 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The particle labs. A category and a reading say what a particle is, a note
5
+ * says what an isotope shows, and a summary says what a property means, so
6
+ * each is answer state.
7
+ */
8
+ export declare function particleVisuals<E>(rich: RichSlot<E>): {
9
+ IonLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
10
+ readonly description: RichSlot<E>;
11
+ readonly title: RichSlot<E>;
12
+ readonly labels: Schema.Struct<{
13
+ readonly afterChange: Schema.Trimmed;
14
+ readonly beforeChange: Schema.Trimmed;
15
+ readonly charge: Schema.Trimmed;
16
+ readonly chooseIon: Schema.Trimmed;
17
+ readonly electronChange: Schema.Trimmed;
18
+ readonly electrons: Schema.Trimmed;
19
+ readonly neutralAtom: Schema.Trimmed;
20
+ readonly neutrons: Schema.Trimmed;
21
+ readonly protons: Schema.Trimmed;
22
+ readonly samples: Schema.$Record<Schema.Literals<readonly ["sodium-cation", "fluoride-anion", "lithium-cation", "oxide-anion"]>, Schema.Struct<{
23
+ readonly action: RichSlot<E>;
24
+ readonly name: Schema.Trimmed;
25
+ readonly type: Schema.Trimmed;
26
+ }>>;
27
+ }>;
28
+ }>, "figure">;
29
+ IsotopeLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
30
+ readonly description: RichSlot<E>;
31
+ readonly title: RichSlot<E>;
32
+ readonly labels: Schema.Struct<{
33
+ readonly abundance: Schema.Trimmed;
34
+ readonly atomicNumber: Schema.Trimmed;
35
+ readonly chooseIsotope: Schema.Trimmed;
36
+ readonly electrons: Schema.Trimmed;
37
+ readonly massNumber: Schema.Trimmed;
38
+ readonly neutrons: Schema.Trimmed;
39
+ readonly protons: Schema.Trimmed;
40
+ readonly samples: Schema.$Record<Schema.Literals<readonly ["hydrogen-1", "deuterium", "tritium", "carbon-12", "carbon-13", "carbon-14"]>, Schema.Struct<{
41
+ readonly abundance: RichSlot<E>;
42
+ readonly ariaName: Schema.Trimmed;
43
+ readonly name: RichSlot<E>;
44
+ readonly note: RichSlot<E>;
45
+ readonly tab: RichSlot<E>;
46
+ }>>;
47
+ }>;
48
+ }>, "figure">;
49
+ MatterParticleReaderLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
50
+ readonly description: RichSlot<E>;
51
+ readonly title: RichSlot<E>;
52
+ readonly labels: Schema.Struct<{
53
+ readonly categoryLabel: Schema.Trimmed;
54
+ readonly chooseMode: Schema.Trimmed;
55
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["atom", "element", "elemental-molecule", "compound-molecule"]>, Schema.Struct<{
56
+ readonly category: RichSlot<E>;
57
+ readonly helperCaption: RichSlot<E>;
58
+ readonly reading: RichSlot<E>;
59
+ readonly tab: RichSlot<E>;
60
+ readonly tabLabel: Schema.Trimmed;
61
+ }>>;
62
+ readonly particleView: Schema.Trimmed;
63
+ readonly readingLabel: Schema.Trimmed;
64
+ }>;
65
+ }>, "figure">;
66
+ SubatomicParticlePropertiesLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
67
+ readonly description: RichSlot<E>;
68
+ readonly title: RichSlot<E>;
69
+ readonly labels: Schema.Struct<{
70
+ readonly chooseMode: Schema.Trimmed;
71
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["charge", "mass", "location"]>, Schema.Struct<{
72
+ readonly facts: Schema.$Array<Schema.Struct<{
73
+ readonly label: Schema.Trimmed;
74
+ readonly value: RichSlot<E>;
75
+ }>>;
76
+ readonly summary: RichSlot<E>;
77
+ readonly tab: Schema.Trimmed;
78
+ }>>;
79
+ readonly scene: Schema.Struct<{
80
+ readonly electron: RichSlot<E>;
81
+ readonly electronRegion: RichSlot<E>;
82
+ readonly negativePlate: RichSlot<E>;
83
+ readonly neutron: RichSlot<E>;
84
+ readonly nucleus: RichSlot<E>;
85
+ readonly positivePlate: RichSlot<E>;
86
+ readonly proton: RichSlot<E>;
87
+ }>;
88
+ }>;
89
+ }>, "figure">;
90
+ SubatomicParticlesLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
91
+ readonly description: RichSlot<E>;
92
+ readonly title: RichSlot<E>;
93
+ readonly labels: Schema.Struct<{
94
+ readonly chooseMode: Schema.Trimmed;
95
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["cathode-ray", "gold-foil", "atom-map"]>, Schema.Struct<{
96
+ readonly description: RichSlot<E>;
97
+ readonly facts: Schema.$Array<Schema.Struct<{
98
+ readonly label: Schema.Trimmed;
99
+ readonly value: RichSlot<E>;
100
+ }>>;
101
+ readonly tab: Schema.Trimmed;
102
+ }>>;
103
+ readonly scene: Schema.Struct<{
104
+ readonly alphaParticle: RichSlot<E>;
105
+ readonly anode: RichSlot<E>;
106
+ readonly cathode: RichSlot<E>;
107
+ readonly cathodeRay: RichSlot<E>;
108
+ readonly negativePlate: RichSlot<E>;
109
+ readonly nucleus: RichSlot<E>;
110
+ readonly positivePlate: RichSlot<E>;
111
+ }>;
112
+ }>;
113
+ }>, "figure">;
114
+ };
@@ -0,0 +1,149 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, factSchema, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** The ions the ion lab forms. */
5
+ const ION_SAMPLES = [
6
+ "sodium-cation",
7
+ "fluoride-anion",
8
+ "lithium-cation",
9
+ "oxide-anion",
10
+ ];
11
+ /** The isotopes the isotope lab compares. */
12
+ const ISOTOPE_SAMPLES = [
13
+ "hydrogen-1",
14
+ "deuterium",
15
+ "tritium",
16
+ "carbon-12",
17
+ "carbon-13",
18
+ "carbon-14",
19
+ ];
20
+ /** The particles the matter reader sorts. */
21
+ const MATTER_MODES = [
22
+ "atom",
23
+ "element",
24
+ "elemental-molecule",
25
+ "compound-molecule",
26
+ ];
27
+ /** The properties the subatomic property lab compares. */
28
+ const PROPERTY_MODES = ["charge", "mass", "location"];
29
+ /** The experiments that found the subatomic particles. */
30
+ const DISCOVERY_MODES = ["cathode-ray", "gold-foil", "atom-map"];
31
+ /** Props of `IonLab`: an atom that gains or loses electrons. */
32
+ function ionLab(rich) {
33
+ return figure(Schema.Struct({
34
+ ...cardFields(rich),
35
+ labels: Schema.Struct({
36
+ afterChange: TextSchema,
37
+ beforeChange: TextSchema,
38
+ charge: TextSchema,
39
+ chooseIon: TextSchema,
40
+ electronChange: TextSchema,
41
+ electrons: TextSchema,
42
+ neutralAtom: TextSchema,
43
+ neutrons: TextSchema,
44
+ protons: TextSchema,
45
+ samples: byIds(ION_SAMPLES, Schema.Struct({ action: rich, name: TextSchema, type: TextSchema })),
46
+ }),
47
+ }));
48
+ }
49
+ /** Props of `IsotopeLab`: atoms of one element with different neutron counts. */
50
+ function isotopeLab(rich) {
51
+ return figure(Schema.Struct({
52
+ ...cardFields(rich),
53
+ labels: Schema.Struct({
54
+ abundance: TextSchema,
55
+ atomicNumber: TextSchema,
56
+ chooseIsotope: TextSchema,
57
+ electrons: TextSchema,
58
+ massNumber: TextSchema,
59
+ neutrons: TextSchema,
60
+ protons: TextSchema,
61
+ samples: byIds(ISOTOPE_SAMPLES, Schema.Struct({
62
+ abundance: rich,
63
+ ariaName: TextSchema,
64
+ name: rich,
65
+ note: rich,
66
+ tab: rich,
67
+ })),
68
+ }),
69
+ }), answerAt(["labels", "samples", "*", "note"]));
70
+ }
71
+ /** Props of `MatterParticleReaderLab`: atoms, elements, and molecules. */
72
+ function matterParticleReaderLab(rich) {
73
+ return figure(Schema.Struct({
74
+ ...cardFields(rich),
75
+ labels: Schema.Struct({
76
+ categoryLabel: TextSchema,
77
+ chooseMode: TextSchema,
78
+ modes: byIds(MATTER_MODES, Schema.Struct({
79
+ category: rich,
80
+ helperCaption: rich,
81
+ reading: rich,
82
+ tab: rich,
83
+ tabLabel: TextSchema,
84
+ })),
85
+ particleView: TextSchema,
86
+ readingLabel: TextSchema,
87
+ }),
88
+ }), answerAt(["labels", "modes", "*", "category"], ["labels", "modes", "*", "reading"]));
89
+ }
90
+ /** Props of `SubatomicParticlePropertiesLab`: charge, mass, and place of each particle. */
91
+ function subatomicParticlePropertiesLab(rich) {
92
+ return figure(Schema.Struct({
93
+ ...cardFields(rich),
94
+ labels: Schema.Struct({
95
+ chooseMode: TextSchema,
96
+ modes: byIds(PROPERTY_MODES, Schema.Struct({
97
+ facts: Schema.Array(factSchema(rich)),
98
+ summary: rich,
99
+ tab: TextSchema,
100
+ })),
101
+ scene: Schema.Struct({
102
+ electron: rich,
103
+ electronRegion: rich,
104
+ negativePlate: rich,
105
+ neutron: rich,
106
+ nucleus: rich,
107
+ positivePlate: rich,
108
+ proton: rich,
109
+ }),
110
+ }),
111
+ }), answerAt(["labels", "modes", "*", "summary"]));
112
+ }
113
+ /** Props of `SubatomicParticlesLab`: the experiments that found each particle. */
114
+ function subatomicParticlesLab(rich) {
115
+ return figure(Schema.Struct({
116
+ ...cardFields(rich),
117
+ labels: Schema.Struct({
118
+ chooseMode: TextSchema,
119
+ modes: byIds(DISCOVERY_MODES, Schema.Struct({
120
+ description: rich,
121
+ facts: Schema.Array(factSchema(rich)),
122
+ tab: TextSchema,
123
+ })),
124
+ scene: Schema.Struct({
125
+ alphaParticle: rich,
126
+ anode: rich,
127
+ cathode: rich,
128
+ cathodeRay: rich,
129
+ negativePlate: rich,
130
+ nucleus: rich,
131
+ positivePlate: rich,
132
+ }),
133
+ }),
134
+ }));
135
+ }
136
+ /**
137
+ * The particle labs. A category and a reading say what a particle is, a note
138
+ * says what an isotope shows, and a summary says what a property means, so
139
+ * each is answer state.
140
+ */
141
+ export function particleVisuals(rich) {
142
+ return {
143
+ IonLab: ionLab(rich),
144
+ IsotopeLab: isotopeLab(rich),
145
+ MatterParticleReaderLab: matterParticleReaderLab(rich),
146
+ SubatomicParticlePropertiesLab: subatomicParticlePropertiesLab(rich),
147
+ SubatomicParticlesLab: subatomicParticlesLab(rich),
148
+ };
149
+ }
@@ -0,0 +1,52 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The periodic table labs. A focus detail explains what a part of the table
5
+ * shares, and a trend and its cause state how a property changes and why, so
6
+ * they are answer state.
7
+ */
8
+ export declare function periodicVisuals<E>(rich: RichSlot<E>): {
9
+ ModernPeriodicTableLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
10
+ readonly description: RichSlot<E>;
11
+ readonly title: RichSlot<E>;
12
+ readonly labels: Schema.Struct<{
13
+ readonly atomicNumber: Schema.Trimmed;
14
+ readonly categoryNames: Schema.$Record<Schema.Literals<readonly ["metal", "transition-metal", "metalloid", "nonmetal", "noble-gas", "inner-transition", "series-marker"]>, Schema.Trimmed>;
15
+ readonly chooseFocus: Schema.Trimmed;
16
+ readonly focuses: Schema.$Record<Schema.Literals<readonly ["group-one", "period-three", "transition", "inner-transition", "metalloid", "noble-gas"]>, Schema.Struct<{
17
+ readonly detail: RichSlot<E>;
18
+ readonly name: Schema.Trimmed;
19
+ readonly tab: Schema.Trimmed;
20
+ }>>;
21
+ readonly focusLabel: Schema.Trimmed;
22
+ readonly group: Schema.Trimmed;
23
+ readonly period: Schema.Trimmed;
24
+ readonly periodPrefix: Schema.Trimmed;
25
+ readonly seriesNames: Schema.$Record<Schema.Literals<readonly ["lanthanide", "actinide"]>, Schema.Trimmed>;
26
+ readonly tableLabel: Schema.Trimmed;
27
+ }>;
28
+ }>, "figure">;
29
+ PeriodicPropertiesLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
30
+ readonly description: RichSlot<E>;
31
+ readonly title: RichSlot<E>;
32
+ readonly labels: Schema.Struct<{
33
+ readonly chooseTrend: Schema.Trimmed;
34
+ readonly factLabels: Schema.Struct<{
35
+ readonly cause: Schema.Trimmed;
36
+ readonly group: Schema.Trimmed;
37
+ readonly period: Schema.Trimmed;
38
+ readonly question: Schema.Trimmed;
39
+ }>;
40
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["atomic-radius", "ionization-energy", "electron-affinity", "electronegativity"]>, Schema.Struct<{
41
+ readonly cause: RichSlot<E>;
42
+ readonly groupTrend: RichSlot<E>;
43
+ readonly guidance: RichSlot<E>;
44
+ readonly name: Schema.Trimmed;
45
+ readonly periodTrend: RichSlot<E>;
46
+ readonly question: RichSlot<E>;
47
+ readonly tab: Schema.Trimmed;
48
+ }>>;
49
+ readonly sceneLabel: Schema.Trimmed;
50
+ }>;
51
+ }>, "figure">;
52
+ };
@@ -0,0 +1,85 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** The parts of the periodic table the table lab can focus on. */
5
+ const TABLE_FOCUSES = [
6
+ "group-one",
7
+ "period-three",
8
+ "transition",
9
+ "inner-transition",
10
+ "metalloid",
11
+ "noble-gas",
12
+ ];
13
+ /** The categories the table colors its elements by, and the marker of the lower series. */
14
+ const ELEMENT_CATEGORIES = [
15
+ "metal",
16
+ "transition-metal",
17
+ "metalloid",
18
+ "nonmetal",
19
+ "noble-gas",
20
+ "inner-transition",
21
+ "series-marker",
22
+ ];
23
+ /** The two rows drawn below the table. */
24
+ const SERIES_ROWS = ["lanthanide", "actinide"];
25
+ /** The trends the periodic properties lab compares. */
26
+ const PROPERTY_TRENDS = [
27
+ "atomic-radius",
28
+ "ionization-energy",
29
+ "electron-affinity",
30
+ "electronegativity",
31
+ ];
32
+ /** Props of `ModernPeriodicTableLab`: groups, periods, and blocks of the table. */
33
+ function modernPeriodicTableLab(rich) {
34
+ return figure(Schema.Struct({
35
+ ...cardFields(rich),
36
+ labels: Schema.Struct({
37
+ atomicNumber: TextSchema,
38
+ categoryNames: byIds(ELEMENT_CATEGORIES, TextSchema),
39
+ chooseFocus: TextSchema,
40
+ focuses: byIds(TABLE_FOCUSES, Schema.Struct({ detail: rich, name: TextSchema, tab: TextSchema })),
41
+ focusLabel: TextSchema,
42
+ group: TextSchema,
43
+ period: TextSchema,
44
+ periodPrefix: TextSchema,
45
+ seriesNames: byIds(SERIES_ROWS, TextSchema),
46
+ tableLabel: TextSchema,
47
+ }),
48
+ }), answerAt(["labels", "focuses", "*", "detail"]));
49
+ }
50
+ /** Props of `PeriodicPropertiesLab`: how a property changes along a period and a group. */
51
+ function periodicPropertiesLab(rich) {
52
+ return figure(Schema.Struct({
53
+ ...cardFields(rich),
54
+ labels: Schema.Struct({
55
+ chooseTrend: TextSchema,
56
+ factLabels: Schema.Struct({
57
+ cause: TextSchema,
58
+ group: TextSchema,
59
+ period: TextSchema,
60
+ question: TextSchema,
61
+ }),
62
+ modes: byIds(PROPERTY_TRENDS, Schema.Struct({
63
+ cause: rich,
64
+ groupTrend: rich,
65
+ guidance: rich,
66
+ name: TextSchema,
67
+ periodTrend: rich,
68
+ question: rich,
69
+ tab: TextSchema,
70
+ })),
71
+ sceneLabel: TextSchema,
72
+ }),
73
+ }), answerAt(["labels", "modes", "*", "cause"], ["labels", "modes", "*", "groupTrend"], ["labels", "modes", "*", "periodTrend"]));
74
+ }
75
+ /**
76
+ * The periodic table labs. A focus detail explains what a part of the table
77
+ * shares, and a trend and its cause state how a property changes and why, so
78
+ * they are answer state.
79
+ */
80
+ export function periodicVisuals(rich) {
81
+ return {
82
+ ModernPeriodicTableLab: modernPeriodicTableLab(rich),
83
+ PeriodicPropertiesLab: periodicPropertiesLab(rich),
84
+ };
85
+ }
@@ -0,0 +1,60 @@
1
+ import { Schema } from "effect";
2
+ import { type RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * The reaction labs. A meaning says what a cue tells, an equation and its
5
+ * check balance a reaction, so they are answer state.
6
+ */
7
+ export declare function reactionVisuals<E>(rich: RichSlot<E>): {
8
+ ChemicalReactionCharacteristicsLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly title: RichSlot<E>;
11
+ readonly labels: Schema.Struct<{
12
+ readonly after: Schema.Trimmed;
13
+ readonly before: Schema.Trimmed;
14
+ readonly chooseCue: Schema.Trimmed;
15
+ readonly cues: Schema.$Record<Schema.Literals<readonly ["gas", "precipitate", "color", "energy"]>, Schema.Struct<{
16
+ readonly helperCaption: RichSlot<E>;
17
+ readonly limit: RichSlot<E>;
18
+ readonly meaning: RichSlot<E>;
19
+ readonly observation: RichSlot<E>;
20
+ readonly tab: Schema.Trimmed;
21
+ }>>;
22
+ readonly limitLabel: Schema.Trimmed;
23
+ readonly meaningLabel: Schema.Trimmed;
24
+ readonly observationLabel: Schema.Trimmed;
25
+ readonly transition: Schema.Trimmed;
26
+ }>;
27
+ }>, "figure">;
28
+ ChemicalReactionTypesLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
29
+ readonly description: RichSlot<E>;
30
+ readonly title: RichSlot<E>;
31
+ readonly labels: Schema.Struct<{
32
+ readonly after: Schema.Trimmed;
33
+ readonly before: Schema.Trimmed;
34
+ readonly checkLabel: Schema.Trimmed;
35
+ readonly chooseType: Schema.Trimmed;
36
+ readonly equationLabel: Schema.Trimmed;
37
+ readonly reactionView: Schema.Trimmed;
38
+ readonly readingLabel: Schema.Trimmed;
39
+ readonly types: Schema.$Record<Schema.Literals<readonly ["combustion", "rust", "precipitate", "gas"]>, Schema.Struct<{
40
+ readonly check: RichSlot<E>;
41
+ readonly equation: RichSlot<E>;
42
+ readonly helperCaption: RichSlot<E>;
43
+ readonly reading: RichSlot<E>;
44
+ readonly tab: Schema.Trimmed;
45
+ readonly visibleCue: RichSlot<E>;
46
+ }>>;
47
+ readonly visibleCueLabel: Schema.Trimmed;
48
+ }>;
49
+ }>, "figure">;
50
+ MethaneCombustionEquationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
51
+ readonly description: RichSlot<E>;
52
+ readonly title: RichSlot<E>;
53
+ readonly labels: Schema.Struct<{
54
+ readonly equation: RichSlot<E>;
55
+ readonly moleculeView: Schema.Trimmed;
56
+ readonly products: Schema.Trimmed;
57
+ readonly reactants: Schema.Trimmed;
58
+ }>;
59
+ }>, "figure">;
60
+ };
@@ -0,0 +1,76 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** The cues that show a reaction happened. */
5
+ const REACTION_CUES = ["gas", "precipitate", "color", "energy"];
6
+ /** The reaction types the types lab shows. */
7
+ const REACTION_TYPES = ["combustion", "rust", "precipitate", "gas"];
8
+ /** Props of `ChemicalReactionCharacteristicsLab`: what a reaction looks like. */
9
+ function reactionCharacteristicsLab(rich) {
10
+ return figure(Schema.Struct({
11
+ ...cardFields(rich),
12
+ labels: Schema.Struct({
13
+ after: TextSchema,
14
+ before: TextSchema,
15
+ chooseCue: TextSchema,
16
+ cues: byIds(REACTION_CUES, Schema.Struct({
17
+ helperCaption: rich,
18
+ limit: rich,
19
+ meaning: rich,
20
+ observation: rich,
21
+ tab: TextSchema,
22
+ })),
23
+ limitLabel: TextSchema,
24
+ meaningLabel: TextSchema,
25
+ observationLabel: TextSchema,
26
+ transition: TextSchema,
27
+ }),
28
+ }), answerAt(["labels", "cues", "*", "meaning"]));
29
+ }
30
+ /** Props of `ChemicalReactionTypesLab`: four everyday reactions and their equations. */
31
+ function reactionTypesLab(rich) {
32
+ return figure(Schema.Struct({
33
+ ...cardFields(rich),
34
+ labels: Schema.Struct({
35
+ after: TextSchema,
36
+ before: TextSchema,
37
+ checkLabel: TextSchema,
38
+ chooseType: TextSchema,
39
+ equationLabel: TextSchema,
40
+ reactionView: TextSchema,
41
+ readingLabel: TextSchema,
42
+ types: byIds(REACTION_TYPES, Schema.Struct({
43
+ check: rich,
44
+ equation: rich,
45
+ helperCaption: rich,
46
+ reading: rich,
47
+ tab: TextSchema,
48
+ visibleCue: rich,
49
+ })),
50
+ visibleCueLabel: TextSchema,
51
+ }),
52
+ }), answerAt(["labels", "types", "*", "check"], ["labels", "types", "*", "equation"]));
53
+ }
54
+ /** Props of `MethaneCombustionEquationLab`: methane burning, molecule by molecule. */
55
+ function methaneCombustionLab(rich) {
56
+ return figure(Schema.Struct({
57
+ ...cardFields(rich),
58
+ labels: Schema.Struct({
59
+ equation: rich,
60
+ moleculeView: TextSchema,
61
+ products: TextSchema,
62
+ reactants: TextSchema,
63
+ }),
64
+ }), answerAt(["labels", "equation"]));
65
+ }
66
+ /**
67
+ * The reaction labs. A meaning says what a cue tells, an equation and its
68
+ * check balance a reaction, so they are answer state.
69
+ */
70
+ export function reactionVisuals(rich) {
71
+ return {
72
+ ChemicalReactionCharacteristicsLab: reactionCharacteristicsLab(rich),
73
+ ChemicalReactionTypesLab: reactionTypesLab(rich),
74
+ MethaneCombustionEquationLab: methaneCombustionLab(rich),
75
+ };
76
+ }