@altnovatrail/canvas 0.3.32 → 0.3.34
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/lib/core/boxes.d.ts +1 -1
- package/lib/core/boxes.js +3 -3
- package/lib/core/crop.d.ts +1 -5
- package/lib/core/crop.js +1 -5
- package/lib/core/example.js +2 -2
- package/lib/core/grid.d.ts +3 -6
- package/lib/core/grid.js +2 -2
- package/lib/core/groups.d.ts +1 -1
- package/lib/core/groups.js +1 -1
- package/lib/core/hands.d.ts +7 -7
- package/lib/core/hands.js +6 -6
- package/lib/core/history.d.ts +3 -2
- package/lib/core/history.js +3 -2
- package/lib/core/index.js +2 -2
- package/lib/core/manifest.d.ts +2 -3
- package/lib/core/manifest.js +2 -3
- package/lib/core/marks.d.ts +3 -3
- package/lib/core/marks.js +3 -4
- package/lib/core/page.d.ts +2 -2
- package/lib/core/page.js +6 -6
- package/lib/core/recorder.d.ts +5 -5
- package/lib/core/recorder.js +5 -5
- package/lib/core/screen.d.ts +7 -8
- package/lib/core/screen.js +4 -4
- package/lib/core/submission.d.ts +2 -2
- package/lib/core/submission.js +2 -2
- package/lib/core/task.d.ts +6 -7
- package/lib/core/task.js +1 -1
- package/lib/core/zoom.d.ts +2 -2
- package/lib/core/zoom.js +2 -2
- package/lib/element/icons.d.ts +1 -1
- package/lib/element/icons.js +2 -2
- package/lib/element/index.d.ts +28 -30
- package/lib/element/index.js +125 -123
- package/lib/element/labels.d.ts +7 -7
- package/lib/element/labels.js +9 -10
- package/lib/element/parts.d.ts +1 -1
- package/lib/element/parts.js +9 -9
- package/lib/element/probe.d.ts +1 -1
- package/lib/element/probe.js +3 -4
- package/lib/element/session.js +1 -1
- package/lib/element/statement.js +1 -1
- package/lib/element/tools.d.ts +1 -1
- package/lib/element/tools.js +16 -18
- package/package.json +1 -1
package/lib/element/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ import { type Task, type Tool } from "../core/task.js";
|
|
|
10
10
|
* CanvasElement has it, what its events tell and the work it gives for checking, here, and the data
|
|
11
11
|
* — the history of writing, the context of a submission, the filled slots and the state of a demo
|
|
12
12
|
* — through the DOM-free part. The entry point gives them under spec's names, the same types, the
|
|
13
|
-
* media
|
|
14
|
-
*
|
|
13
|
+
* media and the tutor's marks too. The crop and a task with its temporary tools are the element's
|
|
14
|
+
* own (R26, R41).
|
|
15
15
|
*/
|
|
16
16
|
export type { Box, CanvasElement, CanvasEventMap, DemoChangeEvent, ExportedCell, ExportedSheet, ExportedWork, ExportedWorkbook, HistoryChange, HistoryChangeEvent, Media, ToolChange, ToolChangeEvent, } from "@altnovatrail/spec/canvas";
|
|
17
17
|
export type { Filled, Filling } from "../core/boxes.js";
|
|
@@ -65,7 +65,7 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
65
65
|
* A lesson's worked example (R42; R58 spec): the open view of a segment `worked_example` of the
|
|
66
66
|
* module format 0.4 — its statement, which the element shows above the sheet as a task's (R23),
|
|
67
67
|
* the grid of its sheet or the lines of its workbook, and the parts of the author's demo, which
|
|
68
|
-
* on a workbook fill the lines' boxes with their values (
|
|
68
|
+
* on a workbook fill the lines' boxes with their values (R61). The type is spec's (R73 spec; R41).
|
|
69
69
|
* The element shows a task or a worked example, not both: an example while a task is given, while
|
|
70
70
|
* the sheet has a history of writing, or while a stroke or an erasing is under way, is a
|
|
71
71
|
* TypeError, and so is one the schema refuses, at its field. `undefined` takes the example off,
|
|
@@ -113,13 +113,13 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
113
113
|
get manifest(): Manifest | undefined;
|
|
114
114
|
set manifest(manifest: Manifest | undefined);
|
|
115
115
|
/**
|
|
116
|
-
* What gives the files of the pictures, by their references, as the contract has it (
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
116
|
+
* What gives the files of the pictures, by their references, as the contract has it (R07;
|
|
117
|
+
* R36 spec): a task's statement's, and a worked example's — its statement's and every part's of
|
|
118
|
+
* its demo, which it asks for as the example comes, before the learner opens them (R42). A
|
|
119
|
+
* reference is asked for once, whichever pictures show it, and its file stays while the task or
|
|
120
|
+
* the example names it. Until a picture's file comes, or if it never does, its frame shows what
|
|
121
|
+
* it shows in words. A new function serves the references that have no file yet, and stops no
|
|
122
|
+
* load the last one began.
|
|
123
123
|
*/
|
|
124
124
|
get media(): Media | undefined;
|
|
125
125
|
set media(media: Media | undefined);
|
|
@@ -160,12 +160,11 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
160
160
|
* workbook where an answer cell is, by its item and its slot (R39). A mark holds on to the
|
|
161
161
|
* strokes the model saw there and is drawn around those of them the sheet shows, as they are now
|
|
162
162
|
* — a cell's around its box too: new strokes do not move it, and when all of them are erased it
|
|
163
|
-
* is gone, till undo brings them back. A box of a workbook that was empty is framed alone (
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* to a page of its boxes: one of other strokes or other boxes is a TypeError, and so are marks
|
|
163
|
+
* is gone, till undo brings them back. A box of a workbook that was empty is framed alone (R74
|
|
164
|
+
* spec). A box that comes near no stroke, and a cell on a sheet, which takes no zones, have no
|
|
165
|
+
* frame: the question is asked without one. The type is spec's (R83 spec). A submission goes back
|
|
166
|
+
* to a sheet whose history holds its strokes, as its digest tells (R27), and a workbook's to a
|
|
167
|
+
* page of its boxes: one of other strokes or other boxes is a TypeError, and so are marks
|
|
169
168
|
* given before the task and the history they hold on to, and marks that are not marks. A new
|
|
170
169
|
* history, and a new page, put the marks back on their strokes, or take them off. `undefined`
|
|
171
170
|
* takes the marks off. Every value is checked as it comes, and marks equal to those shown write
|
|
@@ -180,9 +179,9 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
180
179
|
* The element's `lang` came, changed or went: its buttons and a workbook's boxes are labelled in
|
|
181
180
|
* it, or in English for a language their labels are not in, and for none (R28, R36). Or
|
|
182
181
|
* `tools-hidden` did: while the element has it, the bar is out of sight and of the accessibility
|
|
183
|
-
* tree, as `app` hides it on a phone under its tutor's sheet (R84;
|
|
184
|
-
*
|
|
185
|
-
*
|
|
182
|
+
* tree, as `app` hides it on a phone under its tutor's sheet (R84; R36 spec). An attribute the
|
|
183
|
+
* element had before it was defined comes here just after the constructor, which reads no
|
|
184
|
+
* attribute.
|
|
186
185
|
*/
|
|
187
186
|
attributeChangedCallback(name: string): void;
|
|
188
187
|
/**
|
|
@@ -214,17 +213,16 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
214
213
|
*/
|
|
215
214
|
exportWork(): Promise<ExportedWork | null>;
|
|
216
215
|
/**
|
|
217
|
-
* The picture of the work, for the `picture` of a stored work that app puts on the server
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* 4 MiB of a stored work.
|
|
216
|
+
* The picture of the work, for the `picture` of a stored work that app puts on the server, a
|
|
217
|
+
* method of the agreement with app (R83; R36 spec): the PNG of the strokes the surface shows,
|
|
218
|
+
* with no condition — the whole sheet, or the workbook's whole page with its draft, one pixel a
|
|
219
|
+
* unit, 1000 × 1400, whatever is filled and whether the work was sent to be checked or not; an
|
|
220
|
+
* empty surface, and a worked example's, is white. The strokes are those `exportWork()` takes, as
|
|
221
|
+
* the history has them: not the stroke under way, but those under an eraser not yet lifted. Each
|
|
222
|
+
* is the outline the screen fills, black on white with no theme and no template, and the pixels
|
|
223
|
+
* go through the crop's encoder, grey a byte each: so the picture looks as the sheet does, and
|
|
224
|
+
* holds at most 1,576,640 bytes, for the encoder spends at most 9 bits on a byte of a row, under
|
|
225
|
+
* the 4 MiB of a stored work.
|
|
228
226
|
*/
|
|
229
227
|
exportPicture(): Promise<Blob>;
|
|
230
228
|
disconnectedCallback(): void;
|