@sudobility/music_drawing 0.0.7 → 0.0.10
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/dist/canvas-renderer.d.ts +5 -1
- package/dist/canvas-renderer.d.ts.map +1 -1
- package/dist/canvas-renderer.js +29 -16
- package/dist/canvas-renderer.js.map +1 -1
- package/dist/drawing-context.d.ts +109 -0
- package/dist/drawing-context.d.ts.map +1 -0
- package/dist/drawing-context.js +23 -0
- package/dist/drawing-context.js.map +1 -0
- package/dist/icon-canvas.d.ts +2 -1
- package/dist/icon-canvas.d.ts.map +1 -1
- package/dist/icon-canvas.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/measure-content.d.ts.map +1 -1
- package/dist/measure-content.js.map +1 -1
- package/dist/skia/css-font.d.ts +24 -0
- package/dist/skia/css-font.d.ts.map +1 -0
- package/dist/skia/css-font.js +100 -0
- package/dist/skia/css-font.js.map +1 -0
- package/dist/skia/index.d.ts +17 -0
- package/dist/skia/index.d.ts.map +1 -0
- package/dist/skia/index.js +14 -0
- package/dist/skia/index.js.map +1 -0
- package/dist/skia/skia-api.d.ts +133 -0
- package/dist/skia/skia-api.d.ts.map +1 -0
- package/dist/skia/skia-api.js +28 -0
- package/dist/skia/skia-api.js.map +1 -0
- package/dist/skia/skia-context.d.ts +58 -0
- package/dist/skia/skia-context.d.ts.map +1 -0
- package/dist/skia/skia-context.js +394 -0
- package/dist/skia/skia-context.js.map +1 -0
- package/dist/test/canvas-stub.d.ts +5 -5
- package/dist/test/canvas-stub.d.ts.map +1 -1
- package/dist/test/canvas-stub.js +3 -4
- package/dist/test/canvas-stub.js.map +1 -1
- package/dist/test/fake-skia.d.ts +81 -0
- package/dist/test/fake-skia.d.ts.map +1 -0
- package/dist/test/fake-skia.js +228 -0
- package/dist/test/fake-skia.js.map +1 -0
- package/dist/test/index.d.ts +18 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +16 -0
- package/dist/test/index.js.map +1 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +35 -1
- package/dist/types.js.map +1 -1
- package/package.json +16 -6
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matrices here are kept in Skia's **row-major** order — `[a, c, e, b, d, f]`,
|
|
3
|
+
* the top two rows of the 3×3 — not canvas's `[a, b, c, d, e, f]`. Identity is
|
|
4
|
+
* the same six numbers in a different arrangement, which is exactly the sort of
|
|
5
|
+
* thing that silently transposes a frame.
|
|
6
|
+
*/
|
|
7
|
+
const IDENTITY = [1, 0, 0, 0, 1, 0];
|
|
8
|
+
/**
|
|
9
|
+
* Where a point ends up under a recorded matrix, computed straight from Skia's
|
|
10
|
+
* row-major contract: `[scaleX, skewX, transX, skewY, scaleY, transY]`.
|
|
11
|
+
*
|
|
12
|
+
* This is the independent half of the transform tests. Asserting on the matrix
|
|
13
|
+
* array alone cannot catch a transposition — the adapter and this fake would
|
|
14
|
+
* simply agree on the wrong order, and every transform the renderer uses is
|
|
15
|
+
* diagonal, where a transpose is invisible. Mapping a point under a *skewed*
|
|
16
|
+
* matrix and comparing against what canvas semantics say it should be checks
|
|
17
|
+
* the two sides against the spec rather than against each other.
|
|
18
|
+
*/
|
|
19
|
+
export function mapPoint(matrix, x, y) {
|
|
20
|
+
return {
|
|
21
|
+
x: matrix[0] * x + matrix[1] * y + matrix[2],
|
|
22
|
+
y: matrix[3] * x + matrix[4] * y + matrix[5],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Row-major 3×3 multiply, kept in the six-value affine form Skia is given. */
|
|
26
|
+
function multiply(m, n) {
|
|
27
|
+
const [a1, c1, e1, b1, d1, f1] = [m[0], m[1], m[2], m[3], m[4], m[5]];
|
|
28
|
+
const [a2, c2, e2, b2, d2, f2] = [n[0], n[1], n[2], n[3], n[4], n[5]];
|
|
29
|
+
return [
|
|
30
|
+
a1 * a2 + c1 * b2,
|
|
31
|
+
a1 * c2 + c1 * d2,
|
|
32
|
+
a1 * e2 + c1 * f2 + e1,
|
|
33
|
+
b1 * a2 + d1 * b2,
|
|
34
|
+
b1 * c2 + d1 * d2,
|
|
35
|
+
b1 * e2 + d1 * f2 + f1,
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Metrics good enough to be checkable: half the size per character of advance,
|
|
40
|
+
* a cap at 0.7 of the size. Real faces differ, which is precisely why nothing
|
|
41
|
+
* in the renderer hard-codes a number and reads these instead.
|
|
42
|
+
*/
|
|
43
|
+
const ADVANCE_RATIO = 0.5;
|
|
44
|
+
const ASCENT_RATIO = 0.7;
|
|
45
|
+
const DESCENT_RATIO = 0.2;
|
|
46
|
+
export function createFakeSkia() {
|
|
47
|
+
const draws = [];
|
|
48
|
+
const fontRequests = [];
|
|
49
|
+
let matrix = [...IDENTITY];
|
|
50
|
+
const matrixStack = [];
|
|
51
|
+
const paintState = new WeakMap();
|
|
52
|
+
const pathCommands = new WeakMap();
|
|
53
|
+
const fontState = new WeakMap();
|
|
54
|
+
function snapshot(paint) {
|
|
55
|
+
return { ...paintState.get(paint) };
|
|
56
|
+
}
|
|
57
|
+
function makePaint() {
|
|
58
|
+
const paint = {
|
|
59
|
+
setColor: color => {
|
|
60
|
+
state.color = String(color);
|
|
61
|
+
},
|
|
62
|
+
setStyle: style => {
|
|
63
|
+
state.style = style;
|
|
64
|
+
},
|
|
65
|
+
setStrokeWidth: width => {
|
|
66
|
+
state.strokeWidth = width;
|
|
67
|
+
},
|
|
68
|
+
setStrokeCap: cap => {
|
|
69
|
+
state.cap = cap;
|
|
70
|
+
},
|
|
71
|
+
setStrokeJoin: join => {
|
|
72
|
+
state.join = join;
|
|
73
|
+
},
|
|
74
|
+
setAntiAlias: () => undefined,
|
|
75
|
+
setAlphaf: alpha => {
|
|
76
|
+
state.alpha = alpha;
|
|
77
|
+
},
|
|
78
|
+
getAlphaf: () => state.alpha,
|
|
79
|
+
setPathEffect: effect => {
|
|
80
|
+
state.dashed = effect !== null;
|
|
81
|
+
},
|
|
82
|
+
setBlendMode: blendMode => {
|
|
83
|
+
state.blendMode = blendMode;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
const state = {
|
|
87
|
+
color: '#000000',
|
|
88
|
+
style: 0,
|
|
89
|
+
strokeWidth: 1,
|
|
90
|
+
cap: 0,
|
|
91
|
+
join: 0,
|
|
92
|
+
alpha: 1,
|
|
93
|
+
blendMode: null,
|
|
94
|
+
dashed: false,
|
|
95
|
+
};
|
|
96
|
+
paintState.set(paint, state);
|
|
97
|
+
return paint;
|
|
98
|
+
}
|
|
99
|
+
function makePath() {
|
|
100
|
+
const commands = [];
|
|
101
|
+
const record = (command) => (...args) => {
|
|
102
|
+
commands.push({
|
|
103
|
+
command,
|
|
104
|
+
args: args.filter((a) => typeof a === 'number'),
|
|
105
|
+
});
|
|
106
|
+
return path;
|
|
107
|
+
};
|
|
108
|
+
const path = {
|
|
109
|
+
moveTo: record('moveTo'),
|
|
110
|
+
lineTo: record('lineTo'),
|
|
111
|
+
cubicTo: record('cubicTo'),
|
|
112
|
+
quadTo: record('quadTo'),
|
|
113
|
+
arcToOval: (oval, start, sweep, forceMoveTo) => {
|
|
114
|
+
commands.push({
|
|
115
|
+
command: 'arcToOval',
|
|
116
|
+
args: [
|
|
117
|
+
oval.x,
|
|
118
|
+
oval.y,
|
|
119
|
+
oval.width,
|
|
120
|
+
oval.height,
|
|
121
|
+
start,
|
|
122
|
+
sweep,
|
|
123
|
+
forceMoveTo ? 1 : 0,
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
return path;
|
|
127
|
+
},
|
|
128
|
+
addRect: rect => {
|
|
129
|
+
commands.push({
|
|
130
|
+
command: 'addRect',
|
|
131
|
+
args: [rect.x, rect.y, rect.width, rect.height],
|
|
132
|
+
});
|
|
133
|
+
return path;
|
|
134
|
+
},
|
|
135
|
+
close: record('close'),
|
|
136
|
+
};
|
|
137
|
+
pathCommands.set(path, commands);
|
|
138
|
+
return path;
|
|
139
|
+
}
|
|
140
|
+
function makeFont(family, size, bold) {
|
|
141
|
+
const metrics = {
|
|
142
|
+
ascent: -size * ASCENT_RATIO,
|
|
143
|
+
descent: size * DESCENT_RATIO,
|
|
144
|
+
};
|
|
145
|
+
const font = {
|
|
146
|
+
measureText: text => ({
|
|
147
|
+
x: 0,
|
|
148
|
+
y: -size * ASCENT_RATIO,
|
|
149
|
+
width: text.length * size * ADVANCE_RATIO,
|
|
150
|
+
height: size * (ASCENT_RATIO + DESCENT_RATIO),
|
|
151
|
+
}),
|
|
152
|
+
getMetrics: () => metrics,
|
|
153
|
+
getGlyphIDs: text => [...text].map((_, i) => i + 1),
|
|
154
|
+
getGlyphWidths: glyphs => glyphs.map(() => size * ADVANCE_RATIO),
|
|
155
|
+
};
|
|
156
|
+
fontState.set(font, { family, size, bold });
|
|
157
|
+
return font;
|
|
158
|
+
}
|
|
159
|
+
const canvas = {
|
|
160
|
+
save: () => {
|
|
161
|
+
matrixStack.push([...matrix]);
|
|
162
|
+
return matrixStack.length;
|
|
163
|
+
},
|
|
164
|
+
restore: () => {
|
|
165
|
+
matrix = matrixStack.pop() ?? [...IDENTITY];
|
|
166
|
+
},
|
|
167
|
+
concat: next => {
|
|
168
|
+
matrix = multiply(matrix, next);
|
|
169
|
+
},
|
|
170
|
+
drawPath: (path, paint) => {
|
|
171
|
+
draws.push({
|
|
172
|
+
op: 'drawPath',
|
|
173
|
+
commands: [...(pathCommands.get(path) ?? [])],
|
|
174
|
+
paint: snapshot(paint),
|
|
175
|
+
matrix: [...matrix],
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
drawRect: (rect, paint) => {
|
|
179
|
+
draws.push({
|
|
180
|
+
op: 'drawRect',
|
|
181
|
+
rect,
|
|
182
|
+
paint: snapshot(paint),
|
|
183
|
+
matrix: [...matrix],
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
drawText: (text, x, y, paint, font) => {
|
|
187
|
+
draws.push({
|
|
188
|
+
op: 'drawText',
|
|
189
|
+
text,
|
|
190
|
+
x,
|
|
191
|
+
y,
|
|
192
|
+
paint: snapshot(paint),
|
|
193
|
+
font: { ...fontState.get(font) },
|
|
194
|
+
matrix: [...matrix],
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
// Mirrors Skia's own enum values.
|
|
199
|
+
const module = {
|
|
200
|
+
Skia: {
|
|
201
|
+
Paint: makePaint,
|
|
202
|
+
Path: { Make: makePath },
|
|
203
|
+
Font: (typeface, size = 14) => {
|
|
204
|
+
const requested = typeface;
|
|
205
|
+
return makeFont(requested?.family ?? 'system', size, requested?.bold ?? false);
|
|
206
|
+
},
|
|
207
|
+
FontMgr: {
|
|
208
|
+
System: () => ({
|
|
209
|
+
matchFamilyStyle: (name, style) => {
|
|
210
|
+
fontRequests.push({ family: name, style });
|
|
211
|
+
const weight = style?.weight;
|
|
212
|
+
return { family: name, bold: (weight ?? 400) >= 600 };
|
|
213
|
+
},
|
|
214
|
+
}),
|
|
215
|
+
},
|
|
216
|
+
Color: color => color,
|
|
217
|
+
XYWHRect: (x, y, width, height) => ({ x, y, width, height }),
|
|
218
|
+
PathEffect: { MakeDash: intervals => ({ intervals }) },
|
|
219
|
+
},
|
|
220
|
+
PaintStyle: { Fill: 0, Stroke: 1 },
|
|
221
|
+
StrokeCap: { Butt: 0, Round: 1, Square: 2 },
|
|
222
|
+
StrokeJoin: { Miter: 0, Round: 1, Bevel: 2 },
|
|
223
|
+
FontSlant: { Upright: 0, Italic: 1 },
|
|
224
|
+
BlendMode: { Clear: 0 },
|
|
225
|
+
};
|
|
226
|
+
return { ...module, canvas, draws, fontRequests };
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=fake-skia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-skia.js","sourceRoot":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AK,EAAE,EAAE;wBAChC,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;wBAC3C,MAAM,MAAM,GAAI,KAAyC,EAAE,MAAM,CAAC;wBAClE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;oBACxD,CAAC;iBACF,CAAC;aACH;YACD,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK;YACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAC5D,UAAU,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;SACvD;QACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAClC,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAC3C,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAC5C,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QACpC,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;KACxB,CAAC;IAEF,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@sudobility/music_drawing/test` — doubles for testing a host's render path.
|
|
3
|
+
*
|
|
4
|
+
* Both of these stand in for a drawing surface so a suite can render a real
|
|
5
|
+
* score with no browser and no device: `createMock2DContext` records calls made
|
|
6
|
+
* to a `DrawingContext2D`, and `createFakeSkia` records what reaches Skia
|
|
7
|
+
* through the React Native adapter.
|
|
8
|
+
*
|
|
9
|
+
* Their own subpath rather than the package root, so nothing ships a test
|
|
10
|
+
* double into an app bundle that only wanted the renderer — and so the name
|
|
11
|
+
* `createMock2DContext` does not collide with `music_lib`'s copy where that
|
|
12
|
+
* package re-exports this one wholesale.
|
|
13
|
+
*/
|
|
14
|
+
export { createMock2DContext } from './canvas-stub.js';
|
|
15
|
+
export type { Mock2DContext, MockOp } from './canvas-stub.js';
|
|
16
|
+
export { createFakeSkia, mapPoint } from './fake-skia.js';
|
|
17
|
+
export type { FakeDraw, FakeFontRequest, FakeFontState, FakePaintState, FakePathCommand, FakeSkia, } from './fake-skia.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1D,YAAY,EACV,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EACf,QAAQ,GACT,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@sudobility/music_drawing/test` — doubles for testing a host's render path.
|
|
3
|
+
*
|
|
4
|
+
* Both of these stand in for a drawing surface so a suite can render a real
|
|
5
|
+
* score with no browser and no device: `createMock2DContext` records calls made
|
|
6
|
+
* to a `DrawingContext2D`, and `createFakeSkia` records what reaches Skia
|
|
7
|
+
* through the React Native adapter.
|
|
8
|
+
*
|
|
9
|
+
* Their own subpath rather than the package root, so nothing ships a test
|
|
10
|
+
* double into an app bundle that only wanted the renderer — and so the name
|
|
11
|
+
* `createMock2DContext` does not collide with `music_lib`'s copy where that
|
|
12
|
+
* package re-exports this one wholesale.
|
|
13
|
+
*/
|
|
14
|
+
export { createMock2DContext } from './canvas-stub.js';
|
|
15
|
+
export { createFakeSkia, mapPoint } from './fake-skia.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -48,13 +48,36 @@ export type RenderTheme = {
|
|
|
48
48
|
noteSelected: string;
|
|
49
49
|
noteRegenerated: string;
|
|
50
50
|
notePlaying: string;
|
|
51
|
+
/**
|
|
52
|
+
* Large translucent fill behind a selected measure. Defaults to
|
|
53
|
+
* `noteSelected` for existing callers, but can be softer than the selected
|
|
54
|
+
* note ink so a whole-bar selection reads as paper tint instead of a wash of
|
|
55
|
+
* notehead colour.
|
|
56
|
+
*/
|
|
57
|
+
measureSelection?: string;
|
|
51
58
|
/** Stave lines + barlines of the active track. */
|
|
52
59
|
staveActive: string;
|
|
53
60
|
/** Stave lines + barlines of every other track. */
|
|
54
61
|
staveInactive: string;
|
|
55
62
|
/** Playback caret. Drawn as a DOM element by the app, but themed here so every render color lives in one object. */
|
|
56
63
|
caret: string;
|
|
64
|
+
/**
|
|
65
|
+
* Ink used for print renders. Defaults to black, so paper output stays
|
|
66
|
+
* readable even when the screen theme is dark or otherwise low-contrast on
|
|
67
|
+
* white paper.
|
|
68
|
+
*/
|
|
69
|
+
printForeground?: string;
|
|
57
70
|
};
|
|
71
|
+
/** Default high-contrast paper ink. */
|
|
72
|
+
export declare const PRINT_INK = "#000000";
|
|
73
|
+
/**
|
|
74
|
+
* A calm default screen palette for notation surfaces. Apps can still supply
|
|
75
|
+
* their own theme, but this gives the package an eye-friendly baseline with
|
|
76
|
+
* distinct state colours and print-safe ink.
|
|
77
|
+
*/
|
|
78
|
+
export declare const DEFAULT_SCREEN_RENDER_THEME: RenderTheme;
|
|
79
|
+
/** A monochrome theme for callers that render paper-first surfaces. */
|
|
80
|
+
export declare const DEFAULT_PRINT_RENDER_THEME: RenderTheme;
|
|
58
81
|
export type RenderOptions = {
|
|
59
82
|
/** Linear scale factor applied to the whole render (measure width, stave height, font size). */
|
|
60
83
|
zoom: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oGAAoG;AACpG,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5C,KAAK,oBAAoB,GAAG;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,UAAU,CAIvE;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAE1E;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;I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1B,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAYzC,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,EAAE,WAYxC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,UAAU,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,sHAAsH;IACtH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAChD,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,4IAA4I;IAC5I,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -17,6 +17,40 @@ export function renderModeFor(options) {
|
|
|
17
17
|
}
|
|
18
18
|
/** Whether the left track-info gutter should be reserved and painted. */
|
|
19
19
|
export function shouldShowTrackInfo(options) {
|
|
20
|
-
return options.showTrackInfo ??
|
|
20
|
+
return options.showTrackInfo ?? renderModeFor(options) === 'screen';
|
|
21
21
|
}
|
|
22
|
+
/** Default high-contrast paper ink. */
|
|
23
|
+
export const PRINT_INK = '#000000';
|
|
24
|
+
/**
|
|
25
|
+
* A calm default screen palette for notation surfaces. Apps can still supply
|
|
26
|
+
* their own theme, but this gives the package an eye-friendly baseline with
|
|
27
|
+
* distinct state colours and print-safe ink.
|
|
28
|
+
*/
|
|
29
|
+
export const DEFAULT_SCREEN_RENDER_THEME = {
|
|
30
|
+
foreground: '#1f2937',
|
|
31
|
+
noteNormal: '#111827',
|
|
32
|
+
noteInactive: '#8a97a8',
|
|
33
|
+
noteSelected: '#050816',
|
|
34
|
+
noteRegenerated: '#2563eb',
|
|
35
|
+
notePlaying: '#0f766e',
|
|
36
|
+
measureSelection: '#f59e0b',
|
|
37
|
+
staveActive: '#64748b',
|
|
38
|
+
staveInactive: '#c3ccd8',
|
|
39
|
+
caret: '#e11d48',
|
|
40
|
+
printForeground: PRINT_INK,
|
|
41
|
+
};
|
|
42
|
+
/** A monochrome theme for callers that render paper-first surfaces. */
|
|
43
|
+
export const DEFAULT_PRINT_RENDER_THEME = {
|
|
44
|
+
foreground: PRINT_INK,
|
|
45
|
+
noteNormal: PRINT_INK,
|
|
46
|
+
noteInactive: PRINT_INK,
|
|
47
|
+
noteSelected: PRINT_INK,
|
|
48
|
+
noteRegenerated: PRINT_INK,
|
|
49
|
+
notePlaying: PRINT_INK,
|
|
50
|
+
measureSelection: PRINT_INK,
|
|
51
|
+
staveActive: PRINT_INK,
|
|
52
|
+
staveInactive: PRINT_INK,
|
|
53
|
+
caret: PRINT_INK,
|
|
54
|
+
printForeground: PRINT_INK,
|
|
55
|
+
};
|
|
22
56
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,OAAO,CACL,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,aAA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IACtB,gBAAgB,EAAE,SAAS;IAC3B,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,SAAS;CAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/music_drawing",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Canvas score rendering for Moosiac: layout, VexFlow drawing and the paint loop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
|
+
"react-native": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"types": "./dist/index.d.ts",
|
|
12
13
|
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./skia": {
|
|
16
|
+
"types": "./dist/skia/index.d.ts",
|
|
17
|
+
"import": "./dist/skia/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./test": {
|
|
20
|
+
"types": "./dist/test/index.d.ts",
|
|
21
|
+
"import": "./dist/test/index.js"
|
|
13
22
|
}
|
|
14
23
|
},
|
|
15
24
|
"files": [
|
|
@@ -21,21 +30,22 @@
|
|
|
21
30
|
"test": "vitest run",
|
|
22
31
|
"test:watch": "vitest",
|
|
23
32
|
"lint": "eslint src",
|
|
24
|
-
"format": "prettier --write src/**/*.ts",
|
|
25
|
-
"format:check": "prettier --check src/**/*.ts",
|
|
33
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
34
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
26
35
|
"typecheck": "tsc --noEmit",
|
|
27
|
-
"
|
|
36
|
+
"typecheck:dom": "tsc -p tsconfig.dom-compat.json",
|
|
37
|
+
"verify": "bun run format:check && bun run typecheck && bun run typecheck:dom && bun run lint && bun run test && bun run build",
|
|
28
38
|
"prepublishOnly": "bun run clean && bun run verify"
|
|
29
39
|
},
|
|
30
40
|
"dependencies": {
|
|
31
41
|
"vexflow": "^4.2.5"
|
|
32
42
|
},
|
|
33
43
|
"peerDependencies": {
|
|
34
|
-
"@sudobility/music_types": "^0.
|
|
44
|
+
"@sudobility/music_types": "^0.13.1"
|
|
35
45
|
},
|
|
36
46
|
"devDependencies": {
|
|
37
47
|
"@eslint/js": "^9.38.0",
|
|
38
|
-
"@sudobility/music_types": "^0.
|
|
48
|
+
"@sudobility/music_types": "^0.13.1",
|
|
39
49
|
"@sudobility/types": "^1.9.66",
|
|
40
50
|
"@tonejs/midi": "^2.0.28",
|
|
41
51
|
"@types/jsdom": "^30.0.0",
|