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,67 @@
1
+ "use strict";
2
+
3
+ import { Platform } from 'react-native';
4
+ export let LogCategory = /*#__PURE__*/function (LogCategory) {
5
+ LogCategory["FontManager"] = "FontManager";
6
+ LogCategory["VexflowRecordingContext"] = "VexflowRecordingContext";
7
+ LogCategory["VexflowCanvas"] = "VexflowCanvas";
8
+ LogCategory["Default"] = "Default";
9
+ return LogCategory;
10
+ }({});
11
+ const disabledCategories = new Set([LogCategory.FontManager
12
+ // LogCategory.VexflowRecordingContext,
13
+ // LogCategory.VexflowCanvas,
14
+ ]);
15
+ const categoryColors = Platform.select({
16
+ web: {
17
+ [LogCategory.FontManager]: '#1d56b3',
18
+ [LogCategory.VexflowRecordingContext]: 'green',
19
+ [LogCategory.VexflowCanvas]: 'cyan',
20
+ [LogCategory.Default]: 'black'
21
+ },
22
+ default: {
23
+ [LogCategory.FontManager]: '\x1b[34m',
24
+ // Blue
25
+ [LogCategory.VexflowRecordingContext]: '\x1b[32m',
26
+ // Green
27
+ [LogCategory.VexflowCanvas]: '\x1b[36m',
28
+ // Cyan
29
+ [LogCategory.Default]: '\x1b[0m' // Reset
30
+ }
31
+ });
32
+ class Logger {
33
+ constructor(category = LogCategory.Default) {
34
+ this.logCategory = category;
35
+ }
36
+ extend(logCategory) {
37
+ return new Logger(logCategory);
38
+ }
39
+ formatMessage(...params) {
40
+ if (Platform.OS === 'web') {
41
+ const color = categoryColors[this.logCategory] || 'black';
42
+ return [`%c${this.logCategory}`, `background-color: ${color}; font-weight: bold;`, ...params];
43
+ }
44
+ const colorCode = categoryColors[this.logCategory] || categoryColors[LogCategory.Default];
45
+ return [`${colorCode}${this.logCategory}`, ...params, '\x1b[0m'];
46
+ }
47
+ log(...params) {
48
+ if (disabledCategories.has(this.logCategory)) {
49
+ return;
50
+ }
51
+ console.log(...this.formatMessage(...params));
52
+ }
53
+ warn(...params) {
54
+ if (disabledCategories.has(this.logCategory)) {
55
+ return;
56
+ }
57
+ console.warn(...this.formatMessage(...params));
58
+ }
59
+ error(...params) {
60
+ if (disabledCategories.has(this.logCategory)) {
61
+ return;
62
+ }
63
+ console.error(...this.formatMessage(...params));
64
+ }
65
+ }
66
+ export default new Logger();
67
+ //# sourceMappingURL=Logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","LogCategory","disabledCategories","Set","FontManager","categoryColors","select","web","VexflowRecordingContext","VexflowCanvas","Default","default","Logger","constructor","category","logCategory","extend","formatMessage","params","OS","color","colorCode","log","has","console","warn","error"],"sourceRoot":"../../../src","sources":["shared/Logger.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAOvB,MAAMC,kBAAoC,GAAG,IAAIC,GAAG,CAAC,CACnDF,WAAW,CAACG;AACZ;AACA;AAAA,CACD,CAAC;AAEF,MAAMC,cAA2C,GAAGL,QAAQ,CAACM,MAAM,CAAC;EAClEC,GAAG,EAAE;IACH,CAACN,WAAW,CAACG,WAAW,GAAG,SAAS;IACpC,CAACH,WAAW,CAACO,uBAAuB,GAAG,OAAO;IAC9C,CAACP,WAAW,CAACQ,aAAa,GAAG,MAAM;IACnC,CAACR,WAAW,CAACS,OAAO,GAAG;EACzB,CAAC;EACDC,OAAO,EAAE;IACP,CAACV,WAAW,CAACG,WAAW,GAAG,UAAU;IAAE;IACvC,CAACH,WAAW,CAACO,uBAAuB,GAAG,UAAU;IAAE;IACnD,CAACP,WAAW,CAACQ,aAAa,GAAG,UAAU;IAAE;IACzC,CAACR,WAAW,CAACS,OAAO,G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AAIhB,kBAAkB,CAACqB,GAAG,CAAC,IAAI,CAACR,WAA0B,CAAC,EAAE;MAC3D;IACF;IAEAS,OAAO,CAACE,KAAK,CAAC,GAAG,IAAI,CAACT,aAAa,CAAC,GAAGC,MAAM,CAAC,CAAC;EACjD;AACF;AAEA,eAAe,IAAIN,MAAM,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from "./types.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["state/index.ts"],"mappings":";;AAAA,cAAc,YAAS","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["state/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +1,9 @@
1
+ // export type LineCap = 'butt' | 'round' | 'square';
2
+ // export type LineJoin = 'miter' | 'round' | 'bevel';
3
+
4
+ // export type ParsedCssFont = {
5
+ // sizePx: number;
6
+ // family?: string;
7
+ // };
1
8
  "use strict";
2
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -1,79 +1,44 @@
1
- "use strict";
1
+ // import { PT_TO_PX } from './constants';
2
+ // import { type ParsedCssFont } from './types';
3
+
4
+ // export function toPxFontSize(size: number | string | undefined): number {
5
+ // if (size === undefined || size === null) return 12;
6
+
7
+ // if (typeof size === 'number' && Number.isFinite(size)) {
8
+ // return size * PT_TO_PX;
9
+ // }
10
+
11
+ // if (typeof size === 'string') {
12
+ // const match = size.trim().match(/^(\d+(?:\.\d+)?)(px|pt)?$/i);
13
+
14
+ // if (match) {
15
+ // const value = Number.parseFloat(match[1] || '12');
16
+ // const unit = match[2]?.toLowerCase();
17
+ // if (!unit || unit === 'px') return value;
18
+ // return value * PT_TO_PX;
19
+ // }
20
+ // }
21
+
22
+ // return 12;
23
+ // }
2
24
 
3
- import { Skia } from '@shopify/react-native-skia';
4
- import { fontCache, PT_TO_PX } from "./constants.js";
5
- export function getAdvanceWidth(font, text) {
6
- const glyphs = font.getGlyphIDs(text);
7
- const widths = font.getGlyphWidths(glyphs);
8
- return widths.reduce((sum, width) => sum + width, 0);
9
- }
10
- export function toPxFontSize(size) {
11
- if (size === undefined || size === null) return 12;
12
- if (typeof size === 'number' && Number.isFinite(size)) {
13
- return size * PT_TO_PX;
14
- }
15
- if (typeof size === 'string') {
16
- const match = size.trim().match(/^(\d+(?:\.\d+)?)(px|pt)?$/i);
17
- if (match) {
18
- const value = Number.parseFloat(match[1] || '12');
19
- const unit = match[2]?.toLowerCase();
20
- if (!unit || unit === 'px') return value;
21
- return value * PT_TO_PX;
22
- }
23
- }
24
- return 12;
25
- }
26
- export function parseCssFontShorthand(cssFont) {
27
- const sizeMatch = cssFont.match(/(\d+(?:\.\d+)?(?:px|pt))/i);
28
- if (!sizeMatch) {
29
- return {
30
- sizePx: 12
31
- };
32
- }
33
- const sizePx = toPxFontSize(sizeMatch[1]);
34
- const family = cssFont.slice((sizeMatch.index ?? 0) + (sizeMatch[1]?.length || 0)).trim();
35
- return {
36
- sizePx,
37
- family: family || undefined
38
- };
39
- }
40
- export function createFont(size, familyName, bravuraFont) {
41
- const fontSize = Number.isFinite(size) && size > 0 ? size : 12;
42
- const family = familyName?.trim();
43
- if (family?.toLowerCase().includes('bravura') && bravuraFont) {
44
- const cacheKey = `Bravura-${fontSize}`;
45
- const cached = fontCache.get(cacheKey);
46
- if (cached) return cached;
47
- const typeface = bravuraFont.getTypeface();
48
- if (typeface) {
49
- const font = Skia.Font(typeface, fontSize);
50
- fontCache.set(cacheKey, font);
51
- return font;
52
- }
53
- }
54
- const fontMgr = Skia.FontMgr.System();
55
- const requestedFamilies = family ? family.replace(/["']/g, '').split(',').map(part => part.trim()).filter(Boolean) : [];
56
- for (const requestedFamily of requestedFamilies) {
57
- const typeface = fontMgr.matchFamilyStyle(requestedFamily, {
58
- weight: 400,
59
- width: 5,
60
- slant: 0
61
- });
62
- if (typeface) {
63
- return Skia.Font(typeface, fontSize);
64
- }
65
- }
66
- for (let i = 0; i < fontMgr.countFamilies(); i++) {
67
- const systemFamily = fontMgr.getFamilyName(i);
68
- const typeface = fontMgr.matchFamilyStyle(systemFamily, {
69
- weight: 400,
70
- width: 5,
71
- slant: 0
72
- });
73
- if (typeface) {
74
- return Skia.Font(typeface, fontSize);
75
- }
76
- }
77
- throw new Error('Unable to create a Skia font.');
78
- }
25
+ // export function parseCssFontShorthand(cssFont: string): ParsedCssFont {
26
+ // const sizeMatch = cssFont.match(/(\d+(?:\.\d+)?(?:px|pt))/i);
27
+
28
+ // if (!sizeMatch) {
29
+ // return { sizePx: 12 };
30
+ // }
31
+
32
+ // const sizePx = toPxFontSize(sizeMatch[1]);
33
+
34
+ // const family = cssFont
35
+ // .slice((sizeMatch.index ?? 0) + (sizeMatch[1]?.length || 0))
36
+ // .trim();
37
+
38
+ // return {
39
+ // sizePx,
40
+ // family: family || undefined,
41
+ // };
42
+ // }
43
+ "use strict";
79
44
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Skia","fontCache","PT_TO_PX","getAdvanceWidth","font","text","glyphs","getGlyphIDs","widths","getGlyphWidths","reduce","sum","width","toPxFontSize","size","undefined","Number","isFinite","match","trim","value","parseFloat","unit","toLowerCase","parseCssFontShorthand","cssFont","sizeMatch","sizePx","family","slice","index","length","createFont","familyName","bravuraFont","fontSize","includes","cacheKey","cached","get","typeface","getTypeface","Font","set","fontMgr","FontMgr","System","requestedFamilies","replace","split","map","part","filter","Boolean","requestedFamily","matchFamilyStyle","weight","slant","i","countFamilies","systemFamily","getFamilyName","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A;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import type { FontInfo } from 'vexflow';
2
+ import { FontWeight, FontSlant, FontWidth } from '@shopify/react-native-skia';
3
+ import type { SkFont, SkTypefaceFontProvider } from '@shopify/react-native-skia';
4
+ interface ResolvedFont {
5
+ family: string;
6
+ size: number;
7
+ weight: FontWeight;
8
+ slant: FontSlant;
9
+ width: FontWidth;
10
+ }
11
+ export default class FontManager {
12
+ __workletClass: boolean;
13
+ private fontProvider;
14
+ private defaultFontName;
15
+ constructor(fontProvider: SkTypefaceFontProvider, defaultFontName: string);
16
+ private isFamilyAvailable;
17
+ private getFamiliesFromFont;
18
+ private matchFontFamilyName;
19
+ resolveFontDescriptor(font?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): ResolvedFont;
20
+ createSkFont(font?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): SkFont;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=FontManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontManager.d.ts","sourceRoot":"","sources":["../../../../src/base/FontManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EAEV,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,MAAM,EACN,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAMpC,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB;AAuED,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,cAAc,UAAQ;IAEtB,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,eAAe,CAAS;gBAEpB,YAAY,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM;IAmBzE,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,mBAAmB;IAgB3B,qBAAqB,CACnB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,EACxB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EACxB,KAAK,CAAC,EAAE,MAAM,GACb,YAAY;IAYf,YAAY,CACV,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,EACxB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EACxB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM;CA0BV"}
@@ -0,0 +1,22 @@
1
+ import type VexflowRecordingContext from './VexflowRecordingContext';
2
+ declare class TextMeasureContext {
3
+ __workletClass: boolean;
4
+ private context;
5
+ private currentFont;
6
+ constructor(context: VexflowRecordingContext);
7
+ measureText(text: string): {
8
+ width: number;
9
+ actualBoundingBoxAscent: number;
10
+ actualBoundingBoxDescent: number;
11
+ fontBoundingBoxAscent: number;
12
+ fontBoundingBoxDescent: number;
13
+ actualBoundingBoxLeft: number;
14
+ actualBoundingBoxRight: number;
15
+ };
16
+ get(): string;
17
+ set(value: string): void;
18
+ get font(): string;
19
+ set font(value: string);
20
+ }
21
+ export default TextMeasureContext;
22
+ //# sourceMappingURL=TextMeasureContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextMeasureContext.d.ts","sourceRoot":"","sources":["../../../../src/base/TextMeasureContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,uBAAuB,MAAM,2BAA2B,CAAC;AAErE,cAAM,kBAAkB;IACtB,cAAc,UAAQ;IAEtB,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,WAAW,CAAM;gBAEb,OAAO,EAAE,uBAAuB;IAI5C,WAAW,CAAC,IAAI,EAAE,MAAM;;;;;;;;;IAmBxB,GAAG;IAIH,GAAG,CAAC,KAAK,EAAE,MAAM;IAKjB,IAAI,IAAI,IAIQ,MAAM,CAFrB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;CACF;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { VexflowCanvasProps } from './types';
3
+ declare const VexflowCanvas: React.FC<VexflowCanvasProps>;
4
+ export default VexflowCanvas;
5
+ //# sourceMappingURL=VexflowCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VexflowCanvas.d.ts","sourceRoot":"","sources":["../../../../src/base/VexflowCanvas.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIlD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqC/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface VexflowColorScheme {
2
+ foreground?: string;
3
+ background?: string;
4
+ ledgerLine?: string;
5
+ }
6
+ export declare function resolveVexflowColor(style: string, colorScheme?: VexflowColorScheme): string;
7
+ //# sourceMappingURL=VexflowColorScheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VexflowColorScheme.d.ts","sourceRoot":"","sources":["../../../../src/base/VexflowColorScheme.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,kBAAkB,GAC/B,MAAM,CAiBR"}
@@ -0,0 +1,103 @@
1
+ import { type SkFont, type SkTypefaceFontProvider } from '@shopify/react-native-skia';
2
+ import { RenderContext as VexflowRenderContext } from 'vexflow';
3
+ import type { FontInfo } from 'vexflow';
4
+ import TextMeasureContext from './TextMeasureContext';
5
+ import { type VexflowColorScheme } from './VexflowColorScheme';
6
+ import type { VexflowRecordingCommand } from './VexflowRecordingTypes';
7
+ export default class VexflowRecordingContext implements VexflowRenderContext {
8
+ __workletClass: boolean;
9
+ private commands;
10
+ private colorGroupId?;
11
+ private currentPath?;
12
+ private fillPaint;
13
+ private strokePaint;
14
+ private textFont;
15
+ private textFontDescriptor;
16
+ private fontManager;
17
+ private textMeasurementContext;
18
+ private isFinished;
19
+ private colorScheme?;
20
+ constructor(fontProvider: SkTypefaceFontProvider, defaultFont: string, colorScheme?: VexflowColorScheme);
21
+ getCurrentSkFont(): SkFont;
22
+ getMeasurementContext(): TextMeasureContext;
23
+ finish(): readonly VexflowRecordingCommand[];
24
+ clear(): this;
25
+ setFillStyle(style: string | unknown): this;
26
+ setBackgroundFillStyle(_style: string): this;
27
+ setStrokeStyle(style: string): this;
28
+ /**
29
+ * Record a glow/shadow colour (CSS `shadowColor`) into both the fill and the
30
+ * stroke paint — VexFlow's `ElementStyle.shadowColor` is applied as ctx-level
31
+ * state that affects whatever is drawn next, fill or stroke. Replayed in Skia
32
+ * as a drop-shadow image filter (a glow around the ink) and overridable per
33
+ * group at replay.
34
+ */
35
+ setShadowColor(color: string): this;
36
+ /**
37
+ * Record a glow/shadow blur radius (CSS `shadowBlur`) into both the fill and
38
+ * the stroke paint. Mapped to a Gaussian sigma at replay; only takes effect
39
+ * when a `shadowColor` is also set.
40
+ */
41
+ setShadowBlur(blur: number): this;
42
+ setLineWidth(width: number): this;
43
+ setLineCap(cap: string): this;
44
+ /**
45
+ * Record a dash pattern (CSS `setLineDash`) into the stroke paint — dashing is
46
+ * a stroke-only concept (stems, ledger lines, …). Replayed in Skia as a dash
47
+ * path effect and overridable per group at replay. An empty array clears any
48
+ * recorded dash (CSS semantics: solid line).
49
+ */
50
+ setLineDash(dashPattern: number[]): this;
51
+ scale(x: number, y: number): this;
52
+ translate(x: number, y: number): this;
53
+ resize(_width: number, _height: number): this;
54
+ rect(x: number, y: number, width: number, height: number): this;
55
+ fillRect(x: number, y: number, width: number, height: number): this;
56
+ clearRect(x: number, y: number, width: number, height: number): this;
57
+ clipRect(x: number, y: number, width: number, height: number): this;
58
+ pointerRect(_x: number, _y: number, _width: number, _height: number): this;
59
+ beginPath(): this;
60
+ moveTo(x: number, y: number): this;
61
+ lineTo(x: number, y: number): this;
62
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): this;
63
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): this;
64
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): this;
65
+ fill(_attributes?: unknown): this;
66
+ stroke(): this;
67
+ closePath(): this;
68
+ fillText(text: string, x: number, y: number): this;
69
+ save(): this;
70
+ restore(): this;
71
+ openGroup(_cls?: string, _id?: string): this;
72
+ closeGroup(): this;
73
+ /**
74
+ * Open a colour group. Every command recorded until `endColorGroup()` is
75
+ * stamped with `id` as its `groupId`, so a replay can recolor the whole group
76
+ * from a `groupId -> color` override map without re-recording. This is a
77
+ * dedicated, explicit grouping — distinct from VexFlow's
78
+ * `openGroup`/`closeGroup` (above, no-ops here), which a real score nests per
79
+ * element. Returns `this` for chaining.
80
+ */
81
+ beginColorGroup(id: string): this;
82
+ endColorGroup(): this;
83
+ openRotation(_angleDegrees: number, _x: number, _y: number): this;
84
+ closeRotation(): this;
85
+ add(_child: unknown): this;
86
+ measureText(_text: string): {
87
+ x: number;
88
+ y: number;
89
+ width: number;
90
+ height: number;
91
+ };
92
+ set fillStyle(style: string | unknown);
93
+ get fillStyle(): string | unknown;
94
+ set strokeStyle(value: string);
95
+ get strokeStyle(): string;
96
+ setFont(font?: string | FontInfo, size?: string | number, weight?: string | number, style?: string): this;
97
+ getFont(): string;
98
+ set font(value: string);
99
+ get font(): string;
100
+ private cloneCurrentPath;
101
+ private pushCommand;
102
+ }
103
+ //# sourceMappingURL=VexflowRecordingContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VexflowRecordingContext.d.ts","sourceRoot":"","sources":["../../../../src/base/VexflowRecordingContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAW,aAAa,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,uBAAuB,EAMxB,MAAM,yBAAyB,CAAC;AAgBjC,MAAM,CAAC,OAAO,OAAO,uBAAwB,YAAW,oBAAoB;IAC1E,cAAc,UAAQ;IAEtB,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAC,CAAgC;IACpD,OAAO,CAAC,SAAS,CAEf;IACF,OAAO,CAAC,WAAW,CAIjB;IACF,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,sBAAsB,CAAqB;IACnD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAC,CAAqB;gBAGvC,YAAY,EAAE,sBAAsB,EACpC,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,kBAAkB;IA8BlC,gBAAgB;IAIhB,qBAAqB;IAIrB,MAAM,IAAI,SAAS,uBAAuB,EAAE;IAK5C,KAAK;IAQL,YAAY,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ACxB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EACxB,KAAK,CAAC,EAAE,MAAM;IAOhB,OAAO;IAKP,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,IAAI,IAJQ,MAAM,CAOrB;IAED,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,WAAW;CAapB"}
@@ -0,0 +1,12 @@
1
+ import { type SkCanvas, type SkTypefaceFontProvider } from '@shopify/react-native-skia';
2
+ import type { VexflowRecordingCommand, VexflowStyleOverride } from './VexflowRecordingTypes';
3
+ export declare function renderVexflowRecordingCommands(canvas: SkCanvas, commands: readonly VexflowRecordingCommand[], fontProvider: SkTypefaceFontProvider, defaultFont: string,
4
+ /**
5
+ * Optional `groupId -> VexflowStyleOverride` map. Commands tagged (via
6
+ * `beginColorGroup`/`endColorGroup`) with a `groupId` present here are drawn
7
+ * with the override merged over their recorded paint — separate fill/stroke
8
+ * colours, a glow (shadow), and a stroke dash are all expressible. Omit for a
9
+ * byte-identical replay of the recorded style.
10
+ */
11
+ styleOverrides?: Record<string, VexflowStyleOverride>): void;
12
+ //# sourceMappingURL=VexflowRecordingReplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VexflowRecordingReplay.d.ts","sourceRoot":"","sources":["../../../../src/base/VexflowRecordingReplay.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,QAAQ,EAGb,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,uBAAuB,EAMvB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AA4NjC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,SAAS,uBAAuB,EAAE,EAC5C,YAAY,EAAE,sBAAsB,EACpC,WAAW,EAAE,MAAM;AACnB;;;;;;GAMG;AACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,QAyEtD"}
@@ -0,0 +1,146 @@
1
+ import type { FontInfo } from 'vexflow';
2
+ export type VexflowRecordingLineCap = 'butt' | 'round' | 'square';
3
+ export interface VexflowRecordingRect {
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export interface VexflowRecordingPaint {
10
+ color: string;
11
+ strokeCap?: VexflowRecordingLineCap;
12
+ strokeWidth?: number;
13
+ /**
14
+ * Glow/shadow colour (CSS `shadowColor`). Recorded from
15
+ * `VexflowRecordingContext.setShadowColor`. Replayed in Skia as a drop-shadow
16
+ * image filter with `dx = dy = 0` (a glow around the ink), and overridable per
17
+ * group via `VexflowStyleOverride.shadowColor`.
18
+ */
19
+ shadowColor?: string;
20
+ /**
21
+ * Glow/shadow blur radius in px (CSS `shadowBlur`). Recorded from
22
+ * `VexflowRecordingContext.setShadowBlur`. Mapped to a Gaussian sigma of
23
+ * `shadowBlur / 2` at replay. Only takes effect when `shadowColor` is set.
24
+ */
25
+ shadowBlur?: number;
26
+ /**
27
+ * Dash pattern (CSS `setLineDash`), stroke only. Recorded from
28
+ * `VexflowRecordingContext.setLineDash`. Replayed as a Skia dash path effect
29
+ * and overridable per group via `VexflowStyleOverride.lineDash`.
30
+ */
31
+ lineDash?: number[];
32
+ }
33
+ /**
34
+ * A granular, disambiguated style override applied to every command sharing a
35
+ * `groupId` at replay (see `renderVexflowRecordingCommands`'s `styleOverrides`).
36
+ *
37
+ * Each field is merged OVER the recorded paint, so any field left undefined
38
+ * falls back to whatever was recorded. An override is resolved per command
39
+ * against the paint that command uses (fill vs stroke), which is why fill and
40
+ * stroke colours are separable here — the consumer can, e.g., fill a notehead
41
+ * green while stroking its stem red.
42
+ */
43
+ export interface VexflowStyleOverride {
44
+ /** Fill paint colour (noteheads, rests, glyphs, filled shapes). */
45
+ fillColor?: string;
46
+ /** Stroke paint colour (stems, ledger lines, beam edges). */
47
+ strokeColor?: string;
48
+ /** Shorthand applied to both fill and stroke (lower precedence than the two above). */
49
+ color?: string;
50
+ /** Glow colour (CSS `shadowColor`), applied to both fill and stroke so the whole note glows. */
51
+ shadowColor?: string;
52
+ /** Glow blur radius in px (CSS `shadowBlur`). Only takes effect when a `shadowColor` resolves. */
53
+ shadowBlur?: number;
54
+ /** Dash pattern (stroke only). */
55
+ lineDash?: number[];
56
+ }
57
+ export interface VexflowRecordingFont {
58
+ font?: string | FontInfo;
59
+ size?: string | number;
60
+ weight?: string | number;
61
+ style?: string;
62
+ }
63
+ export type VexflowRecordingPathCommand = {
64
+ type: 'moveTo';
65
+ x: number;
66
+ y: number;
67
+ } | {
68
+ type: 'lineTo';
69
+ x: number;
70
+ y: number;
71
+ } | {
72
+ type: 'cubicTo';
73
+ cp1x: number;
74
+ cp1y: number;
75
+ cp2x: number;
76
+ cp2y: number;
77
+ x: number;
78
+ y: number;
79
+ } | {
80
+ type: 'quadTo';
81
+ cpx: number;
82
+ cpy: number;
83
+ x: number;
84
+ y: number;
85
+ } | {
86
+ type: 'addRect';
87
+ rect: VexflowRecordingRect;
88
+ } | {
89
+ type: 'addArc';
90
+ rect: VexflowRecordingRect;
91
+ startDegrees: number;
92
+ sweepDegrees: number;
93
+ } | {
94
+ type: 'close';
95
+ };
96
+ /**
97
+ * A recorded draw command. `groupId` (optional) is stamped by
98
+ * `beginColorGroup`/`endColorGroup` on the recording context: a replay can then
99
+ * recolor every command sharing a `groupId` from a `groupId -> color` override
100
+ * map without re-recording. Untagged commands (staff lines, clefs, …) are never
101
+ * overridden.
102
+ */
103
+ export type VexflowRecordingCommand = {
104
+ groupId?: string;
105
+ } & ({
106
+ type: 'clear';
107
+ color: string;
108
+ } | {
109
+ type: 'save';
110
+ } | {
111
+ type: 'restore';
112
+ } | {
113
+ type: 'scale';
114
+ x: number;
115
+ y: number;
116
+ } | {
117
+ type: 'translate';
118
+ x: number;
119
+ y: number;
120
+ } | {
121
+ type: 'clipRect';
122
+ rect: VexflowRecordingRect;
123
+ } | {
124
+ type: 'fillRect';
125
+ rect: VexflowRecordingRect;
126
+ paint: VexflowRecordingPaint;
127
+ } | {
128
+ type: 'clearRect';
129
+ rect: VexflowRecordingRect;
130
+ } | {
131
+ type: 'fillPath';
132
+ path: VexflowRecordingPathCommand[];
133
+ paint: VexflowRecordingPaint;
134
+ } | {
135
+ type: 'strokePath';
136
+ path: VexflowRecordingPathCommand[];
137
+ paint: VexflowRecordingPaint;
138
+ } | {
139
+ type: 'fillText';
140
+ text: string;
141
+ x: number;
142
+ y: number;
143
+ paint: VexflowRecordingPaint;
144
+ font: VexflowRecordingFont;
145
+ });
146
+ //# sourceMappingURL=VexflowRecordingTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VexflowRecordingTypes.d.ts","sourceRoot":"","sources":["../../../../src/base/VexflowRecordingTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,WAAW,CAAC,EAAE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+ export { default as VexflowRecordingContext } from './VexflowRecordingContext';
3
+ export { renderVexflowRecordingCommands } from './VexflowRecordingReplay';
4
+ export * from './VexflowColorScheme';
5
+ export * from './VexflowRecordingTypes';
6
+ export * from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Font } from 'vexflow';
2
+ import type { FontInfo } from 'vexflow';
3
+ export declare function installVexflowReactNativeFallbacks(): void;
4
+ export declare function ensureVexflowTextMeasurementCanvas(): void;
5
+ declare function parseCssFontShorthand(cssFontShorthand: string): Required<FontInfo>;
6
+ export declare const __test__: {
7
+ originalFromCSSString: typeof Font.fromCSSString;
8
+ parseCssFontShorthand: typeof parseCssFontShorthand;
9
+ };
10
+ export {};
11
+ //# sourceMappingURL=setupVexflowReactNative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupVexflowReactNative.d.ts","sourceRoot":"","sources":["../../../../src/base/setupVexflowReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA0BxC,wBAAgB,kCAAkC,IAAI,IAAI,CAoBzD;AAED,wBAAgB,kCAAkC,IAAI,IAAI,CA+BzD;AAED,iBAAS,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CA0B3E;AAWD,eAAO,MAAM,QAAQ;;;CAGpB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { SkTypefaceFontProvider } from '@shopify/react-native-skia';
2
+ import type VexflowRecordingContext from './VexflowRecordingContext';
3
+ export interface OnDrawParams {
4
+ ctx: VexflowRecordingContext;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export interface VexflowCanvasProps {
9
+ onDraw: (params: OnDrawParams) => void;
10
+ fontManager: SkTypefaceFontProvider;
11
+ defaultFont: string;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map