@nakafa/aksara-contracts 8.12.0 → 8.13.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/biology/leaf.d.ts +436 -0
- package/dist/visual/biology/leaf.js +151 -0
- package/dist/visual/biology/tissue.d.ts +424 -0
- package/dist/visual/biology/tissue.js +140 -0
- package/dist/visual/catalog.d.ts +2072 -787
- package/dist/visual/catalog.js +6 -0
- package/dist/visual/chemistry/equilibrium.d.ts +449 -0
- package/dist/visual/chemistry/equilibrium.js +135 -0
- package/package.json +1 -1
package/dist/visual/catalog.js
CHANGED
|
@@ -23,6 +23,7 @@ import { jointVisuals } from "#contracts/visual/biology/joint";
|
|
|
23
23
|
import { keyVisuals } from "#contracts/visual/biology/key";
|
|
24
24
|
import { kingdomVisuals } from "#contracts/visual/biology/kingdom";
|
|
25
25
|
import { lactaseVisuals } from "#contracts/visual/biology/lactase";
|
|
26
|
+
import { leafVisuals } from "#contracts/visual/biology/leaf";
|
|
26
27
|
import { limbVisuals } from "#contracts/visual/biology/limb";
|
|
27
28
|
import { lipidVisuals } from "#contracts/visual/biology/lipid";
|
|
28
29
|
import { locomotionVisuals } from "#contracts/visual/biology/locomotion";
|
|
@@ -43,6 +44,7 @@ import { spillVisuals } from "#contracts/visual/biology/spill";
|
|
|
43
44
|
import { sugarVisuals } from "#contracts/visual/biology/sugar";
|
|
44
45
|
import { synapseVisuals } from "#contracts/visual/biology/synapse";
|
|
45
46
|
import { taxonVisuals } from "#contracts/visual/biology/taxon";
|
|
47
|
+
import { tissueVisuals } from "#contracts/visual/biology/tissue";
|
|
46
48
|
import { twinsVisuals } from "#contracts/visual/biology/twins";
|
|
47
49
|
import { vernacularVisuals } from "#contracts/visual/biology/vernacular";
|
|
48
50
|
import { vertebraVisuals } from "#contracts/visual/biology/vertebra";
|
|
@@ -56,6 +58,7 @@ import { bondingVisuals } from "#contracts/visual/chemistry/bonding";
|
|
|
56
58
|
import { discoveryVisuals } from "#contracts/visual/chemistry/discovery";
|
|
57
59
|
import { electrochemistryVisuals } from "#contracts/visual/chemistry/electrochemistry";
|
|
58
60
|
import { electronVisuals } from "#contracts/visual/chemistry/electron";
|
|
61
|
+
import { equilibriumVisuals } from "#contracts/visual/chemistry/equilibrium";
|
|
59
62
|
import { lawVisuals } from "#contracts/visual/chemistry/laws";
|
|
60
63
|
import { particleVisuals } from "#contracts/visual/chemistry/particles";
|
|
61
64
|
import { periodicVisuals } from "#contracts/visual/chemistry/periodic";
|
|
@@ -121,6 +124,7 @@ export function visualCatalog(rich) {
|
|
|
121
124
|
...biologyVisuals(rich),
|
|
122
125
|
...atomVisuals(rich),
|
|
123
126
|
...electronVisuals(rich),
|
|
127
|
+
...equilibriumVisuals(rich),
|
|
124
128
|
...electrochemistryVisuals(rich),
|
|
125
129
|
...titrationVisuals(rich),
|
|
126
130
|
...rateVisuals(rich),
|
|
@@ -189,6 +193,8 @@ export function visualCatalog(rich) {
|
|
|
189
193
|
...denatureVisuals(rich),
|
|
190
194
|
...saturationVisuals(rich),
|
|
191
195
|
...lactaseVisuals(rich),
|
|
196
|
+
...leafVisuals(rich),
|
|
197
|
+
...tissueVisuals(rich),
|
|
192
198
|
...balanceVisuals(rich),
|
|
193
199
|
...bondingVisuals(rich),
|
|
194
200
|
...discoveryVisuals(rich),
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* Chemical equilibrium labs covering dynamic reversible kinetics, reaction
|
|
5
|
+
* quotient comparisons against K_c, and Le Chatelier disturbances.
|
|
6
|
+
*/
|
|
7
|
+
export declare function equilibriumVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
DynamicEquilibriumLab: 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 forwardRate: Schema.Struct<{
|
|
129
|
+
readonly max: Schema.Finite;
|
|
130
|
+
readonly min: Schema.Finite;
|
|
131
|
+
readonly value: Schema.Finite;
|
|
132
|
+
}>;
|
|
133
|
+
readonly initialReactant: Schema.Struct<{
|
|
134
|
+
readonly max: Schema.Finite;
|
|
135
|
+
readonly min: Schema.Finite;
|
|
136
|
+
readonly value: Schema.Finite;
|
|
137
|
+
}>;
|
|
138
|
+
readonly labels: Schema.Struct<{
|
|
139
|
+
readonly equilibrium: Schema.optionalKey<RichSlot<E>>;
|
|
140
|
+
readonly forwardRate: Schema.Trimmed;
|
|
141
|
+
readonly initial: Schema.Trimmed;
|
|
142
|
+
readonly rateForward: RichSlot<E>;
|
|
143
|
+
readonly rateReverse: RichSlot<E>;
|
|
144
|
+
readonly reverseRate: Schema.Trimmed;
|
|
145
|
+
readonly state: RichSlot<E>;
|
|
146
|
+
readonly states: Schema.$Record<Schema.Literals<readonly ["approaching", "balanced"]>, Schema.Trimmed>;
|
|
147
|
+
readonly system: Schema.Trimmed;
|
|
148
|
+
readonly systems: Schema.$Record<Schema.Literals<readonly ["generic", "nitrogenDioxide", "hydrogenIodide"]>, Schema.optionalKey<Schema.Struct<{
|
|
149
|
+
readonly equation: RichSlot<E>;
|
|
150
|
+
readonly name: Schema.Trimmed;
|
|
151
|
+
readonly product: Schema.Trimmed;
|
|
152
|
+
readonly reactant: Schema.Trimmed;
|
|
153
|
+
}>>>;
|
|
154
|
+
readonly view: Schema.Trimmed;
|
|
155
|
+
}>;
|
|
156
|
+
readonly reverseRate: Schema.Struct<{
|
|
157
|
+
readonly max: Schema.Finite;
|
|
158
|
+
readonly min: Schema.Finite;
|
|
159
|
+
readonly value: Schema.Finite;
|
|
160
|
+
}>;
|
|
161
|
+
readonly systems: Schema.NonEmptyArray<Schema.Literals<readonly ["generic", "nitrogenDioxide", "hydrogenIodide"]>>;
|
|
162
|
+
}>, "figure">;
|
|
163
|
+
EquilibriumQuotientLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
164
|
+
readonly description: RichSlot<E>;
|
|
165
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
166
|
+
readonly marks?: readonly [{
|
|
167
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
168
|
+
} | {
|
|
169
|
+
readonly attrs: {
|
|
170
|
+
readonly href: string;
|
|
171
|
+
};
|
|
172
|
+
readonly type: "link";
|
|
173
|
+
} | {
|
|
174
|
+
readonly attrs: {
|
|
175
|
+
readonly variant: "success" | "warning" | null;
|
|
176
|
+
};
|
|
177
|
+
readonly type: "highlight";
|
|
178
|
+
}, ...({
|
|
179
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
180
|
+
} | {
|
|
181
|
+
readonly attrs: {
|
|
182
|
+
readonly href: string;
|
|
183
|
+
};
|
|
184
|
+
readonly type: "link";
|
|
185
|
+
} | {
|
|
186
|
+
readonly attrs: {
|
|
187
|
+
readonly variant: "success" | "warning" | null;
|
|
188
|
+
};
|
|
189
|
+
readonly type: "highlight";
|
|
190
|
+
})[]];
|
|
191
|
+
readonly text: string;
|
|
192
|
+
readonly type: "text";
|
|
193
|
+
} | {
|
|
194
|
+
readonly attrs: {
|
|
195
|
+
readonly latex: string;
|
|
196
|
+
};
|
|
197
|
+
readonly marks?: readonly [{
|
|
198
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
199
|
+
} | {
|
|
200
|
+
readonly attrs: {
|
|
201
|
+
readonly href: string;
|
|
202
|
+
};
|
|
203
|
+
readonly type: "link";
|
|
204
|
+
} | {
|
|
205
|
+
readonly attrs: {
|
|
206
|
+
readonly variant: "success" | "warning" | null;
|
|
207
|
+
};
|
|
208
|
+
readonly type: "highlight";
|
|
209
|
+
}, ...({
|
|
210
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
211
|
+
} | {
|
|
212
|
+
readonly attrs: {
|
|
213
|
+
readonly href: string;
|
|
214
|
+
};
|
|
215
|
+
readonly type: "link";
|
|
216
|
+
} | {
|
|
217
|
+
readonly attrs: {
|
|
218
|
+
readonly variant: "success" | "warning" | null;
|
|
219
|
+
};
|
|
220
|
+
readonly type: "highlight";
|
|
221
|
+
})[]];
|
|
222
|
+
readonly type: "mathInline";
|
|
223
|
+
}, ...({
|
|
224
|
+
readonly marks?: readonly [{
|
|
225
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
226
|
+
} | {
|
|
227
|
+
readonly attrs: {
|
|
228
|
+
readonly href: string;
|
|
229
|
+
};
|
|
230
|
+
readonly type: "link";
|
|
231
|
+
} | {
|
|
232
|
+
readonly attrs: {
|
|
233
|
+
readonly variant: "success" | "warning" | null;
|
|
234
|
+
};
|
|
235
|
+
readonly type: "highlight";
|
|
236
|
+
}, ...({
|
|
237
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
238
|
+
} | {
|
|
239
|
+
readonly attrs: {
|
|
240
|
+
readonly href: string;
|
|
241
|
+
};
|
|
242
|
+
readonly type: "link";
|
|
243
|
+
} | {
|
|
244
|
+
readonly attrs: {
|
|
245
|
+
readonly variant: "success" | "warning" | null;
|
|
246
|
+
};
|
|
247
|
+
readonly type: "highlight";
|
|
248
|
+
})[]];
|
|
249
|
+
readonly text: string;
|
|
250
|
+
readonly type: "text";
|
|
251
|
+
} | {
|
|
252
|
+
readonly attrs: {
|
|
253
|
+
readonly latex: string;
|
|
254
|
+
};
|
|
255
|
+
readonly marks?: readonly [{
|
|
256
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
257
|
+
} | {
|
|
258
|
+
readonly attrs: {
|
|
259
|
+
readonly href: string;
|
|
260
|
+
};
|
|
261
|
+
readonly type: "link";
|
|
262
|
+
} | {
|
|
263
|
+
readonly attrs: {
|
|
264
|
+
readonly variant: "success" | "warning" | null;
|
|
265
|
+
};
|
|
266
|
+
readonly type: "highlight";
|
|
267
|
+
}, ...({
|
|
268
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
269
|
+
} | {
|
|
270
|
+
readonly attrs: {
|
|
271
|
+
readonly href: string;
|
|
272
|
+
};
|
|
273
|
+
readonly type: "link";
|
|
274
|
+
} | {
|
|
275
|
+
readonly attrs: {
|
|
276
|
+
readonly variant: "success" | "warning" | null;
|
|
277
|
+
};
|
|
278
|
+
readonly type: "highlight";
|
|
279
|
+
})[]];
|
|
280
|
+
readonly type: "mathInline";
|
|
281
|
+
})[]], E, never, never>>;
|
|
282
|
+
readonly title: RichSlot<E>;
|
|
283
|
+
readonly kc: Schema.Finite;
|
|
284
|
+
readonly labels: Schema.Struct<{
|
|
285
|
+
readonly direction: Schema.optionalKey<RichSlot<E>>;
|
|
286
|
+
readonly directions: Schema.$Record<Schema.Literals<readonly ["forward", "equilibrium", "reverse"]>, RichSlot<E>>;
|
|
287
|
+
readonly equation: RichSlot<E>;
|
|
288
|
+
readonly kc: RichSlot<E>;
|
|
289
|
+
readonly product: Schema.Trimmed;
|
|
290
|
+
readonly quotient: Schema.optionalKey<RichSlot<E>>;
|
|
291
|
+
readonly reactant: Schema.Trimmed;
|
|
292
|
+
readonly view: Schema.Trimmed;
|
|
293
|
+
}>;
|
|
294
|
+
readonly product: Schema.Struct<{
|
|
295
|
+
readonly max: Schema.Finite;
|
|
296
|
+
readonly min: Schema.Finite;
|
|
297
|
+
readonly value: Schema.Finite;
|
|
298
|
+
}>;
|
|
299
|
+
readonly reactant: Schema.Struct<{
|
|
300
|
+
readonly max: Schema.Finite;
|
|
301
|
+
readonly min: Schema.Finite;
|
|
302
|
+
readonly value: Schema.Finite;
|
|
303
|
+
}>;
|
|
304
|
+
readonly stoichiometry: Schema.Literals<readonly ["oneToOne", "oneToTwo", "twoToTwo"]>;
|
|
305
|
+
}>, "figure">;
|
|
306
|
+
LeChatelierLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
307
|
+
readonly description: RichSlot<E>;
|
|
308
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
309
|
+
readonly marks?: readonly [{
|
|
310
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
311
|
+
} | {
|
|
312
|
+
readonly attrs: {
|
|
313
|
+
readonly href: string;
|
|
314
|
+
};
|
|
315
|
+
readonly type: "link";
|
|
316
|
+
} | {
|
|
317
|
+
readonly attrs: {
|
|
318
|
+
readonly variant: "success" | "warning" | null;
|
|
319
|
+
};
|
|
320
|
+
readonly type: "highlight";
|
|
321
|
+
}, ...({
|
|
322
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
323
|
+
} | {
|
|
324
|
+
readonly attrs: {
|
|
325
|
+
readonly href: string;
|
|
326
|
+
};
|
|
327
|
+
readonly type: "link";
|
|
328
|
+
} | {
|
|
329
|
+
readonly attrs: {
|
|
330
|
+
readonly variant: "success" | "warning" | null;
|
|
331
|
+
};
|
|
332
|
+
readonly type: "highlight";
|
|
333
|
+
})[]];
|
|
334
|
+
readonly text: string;
|
|
335
|
+
readonly type: "text";
|
|
336
|
+
} | {
|
|
337
|
+
readonly attrs: {
|
|
338
|
+
readonly latex: string;
|
|
339
|
+
};
|
|
340
|
+
readonly marks?: readonly [{
|
|
341
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
342
|
+
} | {
|
|
343
|
+
readonly attrs: {
|
|
344
|
+
readonly href: string;
|
|
345
|
+
};
|
|
346
|
+
readonly type: "link";
|
|
347
|
+
} | {
|
|
348
|
+
readonly attrs: {
|
|
349
|
+
readonly variant: "success" | "warning" | null;
|
|
350
|
+
};
|
|
351
|
+
readonly type: "highlight";
|
|
352
|
+
}, ...({
|
|
353
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
354
|
+
} | {
|
|
355
|
+
readonly attrs: {
|
|
356
|
+
readonly href: string;
|
|
357
|
+
};
|
|
358
|
+
readonly type: "link";
|
|
359
|
+
} | {
|
|
360
|
+
readonly attrs: {
|
|
361
|
+
readonly variant: "success" | "warning" | null;
|
|
362
|
+
};
|
|
363
|
+
readonly type: "highlight";
|
|
364
|
+
})[]];
|
|
365
|
+
readonly type: "mathInline";
|
|
366
|
+
}, ...({
|
|
367
|
+
readonly marks?: readonly [{
|
|
368
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
369
|
+
} | {
|
|
370
|
+
readonly attrs: {
|
|
371
|
+
readonly href: string;
|
|
372
|
+
};
|
|
373
|
+
readonly type: "link";
|
|
374
|
+
} | {
|
|
375
|
+
readonly attrs: {
|
|
376
|
+
readonly variant: "success" | "warning" | null;
|
|
377
|
+
};
|
|
378
|
+
readonly type: "highlight";
|
|
379
|
+
}, ...({
|
|
380
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
381
|
+
} | {
|
|
382
|
+
readonly attrs: {
|
|
383
|
+
readonly href: string;
|
|
384
|
+
};
|
|
385
|
+
readonly type: "link";
|
|
386
|
+
} | {
|
|
387
|
+
readonly attrs: {
|
|
388
|
+
readonly variant: "success" | "warning" | null;
|
|
389
|
+
};
|
|
390
|
+
readonly type: "highlight";
|
|
391
|
+
})[]];
|
|
392
|
+
readonly text: string;
|
|
393
|
+
readonly type: "text";
|
|
394
|
+
} | {
|
|
395
|
+
readonly attrs: {
|
|
396
|
+
readonly latex: string;
|
|
397
|
+
};
|
|
398
|
+
readonly marks?: readonly [{
|
|
399
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
400
|
+
} | {
|
|
401
|
+
readonly attrs: {
|
|
402
|
+
readonly href: string;
|
|
403
|
+
};
|
|
404
|
+
readonly type: "link";
|
|
405
|
+
} | {
|
|
406
|
+
readonly attrs: {
|
|
407
|
+
readonly variant: "success" | "warning" | null;
|
|
408
|
+
};
|
|
409
|
+
readonly type: "highlight";
|
|
410
|
+
}, ...({
|
|
411
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
412
|
+
} | {
|
|
413
|
+
readonly attrs: {
|
|
414
|
+
readonly href: string;
|
|
415
|
+
};
|
|
416
|
+
readonly type: "link";
|
|
417
|
+
} | {
|
|
418
|
+
readonly attrs: {
|
|
419
|
+
readonly variant: "success" | "warning" | null;
|
|
420
|
+
};
|
|
421
|
+
readonly type: "highlight";
|
|
422
|
+
})[]];
|
|
423
|
+
readonly type: "mathInline";
|
|
424
|
+
})[]], E, never, never>>;
|
|
425
|
+
readonly title: RichSlot<E>;
|
|
426
|
+
readonly disturbances: Schema.NonEmptyArray<Schema.Literals<readonly ["pressure", "temperature", "concentration", "catalyst"]>>;
|
|
427
|
+
readonly labels: Schema.Struct<{
|
|
428
|
+
readonly catalyst: Schema.Trimmed;
|
|
429
|
+
readonly concentration: Schema.Trimmed;
|
|
430
|
+
readonly disturbance: Schema.Trimmed;
|
|
431
|
+
readonly disturbances: Schema.$Record<Schema.Literals<readonly ["pressure", "temperature", "concentration", "catalyst"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
432
|
+
readonly kcChange: Schema.optionalKey<RichSlot<E>>;
|
|
433
|
+
readonly kcStates: Schema.$Record<Schema.Literals<readonly ["increases", "constant", "decreases"]>, Schema.Trimmed>;
|
|
434
|
+
readonly pressure: Schema.Trimmed;
|
|
435
|
+
readonly shift: Schema.optionalKey<RichSlot<E>>;
|
|
436
|
+
readonly shifts: Schema.$Record<Schema.Literals<readonly ["forward", "none", "reverse"]>, RichSlot<E>>;
|
|
437
|
+
readonly system: Schema.Trimmed;
|
|
438
|
+
readonly systems: Schema.$Record<Schema.Literals<readonly ["haber", "nitrogenDioxide", "contact"]>, Schema.optionalKey<Schema.Struct<{
|
|
439
|
+
readonly enthalpy: Schema.Trimmed;
|
|
440
|
+
readonly equation: RichSlot<E>;
|
|
441
|
+
readonly name: Schema.Trimmed;
|
|
442
|
+
}>>>;
|
|
443
|
+
readonly temperature: Schema.Trimmed;
|
|
444
|
+
readonly view: Schema.Trimmed;
|
|
445
|
+
readonly yield: RichSlot<E>;
|
|
446
|
+
}>;
|
|
447
|
+
readonly systems: Schema.NonEmptyArray<Schema.Literals<readonly ["haber", "nitrogenDioxide", "contact"]>>;
|
|
448
|
+
}>, "figure">;
|
|
449
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
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 physical quantity. */
|
|
5
|
+
const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
|
|
6
|
+
/** A non-negative finite concentration or rate parameter. */
|
|
7
|
+
const NonNegativeSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
|
|
8
|
+
/** A slider range with minimum below maximum and starting value inside bounds. */
|
|
9
|
+
const SliderSchema = Schema.Struct({
|
|
10
|
+
max: PositiveSchema,
|
|
11
|
+
min: NonNegativeSchema,
|
|
12
|
+
value: NonNegativeSchema,
|
|
13
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
14
|
+
message: "Expected a slider range whose minimum is below its maximum, with the starting value between them.",
|
|
15
|
+
}));
|
|
16
|
+
const DYNAMIC_SYSTEMS = [
|
|
17
|
+
"generic",
|
|
18
|
+
"nitrogenDioxide",
|
|
19
|
+
"hydrogenIodide",
|
|
20
|
+
];
|
|
21
|
+
const LE_CHATELIER_SYSTEMS = ["haber", "nitrogenDioxide", "contact"];
|
|
22
|
+
const DISTURBANCES = [
|
|
23
|
+
"pressure",
|
|
24
|
+
"temperature",
|
|
25
|
+
"concentration",
|
|
26
|
+
"catalyst",
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Props of `DynamicEquilibriumLab`: a 3D reversible particle reactor showing
|
|
30
|
+
* forward and reverse reactions occurring simultaneously as forward rate and
|
|
31
|
+
* reverse rate converge to a nonzero steady value while concentrations stay
|
|
32
|
+
* constant. The equilibrium composition readout shows only when
|
|
33
|
+
* `labels.equilibrium` names it.
|
|
34
|
+
*/
|
|
35
|
+
function dynamicEquilibriumLab(rich) {
|
|
36
|
+
return figure(Schema.Struct({
|
|
37
|
+
...cardFields(rich),
|
|
38
|
+
forwardRate: SliderSchema,
|
|
39
|
+
initialReactant: SliderSchema,
|
|
40
|
+
labels: Schema.Struct({
|
|
41
|
+
equilibrium: Schema.optionalKey(rich),
|
|
42
|
+
forwardRate: TextSchema,
|
|
43
|
+
initial: TextSchema,
|
|
44
|
+
rateForward: rich,
|
|
45
|
+
rateReverse: rich,
|
|
46
|
+
reverseRate: TextSchema,
|
|
47
|
+
state: rich,
|
|
48
|
+
states: byIds(["approaching", "balanced"], TextSchema),
|
|
49
|
+
system: TextSchema,
|
|
50
|
+
systems: byPickedIds(DYNAMIC_SYSTEMS, Schema.Struct({
|
|
51
|
+
equation: rich,
|
|
52
|
+
name: TextSchema,
|
|
53
|
+
product: TextSchema,
|
|
54
|
+
reactant: TextSchema,
|
|
55
|
+
})),
|
|
56
|
+
view: TextSchema,
|
|
57
|
+
}),
|
|
58
|
+
reverseRate: SliderSchema,
|
|
59
|
+
systems: Schema.NonEmptyArray(Schema.Literals(DYNAMIC_SYSTEMS)).check(Schema.isUnique()),
|
|
60
|
+
}).check(Schema.makeFilter(({ labels, systems }) => namesEach(systems, labels.systems), {
|
|
61
|
+
message: "Expected a name and species labels for every reversible system shown, and no other.",
|
|
62
|
+
})), answerAt(["labels", "equilibrium"]));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Props of `EquilibriumQuotientLab`: a 3D reaction vessel coupled to a live
|
|
66
|
+
* reaction quotient scale comparing Q_c against K_c so learners see whether a
|
|
67
|
+
* mixture shifts forward, stays at equilibrium, or shifts in reverse. The
|
|
68
|
+
* quotient and direction readouts are optional answer state.
|
|
69
|
+
*/
|
|
70
|
+
function equilibriumQuotientLab(rich) {
|
|
71
|
+
return figure(Schema.Struct({
|
|
72
|
+
...cardFields(rich),
|
|
73
|
+
kc: PositiveSchema,
|
|
74
|
+
labels: Schema.Struct({
|
|
75
|
+
direction: Schema.optionalKey(rich),
|
|
76
|
+
directions: byIds(["forward", "equilibrium", "reverse"], rich),
|
|
77
|
+
equation: rich,
|
|
78
|
+
kc: rich,
|
|
79
|
+
product: TextSchema,
|
|
80
|
+
quotient: Schema.optionalKey(rich),
|
|
81
|
+
reactant: TextSchema,
|
|
82
|
+
view: TextSchema,
|
|
83
|
+
}),
|
|
84
|
+
product: SliderSchema,
|
|
85
|
+
reactant: SliderSchema,
|
|
86
|
+
stoichiometry: Schema.Literals(["oneToOne", "oneToTwo", "twoToTwo"]),
|
|
87
|
+
}), answerAt(["labels", "direction"], ["labels", "quotient"]));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Props of `LeChatelierLab`: a 3D piston-cylinder gas reactor with heating,
|
|
91
|
+
* cooling, species injection, and catalyst controls for gas equilibria such as
|
|
92
|
+
* Haber-Bosch and nitrogen dioxide dimerisation. The shift direction and K_c
|
|
93
|
+
* response readouts show only when named so questions can withhold them.
|
|
94
|
+
*/
|
|
95
|
+
function leChatelierLab(rich) {
|
|
96
|
+
return figure(Schema.Struct({
|
|
97
|
+
...cardFields(rich),
|
|
98
|
+
disturbances: Schema.NonEmptyArray(Schema.Literals(DISTURBANCES)).check(Schema.isUnique()),
|
|
99
|
+
labels: Schema.Struct({
|
|
100
|
+
catalyst: TextSchema,
|
|
101
|
+
concentration: TextSchema,
|
|
102
|
+
disturbance: TextSchema,
|
|
103
|
+
disturbances: byPickedIds(DISTURBANCES, TextSchema),
|
|
104
|
+
kcChange: Schema.optionalKey(rich),
|
|
105
|
+
kcStates: byIds(["increases", "constant", "decreases"], TextSchema),
|
|
106
|
+
pressure: TextSchema,
|
|
107
|
+
shift: Schema.optionalKey(rich),
|
|
108
|
+
shifts: byIds(["forward", "none", "reverse"], rich),
|
|
109
|
+
system: TextSchema,
|
|
110
|
+
systems: byPickedIds(LE_CHATELIER_SYSTEMS, Schema.Struct({
|
|
111
|
+
enthalpy: TextSchema,
|
|
112
|
+
equation: rich,
|
|
113
|
+
name: TextSchema,
|
|
114
|
+
})),
|
|
115
|
+
temperature: TextSchema,
|
|
116
|
+
view: TextSchema,
|
|
117
|
+
yield: rich,
|
|
118
|
+
}),
|
|
119
|
+
systems: Schema.NonEmptyArray(Schema.Literals(LE_CHATELIER_SYSTEMS)).check(Schema.isUnique()),
|
|
120
|
+
}).check(Schema.makeFilter(({ disturbances, labels, systems }) => namesEach(systems, labels.systems) &&
|
|
121
|
+
namesEach(disturbances, labels.disturbances), {
|
|
122
|
+
message: "Expected labels for every equilibrium system and disturbance shown, and no other.",
|
|
123
|
+
})), answerAt(["labels", "shift"], ["labels", "kcChange"]));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Chemical equilibrium labs covering dynamic reversible kinetics, reaction
|
|
127
|
+
* quotient comparisons against K_c, and Le Chatelier disturbances.
|
|
128
|
+
*/
|
|
129
|
+
export function equilibriumVisuals(rich) {
|
|
130
|
+
return {
|
|
131
|
+
DynamicEquilibriumLab: dynamicEquilibriumLab(rich),
|
|
132
|
+
EquilibriumQuotientLab: equilibriumQuotientLab(rich),
|
|
133
|
+
LeChatelierLab: leChatelierLab(rich),
|
|
134
|
+
};
|
|
135
|
+
}
|
package/package.json
CHANGED