@nakafa/aksara-contracts 8.14.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.
- 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 +2169 -0
- package/dist/visual/biology.js +12 -0
- package/dist/visual/catalog.d.ts +2962 -654
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* Plant response and phytohormone labs covering asymmetric auxin agar-block
|
|
5
|
+
* bending and the five core phytohormones in plant development and farming.
|
|
6
|
+
*/
|
|
7
|
+
export declare function phytohormoneVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
AuxinAgarBendLab: 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 auxinLevel: 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 angle: Schema.optionalKey<RichSlot<E>>;
|
|
135
|
+
readonly auxinLevel: Schema.Trimmed;
|
|
136
|
+
readonly elongation: Schema.optionalKey<RichSlot<E>>;
|
|
137
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["agarBlock", "coleoptile", "shadedSide", "litSide", "auxinDot"]>, Schema.Trimmed>;
|
|
138
|
+
readonly view: Schema.Trimmed;
|
|
139
|
+
}>;
|
|
140
|
+
}>, "figure">;
|
|
141
|
+
PhytohormoneActionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
142
|
+
readonly description: RichSlot<E>;
|
|
143
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
144
|
+
readonly marks?: readonly [{
|
|
145
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
146
|
+
} | {
|
|
147
|
+
readonly attrs: {
|
|
148
|
+
readonly href: string;
|
|
149
|
+
};
|
|
150
|
+
readonly type: "link";
|
|
151
|
+
} | {
|
|
152
|
+
readonly attrs: {
|
|
153
|
+
readonly variant: "success" | "warning" | null;
|
|
154
|
+
};
|
|
155
|
+
readonly type: "highlight";
|
|
156
|
+
}, ...({
|
|
157
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
158
|
+
} | {
|
|
159
|
+
readonly attrs: {
|
|
160
|
+
readonly href: string;
|
|
161
|
+
};
|
|
162
|
+
readonly type: "link";
|
|
163
|
+
} | {
|
|
164
|
+
readonly attrs: {
|
|
165
|
+
readonly variant: "success" | "warning" | null;
|
|
166
|
+
};
|
|
167
|
+
readonly type: "highlight";
|
|
168
|
+
})[]];
|
|
169
|
+
readonly text: string;
|
|
170
|
+
readonly type: "text";
|
|
171
|
+
} | {
|
|
172
|
+
readonly attrs: {
|
|
173
|
+
readonly latex: string;
|
|
174
|
+
};
|
|
175
|
+
readonly marks?: readonly [{
|
|
176
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
177
|
+
} | {
|
|
178
|
+
readonly attrs: {
|
|
179
|
+
readonly href: string;
|
|
180
|
+
};
|
|
181
|
+
readonly type: "link";
|
|
182
|
+
} | {
|
|
183
|
+
readonly attrs: {
|
|
184
|
+
readonly variant: "success" | "warning" | null;
|
|
185
|
+
};
|
|
186
|
+
readonly type: "highlight";
|
|
187
|
+
}, ...({
|
|
188
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
189
|
+
} | {
|
|
190
|
+
readonly attrs: {
|
|
191
|
+
readonly href: string;
|
|
192
|
+
};
|
|
193
|
+
readonly type: "link";
|
|
194
|
+
} | {
|
|
195
|
+
readonly attrs: {
|
|
196
|
+
readonly variant: "success" | "warning" | null;
|
|
197
|
+
};
|
|
198
|
+
readonly type: "highlight";
|
|
199
|
+
})[]];
|
|
200
|
+
readonly type: "mathInline";
|
|
201
|
+
}, ...({
|
|
202
|
+
readonly marks?: readonly [{
|
|
203
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
204
|
+
} | {
|
|
205
|
+
readonly attrs: {
|
|
206
|
+
readonly href: string;
|
|
207
|
+
};
|
|
208
|
+
readonly type: "link";
|
|
209
|
+
} | {
|
|
210
|
+
readonly attrs: {
|
|
211
|
+
readonly variant: "success" | "warning" | null;
|
|
212
|
+
};
|
|
213
|
+
readonly type: "highlight";
|
|
214
|
+
}, ...({
|
|
215
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
216
|
+
} | {
|
|
217
|
+
readonly attrs: {
|
|
218
|
+
readonly href: string;
|
|
219
|
+
};
|
|
220
|
+
readonly type: "link";
|
|
221
|
+
} | {
|
|
222
|
+
readonly attrs: {
|
|
223
|
+
readonly variant: "success" | "warning" | null;
|
|
224
|
+
};
|
|
225
|
+
readonly type: "highlight";
|
|
226
|
+
})[]];
|
|
227
|
+
readonly text: string;
|
|
228
|
+
readonly type: "text";
|
|
229
|
+
} | {
|
|
230
|
+
readonly attrs: {
|
|
231
|
+
readonly latex: string;
|
|
232
|
+
};
|
|
233
|
+
readonly marks?: readonly [{
|
|
234
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
235
|
+
} | {
|
|
236
|
+
readonly attrs: {
|
|
237
|
+
readonly href: string;
|
|
238
|
+
};
|
|
239
|
+
readonly type: "link";
|
|
240
|
+
} | {
|
|
241
|
+
readonly attrs: {
|
|
242
|
+
readonly variant: "success" | "warning" | null;
|
|
243
|
+
};
|
|
244
|
+
readonly type: "highlight";
|
|
245
|
+
}, ...({
|
|
246
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
247
|
+
} | {
|
|
248
|
+
readonly attrs: {
|
|
249
|
+
readonly href: string;
|
|
250
|
+
};
|
|
251
|
+
readonly type: "link";
|
|
252
|
+
} | {
|
|
253
|
+
readonly attrs: {
|
|
254
|
+
readonly variant: "success" | "warning" | null;
|
|
255
|
+
};
|
|
256
|
+
readonly type: "highlight";
|
|
257
|
+
})[]];
|
|
258
|
+
readonly type: "mathInline";
|
|
259
|
+
})[]], E, never, never>>;
|
|
260
|
+
readonly title: RichSlot<E>;
|
|
261
|
+
readonly hormones: Schema.NonEmptyArray<Schema.Literals<readonly ["auxin", "gibberellin", "cytokinin", "abscisicAcid", "ethylene"]>>;
|
|
262
|
+
readonly labels: Schema.Struct<{
|
|
263
|
+
readonly effect: Schema.optionalKey<RichSlot<E>>;
|
|
264
|
+
readonly farmUse: Schema.optionalKey<RichSlot<E>>;
|
|
265
|
+
readonly hormone: Schema.Trimmed;
|
|
266
|
+
readonly hormones: Schema.$Record<Schema.Literals<readonly ["auxin", "gibberellin", "cytokinin", "abscisicAcid", "ethylene"]>, Schema.optionalKey<Schema.Struct<{
|
|
267
|
+
readonly effect: RichSlot<E>;
|
|
268
|
+
readonly farmUse: RichSlot<E>;
|
|
269
|
+
readonly name: Schema.Trimmed;
|
|
270
|
+
}>>>;
|
|
271
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["shootTip", "lateralBud", "stemNode", "leaf", "fruit"]>, Schema.Trimmed>;
|
|
272
|
+
readonly view: Schema.Trimmed;
|
|
273
|
+
}>;
|
|
274
|
+
}>, "figure">;
|
|
275
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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 NonNegativeSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
|
|
6
|
+
const SliderSchema = Schema.Struct({
|
|
7
|
+
max: PositiveSchema,
|
|
8
|
+
min: NonNegativeSchema,
|
|
9
|
+
value: NonNegativeSchema,
|
|
10
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
11
|
+
message: "Expected a slider range whose minimum is below its maximum, with the starting value between them.",
|
|
12
|
+
}));
|
|
13
|
+
const HORMONES = [
|
|
14
|
+
"auxin",
|
|
15
|
+
"gibberellin",
|
|
16
|
+
"cytokinin",
|
|
17
|
+
"abscisicAcid",
|
|
18
|
+
"ethylene",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Props of `AuxinAgarBendLab`: a 3D decapitated coleoptile shoot carrying an
|
|
22
|
+
* off-centre auxin-infused agar block whose auxin concentration slider varies
|
|
23
|
+
* cell elongation across the two sides and bends the shoot in the dark.
|
|
24
|
+
* Bending angle and elongation readout are optional answer state.
|
|
25
|
+
*/
|
|
26
|
+
function auxinAgarBendLab(rich) {
|
|
27
|
+
return figure(Schema.Struct({
|
|
28
|
+
...cardFields(rich),
|
|
29
|
+
auxinLevel: SliderSchema,
|
|
30
|
+
labels: Schema.Struct({
|
|
31
|
+
angle: Schema.optionalKey(rich),
|
|
32
|
+
auxinLevel: TextSchema,
|
|
33
|
+
elongation: Schema.optionalKey(rich),
|
|
34
|
+
parts: byIds(["agarBlock", "coleoptile", "shadedSide", "litSide", "auxinDot"], TextSchema),
|
|
35
|
+
view: TextSchema,
|
|
36
|
+
}),
|
|
37
|
+
}), answerAt(["labels", "angle"], ["labels", "elongation"]));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props of `PhytohormoneActionLab`: a 3D whole-plant model showing how the
|
|
41
|
+
* five major phytohormones (auxin, gibberellin, cytokinin, abscisic acid,
|
|
42
|
+
* ethylene) regulate stem elongation, fruit ripening, bud growth, and stress
|
|
43
|
+
* dormancy, alongside farming applications. Natural effect and farming use
|
|
44
|
+
* readouts are optional answer state.
|
|
45
|
+
*/
|
|
46
|
+
function phytohormoneActionLab(rich) {
|
|
47
|
+
return figure(Schema.Struct({
|
|
48
|
+
...cardFields(rich),
|
|
49
|
+
hormones: Schema.NonEmptyArray(Schema.Literals(HORMONES)).check(Schema.isUnique()),
|
|
50
|
+
labels: Schema.Struct({
|
|
51
|
+
effect: Schema.optionalKey(rich),
|
|
52
|
+
farmUse: Schema.optionalKey(rich),
|
|
53
|
+
hormone: TextSchema,
|
|
54
|
+
hormones: byPickedIds(HORMONES, Schema.Struct({
|
|
55
|
+
effect: rich,
|
|
56
|
+
farmUse: rich,
|
|
57
|
+
name: TextSchema,
|
|
58
|
+
})),
|
|
59
|
+
parts: byIds(["shootTip", "lateralBud", "stemNode", "leaf", "fruit"], TextSchema),
|
|
60
|
+
view: TextSchema,
|
|
61
|
+
}),
|
|
62
|
+
}).check(Schema.makeFilter(({ hormones, labels }) => namesEach(hormones, labels.hormones), {
|
|
63
|
+
message: "Expected a name, effect, and farm-use note for every phytohormone shown, and no other.",
|
|
64
|
+
})), answerAt(["labels", "effect"], ["labels", "farmUse"]));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Plant response and phytohormone labs covering asymmetric auxin agar-block
|
|
68
|
+
* bending and the five core phytohormones in plant development and farming.
|
|
69
|
+
*/
|
|
70
|
+
export function phytohormoneVisuals(rich) {
|
|
71
|
+
return {
|
|
72
|
+
AuxinAgarBendLab: auxinAgarBendLab(rich),
|
|
73
|
+
PhytohormoneActionLab: phytohormoneActionLab(rich),
|
|
74
|
+
};
|
|
75
|
+
}
|