@altnovatrail/canvas 0.3.36 → 0.3.38

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.
@@ -1,6 +1,6 @@
1
1
  import { record, shown } from "./fields.js";
2
2
  import { tenths } from "./geometry.js";
3
- import { SHEET } from "./sheet.js";
3
+ import { REACH } from "./sheet.js";
4
4
  /**
5
5
  * The tracing paper's rule (R87), in sheet units: the crop is drawn as large as fits within
6
6
  * `width` × `height`, in its own proportions; it starts at `at`, right of the bar of buttons, which
@@ -15,6 +15,53 @@ export const TRACING = Object.freeze({
15
15
  leap: 100,
16
16
  dots: 25,
17
17
  });
18
+ /**
19
+ * The tracing paper's scale (R89): from `min` to `max` times its own size, as the mockup's
20
+ * `Zadacha-masshtab` has it; a button's press multiplies it by `button`, a notch of the wheel by
21
+ * `wheel`, and a scale is kept in hundredths, as the percentage shows it.
22
+ */
23
+ export const SCALE = Object.freeze({ min: 0.4, max: 4, button: 1.2, wheel: 1.08 });
24
+ /** A scale kept to the rule's bounds, in hundredths (R89). */
25
+ export function scaleOf(scale) {
26
+ return Math.round(clamp(scale, SCALE.min, SCALE.max) * 100) / 100;
27
+ }
28
+ /** The scale of a tracing state: 1 where it has none (R89). */
29
+ export function scaleIn(state) {
30
+ return state.scale ?? 1;
31
+ }
32
+ /** A size as large as `scale` makes it. */
33
+ export function scaled(size, scale) {
34
+ return { width: size.width * scale, height: size.height * scale };
35
+ }
36
+ /**
37
+ * The grids of a task from paper's sheet in the order its button turns them, round, the first as
38
+ * the task comes (R88).
39
+ */
40
+ export const PAPER_GRIDS = Object.freeze([
41
+ "dots",
42
+ "lines",
43
+ "blank",
44
+ "squares",
45
+ ]);
46
+ /** Each grid's rulings, in sheet units, as the mockup draws them: a blank sheet has none (R88). */
47
+ const RULINGS = Object.freeze({
48
+ dots: Object.freeze({ kind: "dots", step: TRACING.dots }),
49
+ lines: Object.freeze({ kind: "lines", step: 40 }),
50
+ blank: undefined,
51
+ squares: Object.freeze({ kind: "squares", step: TRACING.dots }),
52
+ });
53
+ /** Whether a value is a grid of a task from paper's sheet. */
54
+ export function isPaperGrid(value) {
55
+ return typeof value === "string" && PAPER_GRIDS.includes(value);
56
+ }
57
+ /** The rulings of a task from paper's grid, or none for a blank sheet (R88). */
58
+ export function rulingsOf(grid) {
59
+ return RULINGS[grid];
60
+ }
61
+ /** The grid the button turns a task from paper's grid to: the next, round (R88). */
62
+ export function nextGrid(grid) {
63
+ return PAPER_GRIDS[(PAPER_GRIDS.indexOf(grid) + 1) % PAPER_GRIDS.length];
64
+ }
18
65
  /** The size before the crop's picture is read: the largest the tracing paper may be. */
19
66
  export const LARGEST = Object.freeze({ width: TRACING.width, height: TRACING.height });
20
67
  /**
@@ -31,24 +78,26 @@ export function sizeOf(width, height) {
31
78
  export const TRACING_START = Object.freeze({
32
79
  at: Object.freeze([TRACING.at[0], TRACING.at[1]]),
33
80
  hidden: false,
81
+ scale: 1,
34
82
  });
35
83
  /**
36
84
  * A tracing state a consumer gives (R74 spec), checked and frozen: an object of `at`, [x, y] in
37
- * units, finite numbers, and `hidden`, true or false; other fields are passed over. A state that
38
- * puts the tracing paper of `size` wholly off the sheet is a TypeError, as is anything else that is
39
- * not such a state.
85
+ * units, finite numbers, `hidden`, true or false, and `scale`, if any, from 0.4 to 4; other fields
86
+ * are passed over. A state that puts the tracing paper of `size` at its scale wholly off the sheet
87
+ * is a TypeError, as is anything else that is not such a state.
40
88
  */
41
89
  export function tracingStateOf(value, size) {
42
90
  const state = tracingFieldsOf(value, "tracing");
43
- if (whollyOff(state.at, size)) {
91
+ if (whollyOff(state.at, scaled(size, scaleIn(state)))) {
44
92
  throw new TypeError(`tracing.at: ${shown(state.at)} puts the tracing paper wholly off the sheet`);
45
93
  }
46
94
  return state;
47
95
  }
48
96
  /**
49
97
  * The fields of a tracing state at `path`, checked and frozen: `at`, [x, y] in units, finite
50
- * numbers, and `hidden`, true or false; other fields are passed over. Anything else is a
51
- * TypeError. Where it lies on the sheet is the caller's to check.
98
+ * numbers, `hidden`, true or false, and `scale`, from 0.4 to 4, 1 where it is absent; other
99
+ * fields are passed over. Anything else is a TypeError. Where it lies on the sheet is the caller's
100
+ * to check.
52
101
  */
53
102
  export function tracingFieldsOf(value, path) {
54
103
  const fields = record(value, path);
@@ -61,17 +110,47 @@ export function tracingFieldsOf(value, path) {
61
110
  if (typeof fields.hidden !== "boolean") {
62
111
  throw new TypeError(`${path}.hidden: true or false, not ${shown(fields.hidden)}`);
63
112
  }
113
+ const scale = fields.scale ?? 1;
114
+ if (typeof scale !== "number" ||
115
+ !Number.isFinite(scale) ||
116
+ scale < SCALE.min ||
117
+ scale > SCALE.max) {
118
+ throw new TypeError(`${path}.scale: a number from ${SCALE.min} to ${SCALE.max}, not ${shown(scale)}`);
119
+ }
64
120
  const [x, y] = at;
65
- return Object.freeze({ at: Object.freeze([x, y]), hidden: fields.hidden });
121
+ return Object.freeze({ at: Object.freeze([x, y]), hidden: fields.hidden, scale });
66
122
  }
67
123
  /** Whether the tracing paper of `size` at `at` lies wholly off the sheet, touching it at most. */
68
124
  export function whollyOff(at, size) {
69
125
  const [x, y] = at;
70
- return x >= SHEET.width || y >= SHEET.height || x + size.width <= 0 || y + size.height <= 0;
126
+ return x >= REACH.width || y >= REACH.height || x + size.width <= 0 || y + size.height <= 0;
127
+ }
128
+ /** The most statements a reading holds, as the attempt's tasks are (R162 spec). */
129
+ const STATEMENTS = 20;
130
+ /**
131
+ * A reading of the statement a consumer gives (R89), checked and frozen: `state` "ready" or
132
+ * "busy", or "done" with `statements`, from none to 20 strings; other fields are passed over.
133
+ * Anything else is a TypeError.
134
+ */
135
+ export function readingOf(value) {
136
+ const fields = record(value, "reading");
137
+ const state = fields.state;
138
+ if (state === "ready" || state === "busy")
139
+ return Object.freeze({ state });
140
+ if (state !== "done") {
141
+ throw new TypeError(`reading.state: "ready", "busy" or "done", not ${shown(state)}`);
142
+ }
143
+ const statements = fields.statements;
144
+ if (!Array.isArray(statements) ||
145
+ statements.length > STATEMENTS ||
146
+ !statements.every((each) => typeof each === "string")) {
147
+ throw new TypeError(`reading.statements: up to ${STATEMENTS} strings, the statements read, not ${shown(statements)}`);
148
+ }
149
+ return Object.freeze({ state, statements: Object.freeze([...statements]) });
71
150
  }
72
151
  /** Whether two tracing states say the same. */
73
152
  export function sameTracing(a, b) {
74
- return a.at[0] === b.at[0] && a.at[1] === b.at[1] && a.hidden === b.hidden;
153
+ return (a.at[0] === b.at[0] && a.at[1] === b.at[1] && a.hidden === b.hidden && scaleIn(a) === scaleIn(b));
75
154
  }
76
155
  /** The tracing paper's rectangle on the sheet, in units. */
77
156
  export function rectOf(at, size) {
@@ -83,8 +162,8 @@ export function rectOf(at, size) {
83
162
  */
84
163
  export function keptOn(at, size) {
85
164
  return Object.freeze([
86
- clamp(at[0], 0, Math.max(0, SHEET.width - size.width)),
87
- clamp(at[1], 0, Math.max(0, SHEET.height - size.height)),
165
+ clamp(at[0], 0, Math.max(0, REACH.width - size.width)),
166
+ clamp(at[1], 0, Math.max(0, REACH.height - size.height)),
88
167
  ]);
89
168
  }
90
169
  /** Whether a point of the sheet lies on the tracing paper, its edges too. */
@@ -93,27 +172,27 @@ export function onTracing(point, at, size) {
93
172
  return point.x >= minX && point.x <= maxX && point.y >= minY && point.y <= maxY;
94
173
  }
95
174
  /**
96
- * A point of the sheet as a stroke on the tracing paper holds it: from the paper's top left corner,
97
- * kept to the paper (R74 spec).
175
+ * A point of the sheet as a stroke on the tracing paper of `size` at `scale` holds it: from the
176
+ * paper's top left corner, in its own units, kept to the paper (R74 spec; R89).
98
177
  */
99
- export function toTracing(point, at, size) {
178
+ export function toTracing(point, at, size, scale = 1) {
100
179
  return {
101
- x: clamp(point.x - at[0], 0, size.width),
102
- y: clamp(point.y - at[1], 0, size.height),
180
+ x: clamp((point.x - at[0]) / scale, 0, size.width),
181
+ y: clamp((point.y - at[1]) / scale, 0, size.height),
103
182
  };
104
183
  }
105
184
  /**
106
- * A stroke of the tracing paper where it lies on the sheet: its points moved by `at`, and kept to
107
- * the sheet, should the paper lie in part beyond it — the rules of the groups and the crop hold on
185
+ * A stroke of the tracing paper where it lies on the sheet: its points scaled by `scale` and moved
186
+ * by `at`, and kept to the sheet, should the paper lie in part beyond it — the rules of the groups and the crop hold on
108
187
  * the sheet alone (R24, R25). The same ID, kind and times.
109
188
  */
110
- export function onSheet(stroke, at) {
189
+ export function onSheet(stroke, at, scale = 1) {
111
190
  return Object.freeze({
112
191
  id: stroke.id,
113
192
  kind: stroke.kind,
114
193
  points: Object.freeze(stroke.points.map(({ x, y, t, p }) => Object.freeze({
115
- x: clamp(x + at[0], 0, SHEET.width),
116
- y: clamp(y + at[1], 0, SHEET.height),
194
+ x: clamp(x * scale + at[0], 0, REACH.width),
195
+ y: clamp(y * scale + at[1], 0, REACH.height),
117
196
  t,
118
197
  p,
119
198
  }))),
@@ -124,12 +203,12 @@ export function onSheet(stroke, at) {
124
203
  * paper: the box of `onSheet`'s points, for moving and keeping to the sheet keep the order of the
125
204
  * numbers, without a copy of the stroke.
126
205
  */
127
- export function boxOnSheet(box, at) {
206
+ export function boxOnSheet(box, at, scale = 1) {
128
207
  return {
129
- minX: clamp(box.minX + at[0], 0, SHEET.width),
130
- minY: clamp(box.minY + at[1], 0, SHEET.height),
131
- maxX: clamp(box.maxX + at[0], 0, SHEET.width),
132
- maxY: clamp(box.maxY + at[1], 0, SHEET.height),
208
+ minX: clamp(box.minX * scale + at[0], 0, REACH.width),
209
+ minY: clamp(box.minY * scale + at[1], 0, REACH.height),
210
+ maxX: clamp(box.maxX * scale + at[0], 0, REACH.width),
211
+ maxY: clamp(box.maxY * scale + at[1], 0, REACH.height),
133
212
  };
134
213
  }
135
214
  /**
@@ -138,10 +217,10 @@ export function boxOnSheet(box, at) {
138
217
  */
139
218
  export function tenthsOf(rect) {
140
219
  return {
141
- minX: tenths(clamp(rect.minX, 0, SHEET.width)),
142
- minY: tenths(clamp(rect.minY, 0, SHEET.height)),
143
- maxX: tenths(clamp(rect.maxX, 0, SHEET.width)),
144
- maxY: tenths(clamp(rect.maxY, 0, SHEET.height)),
220
+ minX: tenths(clamp(rect.minX, 0, REACH.width)),
221
+ minY: tenths(clamp(rect.minY, 0, REACH.height)),
222
+ maxX: tenths(clamp(rect.maxX, 0, REACH.width)),
223
+ maxY: tenths(clamp(rect.maxY, 0, REACH.height)),
145
224
  };
146
225
  }
147
226
  /**
@@ -44,17 +44,49 @@ export declare const ICONS: {
44
44
  readonly viewBox: "0 0 24 24";
45
45
  readonly paths: readonly ["M5 19q-.825 0-1.412-.587T3 17V8q-.425 0-.712-.288T2 7t.288-.712T3 6h3v-.5q0-.425.288-.712T7 4.5h2q.425 0 .713.288T10 5.5V6h3q.425 0 .713.288T14 7t-.288.713T13 8v9q0 .825-.587 1.413T11 19zm11-1q-.425 0-.712-.288T15 17t.288-.712T16 16h2q.425 0 .713.288T19 17t-.288.713T18 18zm0-4q-.425 0-.712-.288T15 13t.288-.712T16 12h4q.425 0 .713.288T21 13t-.288.713T20 14zm0-4q-.425 0-.712-.288T15 9t.288-.712T16 8h5q.425 0 .713.288T22 9t-.288.713T21 10zM5 8v9h6V8z"];
46
46
  };
47
- readonly "zoom-in-outline-rounded": {
47
+ readonly "pan-tool-outline-rounded": {
48
48
  readonly viewBox: "0 0 24 24";
49
- readonly paths: readonly ["M8.5 10.5h-1q-.425 0-.712-.288T6.5 9.5t.288-.712T7.5 8.5h1v-1q0-.425.288-.712T9.5 6.5t.713.288t.287.712v1h1q.425 0 .713.288t.287.712t-.288.713t-.712.287h-1v1q0 .425-.288.713T9.5 12.5t-.712-.288T8.5 11.5zm1 5.5q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"];
49
+ readonly paths: readonly ["M10.05 23q-.75 0-1.4-.337T7.575 21.7l-5.9-8.65q-.2-.3-.175-.65t.3-.6q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v11.5q0 .6-.537.888t-1.038-.063l-2.125-1.5l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zm2.662-21.712Q13 1.575 13 2v9q0 .425-.288.713T12 12t-.712-.288T11 11V2q0-.425.288-.712T12 1t.713.288m4 1Q17 2.575 17 3v8q0 .425-.288.713T16 12t-.712-.288T15 11V3q0-.425.288-.712T16 2t.713.288M12.15 16.5"];
50
50
  };
51
- readonly "zoom-out-outline-rounded": {
51
+ readonly "pan-tool-rounded": {
52
52
  readonly viewBox: "0 0 24 24";
53
- readonly paths: readonly ["M8 10.5q-.425 0-.712-.288T7 9.5t.288-.712T8 8.5h3q.425 0 .713.288T12 9.5t-.288.713T11 10.5zM9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"];
53
+ readonly paths: readonly ["M10.05 23q-.75 0-1.4-.337T7.575 21.7l-5.9-8.65q-.2-.3-.175-.65t.3-.6q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v8h2V2q0-.425.288-.712T12 1t.713.288T13 2v10h2V3q0-.425.288-.712T16 2t.713.288T17 3v9h2V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23z"];
54
54
  };
55
- readonly "touch-app-outline-rounded": {
55
+ readonly "background-dot-small-outline-rounded": {
56
56
  readonly viewBox: "0 0 24 24";
57
- readonly paths: readonly ["M10.475 22q-.7 0-1.312-.3t-1.038-.85L3.1 14.475q-.2-.225-.175-.537t.225-.513q.5-.525 1.2-.625t1.3.275L7.5 14.2V6q0-.425.288-.712T8.5 5t.725.288t.3.712v10q0 .575-.513.863T8 16.85l-.9-.55l2.6 3.325q.15.175.35.275t.425.1H16q.825 0 1.413-.587T18 18v-4q0-.425-.288-.712T17 13h-4.475q-.425 0-.712-.288T11.525 12t.288-.712t.712-.288H17q1.25 0 2.125.875T20 14v4q0 1.65-1.175 2.825T16 22zm1.5-13q-.425 0-.712-.288T10.975 8q0-.05.125-.5q.2-.35.3-.712T11.5 6q0-1.25-.875-2.125T8.5 3t-2.125.875T5.5 6q0 .425.1.788t.3.712q.075.125.1.25t.025.25q0 .425-.275.713T5.05 9q-.275 0-.512-.15t-.363-.375q-.325-.55-.5-1.175T3.5 6q0-2.075 1.463-3.537T8.5 1t3.538 1.463T13.5 6q0 .675-.175 1.3t-.5 1.175q-.125.225-.35.375t-.5.15"];
57
+ readonly paths: readonly ["M8.563 17.563Q9 17.125 9 16.5t-.437-1.062T7.5 15t-1.062.438T6 16.5t.438 1.063T7.5 18t1.063-.437m0-9Q9 8.124 9 7.5t-.437-1.062T7.5 6t-1.062.438T6 7.5t.438 1.063T7.5 9t1.063-.437m0 4.5Q9 12.625 9 12t-.437-1.062T7.5 10.5t-1.062.438T6 12t.438 1.063T7.5 13.5t1.063-.437m9 4.5Q18 17.125 18 16.5t-.437-1.062T16.5 15t-1.062.438T15 16.5t.438 1.063T16.5 18t1.063-.437m0-9Q18 8.124 18 7.5t-.437-1.062T16.5 6t-1.062.438T15 7.5t.438 1.063T16.5 9t1.063-.437M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zM5 5v14zm12.563 8.063Q18 12.625 18 12t-.437-1.062T16.5 10.5t-1.062.438T15 12t.438 1.063t1.062.437t1.063-.437m-4.5-4.5q.437-.438.437-1.063t-.437-1.062T12 6t-1.062.438T10.5 7.5t.438 1.063T12 9t1.063-.437m0 9q.437-.438.437-1.063t-.437-1.062T12 15t-1.062.438T10.5 16.5t.438 1.063T12 18t1.063-.437m0-4.5q.437-.438.437-1.063t-.437-1.062T12 10.5t-1.062.438T10.5 12t.438 1.063T12 13.5t1.063-.437"];
58
+ };
59
+ readonly "view-headline-outline-rounded": {
60
+ readonly viewBox: "0 0 24 24";
61
+ readonly paths: readonly ["M4.975 15q-.425 0-.7-.288T4 14t.288-.712T5 13h14.025q.425 0 .7.288T20 14t-.288.713T19 15zm0 4q-.425 0-.7-.288T4 18t.288-.712T5 17h14.025q.425 0 .7.288T20 18t-.288.713T19 19zm0-8q-.425 0-.7-.288T4 10t.288-.712T5 9h14.025q.425 0 .7.288T20 10t-.288.713T19 11zm0-4q-.425 0-.7-.288T4 6t.288-.712T5 5h14.025q.425 0 .7.288T20 6t-.288.713T19 7z"];
62
+ };
63
+ readonly "crop-square-outline-rounded": {
64
+ readonly viewBox: "0 0 24 24";
65
+ readonly paths: readonly ["M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5z"];
66
+ };
67
+ readonly "grid-on-outline-rounded": {
68
+ readonly viewBox: "0 0 24 24";
69
+ readonly paths: readonly ["M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h3.325v-3.325H5zm5.325 0h3.35v-3.325h-3.35zm5.35 0H19v-3.325h-3.325zM5 13.675h3.325v-3.35H5zm5.325 0h3.35v-3.35h-3.35zm5.35 0H19v-3.35h-3.325zM5 8.325h3.325V5H5zm5.325 0h3.35V5h-3.35zm5.35 0H19V5h-3.325z"];
70
+ };
71
+ readonly "remove-outline-rounded": {
72
+ readonly viewBox: "0 0 24 24";
73
+ readonly paths: readonly ["M6 13q-.425 0-.712-.288T5 12t.288-.712T6 11h12q.425 0 .713.288T19 12t-.288.713T18 13z"];
74
+ };
75
+ readonly "add-outline-rounded": {
76
+ readonly viewBox: "0 0 24 24";
77
+ readonly paths: readonly ["M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"];
78
+ };
79
+ readonly "fit-screen-outline-rounded": {
80
+ readonly viewBox: "0 0 24 24";
81
+ readonly paths: readonly ["M20 8V6h-2q-.425 0-.712-.288T17 5t.288-.712T18 4h2q.825 0 1.413.588T22 6v2q0 .425-.288.713T21 9t-.712-.288T20 8M2 8V6q0-.825.588-1.412T4 4h2q.425 0 .713.288T7 5t-.288.713T6 6H4v2q0 .425-.288.713T3 9t-.712-.288T2 8m18 12h-2q-.425 0-.712-.288T17 19t.288-.712T18 18h2v-2q0-.425.288-.712T21 15t.713.288T22 16v2q0 .825-.587 1.413T20 20M4 20q-.825 0-1.412-.587T2 18v-2q0-.425.288-.712T3 15t.713.288T4 16v2h2q.425 0 .713.288T7 19t-.288.713T6 20zm2-6v-4q0-.825.588-1.412T8 8h8q.825 0 1.413.588T18 10v4q0 .825-.587 1.413T16 16H8q-.825 0-1.412-.587T6 14m2 0h8v-4H8zm0 0v-4z"];
82
+ };
83
+ readonly "auto-awesome-outline-rounded": {
84
+ readonly viewBox: "0 0 24 24";
85
+ readonly paths: readonly ["M19 8.3q-.125 0-.263-.075T18.55 8l-.8-1.75l-1.75-.8q-.15-.05-.225-.187T15.7 5q0-.125.075-.262T16 4.55l1.75-.8l.8-1.75q.05-.15.188-.225T19 1.7q.125 0 .263.075T19.45 2l.8 1.75l1.75.8q.15.05.225.188T22.3 5q0 .125-.075.263T22 5.45l-1.75.8l-.8 1.75q-.05.15-.188.225T19 8.3Zm0 14q-.125 0-.263-.075T18.55 22l-.8-1.75l-1.75-.8q-.15-.05-.225-.188T15.7 19q0-.125.075-.263T16 18.55l1.75-.8l.8-1.75q.05-.15.188-.225T19 15.7q.125 0 .263.075t.187.225l.8 1.75l1.75.8q.15.05.225.188T22.3 19q0 .125-.075.263T22 19.45l-1.75.8l-.8 1.75q-.05.15-.188.225T19 22.3ZM9 18.575q-.275 0-.525-.15T8.1 18l-1.6-3.5L3 12.9q-.275-.125-.425-.375T2.425 12q0-.275.15-.525T3 11.1l3.5-1.6L8.1 6q.125-.275.375-.425T9 5.425q.275 0 .525.15T9.9 6l1.6 3.5l3.5 1.6q.275.125.425.375t.15.525q0 .275-.15.525T15 12.9l-3.5 1.6L9.9 18q-.125.275-.375.425t-.525.15Zm0-3.425L10 13l2.15-1L10 11L9 8.85L8 11l-2.15 1L8 13l1 2.15ZM9 12Z"];
86
+ };
87
+ readonly "image-outline-rounded": {
88
+ readonly viewBox: "0 0 24 24";
89
+ readonly paths: readonly ["M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17"];
58
90
  };
59
91
  };
60
92
  /** The name of an icon of the row. */
@@ -105,19 +137,54 @@ export declare const ROW: {
105
137
  readonly filled: "delete-sweep-outline-rounded";
106
138
  readonly mirrored: false;
107
139
  };
108
- readonly zoomIn: {
109
- readonly outline: "zoom-in-outline-rounded";
110
- readonly filled: "zoom-in-outline-rounded";
140
+ readonly hand: {
141
+ readonly outline: "pan-tool-outline-rounded";
142
+ readonly filled: "pan-tool-rounded";
143
+ readonly mirrored: false;
144
+ };
145
+ readonly gridDots: {
146
+ readonly outline: "background-dot-small-outline-rounded";
147
+ readonly filled: "background-dot-small-outline-rounded";
148
+ readonly mirrored: false;
149
+ };
150
+ readonly gridLines: {
151
+ readonly outline: "view-headline-outline-rounded";
152
+ readonly filled: "view-headline-outline-rounded";
153
+ readonly mirrored: false;
154
+ };
155
+ readonly gridBlank: {
156
+ readonly outline: "crop-square-outline-rounded";
157
+ readonly filled: "crop-square-outline-rounded";
158
+ readonly mirrored: false;
159
+ };
160
+ readonly gridSquares: {
161
+ readonly outline: "grid-on-outline-rounded";
162
+ readonly filled: "grid-on-outline-rounded";
111
163
  readonly mirrored: false;
112
164
  };
113
165
  readonly zoomOut: {
114
- readonly outline: "zoom-out-outline-rounded";
115
- readonly filled: "zoom-out-outline-rounded";
166
+ readonly outline: "remove-outline-rounded";
167
+ readonly filled: "remove-outline-rounded";
168
+ readonly mirrored: false;
169
+ };
170
+ readonly zoomIn: {
171
+ readonly outline: "add-outline-rounded";
172
+ readonly filled: "add-outline-rounded";
173
+ readonly mirrored: false;
174
+ };
175
+ readonly fit: {
176
+ readonly outline: "fit-screen-outline-rounded";
177
+ readonly filled: "fit-screen-outline-rounded";
178
+ readonly mirrored: false;
179
+ };
180
+ readonly recognise: {
181
+ readonly outline: "auto-awesome-outline-rounded";
182
+ readonly filled: "auto-awesome-outline-rounded";
116
183
  readonly mirrored: false;
117
184
  };
118
- readonly finger: {
119
- readonly outline: "touch-app-outline-rounded";
120
- readonly filled: "touch-app-outline-rounded";
185
+ readonly original: {
186
+ readonly outline: "image-outline-rounded";
187
+ readonly filled: "image-outline-rounded";
121
188
  readonly mirrored: false;
122
189
  };
123
190
  };
@@ -70,22 +70,70 @@ export const ICONS = {
70
70
  "M5 19q-.825 0-1.412-.587T3 17V8q-.425 0-.712-.288T2 7t.288-.712T3 6h3v-.5q0-.425.288-.712T7 4.5h2q.425 0 .713.288T10 5.5V6h3q.425 0 .713.288T14 7t-.288.713T13 8v9q0 .825-.587 1.413T11 19zm11-1q-.425 0-.712-.288T15 17t.288-.712T16 16h2q.425 0 .713.288T19 17t-.288.713T18 18zm0-4q-.425 0-.712-.288T15 13t.288-.712T16 12h4q.425 0 .713.288T21 13t-.288.713T20 14zm0-4q-.425 0-.712-.288T15 9t.288-.712T16 8h5q.425 0 .713.288T22 9t-.288.713T21 10zM5 8v9h6V8z",
71
71
  ],
72
72
  },
73
- "zoom-in-outline-rounded": {
73
+ "pan-tool-outline-rounded": {
74
74
  viewBox: "0 0 24 24",
75
75
  paths: [
76
- "M8.5 10.5h-1q-.425 0-.712-.288T6.5 9.5t.288-.712T7.5 8.5h1v-1q0-.425.288-.712T9.5 6.5t.713.288t.287.712v1h1q.425 0 .713.288t.287.712t-.288.713t-.712.287h-1v1q0 .425-.288.713T9.5 12.5t-.712-.288T8.5 11.5zm1 5.5q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14",
76
+ "M10.05 23q-.75 0-1.4-.337T7.575 21.7l-5.9-8.65q-.2-.3-.175-.65t.3-.6q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v11.5q0 .6-.537.888t-1.038-.063l-2.125-1.5l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zm2.662-21.712Q13 1.575 13 2v9q0 .425-.288.713T12 12t-.712-.288T11 11V2q0-.425.288-.712T12 1t.713.288m4 1Q17 2.575 17 3v8q0 .425-.288.713T16 12t-.712-.288T15 11V3q0-.425.288-.712T16 2t.713.288M12.15 16.5",
77
77
  ],
78
78
  },
79
- "zoom-out-outline-rounded": {
79
+ "pan-tool-rounded": {
80
80
  viewBox: "0 0 24 24",
81
81
  paths: [
82
- "M8 10.5q-.425 0-.712-.288T7 9.5t.288-.712T8 8.5h3q.425 0 .713.288T12 9.5t-.288.713T11 10.5zM9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14",
82
+ "M10.05 23q-.75 0-1.4-.337T7.575 21.7l-5.9-8.65q-.2-.3-.175-.65t.3-.6q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v8h2V2q0-.425.288-.712T12 1t.713.288T13 2v10h2V3q0-.425.288-.712T16 2t.713.288T17 3v9h2V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23z",
83
83
  ],
84
84
  },
85
- "touch-app-outline-rounded": {
85
+ "background-dot-small-outline-rounded": {
86
86
  viewBox: "0 0 24 24",
87
87
  paths: [
88
- "M10.475 22q-.7 0-1.312-.3t-1.038-.85L3.1 14.475q-.2-.225-.175-.537t.225-.513q.5-.525 1.2-.625t1.3.275L7.5 14.2V6q0-.425.288-.712T8.5 5t.725.288t.3.712v10q0 .575-.513.863T8 16.85l-.9-.55l2.6 3.325q.15.175.35.275t.425.1H16q.825 0 1.413-.587T18 18v-4q0-.425-.288-.712T17 13h-4.475q-.425 0-.712-.288T11.525 12t.288-.712t.712-.288H17q1.25 0 2.125.875T20 14v4q0 1.65-1.175 2.825T16 22zm1.5-13q-.425 0-.712-.288T10.975 8q0-.05.125-.5q.2-.35.3-.712T11.5 6q0-1.25-.875-2.125T8.5 3t-2.125.875T5.5 6q0 .425.1.788t.3.712q.075.125.1.25t.025.25q0 .425-.275.713T5.05 9q-.275 0-.512-.15t-.363-.375q-.325-.55-.5-1.175T3.5 6q0-2.075 1.463-3.537T8.5 1t3.538 1.463T13.5 6q0 .675-.175 1.3t-.5 1.175q-.125.225-.35.375t-.5.15",
88
+ "M8.563 17.563Q9 17.125 9 16.5t-.437-1.062T7.5 15t-1.062.438T6 16.5t.438 1.063T7.5 18t1.063-.437m0-9Q9 8.124 9 7.5t-.437-1.062T7.5 6t-1.062.438T6 7.5t.438 1.063T7.5 9t1.063-.437m0 4.5Q9 12.625 9 12t-.437-1.062T7.5 10.5t-1.062.438T6 12t.438 1.063T7.5 13.5t1.063-.437m9 4.5Q18 17.125 18 16.5t-.437-1.062T16.5 15t-1.062.438T15 16.5t.438 1.063T16.5 18t1.063-.437m0-9Q18 8.124 18 7.5t-.437-1.062T16.5 6t-1.062.438T15 7.5t.438 1.063T16.5 9t1.063-.437M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zM5 5v14zm12.563 8.063Q18 12.625 18 12t-.437-1.062T16.5 10.5t-1.062.438T15 12t.438 1.063t1.062.437t1.063-.437m-4.5-4.5q.437-.438.437-1.063t-.437-1.062T12 6t-1.062.438T10.5 7.5t.438 1.063T12 9t1.063-.437m0 9q.437-.438.437-1.063t-.437-1.062T12 15t-1.062.438T10.5 16.5t.438 1.063T12 18t1.063-.437m0-4.5q.437-.438.437-1.063t-.437-1.062T12 10.5t-1.062.438T10.5 12t.438 1.063T12 13.5t1.063-.437",
89
+ ],
90
+ },
91
+ "view-headline-outline-rounded": {
92
+ viewBox: "0 0 24 24",
93
+ paths: [
94
+ "M4.975 15q-.425 0-.7-.288T4 14t.288-.712T5 13h14.025q.425 0 .7.288T20 14t-.288.713T19 15zm0 4q-.425 0-.7-.288T4 18t.288-.712T5 17h14.025q.425 0 .7.288T20 18t-.288.713T19 19zm0-8q-.425 0-.7-.288T4 10t.288-.712T5 9h14.025q.425 0 .7.288T20 10t-.288.713T19 11zm0-4q-.425 0-.7-.288T4 6t.288-.712T5 5h14.025q.425 0 .7.288T20 6t-.288.713T19 7z",
95
+ ],
96
+ },
97
+ "crop-square-outline-rounded": {
98
+ viewBox: "0 0 24 24",
99
+ paths: [
100
+ "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5z",
101
+ ],
102
+ },
103
+ "grid-on-outline-rounded": {
104
+ viewBox: "0 0 24 24",
105
+ paths: [
106
+ "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h3.325v-3.325H5zm5.325 0h3.35v-3.325h-3.35zm5.35 0H19v-3.325h-3.325zM5 13.675h3.325v-3.35H5zm5.325 0h3.35v-3.35h-3.35zm5.35 0H19v-3.35h-3.325zM5 8.325h3.325V5H5zm5.325 0h3.35V5h-3.35zm5.35 0H19V5h-3.325z",
107
+ ],
108
+ },
109
+ "remove-outline-rounded": {
110
+ viewBox: "0 0 24 24",
111
+ paths: [
112
+ "M6 13q-.425 0-.712-.288T5 12t.288-.712T6 11h12q.425 0 .713.288T19 12t-.288.713T18 13z",
113
+ ],
114
+ },
115
+ "add-outline-rounded": {
116
+ viewBox: "0 0 24 24",
117
+ paths: [
118
+ "M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z",
119
+ ],
120
+ },
121
+ "fit-screen-outline-rounded": {
122
+ viewBox: "0 0 24 24",
123
+ paths: [
124
+ "M20 8V6h-2q-.425 0-.712-.288T17 5t.288-.712T18 4h2q.825 0 1.413.588T22 6v2q0 .425-.288.713T21 9t-.712-.288T20 8M2 8V6q0-.825.588-1.412T4 4h2q.425 0 .713.288T7 5t-.288.713T6 6H4v2q0 .425-.288.713T3 9t-.712-.288T2 8m18 12h-2q-.425 0-.712-.288T17 19t.288-.712T18 18h2v-2q0-.425.288-.712T21 15t.713.288T22 16v2q0 .825-.587 1.413T20 20M4 20q-.825 0-1.412-.587T2 18v-2q0-.425.288-.712T3 15t.713.288T4 16v2h2q.425 0 .713.288T7 19t-.288.713T6 20zm2-6v-4q0-.825.588-1.412T8 8h8q.825 0 1.413.588T18 10v4q0 .825-.587 1.413T16 16H8q-.825 0-1.412-.587T6 14m2 0h8v-4H8zm0 0v-4z",
125
+ ],
126
+ },
127
+ "auto-awesome-outline-rounded": {
128
+ viewBox: "0 0 24 24",
129
+ paths: [
130
+ "M19 8.3q-.125 0-.263-.075T18.55 8l-.8-1.75l-1.75-.8q-.15-.05-.225-.187T15.7 5q0-.125.075-.262T16 4.55l1.75-.8l.8-1.75q.05-.15.188-.225T19 1.7q.125 0 .263.075T19.45 2l.8 1.75l1.75.8q.15.05.225.188T22.3 5q0 .125-.075.263T22 5.45l-1.75.8l-.8 1.75q-.05.15-.188.225T19 8.3Zm0 14q-.125 0-.263-.075T18.55 22l-.8-1.75l-1.75-.8q-.15-.05-.225-.188T15.7 19q0-.125.075-.263T16 18.55l1.75-.8l.8-1.75q.05-.15.188-.225T19 15.7q.125 0 .263.075t.187.225l.8 1.75l1.75.8q.15.05.225.188T22.3 19q0 .125-.075.263T22 19.45l-1.75.8l-.8 1.75q-.05.15-.188.225T19 22.3ZM9 18.575q-.275 0-.525-.15T8.1 18l-1.6-3.5L3 12.9q-.275-.125-.425-.375T2.425 12q0-.275.15-.525T3 11.1l3.5-1.6L8.1 6q.125-.275.375-.425T9 5.425q.275 0 .525.15T9.9 6l1.6 3.5l3.5 1.6q.275.125.425.375t.15.525q0 .275-.15.525T15 12.9l-3.5 1.6L9.9 18q-.125.275-.375.425t-.525.15Zm0-3.425L10 13l2.15-1L10 11L9 8.85L8 11l-2.15 1L8 13l1 2.15ZM9 12Z",
131
+ ],
132
+ },
133
+ "image-outline-rounded": {
134
+ viewBox: "0 0 24 24",
135
+ paths: [
136
+ "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5zm0 0V5zm2-2h10q.3 0 .45-.275t-.05-.525l-2.75-3.675q-.15-.2-.4-.2t-.4.2L11.25 16L9.4 13.525q-.15-.2-.4-.2t-.4.2l-2 2.675q-.2.25-.05.525T7 17",
89
137
  ],
90
138
  },
91
139
  };
@@ -119,19 +167,38 @@ export const ROW = {
119
167
  filled: "delete-sweep-outline-rounded",
120
168
  mirrored: false,
121
169
  },
122
- zoomIn: {
123
- outline: "zoom-in-outline-rounded",
124
- filled: "zoom-in-outline-rounded",
170
+ hand: { outline: "pan-tool-outline-rounded", filled: "pan-tool-rounded", mirrored: false },
171
+ gridDots: {
172
+ outline: "background-dot-small-outline-rounded",
173
+ filled: "background-dot-small-outline-rounded",
174
+ mirrored: false,
175
+ },
176
+ gridLines: {
177
+ outline: "view-headline-outline-rounded",
178
+ filled: "view-headline-outline-rounded",
179
+ mirrored: false,
180
+ },
181
+ gridBlank: {
182
+ outline: "crop-square-outline-rounded",
183
+ filled: "crop-square-outline-rounded",
184
+ mirrored: false,
185
+ },
186
+ gridSquares: {
187
+ outline: "grid-on-outline-rounded",
188
+ filled: "grid-on-outline-rounded",
125
189
  mirrored: false,
126
190
  },
127
- zoomOut: {
128
- outline: "zoom-out-outline-rounded",
129
- filled: "zoom-out-outline-rounded",
191
+ zoomOut: { outline: "remove-outline-rounded", filled: "remove-outline-rounded", mirrored: false },
192
+ zoomIn: { outline: "add-outline-rounded", filled: "add-outline-rounded", mirrored: false },
193
+ fit: {
194
+ outline: "fit-screen-outline-rounded",
195
+ filled: "fit-screen-outline-rounded",
130
196
  mirrored: false,
131
197
  },
132
- finger: {
133
- outline: "touch-app-outline-rounded",
134
- filled: "touch-app-outline-rounded",
198
+ recognise: {
199
+ outline: "auto-awesome-outline-rounded",
200
+ filled: "auto-awesome-outline-rounded",
135
201
  mirrored: false,
136
202
  },
203
+ original: { outline: "image-outline-rounded", filled: "image-outline-rounded", mirrored: false },
137
204
  };
@@ -1,4 +1,4 @@
1
- import type { CanvasElement, CanvasEventMap, ExportedWork, Media, PaperTask, TracingState } from "@altnovatrail/spec/canvas";
1
+ import type { CanvasElement, CanvasEventMap, ExportedWork, Media, PaperGrid, PaperTask, TracingReading, TracingState } from "@altnovatrail/spec/canvas";
2
2
  import { type Filled } from "../core/boxes.js";
3
3
  import { type DemoState, type WorkedExample } from "../core/example.js";
4
4
  import { type HistoryEvent } from "../core/history.js";
@@ -13,7 +13,7 @@ import { type Task, type Tool } from "../core/task.js";
13
13
  * media and the tutor's marks too. The crop and a task with its temporary tools are the element's
14
14
  * own (R26, R41).
15
15
  */
16
- export type { Box, CanvasElement, CanvasEventMap, DemoChangeEvent, ExportedCell, ExportedPaper, ExportedSheet, ExportedWork, ExportedWorkbook, HistoryChange, HistoryChangeEvent, Media, PaperTask, ToolChange, ToolChangeEvent, TracingChangeEvent, TracingState, } from "@altnovatrail/spec/canvas";
16
+ export type { Box, CanvasElement, CanvasEventMap, DemoChangeEvent, ExportedCell, ExportedPaper, ExportedSheet, ExportedWork, ExportedWorkbook, GridChange, GridChangeEvent, HistoryChange, HistoryChangeEvent, Media, PaperGrid, PaperTask, ToolChange, ToolChangeEvent, TracingChangeEvent, TracingReadEvent, TracingReading, TracingState, } from "@altnovatrail/spec/canvas";
17
17
  export type { Filled, Filling } from "../core/boxes.js";
18
18
  export type { Crop, Frame } from "../core/crop.js";
19
19
  export type { DemoState, WorkedExample } from "../core/example.js";
@@ -36,12 +36,13 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
36
36
  /** The element follows its own `lang`: its buttons are labelled in it (R07, R28). */
37
37
  static readonly observedAttributes: string[];
38
38
  /**
39
- * What a press of the primary button does: "pen" writes, as the element starts, and "eraser"
40
- * erases (R22). The learner switches it with the element's own buttons, which say a choice of
41
- * theirs with a `toolchange`, and the consumer may set it too, which says nothing (R28). A press
42
- * under way goes on as it began. A pen's eraser erases whatever the tool. A task without the
43
- * eraser has none of it: "eraser" is a TypeError then, and a new task without it puts the pen
44
- * back. A worked example has the pen alone, which writes nothing on its sheet (R42).
39
+ * What a press of the primary button does: "pen" writes, as the element starts, "eraser" erases
40
+ * (R22), and "hand" moves the sheet, under any pointer (R88). The learner switches it with the
41
+ * element's own buttons, which say a choice of theirs with a `toolchange`, and the consumer may
42
+ * set it too, which says nothing (R28). A press under way goes on as it began. A pen's eraser
43
+ * erases whatever the tool but the hand. A task without the eraser has none of it: "eraser" is a
44
+ * TypeError then, and a new task without it puts the pen back. Every sheet the learner writes on
45
+ * has the hand. A worked example has the pen alone, which writes nothing on its sheet (R42).
45
46
  */
46
47
  get tool(): Tool;
47
48
  set tool(tool: Tool);
@@ -73,8 +74,8 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
73
74
  * another replaces it, its grid and its statement apart, as a task does.
74
75
  *
75
76
  * On a worked example's sheet the learner does not write: the canvas takes no input, and a finger
76
- * or a pen there scrolls the sheet as the browser scrolls the statement. Its row has no tools of
77
- * writing and is named a worked example's. `task`, `history` other than the empty one and
77
+ * or a pen there scrolls the sheet as the browser scrolls the statement. It has no bar: its row
78
+ * holds Next and Demo, and its region is named a worked example's. `task`, `history` other than the empty one and
78
79
  * `marks` are TypeErrors, and so is an eraser: the tool is the pen alone, and `exportWork()` and
79
80
  * `filled` give null. The next segment of a lesson is a new element (R20).
80
81
  *
@@ -110,6 +111,14 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
110
111
  */
111
112
  get tracing(): TracingState | undefined;
112
113
  set tracing(state: TracingState | undefined);
114
+ /**
115
+ * The reading of the task from paper's statement in clean print (R89): `undefined` offers no
116
+ * "Recognise"; `"ready"` offers it, and its press sends a `tracingread`; `"busy"` waits; `"done"`
117
+ * holds the statements, which take the crop's place for the learner who asked, till "Original".
118
+ * Frozen; given without a task from paper, or not a reading, it is a TypeError.
119
+ */
120
+ get reading(): TracingReading | undefined;
121
+ set reading(reading: TracingReading | undefined);
113
122
  /**
114
123
  * How far the learner has gone through the worked example's demo (R42): `opened`, how many of
115
124
  * its parts are open, from the first, and `hidden`, whether the whole demo is hidden — frozen,
@@ -149,6 +158,14 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
149
158
  */
150
159
  get media(): Media | undefined;
151
160
  set media(media: Media | undefined);
161
+ /**
162
+ * The grid of the task from paper's sheet (R88): `undefined` without a task from paper, and
163
+ * "dots" as one comes. The learner turns it by the element's button, which a `gridchange`
164
+ * tells; the consumer keeps it and gives it back, which tells nothing. A grid given before the
165
+ * task from paper is a TypeError, and so is one not of `PaperGrid`; `undefined` changes nothing.
166
+ */
167
+ get grid(): PaperGrid | undefined;
168
+ set grid(grid: PaperGrid | undefined);
152
169
  /**
153
170
  * The history of writing (R22, R27): every stroke, erasing, clearing and undo on the sheet, in the
154
171
  * order they landed, at the sheet's time — frozen, and the same array until the next action. The
@@ -241,9 +258,11 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
241
258
  /**
242
259
  * The picture of the work, for the `picture` of a stored work that app puts on the server, a
243
260
  * method of the agreement with app (R83; R36 spec): the PNG of the strokes the surface shows,
244
- * with no condition — the whole sheet, or the workbook's whole page with its draft, one pixel a
245
- * unit, 1000 × 1400, whatever is filled and whether the work was sent to be checked or not; an
246
- * empty surface, and a worked example's, is white. The strokes are those `exportWork()` takes, as
261
+ * with no condition — the sheet's page, or the workbook's whole page with its draft, and the ink
262
+ * past the page, right and down, with the tracing paper where it lies (R73): one pixel a unit,
263
+ * 1000 × 1400 for the page alone, and scaled down past the page to hold no more pixels than it,
264
+ * its size in its PNG's header —, whatever is filled and whether the work was sent to be checked
265
+ * or not; an empty surface, and a worked example's, is white. The strokes are those `exportWork()` takes, as
247
266
  * the history has them: not the stroke under way, but those under an eraser not yet lifted. Each
248
267
  * is the outline the screen fills, black on white with no theme and no template — on a task from
249
268
  * paper the strokes of both layers, the tracing paper's where it lies, hidden or not, with the