@nakafa/aksara-contracts 8.15.0 → 8.17.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.
- package/dist/visual/base.d.ts +785 -0
- package/dist/visual/base.js +13 -0
- package/dist/visual/biology/ecosystem.d.ts +425 -0
- package/dist/visual/biology/ecosystem.js +140 -0
- package/dist/visual/biology/respiration.d.ts +286 -0
- package/dist/visual/biology/respiration.js +97 -0
- package/dist/visual/biology.d.ts +11158 -205
- package/dist/visual/biology.js +104 -0
- package/dist/visual/catalog.d.ts +16 -41206
- package/dist/visual/catalog.js +8 -216
- package/dist/visual/chemistry/green.d.ts +282 -0
- package/dist/visual/chemistry/green.js +98 -0
- package/dist/visual/chemistry/groups.d.ts +276 -0
- package/dist/visual/chemistry/groups.js +85 -0
- package/dist/visual/chemistry/industry.d.ts +420 -0
- package/dist/visual/chemistry/industry.js +126 -0
- package/dist/visual/chemistry/materials.d.ts +416 -0
- package/dist/visual/chemistry/materials.js +116 -0
- package/dist/visual/chemistry/organic.d.ts +416 -0
- package/dist/visual/chemistry/organic.js +128 -0
- package/dist/visual/chemistry/polymer.d.ts +422 -0
- package/dist/visual/chemistry/polymer.js +126 -0
- package/dist/visual/chemistry/solution.d.ts +278 -0
- package/dist/visual/chemistry/solution.js +89 -0
- package/dist/visual/chemistry/stoichiometry.d.ts +287 -0
- package/dist/visual/chemistry/stoichiometry.js +83 -0
- package/dist/visual/chemistry.d.ts +8827 -0
- package/dist/visual/chemistry.js +50 -0
- package/dist/visual/mathematics/derivative.d.ts +425 -0
- package/dist/visual/mathematics/derivative.js +132 -0
- package/dist/visual/mathematics/integral.d.ts +428 -0
- package/dist/visual/mathematics/integral.js +146 -0
- package/dist/visual/mathematics/limit.d.ts +425 -0
- package/dist/visual/mathematics/limit.js +139 -0
- package/dist/visual/mathematics/linear.d.ts +425 -0
- package/dist/visual/mathematics/linear.js +140 -0
- package/dist/visual/mathematics/vector.d.ts +419 -0
- package/dist/visual/mathematics/vector.js +129 -0
- package/dist/visual/mathematics.d.ts +5148 -0
- package/dist/visual/mathematics.js +41 -0
- package/dist/visual/physics.d.ts +17875 -0
- package/dist/visual/physics.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* Consumer and industrial chemistry labs covering soap micelle emulsification,
|
|
5
|
+
* the Haber-Bosch ammonia converter, and kettle saponification.
|
|
6
|
+
*/
|
|
7
|
+
export declare function industryVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
HaberAmmoniaConverterLab: 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 labels: Schema.Struct<{
|
|
129
|
+
readonly equilibriumYield: Schema.optionalKey<RichSlot<E>>;
|
|
130
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["compressor", "ironCatalystBed", "coolingCondenser", "liquidAmmonia", "recyclePipe"]>, Schema.Trimmed>;
|
|
131
|
+
readonly pressure: Schema.Trimmed;
|
|
132
|
+
readonly rateNote: Schema.optionalKey<RichSlot<E>>;
|
|
133
|
+
readonly temperature: Schema.Trimmed;
|
|
134
|
+
readonly view: Schema.Trimmed;
|
|
135
|
+
}>;
|
|
136
|
+
readonly pressure: Schema.Struct<{
|
|
137
|
+
readonly max: Schema.Finite;
|
|
138
|
+
readonly min: Schema.Finite;
|
|
139
|
+
readonly value: Schema.Finite;
|
|
140
|
+
}>;
|
|
141
|
+
readonly temperature: Schema.Struct<{
|
|
142
|
+
readonly max: Schema.Finite;
|
|
143
|
+
readonly min: Schema.Finite;
|
|
144
|
+
readonly value: Schema.Finite;
|
|
145
|
+
}>;
|
|
146
|
+
}>, "figure">;
|
|
147
|
+
SaponificationKettleLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
148
|
+
readonly description: RichSlot<E>;
|
|
149
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
150
|
+
readonly marks?: readonly [{
|
|
151
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
152
|
+
} | {
|
|
153
|
+
readonly attrs: {
|
|
154
|
+
readonly href: string;
|
|
155
|
+
};
|
|
156
|
+
readonly type: "link";
|
|
157
|
+
} | {
|
|
158
|
+
readonly attrs: {
|
|
159
|
+
readonly variant: "success" | "warning" | null;
|
|
160
|
+
};
|
|
161
|
+
readonly type: "highlight";
|
|
162
|
+
}, ...({
|
|
163
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
164
|
+
} | {
|
|
165
|
+
readonly attrs: {
|
|
166
|
+
readonly href: string;
|
|
167
|
+
};
|
|
168
|
+
readonly type: "link";
|
|
169
|
+
} | {
|
|
170
|
+
readonly attrs: {
|
|
171
|
+
readonly variant: "success" | "warning" | null;
|
|
172
|
+
};
|
|
173
|
+
readonly type: "highlight";
|
|
174
|
+
})[]];
|
|
175
|
+
readonly text: string;
|
|
176
|
+
readonly type: "text";
|
|
177
|
+
} | {
|
|
178
|
+
readonly attrs: {
|
|
179
|
+
readonly latex: string;
|
|
180
|
+
};
|
|
181
|
+
readonly marks?: readonly [{
|
|
182
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
183
|
+
} | {
|
|
184
|
+
readonly attrs: {
|
|
185
|
+
readonly href: string;
|
|
186
|
+
};
|
|
187
|
+
readonly type: "link";
|
|
188
|
+
} | {
|
|
189
|
+
readonly attrs: {
|
|
190
|
+
readonly variant: "success" | "warning" | null;
|
|
191
|
+
};
|
|
192
|
+
readonly type: "highlight";
|
|
193
|
+
}, ...({
|
|
194
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
195
|
+
} | {
|
|
196
|
+
readonly attrs: {
|
|
197
|
+
readonly href: string;
|
|
198
|
+
};
|
|
199
|
+
readonly type: "link";
|
|
200
|
+
} | {
|
|
201
|
+
readonly attrs: {
|
|
202
|
+
readonly variant: "success" | "warning" | null;
|
|
203
|
+
};
|
|
204
|
+
readonly type: "highlight";
|
|
205
|
+
})[]];
|
|
206
|
+
readonly type: "mathInline";
|
|
207
|
+
}, ...({
|
|
208
|
+
readonly marks?: readonly [{
|
|
209
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
210
|
+
} | {
|
|
211
|
+
readonly attrs: {
|
|
212
|
+
readonly href: string;
|
|
213
|
+
};
|
|
214
|
+
readonly type: "link";
|
|
215
|
+
} | {
|
|
216
|
+
readonly attrs: {
|
|
217
|
+
readonly variant: "success" | "warning" | null;
|
|
218
|
+
};
|
|
219
|
+
readonly type: "highlight";
|
|
220
|
+
}, ...({
|
|
221
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
222
|
+
} | {
|
|
223
|
+
readonly attrs: {
|
|
224
|
+
readonly href: string;
|
|
225
|
+
};
|
|
226
|
+
readonly type: "link";
|
|
227
|
+
} | {
|
|
228
|
+
readonly attrs: {
|
|
229
|
+
readonly variant: "success" | "warning" | null;
|
|
230
|
+
};
|
|
231
|
+
readonly type: "highlight";
|
|
232
|
+
})[]];
|
|
233
|
+
readonly text: string;
|
|
234
|
+
readonly type: "text";
|
|
235
|
+
} | {
|
|
236
|
+
readonly attrs: {
|
|
237
|
+
readonly latex: string;
|
|
238
|
+
};
|
|
239
|
+
readonly marks?: readonly [{
|
|
240
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
241
|
+
} | {
|
|
242
|
+
readonly attrs: {
|
|
243
|
+
readonly href: string;
|
|
244
|
+
};
|
|
245
|
+
readonly type: "link";
|
|
246
|
+
} | {
|
|
247
|
+
readonly attrs: {
|
|
248
|
+
readonly variant: "success" | "warning" | null;
|
|
249
|
+
};
|
|
250
|
+
readonly type: "highlight";
|
|
251
|
+
}, ...({
|
|
252
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
253
|
+
} | {
|
|
254
|
+
readonly attrs: {
|
|
255
|
+
readonly href: string;
|
|
256
|
+
};
|
|
257
|
+
readonly type: "link";
|
|
258
|
+
} | {
|
|
259
|
+
readonly attrs: {
|
|
260
|
+
readonly variant: "success" | "warning" | null;
|
|
261
|
+
};
|
|
262
|
+
readonly type: "highlight";
|
|
263
|
+
})[]];
|
|
264
|
+
readonly type: "mathInline";
|
|
265
|
+
})[]], E, never, never>>;
|
|
266
|
+
readonly title: RichSlot<E>;
|
|
267
|
+
readonly labels: Schema.Struct<{
|
|
268
|
+
readonly chemicalChange: Schema.optionalKey<RichSlot<E>>;
|
|
269
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["kettle", "triglyceride", "alkaliStream", "saltLayer", "soapCurd"]>, Schema.Trimmed>;
|
|
270
|
+
readonly purpose: Schema.optionalKey<RichSlot<E>>;
|
|
271
|
+
readonly step: Schema.Trimmed;
|
|
272
|
+
readonly steps: Schema.$Record<Schema.Literals<readonly ["hydrolysis", "saltingOut", "filtration", "molding"]>, Schema.optionalKey<Schema.Struct<{
|
|
273
|
+
readonly chemicalChange: RichSlot<E>;
|
|
274
|
+
readonly name: Schema.Trimmed;
|
|
275
|
+
readonly purpose: RichSlot<E>;
|
|
276
|
+
}>>>;
|
|
277
|
+
readonly view: Schema.Trimmed;
|
|
278
|
+
}>;
|
|
279
|
+
readonly steps: Schema.NonEmptyArray<Schema.Literals<readonly ["hydrolysis", "saltingOut", "filtration", "molding"]>>;
|
|
280
|
+
}>, "figure">;
|
|
281
|
+
SoapMicelleEmulsionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
282
|
+
readonly description: RichSlot<E>;
|
|
283
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
284
|
+
readonly marks?: readonly [{
|
|
285
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
286
|
+
} | {
|
|
287
|
+
readonly attrs: {
|
|
288
|
+
readonly href: string;
|
|
289
|
+
};
|
|
290
|
+
readonly type: "link";
|
|
291
|
+
} | {
|
|
292
|
+
readonly attrs: {
|
|
293
|
+
readonly variant: "success" | "warning" | null;
|
|
294
|
+
};
|
|
295
|
+
readonly type: "highlight";
|
|
296
|
+
}, ...({
|
|
297
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
298
|
+
} | {
|
|
299
|
+
readonly attrs: {
|
|
300
|
+
readonly href: string;
|
|
301
|
+
};
|
|
302
|
+
readonly type: "link";
|
|
303
|
+
} | {
|
|
304
|
+
readonly attrs: {
|
|
305
|
+
readonly variant: "success" | "warning" | null;
|
|
306
|
+
};
|
|
307
|
+
readonly type: "highlight";
|
|
308
|
+
})[]];
|
|
309
|
+
readonly text: string;
|
|
310
|
+
readonly type: "text";
|
|
311
|
+
} | {
|
|
312
|
+
readonly attrs: {
|
|
313
|
+
readonly latex: string;
|
|
314
|
+
};
|
|
315
|
+
readonly marks?: readonly [{
|
|
316
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
317
|
+
} | {
|
|
318
|
+
readonly attrs: {
|
|
319
|
+
readonly href: string;
|
|
320
|
+
};
|
|
321
|
+
readonly type: "link";
|
|
322
|
+
} | {
|
|
323
|
+
readonly attrs: {
|
|
324
|
+
readonly variant: "success" | "warning" | null;
|
|
325
|
+
};
|
|
326
|
+
readonly type: "highlight";
|
|
327
|
+
}, ...({
|
|
328
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
329
|
+
} | {
|
|
330
|
+
readonly attrs: {
|
|
331
|
+
readonly href: string;
|
|
332
|
+
};
|
|
333
|
+
readonly type: "link";
|
|
334
|
+
} | {
|
|
335
|
+
readonly attrs: {
|
|
336
|
+
readonly variant: "success" | "warning" | null;
|
|
337
|
+
};
|
|
338
|
+
readonly type: "highlight";
|
|
339
|
+
})[]];
|
|
340
|
+
readonly type: "mathInline";
|
|
341
|
+
}, ...({
|
|
342
|
+
readonly marks?: readonly [{
|
|
343
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
344
|
+
} | {
|
|
345
|
+
readonly attrs: {
|
|
346
|
+
readonly href: string;
|
|
347
|
+
};
|
|
348
|
+
readonly type: "link";
|
|
349
|
+
} | {
|
|
350
|
+
readonly attrs: {
|
|
351
|
+
readonly variant: "success" | "warning" | null;
|
|
352
|
+
};
|
|
353
|
+
readonly type: "highlight";
|
|
354
|
+
}, ...({
|
|
355
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
356
|
+
} | {
|
|
357
|
+
readonly attrs: {
|
|
358
|
+
readonly href: string;
|
|
359
|
+
};
|
|
360
|
+
readonly type: "link";
|
|
361
|
+
} | {
|
|
362
|
+
readonly attrs: {
|
|
363
|
+
readonly variant: "success" | "warning" | null;
|
|
364
|
+
};
|
|
365
|
+
readonly type: "highlight";
|
|
366
|
+
})[]];
|
|
367
|
+
readonly text: string;
|
|
368
|
+
readonly type: "text";
|
|
369
|
+
} | {
|
|
370
|
+
readonly attrs: {
|
|
371
|
+
readonly latex: string;
|
|
372
|
+
};
|
|
373
|
+
readonly marks?: readonly [{
|
|
374
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
375
|
+
} | {
|
|
376
|
+
readonly attrs: {
|
|
377
|
+
readonly href: string;
|
|
378
|
+
};
|
|
379
|
+
readonly type: "link";
|
|
380
|
+
} | {
|
|
381
|
+
readonly attrs: {
|
|
382
|
+
readonly variant: "success" | "warning" | null;
|
|
383
|
+
};
|
|
384
|
+
readonly type: "highlight";
|
|
385
|
+
}, ...({
|
|
386
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
387
|
+
} | {
|
|
388
|
+
readonly attrs: {
|
|
389
|
+
readonly href: string;
|
|
390
|
+
};
|
|
391
|
+
readonly type: "link";
|
|
392
|
+
} | {
|
|
393
|
+
readonly attrs: {
|
|
394
|
+
readonly variant: "success" | "warning" | null;
|
|
395
|
+
};
|
|
396
|
+
readonly type: "highlight";
|
|
397
|
+
})[]];
|
|
398
|
+
readonly type: "mathInline";
|
|
399
|
+
})[]], E, never, never>>;
|
|
400
|
+
readonly title: RichSlot<E>;
|
|
401
|
+
readonly labels: Schema.Struct<{
|
|
402
|
+
readonly mechanism: Schema.optionalKey<RichSlot<E>>;
|
|
403
|
+
readonly outcome: Schema.optionalKey<RichSlot<E>>;
|
|
404
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["fabric", "greaseDrop", "hydrophilicHead", "hydrophobicTail", "waterFlow"]>, Schema.Trimmed>;
|
|
405
|
+
readonly stage: Schema.Trimmed;
|
|
406
|
+
readonly stages: Schema.$Record<Schema.Literals<readonly ["greaseOnFabric", "tailInsertion", "micelleLift", "rinseAway"]>, Schema.optionalKey<Schema.Struct<{
|
|
407
|
+
readonly mechanism: RichSlot<E>;
|
|
408
|
+
readonly name: Schema.Trimmed;
|
|
409
|
+
}>>>;
|
|
410
|
+
readonly view: Schema.Trimmed;
|
|
411
|
+
readonly waterType: Schema.Trimmed;
|
|
412
|
+
readonly waterTypes: Schema.$Record<Schema.Literals<readonly ["soft", "hard"]>, Schema.optionalKey<Schema.Struct<{
|
|
413
|
+
readonly name: Schema.Trimmed;
|
|
414
|
+
readonly outcome: RichSlot<E>;
|
|
415
|
+
}>>>;
|
|
416
|
+
}>;
|
|
417
|
+
readonly stages: Schema.NonEmptyArray<Schema.Literals<readonly ["greaseOnFabric", "tailInsertion", "micelleLift", "rinseAway"]>>;
|
|
418
|
+
readonly waterTypes: Schema.NonEmptyArray<Schema.Literals<readonly ["soft", "hard"]>>;
|
|
419
|
+
}>, "figure">;
|
|
420
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
|
|
5
|
+
const PositiveSliderSchema = Schema.Struct({
|
|
6
|
+
max: PositiveSchema,
|
|
7
|
+
min: PositiveSchema,
|
|
8
|
+
value: PositiveSchema,
|
|
9
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
10
|
+
message: "Expected a positive slider range whose minimum is below its maximum, with the starting value between them.",
|
|
11
|
+
}));
|
|
12
|
+
const MICELLE_STAGES = [
|
|
13
|
+
"greaseOnFabric",
|
|
14
|
+
"tailInsertion",
|
|
15
|
+
"micelleLift",
|
|
16
|
+
"rinseAway",
|
|
17
|
+
];
|
|
18
|
+
const WATER_TYPES = ["soft", "hard"];
|
|
19
|
+
const SAPONIFICATION_STEPS = [
|
|
20
|
+
"hydrolysis",
|
|
21
|
+
"saltingOut",
|
|
22
|
+
"filtration",
|
|
23
|
+
"molding",
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Props of `SoapMicelleEmulsionLab`: a 3D fabric surface and oil droplet
|
|
27
|
+
* showing hydrophobic soap tails anchoring into grease, hydrophilic heads
|
|
28
|
+
* facing water to lift an emulsified micelle, and hard-water scum formation.
|
|
29
|
+
* Cleaning mechanism and water-type outcome readouts are optional answer state.
|
|
30
|
+
*/
|
|
31
|
+
function soapMicelleEmulsionLab(rich) {
|
|
32
|
+
return figure(Schema.Struct({
|
|
33
|
+
...cardFields(rich),
|
|
34
|
+
labels: Schema.Struct({
|
|
35
|
+
mechanism: Schema.optionalKey(rich),
|
|
36
|
+
outcome: Schema.optionalKey(rich),
|
|
37
|
+
parts: byIds([
|
|
38
|
+
"fabric",
|
|
39
|
+
"greaseDrop",
|
|
40
|
+
"hydrophilicHead",
|
|
41
|
+
"hydrophobicTail",
|
|
42
|
+
"waterFlow",
|
|
43
|
+
], TextSchema),
|
|
44
|
+
stage: TextSchema,
|
|
45
|
+
stages: byPickedIds(MICELLE_STAGES, Schema.Struct({
|
|
46
|
+
mechanism: rich,
|
|
47
|
+
name: TextSchema,
|
|
48
|
+
})),
|
|
49
|
+
view: TextSchema,
|
|
50
|
+
waterType: TextSchema,
|
|
51
|
+
waterTypes: byPickedIds(WATER_TYPES, Schema.Struct({
|
|
52
|
+
name: TextSchema,
|
|
53
|
+
outcome: rich,
|
|
54
|
+
})),
|
|
55
|
+
}),
|
|
56
|
+
stages: Schema.NonEmptyArray(Schema.Literals(MICELLE_STAGES)).check(Schema.isUnique()),
|
|
57
|
+
waterTypes: Schema.NonEmptyArray(Schema.Literals(WATER_TYPES)).check(Schema.isUnique()),
|
|
58
|
+
}).check(Schema.makeFilter(({ labels, stages, waterTypes }) => namesEach(stages, labels.stages) &&
|
|
59
|
+
namesEach(waterTypes, labels.waterTypes), {
|
|
60
|
+
message: "Expected a name and note for every micelle cleaning stage and water type shown, and no other.",
|
|
61
|
+
})), answerAt(["labels", "mechanism"], ["labels", "outcome"]));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Props of `HaberAmmoniaConverterLab`: a 3D industrial Haber-Bosch converter
|
|
65
|
+
* loop with gas compressor, iron catalyst trays, condenser, and recycle pipe
|
|
66
|
+
* showing the temperature-pressure compromise between equilibrium yield and
|
|
67
|
+
* reaction rate. Yield and rate readouts are optional answer state.
|
|
68
|
+
*/
|
|
69
|
+
function haberAmmoniaConverterLab(rich) {
|
|
70
|
+
return figure(Schema.Struct({
|
|
71
|
+
...cardFields(rich),
|
|
72
|
+
labels: Schema.Struct({
|
|
73
|
+
equilibriumYield: Schema.optionalKey(rich),
|
|
74
|
+
parts: byIds([
|
|
75
|
+
"compressor",
|
|
76
|
+
"ironCatalystBed",
|
|
77
|
+
"coolingCondenser",
|
|
78
|
+
"liquidAmmonia",
|
|
79
|
+
"recyclePipe",
|
|
80
|
+
], TextSchema),
|
|
81
|
+
pressure: TextSchema,
|
|
82
|
+
rateNote: Schema.optionalKey(rich),
|
|
83
|
+
temperature: TextSchema,
|
|
84
|
+
view: TextSchema,
|
|
85
|
+
}),
|
|
86
|
+
pressure: PositiveSliderSchema,
|
|
87
|
+
temperature: PositiveSliderSchema,
|
|
88
|
+
}), answerAt(["labels", "equilibriumYield"], ["labels", "rateNote"]));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Props of `SaponificationKettleLab`: a 3D industrial soap-boiling kettle
|
|
92
|
+
* illustrating alkaline hydrolysis of vegetable oil with NaOH, salting out
|
|
93
|
+
* with NaCl brine, filtration, and bar molding. Chemical change and stage
|
|
94
|
+
* purpose readouts are optional answer state.
|
|
95
|
+
*/
|
|
96
|
+
function saponificationKettleLab(rich) {
|
|
97
|
+
return figure(Schema.Struct({
|
|
98
|
+
...cardFields(rich),
|
|
99
|
+
labels: Schema.Struct({
|
|
100
|
+
chemicalChange: Schema.optionalKey(rich),
|
|
101
|
+
parts: byIds(["kettle", "triglyceride", "alkaliStream", "saltLayer", "soapCurd"], TextSchema),
|
|
102
|
+
purpose: Schema.optionalKey(rich),
|
|
103
|
+
step: TextSchema,
|
|
104
|
+
steps: byPickedIds(SAPONIFICATION_STEPS, Schema.Struct({
|
|
105
|
+
chemicalChange: rich,
|
|
106
|
+
name: TextSchema,
|
|
107
|
+
purpose: rich,
|
|
108
|
+
})),
|
|
109
|
+
view: TextSchema,
|
|
110
|
+
}),
|
|
111
|
+
steps: Schema.NonEmptyArray(Schema.Literals(SAPONIFICATION_STEPS)).check(Schema.isUnique()),
|
|
112
|
+
}).check(Schema.makeFilter(({ labels, steps }) => namesEach(steps, labels.steps), {
|
|
113
|
+
message: "Expected a name, chemical change, and purpose note for every saponification step shown, and no other.",
|
|
114
|
+
})), answerAt(["labels", "chemicalChange"], ["labels", "purpose"]));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Consumer and industrial chemistry labs covering soap micelle emulsification,
|
|
118
|
+
* the Haber-Bosch ammonia converter, and kettle saponification.
|
|
119
|
+
*/
|
|
120
|
+
export function industryVisuals(rich) {
|
|
121
|
+
return {
|
|
122
|
+
HaberAmmoniaConverterLab: haberAmmoniaConverterLab(rich),
|
|
123
|
+
SaponificationKettleLab: saponificationKettleLab(rich),
|
|
124
|
+
SoapMicelleEmulsionLab: soapMicelleEmulsionLab(rich),
|
|
125
|
+
};
|
|
126
|
+
}
|