@nakafa/aksara-contracts 8.13.0 → 8.15.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 (37) hide show
  1. package/dist/assessment/document.d.ts +15 -2
  2. package/dist/assessment/document.js +12 -3
  3. package/dist/visual/biology/flower.d.ts +276 -0
  4. package/dist/visual/biology/flower.js +76 -0
  5. package/dist/visual/biology/homeostasis.d.ts +284 -0
  6. package/dist/visual/biology/homeostasis.js +101 -0
  7. package/dist/visual/biology/membrane.d.ts +421 -0
  8. package/dist/visual/biology/membrane.js +129 -0
  9. package/dist/visual/biology/mendelian.d.ts +410 -0
  10. package/dist/visual/biology/mendelian.js +107 -0
  11. package/dist/visual/biology/neuron.d.ts +136 -1
  12. package/dist/visual/biology/neuron.js +41 -2
  13. package/dist/visual/biology/nutrition.d.ts +410 -0
  14. package/dist/visual/biology/nutrition.js +112 -0
  15. package/dist/visual/biology/phytohormone.d.ts +275 -0
  16. package/dist/visual/biology/phytohormone.js +75 -0
  17. package/dist/visual/biology/variation.d.ts +421 -0
  18. package/dist/visual/biology/variation.js +123 -0
  19. package/dist/visual/biology/vascular.d.ts +425 -0
  20. package/dist/visual/biology/vascular.js +107 -0
  21. package/dist/visual/biology.d.ts +2169 -0
  22. package/dist/visual/biology.js +12 -0
  23. package/dist/visual/catalog.d.ts +7460 -3208
  24. package/dist/visual/catalog.js +6 -0
  25. package/dist/visual/chemistry/rate.d.ts +280 -1
  26. package/dist/visual/chemistry/rate.js +81 -3
  27. package/dist/visual/physics/electronics.d.ts +163 -24
  28. package/dist/visual/physics/electronics.js +50 -5
  29. package/dist/visual/physics/gravity.d.ts +139 -4
  30. package/dist/visual/physics/gravity.js +46 -4
  31. package/dist/visual/physics/heat.d.ts +307 -12
  32. package/dist/visual/physics/heat.js +84 -5
  33. package/dist/visual/physics/nuclear.d.ts +150 -13
  34. package/dist/visual/physics/nuclear.js +44 -5
  35. package/dist/visual/physics/quantum.d.ts +282 -0
  36. package/dist/visual/physics/quantum.js +87 -0
  37. package/package.json +1 -1
@@ -0,0 +1,284 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * Homeostasis labs covering mammalian skin thermoregulation and pancreatic
5
+ * blood-glucose negative feedback.
6
+ */
7
+ export declare function homeostasisVisuals<E>(rich: RichSlot<E>): {
8
+ BloodGlucoseFeedbackLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly marks?: readonly [{
12
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
13
+ } | {
14
+ readonly attrs: {
15
+ readonly href: string;
16
+ };
17
+ readonly type: "link";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly variant: "success" | "warning" | null;
21
+ };
22
+ readonly type: "highlight";
23
+ }, ...({
24
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
25
+ } | {
26
+ readonly attrs: {
27
+ readonly href: string;
28
+ };
29
+ readonly type: "link";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly variant: "success" | "warning" | null;
33
+ };
34
+ readonly type: "highlight";
35
+ })[]];
36
+ readonly text: string;
37
+ readonly type: "text";
38
+ } | {
39
+ readonly attrs: {
40
+ readonly latex: string;
41
+ };
42
+ readonly marks?: readonly [{
43
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
44
+ } | {
45
+ readonly attrs: {
46
+ readonly href: string;
47
+ };
48
+ readonly type: "link";
49
+ } | {
50
+ readonly attrs: {
51
+ readonly variant: "success" | "warning" | null;
52
+ };
53
+ readonly type: "highlight";
54
+ }, ...({
55
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly href: string;
59
+ };
60
+ readonly type: "link";
61
+ } | {
62
+ readonly attrs: {
63
+ readonly variant: "success" | "warning" | null;
64
+ };
65
+ readonly type: "highlight";
66
+ })[]];
67
+ readonly type: "mathInline";
68
+ }, ...({
69
+ readonly marks?: readonly [{
70
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
71
+ } | {
72
+ readonly attrs: {
73
+ readonly href: string;
74
+ };
75
+ readonly type: "link";
76
+ } | {
77
+ readonly attrs: {
78
+ readonly variant: "success" | "warning" | null;
79
+ };
80
+ readonly type: "highlight";
81
+ }, ...({
82
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
83
+ } | {
84
+ readonly attrs: {
85
+ readonly href: string;
86
+ };
87
+ readonly type: "link";
88
+ } | {
89
+ readonly attrs: {
90
+ readonly variant: "success" | "warning" | null;
91
+ };
92
+ readonly type: "highlight";
93
+ })[]];
94
+ readonly text: string;
95
+ readonly type: "text";
96
+ } | {
97
+ readonly attrs: {
98
+ readonly latex: string;
99
+ };
100
+ readonly marks?: readonly [{
101
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
102
+ } | {
103
+ readonly attrs: {
104
+ readonly href: string;
105
+ };
106
+ readonly type: "link";
107
+ } | {
108
+ readonly attrs: {
109
+ readonly variant: "success" | "warning" | null;
110
+ };
111
+ readonly type: "highlight";
112
+ }, ...({
113
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
114
+ } | {
115
+ readonly attrs: {
116
+ readonly href: string;
117
+ };
118
+ readonly type: "link";
119
+ } | {
120
+ readonly attrs: {
121
+ readonly variant: "success" | "warning" | null;
122
+ };
123
+ readonly type: "highlight";
124
+ })[]];
125
+ readonly type: "mathInline";
126
+ })[]], E, never, never>>;
127
+ readonly title: RichSlot<E>;
128
+ readonly glucose: Schema.Struct<{
129
+ readonly max: Schema.Finite;
130
+ readonly min: Schema.Finite;
131
+ readonly value: Schema.Finite;
132
+ }>;
133
+ readonly labels: Schema.Struct<{
134
+ readonly actions: Schema.$Record<Schema.Literals<readonly ["afterMeal", "normal", "fasting", "diabetes"]>, Schema.optionalKey<RichSlot<E>>>;
135
+ readonly glucose: Schema.Trimmed;
136
+ readonly hormone: Schema.optionalKey<RichSlot<E>>;
137
+ readonly hormones: Schema.$Record<Schema.Literals<readonly ["insulin", "glucagon", "balanced", "deficient"]>, Schema.Trimmed>;
138
+ readonly liverAction: Schema.optionalKey<RichSlot<E>>;
139
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["pancreas", "alphaCell", "betaCell", "liver", "glycogen", "bloodVessel"]>, Schema.Trimmed>;
140
+ readonly state: Schema.Trimmed;
141
+ readonly states: Schema.$Record<Schema.Literals<readonly ["afterMeal", "normal", "fasting", "diabetes"]>, Schema.optionalKey<Schema.Trimmed>>;
142
+ readonly view: Schema.Trimmed;
143
+ }>;
144
+ readonly states: Schema.NonEmptyArray<Schema.Literals<readonly ["afterMeal", "normal", "fasting", "diabetes"]>>;
145
+ }>, "figure">;
146
+ ThermoregulationSkinLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
147
+ readonly description: RichSlot<E>;
148
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
149
+ readonly marks?: readonly [{
150
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
151
+ } | {
152
+ readonly attrs: {
153
+ readonly href: string;
154
+ };
155
+ readonly type: "link";
156
+ } | {
157
+ readonly attrs: {
158
+ readonly variant: "success" | "warning" | null;
159
+ };
160
+ readonly type: "highlight";
161
+ }, ...({
162
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
163
+ } | {
164
+ readonly attrs: {
165
+ readonly href: string;
166
+ };
167
+ readonly type: "link";
168
+ } | {
169
+ readonly attrs: {
170
+ readonly variant: "success" | "warning" | null;
171
+ };
172
+ readonly type: "highlight";
173
+ })[]];
174
+ readonly text: string;
175
+ readonly type: "text";
176
+ } | {
177
+ readonly attrs: {
178
+ readonly latex: string;
179
+ };
180
+ readonly marks?: readonly [{
181
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
182
+ } | {
183
+ readonly attrs: {
184
+ readonly href: string;
185
+ };
186
+ readonly type: "link";
187
+ } | {
188
+ readonly attrs: {
189
+ readonly variant: "success" | "warning" | null;
190
+ };
191
+ readonly type: "highlight";
192
+ }, ...({
193
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
194
+ } | {
195
+ readonly attrs: {
196
+ readonly href: string;
197
+ };
198
+ readonly type: "link";
199
+ } | {
200
+ readonly attrs: {
201
+ readonly variant: "success" | "warning" | null;
202
+ };
203
+ readonly type: "highlight";
204
+ })[]];
205
+ readonly type: "mathInline";
206
+ }, ...({
207
+ readonly marks?: readonly [{
208
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
209
+ } | {
210
+ readonly attrs: {
211
+ readonly href: string;
212
+ };
213
+ readonly type: "link";
214
+ } | {
215
+ readonly attrs: {
216
+ readonly variant: "success" | "warning" | null;
217
+ };
218
+ readonly type: "highlight";
219
+ }, ...({
220
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
221
+ } | {
222
+ readonly attrs: {
223
+ readonly href: string;
224
+ };
225
+ readonly type: "link";
226
+ } | {
227
+ readonly attrs: {
228
+ readonly variant: "success" | "warning" | null;
229
+ };
230
+ readonly type: "highlight";
231
+ })[]];
232
+ readonly text: string;
233
+ readonly type: "text";
234
+ } | {
235
+ readonly attrs: {
236
+ readonly latex: string;
237
+ };
238
+ readonly marks?: readonly [{
239
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
240
+ } | {
241
+ readonly attrs: {
242
+ readonly href: string;
243
+ };
244
+ readonly type: "link";
245
+ } | {
246
+ readonly attrs: {
247
+ readonly variant: "success" | "warning" | null;
248
+ };
249
+ readonly type: "highlight";
250
+ }, ...({
251
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
252
+ } | {
253
+ readonly attrs: {
254
+ readonly href: string;
255
+ };
256
+ readonly type: "link";
257
+ } | {
258
+ readonly attrs: {
259
+ readonly variant: "success" | "warning" | null;
260
+ };
261
+ readonly type: "highlight";
262
+ })[]];
263
+ readonly type: "mathInline";
264
+ })[]], E, never, never>>;
265
+ readonly title: RichSlot<E>;
266
+ readonly ambient: Schema.Struct<{
267
+ readonly max: Schema.Finite;
268
+ readonly min: Schema.Finite;
269
+ readonly value: Schema.Finite;
270
+ }>;
271
+ readonly conditions: Schema.NonEmptyArray<Schema.Literals<readonly ["cold", "normal", "hot"]>>;
272
+ readonly labels: Schema.Struct<{
273
+ readonly ambient: Schema.Trimmed;
274
+ readonly bloodFlow: Schema.optionalKey<RichSlot<E>>;
275
+ readonly condition: Schema.Trimmed;
276
+ readonly conditions: Schema.$Record<Schema.Literals<readonly ["cold", "normal", "hot"]>, Schema.optionalKey<Schema.Trimmed>>;
277
+ readonly heatLoss: Schema.optionalKey<RichSlot<E>>;
278
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["epidermis", "sweatGland", "arteriole", "capillary", "erectorMuscle", "hairShaft", "fatLayer"]>, Schema.Trimmed>;
279
+ readonly response: RichSlot<E>;
280
+ readonly responses: Schema.$Record<Schema.Literals<readonly ["cold", "normal", "hot"]>, Schema.optionalKey<RichSlot<E>>>;
281
+ readonly view: Schema.Trimmed;
282
+ }>;
283
+ }>, "figure">;
284
+ };
@@ -0,0 +1,101 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** A strictly positive finite measure for physiological sliders. */
5
+ const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
6
+ /** A finite slider whose minimum sits below its maximum. */
7
+ const RangeSliderSchema = Schema.Struct({
8
+ max: Schema.Finite,
9
+ min: Schema.Finite,
10
+ value: Schema.Finite,
11
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
12
+ message: "Expected a slider range whose minimum is below its maximum, with the starting value between them.",
13
+ }));
14
+ /** A strictly positive slider whose minimum sits below its maximum. */
15
+ const PositiveSliderSchema = Schema.Struct({
16
+ max: PositiveSchema,
17
+ min: PositiveSchema,
18
+ value: PositiveSchema,
19
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
20
+ message: "Expected a positive slider range whose minimum is below its maximum, with the starting value between them.",
21
+ }));
22
+ const THERMAL_CONDITIONS = ["cold", "normal", "hot"];
23
+ const GLUCOSE_STATES = ["afterMeal", "normal", "fasting", "diabetes"];
24
+ /**
25
+ * Props of `ThermoregulationSkinLab`: a 3D mammalian skin cross-section
26
+ * contrasting cold, normal, and hot conditions across arteriolar diameter,
27
+ * sweat gland activity, erector pili muscles, and hair shaft tilt. Blood flow
28
+ * and heat-loss readouts are optional answer state.
29
+ */
30
+ function thermoregulationSkinLab(rich) {
31
+ return figure(Schema.Struct({
32
+ ...cardFields(rich),
33
+ ambient: RangeSliderSchema,
34
+ conditions: Schema.NonEmptyArray(Schema.Literals(THERMAL_CONDITIONS)).check(Schema.isUnique()),
35
+ labels: Schema.Struct({
36
+ ambient: TextSchema,
37
+ bloodFlow: Schema.optionalKey(rich),
38
+ condition: TextSchema,
39
+ conditions: byPickedIds(THERMAL_CONDITIONS, TextSchema),
40
+ heatLoss: Schema.optionalKey(rich),
41
+ parts: byIds([
42
+ "epidermis",
43
+ "sweatGland",
44
+ "arteriole",
45
+ "capillary",
46
+ "erectorMuscle",
47
+ "hairShaft",
48
+ "fatLayer",
49
+ ], TextSchema),
50
+ response: rich,
51
+ responses: byPickedIds(THERMAL_CONDITIONS, rich),
52
+ view: TextSchema,
53
+ }),
54
+ }).check(Schema.makeFilter(({ conditions, labels }) => namesEach(conditions, labels.conditions) &&
55
+ namesEach(conditions, labels.responses), {
56
+ message: "Expected a name and response note for every thermal condition shown, and no other.",
57
+ })), answerAt(["labels", "bloodFlow"], ["labels", "heatLoss"]));
58
+ }
59
+ /**
60
+ * Props of `BloodGlucoseFeedbackLab`: a 3D negative-feedback circuit linking
61
+ * pancreatic islets, insulin and glucagon secretion, liver glycogen storage,
62
+ * and blood glucose concentration across meal, fasting, and diabetes states.
63
+ * Active hormone and liver-action readouts are optional answer state.
64
+ */
65
+ function bloodGlucoseFeedbackLab(rich) {
66
+ return figure(Schema.Struct({
67
+ ...cardFields(rich),
68
+ glucose: PositiveSliderSchema,
69
+ labels: Schema.Struct({
70
+ actions: byPickedIds(GLUCOSE_STATES, rich),
71
+ glucose: TextSchema,
72
+ hormone: Schema.optionalKey(rich),
73
+ hormones: byIds(["insulin", "glucagon", "balanced", "deficient"], TextSchema),
74
+ liverAction: Schema.optionalKey(rich),
75
+ parts: byIds([
76
+ "pancreas",
77
+ "alphaCell",
78
+ "betaCell",
79
+ "liver",
80
+ "glycogen",
81
+ "bloodVessel",
82
+ ], TextSchema),
83
+ state: TextSchema,
84
+ states: byPickedIds(GLUCOSE_STATES, TextSchema),
85
+ view: TextSchema,
86
+ }),
87
+ states: Schema.NonEmptyArray(Schema.Literals(GLUCOSE_STATES)).check(Schema.isUnique()),
88
+ }).check(Schema.makeFilter(({ labels, states }) => namesEach(states, labels.states) && namesEach(states, labels.actions), {
89
+ message: "Expected a name and liver action note for every glucose state shown, and no other.",
90
+ })), answerAt(["labels", "hormone"], ["labels", "liverAction"]));
91
+ }
92
+ /**
93
+ * Homeostasis labs covering mammalian skin thermoregulation and pancreatic
94
+ * blood-glucose negative feedback.
95
+ */
96
+ export function homeostasisVisuals(rich) {
97
+ return {
98
+ BloodGlucoseFeedbackLab: bloodGlucoseFeedbackLab(rich),
99
+ ThermoregulationSkinLab: thermoregulationSkinLab(rich),
100
+ };
101
+ }