@altnovatrail/spec 0.21.0 → 0.21.2
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/canvas/index.d.ts +35 -7
- package/package.json +1 -1
package/canvas/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* It takes the tutor's marks of a submission too, by a property, with the submission's context:
|
|
18
18
|
* their kind and their place come from the contract between app and api, novatrail.api.v1, whose
|
|
19
19
|
* message `Mark` these types are checked against, and their names from app (`contracts/README.md`).
|
|
20
|
-
* The element's members beyond this contract — its commands undo() and clear(),
|
|
20
|
+
* The element's members beyond this contract — its commands undo(), redo() and clear(),
|
|
21
21
|
* which its own buttons call — and its place in the DOM's maps of tags and events are canvas's:
|
|
22
22
|
* its package registers the element. The declarations take the DOM's
|
|
23
23
|
* types: Blob, CustomEvent and HTMLElement.
|
|
@@ -75,8 +75,18 @@ export type DemoChangeEvent = CustomEvent<DemoState>;
|
|
|
75
75
|
* are the pen, the eraser and the hand.
|
|
76
76
|
*/
|
|
77
77
|
export interface PaperTask {
|
|
78
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* The task's picture, a JPEG or a PNG, without the learner's strokes: the crop app cut of the
|
|
80
|
+
* photo, or, for a task of a module solved on the sheet, the module's statement that app drew as
|
|
81
|
+
* text on white.
|
|
82
|
+
*/
|
|
79
83
|
readonly statement: Blob;
|
|
84
|
+
/**
|
|
85
|
+
* Where the picture comes from: "photo", as it is when absent, or "module". A task of a module
|
|
86
|
+
* shows the sign "Task of the module" above the paper and offers no "Recognise", whatever
|
|
87
|
+
* `reading` holds: its statement is the module's text already. Any other value is a TypeError.
|
|
88
|
+
*/
|
|
89
|
+
readonly source?: "photo" | "module";
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
/**
|
|
@@ -307,9 +317,9 @@ export type HistoryEvent =
|
|
|
307
317
|
* and of no pressure, 0, and the strokes it took off, in the sheet's order. `on` is
|
|
308
318
|
* `"tracing"` when its strokes are on the tracing paper, as for a stroke written. The host puts
|
|
309
319
|
* it on the sheet by setting `history`, and an undo takes it back whole. A sample file of the
|
|
310
|
-
* eval protocol never holds one: the tutor's strokes are no learner's writing. A move
|
|
311
|
-
* holds as an erasing of the strokes moved, if a move, and a writing
|
|
312
|
-
* event's time: they replay to the same sheet.
|
|
320
|
+
* eval protocol never holds one: the tutor's strokes are no learner's writing. A move, a scale and
|
|
321
|
+
* a copy it holds as an erasing of the strokes moved or scaled, if a move or a scale, and a writing
|
|
322
|
+
* of each new stroke, at the event's time: they replay to the same sheet.
|
|
313
323
|
*/
|
|
314
324
|
| {
|
|
315
325
|
readonly kind: "tutor";
|
|
@@ -345,11 +355,29 @@ export type HistoryEvent =
|
|
|
345
355
|
readonly strokes: readonly Stroke[];
|
|
346
356
|
readonly on?: "tracing";
|
|
347
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Strokes Select scaled by a corner of their box, one action, as a move is: the strokes it took
|
|
360
|
+
* off, in the sheet's order, and each anew, after every other — the one of the same place in `ids`
|
|
361
|
+
* with every point `at` + (point − `at`) × `factor`, `at` the corner across, which stays, in the
|
|
362
|
+
* units of their layer, and its style's width times `factor` to a tenth, kept within 0.1 to 50; its
|
|
363
|
+
* pointer's kind, the rest of its style, times and pressures as they were, and a stroke of no style
|
|
364
|
+
* keeps none. `factor` is from 0.25 to 4, and never 1. Its IDs are new, above every ID before them,
|
|
365
|
+
* ascending, and `on` is as a move's. An undo takes it back whole.
|
|
366
|
+
*/
|
|
367
|
+
| {
|
|
368
|
+
readonly kind: "scale";
|
|
369
|
+
readonly t: number;
|
|
370
|
+
readonly ids: readonly number[];
|
|
371
|
+
readonly strokes: readonly Stroke[];
|
|
372
|
+
readonly factor: number;
|
|
373
|
+
readonly at: readonly [number, number];
|
|
374
|
+
readonly on?: "tracing";
|
|
375
|
+
}
|
|
348
376
|
/**
|
|
349
377
|
* The last action still in force taken back: the stroke it took off, if it was a writing, or the
|
|
350
378
|
* strokes it brought back, if it was an erasing or a clearing — and of a cut, the pieces it took
|
|
351
|
-
* off too; of a move, the
|
|
352
|
-
* copies.
|
|
379
|
+
* off too; of a move or a scale, the new strokes it took off and those it brought back, and of a
|
|
380
|
+
* copy, the copies.
|
|
353
381
|
*/
|
|
354
382
|
| {
|
|
355
383
|
readonly kind: "undo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altnovatrail/spec",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"description": "The types of NovaTrail's module format for TypeScript, generated from its schemas: the parts of a module and their open views, the canonical view, the inventory, the module index and the test vectors. And the types of the element <novatrail-canvas>, the contract of the canvas and the app. And the types of the admission table, which says which AI provider may serve which age category. And the numbers and widths of the workbook's page and its test vectors, as JSON, by which a canvas lays the page out. And the types of the deployment configuration, the file /deployment.json that the app reads at its start. And the types of the legal texts' passport, which names each text, its versions and the sets of texts of the samples page. And the types of the table of the age of digital consent, which gives each country's age with the law that sets it. And the types of the files of an export, the file the owner of an account gets of a profile or of the account.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|