vexflow-native 0.0.2 → 0.1.0
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/module/SkiaVexflowContext.js +285 -0
- package/lib/module/SkiaVexflowContext.js.map +1 -0
- package/lib/module/VexflowCanvas.js +101 -0
- package/lib/module/VexflowCanvas.js.map +1 -0
- package/lib/module/colorUtils.js +34 -0
- package/lib/module/colorUtils.js.map +1 -0
- package/lib/module/colorUtils.test.js +37 -0
- package/lib/module/colorUtils.test.js.map +1 -0
- package/lib/module/constants.js +30 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +79 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/src/SkiaVexflowContext.d.ts +101 -0
- package/lib/typescript/src/SkiaVexflowContext.d.ts.map +1 -0
- package/lib/typescript/src/VexflowCanvas.d.ts +15 -0
- package/lib/typescript/src/VexflowCanvas.d.ts.map +1 -0
- package/lib/typescript/src/colorUtils.d.ts +2 -0
- package/lib/typescript/src/colorUtils.d.ts.map +1 -0
- package/lib/typescript/src/colorUtils.test.d.ts +2 -0
- package/lib/typescript/src/colorUtils.test.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +21 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +7 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +7 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/package.json +7 -3
- package/src/SkiaVexflowContext.ts +462 -0
- package/src/VexflowCanvas.tsx +140 -0
- package/src/colorUtils.test.ts +52 -0
- package/src/colorUtils.ts +55 -0
- package/src/constants.tsx +34 -0
- package/src/index.ts +8 -0
- package/src/types.ts +7 -0
- package/src/utils.tsx +108 -0
- package/src/index.tsx +0 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type SkCanvas, type SkFont } from '@shopify/react-native-skia';
|
|
2
|
+
import { RenderContext as VexflowRenderContext } from 'vexflow';
|
|
3
|
+
import type { FontInfo } from 'vexflow';
|
|
4
|
+
type SkiaVexflowContextOptions = {
|
|
5
|
+
defaultFillStyle?: string;
|
|
6
|
+
defaultStrokeStyle?: string;
|
|
7
|
+
};
|
|
8
|
+
type CanvasLineCap = 'butt' | 'round' | 'square';
|
|
9
|
+
interface DOMMatrix2DInit {
|
|
10
|
+
a?: number;
|
|
11
|
+
b?: number;
|
|
12
|
+
c?: number;
|
|
13
|
+
d?: number;
|
|
14
|
+
e?: number;
|
|
15
|
+
f?: number;
|
|
16
|
+
m11?: number;
|
|
17
|
+
m12?: number;
|
|
18
|
+
m21?: number;
|
|
19
|
+
m22?: number;
|
|
20
|
+
m41?: number;
|
|
21
|
+
m42?: number;
|
|
22
|
+
}
|
|
23
|
+
interface CanvasGradient {
|
|
24
|
+
/**
|
|
25
|
+
* The **`CanvasGradient.addColorStop()`** method adds a new color stop, defined by an `offset` and a `color`, to a given canvas gradient.
|
|
26
|
+
*
|
|
27
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasGradient/addColorStop)
|
|
28
|
+
*/
|
|
29
|
+
addColorStop(offset: number, color: string): void;
|
|
30
|
+
}
|
|
31
|
+
interface CanvasPattern {
|
|
32
|
+
/**
|
|
33
|
+
* The **`CanvasPattern.setTransform()`** method uses a DOMMatrix object as the pattern's transformation matrix and invokes it on the pattern.
|
|
34
|
+
*
|
|
35
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform)
|
|
36
|
+
*/
|
|
37
|
+
setTransform(transform?: DOMMatrix2DInit): void;
|
|
38
|
+
}
|
|
39
|
+
export default class SkiaVexflowContext implements VexflowRenderContext {
|
|
40
|
+
static get CATEGORY(): string;
|
|
41
|
+
private canvas;
|
|
42
|
+
private currentPath;
|
|
43
|
+
private fillPaint;
|
|
44
|
+
private strokePaint;
|
|
45
|
+
private textFont;
|
|
46
|
+
private bravuraFont;
|
|
47
|
+
private defaultFillStyle;
|
|
48
|
+
private defaultStrokeStyle;
|
|
49
|
+
private stateStack;
|
|
50
|
+
private state;
|
|
51
|
+
constructor(canvas: SkCanvas, bravuraFont?: SkFont | null, options?: SkiaVexflowContextOptions);
|
|
52
|
+
private applyState;
|
|
53
|
+
clear(): void;
|
|
54
|
+
setFillStyle(style: string): this;
|
|
55
|
+
setBackgroundFillStyle(style: string): this;
|
|
56
|
+
setStrokeStyle(style: string): this;
|
|
57
|
+
setShadowColor(color: string): this;
|
|
58
|
+
setShadowBlur(blur: number): this;
|
|
59
|
+
setLineWidth(width: number): this;
|
|
60
|
+
setLineCap(capType: CanvasLineCap): this;
|
|
61
|
+
setLineDash(dashPattern: number[]): this;
|
|
62
|
+
scale(x: number, y: number): this;
|
|
63
|
+
rect(x: number, y: number, width: number, height: number): this;
|
|
64
|
+
resize(width: number, height: number): this;
|
|
65
|
+
fillRect(x: number, y: number, width: number, height: number): this;
|
|
66
|
+
clearRect(x: number, y: number, width: number, height: number): this;
|
|
67
|
+
pointerRect(x: number, y: number, width: number, height: number): this;
|
|
68
|
+
beginPath(): this;
|
|
69
|
+
moveTo(x: number, y: number): this;
|
|
70
|
+
lineTo(x: number, y: number): this;
|
|
71
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): this;
|
|
72
|
+
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): this;
|
|
73
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): this;
|
|
74
|
+
fill(attributes?: any): this;
|
|
75
|
+
stroke(): this;
|
|
76
|
+
closePath(): this;
|
|
77
|
+
fillText(text: string, x: number, y: number): this;
|
|
78
|
+
save(): this;
|
|
79
|
+
restore(): this;
|
|
80
|
+
openGroup(cls?: string, id?: string): null;
|
|
81
|
+
closeGroup(): void;
|
|
82
|
+
openRotation(angleDegrees: number, x: number, y: number): void;
|
|
83
|
+
closeRotation(): void;
|
|
84
|
+
add(child: any): void;
|
|
85
|
+
measureText(text: string): {
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
};
|
|
91
|
+
set fillStyle(style: string | CanvasGradient | CanvasPattern);
|
|
92
|
+
get fillStyle(): string | CanvasGradient | CanvasPattern;
|
|
93
|
+
set strokeStyle(style: string | CanvasGradient | CanvasPattern);
|
|
94
|
+
get strokeStyle(): string | CanvasGradient | CanvasPattern;
|
|
95
|
+
setFont(font?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): this;
|
|
96
|
+
getFont(): string;
|
|
97
|
+
set font(font: string);
|
|
98
|
+
get font(): string;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
101
|
+
//# sourceMappingURL=SkiaVexflowContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkiaVexflowContext.d.ts","sourceRoot":"","sources":["../../../src/SkiaVexflowContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,MAAM,EAGZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA8BxC,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAWF,KAAK,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjD,UAAU,eAAe;IACvB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,C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{
|
|
8
|
+
onDraw: (args: VexflowCanvasDrawArgs) => void;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
colorScheme?: 'light' | 'dark';
|
|
12
|
+
};
|
|
13
|
+
export default function VexflowCanvas({ onDraw, width, height, colorScheme, }: VexflowCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=VexflowCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VexflowCanvas.d.ts","sourceRoot":"","sources":["../../../src/VexflowCanvas.tsx"],"names":[],"mappings":"AAYA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAMtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE,kBAAkB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,CAAC;AAkEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,KAAK,EACL,MAAsB,EACtB,WAAqB,GACtB,EAAE,kBAAkB,2CAuCpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../src/colorUtils.ts"],"names":[],"mappings":"AAgDA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorUtils.test.d.ts","sourceRoot":"","sources":["../../../src/colorUtils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SkFont, StrokeCap, StrokeJoin } from '@shopify/react-native-skia';
|
|
2
|
+
import { type LineCap, type LineJoin } from './types';
|
|
3
|
+
export declare const PT_TO_PX: number;
|
|
4
|
+
export declare const VEXFLOW_SCORE_COLORS: {
|
|
5
|
+
readonly light: {
|
|
6
|
+
readonly fill: "#111827";
|
|
7
|
+
readonly stroke: "#111827";
|
|
8
|
+
};
|
|
9
|
+
readonly dark: {
|
|
10
|
+
readonly fill: "#F9FAFB";
|
|
11
|
+
readonly stroke: "#F9FAFB";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const DEFAULT_FILL_STYLE: "#111827";
|
|
15
|
+
export declare const DEFAULT_STROKE_STYLE: "#111827";
|
|
16
|
+
export declare const DEFAULT_LINE_WIDTH = 1;
|
|
17
|
+
export declare const DEFAULT_FONT = "12px Bravura";
|
|
18
|
+
export declare const LINE_CAP_MAP: Record<LineCap, StrokeCap>;
|
|
19
|
+
export declare const LINE_JOIN_MAP: Record<LineJoin, StrokeJoin>;
|
|
20
|
+
export declare const fontCache: Map<string, SkFont>;
|
|
21
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAE9B,eAAO,MAAM,oBAAoB;;;;;;;;;CASvB,CAAC;AAEX,eAAO,MAAM,kBAAkB,WAAkC,CAAC;AAClE,eAAO,MAAM,oBAAoB,WAAoC,CAAC;AACtE,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,CAInD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAItD,CAAC;AAEF,eAAO,MAAM,SAAS,qBAA4B,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './utils';
|
|
4
|
+
export { default as SkiaVexflowContext } from './SkiaVexflowContext';
|
|
5
|
+
export { default as VexflowCanvas } from './VexflowCanvas';
|
|
6
|
+
export type { VexflowCanvasDrawArgs } from './VexflowCanvas';
|
|
2
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3D,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SkFont } from '@shopify/react-native-skia';
|
|
2
|
+
import { type ParsedCssFont } from './types';
|
|
3
|
+
export declare function getAdvanceWidth(font: SkFont, text: string): number;
|
|
4
|
+
export declare function toPxFontSize(size: number | string | undefined): number;
|
|
5
|
+
export declare function parseCssFontShorthand(cssFont: string): ParsedCssFont;
|
|
6
|
+
export declare function createFont(size: number, familyName?: string, bravuraFont?: SkFont | null): SkFont;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAmBtE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAiBpE;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAC1B,MAAM,CAoDR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vexflow-native",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "React native backend for rendering music notation using @shopify/react-native-skiaact-native-skia",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"@react-native/babel-preset": "0.83.0",
|
|
67
67
|
"@react-native/eslint-config": "0.83.0",
|
|
68
68
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
69
|
+
"@shopify/react-native-skia": "^2.4.21",
|
|
69
70
|
"@types/jest": "^29.5.14",
|
|
70
71
|
"@types/react": "^19.1.12",
|
|
71
72
|
"commitlint": "^19.8.1",
|
|
@@ -81,11 +82,14 @@
|
|
|
81
82
|
"react-native-builder-bob": "^0.40.18",
|
|
82
83
|
"release-it": "^19.0.4",
|
|
83
84
|
"turbo": "^2.5.6",
|
|
84
|
-
"typescript": "^5.9.2"
|
|
85
|
+
"typescript": "^5.9.2",
|
|
86
|
+
"vexflow": "^5.0.0"
|
|
85
87
|
},
|
|
86
88
|
"peerDependencies": {
|
|
89
|
+
"@shopify/react-native-skia": "*",
|
|
87
90
|
"react": "*",
|
|
88
|
-
"react-native": "*"
|
|
91
|
+
"react-native": "*",
|
|
92
|
+
"vexflow": "*"
|
|
89
93
|
},
|
|
90
94
|
"workspaces": [
|
|
91
95
|
"example"
|