@altnovatrail/canvas 0.3.37 → 0.3.39
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/geometry.js +2 -2
- package/lib/core/grid.d.ts +11 -4
- package/lib/core/grid.js +33 -8
- package/lib/core/hands.d.ts +14 -7
- package/lib/core/hands.js +58 -7
- package/lib/core/history.js +3 -3
- package/lib/core/marks.d.ts +2 -0
- package/lib/core/marks.js +11 -6
- package/lib/core/notation.d.ts +29 -0
- package/lib/core/notation.js +180 -0
- package/lib/core/screen.d.ts +10 -11
- package/lib/core/screen.js +13 -14
- package/lib/core/sheet.d.ts +46 -3
- package/lib/core/sheet.js +46 -3
- package/lib/core/submission.js +5 -1
- package/lib/core/task.d.ts +9 -4
- package/lib/core/task.js +7 -2
- package/lib/core/tracing.d.ts +49 -13
- package/lib/core/tracing.js +110 -31
- package/lib/core/zoom.d.ts +19 -8
- package/lib/core/zoom.js +36 -15
- package/lib/element/icons.d.ts +90 -5
- package/lib/element/icons.js +94 -5
- package/lib/element/index.d.ts +32 -13
- package/lib/element/index.js +712 -240
- package/lib/element/labels.d.ts +30 -5
- package/lib/element/labels.js +32 -5
- package/lib/element/notation.d.ts +2 -0
- package/lib/element/notation.js +94 -0
- package/lib/element/session.js +4 -4
- package/lib/element/tools.d.ts +31 -16
- package/lib/element/tools.js +87 -54
- package/lib/element/tracing.d.ts +49 -5
- package/lib/element/tracing.js +446 -10
- package/package.json +3 -3
package/lib/element/icons.d.ts
CHANGED
|
@@ -44,6 +44,30 @@ 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 "pan-tool-outline-rounded": {
|
|
48
|
+
readonly viewBox: "0 0 24 24";
|
|
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
|
+
};
|
|
51
|
+
readonly "pan-tool-rounded": {
|
|
52
|
+
readonly viewBox: "0 0 24 24";
|
|
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
|
+
};
|
|
55
|
+
readonly "background-dot-small-outline-rounded": {
|
|
56
|
+
readonly viewBox: "0 0 24 24";
|
|
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
|
+
};
|
|
47
71
|
readonly "zoom-in-outline-rounded": {
|
|
48
72
|
readonly viewBox: "0 0 24 24";
|
|
49
73
|
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"];
|
|
@@ -52,9 +76,25 @@ export declare const ICONS: {
|
|
|
52
76
|
readonly viewBox: "0 0 24 24";
|
|
53
77
|
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"];
|
|
54
78
|
};
|
|
55
|
-
readonly "
|
|
79
|
+
readonly "remove-outline-rounded": {
|
|
80
|
+
readonly viewBox: "0 0 24 24";
|
|
81
|
+
readonly paths: readonly ["M6 13q-.425 0-.712-.288T5 12t.288-.712T6 11h12q.425 0 .713.288T19 12t-.288.713T18 13z"];
|
|
82
|
+
};
|
|
83
|
+
readonly "add-outline-rounded": {
|
|
84
|
+
readonly viewBox: "0 0 24 24";
|
|
85
|
+
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"];
|
|
86
|
+
};
|
|
87
|
+
readonly "fit-screen-outline-rounded": {
|
|
88
|
+
readonly viewBox: "0 0 24 24";
|
|
89
|
+
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"];
|
|
90
|
+
};
|
|
91
|
+
readonly "auto-awesome-outline-rounded": {
|
|
92
|
+
readonly viewBox: "0 0 24 24";
|
|
93
|
+
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"];
|
|
94
|
+
};
|
|
95
|
+
readonly "image-outline-rounded": {
|
|
56
96
|
readonly viewBox: "0 0 24 24";
|
|
57
|
-
readonly paths: readonly ["
|
|
97
|
+
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
98
|
};
|
|
59
99
|
};
|
|
60
100
|
/** The name of an icon of the row. */
|
|
@@ -105,6 +145,31 @@ export declare const ROW: {
|
|
|
105
145
|
readonly filled: "delete-sweep-outline-rounded";
|
|
106
146
|
readonly mirrored: false;
|
|
107
147
|
};
|
|
148
|
+
readonly hand: {
|
|
149
|
+
readonly outline: "pan-tool-outline-rounded";
|
|
150
|
+
readonly filled: "pan-tool-rounded";
|
|
151
|
+
readonly mirrored: false;
|
|
152
|
+
};
|
|
153
|
+
readonly gridDots: {
|
|
154
|
+
readonly outline: "background-dot-small-outline-rounded";
|
|
155
|
+
readonly filled: "background-dot-small-outline-rounded";
|
|
156
|
+
readonly mirrored: false;
|
|
157
|
+
};
|
|
158
|
+
readonly gridLines: {
|
|
159
|
+
readonly outline: "view-headline-outline-rounded";
|
|
160
|
+
readonly filled: "view-headline-outline-rounded";
|
|
161
|
+
readonly mirrored: false;
|
|
162
|
+
};
|
|
163
|
+
readonly gridBlank: {
|
|
164
|
+
readonly outline: "crop-square-outline-rounded";
|
|
165
|
+
readonly filled: "crop-square-outline-rounded";
|
|
166
|
+
readonly mirrored: false;
|
|
167
|
+
};
|
|
168
|
+
readonly gridSquares: {
|
|
169
|
+
readonly outline: "grid-on-outline-rounded";
|
|
170
|
+
readonly filled: "grid-on-outline-rounded";
|
|
171
|
+
readonly mirrored: false;
|
|
172
|
+
};
|
|
108
173
|
readonly zoomIn: {
|
|
109
174
|
readonly outline: "zoom-in-outline-rounded";
|
|
110
175
|
readonly filled: "zoom-in-outline-rounded";
|
|
@@ -115,9 +180,29 @@ export declare const ROW: {
|
|
|
115
180
|
readonly filled: "zoom-out-outline-rounded";
|
|
116
181
|
readonly mirrored: false;
|
|
117
182
|
};
|
|
118
|
-
readonly
|
|
119
|
-
readonly outline: "
|
|
120
|
-
readonly filled: "
|
|
183
|
+
readonly smaller: {
|
|
184
|
+
readonly outline: "remove-outline-rounded";
|
|
185
|
+
readonly filled: "remove-outline-rounded";
|
|
186
|
+
readonly mirrored: false;
|
|
187
|
+
};
|
|
188
|
+
readonly larger: {
|
|
189
|
+
readonly outline: "add-outline-rounded";
|
|
190
|
+
readonly filled: "add-outline-rounded";
|
|
191
|
+
readonly mirrored: false;
|
|
192
|
+
};
|
|
193
|
+
readonly fit: {
|
|
194
|
+
readonly outline: "fit-screen-outline-rounded";
|
|
195
|
+
readonly filled: "fit-screen-outline-rounded";
|
|
196
|
+
readonly mirrored: false;
|
|
197
|
+
};
|
|
198
|
+
readonly recognise: {
|
|
199
|
+
readonly outline: "auto-awesome-outline-rounded";
|
|
200
|
+
readonly filled: "auto-awesome-outline-rounded";
|
|
201
|
+
readonly mirrored: false;
|
|
202
|
+
};
|
|
203
|
+
readonly original: {
|
|
204
|
+
readonly outline: "image-outline-rounded";
|
|
205
|
+
readonly filled: "image-outline-rounded";
|
|
121
206
|
readonly mirrored: false;
|
|
122
207
|
};
|
|
123
208
|
};
|
package/lib/element/icons.js
CHANGED
|
@@ -70,6 +70,42 @@ 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
|
+
"pan-tool-outline-rounded": {
|
|
74
|
+
viewBox: "0 0 24 24",
|
|
75
|
+
paths: [
|
|
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
|
+
],
|
|
78
|
+
},
|
|
79
|
+
"pan-tool-rounded": {
|
|
80
|
+
viewBox: "0 0 24 24",
|
|
81
|
+
paths: [
|
|
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
|
+
],
|
|
84
|
+
},
|
|
85
|
+
"background-dot-small-outline-rounded": {
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
paths: [
|
|
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
|
+
},
|
|
73
109
|
"zoom-in-outline-rounded": {
|
|
74
110
|
viewBox: "0 0 24 24",
|
|
75
111
|
paths: [
|
|
@@ -82,10 +118,34 @@ export const ICONS = {
|
|
|
82
118
|
"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",
|
|
83
119
|
],
|
|
84
120
|
},
|
|
85
|
-
"
|
|
121
|
+
"remove-outline-rounded": {
|
|
122
|
+
viewBox: "0 0 24 24",
|
|
123
|
+
paths: [
|
|
124
|
+
"M6 13q-.425 0-.712-.288T5 12t.288-.712T6 11h12q.425 0 .713.288T19 12t-.288.713T18 13z",
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
"add-outline-rounded": {
|
|
128
|
+
viewBox: "0 0 24 24",
|
|
129
|
+
paths: [
|
|
130
|
+
"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",
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
"fit-screen-outline-rounded": {
|
|
86
134
|
viewBox: "0 0 24 24",
|
|
87
135
|
paths: [
|
|
88
|
-
"
|
|
136
|
+
"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",
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
"auto-awesome-outline-rounded": {
|
|
140
|
+
viewBox: "0 0 24 24",
|
|
141
|
+
paths: [
|
|
142
|
+
"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",
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
"image-outline-rounded": {
|
|
146
|
+
viewBox: "0 0 24 24",
|
|
147
|
+
paths: [
|
|
148
|
+
"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
149
|
],
|
|
90
150
|
},
|
|
91
151
|
};
|
|
@@ -119,6 +179,27 @@ export const ROW = {
|
|
|
119
179
|
filled: "delete-sweep-outline-rounded",
|
|
120
180
|
mirrored: false,
|
|
121
181
|
},
|
|
182
|
+
hand: { outline: "pan-tool-outline-rounded", filled: "pan-tool-rounded", mirrored: false },
|
|
183
|
+
gridDots: {
|
|
184
|
+
outline: "background-dot-small-outline-rounded",
|
|
185
|
+
filled: "background-dot-small-outline-rounded",
|
|
186
|
+
mirrored: false,
|
|
187
|
+
},
|
|
188
|
+
gridLines: {
|
|
189
|
+
outline: "view-headline-outline-rounded",
|
|
190
|
+
filled: "view-headline-outline-rounded",
|
|
191
|
+
mirrored: false,
|
|
192
|
+
},
|
|
193
|
+
gridBlank: {
|
|
194
|
+
outline: "crop-square-outline-rounded",
|
|
195
|
+
filled: "crop-square-outline-rounded",
|
|
196
|
+
mirrored: false,
|
|
197
|
+
},
|
|
198
|
+
gridSquares: {
|
|
199
|
+
outline: "grid-on-outline-rounded",
|
|
200
|
+
filled: "grid-on-outline-rounded",
|
|
201
|
+
mirrored: false,
|
|
202
|
+
},
|
|
122
203
|
zoomIn: {
|
|
123
204
|
outline: "zoom-in-outline-rounded",
|
|
124
205
|
filled: "zoom-in-outline-rounded",
|
|
@@ -129,9 +210,17 @@ export const ROW = {
|
|
|
129
210
|
filled: "zoom-out-outline-rounded",
|
|
130
211
|
mirrored: false,
|
|
131
212
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
213
|
+
smaller: { outline: "remove-outline-rounded", filled: "remove-outline-rounded", mirrored: false },
|
|
214
|
+
larger: { outline: "add-outline-rounded", filled: "add-outline-rounded", mirrored: false },
|
|
215
|
+
fit: {
|
|
216
|
+
outline: "fit-screen-outline-rounded",
|
|
217
|
+
filled: "fit-screen-outline-rounded",
|
|
218
|
+
mirrored: false,
|
|
219
|
+
},
|
|
220
|
+
recognise: {
|
|
221
|
+
outline: "auto-awesome-outline-rounded",
|
|
222
|
+
filled: "auto-awesome-outline-rounded",
|
|
135
223
|
mirrored: false,
|
|
136
224
|
},
|
|
225
|
+
original: { outline: "image-outline-rounded", filled: "image-outline-rounded", mirrored: false },
|
|
137
226
|
};
|
package/lib/element/index.d.ts
CHANGED
|
@@ -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,
|
|
40
|
-
*
|
|
41
|
-
* theirs with a `toolchange`, and the consumer may
|
|
42
|
-
* under way goes on as it began. A pen's eraser
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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.
|
|
77
|
-
*
|
|
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
|
|
245
|
-
*
|
|
246
|
-
*
|
|
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
|