vexflow-native 0.2.0 → 1.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.
Files changed (259) hide show
  1. package/README.md +267 -37
  2. package/lib/module/base/FontManager.js +139 -0
  3. package/lib/module/base/FontManager.js.map +1 -0
  4. package/lib/module/base/TextMeasureContext.js +46 -0
  5. package/lib/module/base/TextMeasureContext.js.map +1 -0
  6. package/lib/module/base/VexflowCanvas.js +48 -0
  7. package/lib/module/base/VexflowCanvas.js.map +1 -0
  8. package/lib/module/base/VexflowColorScheme.js +16 -0
  9. package/lib/module/base/VexflowColorScheme.js.map +1 -0
  10. package/lib/module/base/VexflowRecordingContext.js +487 -0
  11. package/lib/module/base/VexflowRecordingContext.js.map +1 -0
  12. package/lib/module/base/VexflowRecordingReplay.js +214 -0
  13. package/lib/module/base/VexflowRecordingReplay.js.map +1 -0
  14. package/lib/module/base/VexflowRecordingTypes.js +4 -0
  15. package/lib/module/base/VexflowRecordingTypes.js.map +1 -0
  16. package/lib/module/base/index.js +9 -0
  17. package/lib/module/base/index.js.map +1 -0
  18. package/lib/module/base/setupVexflowReactNative.js +96 -0
  19. package/lib/module/base/setupVexflowReactNative.js.map +1 -0
  20. package/lib/module/base/types.js +4 -0
  21. package/lib/module/base/types.js.map +1 -0
  22. package/lib/module/base/utils.js +18 -0
  23. package/lib/module/base/utils.js.map +1 -0
  24. package/lib/module/musicxml/MusicXmlParser/InternalTypes.js +4 -0
  25. package/lib/module/musicxml/MusicXmlParser/InternalTypes.js.map +1 -0
  26. package/lib/module/musicxml/MusicXmlParser/MeasureParser.js +269 -0
  27. package/lib/module/musicxml/MusicXmlParser/MeasureParser.js.map +1 -0
  28. package/lib/module/musicxml/MusicXmlParser/MusicXmlDirections.js +62 -0
  29. package/lib/module/musicxml/MusicXmlParser/MusicXmlDirections.js.map +1 -0
  30. package/lib/module/musicxml/MusicXmlParser/MusicXmlTiming.js +124 -0
  31. package/lib/module/musicxml/MusicXmlParser/MusicXmlTiming.js.map +1 -0
  32. package/lib/module/musicxml/MusicXmlParser/PartParser.js +41 -0
  33. package/lib/module/musicxml/MusicXmlParser/PartParser.js.map +1 -0
  34. package/lib/module/musicxml/MusicXmlParser/Spanners.js +149 -0
  35. package/lib/module/musicxml/MusicXmlParser/Spanners.js.map +1 -0
  36. package/lib/module/musicxml/MusicXmlParser/XmlOrder.js +106 -0
  37. package/lib/module/musicxml/MusicXmlParser/XmlOrder.js.map +1 -0
  38. package/lib/module/musicxml/MusicXmlParser/index.js +110 -0
  39. package/lib/module/musicxml/MusicXmlParser/index.js.map +1 -0
  40. package/lib/module/musicxml/MusicXmlParser/mappers.js +312 -0
  41. package/lib/module/musicxml/MusicXmlParser/mappers.js.map +1 -0
  42. package/lib/module/musicxml/MusicXmlParser/types.js +10 -0
  43. package/lib/module/musicxml/MusicXmlParser/types.js.map +1 -0
  44. package/lib/module/musicxml/index.js +4 -0
  45. package/lib/module/musicxml/index.js.map +1 -0
  46. package/lib/module/musicxml/testfiles/lg-8102429.xml +79620 -0
  47. package/lib/module/renderer/Layout/DocumentLayout.js +156 -0
  48. package/lib/module/renderer/Layout/DocumentLayout.js.map +1 -0
  49. package/lib/module/renderer/Layout/LayoutMetrics.js +13 -0
  50. package/lib/module/renderer/Layout/LayoutMetrics.js.map +1 -0
  51. package/lib/module/renderer/Layout/VerticalSpacing.js +69 -0
  52. package/lib/module/renderer/Layout/VerticalSpacing.js.map +1 -0
  53. package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js +277 -0
  54. package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js.map +1 -0
  55. package/lib/module/renderer/ScoreRenderer/ScoreScrollbar.js +108 -0
  56. package/lib/module/renderer/ScoreRenderer/ScoreScrollbar.js.map +1 -0
  57. package/lib/module/renderer/ScoreRenderer/index.js +7 -0
  58. package/lib/module/renderer/ScoreRenderer/index.js.map +1 -0
  59. package/lib/module/renderer/ScoreRenderer/types.js +4 -0
  60. package/lib/module/renderer/ScoreRenderer/types.js.map +1 -0
  61. package/lib/module/renderer/ScoreRenderer/useScoreScroll.js +77 -0
  62. package/lib/module/renderer/ScoreRenderer/useScoreScroll.js.map +1 -0
  63. package/lib/module/renderer/colorScheme.js +17 -0
  64. package/lib/module/renderer/colorScheme.js.map +1 -0
  65. package/lib/module/renderer/constants.js +18 -0
  66. package/lib/module/renderer/constants.js.map +1 -0
  67. package/lib/module/renderer/index.js +6 -0
  68. package/lib/module/renderer/index.js.map +1 -0
  69. package/lib/module/renderer/layout.js +153 -0
  70. package/lib/module/renderer/layout.js.map +1 -0
  71. package/lib/module/renderer/measure.js +202 -0
  72. package/lib/module/renderer/measure.js.map +1 -0
  73. package/lib/module/renderer/render.js +184 -0
  74. package/lib/module/renderer/render.js.map +1 -0
  75. package/lib/module/renderer/scoreParsing.js +230 -0
  76. package/lib/module/renderer/scoreParsing.js.map +1 -0
  77. package/lib/module/renderer/types.js +4 -0
  78. package/lib/module/renderer/types.js.map +1 -0
  79. package/lib/module/renderer/useScoreRecording.js +112 -0
  80. package/lib/module/renderer/useScoreRecording.js.map +1 -0
  81. package/lib/module/renderer/viewport.js +26 -0
  82. package/lib/module/renderer/viewport.js.map +1 -0
  83. package/lib/module/shared/Logger.js +67 -0
  84. package/lib/module/shared/Logger.js.map +1 -0
  85. package/lib/module/state/index.js +4 -0
  86. package/lib/module/state/index.js.map +1 -0
  87. package/lib/module/state/types.js +2 -0
  88. package/lib/module/state/types.js.map +1 -0
  89. package/lib/module/types.js +7 -0
  90. package/lib/module/types.js.map +1 -1
  91. package/lib/module/utils.js +42 -77
  92. package/lib/module/utils.js.map +1 -1
  93. package/lib/typescript/src/base/FontManager.d.ts +23 -0
  94. package/lib/typescript/src/base/FontManager.d.ts.map +1 -0
  95. package/lib/typescript/src/base/TextMeasureContext.d.ts +22 -0
  96. package/lib/typescript/src/base/TextMeasureContext.d.ts.map +1 -0
  97. package/lib/typescript/src/base/VexflowCanvas.d.ts +5 -0
  98. package/lib/typescript/src/base/VexflowCanvas.d.ts.map +1 -0
  99. package/lib/typescript/src/base/VexflowColorScheme.d.ts +7 -0
  100. package/lib/typescript/src/base/VexflowColorScheme.d.ts.map +1 -0
  101. package/lib/typescript/src/base/VexflowRecordingContext.d.ts +103 -0
  102. package/lib/typescript/src/base/VexflowRecordingContext.d.ts.map +1 -0
  103. package/lib/typescript/src/base/VexflowRecordingReplay.d.ts +12 -0
  104. package/lib/typescript/src/base/VexflowRecordingReplay.d.ts.map +1 -0
  105. package/lib/typescript/src/base/VexflowRecordingTypes.d.ts +146 -0
  106. package/lib/typescript/src/base/VexflowRecordingTypes.d.ts.map +1 -0
  107. package/lib/typescript/src/base/index.d.ts +7 -0
  108. package/lib/typescript/src/base/index.d.ts.map +1 -0
  109. package/lib/typescript/src/base/setupVexflowReactNative.d.ts +11 -0
  110. package/lib/typescript/src/base/setupVexflowReactNative.d.ts.map +1 -0
  111. package/lib/typescript/src/base/types.d.ts +13 -0
  112. package/lib/typescript/src/base/types.d.ts.map +1 -0
  113. package/lib/typescript/src/base/utils.d.ts +2 -0
  114. package/lib/typescript/src/base/utils.d.ts.map +1 -0
  115. package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts +30 -0
  116. package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts.map +1 -0
  117. package/lib/typescript/src/musicxml/MusicXmlParser/MeasureParser.d.ts +4 -0
  118. package/lib/typescript/src/musicxml/MusicXmlParser/MeasureParser.d.ts.map +1 -0
  119. package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlDirections.d.ts +5 -0
  120. package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlDirections.d.ts.map +1 -0
  121. package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlTiming.d.ts +6 -0
  122. package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlTiming.d.ts.map +1 -0
  123. package/lib/typescript/src/musicxml/MusicXmlParser/PartParser.d.ts +8 -0
  124. package/lib/typescript/src/musicxml/MusicXmlParser/PartParser.d.ts.map +1 -0
  125. package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts +4 -0
  126. package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts.map +1 -0
  127. package/lib/typescript/src/musicxml/MusicXmlParser/XmlOrder.d.ts +20 -0
  128. package/lib/typescript/src/musicxml/MusicXmlParser/XmlOrder.d.ts.map +1 -0
  129. package/lib/typescript/src/musicxml/MusicXmlParser/index.d.ts +5 -0
  130. package/lib/typescript/src/musicxml/MusicXmlParser/index.d.ts.map +1 -0
  131. package/lib/typescript/src/musicxml/MusicXmlParser/mappers.d.ts +15 -0
  132. package/lib/typescript/src/musicxml/MusicXmlParser/mappers.d.ts.map +1 -0
  133. package/lib/typescript/src/musicxml/MusicXmlParser/types.d.ts +13 -0
  134. package/lib/typescript/src/musicxml/MusicXmlParser/types.d.ts.map +1 -0
  135. package/lib/typescript/src/musicxml/index.d.ts +2 -0
  136. package/lib/typescript/src/musicxml/index.d.ts.map +1 -0
  137. package/lib/typescript/src/renderer/Layout/DocumentLayout.d.ts +10 -0
  138. package/lib/typescript/src/renderer/Layout/DocumentLayout.d.ts.map +1 -0
  139. package/lib/typescript/src/renderer/Layout/LayoutMetrics.d.ts +6 -0
  140. package/lib/typescript/src/renderer/Layout/LayoutMetrics.d.ts.map +1 -0
  141. package/lib/typescript/src/renderer/Layout/VerticalSpacing.d.ts +9 -0
  142. package/lib/typescript/src/renderer/Layout/VerticalSpacing.d.ts.map +1 -0
  143. package/lib/typescript/src/renderer/ScoreRenderer/ScoreRenderer.d.ts +15 -0
  144. package/lib/typescript/src/renderer/ScoreRenderer/ScoreRenderer.d.ts.map +1 -0
  145. package/lib/typescript/src/renderer/ScoreRenderer/ScoreScrollbar.d.ts +24 -0
  146. package/lib/typescript/src/renderer/ScoreRenderer/ScoreScrollbar.d.ts.map +1 -0
  147. package/lib/typescript/src/renderer/ScoreRenderer/index.d.ts +5 -0
  148. package/lib/typescript/src/renderer/ScoreRenderer/index.d.ts.map +1 -0
  149. package/lib/typescript/src/renderer/ScoreRenderer/types.d.ts +12 -0
  150. package/lib/typescript/src/renderer/ScoreRenderer/types.d.ts.map +1 -0
  151. package/lib/typescript/src/renderer/ScoreRenderer/useScoreScroll.d.ts +13 -0
  152. package/lib/typescript/src/renderer/ScoreRenderer/useScoreScroll.d.ts.map +1 -0
  153. package/lib/typescript/src/renderer/colorScheme.d.ts +9 -0
  154. package/lib/typescript/src/renderer/colorScheme.d.ts.map +1 -0
  155. package/lib/typescript/src/renderer/constants.d.ts +5 -0
  156. package/lib/typescript/src/renderer/constants.d.ts.map +1 -0
  157. package/lib/typescript/src/renderer/index.d.ts +4 -0
  158. package/lib/typescript/src/renderer/index.d.ts.map +1 -0
  159. package/lib/typescript/src/renderer/layout.d.ts +56 -0
  160. package/lib/typescript/src/renderer/layout.d.ts.map +1 -0
  161. package/lib/typescript/src/renderer/measure.d.ts +23 -0
  162. package/lib/typescript/src/renderer/measure.d.ts.map +1 -0
  163. package/lib/typescript/src/renderer/render.d.ts +9 -0
  164. package/lib/typescript/src/renderer/render.d.ts.map +1 -0
  165. package/lib/typescript/src/renderer/scoreParsing.d.ts +76 -0
  166. package/lib/typescript/src/renderer/scoreParsing.d.ts.map +1 -0
  167. package/lib/typescript/src/renderer/types.d.ts +56 -0
  168. package/lib/typescript/src/renderer/types.d.ts.map +1 -0
  169. package/lib/typescript/src/renderer/useScoreRecording.d.ts +21 -0
  170. package/lib/typescript/src/renderer/useScoreRecording.d.ts.map +1 -0
  171. package/lib/typescript/src/renderer/viewport.d.ts +3 -0
  172. package/lib/typescript/src/renderer/viewport.d.ts.map +1 -0
  173. package/lib/typescript/src/shared/Logger.d.ts +18 -0
  174. package/lib/typescript/src/shared/Logger.d.ts.map +1 -0
  175. package/lib/typescript/src/state/index.d.ts +2 -0
  176. package/lib/typescript/src/state/index.d.ts.map +1 -0
  177. package/lib/typescript/src/state/types.d.ts +190 -0
  178. package/lib/typescript/src/state/types.d.ts.map +1 -0
  179. package/lib/typescript/src/types.d.ts +0 -6
  180. package/lib/typescript/src/types.d.ts.map +1 -1
  181. package/lib/typescript/src/utils.d.ts +0 -6
  182. package/lib/typescript/src/utils.d.ts.map +1 -1
  183. package/package.json +41 -14
  184. package/src/base/FontManager.ts +206 -0
  185. package/src/base/TextMeasureContext.ts +59 -0
  186. package/src/base/VexflowCanvas.tsx +60 -0
  187. package/src/base/VexflowColorScheme.ts +32 -0
  188. package/src/base/VexflowRecordingContext.ts +545 -0
  189. package/src/base/VexflowRecordingReplay.ts +327 -0
  190. package/src/base/VexflowRecordingTypes.ts +169 -0
  191. package/src/base/index.ts +7 -0
  192. package/src/base/setupVexflowReactNative.ts +124 -0
  193. package/src/base/types.ts +17 -0
  194. package/src/base/utils.ts +21 -0
  195. package/src/musicxml/MusicXmlParser/InternalTypes.ts +41 -0
  196. package/src/musicxml/MusicXmlParser/MeasureParser.ts +469 -0
  197. package/src/musicxml/MusicXmlParser/MusicXmlDirections.ts +84 -0
  198. package/src/musicxml/MusicXmlParser/MusicXmlTiming.ts +153 -0
  199. package/src/musicxml/MusicXmlParser/PartParser.ts +69 -0
  200. package/src/musicxml/MusicXmlParser/Spanners.ts +215 -0
  201. package/src/musicxml/MusicXmlParser/XmlOrder.ts +170 -0
  202. package/src/musicxml/MusicXmlParser/index.ts +144 -0
  203. package/src/musicxml/MusicXmlParser/mappers.ts +307 -0
  204. package/src/musicxml/MusicXmlParser/types.ts +24 -0
  205. package/src/musicxml/index.ts +5 -0
  206. package/src/musicxml/testfiles/lg-8102429.xml +79620 -0
  207. package/src/renderer/Layout/DocumentLayout.ts +240 -0
  208. package/src/renderer/Layout/LayoutMetrics.ts +21 -0
  209. package/src/renderer/Layout/VerticalSpacing.ts +122 -0
  210. package/src/renderer/ScoreRenderer/ScoreRenderer.tsx +384 -0
  211. package/src/renderer/ScoreRenderer/ScoreScrollbar.tsx +231 -0
  212. package/src/renderer/ScoreRenderer/index.ts +13 -0
  213. package/src/renderer/ScoreRenderer/types.ts +14 -0
  214. package/src/renderer/ScoreRenderer/useScoreScroll.ts +146 -0
  215. package/src/renderer/colorScheme.ts +28 -0
  216. package/src/renderer/constants.ts +19 -0
  217. package/src/renderer/index.ts +3 -0
  218. package/src/renderer/layout.ts +309 -0
  219. package/src/renderer/measure.tsx +304 -0
  220. package/src/renderer/render.tsx +308 -0
  221. package/src/renderer/scoreParsing.tsx +352 -0
  222. package/src/renderer/types.ts +65 -0
  223. package/src/renderer/useScoreRecording.ts +177 -0
  224. package/src/renderer/viewport.ts +45 -0
  225. package/src/shared/Logger.ts +85 -0
  226. package/src/state/index.ts +1 -0
  227. package/src/state/types.ts +295 -0
  228. package/src/types.ts +6 -6
  229. package/src/utils.tsx +32 -98
  230. package/lib/module/SkiaVexflowContext.js +0 -285
  231. package/lib/module/SkiaVexflowContext.js.map +0 -1
  232. package/lib/module/VexflowCanvas.js +0 -103
  233. package/lib/module/VexflowCanvas.js.map +0 -1
  234. package/lib/module/colorUtils.js +0 -34
  235. package/lib/module/colorUtils.js.map +0 -1
  236. package/lib/module/colorUtils.test.js +0 -37
  237. package/lib/module/colorUtils.test.js.map +0 -1
  238. package/lib/module/constants.js +0 -30
  239. package/lib/module/constants.js.map +0 -1
  240. package/lib/module/index.js +0 -8
  241. package/lib/module/index.js.map +0 -1
  242. package/lib/typescript/src/SkiaVexflowContext.d.ts +0 -101
  243. package/lib/typescript/src/SkiaVexflowContext.d.ts.map +0 -1
  244. package/lib/typescript/src/VexflowCanvas.d.ts +0 -17
  245. package/lib/typescript/src/VexflowCanvas.d.ts.map +0 -1
  246. package/lib/typescript/src/colorUtils.d.ts +0 -2
  247. package/lib/typescript/src/colorUtils.d.ts.map +0 -1
  248. package/lib/typescript/src/colorUtils.test.d.ts +0 -2
  249. package/lib/typescript/src/colorUtils.test.d.ts.map +0 -1
  250. package/lib/typescript/src/constants.d.ts +0 -21
  251. package/lib/typescript/src/constants.d.ts.map +0 -1
  252. package/lib/typescript/src/index.d.ts +0 -7
  253. package/lib/typescript/src/index.d.ts.map +0 -1
  254. package/src/SkiaVexflowContext.ts +0 -462
  255. package/src/VexflowCanvas.tsx +0 -145
  256. package/src/colorUtils.test.ts +0 -52
  257. package/src/colorUtils.ts +0 -55
  258. package/src/constants.tsx +0 -34
  259. package/src/index.ts +0 -8
@@ -0,0 +1,487 @@
1
+ "use strict";
2
+
3
+ import { Platform } from 'react-native';
4
+ import { Element } from 'vexflow';
5
+ import FontManager from "./FontManager.js";
6
+ import TextMeasureContext from "./TextMeasureContext.js";
7
+ import { installVexflowReactNativeFallbacks } from "./setupVexflowReactNative.js";
8
+ import { resolveVexflowColor } from "./VexflowColorScheme.js";
9
+ const showSilentLogs = false;
10
+ const WidthScale = 3 / 4;
11
+ function logUnimplemented(methodName, isSilent = false) {
12
+ if (isSilent && !showSilentLogs) {
13
+ return;
14
+ }
15
+ console.log(`VexflowRecordingContext: Method "${methodName}" is not implemented yet.`);
16
+ }
17
+ export default class VexflowRecordingContext {
18
+ __workletClass = true;
19
+ commands = [];
20
+ fillPaint = {
21
+ color: '#000000'
22
+ };
23
+ strokePaint = {
24
+ color: '#000000',
25
+ strokeCap: 'butt',
26
+ strokeWidth: 1.5 * WidthScale
27
+ };
28
+ isFinished = false;
29
+ constructor(fontProvider, defaultFont, colorScheme) {
30
+ this.colorScheme = colorScheme;
31
+ this.fillPaint.color = resolveVexflowColor('black', colorScheme);
32
+ this.strokePaint.color = resolveVexflowColor('black', colorScheme);
33
+ this.fontManager = new FontManager(fontProvider, defaultFont);
34
+ this.textFontDescriptor = {
35
+ font: defaultFont
36
+ };
37
+ this.textFont = this.fontManager.createSkFont(defaultFont);
38
+ if (Platform.OS === 'ios' || Platform.OS === 'android') {
39
+ installVexflowReactNativeFallbacks();
40
+ this.textMeasurementContext = new TextMeasureContext(this);
41
+ Element.setTextMeasurementCanvas({
42
+ getContext: type => {
43
+ if (type === '2d') {
44
+ return this.textMeasurementContext;
45
+ }
46
+ return null;
47
+ }
48
+ });
49
+ } else {
50
+ const measurementCanvas = Element.getTextMeasurementCanvas();
51
+ this.textMeasurementContext = measurementCanvas?.getContext('2d');
52
+ }
53
+ }
54
+ getCurrentSkFont() {
55
+ return this.textFont;
56
+ }
57
+ getMeasurementContext() {
58
+ return this.textMeasurementContext;
59
+ }
60
+ finish() {
61
+ this.isFinished = true;
62
+ return this.commands.map(command => cloneCommand(command));
63
+ }
64
+ clear() {
65
+ this.pushCommand({
66
+ type: 'clear',
67
+ color: 'transparent'
68
+ });
69
+ return this;
70
+ }
71
+ setFillStyle(style) {
72
+ if (typeof style === 'string') {
73
+ this.fillPaint = {
74
+ ...this.fillPaint,
75
+ color: resolveVexflowColor(style, this.colorScheme)
76
+ };
77
+ return this;
78
+ }
79
+ logUnimplemented('setFillStyle (gradient or pattern)');
80
+ return this;
81
+ }
82
+ setBackgroundFillStyle(_style) {
83
+ logUnimplemented('setBackgroundFillStyle');
84
+ return this;
85
+ }
86
+ setStrokeStyle(style) {
87
+ this.strokePaint = {
88
+ ...this.strokePaint,
89
+ color: resolveVexflowColor(style, this.colorScheme)
90
+ };
91
+ return this;
92
+ }
93
+
94
+ /**
95
+ * Record a glow/shadow colour (CSS `shadowColor`) into both the fill and the
96
+ * stroke paint — VexFlow's `ElementStyle.shadowColor` is applied as ctx-level
97
+ * state that affects whatever is drawn next, fill or stroke. Replayed in Skia
98
+ * as a drop-shadow image filter (a glow around the ink) and overridable per
99
+ * group at replay.
100
+ */
101
+ setShadowColor(color) {
102
+ const resolved = resolveVexflowColor(color, this.colorScheme);
103
+ this.fillPaint = {
104
+ ...this.fillPaint,
105
+ shadowColor: resolved
106
+ };
107
+ this.strokePaint = {
108
+ ...this.strokePaint,
109
+ shadowColor: resolved
110
+ };
111
+ return this;
112
+ }
113
+
114
+ /**
115
+ * Record a glow/shadow blur radius (CSS `shadowBlur`) into both the fill and
116
+ * the stroke paint. Mapped to a Gaussian sigma at replay; only takes effect
117
+ * when a `shadowColor` is also set.
118
+ */
119
+ setShadowBlur(blur) {
120
+ this.fillPaint = {
121
+ ...this.fillPaint,
122
+ shadowBlur: blur
123
+ };
124
+ this.strokePaint = {
125
+ ...this.strokePaint,
126
+ shadowBlur: blur
127
+ };
128
+ return this;
129
+ }
130
+ setLineWidth(width) {
131
+ this.strokePaint = {
132
+ ...this.strokePaint,
133
+ strokeWidth: width * WidthScale
134
+ };
135
+ return this;
136
+ }
137
+ setLineCap(cap) {
138
+ this.strokePaint = {
139
+ ...this.strokePaint,
140
+ strokeCap: normalizeLineCap(cap)
141
+ };
142
+ return this;
143
+ }
144
+
145
+ /**
146
+ * Record a dash pattern (CSS `setLineDash`) into the stroke paint — dashing is
147
+ * a stroke-only concept (stems, ledger lines, …). Replayed in Skia as a dash
148
+ * path effect and overridable per group at replay. An empty array clears any
149
+ * recorded dash (CSS semantics: solid line).
150
+ */
151
+ setLineDash(dashPattern) {
152
+ this.strokePaint = {
153
+ ...this.strokePaint,
154
+ lineDash: dashPattern.length > 0 ? [...dashPattern] : undefined
155
+ };
156
+ return this;
157
+ }
158
+ scale(x, y) {
159
+ this.pushCommand({
160
+ type: 'scale',
161
+ x,
162
+ y
163
+ });
164
+ return this;
165
+ }
166
+ translate(x, y) {
167
+ this.pushCommand({
168
+ type: 'translate',
169
+ x,
170
+ y
171
+ });
172
+ return this;
173
+ }
174
+ resize(_width, _height) {
175
+ logUnimplemented('resize');
176
+ return this;
177
+ }
178
+ rect(x, y, width, height) {
179
+ this.currentPath?.push({
180
+ type: 'addRect',
181
+ rect: makeRect(x, y, width, height)
182
+ });
183
+ return this;
184
+ }
185
+ fillRect(x, y, width, height) {
186
+ this.pushCommand({
187
+ type: 'fillRect',
188
+ rect: makeRect(x, y, width, height),
189
+ paint: clonePaint(this.fillPaint)
190
+ });
191
+ return this;
192
+ }
193
+ clearRect(x, y, width, height) {
194
+ this.pushCommand({
195
+ type: 'clearRect',
196
+ rect: makeRect(x, y, width, height)
197
+ });
198
+ return this;
199
+ }
200
+ clipRect(x, y, width, height) {
201
+ this.pushCommand({
202
+ type: 'clipRect',
203
+ rect: makeRect(x, y, width, height)
204
+ });
205
+ return this;
206
+ }
207
+ pointerRect(_x, _y, _width, _height) {
208
+ logUnimplemented('pointerRect', true);
209
+ return this;
210
+ }
211
+ beginPath() {
212
+ this.currentPath = [];
213
+ return this;
214
+ }
215
+ moveTo(x, y) {
216
+ this.currentPath?.push({
217
+ type: 'moveTo',
218
+ x,
219
+ y
220
+ });
221
+ return this;
222
+ }
223
+ lineTo(x, y) {
224
+ this.currentPath?.push({
225
+ type: 'lineTo',
226
+ x,
227
+ y
228
+ });
229
+ return this;
230
+ }
231
+ bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
232
+ this.currentPath?.push({
233
+ type: 'cubicTo',
234
+ cp1x,
235
+ cp1y,
236
+ cp2x,
237
+ cp2y,
238
+ x,
239
+ y
240
+ });
241
+ return this;
242
+ }
243
+ quadraticCurveTo(cpx, cpy, x, y) {
244
+ this.currentPath?.push({
245
+ type: 'quadTo',
246
+ cpx,
247
+ cpy,
248
+ x,
249
+ y
250
+ });
251
+ return this;
252
+ }
253
+ arc(x, y, radius, startAngle, endAngle, anticlockwise) {
254
+ const startDeg = startAngle * 180 / Math.PI;
255
+ const endDeg = endAngle * 180 / Math.PI;
256
+ const sweepDeg = anticlockwise ? startDeg - endDeg : endDeg - startDeg;
257
+ this.currentPath?.push({
258
+ type: 'addArc',
259
+ rect: makeRect(x - radius, y - radius, radius * 2, radius * 2),
260
+ startDegrees: startDeg,
261
+ sweepDegrees: sweepDeg
262
+ });
263
+ return this;
264
+ }
265
+ fill(_attributes) {
266
+ this.pushCommand({
267
+ type: 'fillPath',
268
+ path: this.cloneCurrentPath(),
269
+ paint: clonePaint(this.fillPaint)
270
+ });
271
+ return this;
272
+ }
273
+ stroke() {
274
+ this.pushCommand({
275
+ type: 'strokePath',
276
+ path: this.cloneCurrentPath(),
277
+ paint: clonePaint(this.strokePaint)
278
+ });
279
+ return this;
280
+ }
281
+ closePath() {
282
+ this.currentPath?.push({
283
+ type: 'close'
284
+ });
285
+ return this;
286
+ }
287
+ fillText(text, x, y) {
288
+ this.pushCommand({
289
+ type: 'fillText',
290
+ text,
291
+ x,
292
+ y,
293
+ paint: clonePaint(this.fillPaint),
294
+ font: cloneFont(this.textFontDescriptor)
295
+ });
296
+ return this;
297
+ }
298
+ save() {
299
+ this.pushCommand({
300
+ type: 'save'
301
+ });
302
+ return this;
303
+ }
304
+ restore() {
305
+ this.pushCommand({
306
+ type: 'restore'
307
+ });
308
+ return this;
309
+ }
310
+ openGroup(_cls, _id) {
311
+ logUnimplemented('openGroup', true);
312
+ return this;
313
+ }
314
+ closeGroup() {
315
+ logUnimplemented('closeGroup', true);
316
+ return this;
317
+ }
318
+
319
+ /**
320
+ * Open a colour group. Every command recorded until `endColorGroup()` is
321
+ * stamped with `id` as its `groupId`, so a replay can recolor the whole group
322
+ * from a `groupId -> color` override map without re-recording. This is a
323
+ * dedicated, explicit grouping — distinct from VexFlow's
324
+ * `openGroup`/`closeGroup` (above, no-ops here), which a real score nests per
325
+ * element. Returns `this` for chaining.
326
+ */
327
+ beginColorGroup(id) {
328
+ this.colorGroupId = id;
329
+ return this;
330
+ }
331
+ endColorGroup() {
332
+ this.colorGroupId = undefined;
333
+ return this;
334
+ }
335
+ openRotation(_angleDegrees, _x, _y) {
336
+ logUnimplemented('openRotation');
337
+ return this;
338
+ }
339
+ closeRotation() {
340
+ logUnimplemented('closeRotation');
341
+ return this;
342
+ }
343
+ add(_child) {
344
+ logUnimplemented('add');
345
+ return this;
346
+ }
347
+ measureText(_text) {
348
+ logUnimplemented('measureText');
349
+ return {
350
+ x: 0,
351
+ y: 0,
352
+ width: 0,
353
+ height: 0
354
+ };
355
+ }
356
+ set fillStyle(style) {
357
+ this.setFillStyle(style);
358
+ }
359
+ get fillStyle() {
360
+ logUnimplemented('get fillStyle');
361
+ return '';
362
+ }
363
+ set strokeStyle(value) {
364
+ this.setStrokeStyle(value);
365
+ }
366
+ get strokeStyle() {
367
+ logUnimplemented('get strokeStyle');
368
+ return '';
369
+ }
370
+ setFont(font, size, weight, style) {
371
+ this.textFontDescriptor = {
372
+ font,
373
+ size,
374
+ weight,
375
+ style
376
+ };
377
+ this.textFont = this.fontManager.createSkFont(font, size, weight, style);
378
+ return this;
379
+ }
380
+ getFont() {
381
+ logUnimplemented('getFont');
382
+ return '';
383
+ }
384
+ set font(value) {
385
+ this.setFont(value);
386
+ }
387
+ get font() {
388
+ logUnimplemented('get font');
389
+ return '';
390
+ }
391
+ cloneCurrentPath() {
392
+ if (!this.currentPath) {
393
+ this.currentPath = [];
394
+ }
395
+ return this.currentPath.map(command => clonePathCommand(command));
396
+ }
397
+ pushCommand(command) {
398
+ if (this.isFinished) {
399
+ throw new Error('VexflowRecordingContext: Cannot record commands after finish() has been called.');
400
+ }
401
+ if (this.colorGroupId != null) {
402
+ command.groupId = this.colorGroupId;
403
+ }
404
+ this.commands.push(command);
405
+ }
406
+ }
407
+ function makeRect(x, y, width, height) {
408
+ return {
409
+ x,
410
+ y,
411
+ width,
412
+ height
413
+ };
414
+ }
415
+ function normalizeLineCap(cap) {
416
+ if (cap === 'round' || cap === 'square') {
417
+ return cap;
418
+ }
419
+ return 'butt';
420
+ }
421
+ function clonePaint(paint) {
422
+ return {
423
+ ...paint,
424
+ ...(paint.lineDash ? {
425
+ lineDash: [...paint.lineDash]
426
+ } : null)
427
+ };
428
+ }
429
+ function cloneFont(font) {
430
+ return {
431
+ ...font,
432
+ font: typeof font.font === 'object' && font.font ? {
433
+ ...font.font
434
+ } : font.font
435
+ };
436
+ }
437
+ function clonePathCommand(command) {
438
+ if (command.type === 'addRect' || command.type === 'addArc') {
439
+ return {
440
+ ...command,
441
+ rect: {
442
+ ...command.rect
443
+ }
444
+ };
445
+ }
446
+ return {
447
+ ...command
448
+ };
449
+ }
450
+ function cloneCommand(command) {
451
+ switch (command.type) {
452
+ case 'fillRect':
453
+ return {
454
+ ...command,
455
+ rect: {
456
+ ...command.rect
457
+ },
458
+ paint: clonePaint(command.paint)
459
+ };
460
+ case 'fillPath':
461
+ case 'strokePath':
462
+ return {
463
+ ...command,
464
+ path: command.path.map(pathCommand => clonePathCommand(pathCommand)),
465
+ paint: clonePaint(command.paint)
466
+ };
467
+ case 'fillText':
468
+ return {
469
+ ...command,
470
+ paint: clonePaint(command.paint),
471
+ font: cloneFont(command.font)
472
+ };
473
+ case 'clipRect':
474
+ case 'clearRect':
475
+ return {
476
+ ...command,
477
+ rect: {
478
+ ...command.rect
479
+ }
480
+ };
481
+ default:
482
+ return {
483
+ ...command
484
+ };
485
+ }
486
+ }
487
+ //# sourceMappingURL=VexflowRecordingContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","Element","FontManager","TextMeasureContext","installVexflowReactNativeFallbacks","resolveVexflowColor","showSilentLogs","WidthScale","logUnimplemented","methodName","isSilent","console","log","VexflowRecordingContext","__workletClass","commands","fillPaint","color","strokePaint","strokeCap","strokeWidth","isFinished","constructor","fontProvider","defaultFont","colorScheme","fontManager","textFontDescriptor","font","textFont","createSkFont","OS","textMeasurementContext","setTextMeasurementCanvas","getContext","type","measurementCanvas","getTextMeasurementCanvas","getCurrentSkFont","getMeasurementContext","finish","map","command","cloneCommand","clear","pushCommand","setFillStyle","style","setBackgroundFillStyle","_style","setStrokeStyle","setShadowColor","resolved","shadowColor","setShadowBlur","blur","shadowBlur","setLineWidth","width","setLineCap","cap","normalizeLineCap","setLineDash","dashPattern","lineDash","length","undefined","scale","x","y","translate","resize","_width","_height","rect","height","currentPath","push","makeRect","fillRect","paint","clonePaint","clearRect","clipRect","pointerRect","_x","_y","beginPath","moveTo","lineTo","bezierCurveTo","cp1x","cp1y","cp2x","cp2y","quadraticCurveTo","cpx","cpy","arc","radius","startAngle","endAngle","anticlockwise","startDeg","Math","PI","endDeg","sweepDeg","startDegrees","sweepDegrees","fill","_attributes","path","cloneCurrentPath","stroke","closePath","fillText","text","cloneFont","save","restore","openGroup","_cls","_id","closeGroup","beginColorGroup","id","colorGroupId","endColorGroup","openRotation","_angleDegrees","closeRotation","add","_child","measureText","_text","fillStyle","strokeStyle","value","setFont","size","weight","getFont","clonePathCommand","Error","groupId","pathCommand"],"sourceRoot":"../../../src","sources":["base/VexflowRecordingContext.ts"],"mappings":";;AAIA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,OAAO,QAA+C,SAAS;AAGxE,OAAOC,WAAW,MAAM,kBAAe;AACvC,OAAOC,kBAAkB,MAAM,yBAAsB;AACrD,SAASC,kCAAkC,QAAQ,8BAA2B;AAC9E,SACEC,mBAAmB,QAEd,yBAAsB;AAU7B,MAAMC,cAAc,GAAG,KAAK;AAE5B,MAAMC,UAAU,GAAG,CAAC,GAAG,CAAC;AAExB,SAASC,gBAAgBA,CAACC,UAAkB,EAAEC,QAAQ,GAAG,KAAK,EAAE;EAC9D,IAAIA,QAAQ,IAAI,CAACJ,cAAc,EAAE;IAC/B;EACF;EAEAK,OAAO,CAACC,GAAG,CACT,oCAAoCH,UAAU,2BAChD,CAAC;AACH;AAEA,eAAe,MAAMI,uBAAuB,CAAiC;EAC3EC,cAAc,GAAG,IAAI;EAEbC,QAAQ,GAA8B,EAAE;EAGxCC,SAAS,GAA0B;IACzCC,KAAK,EAAE;EACT,CAAC;EACOC,WAAW,GAA0B;IAC3CD,KAAK,EAAE,SAAS;IAChBE,SAAS,EAAE,MAAM;IACjBC,WAAW,EAAE,GAAG,GAAGb;EACrB,CAAC;EAKOc,UAAU,GAAG,KAAK;EAG1BC,WAAWA,CACTC,YAAoC,EACpCC,WAAmB,EACnBC,WAAgC,EAChC;IACA,IAAI,CAACA,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACT,SAAS,CAACC,KAAK,GAAGZ,mBAAmB,CAAC,OAAO,EAAEoB,WAAW,CAAC;IAChE,IAAI,CAACP,WAAW,CAACD,KAAK,GAAGZ,mBAAmB,CAAC,OAAO,EAAEoB,WAAW,CAAC;IAClE,IAAI,CAACC,WAAW,GAAG,IAAIx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