@nakafa/aksara-contracts 1.0.1 → 3.0.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/README.md +10 -27
- package/dist/artifact/integrity.d.ts +3 -3
- package/dist/artifact/integrity.js +2 -2
- package/dist/artifact/source.d.ts +2 -2
- package/dist/artifact/source.js +2 -8
- package/dist/artifact/spec.d.ts +0 -16
- package/dist/artifact/spec.js +0 -6
- package/dist/artifact/verify.d.ts +1 -1
- package/dist/{question → assessment}/answer.d.ts +14 -58
- package/dist/{question → assessment}/answer.js +13 -60
- package/dist/assessment/catalog.d.ts +235 -0
- package/dist/assessment/catalog.js +115 -0
- package/dist/assessment/chart.d.ts +62 -0
- package/dist/assessment/chart.js +64 -0
- package/dist/assessment/closure.d.ts +28 -0
- package/dist/assessment/closure.js +164 -0
- package/dist/assessment/explanation.d.ts +13 -8
- package/dist/assessment/explanation.js +14 -8
- package/dist/assessment/figure.d.ts +140 -1
- package/dist/assessment/figure.js +9 -2
- package/dist/assessment/hash.d.ts +352 -212
- package/dist/assessment/hash.js +14 -0
- package/dist/assessment/inline.d.ts +3 -1
- package/dist/assessment/inline.js +20 -5
- package/dist/assessment/item.d.ts +8 -4
- package/dist/assessment/item.js +6 -2
- package/dist/assessment/key.js +6 -6
- package/dist/assessment/paper.d.ts +74 -74
- package/dist/assessment/snapshot.d.ts +3778 -0
- package/dist/assessment/snapshot.js +192 -0
- package/dist/cache/content.d.ts +4 -4
- package/dist/canonical.d.ts +6 -0
- package/dist/canonical.js +8 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +0 -1
- package/dist/delivery.d.ts +0 -3
- package/dist/delivery.js +0 -5
- package/dist/hash/digest.d.ts +7 -7
- package/dist/hash/digest.js +9 -30
- package/dist/hash/stream.d.ts +1 -1
- package/dist/hash/text.d.ts +3 -12
- package/dist/hash/text.js +3 -6
- package/dist/ids.js +8 -8
- package/dist/preview/artifact.d.ts +1 -120
- package/dist/preview/auth.d.ts +1 -1
- package/dist/preview/auth.js +29 -25
- package/dist/preview/document.d.ts +0 -586
- package/dist/preview/document.js +1 -47
- package/dist/preview/spec.d.ts +6 -1984
- package/dist/preview/spec.js +7 -47
- package/dist/preview/target.d.ts +0 -173
- package/dist/preview/target.js +1 -70
- package/dist/program/snapshot/digest.d.ts +1 -2
- package/dist/program/snapshot/digest.js +2 -4
- package/dist/program/snapshot/hash.d.ts +6 -21
- package/dist/program/snapshot/hash.js +3 -9
- package/dist/projection/digest.d.ts +7 -143
- package/dist/projection/digest.js +7 -13
- package/dist/projection/hash.d.ts +2 -138
- package/dist/projection/hash.js +2 -5
- package/dist/projection/material.js +1 -1
- package/dist/projection/spec.d.ts +6 -211
- package/dist/projection/spec.js +4 -18
- package/dist/projection/verify.d.ts +1 -128
- package/dist/projection/verify.js +1 -4
- package/dist/quran/provenance.d.ts +2 -8
- package/dist/quran/provenance.js +1 -4
- package/dist/quran/snapshot/digest.d.ts +1 -2
- package/dist/quran/snapshot/digest.js +2 -2
- package/dist/quran/snapshot/hash.d.ts +3 -10
- package/dist/quran/snapshot/hash.js +2 -5
- package/dist/quran/snapshot/row/hash.d.ts +3 -12
- package/dist/quran/snapshot/row/hash.js +2 -5
- package/dist/release/canonical.d.ts +2 -2
- package/dist/release/current/evidence.d.ts +24 -24
- package/dist/release/current/state.d.ts +28 -56
- package/dist/release/current/state.js +1 -6
- package/dist/release/digest.d.ts +9 -18
- package/dist/release/digest.js +7 -13
- package/dist/release/hash.d.ts +7 -16
- package/dist/release/hash.js +2 -6
- package/dist/release/head.d.ts +10 -57
- package/dist/release/head.js +3 -14
- package/dist/release/identity.d.ts +3 -3
- package/dist/release/items.d.ts +3 -3
- package/dist/release/items.js +1 -1
- package/dist/release/lifecycle.d.ts +18 -18
- package/dist/release/policy.d.ts +3 -4
- package/dist/release/policy.js +2 -11
- package/dist/release/result/digest.d.ts +11 -31
- package/dist/release/result/digest.js +5 -11
- package/dist/release/rollback/digest.d.ts +11 -35
- package/dist/release/rollback/digest.js +7 -13
- package/dist/release/rollback/spec.d.ts +30 -792
- package/dist/release/rollback/spec.js +1 -4
- package/dist/release/route/digest.d.ts +7 -16
- package/dist/release/route/digest.js +7 -13
- package/dist/release/route/verify.d.ts +1 -1
- package/dist/release/route/verify.js +1 -1
- package/dist/release/snapshot/data.d.ts +599 -249
- package/dist/release/snapshot/data.js +11 -28
- package/dist/release/snapshot/evidence/assessment.d.ts +26 -0
- package/dist/release/snapshot/evidence/assessment.js +44 -0
- package/dist/release/snapshot/evidence/program.d.ts +1 -1
- package/dist/release/snapshot/evidence/quran.d.ts +1 -1
- package/dist/release/snapshot/evidence/requirement.d.ts +1 -1
- package/dist/release/snapshot/evidence.d.ts +19 -19
- package/dist/release/snapshot/evidence.js +2 -2
- package/dist/release/snapshot/scope.d.ts +5 -5
- package/dist/release/snapshot/scope.js +1 -1
- package/dist/release/snapshot/spec.d.ts +15 -15
- package/dist/release/snapshot/spec.js +8 -8
- package/dist/release/snapshot/verify.d.ts +1278 -268
- package/dist/release/snapshot/verify.js +8 -5
- package/dist/release/spec.d.ts +33 -33
- package/dist/release/verify.d.ts +7 -7
- package/dist/renderer/compatibility.d.ts +1 -1
- package/dist/renderer/component.js +1 -1
- package/dist/renderer/contract.d.ts +0 -8
- package/dist/renderer/contract.js +0 -3
- package/dist/renderer/manifest.d.ts +3 -3
- package/dist/renderer/manifest.js +2 -2
- package/dist/runtime/spec.d.ts +38 -38
- package/dist/runtime/spec.js +4 -5
- package/dist/runtime/verify.d.ts +42 -42
- package/dist/signature/key.d.ts +0 -2
- package/dist/signature/key.js +37 -88
- package/dist/signature/spec.d.ts +5 -5
- package/dist/signature/spec.js +0 -1
- package/dist/signature/verify.js +31 -46
- package/dist/transport/batch.d.ts +6 -244
- package/dist/transport/failure.d.ts +6 -20
- package/dist/transport/failure.js +0 -10
- package/dist/transport/group.d.ts +1969 -1369
- package/dist/transport/group.js +0 -2
- package/dist/transport/request.d.ts +10691 -5086
- package/dist/transport/request.js +0 -3
- package/dist/transport/response.d.ts +219 -1442
- package/dist/transport/response.js +0 -4
- package/dist/transport/snapshot.d.ts +1187 -487
- package/dist/tree.js +1 -1
- package/package.json +188 -296
- package/dist/projection/question.d.ts +0 -1067
- package/dist/projection/question.js +0 -121
- package/dist/question/identity.d.ts +0 -175
- package/dist/question/identity.js +0 -207
- package/dist/question/item.d.ts +0 -450
- package/dist/question/item.js +0 -174
- package/dist/question/label.d.ts +0 -3
- package/dist/question/label.js +0 -3
- package/dist/question/points.d.ts +0 -18
- package/dist/question/points.js +0 -22
- package/dist/question/response.d.ts +0 -289
- package/dist/question/response.js +0 -167
- package/dist/question/rubric.d.ts +0 -234
- package/dist/question/rubric.js +0 -186
- package/dist/release/current/runtime.d.ts +0 -4
- package/dist/release/current/runtime.js +0 -15
- package/dist/release/snapshot/evidence/tryout.d.ts +0 -22
- package/dist/release/snapshot/evidence/tryout.js +0 -91
- package/dist/runtime/protected/limits.d.ts +0 -10
- package/dist/runtime/protected/limits.js +0 -16
- package/dist/runtime/protected/spec.d.ts +0 -310
- package/dist/runtime/protected/spec.js +0 -80
- package/dist/runtime/protected/verify.d.ts +0 -83
- package/dist/runtime/protected/verify.js +0 -70
- package/dist/transport/runtime.d.ts +0 -77
- package/dist/transport/runtime.js +0 -33
- package/dist/tryout/canonical.d.ts +0 -12
- package/dist/tryout/canonical.js +0 -7
- package/dist/tryout/catalog.d.ts +0 -396
- package/dist/tryout/catalog.js +0 -155
- package/dist/tryout/closure/accounting.d.ts +0 -20
- package/dist/tryout/closure/accounting.js +0 -70
- package/dist/tryout/closure/locale.d.ts +0 -14
- package/dist/tryout/closure/locale.js +0 -113
- package/dist/tryout/closure/placement.d.ts +0 -5
- package/dist/tryout/closure/placement.js +0 -32
- package/dist/tryout/digest.d.ts +0 -34
- package/dist/tryout/digest.js +0 -57
- package/dist/tryout/hash/catalog.d.ts +0 -364
- package/dist/tryout/hash/catalog.js +0 -209
- package/dist/tryout/hash/content.d.ts +0 -215
- package/dist/tryout/hash/content.js +0 -75
- package/dist/tryout/hash/placement.d.ts +0 -242
- package/dist/tryout/hash/placement.js +0 -56
- package/dist/tryout/identity.d.ts +0 -12
- package/dist/tryout/identity.js +0 -47
- package/dist/tryout/key.d.ts +0 -4
- package/dist/tryout/key.js +0 -8
- package/dist/tryout/language.d.ts +0 -24
- package/dist/tryout/language.js +0 -30
- package/dist/tryout/placement.d.ts +0 -331
- package/dist/tryout/placement.js +0 -96
- package/dist/tryout/runtime/canonical.d.ts +0 -8
- package/dist/tryout/runtime/canonical.js +0 -34
- package/dist/tryout/runtime/hash.d.ts +0 -34
- package/dist/tryout/runtime/hash.js +0 -13
- package/dist/tryout/runtime/source.d.ts +0 -44
- package/dist/tryout/runtime/source.js +0 -47
- package/dist/tryout/runtime/spec.d.ts +0 -58
- package/dist/tryout/runtime/spec.js +0 -21
- package/dist/tryout/runtime/verify.d.ts +0 -69
- package/dist/tryout/runtime/verify.js +0 -67
- package/dist/tryout/scoring.d.ts +0 -148
- package/dist/tryout/scoring.js +0 -98
- package/dist/tryout/snapshot/canonical.d.ts +0 -7
- package/dist/tryout/snapshot/canonical.js +0 -18
- package/dist/tryout/snapshot/hash.d.ts +0 -49
- package/dist/tryout/snapshot/hash.js +0 -22
- package/dist/tryout/snapshot/spec.d.ts +0 -46
- package/dist/tryout/snapshot/spec.js +0 -30
- package/dist/tryout/spec.d.ts +0 -41
- package/dist/tryout/spec.js +0 -46
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
/**
|
|
3
|
-
* The explanation of one item version: its own schema and its
|
|
4
|
-
* the answer key is. A paper bundle carries prompts and
|
|
5
|
-
* key and never an explanation, so an explanation
|
|
6
|
-
* release, under the release policy that Nakafa
|
|
7
|
-
* document places no interaction. `version` is
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
3
|
+
* The explanation of one item version in one language: its own schema and its
|
|
4
|
+
* own artifact, as the answer key is. A paper bundle carries prompts and
|
|
5
|
+
* stimuli only, never a key and never an explanation, so an explanation
|
|
6
|
+
* reaches a learner after release, under the release policy that Nakafa
|
|
7
|
+
* applies, from this record. The document places no interaction. `version` is
|
|
8
|
+
* the hash of the item version it explains. `language` is the language the
|
|
9
|
+
* explanation is written in, which need not be the delivery language of the
|
|
10
|
+
* version: an item asked in Indonesian is explained to a learner in the
|
|
11
|
+
* language of the learner, and may quote the prompt in its own language. A
|
|
12
|
+
* version has at most one explanation in each language, and a version without
|
|
13
|
+
* one has no record. An item version holds no explanation. Its size is limited
|
|
14
|
+
* by `assessment/record`.
|
|
11
15
|
*/
|
|
12
16
|
export declare const ItemExplanationSchema: Schema.Struct<{
|
|
13
17
|
readonly document: Schema.decodeTo<Schema.Struct<{
|
|
14
18
|
readonly content: Schema.NonEmptyArray<Schema.Codec<import("#contracts/assessment/document").BlockNode, import("#contracts/assessment/document").BlockNode, never, never>>;
|
|
15
19
|
readonly type: Schema.Literal<"doc">;
|
|
16
20
|
}>, Schema.Unknown, never, never>;
|
|
21
|
+
readonly language: Schema.brand<Schema.String, "@NakafaAI/AksaraContentLanguage">;
|
|
17
22
|
readonly version: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
18
23
|
}>;
|
|
19
24
|
export type ItemExplanation = typeof ItemExplanationSchema.Type;
|
|
@@ -2,17 +2,23 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { ContentDocumentSchema } from "#contracts/assessment/document";
|
|
3
3
|
import { isWithinRecordLimit } from "#contracts/assessment/record";
|
|
4
4
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
5
|
+
import { ContentLanguageSchema } from "#contracts/locale";
|
|
5
6
|
/**
|
|
6
|
-
* The explanation of one item version: its own schema and its
|
|
7
|
-
* the answer key is. A paper bundle carries prompts and
|
|
8
|
-
* key and never an explanation, so an explanation
|
|
9
|
-
* release, under the release policy that Nakafa
|
|
10
|
-
* document places no interaction. `version` is
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* The explanation of one item version in one language: its own schema and its
|
|
8
|
+
* own artifact, as the answer key is. A paper bundle carries prompts and
|
|
9
|
+
* stimuli only, never a key and never an explanation, so an explanation
|
|
10
|
+
* reaches a learner after release, under the release policy that Nakafa
|
|
11
|
+
* applies, from this record. The document places no interaction. `version` is
|
|
12
|
+
* the hash of the item version it explains. `language` is the language the
|
|
13
|
+
* explanation is written in, which need not be the delivery language of the
|
|
14
|
+
* version: an item asked in Indonesian is explained to a learner in the
|
|
15
|
+
* language of the learner, and may quote the prompt in its own language. A
|
|
16
|
+
* version has at most one explanation in each language, and a version without
|
|
17
|
+
* one has no record. An item version holds no explanation. Its size is limited
|
|
18
|
+
* by `assessment/record`.
|
|
14
19
|
*/
|
|
15
20
|
export const ItemExplanationSchema = Schema.Struct({
|
|
16
21
|
document: ContentDocumentSchema,
|
|
22
|
+
language: ContentLanguageSchema,
|
|
17
23
|
version: Sha256HashSchema,
|
|
18
24
|
}).check(isWithinRecordLimit);
|
|
@@ -508,6 +508,7 @@ export declare const LineEquationPropsSchema: Schema.Struct<{
|
|
|
508
508
|
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
509
509
|
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
510
510
|
readonly at: Schema.optionalKey<Schema.Int>;
|
|
511
|
+
readonly fontSize: Schema.optionalKey<Schema.Finite>;
|
|
511
512
|
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
512
513
|
readonly text: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
513
514
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -589,10 +590,78 @@ export declare const MermaidPropsSchema: Schema.Struct<{
|
|
|
589
590
|
readonly title: Schema.Trimmed;
|
|
590
591
|
}>;
|
|
591
592
|
/**
|
|
592
|
-
* The attributes of a figure node: one of the
|
|
593
|
+
* The attributes of a figure node: one of the six renderer components and the
|
|
593
594
|
* typed props that component takes.
|
|
594
595
|
*/
|
|
595
596
|
export declare const FigureAttrsSchema: Schema.Union<readonly [Schema.Struct<{
|
|
597
|
+
readonly alt: Schema.Trimmed;
|
|
598
|
+
readonly caption: Schema.NullOr<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
599
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
600
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
601
|
+
}>, Schema.Struct<{
|
|
602
|
+
readonly attrs: Schema.Struct<{
|
|
603
|
+
readonly href: Schema.String;
|
|
604
|
+
}>;
|
|
605
|
+
readonly type: Schema.Literal<"link">;
|
|
606
|
+
}>]>>>;
|
|
607
|
+
readonly text: Schema.String;
|
|
608
|
+
readonly type: Schema.Literal<"text">;
|
|
609
|
+
}>, Schema.Struct<{
|
|
610
|
+
readonly attrs: Schema.Struct<{
|
|
611
|
+
readonly latex: Schema.Trimmed;
|
|
612
|
+
}>;
|
|
613
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
614
|
+
}>]>>>;
|
|
615
|
+
readonly component: Schema.Literal<"Chart">;
|
|
616
|
+
readonly props: Schema.Struct<{
|
|
617
|
+
readonly bars: Schema.optionalKey<Schema.Literals<readonly ["apart", "touching"]>>;
|
|
618
|
+
readonly categories: Schema.NonEmptyArray<Schema.Trimmed>;
|
|
619
|
+
readonly description: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
620
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
621
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
622
|
+
}>, Schema.Struct<{
|
|
623
|
+
readonly attrs: Schema.Struct<{
|
|
624
|
+
readonly href: Schema.String;
|
|
625
|
+
}>;
|
|
626
|
+
readonly type: Schema.Literal<"link">;
|
|
627
|
+
}>]>>>;
|
|
628
|
+
readonly text: Schema.String;
|
|
629
|
+
readonly type: Schema.Literal<"text">;
|
|
630
|
+
}>, Schema.Struct<{
|
|
631
|
+
readonly attrs: Schema.Struct<{
|
|
632
|
+
readonly latex: Schema.Trimmed;
|
|
633
|
+
}>;
|
|
634
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
635
|
+
}>]>>;
|
|
636
|
+
readonly series: Schema.NonEmptyArray<Schema.Struct<{
|
|
637
|
+
readonly label: Schema.Trimmed;
|
|
638
|
+
readonly mark: Schema.Literals<readonly ["bar", "line"]>;
|
|
639
|
+
readonly values: Schema.NonEmptyArray<Schema.NullOr<Schema.Finite>>;
|
|
640
|
+
}>>;
|
|
641
|
+
readonly title: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
642
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
643
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
644
|
+
}>, Schema.Struct<{
|
|
645
|
+
readonly attrs: Schema.Struct<{
|
|
646
|
+
readonly href: Schema.String;
|
|
647
|
+
}>;
|
|
648
|
+
readonly type: Schema.Literal<"link">;
|
|
649
|
+
}>]>>>;
|
|
650
|
+
readonly text: Schema.String;
|
|
651
|
+
readonly type: Schema.Literal<"text">;
|
|
652
|
+
}>, Schema.Struct<{
|
|
653
|
+
readonly attrs: Schema.Struct<{
|
|
654
|
+
readonly latex: Schema.Trimmed;
|
|
655
|
+
}>;
|
|
656
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
657
|
+
}>]>>;
|
|
658
|
+
readonly valueLabel: Schema.optionalKey<Schema.Trimmed>;
|
|
659
|
+
readonly valueRange: Schema.optionalKey<Schema.Struct<{
|
|
660
|
+
readonly max: Schema.Finite;
|
|
661
|
+
readonly min: Schema.Finite;
|
|
662
|
+
}>>;
|
|
663
|
+
}>;
|
|
664
|
+
}>, Schema.Struct<{
|
|
596
665
|
readonly alt: Schema.Trimmed;
|
|
597
666
|
readonly caption: Schema.NullOr<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
598
667
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -1142,6 +1211,7 @@ export declare const FigureAttrsSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
1142
1211
|
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1143
1212
|
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1144
1213
|
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1214
|
+
readonly fontSize: Schema.optionalKey<Schema.Finite>;
|
|
1145
1215
|
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1146
1216
|
readonly text: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1147
1217
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -1265,6 +1335,74 @@ export type FigureAttrs = typeof FigureAttrsSchema.Type;
|
|
|
1265
1335
|
/** A figure block: an interactive visual with a required text alternative. */
|
|
1266
1336
|
export declare const FigureNodeSchema: Schema.Struct<{
|
|
1267
1337
|
readonly attrs: Schema.Union<readonly [Schema.Struct<{
|
|
1338
|
+
readonly alt: Schema.Trimmed;
|
|
1339
|
+
readonly caption: Schema.NullOr<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1340
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1341
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
1342
|
+
}>, Schema.Struct<{
|
|
1343
|
+
readonly attrs: Schema.Struct<{
|
|
1344
|
+
readonly href: Schema.String;
|
|
1345
|
+
}>;
|
|
1346
|
+
readonly type: Schema.Literal<"link">;
|
|
1347
|
+
}>]>>>;
|
|
1348
|
+
readonly text: Schema.String;
|
|
1349
|
+
readonly type: Schema.Literal<"text">;
|
|
1350
|
+
}>, Schema.Struct<{
|
|
1351
|
+
readonly attrs: Schema.Struct<{
|
|
1352
|
+
readonly latex: Schema.Trimmed;
|
|
1353
|
+
}>;
|
|
1354
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
1355
|
+
}>]>>>;
|
|
1356
|
+
readonly component: Schema.Literal<"Chart">;
|
|
1357
|
+
readonly props: Schema.Struct<{
|
|
1358
|
+
readonly bars: Schema.optionalKey<Schema.Literals<readonly ["apart", "touching"]>>;
|
|
1359
|
+
readonly categories: Schema.NonEmptyArray<Schema.Trimmed>;
|
|
1360
|
+
readonly description: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1361
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1362
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
1363
|
+
}>, Schema.Struct<{
|
|
1364
|
+
readonly attrs: Schema.Struct<{
|
|
1365
|
+
readonly href: Schema.String;
|
|
1366
|
+
}>;
|
|
1367
|
+
readonly type: Schema.Literal<"link">;
|
|
1368
|
+
}>]>>>;
|
|
1369
|
+
readonly text: Schema.String;
|
|
1370
|
+
readonly type: Schema.Literal<"text">;
|
|
1371
|
+
}>, Schema.Struct<{
|
|
1372
|
+
readonly attrs: Schema.Struct<{
|
|
1373
|
+
readonly latex: Schema.Trimmed;
|
|
1374
|
+
}>;
|
|
1375
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
1376
|
+
}>]>>;
|
|
1377
|
+
readonly series: Schema.NonEmptyArray<Schema.Struct<{
|
|
1378
|
+
readonly label: Schema.Trimmed;
|
|
1379
|
+
readonly mark: Schema.Literals<readonly ["bar", "line"]>;
|
|
1380
|
+
readonly values: Schema.NonEmptyArray<Schema.NullOr<Schema.Finite>>;
|
|
1381
|
+
}>>;
|
|
1382
|
+
readonly title: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1383
|
+
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1384
|
+
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
1385
|
+
}>, Schema.Struct<{
|
|
1386
|
+
readonly attrs: Schema.Struct<{
|
|
1387
|
+
readonly href: Schema.String;
|
|
1388
|
+
}>;
|
|
1389
|
+
readonly type: Schema.Literal<"link">;
|
|
1390
|
+
}>]>>>;
|
|
1391
|
+
readonly text: Schema.String;
|
|
1392
|
+
readonly type: Schema.Literal<"text">;
|
|
1393
|
+
}>, Schema.Struct<{
|
|
1394
|
+
readonly attrs: Schema.Struct<{
|
|
1395
|
+
readonly latex: Schema.Trimmed;
|
|
1396
|
+
}>;
|
|
1397
|
+
readonly type: Schema.Literal<"mathInline">;
|
|
1398
|
+
}>]>>;
|
|
1399
|
+
readonly valueLabel: Schema.optionalKey<Schema.Trimmed>;
|
|
1400
|
+
readonly valueRange: Schema.optionalKey<Schema.Struct<{
|
|
1401
|
+
readonly max: Schema.Finite;
|
|
1402
|
+
readonly min: Schema.Finite;
|
|
1403
|
+
}>>;
|
|
1404
|
+
}>;
|
|
1405
|
+
}>, Schema.Struct<{
|
|
1268
1406
|
readonly alt: Schema.Trimmed;
|
|
1269
1407
|
readonly caption: Schema.NullOr<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1270
1408
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -1814,6 +1952,7 @@ export declare const FigureNodeSchema: Schema.Struct<{
|
|
|
1814
1952
|
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1815
1953
|
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1816
1954
|
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1955
|
+
readonly fontSize: Schema.optionalKey<Schema.Finite>;
|
|
1817
1956
|
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1818
1957
|
readonly text: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1819
1958
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Array as Arr, Record as Rec, Schema } from "effect";
|
|
2
|
+
import { ChartPropsSchema } from "#contracts/assessment/chart";
|
|
2
3
|
import { AssetIdSchema } from "#contracts/assessment/identity";
|
|
3
4
|
import { RichTextSchema } from "#contracts/assessment/inline";
|
|
4
5
|
import { LatexSchema, NonNegativeIntSchema, PlainTextSchema, PositiveIntSchema, } from "#contracts/assessment/scalar";
|
|
@@ -96,10 +97,11 @@ export const NumberLinePropsSchema = Schema.Struct({
|
|
|
96
97
|
}));
|
|
97
98
|
/** Whether the first or last point of a line belongs to it. */
|
|
98
99
|
const EndpointStateSchema = Schema.Literals(["open", "closed"]);
|
|
99
|
-
/** A label on a line: rich text at one of its points, nudged by an offset. */
|
|
100
|
+
/** A label on a line: rich text at one of its points, nudged by an offset, at an optional size. */
|
|
100
101
|
const LineLabelSchema = Schema.Struct({
|
|
101
102
|
anchorX: Schema.optionalKey(Schema.Literals(["center", "left", "right"])),
|
|
102
103
|
at: Schema.optionalKey(NonNegativeIntSchema),
|
|
104
|
+
fontSize: Schema.optionalKey(PositiveMeasureSchema),
|
|
103
105
|
offset: Schema.optionalKey(TripleSchema),
|
|
104
106
|
text: RichTextSchema,
|
|
105
107
|
});
|
|
@@ -199,10 +201,15 @@ const FigureFields = {
|
|
|
199
201
|
caption: Schema.NullOr(RichTextSchema),
|
|
200
202
|
};
|
|
201
203
|
/**
|
|
202
|
-
* The attributes of a figure node: one of the
|
|
204
|
+
* The attributes of a figure node: one of the six renderer components and the
|
|
203
205
|
* typed props that component takes.
|
|
204
206
|
*/
|
|
205
207
|
export const FigureAttrsSchema = Schema.Union([
|
|
208
|
+
Schema.Struct({
|
|
209
|
+
...FigureFields,
|
|
210
|
+
component: Schema.Literal("Chart"),
|
|
211
|
+
props: ChartPropsSchema,
|
|
212
|
+
}),
|
|
206
213
|
Schema.Struct({
|
|
207
214
|
...FigureFields,
|
|
208
215
|
component: Schema.Literal("MathVisual"),
|