@nakafa/aksara-contracts 6.0.0 → 6.2.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/assessment/figure.d.ts +567 -6
- package/dist/math/bounds.d.ts +3 -2
- package/dist/math/bounds.js +55 -9
- package/dist/math/curve.d.ts +64 -0
- package/dist/math/curve.js +83 -0
- package/dist/math/formula/box.d.ts +61 -0
- package/dist/math/formula/box.js +68 -0
- package/dist/math/formula/compile.d.ts +11 -0
- package/dist/math/formula/compile.js +100 -0
- package/dist/math/formula/contour.d.ts +17 -0
- package/dist/math/formula/contour.js +162 -0
- package/dist/math/formula/field.d.ts +42 -0
- package/dist/math/formula/field.js +54 -0
- package/dist/math/formula/mesh.d.ts +25 -0
- package/dist/math/formula/mesh.js +28 -0
- package/dist/math/formula/names.d.ts +4 -0
- package/dist/math/formula/names.js +23 -0
- package/dist/math/formula/parse.d.ts +10 -0
- package/dist/math/formula/parse.js +240 -0
- package/dist/math/formula/plane.d.ts +75 -0
- package/dist/math/formula/plane.js +121 -0
- package/dist/math/formula/reader.d.ts +102 -0
- package/dist/math/formula/reader.js +58 -0
- package/dist/math/formula/region.d.ts +16 -0
- package/dist/math/formula/region.js +94 -0
- package/dist/math/formula/sample.d.ts +14 -0
- package/dist/math/formula/sample.js +182 -0
- package/dist/math/formula/scope.d.ts +41 -0
- package/dist/math/formula/scope.js +151 -0
- package/dist/math/formula/slider.d.ts +9 -0
- package/dist/math/formula/slider.js +32 -0
- package/dist/math/formula/space.d.ts +10 -0
- package/dist/math/formula/space.js +94 -0
- package/dist/math/formula/syntax.d.ts +77 -0
- package/dist/math/formula/syntax.js +111 -0
- package/dist/math/formula/token.d.ts +43 -0
- package/dist/math/formula/token.js +150 -0
- package/dist/math/plane.d.ts +148 -5
- package/dist/math/plane.js +16 -4
- package/dist/math/scene.js +17 -4
- package/dist/math/solid.d.ts +124 -0
- package/dist/math/solid.js +86 -0
- package/dist/math/space.d.ts +214 -0
- package/dist/math/space.js +8 -2
- package/dist/math/visual.d.ts +545 -3
- package/dist/math/visual.js +12 -2
- package/package.json +57 -1
package/dist/math/space.d.ts
CHANGED
|
@@ -1,6 +1,109 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
/** Mathematical objects supported by a Cartesian space scene. */
|
|
3
3
|
export declare const SpaceMathObjectSchema: Schema.Union<readonly [Schema.Struct<{
|
|
4
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
5
|
+
readonly id: Schema.String;
|
|
6
|
+
readonly domain: Schema.optionalKey<Schema.Struct<{
|
|
7
|
+
readonly x: Schema.Struct<{
|
|
8
|
+
readonly max: Schema.Finite;
|
|
9
|
+
readonly min: Schema.Finite;
|
|
10
|
+
}>;
|
|
11
|
+
readonly y: Schema.Struct<{
|
|
12
|
+
readonly max: Schema.Finite;
|
|
13
|
+
readonly min: Schema.Finite;
|
|
14
|
+
}>;
|
|
15
|
+
}>>;
|
|
16
|
+
readonly formula: Schema.String;
|
|
17
|
+
readonly kind: Schema.Literal<"function">;
|
|
18
|
+
}>, Schema.Struct<{
|
|
19
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
20
|
+
readonly id: Schema.String;
|
|
21
|
+
readonly kind: Schema.Literal<"parametric">;
|
|
22
|
+
readonly parameter: Schema.Struct<{
|
|
23
|
+
readonly max: Schema.Finite;
|
|
24
|
+
readonly min: Schema.Finite;
|
|
25
|
+
}>;
|
|
26
|
+
readonly x: Schema.String;
|
|
27
|
+
readonly y: Schema.String;
|
|
28
|
+
readonly z: Schema.String;
|
|
29
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
31
|
+
readonly id: Schema.String;
|
|
32
|
+
readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
|
|
33
|
+
readonly x: Schema.Finite;
|
|
34
|
+
readonly y: Schema.Finite;
|
|
35
|
+
readonly z: Schema.Finite;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly x: Schema.Finite;
|
|
38
|
+
readonly y: Schema.Finite;
|
|
39
|
+
readonly z: Schema.Finite;
|
|
40
|
+
}>, Schema.Struct<{
|
|
41
|
+
readonly x: Schema.Finite;
|
|
42
|
+
readonly y: Schema.Finite;
|
|
43
|
+
readonly z: Schema.Finite;
|
|
44
|
+
}>]>, readonly [Schema.Struct<{
|
|
45
|
+
readonly x: Schema.Finite;
|
|
46
|
+
readonly y: Schema.Finite;
|
|
47
|
+
readonly z: Schema.Finite;
|
|
48
|
+
}>]>;
|
|
49
|
+
readonly kind: Schema.Literal<"prism">;
|
|
50
|
+
readonly offset: Schema.Struct<{
|
|
51
|
+
readonly x: Schema.Finite;
|
|
52
|
+
readonly y: Schema.Finite;
|
|
53
|
+
readonly z: Schema.Finite;
|
|
54
|
+
}>;
|
|
55
|
+
}>, Schema.Struct<{
|
|
56
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
57
|
+
readonly id: Schema.String;
|
|
58
|
+
readonly apex: Schema.Struct<{
|
|
59
|
+
readonly x: Schema.Finite;
|
|
60
|
+
readonly y: Schema.Finite;
|
|
61
|
+
readonly z: Schema.Finite;
|
|
62
|
+
}>;
|
|
63
|
+
readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
|
|
64
|
+
readonly x: Schema.Finite;
|
|
65
|
+
readonly y: Schema.Finite;
|
|
66
|
+
readonly z: Schema.Finite;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
readonly x: Schema.Finite;
|
|
69
|
+
readonly y: Schema.Finite;
|
|
70
|
+
readonly z: Schema.Finite;
|
|
71
|
+
}>, Schema.Struct<{
|
|
72
|
+
readonly x: Schema.Finite;
|
|
73
|
+
readonly y: Schema.Finite;
|
|
74
|
+
readonly z: Schema.Finite;
|
|
75
|
+
}>]>, readonly [Schema.Struct<{
|
|
76
|
+
readonly x: Schema.Finite;
|
|
77
|
+
readonly y: Schema.Finite;
|
|
78
|
+
readonly z: Schema.Finite;
|
|
79
|
+
}>]>;
|
|
80
|
+
readonly kind: Schema.Literal<"pyramid">;
|
|
81
|
+
}>, Schema.Struct<{
|
|
82
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
83
|
+
readonly id: Schema.String;
|
|
84
|
+
readonly axis: Schema.Literals<readonly ["x", "y", "z"]>;
|
|
85
|
+
readonly domain: Schema.Struct<{
|
|
86
|
+
readonly max: Schema.Finite;
|
|
87
|
+
readonly min: Schema.Finite;
|
|
88
|
+
}>;
|
|
89
|
+
readonly formula: Schema.String;
|
|
90
|
+
readonly kind: Schema.Literal<"revolution">;
|
|
91
|
+
}>, Schema.Struct<{
|
|
92
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
93
|
+
readonly id: Schema.String;
|
|
94
|
+
readonly kind: Schema.Literal<"surface">;
|
|
95
|
+
readonly u: Schema.Struct<{
|
|
96
|
+
readonly max: Schema.Finite;
|
|
97
|
+
readonly min: Schema.Finite;
|
|
98
|
+
}>;
|
|
99
|
+
readonly v: Schema.Struct<{
|
|
100
|
+
readonly max: Schema.Finite;
|
|
101
|
+
readonly min: Schema.Finite;
|
|
102
|
+
}>;
|
|
103
|
+
readonly x: Schema.String;
|
|
104
|
+
readonly y: Schema.String;
|
|
105
|
+
readonly z: Schema.String;
|
|
106
|
+
}>, Schema.Struct<{
|
|
4
107
|
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
5
108
|
readonly id: Schema.String;
|
|
6
109
|
readonly center: Schema.Struct<{
|
|
@@ -186,6 +289,109 @@ export declare const SpaceMathVisualSchema: Schema.Struct<{
|
|
|
186
289
|
readonly placement: Schema.optionalKey<Schema.Literals<readonly ["above", "above-left", "above-right", "below", "below-left", "below-right", "center", "left", "right"]>>;
|
|
187
290
|
}>>>;
|
|
188
291
|
readonly objects: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
292
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
293
|
+
readonly id: Schema.String;
|
|
294
|
+
readonly domain: Schema.optionalKey<Schema.Struct<{
|
|
295
|
+
readonly x: Schema.Struct<{
|
|
296
|
+
readonly max: Schema.Finite;
|
|
297
|
+
readonly min: Schema.Finite;
|
|
298
|
+
}>;
|
|
299
|
+
readonly y: Schema.Struct<{
|
|
300
|
+
readonly max: Schema.Finite;
|
|
301
|
+
readonly min: Schema.Finite;
|
|
302
|
+
}>;
|
|
303
|
+
}>>;
|
|
304
|
+
readonly formula: Schema.String;
|
|
305
|
+
readonly kind: Schema.Literal<"function">;
|
|
306
|
+
}>, Schema.Struct<{
|
|
307
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
308
|
+
readonly id: Schema.String;
|
|
309
|
+
readonly kind: Schema.Literal<"parametric">;
|
|
310
|
+
readonly parameter: Schema.Struct<{
|
|
311
|
+
readonly max: Schema.Finite;
|
|
312
|
+
readonly min: Schema.Finite;
|
|
313
|
+
}>;
|
|
314
|
+
readonly x: Schema.String;
|
|
315
|
+
readonly y: Schema.String;
|
|
316
|
+
readonly z: Schema.String;
|
|
317
|
+
}>, Schema.Struct<{
|
|
318
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
319
|
+
readonly id: Schema.String;
|
|
320
|
+
readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
|
|
321
|
+
readonly x: Schema.Finite;
|
|
322
|
+
readonly y: Schema.Finite;
|
|
323
|
+
readonly z: Schema.Finite;
|
|
324
|
+
}>, Schema.Struct<{
|
|
325
|
+
readonly x: Schema.Finite;
|
|
326
|
+
readonly y: Schema.Finite;
|
|
327
|
+
readonly z: Schema.Finite;
|
|
328
|
+
}>, Schema.Struct<{
|
|
329
|
+
readonly x: Schema.Finite;
|
|
330
|
+
readonly y: Schema.Finite;
|
|
331
|
+
readonly z: Schema.Finite;
|
|
332
|
+
}>]>, readonly [Schema.Struct<{
|
|
333
|
+
readonly x: Schema.Finite;
|
|
334
|
+
readonly y: Schema.Finite;
|
|
335
|
+
readonly z: Schema.Finite;
|
|
336
|
+
}>]>;
|
|
337
|
+
readonly kind: Schema.Literal<"prism">;
|
|
338
|
+
readonly offset: Schema.Struct<{
|
|
339
|
+
readonly x: Schema.Finite;
|
|
340
|
+
readonly y: Schema.Finite;
|
|
341
|
+
readonly z: Schema.Finite;
|
|
342
|
+
}>;
|
|
343
|
+
}>, Schema.Struct<{
|
|
344
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
345
|
+
readonly id: Schema.String;
|
|
346
|
+
readonly apex: Schema.Struct<{
|
|
347
|
+
readonly x: Schema.Finite;
|
|
348
|
+
readonly y: Schema.Finite;
|
|
349
|
+
readonly z: Schema.Finite;
|
|
350
|
+
}>;
|
|
351
|
+
readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
|
|
352
|
+
readonly x: Schema.Finite;
|
|
353
|
+
readonly y: Schema.Finite;
|
|
354
|
+
readonly z: Schema.Finite;
|
|
355
|
+
}>, Schema.Struct<{
|
|
356
|
+
readonly x: Schema.Finite;
|
|
357
|
+
readonly y: Schema.Finite;
|
|
358
|
+
readonly z: Schema.Finite;
|
|
359
|
+
}>, Schema.Struct<{
|
|
360
|
+
readonly x: Schema.Finite;
|
|
361
|
+
readonly y: Schema.Finite;
|
|
362
|
+
readonly z: Schema.Finite;
|
|
363
|
+
}>]>, readonly [Schema.Struct<{
|
|
364
|
+
readonly x: Schema.Finite;
|
|
365
|
+
readonly y: Schema.Finite;
|
|
366
|
+
readonly z: Schema.Finite;
|
|
367
|
+
}>]>;
|
|
368
|
+
readonly kind: Schema.Literal<"pyramid">;
|
|
369
|
+
}>, Schema.Struct<{
|
|
370
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
371
|
+
readonly id: Schema.String;
|
|
372
|
+
readonly axis: Schema.Literals<readonly ["x", "y", "z"]>;
|
|
373
|
+
readonly domain: Schema.Struct<{
|
|
374
|
+
readonly max: Schema.Finite;
|
|
375
|
+
readonly min: Schema.Finite;
|
|
376
|
+
}>;
|
|
377
|
+
readonly formula: Schema.String;
|
|
378
|
+
readonly kind: Schema.Literal<"revolution">;
|
|
379
|
+
}>, Schema.Struct<{
|
|
380
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
381
|
+
readonly id: Schema.String;
|
|
382
|
+
readonly kind: Schema.Literal<"surface">;
|
|
383
|
+
readonly u: Schema.Struct<{
|
|
384
|
+
readonly max: Schema.Finite;
|
|
385
|
+
readonly min: Schema.Finite;
|
|
386
|
+
}>;
|
|
387
|
+
readonly v: Schema.Struct<{
|
|
388
|
+
readonly max: Schema.Finite;
|
|
389
|
+
readonly min: Schema.Finite;
|
|
390
|
+
}>;
|
|
391
|
+
readonly x: Schema.String;
|
|
392
|
+
readonly y: Schema.String;
|
|
393
|
+
readonly z: Schema.String;
|
|
394
|
+
}>, Schema.Struct<{
|
|
189
395
|
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
190
396
|
readonly id: Schema.String;
|
|
191
397
|
readonly center: Schema.Struct<{
|
|
@@ -288,6 +494,14 @@ export declare const SpaceMathVisualSchema: Schema.Struct<{
|
|
|
288
494
|
readonly z: Schema.Finite;
|
|
289
495
|
}>;
|
|
290
496
|
}>]>>;
|
|
497
|
+
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
498
|
+
readonly label: Schema.optionalKey<Schema.String>;
|
|
499
|
+
readonly max: Schema.Finite;
|
|
500
|
+
readonly min: Schema.Finite;
|
|
501
|
+
readonly name: Schema.String;
|
|
502
|
+
readonly step: Schema.optionalKey<Schema.Finite>;
|
|
503
|
+
readonly value: Schema.Finite;
|
|
504
|
+
}>>>;
|
|
291
505
|
readonly space: Schema.Literal<"space">;
|
|
292
506
|
readonly view: Schema.Union<readonly [Schema.Struct<{
|
|
293
507
|
readonly kind: Schema.Literal<"camera">;
|
package/dist/math/space.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { hasUniquePositions, MathAxisRangeSchema, MathViewPaddingSchema, mathVisualIdentityIssues, PositiveMeasureSchema, SpacePointSchema, sameSpacePoint, } from "#contracts/math/base";
|
|
3
3
|
import { spaceBoundsIssues } from "#contracts/math/bounds";
|
|
4
|
+
import { FormulaParameterSchema } from "#contracts/math/formula/field";
|
|
5
|
+
import { formulaScopeIssues, parameterScope, spaceFormulaFields, } from "#contracts/math/formula/scope";
|
|
4
6
|
import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
|
|
5
7
|
import { spaceResolutionIssues } from "#contracts/math/resolution";
|
|
8
|
+
import { SpaceSolidObjectSchemas } from "#contracts/math/solid";
|
|
6
9
|
import { hasCoplanarArea } from "#contracts/math/vector";
|
|
7
10
|
const SpacePointObjectSchema = Schema.Struct({
|
|
8
11
|
...MathObjectFields,
|
|
@@ -62,6 +65,7 @@ const SpaceCuboidObjectSchema = Schema.Struct({
|
|
|
62
65
|
});
|
|
63
66
|
/** Mathematical objects supported by a Cartesian space scene. */
|
|
64
67
|
export const SpaceMathObjectSchema = Schema.Union([
|
|
68
|
+
...SpaceSolidObjectSchemas,
|
|
65
69
|
SpaceCuboidObjectSchema,
|
|
66
70
|
SpaceLineObjectSchema,
|
|
67
71
|
SpacePointObjectSchema,
|
|
@@ -103,10 +107,12 @@ export const SpaceMathVisualSchema = Schema.Struct({
|
|
|
103
107
|
frame: SpaceMathFrameSchema,
|
|
104
108
|
labels: Schema.optionalKey(Schema.Array(SpaceLabelAnchorSchema)),
|
|
105
109
|
objects: Schema.NonEmptyArray(SpaceMathObjectSchema),
|
|
110
|
+
parameters: Schema.optionalKey(Schema.Array(FormulaParameterSchema)),
|
|
106
111
|
space: Schema.Literal("space"),
|
|
107
112
|
view: SpaceMathViewSchema,
|
|
108
|
-
}).pipe(Schema.check(Schema.makeFilter(({ frame, labels = [], objects, view }) => [
|
|
113
|
+
}).pipe(Schema.check(Schema.makeFilter(({ frame, labels = [], objects, parameters = [], view }) => [
|
|
109
114
|
...mathVisualIdentityIssues(objects, labels),
|
|
110
|
-
...
|
|
115
|
+
...formulaScopeIssues(objects, spaceFormulaFields, parameters),
|
|
116
|
+
...spaceBoundsIssues(frame, objects, labels, view, parameterScope(parameters)),
|
|
111
117
|
...spaceResolutionIssues(frame, objects, labels, view),
|
|
112
118
|
])));
|