@nakafa/aksara-contracts 6.2.0 → 6.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/assessment/figure.d.ts +78 -0
- package/dist/math/bounds.js +2 -2
- package/dist/math/object.d.ts +2 -0
- package/dist/math/object.js +2 -0
- package/dist/math/plane.d.ts +24 -0
- package/dist/math/plane.js +14 -1
- package/dist/math/scene.js +1 -1
- package/dist/math/space.d.ts +28 -0
- package/dist/math/space.js +14 -1
- package/dist/math/visual.d.ts +78 -0
- package/dist/program/curriculum.d.ts +5 -1
- package/dist/program/curriculum.js +8 -10
- package/dist/projection/material.d.ts +1 -1
- package/dist/projection/material.js +12 -7
- package/dist/quran/provenance.js +11 -10
- package/package.json +1 -1
|
@@ -256,6 +256,18 @@ export declare const MathVisualPropsSchema: Schema.Struct<{
|
|
|
256
256
|
readonly x: Schema.Finite;
|
|
257
257
|
readonly y: Schema.Finite;
|
|
258
258
|
}>;
|
|
259
|
+
}>, Schema.Struct<{
|
|
260
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
261
|
+
readonly id: Schema.String;
|
|
262
|
+
readonly from: Schema.Struct<{
|
|
263
|
+
readonly x: Schema.Finite;
|
|
264
|
+
readonly y: Schema.Finite;
|
|
265
|
+
}>;
|
|
266
|
+
readonly kind: Schema.Literal<"vector">;
|
|
267
|
+
readonly to: Schema.Struct<{
|
|
268
|
+
readonly x: Schema.Finite;
|
|
269
|
+
readonly y: Schema.Finite;
|
|
270
|
+
}>;
|
|
259
271
|
}>]>>;
|
|
260
272
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
261
273
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -505,6 +517,20 @@ export declare const MathVisualPropsSchema: Schema.Struct<{
|
|
|
505
517
|
readonly y: Schema.Finite;
|
|
506
518
|
readonly z: Schema.Finite;
|
|
507
519
|
}>;
|
|
520
|
+
}>, Schema.Struct<{
|
|
521
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
522
|
+
readonly id: Schema.String;
|
|
523
|
+
readonly from: Schema.Struct<{
|
|
524
|
+
readonly x: Schema.Finite;
|
|
525
|
+
readonly y: Schema.Finite;
|
|
526
|
+
readonly z: Schema.Finite;
|
|
527
|
+
}>;
|
|
528
|
+
readonly kind: Schema.Literal<"vector">;
|
|
529
|
+
readonly to: Schema.Struct<{
|
|
530
|
+
readonly x: Schema.Finite;
|
|
531
|
+
readonly y: Schema.Finite;
|
|
532
|
+
readonly z: Schema.Finite;
|
|
533
|
+
}>;
|
|
508
534
|
}>]>>;
|
|
509
535
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
510
536
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -1113,6 +1139,18 @@ export declare const FigureAttrsSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
1113
1139
|
readonly x: Schema.Finite;
|
|
1114
1140
|
readonly y: Schema.Finite;
|
|
1115
1141
|
}>;
|
|
1142
|
+
}>, Schema.Struct<{
|
|
1143
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
1144
|
+
readonly id: Schema.String;
|
|
1145
|
+
readonly from: Schema.Struct<{
|
|
1146
|
+
readonly x: Schema.Finite;
|
|
1147
|
+
readonly y: Schema.Finite;
|
|
1148
|
+
}>;
|
|
1149
|
+
readonly kind: Schema.Literal<"vector">;
|
|
1150
|
+
readonly to: Schema.Struct<{
|
|
1151
|
+
readonly x: Schema.Finite;
|
|
1152
|
+
readonly y: Schema.Finite;
|
|
1153
|
+
}>;
|
|
1116
1154
|
}>]>>;
|
|
1117
1155
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1118
1156
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -1362,6 +1400,20 @@ export declare const FigureAttrsSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
1362
1400
|
readonly y: Schema.Finite;
|
|
1363
1401
|
readonly z: Schema.Finite;
|
|
1364
1402
|
}>;
|
|
1403
|
+
}>, Schema.Struct<{
|
|
1404
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
1405
|
+
readonly id: Schema.String;
|
|
1406
|
+
readonly from: Schema.Struct<{
|
|
1407
|
+
readonly x: Schema.Finite;
|
|
1408
|
+
readonly y: Schema.Finite;
|
|
1409
|
+
readonly z: Schema.Finite;
|
|
1410
|
+
}>;
|
|
1411
|
+
readonly kind: Schema.Literal<"vector">;
|
|
1412
|
+
readonly to: Schema.Struct<{
|
|
1413
|
+
readonly x: Schema.Finite;
|
|
1414
|
+
readonly y: Schema.Finite;
|
|
1415
|
+
readonly z: Schema.Finite;
|
|
1416
|
+
}>;
|
|
1365
1417
|
}>]>>;
|
|
1366
1418
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1367
1419
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -2041,6 +2093,18 @@ export declare const FigureNodeSchema: Schema.Struct<{
|
|
|
2041
2093
|
readonly x: Schema.Finite;
|
|
2042
2094
|
readonly y: Schema.Finite;
|
|
2043
2095
|
}>;
|
|
2096
|
+
}>, Schema.Struct<{
|
|
2097
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
2098
|
+
readonly id: Schema.String;
|
|
2099
|
+
readonly from: Schema.Struct<{
|
|
2100
|
+
readonly x: Schema.Finite;
|
|
2101
|
+
readonly y: Schema.Finite;
|
|
2102
|
+
}>;
|
|
2103
|
+
readonly kind: Schema.Literal<"vector">;
|
|
2104
|
+
readonly to: Schema.Struct<{
|
|
2105
|
+
readonly x: Schema.Finite;
|
|
2106
|
+
readonly y: Schema.Finite;
|
|
2107
|
+
}>;
|
|
2044
2108
|
}>]>>;
|
|
2045
2109
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
2046
2110
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -2290,6 +2354,20 @@ export declare const FigureNodeSchema: Schema.Struct<{
|
|
|
2290
2354
|
readonly y: Schema.Finite;
|
|
2291
2355
|
readonly z: Schema.Finite;
|
|
2292
2356
|
}>;
|
|
2357
|
+
}>, Schema.Struct<{
|
|
2358
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
2359
|
+
readonly id: Schema.String;
|
|
2360
|
+
readonly from: Schema.Struct<{
|
|
2361
|
+
readonly x: Schema.Finite;
|
|
2362
|
+
readonly y: Schema.Finite;
|
|
2363
|
+
readonly z: Schema.Finite;
|
|
2364
|
+
}>;
|
|
2365
|
+
readonly kind: Schema.Literal<"vector">;
|
|
2366
|
+
readonly to: Schema.Struct<{
|
|
2367
|
+
readonly x: Schema.Finite;
|
|
2368
|
+
readonly y: Schema.Finite;
|
|
2369
|
+
readonly z: Schema.Finite;
|
|
2370
|
+
}>;
|
|
2293
2371
|
}>]>>;
|
|
2294
2372
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
2295
2373
|
readonly label: Schema.optionalKey<Schema.String>;
|
package/dist/math/bounds.js
CHANGED
|
@@ -68,7 +68,7 @@ function planeObjectContained(frame, object, scope, labels) {
|
|
|
68
68
|
if (object.kind === "point") {
|
|
69
69
|
return planeContains(frame, object.at);
|
|
70
70
|
}
|
|
71
|
-
if (object.kind === "segment") {
|
|
71
|
+
if (object.kind === "segment" || object.kind === "vector") {
|
|
72
72
|
return Arr.every([object.from, object.to], (point) => planeContains(frame, point));
|
|
73
73
|
}
|
|
74
74
|
if (object.kind === "polyline" || object.kind === "polygon") {
|
|
@@ -102,7 +102,7 @@ function spaceObjectContained(frame, object, scope) {
|
|
|
102
102
|
if (object.kind === "point") {
|
|
103
103
|
return spaceContains(frame, object.at);
|
|
104
104
|
}
|
|
105
|
-
if (object.kind === "segment") {
|
|
105
|
+
if (object.kind === "segment" || object.kind === "vector") {
|
|
106
106
|
return Arr.every([object.from, object.to], (point) => spaceContains(frame, point));
|
|
107
107
|
}
|
|
108
108
|
if (object.kind === "polyline" || object.kind === "polygon") {
|
package/dist/math/object.d.ts
CHANGED
|
@@ -22,3 +22,5 @@ export declare const MATH_POLYLINE_MESSAGE = "Expected unique polyline vertices.
|
|
|
22
22
|
export declare const MATH_RAY_MESSAGE = "Expected a ray through a position distinct from its start.";
|
|
23
23
|
/** Message for a segment whose two ends coincide. */
|
|
24
24
|
export declare const MATH_SEGMENT_MESSAGE = "Expected a segment with distinct ends.";
|
|
25
|
+
/** Message for a vector whose tail and head coincide. */
|
|
26
|
+
export declare const MATH_VECTOR_MESSAGE = "Expected a vector with distinct tail and head.";
|
package/dist/math/object.js
CHANGED
|
@@ -25,3 +25,5 @@ export const MATH_POLYLINE_MESSAGE = "Expected unique polyline vertices.";
|
|
|
25
25
|
export const MATH_RAY_MESSAGE = "Expected a ray through a position distinct from its start.";
|
|
26
26
|
/** Message for a segment whose two ends coincide. */
|
|
27
27
|
export const MATH_SEGMENT_MESSAGE = "Expected a segment with distinct ends.";
|
|
28
|
+
/** Message for a vector whose tail and head coincide. */
|
|
29
|
+
export const MATH_VECTOR_MESSAGE = "Expected a vector with distinct tail and head.";
|
package/dist/math/plane.d.ts
CHANGED
|
@@ -169,6 +169,18 @@ export declare const PlaneMathObjectSchema: Schema.Union<readonly [Schema.Struct
|
|
|
169
169
|
readonly x: Schema.Finite;
|
|
170
170
|
readonly y: Schema.Finite;
|
|
171
171
|
}>;
|
|
172
|
+
}>, Schema.Struct<{
|
|
173
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
174
|
+
readonly id: Schema.String;
|
|
175
|
+
readonly from: Schema.Struct<{
|
|
176
|
+
readonly x: Schema.Finite;
|
|
177
|
+
readonly y: Schema.Finite;
|
|
178
|
+
}>;
|
|
179
|
+
readonly kind: Schema.Literal<"vector">;
|
|
180
|
+
readonly to: Schema.Struct<{
|
|
181
|
+
readonly x: Schema.Finite;
|
|
182
|
+
readonly y: Schema.Finite;
|
|
183
|
+
}>;
|
|
172
184
|
}>]>;
|
|
173
185
|
export type PlaneMathObject = typeof PlaneMathObjectSchema.Type;
|
|
174
186
|
/** Exact Cartesian frame presented behind a plane construction. */
|
|
@@ -401,6 +413,18 @@ export declare const PlaneMathVisualSchema: Schema.Struct<{
|
|
|
401
413
|
readonly x: Schema.Finite;
|
|
402
414
|
readonly y: Schema.Finite;
|
|
403
415
|
}>;
|
|
416
|
+
}>, Schema.Struct<{
|
|
417
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
418
|
+
readonly id: Schema.String;
|
|
419
|
+
readonly from: Schema.Struct<{
|
|
420
|
+
readonly x: Schema.Finite;
|
|
421
|
+
readonly y: Schema.Finite;
|
|
422
|
+
}>;
|
|
423
|
+
readonly kind: Schema.Literal<"vector">;
|
|
424
|
+
readonly to: Schema.Struct<{
|
|
425
|
+
readonly x: Schema.Finite;
|
|
426
|
+
readonly y: Schema.Finite;
|
|
427
|
+
}>;
|
|
404
428
|
}>]>>;
|
|
405
429
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
406
430
|
readonly label: Schema.optionalKey<Schema.String>;
|
package/dist/math/plane.js
CHANGED
|
@@ -5,7 +5,7 @@ import { PlaneCurveObjectSchemas } from "#contracts/math/curve";
|
|
|
5
5
|
import { FormulaParameterSchema, FormulaReadoutSchema, PlaneFormulaPointSchema, } from "#contracts/math/formula/field";
|
|
6
6
|
import { formulaScopeIssues, parameterScope, planeFormulaFields, } from "#contracts/math/formula/scope";
|
|
7
7
|
import { sliderFormulaIssues } from "#contracts/math/formula/slider";
|
|
8
|
-
import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
|
|
8
|
+
import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MATH_VECTOR_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
|
|
9
9
|
import { planeResolutionIssues } from "#contracts/math/resolution";
|
|
10
10
|
/** Checks a plane polygon has non-zero signed area. */
|
|
11
11
|
function hasPlaneArea(vertices) {
|
|
@@ -76,6 +76,18 @@ const PlaneSegmentObjectSchema = Schema.Struct({
|
|
|
76
76
|
}).pipe(Schema.check(Schema.makeFilter(({ from, to }) => !samePlanePoint(from, to), {
|
|
77
77
|
message: MATH_SEGMENT_MESSAGE,
|
|
78
78
|
})));
|
|
79
|
+
/**
|
|
80
|
+
* An arrow from its tail to its head, such as a displacement, a force, or a
|
|
81
|
+
* position vector: a segment that ends in an arrowhead.
|
|
82
|
+
*/
|
|
83
|
+
const PlaneVectorObjectSchema = Schema.Struct({
|
|
84
|
+
...MathObjectFields,
|
|
85
|
+
from: PlanePointSchema,
|
|
86
|
+
kind: Schema.Literal("vector"),
|
|
87
|
+
to: PlanePointSchema,
|
|
88
|
+
}).pipe(Schema.check(Schema.makeFilter(({ from, to }) => !samePlanePoint(from, to), {
|
|
89
|
+
message: MATH_VECTOR_MESSAGE,
|
|
90
|
+
})));
|
|
79
91
|
const PlanePolylineObjectSchema = Schema.Struct({
|
|
80
92
|
...MathObjectFields,
|
|
81
93
|
kind: Schema.Literal("polyline"),
|
|
@@ -125,6 +137,7 @@ export const PlaneMathObjectSchema = Schema.Union([
|
|
|
125
137
|
PlaneQuadraticObjectSchema,
|
|
126
138
|
PlaneRayObjectSchema,
|
|
127
139
|
PlaneSegmentObjectSchema,
|
|
140
|
+
PlaneVectorObjectSchema,
|
|
128
141
|
]);
|
|
129
142
|
/** Exact Cartesian frame presented behind a plane construction. */
|
|
130
143
|
export const PlaneMathFrameSchema = Schema.Struct({
|
package/dist/math/scene.js
CHANGED
|
@@ -64,7 +64,7 @@ function objectCoordinates(frame, object, index, threshold) {
|
|
|
64
64
|
if (object.kind === "ray") {
|
|
65
65
|
return clippedPathCoordinates(frame, "ray", object.from, object.through, root, threshold);
|
|
66
66
|
}
|
|
67
|
-
if (object.kind === "segment") {
|
|
67
|
+
if (object.kind === "segment" || object.kind === "vector") {
|
|
68
68
|
return [
|
|
69
69
|
...pointCoordinates(object.from, [...root, "from"]),
|
|
70
70
|
...pointCoordinates(object.to, [...root, "to"]),
|
package/dist/math/space.d.ts
CHANGED
|
@@ -205,6 +205,20 @@ export declare const SpaceMathObjectSchema: Schema.Union<readonly [Schema.Struct
|
|
|
205
205
|
readonly y: Schema.Finite;
|
|
206
206
|
readonly z: Schema.Finite;
|
|
207
207
|
}>;
|
|
208
|
+
}>, Schema.Struct<{
|
|
209
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
210
|
+
readonly id: Schema.String;
|
|
211
|
+
readonly from: Schema.Struct<{
|
|
212
|
+
readonly x: Schema.Finite;
|
|
213
|
+
readonly y: Schema.Finite;
|
|
214
|
+
readonly z: Schema.Finite;
|
|
215
|
+
}>;
|
|
216
|
+
readonly kind: Schema.Literal<"vector">;
|
|
217
|
+
readonly to: Schema.Struct<{
|
|
218
|
+
readonly x: Schema.Finite;
|
|
219
|
+
readonly y: Schema.Finite;
|
|
220
|
+
readonly z: Schema.Finite;
|
|
221
|
+
}>;
|
|
208
222
|
}>]>;
|
|
209
223
|
export type SpaceMathObject = typeof SpaceMathObjectSchema.Type;
|
|
210
224
|
/** Exact Cartesian frame presented behind a space construction. */
|
|
@@ -493,6 +507,20 @@ export declare const SpaceMathVisualSchema: Schema.Struct<{
|
|
|
493
507
|
readonly y: Schema.Finite;
|
|
494
508
|
readonly z: Schema.Finite;
|
|
495
509
|
}>;
|
|
510
|
+
}>, Schema.Struct<{
|
|
511
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
512
|
+
readonly id: Schema.String;
|
|
513
|
+
readonly from: Schema.Struct<{
|
|
514
|
+
readonly x: Schema.Finite;
|
|
515
|
+
readonly y: Schema.Finite;
|
|
516
|
+
readonly z: Schema.Finite;
|
|
517
|
+
}>;
|
|
518
|
+
readonly kind: Schema.Literal<"vector">;
|
|
519
|
+
readonly to: Schema.Struct<{
|
|
520
|
+
readonly x: Schema.Finite;
|
|
521
|
+
readonly y: Schema.Finite;
|
|
522
|
+
readonly z: Schema.Finite;
|
|
523
|
+
}>;
|
|
496
524
|
}>]>>;
|
|
497
525
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
498
526
|
readonly label: Schema.optionalKey<Schema.String>;
|
package/dist/math/space.js
CHANGED
|
@@ -3,7 +3,7 @@ import { hasUniquePositions, MathAxisRangeSchema, MathViewPaddingSchema, mathVis
|
|
|
3
3
|
import { spaceBoundsIssues } from "#contracts/math/bounds";
|
|
4
4
|
import { FormulaParameterSchema } from "#contracts/math/formula/field";
|
|
5
5
|
import { formulaScopeIssues, parameterScope, spaceFormulaFields, } from "#contracts/math/formula/scope";
|
|
6
|
-
import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
|
|
6
|
+
import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MATH_VECTOR_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
|
|
7
7
|
import { spaceResolutionIssues } from "#contracts/math/resolution";
|
|
8
8
|
import { SpaceSolidObjectSchemas } from "#contracts/math/solid";
|
|
9
9
|
import { hasCoplanarArea } from "#contracts/math/vector";
|
|
@@ -37,6 +37,18 @@ const SpaceSegmentObjectSchema = Schema.Struct({
|
|
|
37
37
|
}).pipe(Schema.check(Schema.makeFilter(({ from, to }) => !sameSpacePoint(from, to), {
|
|
38
38
|
message: MATH_SEGMENT_MESSAGE,
|
|
39
39
|
})));
|
|
40
|
+
/**
|
|
41
|
+
* An arrow from its tail to its head, such as a displacement, a force, or a
|
|
42
|
+
* position vector: a segment that ends in an arrowhead.
|
|
43
|
+
*/
|
|
44
|
+
const SpaceVectorObjectSchema = Schema.Struct({
|
|
45
|
+
...MathObjectFields,
|
|
46
|
+
from: SpacePointSchema,
|
|
47
|
+
kind: Schema.Literal("vector"),
|
|
48
|
+
to: SpacePointSchema,
|
|
49
|
+
}).pipe(Schema.check(Schema.makeFilter(({ from, to }) => !sameSpacePoint(from, to), {
|
|
50
|
+
message: MATH_VECTOR_MESSAGE,
|
|
51
|
+
})));
|
|
40
52
|
const SpacePolylineObjectSchema = Schema.Struct({
|
|
41
53
|
...MathObjectFields,
|
|
42
54
|
kind: Schema.Literal("polyline"),
|
|
@@ -73,6 +85,7 @@ export const SpaceMathObjectSchema = Schema.Union([
|
|
|
73
85
|
SpacePolylineObjectSchema,
|
|
74
86
|
SpaceRayObjectSchema,
|
|
75
87
|
SpaceSegmentObjectSchema,
|
|
88
|
+
SpaceVectorObjectSchema,
|
|
76
89
|
]);
|
|
77
90
|
/** Exact Cartesian frame presented behind a space construction. */
|
|
78
91
|
export const SpaceMathFrameSchema = Schema.Struct({
|
package/dist/math/visual.d.ts
CHANGED
|
@@ -193,6 +193,18 @@ export declare const MathVisualSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
193
193
|
readonly x: Schema.Finite;
|
|
194
194
|
readonly y: Schema.Finite;
|
|
195
195
|
}>;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
198
|
+
readonly id: Schema.String;
|
|
199
|
+
readonly from: Schema.Struct<{
|
|
200
|
+
readonly x: Schema.Finite;
|
|
201
|
+
readonly y: Schema.Finite;
|
|
202
|
+
}>;
|
|
203
|
+
readonly kind: Schema.Literal<"vector">;
|
|
204
|
+
readonly to: Schema.Struct<{
|
|
205
|
+
readonly x: Schema.Finite;
|
|
206
|
+
readonly y: Schema.Finite;
|
|
207
|
+
}>;
|
|
196
208
|
}>]>>;
|
|
197
209
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
198
210
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -442,6 +454,20 @@ export declare const MathVisualSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
442
454
|
readonly y: Schema.Finite;
|
|
443
455
|
readonly z: Schema.Finite;
|
|
444
456
|
}>;
|
|
457
|
+
}>, Schema.Struct<{
|
|
458
|
+
readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
|
|
459
|
+
readonly id: Schema.String;
|
|
460
|
+
readonly from: Schema.Struct<{
|
|
461
|
+
readonly x: Schema.Finite;
|
|
462
|
+
readonly y: Schema.Finite;
|
|
463
|
+
readonly z: Schema.Finite;
|
|
464
|
+
}>;
|
|
465
|
+
readonly kind: Schema.Literal<"vector">;
|
|
466
|
+
readonly to: Schema.Struct<{
|
|
467
|
+
readonly x: Schema.Finite;
|
|
468
|
+
readonly y: Schema.Finite;
|
|
469
|
+
readonly z: Schema.Finite;
|
|
470
|
+
}>;
|
|
445
471
|
}>]>>;
|
|
446
472
|
readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
447
473
|
readonly label: Schema.optionalKey<Schema.String>;
|
|
@@ -642,6 +668,20 @@ export declare const decodeMathVisual: (input: unknown) => Effect.Effect<{
|
|
|
642
668
|
readonly y: number;
|
|
643
669
|
readonly z: number;
|
|
644
670
|
};
|
|
671
|
+
} | {
|
|
672
|
+
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
673
|
+
readonly id: string;
|
|
674
|
+
readonly from: {
|
|
675
|
+
readonly x: number;
|
|
676
|
+
readonly y: number;
|
|
677
|
+
readonly z: number;
|
|
678
|
+
};
|
|
679
|
+
readonly kind: "vector";
|
|
680
|
+
readonly to: {
|
|
681
|
+
readonly x: number;
|
|
682
|
+
readonly y: number;
|
|
683
|
+
readonly z: number;
|
|
684
|
+
};
|
|
645
685
|
} | {
|
|
646
686
|
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
647
687
|
readonly id: string;
|
|
@@ -847,6 +887,20 @@ export declare const decodeMathVisual: (input: unknown) => Effect.Effect<{
|
|
|
847
887
|
readonly y: number;
|
|
848
888
|
readonly z: number;
|
|
849
889
|
};
|
|
890
|
+
} | {
|
|
891
|
+
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
892
|
+
readonly id: string;
|
|
893
|
+
readonly from: {
|
|
894
|
+
readonly x: number;
|
|
895
|
+
readonly y: number;
|
|
896
|
+
readonly z: number;
|
|
897
|
+
};
|
|
898
|
+
readonly kind: "vector";
|
|
899
|
+
readonly to: {
|
|
900
|
+
readonly x: number;
|
|
901
|
+
readonly y: number;
|
|
902
|
+
readonly z: number;
|
|
903
|
+
};
|
|
850
904
|
} | {
|
|
851
905
|
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
852
906
|
readonly id: string;
|
|
@@ -1065,6 +1119,18 @@ export declare const decodeMathVisual: (input: unknown) => Effect.Effect<{
|
|
|
1065
1119
|
readonly x: number;
|
|
1066
1120
|
readonly y: number;
|
|
1067
1121
|
};
|
|
1122
|
+
} | {
|
|
1123
|
+
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
1124
|
+
readonly id: string;
|
|
1125
|
+
readonly from: {
|
|
1126
|
+
readonly x: number;
|
|
1127
|
+
readonly y: number;
|
|
1128
|
+
};
|
|
1129
|
+
readonly kind: "vector";
|
|
1130
|
+
readonly to: {
|
|
1131
|
+
readonly x: number;
|
|
1132
|
+
readonly y: number;
|
|
1133
|
+
};
|
|
1068
1134
|
} | {
|
|
1069
1135
|
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
1070
1136
|
readonly id: string;
|
|
@@ -1234,6 +1300,18 @@ export declare const decodeMathVisual: (input: unknown) => Effect.Effect<{
|
|
|
1234
1300
|
readonly x: number;
|
|
1235
1301
|
readonly y: number;
|
|
1236
1302
|
};
|
|
1303
|
+
} | {
|
|
1304
|
+
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
1305
|
+
readonly id: string;
|
|
1306
|
+
readonly from: {
|
|
1307
|
+
readonly x: number;
|
|
1308
|
+
readonly y: number;
|
|
1309
|
+
};
|
|
1310
|
+
readonly kind: "vector";
|
|
1311
|
+
readonly to: {
|
|
1312
|
+
readonly x: number;
|
|
1313
|
+
readonly y: number;
|
|
1314
|
+
};
|
|
1237
1315
|
} | {
|
|
1238
1316
|
readonly appearance: "answer" | "construction" | "highlight" | "primary" | "reference" | "secondary" | "warning";
|
|
1239
1317
|
readonly id: string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { type AppLocale } from "#contracts/locale";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Localized public route namespaces shared by projection and verification. A
|
|
5
|
+
* declared locale fails to compile until it names its own namespace here.
|
|
6
|
+
*/
|
|
4
7
|
export declare const CURRICULUM_NAMESPACES: {
|
|
5
8
|
readonly de: "lehrplaene";
|
|
6
9
|
readonly en: "curriculum";
|
|
7
10
|
readonly id: "kurikulum";
|
|
11
|
+
readonly ms: "kurikulum";
|
|
8
12
|
};
|
|
9
13
|
/** Resolves the route namespace owned by one application locale. */
|
|
10
14
|
export declare function curriculumNamespace(appLocale: AppLocale): "curriculum" | "kurikulum" | "lehrplaene";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Array as Arr, Schema } from "effect";
|
|
2
2
|
import { CorpusSourcePathSchema, PublicPathSchema } from "#contracts/ids";
|
|
3
|
-
import { AppLocaleSchema } from "#contracts/locale";
|
|
3
|
+
import { AppLocaleSchema, } from "#contracts/locale";
|
|
4
4
|
import { MaterialDomainSchema } from "#contracts/material/domain";
|
|
5
5
|
import { LearningProgramKeySchema, ProgramNavigationIconKeySchema, ProgramNavigationLevelSchema, } from "#contracts/program/spec";
|
|
6
6
|
import { MaterialKeySchema } from "#contracts/projection/material";
|
|
@@ -10,6 +10,7 @@ const CurriculumNamespaceMapSchema = Schema.Struct({
|
|
|
10
10
|
de: Schema.Literal("lehrplaene"),
|
|
11
11
|
en: Schema.Literal("curriculum"),
|
|
12
12
|
id: Schema.Literal("kurikulum"),
|
|
13
|
+
ms: Schema.Literal("kurikulum"),
|
|
13
14
|
});
|
|
14
15
|
const RenderableCurriculumLevelSchema = Schema.Literals([
|
|
15
16
|
"class",
|
|
@@ -23,22 +24,19 @@ function isCurriculumRouteNodeKey(value) {
|
|
|
23
24
|
const rootSuffix = ":root";
|
|
24
25
|
return isLowerKebab(value.endsWith(rootSuffix) ? value.slice(0, -rootSuffix.length) : value);
|
|
25
26
|
}
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Localized public route namespaces shared by projection and verification. A
|
|
29
|
+
* declared locale fails to compile until it names its own namespace here.
|
|
30
|
+
*/
|
|
27
31
|
export const CURRICULUM_NAMESPACES = CurriculumNamespaceMapSchema.make({
|
|
28
32
|
de: "lehrplaene",
|
|
29
33
|
en: "curriculum",
|
|
30
34
|
id: "kurikulum",
|
|
35
|
+
ms: "kurikulum",
|
|
31
36
|
});
|
|
32
37
|
/** Resolves the route namespace owned by one application locale. */
|
|
33
38
|
export function curriculumNamespace(appLocale) {
|
|
34
|
-
|
|
35
|
-
if (localeCode === "de") {
|
|
36
|
-
return CURRICULUM_NAMESPACES.de;
|
|
37
|
-
}
|
|
38
|
-
if (localeCode === "id") {
|
|
39
|
-
return CURRICULUM_NAMESPACES.id;
|
|
40
|
-
}
|
|
41
|
-
return CURRICULUM_NAMESPACES.en;
|
|
39
|
+
return CURRICULUM_NAMESPACES[Schema.encodeSync(AppLocaleSchema)(appLocale)];
|
|
42
40
|
}
|
|
43
41
|
/** Checks whether one curriculum level owns a learner-renderable route. */
|
|
44
42
|
export const isRenderableCurriculumLevel = Schema.is(RenderableCurriculumLevelSchema);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { type AppLocale } from "#contracts/locale";
|
|
3
3
|
/** Locale-owned root namespace for public material routes. */
|
|
4
|
-
export declare const MaterialPublicNamespaceSchema: Schema.Literals<readonly ["subjects", "materi", "faecher"]>;
|
|
4
|
+
export declare const MaterialPublicNamespaceSchema: Schema.Literals<readonly ["subjects", "materi", "faecher", "subjek"]>;
|
|
5
5
|
export type MaterialPublicNamespace = typeof MaterialPublicNamespaceSchema.Type;
|
|
6
6
|
/** Resolves the only public material namespace owned by one app locale. */
|
|
7
7
|
export declare function materialPublicNamespace(appLocale: AppLocale): MaterialPublicNamespace;
|
|
@@ -17,16 +17,21 @@ export const MaterialPublicNamespaceSchema = Schema.Literals([
|
|
|
17
17
|
"subjects",
|
|
18
18
|
"materi",
|
|
19
19
|
"faecher",
|
|
20
|
+
"subjek",
|
|
20
21
|
]);
|
|
22
|
+
/**
|
|
23
|
+
* The public material namespace of every declared app locale. Declaring a
|
|
24
|
+
* locale fails to compile until it names its own namespace here.
|
|
25
|
+
*/
|
|
26
|
+
const MATERIAL_PUBLIC_NAMESPACES = {
|
|
27
|
+
de: "faecher",
|
|
28
|
+
en: "subjects",
|
|
29
|
+
id: "materi",
|
|
30
|
+
ms: "subjek",
|
|
31
|
+
};
|
|
21
32
|
/** Resolves the only public material namespace owned by one app locale. */
|
|
22
33
|
export function materialPublicNamespace(appLocale) {
|
|
23
|
-
|
|
24
|
-
return "subjects";
|
|
25
|
-
}
|
|
26
|
-
if (appLocale === AppLocaleSchema.make("id")) {
|
|
27
|
-
return "materi";
|
|
28
|
-
}
|
|
29
|
-
return "faecher";
|
|
34
|
+
return MATERIAL_PUBLIC_NAMESPACES[Schema.encodeSync(AppLocaleSchema)(appLocale)];
|
|
30
35
|
}
|
|
31
36
|
/** Stable reusable material identity preserved from Nakafa's source registry. */
|
|
32
37
|
export const MaterialKeySchema = Schema.String.pipe(Schema.check(Schema.isPattern(MATERIAL_KEY_PATTERN, {
|
package/dist/quran/provenance.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Array as Arr, Effect, MutableList, Schema } from "effect";
|
|
2
2
|
import { hashText } from "#contracts/hash/text";
|
|
3
3
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
4
|
-
import { ActiveAppLocaleListSchema,
|
|
4
|
+
import { ActiveAppLocaleListSchema, activeAppLocaleCode, ENGLISH_APP_LOCALE_CODE, GERMAN_APP_LOCALE_CODE, INDONESIAN_APP_LOCALE_CODE, } from "#contracts/locale";
|
|
5
5
|
import { canonicalizeQuranAttribution } from "#contracts/quran/attribution";
|
|
6
6
|
import { QuranNameProvenanceScopeSchema, QuranTranslationProvenanceScopeSchema, quranNameProvenanceScope, quranNameSourceForScope, quranTafsirSourceId, quranTranslationProvenanceScope, quranTranslationSourceForScope, } from "#contracts/quran/identity";
|
|
7
7
|
import { QuranProvenanceStatusSchema, } from "#contracts/quran/snapshot/spec";
|
|
@@ -27,6 +27,15 @@ export const QuranProvenanceScopeSchema = Schema.Union([
|
|
|
27
27
|
QuranNameProvenanceScopeSchema,
|
|
28
28
|
QuranTranslationProvenanceScopeSchema,
|
|
29
29
|
]);
|
|
30
|
+
/**
|
|
31
|
+
* The tafsir scope of every active app locale. Activating a locale fails to
|
|
32
|
+
* compile until its tafsir source is named here.
|
|
33
|
+
*/
|
|
34
|
+
const QURAN_TAFSIR_PROVENANCE_SCOPES = {
|
|
35
|
+
de: "de-tafsir-access",
|
|
36
|
+
en: "en-tafsir-access",
|
|
37
|
+
id: "id-tafsir",
|
|
38
|
+
};
|
|
30
39
|
/** Derives the exact provenance scope order for one active locale set. */
|
|
31
40
|
export function quranProvenanceScopes(activeAppLocales) {
|
|
32
41
|
const scopes = MutableList.make();
|
|
@@ -34,15 +43,7 @@ export function quranProvenanceScopes(activeAppLocales) {
|
|
|
34
43
|
for (const appLocale of activeAppLocales) {
|
|
35
44
|
MutableList.append(scopes, quranNameProvenanceScope(appLocale));
|
|
36
45
|
MutableList.append(scopes, quranTranslationProvenanceScope(appLocale));
|
|
37
|
-
|
|
38
|
-
MutableList.append(scopes, "en-tafsir-access");
|
|
39
|
-
}
|
|
40
|
-
else if (appLocale === AppLocaleSchema.make("id")) {
|
|
41
|
-
MutableList.append(scopes, "id-tafsir");
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
MutableList.append(scopes, "de-tafsir-access");
|
|
45
|
-
}
|
|
46
|
+
MutableList.append(scopes, QURAN_TAFSIR_PROVENANCE_SCOPES[activeAppLocaleCode(appLocale)]);
|
|
46
47
|
}
|
|
47
48
|
MutableList.append(scopes, "metadata");
|
|
48
49
|
return MutableList.toArray(scopes);
|
package/package.json
CHANGED