@altnovatrail/canvas 0.3.39 → 0.3.41

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.
Files changed (77) hide show
  1. package/README.md +1 -1
  2. package/lib/core/boxes.d.ts +7 -7
  3. package/lib/core/boxes.js +10 -10
  4. package/lib/core/clock.d.ts +5 -5
  5. package/lib/core/clock.js +5 -5
  6. package/lib/core/crop.d.ts +13 -13
  7. package/lib/core/crop.js +10 -10
  8. package/lib/core/eraser.d.ts +6 -6
  9. package/lib/core/eraser.js +6 -6
  10. package/lib/core/example.d.ts +6 -6
  11. package/lib/core/example.js +9 -9
  12. package/lib/core/fields.d.ts +1 -1
  13. package/lib/core/fields.js +1 -1
  14. package/lib/core/geometry.d.ts +6 -5
  15. package/lib/core/geometry.js +8 -6
  16. package/lib/core/grid.d.ts +3 -3
  17. package/lib/core/grid.js +3 -3
  18. package/lib/core/groups.d.ts +14 -14
  19. package/lib/core/groups.js +6 -6
  20. package/lib/core/hands.d.ts +19 -18
  21. package/lib/core/hands.js +16 -15
  22. package/lib/core/history.d.ts +10 -10
  23. package/lib/core/history.js +6 -6
  24. package/lib/core/index.js +8 -9
  25. package/lib/core/ink.js +3 -3
  26. package/lib/core/manifest.d.ts +3 -3
  27. package/lib/core/manifest.js +6 -6
  28. package/lib/core/marks.d.ts +39 -39
  29. package/lib/core/marks.js +35 -35
  30. package/lib/core/notation.d.ts +5 -5
  31. package/lib/core/outline.d.ts +3 -3
  32. package/lib/core/outline.js +6 -6
  33. package/lib/core/page.d.ts +7 -7
  34. package/lib/core/page.js +10 -10
  35. package/lib/core/png.d.ts +3 -3
  36. package/lib/core/png.js +3 -3
  37. package/lib/core/raster.d.ts +3 -3
  38. package/lib/core/raster.js +3 -3
  39. package/lib/core/recorder.d.ts +8 -8
  40. package/lib/core/recorder.js +8 -8
  41. package/lib/core/screen.d.ts +2 -2
  42. package/lib/core/screen.js +1 -1
  43. package/lib/core/sets.d.ts +1 -1
  44. package/lib/core/sets.js +1 -1
  45. package/lib/core/sheet.d.ts +5 -5
  46. package/lib/core/sheet.js +5 -5
  47. package/lib/core/submission.d.ts +24 -24
  48. package/lib/core/submission.js +21 -21
  49. package/lib/core/task.d.ts +17 -16
  50. package/lib/core/task.js +14 -13
  51. package/lib/core/tracing.d.ts +19 -19
  52. package/lib/core/tracing.js +19 -19
  53. package/lib/core/widths.d.ts +2 -2
  54. package/lib/core/widths.js +5 -5
  55. package/lib/core/work.d.ts +19 -19
  56. package/lib/core/work.js +22 -22
  57. package/lib/core/zoom.d.ts +5 -5
  58. package/lib/core/zoom.js +5 -5
  59. package/lib/element/icons.d.ts +1 -1
  60. package/lib/element/icons.js +2 -2
  61. package/lib/element/index.d.ts +87 -87
  62. package/lib/element/index.js +286 -283
  63. package/lib/element/labels.d.ts +17 -17
  64. package/lib/element/labels.js +7 -8
  65. package/lib/element/notation.js +1 -1
  66. package/lib/element/parts.d.ts +2 -2
  67. package/lib/element/parts.js +6 -6
  68. package/lib/element/pictures.js +1 -1
  69. package/lib/element/probe.d.ts +2 -2
  70. package/lib/element/probe.js +3 -3
  71. package/lib/element/session.js +2 -2
  72. package/lib/element/statement.d.ts +2 -2
  73. package/lib/element/statement.js +6 -6
  74. package/lib/element/tools.d.ts +17 -18
  75. package/lib/element/tools.js +30 -29
  76. package/lib/element/tracing.js +8 -8
  77. package/package.json +3 -3
@@ -2,13 +2,13 @@ import type { Group } from "@altnovatrail/spec/canvas";
2
2
  import { type Box } from "./geometry.js";
3
3
  import type { Stroke } from "./ink.js";
4
4
  /**
5
- * The rule of the groups of strokes (R24): two strokes are neighbours if no more than `pause`
5
+ * The rule of the groups of strokes: two strokes are neighbours if no more than `pause`
6
6
  * milliseconds lie between them and their boxes come within `across` sheet units of each other
7
- * across the sheet and within `down` units down it. A group is the strokes a chain of neighbours
8
- * joins. The rule counts in whole numbers — tenths of a unit and milliseconds, the precision of a
9
- * sample file (R09), rounded half up as `Math.round` rounds: 1000.5 tenths are 1001 — and only
10
- * subtracts and compares them, so that tutor's runner, which groups by the same rule, gets the same
11
- * groups to the bit.
7
+ * across the sheet and within `down` units down it. A group is the strokes a chain of
8
+ * neighbours joins. The rule counts in whole numbers — tenths of a unit and milliseconds, the
9
+ * precision of a sample file, rounded half up as `Math.round` rounds: 1000.5 tenths are 1001 — and
10
+ * only subtracts and compares them, so that tutor's runner, which groups by the same rule, gets the
11
+ * same groups to the bit.
12
12
  */
13
13
  export interface GroupRule {
14
14
  /** The longest pause between two neighbours, in milliseconds. */
@@ -19,32 +19,32 @@ export interface GroupRule {
19
19
  readonly down: number;
20
20
  }
21
21
  /**
22
- * The rule the sheet groups by (R24): 2 seconds, the threshold by which studies of writing tell a
22
+ * The rule the sheet groups by: 2 seconds, the threshold by which studies of writing tell a
23
23
  * pause of writing from one of thinking, and a cell of the default grid, across and down.
24
24
  */
25
25
  export declare const GROUP_RULE: GroupRule;
26
26
  /**
27
27
  * A group of the strokes on a sheet: its label, by place, and the IDs of its strokes, in ascending
28
- * order. The labels and the IDs are the table «label → stroke IDs» of one submission (R06). spec's
29
- * type (R74 spec).
28
+ * order. The labels and the IDs are the table «label → stroke IDs» of one submission. spec's
29
+ * type.
30
30
  */
31
31
  export type { Group };
32
32
  /**
33
- * The groups of the strokes on a sheet (R24): the strokes it shows, with the times of their points
33
+ * The groups of the strokes on a sheet: the strokes it shows, with the times of their points
34
34
  * as they were written, in any order. Erased strokes are none of it: whoever groups a history
35
35
  * replays it first, and the groups come from what the sheet shows. Labelled by place, from the top
36
- * down (R09): A, B, … Z, then AA, AB, … — by the top of a group's rectangle, then its left edge.
36
+ * down: A, B, … Z, then AA, AB, … — by the top of a group's rectangle, then its left edge.
37
37
  */
38
38
  export declare function groupsOf(strokes: readonly Stroke[], rule?: GroupRule): Group[];
39
39
  /**
40
- * The pairs of neighbours among the strokes on a sheet, by ID (R24): each pair once, the smaller
40
+ * The pairs of neighbours among the strokes on a sheet, by ID: each pair once, the smaller
41
41
  * ID first, in ascending order. Its groups join these pairs; spec's test vectors give them too, for
42
- * a runner to see where its grouping parts from the sheet's (R94 spec).
42
+ * a runner to see where its grouping parts from the sheet's.
43
43
  */
44
44
  export declare function neighboursOf(strokes: readonly Stroke[], rule?: GroupRule): [number, number][];
45
45
  /**
46
46
  * The rectangle of a group on the sheet: the box around the points of its strokes, in sheet units,
47
- * of the geometry it is given — the raw strokes on the device, the recorded ones in a sample (R09).
47
+ * of the geometry it is given — the raw strokes on the device, the recorded ones in a sample.
48
48
  * Its box in the fractions of a cut-out is the cut-out's.
49
49
  */
50
50
  export declare function rectOf(ids: readonly number[], strokes: readonly Stroke[]): Box;
@@ -2,15 +2,15 @@ import RBush from "rbush";
2
2
  import { boxOf, tenths } from "./geometry.js";
3
3
  import { Sets } from "./sets.js";
4
4
  /**
5
- * The rule the sheet groups by (R24): 2 seconds, the threshold by which studies of writing tell a
5
+ * The rule the sheet groups by: 2 seconds, the threshold by which studies of writing tell a
6
6
  * pause of writing from one of thinking, and a cell of the default grid, across and down.
7
7
  */
8
8
  export const GROUP_RULE = Object.freeze({ pause: 2000, across: 50, down: 50 });
9
9
  /**
10
- * The groups of the strokes on a sheet (R24): the strokes it shows, with the times of their points
10
+ * The groups of the strokes on a sheet: the strokes it shows, with the times of their points
11
11
  * as they were written, in any order. Erased strokes are none of it: whoever groups a history
12
12
  * replays it first, and the groups come from what the sheet shows. Labelled by place, from the top
13
- * down (R09): A, B, … Z, then AA, AB, … — by the top of a group's rectangle, then its left edge.
13
+ * down: A, B, … Z, then AA, AB, … — by the top of a group's rectangle, then its left edge.
14
14
  */
15
15
  export function groupsOf(strokes, rule = GROUP_RULE) {
16
16
  const pieces = piecesOf(strokes);
@@ -32,9 +32,9 @@ export function groupsOf(strokes, rule = GROUP_RULE) {
32
32
  .map(({ ids }, n) => ({ label: labelOf(n), ids }));
33
33
  }
34
34
  /**
35
- * The pairs of neighbours among the strokes on a sheet, by ID (R24): each pair once, the smaller
35
+ * The pairs of neighbours among the strokes on a sheet, by ID: each pair once, the smaller
36
36
  * ID first, in ascending order. Its groups join these pairs; spec's test vectors give them too, for
37
- * a runner to see where its grouping parts from the sheet's (R94 spec).
37
+ * a runner to see where its grouping parts from the sheet's.
38
38
  */
39
39
  export function neighboursOf(strokes, rule = GROUP_RULE) {
40
40
  return pairsOf(piecesOf(strokes), rule)
@@ -43,7 +43,7 @@ export function neighboursOf(strokes, rule = GROUP_RULE) {
43
43
  }
44
44
  /**
45
45
  * The rectangle of a group on the sheet: the box around the points of its strokes, in sheet units,
46
- * of the geometry it is given — the raw strokes on the device, the recorded ones in a sample (R09).
46
+ * of the geometry it is given — the raw strokes on the device, the recorded ones in a sample.
47
47
  * Its box in the fractions of a cut-out is the cut-out's.
48
48
  */
49
49
  export function rectOf(ids, strokes) {
@@ -1,8 +1,8 @@
1
1
  /**
2
- * A pointer as the hands on the sheet see it (R29): where it is on the screen, how big its contact
3
- * is, and when. The DOM-free part sees no DOM (R12), so the element hands it this much of each
2
+ * A pointer as the hands on the sheet see it: where it is on the screen, how big its contact
3
+ * is, and when. The DOM-free part sees no DOM, so the element hands it this much of each
4
4
  * pointer event. The contact's size decides only what the pointer may do: it goes into no stroke,
5
- * no history and no sample (R09).
5
+ * no history and no sample.
6
6
  */
7
7
  export interface Contact {
8
8
  /** The event's `pointerId`. */
@@ -22,33 +22,34 @@ export interface Contact {
22
22
  readonly time: number;
23
23
  }
24
24
  /**
25
- * A touch wider or taller than this, in CSS pixels, is a palm (R29). WebKit on iPadOS gives a touch
25
+ * A touch wider or taller than this, in CSS pixels, is a palm. WebKit on iPadOS gives a touch
26
26
  * twice its contact's radius, a fingertip's 40–60 px by one report, so canvas-api's 30 px would
27
27
  * take most fingers there for palms. No tablet has measured it.
28
28
  */
29
29
  export declare const PALM_PX = 100;
30
30
  /**
31
- * Two touches that come down at most this many milliseconds apart are two fingers of one gesture
32
- * (R29): Android's tap timeout, 100 ms, with a margin for children's fingers.
31
+ * Two touches that come down at most this many milliseconds apart are two fingers of one gesture:
32
+ * Android's tap timeout, 100 ms, with a margin for children's fingers.
33
33
  */
34
34
  export declare const PAIR_MS = 150;
35
35
  /**
36
- * How far a touch may wander, in CSS pixels, before it is going somewhere (R29): Android's touch
36
+ * How far a touch may wander, in CSS pixels, before it is going somewhere: Android's touch
37
37
  * slop, 8 dp. A finger that has gone further is writing, and two fingers scroll once their middle
38
38
  * has gone further.
39
39
  */
40
40
  export declare const SLOP_PX = 8;
41
41
  /**
42
42
  * Two fingers that have gone this many times further along one axis than along the other, when
43
- * they pass the slop, scroll along that axis alone for the rest of the gesture (R73): a scroll
43
+ * they pass the slop, scroll along that axis alone for the rest of the gesture: a scroll
44
44
  * down a sheet does not wander sideways, nor one across it up and down. Between, they go
45
45
  * both ways.
46
46
  */
47
47
  export declare const RAIL = 2;
48
48
  /**
49
- * The pen mode (R29): on from a pen's touch on a sheet, till the page goes, with no button that
50
- * turns it off: while it is on, a finger neither writes nor erases, and moves the sheet (R84). One is shared by every sheet of a page, and
51
- * it lives in memory alone: nothing is stored or sent, and a new page starts without it.
49
+ * The pen mode: on from a pen's touch on a sheet, till the page goes, with no button that
50
+ * turns it off: while it is on, a finger neither writes nor erases, and moves the sheet. One is
51
+ * shared by every sheet of a page, and it lives in memory alone: nothing is stored or sent, and a
52
+ * new page starts without it.
52
53
  *
53
54
  * It knows, too, whether any sheet of the page is written on, and tells its sheets when the last
54
55
  * stroke ends: each bar shows the mode as it is then.
@@ -83,11 +84,11 @@ export interface HandsSheet {
83
84
  scroll(dx: number, dy: number, fresh: boolean): void;
84
85
  /**
85
86
  * Two fingers drew apart, or together, by `ratio` of the span between them: the sheet's zoom
86
- * goes by it, the point of the sheet at `x` and `y` on the screen, their middle, standing (R73).
87
+ * goes by it, the point of the sheet at `x` and `y` on the screen, their middle, standing.
87
88
  */
88
89
  zoom(ratio: number, x: number, y: number): void;
89
90
  /**
90
- * Whether the sheet scrolls across at all now: one wider than its container does (R73). A
91
+ * Whether the sheet scrolls across at all now: one wider than its container does. A
91
92
  * gesture on a sheet that does not goes by its travel down alone.
92
93
  */
93
94
  across(): boolean;
@@ -96,16 +97,16 @@ export interface HandsSheet {
96
97
  * What a pointer down on the sheet does:
97
98
  * - "writes": it may write or erase, and does while the sheet says it is the writer;
98
99
  * - "waits": a finger in pen mode, waiting for a second to scroll with, or to go past the slop
99
- * and drag the sheet alone (R84);
100
+ * and drag the sheet alone;
100
101
  * - "scrolls": the finger that drags the sheet, or one of the two fingers of a gesture;
101
102
  * - "palm": too big for a finger, it does nothing until it lifts;
102
103
  * - "idle": it does nothing until it lifts.
103
104
  */
104
105
  export type Role = "writes" | "waits" | "scrolls" | "palm" | "idle";
105
106
  /**
106
- * The hands on a sheet (R29): which pointer may write, which is a palm, and which two fingers
107
+ * The hands on a sheet: which pointer may write, which is a palm, and which two fingers
107
108
  * scroll, for a pen, fingers and a mouse on one screen.
108
- * - One pointer writes at a time (R18), and the sheet's recorder and eraser say which.
109
+ * - One pointer writes at a time, and the sheet's recorder and eraser say which.
109
110
  * - A pen's touch puts the page in pen mode and takes away the stroke of a touch under way: it was
110
111
  * a palm. While a pen or a mouse writes, a touch does nothing until it lifts.
111
112
  * - A touch wider or taller than `PALM_PX`, at its `pointerdown` or at any move, is a palm: it does
@@ -115,13 +116,13 @@ export type Role = "writes" | "waits" | "scrolls" | "palm" | "idle";
115
116
  * comes later does nothing.
116
117
  * - In pen mode a finger writes nothing, and two that come down within `PAIR_MS` scroll. One that
117
118
  * goes further than `SLOP_PX` alone, before a second comes, drags the sheet: the second does
118
- * nothing then (R84; R90 spec).
119
+ * nothing then.
119
120
  * - A third finger does nothing. When one of the two lifts, the other does nothing until it lifts.
120
121
  * - Two fingers scroll by the travel of their middle on the screen, and one by its own, past its
121
122
  * first `SLOP_PX`: along one axis alone if it went `RAIL` times further along it than along the
122
123
  * other, or else both.
123
124
  * - Two fingers whose span has changed by more than `SLOP_PX` pinch too: the zoom goes by the
124
- * span's ratio from there, about their middle (R73).
125
+ * span's ratio from there, about their middle.
125
126
  * - Any other pointer, a mouse or one of no type, writes when nothing does, whatever the mode.
126
127
  */
127
128
  export declare class Hands {
package/lib/core/hands.js CHANGED
@@ -1,31 +1,32 @@
1
1
  /**
2
- * A touch wider or taller than this, in CSS pixels, is a palm (R29). WebKit on iPadOS gives a touch
2
+ * A touch wider or taller than this, in CSS pixels, is a palm. WebKit on iPadOS gives a touch
3
3
  * twice its contact's radius, a fingertip's 40–60 px by one report, so canvas-api's 30 px would
4
4
  * take most fingers there for palms. No tablet has measured it.
5
5
  */
6
6
  export const PALM_PX = 100;
7
7
  /**
8
- * Two touches that come down at most this many milliseconds apart are two fingers of one gesture
9
- * (R29): Android's tap timeout, 100 ms, with a margin for children's fingers.
8
+ * Two touches that come down at most this many milliseconds apart are two fingers of one gesture:
9
+ * Android's tap timeout, 100 ms, with a margin for children's fingers.
10
10
  */
11
11
  export const PAIR_MS = 150;
12
12
  /**
13
- * How far a touch may wander, in CSS pixels, before it is going somewhere (R29): Android's touch
13
+ * How far a touch may wander, in CSS pixels, before it is going somewhere: Android's touch
14
14
  * slop, 8 dp. A finger that has gone further is writing, and two fingers scroll once their middle
15
15
  * has gone further.
16
16
  */
17
17
  export const SLOP_PX = 8;
18
18
  /**
19
19
  * Two fingers that have gone this many times further along one axis than along the other, when
20
- * they pass the slop, scroll along that axis alone for the rest of the gesture (R73): a scroll
20
+ * they pass the slop, scroll along that axis alone for the rest of the gesture: a scroll
21
21
  * down a sheet does not wander sideways, nor one across it up and down. Between, they go
22
22
  * both ways.
23
23
  */
24
24
  export const RAIL = 2;
25
25
  /**
26
- * The pen mode (R29): on from a pen's touch on a sheet, till the page goes, with no button that
27
- * turns it off: while it is on, a finger neither writes nor erases, and moves the sheet (R84). One is shared by every sheet of a page, and
28
- * it lives in memory alone: nothing is stored or sent, and a new page starts without it.
26
+ * The pen mode: on from a pen's touch on a sheet, till the page goes, with no button that
27
+ * turns it off: while it is on, a finger neither writes nor erases, and moves the sheet. One is
28
+ * shared by every sheet of a page, and it lives in memory alone: nothing is stored or sent, and a
29
+ * new page starts without it.
29
30
  *
30
31
  * It knows, too, whether any sheet of the page is written on, and tells its sheets when the last
31
32
  * stroke ends: each bar shows the mode as it is then.
@@ -79,9 +80,9 @@ export class PenMode {
79
80
  }
80
81
  }
81
82
  /**
82
- * The hands on a sheet (R29): which pointer may write, which is a palm, and which two fingers
83
+ * The hands on a sheet: which pointer may write, which is a palm, and which two fingers
83
84
  * scroll, for a pen, fingers and a mouse on one screen.
84
- * - One pointer writes at a time (R18), and the sheet's recorder and eraser say which.
85
+ * - One pointer writes at a time, and the sheet's recorder and eraser say which.
85
86
  * - A pen's touch puts the page in pen mode and takes away the stroke of a touch under way: it was
86
87
  * a palm. While a pen or a mouse writes, a touch does nothing until it lifts.
87
88
  * - A touch wider or taller than `PALM_PX`, at its `pointerdown` or at any move, is a palm: it does
@@ -91,13 +92,13 @@ export class PenMode {
91
92
  * comes later does nothing.
92
93
  * - In pen mode a finger writes nothing, and two that come down within `PAIR_MS` scroll. One that
93
94
  * goes further than `SLOP_PX` alone, before a second comes, drags the sheet: the second does
94
- * nothing then (R84; R90 spec).
95
+ * nothing then.
95
96
  * - A third finger does nothing. When one of the two lifts, the other does nothing until it lifts.
96
97
  * - Two fingers scroll by the travel of their middle on the screen, and one by its own, past its
97
98
  * first `SLOP_PX`: along one axis alone if it went `RAIL` times further along it than along the
98
99
  * other, or else both.
99
100
  * - Two fingers whose span has changed by more than `SLOP_PX` pinch too: the zoom goes by the
100
- * span's ratio from there, about their middle (R73).
101
+ * span's ratio from there, about their middle.
101
102
  * - Any other pointer, a mouse or one of no type, writes when nothing does, whatever the mode.
102
103
  */
103
104
  export class Hands {
@@ -148,7 +149,7 @@ export class Hands {
148
149
  hand.x = contact.x;
149
150
  hand.y = contact.y;
150
151
  hand.travel = Math.max(hand.travel, Math.hypot(contact.x - hand.x0, contact.y - hand.y0));
151
- // A finger of pen mode that has gone past the slop with no second drags the sheet alone (R84),
152
+ // A finger of pen mode that has gone past the slop with no second drags the sheet alone,
152
153
  // but not while a sheet of the page is written on: nothing moves under the pen. Another finger
153
154
  // that waits then does nothing until it lifts, and takes no drag over from where it came down.
154
155
  if (hand.role === "waits" &&
@@ -333,8 +334,8 @@ export class Hands {
333
334
  this.#sheet.scroll(dx, dy, false);
334
335
  }
335
336
  /**
336
- * The two fingers' span has changed: past the slop, the zoom goes by its ratio to the last step's,
337
- * from the slop on, without a jump, about their middle (R73).
337
+ * The two fingers' span has changed: past the slop, the zoom goes by its ratio to the last
338
+ * step's, from the slop on, without a jump, about their middle.
338
339
  */
339
340
  #pinch(gesture, span, middle) {
340
341
  if (gesture.span === undefined) {
@@ -1,20 +1,20 @@
1
1
  import type { HistoryEvent } from "@altnovatrail/spec/canvas";
2
2
  import type { Stroke } from "./ink.js";
3
3
  /**
4
- * An event of the history of writing (R09, R22): spec's type, of the contract of canvas and app
5
- * (R74 spec; R07). What an action on the sheet did, at the sheet's time `t` when it landed, in the
4
+ * An event of the history of writing: spec's type, of the contract of canvas and app.
5
+ * What an action on the sheet did, at the sheet's time `t` when it landed, in the
6
6
  * order the actions landed; each event says which strokes it put on the sheet or took off, so
7
- * whoever reads the history replays it without the rules of the stack of undo (R19). Those the
8
- * sheet hands out are frozen through (R27).
7
+ * whoever reads the history replays it without the rules of the stack of undo. Those the
8
+ * sheet hands out are frozen through.
9
9
  */
10
10
  export type { HistoryEvent };
11
11
  /**
12
12
  * The strokes a history leaves on the sheet, in the order they were written: what the sheet shows
13
- * after it (R09).
13
+ * after it.
14
14
  */
15
15
  export declare function replay(history: readonly HistoryEvent[]): Stroke[];
16
16
  /**
17
- * The events of a history given to the sheet (R27), each checked field by field and copied into
17
+ * The events of a history given to the sheet, each checked field by field and copied into
18
18
  * frozen objects of the sheet's own, with only the fields the sheet keeps: others are passed over.
19
19
  * A value that is not such a history is a TypeError that names the field. Each event must be one of
20
20
  * the four, at a time from 0 that never goes back along the history; a stroke must have a new ID, a
@@ -22,18 +22,18 @@ export declare function replay(history: readonly HistoryEvent[]): Stroke[];
22
22
  * times never going back and none after the time it landed. Times are checked for their order
23
23
  * alone: strokes may overlap in time, as several pointers at once would write them. On a task from
24
24
  * paper, `paper`, a stroke written on the tracing paper says so, `on: "tracing"`, its points from
25
- * the paper's top left corner within the sheet's size; anywhere else `on` is a TypeError
26
- * (R87). Whether the actions keep the rules of the stack, the work on the sheet checks as it
25
+ * the paper's top left corner within the sheet's size; anywhere else `on` is a TypeError.
26
+ * Whether the actions keep the rules of the stack, the work on the sheet checks as it
27
27
  * replays them (`Work.restore`).
28
28
  */
29
29
  export declare function historyOf(value: unknown, paper?: boolean): HistoryEvent[];
30
30
  /**
31
- * An event, frozen through: its stroke with its points, or its lists of IDs (R27). Whoever holds
31
+ * An event, frozen through: its stroke with its points, or its lists of IDs. Whoever holds
32
32
  * an event the sheet handed out cannot change the sheet by it.
33
33
  */
34
34
  export declare function frozen(event: HistoryEvent): HistoryEvent;
35
35
  /**
36
- * Whether a value given as a history is the history the sheet has (R27): the very array, or a list
36
+ * Whether a value given as a history is the history the sheet has: the very array, or a list
37
37
  * whose every event says what the sheet's says, by the fields the sheet keeps — others are passed
38
38
  * over. `undefined` is the empty history. It never throws: a value that is no history is simply not
39
39
  * the same one.
@@ -2,7 +2,7 @@ import { record, shown } from "./fields.js";
2
2
  import { REACH } from "./sheet.js";
3
3
  /**
4
4
  * The strokes a history leaves on the sheet, in the order they were written: what the sheet shows
5
- * after it (R09).
5
+ * after it.
6
6
  */
7
7
  export function replay(history) {
8
8
  const written = [];
@@ -29,7 +29,7 @@ export function replay(history) {
29
29
  return written.filter((stroke) => visible.has(stroke.id));
30
30
  }
31
31
  /**
32
- * The events of a history given to the sheet (R27), each checked field by field and copied into
32
+ * The events of a history given to the sheet, each checked field by field and copied into
33
33
  * frozen objects of the sheet's own, with only the fields the sheet keeps: others are passed over.
34
34
  * A value that is not such a history is a TypeError that names the field. Each event must be one of
35
35
  * the four, at a time from 0 that never goes back along the history; a stroke must have a new ID, a
@@ -37,8 +37,8 @@ export function replay(history) {
37
37
  * times never going back and none after the time it landed. Times are checked for their order
38
38
  * alone: strokes may overlap in time, as several pointers at once would write them. On a task from
39
39
  * paper, `paper`, a stroke written on the tracing paper says so, `on: "tracing"`, its points from
40
- * the paper's top left corner within the sheet's size; anywhere else `on` is a TypeError
41
- * (R87). Whether the actions keep the rules of the stack, the work on the sheet checks as it
40
+ * the paper's top left corner within the sheet's size; anywhere else `on` is a TypeError.
41
+ * Whether the actions keep the rules of the stack, the work on the sheet checks as it
42
42
  * replays them (`Work.restore`).
43
43
  */
44
44
  export function historyOf(value, paper = false) {
@@ -90,7 +90,7 @@ export function historyOf(value, paper = false) {
90
90
  });
91
91
  }
92
92
  /**
93
- * An event, frozen through: its stroke with its points, or its lists of IDs (R27). Whoever holds
93
+ * An event, frozen through: its stroke with its points, or its lists of IDs. Whoever holds
94
94
  * an event the sheet handed out cannot change the sheet by it.
95
95
  */
96
96
  export function frozen(event) {
@@ -110,7 +110,7 @@ export function frozen(event) {
110
110
  return Object.freeze(event);
111
111
  }
112
112
  /**
113
- * Whether a value given as a history is the history the sheet has (R27): the very array, or a list
113
+ * Whether a value given as a history is the history the sheet has: the very array, or a list
114
114
  * whose every event says what the sheet's says, by the fields the sheet keeps — others are passed
115
115
  * over. `undefined` is the empty history. It never throws: a value that is no history is simply not
116
116
  * the same one.
package/lib/core/index.js CHANGED
@@ -1,15 +1,14 @@
1
1
  // The DOM-free part of the canvas, the package's entry point @altnovatrail/canvas/core: plain
2
2
  // TypeScript that runs the same in a browser and in Node, for the tests and the synthetic samples
3
- // too (R05, R07). Importing it registers no element: the element is the other entry point. It
3
+ // too. Importing it registers no element: the element is the other entry point. It
4
4
  // gives the sheet's size, the types of the data the element takes and gives — the strokes and the
5
5
  // history of writing, the task, the worked example and the manifest, how far the learner has gone
6
- // through the example's demo (R42) and the context of a submission, of a sheet, a workbook or a
7
- // task from paper with where its tracing paper lay (R87), all of spec's types (R73 spec, R74
8
- // spec), and the tutor's marks, spec's types too (R83 spec) — and the fold of a history into the
9
- // strokes it leaves, so that a consumer reads a history it keeps without the DOM (R27). The code runs without the DOM, but spec's
10
- // declarations of the element's contract, which its types come from, name the DOM's types too: a
11
- // consumer without the DOM's types skips them with skipLibCheck (R27). The rules of the groups, the
12
- // crop and the snapping stay inside: the eval protocol has taken them as they are, and spec's test
13
- // vectors pin them (R94 spec).
6
+ // through the example's demo and the context of a submission, of a sheet, a workbook or a
7
+ // task from paper with where its tracing paper lay, all of spec's types, and the tutor's marks,
8
+ // spec's types too — and the fold of a history into the strokes it leaves, so that a consumer reads
9
+ // a history it keeps without the DOM. The code runs without the DOM, but spec's declarations of the
10
+ // element's contract, which its types come from, name the DOM's types too: a consumer without the
11
+ // DOM's types skips them with skipLibCheck. The rules of the groups, the crop and the snapping stay
12
+ // inside: the eval protocol has taken them as they are, and spec's test vectors pin them.
14
13
  export { replay } from "./history.js";
15
14
  export { SHEET } from "./sheet.js";
package/lib/core/ink.js CHANGED
@@ -1,5 +1,5 @@
1
- // A point of a stroke and a stroke (R06, R09, R18, R27): spec's types, of the contract of canvas
2
- // and app (R74 spec; R07) — where a point lies on the sheet, in logical units, when it was written
1
+ // A point of a stroke and a stroke: spec's types, of the contract of canvas
2
+ // and app — where a point lies on the sheet, in logical units, when it was written
3
3
  // and how hard the pointer pressed, and a stroke's ID on its sheet, its pointer's type and its
4
- // points. Only a pen's pressure changes the width of the line (R05, R18).
4
+ // points. Only a pen's pressure changes the width of the line.
5
5
  export {};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * The version of the module format the element reads: while the format is v0, the platform reads
3
- * its current version alone, and a module of another is refused with the reason (R44 spec). The
4
- * format's rules of a module's versions are module-kit's and api's: the element compares none (R32).
3
+ * its current version alone, and a module of another is refused with the reason. The
4
+ * format's rules of a module's versions are module-kit's and api's: the element compares none.
5
5
  */
6
6
  export declare const FORMAT = "0.4";
7
- /** The open view of a module's manifest, whole: spec's type (R73 spec). */
7
+ /** The open view of a module's manifest, whole: spec's type. */
8
8
  export type { Manifest } from "@altnovatrail/spec/formatv0/open";
9
9
  /**
10
10
  * What the element makes of a manifest: the height of a digit its crop for checking is drawn at,
@@ -1,17 +1,17 @@
1
- // The module's manifest as the element reads it (R32): the open view of manifest.yaml, of which it
1
+ // The module's manifest as the element reads it: the open view of manifest.yaml, of which it
2
2
  // takes three fields — the version of the module format, the height of a digit on the crop for
3
- // checking and the explanation language, which the task's statement is in (R51 spec). The rest of
3
+ // checking and the explanation language, which the task's statement is in. The rest of
4
4
  // the manifest it passes over: what a manifest may hold, module-kit checks. Its canvas settings are
5
5
  // the canvas's own, though: a setting the element does not know is a TypeError, as a field of a
6
6
  // task is, for the element would draw the module's canvas without it. The type is spec's, from
7
- // its npm package at the version of the spec/ submodule (R73 spec; R41), and app gets the
8
- // manifest's open view once for a module's package and gives it to the element as it is (R36 spec).
7
+ // its npm package at the version of the spec/ submodule, and app gets the
8
+ // manifest's open view once for a module's package and gives it to the element as it is.
9
9
  import { CROP } from "./crop.js";
10
10
  import { closed, record, shown, whole } from "./fields.js";
11
11
  /**
12
12
  * The version of the module format the element reads: while the format is v0, the platform reads
13
- * its current version alone, and a module of another is refused with the reason (R44 spec). The
14
- * format's rules of a module's versions are module-kit's and api's: the element compares none (R32).
13
+ * its current version alone, and a module of another is refused with the reason. The
14
+ * format's rules of a module's versions are module-kit's and api's: the element compares none.
15
15
  */
16
16
  export const FORMAT = "0.4";
17
17
  /** The settings without a manifest: digits of 24 px, and the element's own language. */