@nakafa/aksara-contracts 8.14.0 → 8.16.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/flower.d.ts +276 -0
- package/dist/visual/biology/flower.js +76 -0
- package/dist/visual/biology/membrane.d.ts +141 -2
- package/dist/visual/biology/membrane.js +44 -2
- package/dist/visual/biology/mendelian.d.ts +410 -0
- package/dist/visual/biology/mendelian.js +107 -0
- package/dist/visual/biology/nutrition.d.ts +410 -0
- package/dist/visual/biology/nutrition.js +112 -0
- package/dist/visual/biology/phytohormone.d.ts +275 -0
- package/dist/visual/biology/phytohormone.js +75 -0
- package/dist/visual/biology/variation.d.ts +421 -0
- package/dist/visual/biology/variation.js +123 -0
- package/dist/visual/biology/vascular.d.ts +425 -0
- package/dist/visual/biology/vascular.js +107 -0
- package/dist/visual/biology.d.ts +12427 -0
- package/dist/visual/biology.js +112 -0
- package/dist/visual/catalog.d.ts +16 -38898
- 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.d.ts +3065 -0
- package/dist/visual/mathematics.js +30 -0
- package/dist/visual/physics.d.ts +17875 -0
- package/dist/visual/physics.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* Periodic group and period trend labs covering Group 17 halogen displacement
|
|
5
|
+
* and Period 3 oxide acid-base and bonding transitions.
|
|
6
|
+
*/
|
|
7
|
+
export declare function groupVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
HalogenDisplacementLab: 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 observation: Schema.optionalKey<RichSlot<E>>;
|
|
130
|
+
readonly pair: Schema.Trimmed;
|
|
131
|
+
readonly pairs: Schema.$Record<Schema.Literals<readonly ["cl2WithKbr", "cl2WithKi", "br2WithKi", "i2WithKcl"]>, Schema.optionalKey<Schema.Struct<{
|
|
132
|
+
readonly name: Schema.Trimmed;
|
|
133
|
+
readonly observation: RichSlot<E>;
|
|
134
|
+
readonly redoxOutcome: RichSlot<E>;
|
|
135
|
+
}>>>;
|
|
136
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["testTube", "aqueousLayer", "organicLayer", "halogenDrop", "halideIon"]>, Schema.Trimmed>;
|
|
137
|
+
readonly redoxOutcome: Schema.optionalKey<RichSlot<E>>;
|
|
138
|
+
readonly view: Schema.Trimmed;
|
|
139
|
+
}>;
|
|
140
|
+
readonly pairs: Schema.NonEmptyArray<Schema.Literals<readonly ["cl2WithKbr", "cl2WithKi", "br2WithKi", "i2WithKcl"]>>;
|
|
141
|
+
}>, "figure">;
|
|
142
|
+
PeriodThreeOxideLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
143
|
+
readonly description: RichSlot<E>;
|
|
144
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
145
|
+
readonly marks?: readonly [{
|
|
146
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
147
|
+
} | {
|
|
148
|
+
readonly attrs: {
|
|
149
|
+
readonly href: string;
|
|
150
|
+
};
|
|
151
|
+
readonly type: "link";
|
|
152
|
+
} | {
|
|
153
|
+
readonly attrs: {
|
|
154
|
+
readonly variant: "success" | "warning" | null;
|
|
155
|
+
};
|
|
156
|
+
readonly type: "highlight";
|
|
157
|
+
}, ...({
|
|
158
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
159
|
+
} | {
|
|
160
|
+
readonly attrs: {
|
|
161
|
+
readonly href: string;
|
|
162
|
+
};
|
|
163
|
+
readonly type: "link";
|
|
164
|
+
} | {
|
|
165
|
+
readonly attrs: {
|
|
166
|
+
readonly variant: "success" | "warning" | null;
|
|
167
|
+
};
|
|
168
|
+
readonly type: "highlight";
|
|
169
|
+
})[]];
|
|
170
|
+
readonly text: string;
|
|
171
|
+
readonly type: "text";
|
|
172
|
+
} | {
|
|
173
|
+
readonly attrs: {
|
|
174
|
+
readonly latex: string;
|
|
175
|
+
};
|
|
176
|
+
readonly marks?: readonly [{
|
|
177
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
178
|
+
} | {
|
|
179
|
+
readonly attrs: {
|
|
180
|
+
readonly href: string;
|
|
181
|
+
};
|
|
182
|
+
readonly type: "link";
|
|
183
|
+
} | {
|
|
184
|
+
readonly attrs: {
|
|
185
|
+
readonly variant: "success" | "warning" | null;
|
|
186
|
+
};
|
|
187
|
+
readonly type: "highlight";
|
|
188
|
+
}, ...({
|
|
189
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
190
|
+
} | {
|
|
191
|
+
readonly attrs: {
|
|
192
|
+
readonly href: string;
|
|
193
|
+
};
|
|
194
|
+
readonly type: "link";
|
|
195
|
+
} | {
|
|
196
|
+
readonly attrs: {
|
|
197
|
+
readonly variant: "success" | "warning" | null;
|
|
198
|
+
};
|
|
199
|
+
readonly type: "highlight";
|
|
200
|
+
})[]];
|
|
201
|
+
readonly type: "mathInline";
|
|
202
|
+
}, ...({
|
|
203
|
+
readonly marks?: readonly [{
|
|
204
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
205
|
+
} | {
|
|
206
|
+
readonly attrs: {
|
|
207
|
+
readonly href: string;
|
|
208
|
+
};
|
|
209
|
+
readonly type: "link";
|
|
210
|
+
} | {
|
|
211
|
+
readonly attrs: {
|
|
212
|
+
readonly variant: "success" | "warning" | null;
|
|
213
|
+
};
|
|
214
|
+
readonly type: "highlight";
|
|
215
|
+
}, ...({
|
|
216
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
217
|
+
} | {
|
|
218
|
+
readonly attrs: {
|
|
219
|
+
readonly href: string;
|
|
220
|
+
};
|
|
221
|
+
readonly type: "link";
|
|
222
|
+
} | {
|
|
223
|
+
readonly attrs: {
|
|
224
|
+
readonly variant: "success" | "warning" | null;
|
|
225
|
+
};
|
|
226
|
+
readonly type: "highlight";
|
|
227
|
+
})[]];
|
|
228
|
+
readonly text: string;
|
|
229
|
+
readonly type: "text";
|
|
230
|
+
} | {
|
|
231
|
+
readonly attrs: {
|
|
232
|
+
readonly latex: string;
|
|
233
|
+
};
|
|
234
|
+
readonly marks?: readonly [{
|
|
235
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
236
|
+
} | {
|
|
237
|
+
readonly attrs: {
|
|
238
|
+
readonly href: string;
|
|
239
|
+
};
|
|
240
|
+
readonly type: "link";
|
|
241
|
+
} | {
|
|
242
|
+
readonly attrs: {
|
|
243
|
+
readonly variant: "success" | "warning" | null;
|
|
244
|
+
};
|
|
245
|
+
readonly type: "highlight";
|
|
246
|
+
}, ...({
|
|
247
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
248
|
+
} | {
|
|
249
|
+
readonly attrs: {
|
|
250
|
+
readonly href: string;
|
|
251
|
+
};
|
|
252
|
+
readonly type: "link";
|
|
253
|
+
} | {
|
|
254
|
+
readonly attrs: {
|
|
255
|
+
readonly variant: "success" | "warning" | null;
|
|
256
|
+
};
|
|
257
|
+
readonly type: "highlight";
|
|
258
|
+
})[]];
|
|
259
|
+
readonly type: "mathInline";
|
|
260
|
+
})[]], E, never, never>>;
|
|
261
|
+
readonly title: RichSlot<E>;
|
|
262
|
+
readonly labels: Schema.Struct<{
|
|
263
|
+
readonly acidBaseNature: Schema.optionalKey<RichSlot<E>>;
|
|
264
|
+
readonly bonding: Schema.optionalKey<RichSlot<E>>;
|
|
265
|
+
readonly oxide: Schema.Trimmed;
|
|
266
|
+
readonly oxides: Schema.$Record<Schema.Literals<readonly ["na2o", "mgo", "al2o3", "sio2", "p4o10", "so2"]>, Schema.optionalKey<Schema.Struct<{
|
|
267
|
+
readonly acidBaseNature: RichSlot<E>;
|
|
268
|
+
readonly bonding: RichSlot<E>;
|
|
269
|
+
readonly name: Schema.Trimmed;
|
|
270
|
+
}>>>;
|
|
271
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["oxideSample", "waterBeaker", "phMeter", "latticeModel"]>, Schema.Trimmed>;
|
|
272
|
+
readonly view: Schema.Trimmed;
|
|
273
|
+
}>;
|
|
274
|
+
readonly oxides: Schema.NonEmptyArray<Schema.Literals<readonly ["na2o", "mgo", "al2o3", "sio2", "p4o10", "so2"]>>;
|
|
275
|
+
}>, "figure">;
|
|
276
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
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 HALOGEN_PAIRS = [
|
|
5
|
+
"cl2WithKbr",
|
|
6
|
+
"cl2WithKi",
|
|
7
|
+
"br2WithKi",
|
|
8
|
+
"i2WithKcl",
|
|
9
|
+
];
|
|
10
|
+
const PERIOD_THREE_OXIDES = [
|
|
11
|
+
"na2o",
|
|
12
|
+
"mgo",
|
|
13
|
+
"al2o3",
|
|
14
|
+
"sio2",
|
|
15
|
+
"p4o10",
|
|
16
|
+
"so2",
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Props of `HalogenDisplacementLab`: a 3D test-tube rack with aqueous and
|
|
20
|
+
* organic cyclohexane layers demonstrating Group 17 reactivity order as
|
|
21
|
+
* chlorine, bromine, and iodine react with halide solutions. Observation and
|
|
22
|
+
* redox outcome readouts are optional answer state.
|
|
23
|
+
*/
|
|
24
|
+
function halogenDisplacementLab(rich) {
|
|
25
|
+
return figure(Schema.Struct({
|
|
26
|
+
...cardFields(rich),
|
|
27
|
+
labels: Schema.Struct({
|
|
28
|
+
observation: Schema.optionalKey(rich),
|
|
29
|
+
pair: TextSchema,
|
|
30
|
+
pairs: byPickedIds(HALOGEN_PAIRS, Schema.Struct({
|
|
31
|
+
name: TextSchema,
|
|
32
|
+
observation: rich,
|
|
33
|
+
redoxOutcome: rich,
|
|
34
|
+
})),
|
|
35
|
+
parts: byIds([
|
|
36
|
+
"testTube",
|
|
37
|
+
"aqueousLayer",
|
|
38
|
+
"organicLayer",
|
|
39
|
+
"halogenDrop",
|
|
40
|
+
"halideIon",
|
|
41
|
+
], TextSchema),
|
|
42
|
+
redoxOutcome: Schema.optionalKey(rich),
|
|
43
|
+
view: TextSchema,
|
|
44
|
+
}),
|
|
45
|
+
pairs: Schema.NonEmptyArray(Schema.Literals(HALOGEN_PAIRS)).check(Schema.isUnique()),
|
|
46
|
+
}).check(Schema.makeFilter(({ labels, pairs }) => namesEach(pairs, labels.pairs), {
|
|
47
|
+
message: "Expected a name, observation, and redox outcome for every halogen displacement pair shown, and no other.",
|
|
48
|
+
})), answerAt(["labels", "observation"], ["labels", "redoxOutcome"]));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Props of `PeriodThreeOxideLab`: a 3D bench comparing Period 3 oxides from
|
|
52
|
+
* basic ionic Na2O and MgO through amphoteric Al2O3 to giant covalent SiO2 and
|
|
53
|
+
* acidic covalent P4O10 and SO2. Acid-base nature and bonding readouts are
|
|
54
|
+
* optional answer state.
|
|
55
|
+
*/
|
|
56
|
+
function periodThreeOxideLab(rich) {
|
|
57
|
+
return figure(Schema.Struct({
|
|
58
|
+
...cardFields(rich),
|
|
59
|
+
labels: Schema.Struct({
|
|
60
|
+
acidBaseNature: Schema.optionalKey(rich),
|
|
61
|
+
bonding: Schema.optionalKey(rich),
|
|
62
|
+
oxide: TextSchema,
|
|
63
|
+
oxides: byPickedIds(PERIOD_THREE_OXIDES, Schema.Struct({
|
|
64
|
+
acidBaseNature: rich,
|
|
65
|
+
bonding: rich,
|
|
66
|
+
name: TextSchema,
|
|
67
|
+
})),
|
|
68
|
+
parts: byIds(["oxideSample", "waterBeaker", "phMeter", "latticeModel"], TextSchema),
|
|
69
|
+
view: TextSchema,
|
|
70
|
+
}),
|
|
71
|
+
oxides: Schema.NonEmptyArray(Schema.Literals(PERIOD_THREE_OXIDES)).check(Schema.isUnique()),
|
|
72
|
+
}).check(Schema.makeFilter(({ labels, oxides }) => namesEach(oxides, labels.oxides), {
|
|
73
|
+
message: "Expected a name, acid-base nature, and bonding note for every Period 3 oxide shown, and no other.",
|
|
74
|
+
})), answerAt(["labels", "acidBaseNature"], ["labels", "bonding"]));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Periodic group and period trend labs covering Group 17 halogen displacement
|
|
78
|
+
* and Period 3 oxide acid-base and bonding transitions.
|
|
79
|
+
*/
|
|
80
|
+
export function groupVisuals(rich) {
|
|
81
|
+
return {
|
|
82
|
+
HalogenDisplacementLab: halogenDisplacementLab(rich),
|
|
83
|
+
PeriodThreeOxideLab: periodThreeOxideLab(rich),
|
|
84
|
+
};
|
|
85
|
+
}
|