@nakafa/aksara-contracts 8.1.0 → 8.4.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/math/boundary.d.ts +9 -0
- package/dist/math/boundary.js +81 -0
- package/dist/math/curve.d.ts +1 -0
- package/dist/math/curve.js +4 -2
- package/dist/math/formula/affine.d.ts +22 -0
- package/dist/math/formula/affine.js +79 -0
- package/dist/math/formula/contour.js +27 -12
- package/dist/math/object.d.ts +12 -0
- package/dist/math/object.js +11 -0
- package/dist/math/plane.d.ts +10 -0
- package/dist/math/plane.js +7 -1
- package/dist/math/space.d.ts +8 -0
- package/dist/math/space.js +5 -1
- package/dist/math/visual.d.ts +239 -212
- package/dist/visual/base/math.d.ts +78 -0
- package/dist/visual/base/math.js +31 -3
- package/dist/visual/base/media.d.ts +67 -0
- package/dist/visual/biology/bacteria.d.ts +268 -0
- package/dist/visual/biology/cell.d.ts +201 -0
- package/dist/visual/biology/climate.d.ts +201 -0
- package/dist/visual/biology/ecology.d.ts +268 -0
- package/dist/visual/biology/physiology.d.ts +201 -0
- package/dist/visual/biology/plant.d.ts +335 -0
- package/dist/visual/biology.d.ts +16 -16
- package/dist/visual/biology.js +2 -2
- package/dist/visual/card.d.ts +79 -1
- package/dist/visual/card.js +18 -2
- package/dist/visual/catalog.d.ts +14808 -28
- package/dist/visual/catalog.js +26 -0
- package/dist/visual/chemistry/atom.d.ts +203 -2
- package/dist/visual/chemistry/atom.js +2 -2
- package/dist/visual/chemistry/balance.d.ts +335 -0
- package/dist/visual/chemistry/bonding.d.ts +335 -0
- package/dist/visual/chemistry/discovery.d.ts +469 -0
- package/dist/visual/chemistry/electrochemistry.d.ts +134 -0
- package/dist/visual/chemistry/electron.d.ts +134 -0
- package/dist/visual/chemistry/laws.d.ts +268 -0
- package/dist/visual/chemistry/particles.d.ts +335 -0
- package/dist/visual/chemistry/periodic.d.ts +134 -0
- package/dist/visual/chemistry/rate.d.ts +67 -0
- package/dist/visual/chemistry/reaction.d.ts +201 -0
- package/dist/visual/chemistry/titration.d.ts +67 -0
- package/dist/visual/length.d.ts +79 -0
- package/dist/visual/length.js +37 -0
- package/dist/visual/mathematics/chance.d.ts +258 -0
- package/dist/visual/mathematics/chance.js +117 -0
- package/dist/visual/mathematics/chart.d.ts +67 -0
- package/dist/visual/mathematics/charts.d.ts +335 -0
- package/dist/visual/mathematics/function.d.ts +205 -4
- package/dist/visual/mathematics/function.js +4 -4
- package/dist/visual/mathematics/geometry.d.ts +1 -1
- package/dist/visual/mathematics/geometry.js +1 -1
- package/dist/visual/mathematics/numeral.d.ts +170 -0
- package/dist/visual/mathematics/numeral.js +85 -0
- package/dist/visual/physics/braking.d.ts +268 -0
- package/dist/visual/physics/circuit.d.ts +343 -0
- package/dist/visual/physics/circuit.js +86 -0
- package/dist/visual/physics/circular.d.ts +134 -0
- package/dist/visual/physics/dynamics.d.ts +579 -0
- package/dist/visual/physics/dynamics.js +134 -0
- package/dist/visual/physics/efficiency.d.ts +402 -0
- package/dist/visual/physics/electronics.d.ts +260 -0
- package/dist/visual/physics/electronics.js +71 -0
- package/dist/visual/physics/falling.d.ts +268 -0
- package/dist/visual/physics/field.d.ts +249 -0
- package/dist/visual/physics/field.js +60 -0
- package/dist/visual/physics/fluid.d.ts +336 -0
- package/dist/visual/physics/fluid.js +83 -0
- package/dist/visual/physics/force.d.ts +335 -0
- package/dist/visual/physics/gravity.d.ts +172 -0
- package/dist/visual/physics/gravity.js +47 -0
- package/dist/visual/physics/heat.d.ts +255 -0
- package/dist/visual/physics/heat.js +66 -0
- package/dist/visual/physics/instrument.d.ts +469 -0
- package/dist/visual/physics/light.d.ts +343 -0
- package/dist/visual/physics/light.js +90 -0
- package/dist/visual/physics/measurement.d.ts +268 -0
- package/dist/visual/physics/motion.d.ts +402 -0
- package/dist/visual/physics/nuclear.d.ts +258 -0
- package/dist/visual/physics/nuclear.js +69 -0
- package/dist/visual/physics/parabolic.d.ts +69 -2
- package/dist/visual/physics/parabolic.js +2 -2
- package/dist/visual/physics/position.d.ts +402 -0
- package/dist/visual/physics/power.d.ts +536 -0
- package/dist/visual/physics/precision.d.ts +469 -0
- package/dist/visual/physics/product.d.ts +268 -0
- package/dist/visual/physics/reading.d.ts +253 -0
- package/dist/visual/physics/reading.js +61 -0
- package/dist/visual/physics/record.d.ts +134 -0
- package/dist/visual/physics/relative.d.ts +201 -0
- package/dist/visual/physics/solar.d.ts +402 -0
- package/dist/visual/physics/vector.d.ts +335 -0
- package/dist/visual/physics/velocity.d.ts +469 -0
- package/dist/visual/physics/wave.d.ts +338 -0
- package/dist/visual/physics/wave.js +85 -0
- package/dist/visual/politics.d.ts +403 -1
- package/dist/visual/politics.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** Props of `FloatingBlockLab`: a wooden block floats in a tank of water, then in a lighter liquid. */
|
|
5
|
+
function floatingBlockLab(rich) {
|
|
6
|
+
return figure(Schema.Struct({
|
|
7
|
+
...cardFields(rich),
|
|
8
|
+
density: Schema.Finite,
|
|
9
|
+
labels: Schema.Struct({
|
|
10
|
+
above: rich,
|
|
11
|
+
liquid: TextSchema,
|
|
12
|
+
liquids: byIds(["water", "other"], rich),
|
|
13
|
+
under: rich,
|
|
14
|
+
viewLabel: TextSchema,
|
|
15
|
+
}),
|
|
16
|
+
underWater: Schema.Finite,
|
|
17
|
+
volume: Schema.Finite,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
/** Props of `HydraulicJackLab`: a hydraulic jack in section, each cylinder drawn as wide as its piston. */
|
|
21
|
+
function hydraulicJackLab(rich) {
|
|
22
|
+
return figure(Schema.Struct({
|
|
23
|
+
...cardFields(rich),
|
|
24
|
+
force: Schema.Finite,
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
force: rich,
|
|
27
|
+
forceName: TextSchema,
|
|
28
|
+
lifted: rich,
|
|
29
|
+
mass: rich,
|
|
30
|
+
pressure: rich,
|
|
31
|
+
rise: rich,
|
|
32
|
+
viewLabel: TextSchema,
|
|
33
|
+
}),
|
|
34
|
+
largeArea: Schema.Finite,
|
|
35
|
+
smallArea: Schema.Finite,
|
|
36
|
+
stroke: Schema.Finite,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
/** Props of `ManometerLab`: a U-tube manometer with one arm on a gas supply and the other open to the air. */
|
|
40
|
+
function manometerLab(rich) {
|
|
41
|
+
return figure(Schema.Struct({
|
|
42
|
+
...cardFields(rich),
|
|
43
|
+
atmosphere: Schema.Finite,
|
|
44
|
+
difference: Schema.Finite,
|
|
45
|
+
labels: Schema.Struct({
|
|
46
|
+
difference: rich,
|
|
47
|
+
differenceName: TextSchema,
|
|
48
|
+
excess: rich,
|
|
49
|
+
gas: rich,
|
|
50
|
+
viewLabel: TextSchema,
|
|
51
|
+
}),
|
|
52
|
+
liquidDensity: Schema.Finite,
|
|
53
|
+
referenceDensity: Schema.Finite,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
/** Props of `VenturiTubeLab`: water flows steadily through a horizontal pipe that narrows halfway, with an open tube above each section. */
|
|
57
|
+
function venturiTubeLab(rich) {
|
|
58
|
+
return figure(Schema.Struct({
|
|
59
|
+
...cardFields(rich),
|
|
60
|
+
labels: Schema.Struct({
|
|
61
|
+
drop: rich,
|
|
62
|
+
faster: rich,
|
|
63
|
+
speed: rich,
|
|
64
|
+
speedName: TextSchema,
|
|
65
|
+
viewLabel: TextSchema,
|
|
66
|
+
}),
|
|
67
|
+
narrow: Schema.Finite,
|
|
68
|
+
speed: Schema.Finite,
|
|
69
|
+
wide: Schema.Finite,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The props of the fluid pressure labs. Each prop is a value from the item the lab
|
|
74
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
75
|
+
*/
|
|
76
|
+
export function fluidVisuals(rich) {
|
|
77
|
+
return {
|
|
78
|
+
FloatingBlockLab: floatingBlockLab(rich),
|
|
79
|
+
HydraulicJackLab: hydraulicJackLab(rich),
|
|
80
|
+
ManometerLab: manometerLab(rich),
|
|
81
|
+
VenturiTubeLab: venturiTubeLab(rich),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -7,6 +7,73 @@ import { type RichSlot } from "#contracts/visual/card";
|
|
|
7
7
|
export declare function forceVisuals<E>(rich: RichSlot<E>): {
|
|
8
8
|
ForceTableResultantLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
9
|
readonly description: RichSlot<E>;
|
|
10
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly latex: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "mathInline";
|
|
15
|
+
} | {
|
|
16
|
+
readonly marks?: readonly [{
|
|
17
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
18
|
+
} | {
|
|
19
|
+
readonly attrs: {
|
|
20
|
+
readonly href: string;
|
|
21
|
+
};
|
|
22
|
+
readonly type: "link";
|
|
23
|
+
} | {
|
|
24
|
+
readonly attrs: {
|
|
25
|
+
readonly variant: "success" | "warning" | null;
|
|
26
|
+
};
|
|
27
|
+
readonly type: "highlight";
|
|
28
|
+
}, ...({
|
|
29
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
30
|
+
} | {
|
|
31
|
+
readonly attrs: {
|
|
32
|
+
readonly href: string;
|
|
33
|
+
};
|
|
34
|
+
readonly type: "link";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly variant: "success" | "warning" | null;
|
|
38
|
+
};
|
|
39
|
+
readonly type: "highlight";
|
|
40
|
+
})[]];
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly type: "text";
|
|
43
|
+
}, ...({
|
|
44
|
+
readonly attrs: {
|
|
45
|
+
readonly latex: string;
|
|
46
|
+
};
|
|
47
|
+
readonly type: "mathInline";
|
|
48
|
+
} | {
|
|
49
|
+
readonly marks?: readonly [{
|
|
50
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
51
|
+
} | {
|
|
52
|
+
readonly attrs: {
|
|
53
|
+
readonly href: string;
|
|
54
|
+
};
|
|
55
|
+
readonly type: "link";
|
|
56
|
+
} | {
|
|
57
|
+
readonly attrs: {
|
|
58
|
+
readonly variant: "success" | "warning" | null;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "highlight";
|
|
61
|
+
}, ...({
|
|
62
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
63
|
+
} | {
|
|
64
|
+
readonly attrs: {
|
|
65
|
+
readonly href: string;
|
|
66
|
+
};
|
|
67
|
+
readonly type: "link";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly variant: "success" | "warning" | null;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "highlight";
|
|
73
|
+
})[]];
|
|
74
|
+
readonly text: string;
|
|
75
|
+
readonly type: "text";
|
|
76
|
+
})[]], E, never, never>>;
|
|
10
77
|
readonly title: RichSlot<E>;
|
|
11
78
|
readonly labels: Schema.Struct<{
|
|
12
79
|
readonly angle: RichSlot<E>;
|
|
@@ -24,6 +91,73 @@ export declare function forceVisuals<E>(rich: RichSlot<E>): {
|
|
|
24
91
|
}>, "figure">;
|
|
25
92
|
TugOfWarForceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
26
93
|
readonly description: RichSlot<E>;
|
|
94
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
95
|
+
readonly attrs: {
|
|
96
|
+
readonly latex: string;
|
|
97
|
+
};
|
|
98
|
+
readonly type: "mathInline";
|
|
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 text: string;
|
|
126
|
+
readonly type: "text";
|
|
127
|
+
}, ...({
|
|
128
|
+
readonly attrs: {
|
|
129
|
+
readonly latex: string;
|
|
130
|
+
};
|
|
131
|
+
readonly type: "mathInline";
|
|
132
|
+
} | {
|
|
133
|
+
readonly marks?: readonly [{
|
|
134
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
135
|
+
} | {
|
|
136
|
+
readonly attrs: {
|
|
137
|
+
readonly href: string;
|
|
138
|
+
};
|
|
139
|
+
readonly type: "link";
|
|
140
|
+
} | {
|
|
141
|
+
readonly attrs: {
|
|
142
|
+
readonly variant: "success" | "warning" | null;
|
|
143
|
+
};
|
|
144
|
+
readonly type: "highlight";
|
|
145
|
+
}, ...({
|
|
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 text: string;
|
|
159
|
+
readonly type: "text";
|
|
160
|
+
})[]], E, never, never>>;
|
|
27
161
|
readonly title: RichSlot<E>;
|
|
28
162
|
readonly labels: Schema.Struct<{
|
|
29
163
|
readonly left: RichSlot<E>;
|
|
@@ -41,6 +175,73 @@ export declare function forceVisuals<E>(rich: RichSlot<E>): {
|
|
|
41
175
|
}>, "figure">;
|
|
42
176
|
TugboatResultantLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
43
177
|
readonly description: RichSlot<E>;
|
|
178
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
179
|
+
readonly attrs: {
|
|
180
|
+
readonly latex: string;
|
|
181
|
+
};
|
|
182
|
+
readonly type: "mathInline";
|
|
183
|
+
} | {
|
|
184
|
+
readonly marks?: readonly [{
|
|
185
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
186
|
+
} | {
|
|
187
|
+
readonly attrs: {
|
|
188
|
+
readonly href: string;
|
|
189
|
+
};
|
|
190
|
+
readonly type: "link";
|
|
191
|
+
} | {
|
|
192
|
+
readonly attrs: {
|
|
193
|
+
readonly variant: "success" | "warning" | null;
|
|
194
|
+
};
|
|
195
|
+
readonly type: "highlight";
|
|
196
|
+
}, ...({
|
|
197
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
198
|
+
} | {
|
|
199
|
+
readonly attrs: {
|
|
200
|
+
readonly href: string;
|
|
201
|
+
};
|
|
202
|
+
readonly type: "link";
|
|
203
|
+
} | {
|
|
204
|
+
readonly attrs: {
|
|
205
|
+
readonly variant: "success" | "warning" | null;
|
|
206
|
+
};
|
|
207
|
+
readonly type: "highlight";
|
|
208
|
+
})[]];
|
|
209
|
+
readonly text: string;
|
|
210
|
+
readonly type: "text";
|
|
211
|
+
}, ...({
|
|
212
|
+
readonly attrs: {
|
|
213
|
+
readonly latex: string;
|
|
214
|
+
};
|
|
215
|
+
readonly type: "mathInline";
|
|
216
|
+
} | {
|
|
217
|
+
readonly marks?: readonly [{
|
|
218
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
219
|
+
} | {
|
|
220
|
+
readonly attrs: {
|
|
221
|
+
readonly href: string;
|
|
222
|
+
};
|
|
223
|
+
readonly type: "link";
|
|
224
|
+
} | {
|
|
225
|
+
readonly attrs: {
|
|
226
|
+
readonly variant: "success" | "warning" | null;
|
|
227
|
+
};
|
|
228
|
+
readonly type: "highlight";
|
|
229
|
+
}, ...({
|
|
230
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
231
|
+
} | {
|
|
232
|
+
readonly attrs: {
|
|
233
|
+
readonly href: string;
|
|
234
|
+
};
|
|
235
|
+
readonly type: "link";
|
|
236
|
+
} | {
|
|
237
|
+
readonly attrs: {
|
|
238
|
+
readonly variant: "success" | "warning" | null;
|
|
239
|
+
};
|
|
240
|
+
readonly type: "highlight";
|
|
241
|
+
})[]];
|
|
242
|
+
readonly text: string;
|
|
243
|
+
readonly type: "text";
|
|
244
|
+
})[]], E, never, never>>;
|
|
44
245
|
readonly title: RichSlot<E>;
|
|
45
246
|
readonly between: Schema.Finite;
|
|
46
247
|
readonly first: Schema.Finite;
|
|
@@ -56,6 +257,73 @@ export declare function forceVisuals<E>(rich: RichSlot<E>): {
|
|
|
56
257
|
}>, "figure">;
|
|
57
258
|
RampBlockComponentLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
58
259
|
readonly description: RichSlot<E>;
|
|
260
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
261
|
+
readonly attrs: {
|
|
262
|
+
readonly latex: string;
|
|
263
|
+
};
|
|
264
|
+
readonly type: "mathInline";
|
|
265
|
+
} | {
|
|
266
|
+
readonly marks?: readonly [{
|
|
267
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
268
|
+
} | {
|
|
269
|
+
readonly attrs: {
|
|
270
|
+
readonly href: string;
|
|
271
|
+
};
|
|
272
|
+
readonly type: "link";
|
|
273
|
+
} | {
|
|
274
|
+
readonly attrs: {
|
|
275
|
+
readonly variant: "success" | "warning" | null;
|
|
276
|
+
};
|
|
277
|
+
readonly type: "highlight";
|
|
278
|
+
}, ...({
|
|
279
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
280
|
+
} | {
|
|
281
|
+
readonly attrs: {
|
|
282
|
+
readonly href: string;
|
|
283
|
+
};
|
|
284
|
+
readonly type: "link";
|
|
285
|
+
} | {
|
|
286
|
+
readonly attrs: {
|
|
287
|
+
readonly variant: "success" | "warning" | null;
|
|
288
|
+
};
|
|
289
|
+
readonly type: "highlight";
|
|
290
|
+
})[]];
|
|
291
|
+
readonly text: string;
|
|
292
|
+
readonly type: "text";
|
|
293
|
+
}, ...({
|
|
294
|
+
readonly attrs: {
|
|
295
|
+
readonly latex: string;
|
|
296
|
+
};
|
|
297
|
+
readonly type: "mathInline";
|
|
298
|
+
} | {
|
|
299
|
+
readonly marks?: readonly [{
|
|
300
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
301
|
+
} | {
|
|
302
|
+
readonly attrs: {
|
|
303
|
+
readonly href: string;
|
|
304
|
+
};
|
|
305
|
+
readonly type: "link";
|
|
306
|
+
} | {
|
|
307
|
+
readonly attrs: {
|
|
308
|
+
readonly variant: "success" | "warning" | null;
|
|
309
|
+
};
|
|
310
|
+
readonly type: "highlight";
|
|
311
|
+
}, ...({
|
|
312
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
313
|
+
} | {
|
|
314
|
+
readonly attrs: {
|
|
315
|
+
readonly href: string;
|
|
316
|
+
};
|
|
317
|
+
readonly type: "link";
|
|
318
|
+
} | {
|
|
319
|
+
readonly attrs: {
|
|
320
|
+
readonly variant: "success" | "warning" | null;
|
|
321
|
+
};
|
|
322
|
+
readonly type: "highlight";
|
|
323
|
+
})[]];
|
|
324
|
+
readonly text: string;
|
|
325
|
+
readonly type: "text";
|
|
326
|
+
})[]], E, never, never>>;
|
|
59
327
|
readonly title: RichSlot<E>;
|
|
60
328
|
readonly angle: Schema.Finite;
|
|
61
329
|
readonly distance: Schema.optionalKey<Schema.Finite>;
|
|
@@ -73,6 +341,73 @@ export declare function forceVisuals<E>(rich: RichSlot<E>): {
|
|
|
73
341
|
}>, "figure">;
|
|
74
342
|
KiteStringTensionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
75
343
|
readonly description: RichSlot<E>;
|
|
344
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
345
|
+
readonly attrs: {
|
|
346
|
+
readonly latex: string;
|
|
347
|
+
};
|
|
348
|
+
readonly type: "mathInline";
|
|
349
|
+
} | {
|
|
350
|
+
readonly marks?: readonly [{
|
|
351
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
352
|
+
} | {
|
|
353
|
+
readonly attrs: {
|
|
354
|
+
readonly href: string;
|
|
355
|
+
};
|
|
356
|
+
readonly type: "link";
|
|
357
|
+
} | {
|
|
358
|
+
readonly attrs: {
|
|
359
|
+
readonly variant: "success" | "warning" | null;
|
|
360
|
+
};
|
|
361
|
+
readonly type: "highlight";
|
|
362
|
+
}, ...({
|
|
363
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
364
|
+
} | {
|
|
365
|
+
readonly attrs: {
|
|
366
|
+
readonly href: string;
|
|
367
|
+
};
|
|
368
|
+
readonly type: "link";
|
|
369
|
+
} | {
|
|
370
|
+
readonly attrs: {
|
|
371
|
+
readonly variant: "success" | "warning" | null;
|
|
372
|
+
};
|
|
373
|
+
readonly type: "highlight";
|
|
374
|
+
})[]];
|
|
375
|
+
readonly text: string;
|
|
376
|
+
readonly type: "text";
|
|
377
|
+
}, ...({
|
|
378
|
+
readonly attrs: {
|
|
379
|
+
readonly latex: string;
|
|
380
|
+
};
|
|
381
|
+
readonly type: "mathInline";
|
|
382
|
+
} | {
|
|
383
|
+
readonly marks?: readonly [{
|
|
384
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
385
|
+
} | {
|
|
386
|
+
readonly attrs: {
|
|
387
|
+
readonly href: string;
|
|
388
|
+
};
|
|
389
|
+
readonly type: "link";
|
|
390
|
+
} | {
|
|
391
|
+
readonly attrs: {
|
|
392
|
+
readonly variant: "success" | "warning" | null;
|
|
393
|
+
};
|
|
394
|
+
readonly type: "highlight";
|
|
395
|
+
}, ...({
|
|
396
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
397
|
+
} | {
|
|
398
|
+
readonly attrs: {
|
|
399
|
+
readonly href: string;
|
|
400
|
+
};
|
|
401
|
+
readonly type: "link";
|
|
402
|
+
} | {
|
|
403
|
+
readonly attrs: {
|
|
404
|
+
readonly variant: "success" | "warning" | null;
|
|
405
|
+
};
|
|
406
|
+
readonly type: "highlight";
|
|
407
|
+
})[]];
|
|
408
|
+
readonly text: string;
|
|
409
|
+
readonly type: "text";
|
|
410
|
+
})[]], E, never, never>>;
|
|
76
411
|
readonly title: RichSlot<E>;
|
|
77
412
|
readonly angle: Schema.Finite;
|
|
78
413
|
readonly labels: Schema.Struct<{
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The props of the gravitation labs. Each prop is a value from the item the lab
|
|
5
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function gravityVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
OrbitRadiusLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly latex: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "mathInline";
|
|
15
|
+
} | {
|
|
16
|
+
readonly marks?: readonly [{
|
|
17
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
18
|
+
} | {
|
|
19
|
+
readonly attrs: {
|
|
20
|
+
readonly href: string;
|
|
21
|
+
};
|
|
22
|
+
readonly type: "link";
|
|
23
|
+
} | {
|
|
24
|
+
readonly attrs: {
|
|
25
|
+
readonly variant: "success" | "warning" | null;
|
|
26
|
+
};
|
|
27
|
+
readonly type: "highlight";
|
|
28
|
+
}, ...({
|
|
29
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
30
|
+
} | {
|
|
31
|
+
readonly attrs: {
|
|
32
|
+
readonly href: string;
|
|
33
|
+
};
|
|
34
|
+
readonly type: "link";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly variant: "success" | "warning" | null;
|
|
38
|
+
};
|
|
39
|
+
readonly type: "highlight";
|
|
40
|
+
})[]];
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly type: "text";
|
|
43
|
+
}, ...({
|
|
44
|
+
readonly attrs: {
|
|
45
|
+
readonly latex: string;
|
|
46
|
+
};
|
|
47
|
+
readonly type: "mathInline";
|
|
48
|
+
} | {
|
|
49
|
+
readonly marks?: readonly [{
|
|
50
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
51
|
+
} | {
|
|
52
|
+
readonly attrs: {
|
|
53
|
+
readonly href: string;
|
|
54
|
+
};
|
|
55
|
+
readonly type: "link";
|
|
56
|
+
} | {
|
|
57
|
+
readonly attrs: {
|
|
58
|
+
readonly variant: "success" | "warning" | null;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "highlight";
|
|
61
|
+
}, ...({
|
|
62
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
63
|
+
} | {
|
|
64
|
+
readonly attrs: {
|
|
65
|
+
readonly href: string;
|
|
66
|
+
};
|
|
67
|
+
readonly type: "link";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly variant: "success" | "warning" | null;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "highlight";
|
|
73
|
+
})[]];
|
|
74
|
+
readonly text: string;
|
|
75
|
+
readonly type: "text";
|
|
76
|
+
})[]], E, never, never>>;
|
|
77
|
+
readonly title: RichSlot<E>;
|
|
78
|
+
readonly knownHeight: Schema.Finite;
|
|
79
|
+
readonly knownPeriod: Schema.Finite;
|
|
80
|
+
readonly labels: Schema.Struct<{
|
|
81
|
+
readonly knownName: Schema.Trimmed;
|
|
82
|
+
readonly knownRadius: RichSlot<E>;
|
|
83
|
+
readonly otherName: Schema.Trimmed;
|
|
84
|
+
readonly otherPeriod: RichSlot<E>;
|
|
85
|
+
readonly otherRadius: RichSlot<E>;
|
|
86
|
+
readonly viewLabel: Schema.Trimmed;
|
|
87
|
+
}>;
|
|
88
|
+
readonly otherHeight: Schema.Finite;
|
|
89
|
+
}>, "figure">;
|
|
90
|
+
PlanetCompareLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
91
|
+
readonly description: RichSlot<E>;
|
|
92
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
93
|
+
readonly attrs: {
|
|
94
|
+
readonly latex: string;
|
|
95
|
+
};
|
|
96
|
+
readonly type: "mathInline";
|
|
97
|
+
} | {
|
|
98
|
+
readonly marks?: readonly [{
|
|
99
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
100
|
+
} | {
|
|
101
|
+
readonly attrs: {
|
|
102
|
+
readonly href: string;
|
|
103
|
+
};
|
|
104
|
+
readonly type: "link";
|
|
105
|
+
} | {
|
|
106
|
+
readonly attrs: {
|
|
107
|
+
readonly variant: "success" | "warning" | null;
|
|
108
|
+
};
|
|
109
|
+
readonly type: "highlight";
|
|
110
|
+
}, ...({
|
|
111
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
112
|
+
} | {
|
|
113
|
+
readonly attrs: {
|
|
114
|
+
readonly href: string;
|
|
115
|
+
};
|
|
116
|
+
readonly type: "link";
|
|
117
|
+
} | {
|
|
118
|
+
readonly attrs: {
|
|
119
|
+
readonly variant: "success" | "warning" | null;
|
|
120
|
+
};
|
|
121
|
+
readonly type: "highlight";
|
|
122
|
+
})[]];
|
|
123
|
+
readonly text: string;
|
|
124
|
+
readonly type: "text";
|
|
125
|
+
}, ...({
|
|
126
|
+
readonly attrs: {
|
|
127
|
+
readonly latex: string;
|
|
128
|
+
};
|
|
129
|
+
readonly type: "mathInline";
|
|
130
|
+
} | {
|
|
131
|
+
readonly marks?: readonly [{
|
|
132
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
133
|
+
} | {
|
|
134
|
+
readonly attrs: {
|
|
135
|
+
readonly href: string;
|
|
136
|
+
};
|
|
137
|
+
readonly type: "link";
|
|
138
|
+
} | {
|
|
139
|
+
readonly attrs: {
|
|
140
|
+
readonly variant: "success" | "warning" | null;
|
|
141
|
+
};
|
|
142
|
+
readonly type: "highlight";
|
|
143
|
+
}, ...({
|
|
144
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
145
|
+
} | {
|
|
146
|
+
readonly attrs: {
|
|
147
|
+
readonly href: string;
|
|
148
|
+
};
|
|
149
|
+
readonly type: "link";
|
|
150
|
+
} | {
|
|
151
|
+
readonly attrs: {
|
|
152
|
+
readonly variant: "success" | "warning" | null;
|
|
153
|
+
};
|
|
154
|
+
readonly type: "highlight";
|
|
155
|
+
})[]];
|
|
156
|
+
readonly text: string;
|
|
157
|
+
readonly type: "text";
|
|
158
|
+
})[]], E, never, never>>;
|
|
159
|
+
readonly title: RichSlot<E>;
|
|
160
|
+
readonly labels: Schema.Struct<{
|
|
161
|
+
readonly earthName: Schema.Trimmed;
|
|
162
|
+
readonly escape: RichSlot<E>;
|
|
163
|
+
readonly gravity: RichSlot<E>;
|
|
164
|
+
readonly orbit: RichSlot<E>;
|
|
165
|
+
readonly period: RichSlot<E>;
|
|
166
|
+
readonly planetName: Schema.Trimmed;
|
|
167
|
+
readonly viewLabel: Schema.Trimmed;
|
|
168
|
+
}>;
|
|
169
|
+
readonly mass: Schema.Finite;
|
|
170
|
+
readonly radius: Schema.Finite;
|
|
171
|
+
}>, "figure">;
|
|
172
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** Props of `OrbitRadiusLab`: two satellites in circular orbits round the Earth, drawn to scale. */
|
|
5
|
+
function orbitRadiusLab(rich) {
|
|
6
|
+
return figure(Schema.Struct({
|
|
7
|
+
...cardFields(rich),
|
|
8
|
+
knownHeight: Schema.Finite,
|
|
9
|
+
knownPeriod: Schema.Finite,
|
|
10
|
+
labels: Schema.Struct({
|
|
11
|
+
knownName: TextSchema,
|
|
12
|
+
knownRadius: rich,
|
|
13
|
+
otherName: TextSchema,
|
|
14
|
+
otherPeriod: rich,
|
|
15
|
+
otherRadius: rich,
|
|
16
|
+
viewLabel: TextSchema,
|
|
17
|
+
}),
|
|
18
|
+
otherHeight: Schema.Finite,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** Props of `PlanetCompareLab`: the Earth and another planet side by side at the same scale, each with a satellite skimming its surface. */
|
|
22
|
+
function planetCompareLab(rich) {
|
|
23
|
+
return figure(Schema.Struct({
|
|
24
|
+
...cardFields(rich),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
earthName: TextSchema,
|
|
27
|
+
escape: rich,
|
|
28
|
+
gravity: rich,
|
|
29
|
+
orbit: rich,
|
|
30
|
+
period: rich,
|
|
31
|
+
planetName: TextSchema,
|
|
32
|
+
viewLabel: TextSchema,
|
|
33
|
+
}),
|
|
34
|
+
mass: Schema.Finite,
|
|
35
|
+
radius: Schema.Finite,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The props of the gravitation labs. Each prop is a value from the item the lab
|
|
40
|
+
* draws, never the conclusion it leads to, so none holds answer state.
|
|
41
|
+
*/
|
|
42
|
+
export function gravityVisuals(rich) {
|
|
43
|
+
return {
|
|
44
|
+
OrbitRadiusLab: orbitRadiusLab(rich),
|
|
45
|
+
PlanetCompareLab: planetCompareLab(rich),
|
|
46
|
+
};
|
|
47
|
+
}
|