velo-plot 2.20.0 → 3.0.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 (236) hide show
  1. package/README.md +15 -8
  2. package/dist/{ChartCore-ivzLqxVb.js → ChartCore-BpzRvN4Y.js} +978 -861
  3. package/dist/ChartCore-BpzRvN4Y.js.map +1 -0
  4. package/dist/a11y-Bw6urYpr.js +105 -0
  5. package/dist/a11y-Bw6urYpr.js.map +1 -0
  6. package/dist/angular/hooks-entry.d.ts +1 -0
  7. package/dist/angular/hooks.d.ts +26 -0
  8. package/dist/angular/index.d.ts +8 -0
  9. package/dist/angular/velo-plot.component.d.ts +46 -0
  10. package/dist/angular-hooks.d.ts +1 -0
  11. package/dist/angular-hooks.js +9 -0
  12. package/dist/angular-hooks.js.map +1 -0
  13. package/dist/angular.d.ts +1 -0
  14. package/dist/angular.js +166 -0
  15. package/dist/angular.js.map +1 -0
  16. package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
  17. package/dist/astro/StackedPlot.astro +19 -0
  18. package/dist/astro/VeloPlot.astro +23 -0
  19. package/dist/bindings/shared/a11y.d.ts +26 -0
  20. package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
  21. package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
  22. package/dist/bindings/shared/dimensions.d.ts +1 -0
  23. package/dist/bindings/shared/index.d.ts +9 -0
  24. package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
  25. package/dist/bindings/shared/optionsSync.d.ts +7 -0
  26. package/dist/bindings/shared/seriesDiff.d.ts +8 -0
  27. package/dist/bindings/shared/stackedSync.d.ts +9 -0
  28. package/dist/bindings/shared/types.d.ts +46 -0
  29. package/dist/bindings/test-utils/index.d.ts +35 -0
  30. package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
  31. package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
  32. package/dist/chartSyncBridge-DbWrwtyP.js +57 -0
  33. package/dist/chartSyncBridge-DbWrwtyP.js.map +1 -0
  34. package/dist/core/Chart.d.ts +1 -1
  35. package/dist/core/InteractionManager.d.ts +7 -1
  36. package/dist/core/OverlayRenderer.d.ts +5 -0
  37. package/dist/core/annotations/types.d.ts +1 -1
  38. package/dist/core/chart/ChartCore.d.ts +2 -2
  39. package/dist/core/chart/types.d.ts +1 -1
  40. package/dist/core/clipboard/index.d.ts +1 -1
  41. package/dist/core/debug/index.d.ts +1 -1
  42. package/dist/core/keybindings/index.d.ts +1 -1
  43. package/dist/core/loading/index.d.ts +1 -1
  44. package/dist/core/locale/index.d.ts +1 -1
  45. package/dist/core/stacked/paneResize.d.ts +3 -0
  46. package/dist/core/stacked/types.d.ts +10 -0
  47. package/dist/core/theme-editor/index.d.ts +1 -1
  48. package/dist/createStackedChart-Dm-YqUT7.js +756 -0
  49. package/dist/createStackedChart-Dm-YqUT7.js.map +1 -0
  50. package/dist/examples/PluginDemonstration.d.ts +1 -1
  51. package/dist/gpuRenderer-BpaMYz-k.js.map +1 -1
  52. package/dist/hooks-CYPCxoZx.js +69 -0
  53. package/dist/hooks-CYPCxoZx.js.map +1 -0
  54. package/dist/{index-BBpJwOct.js → index-0InEyj0q.js} +119 -121
  55. package/dist/index-0InEyj0q.js.map +1 -0
  56. package/dist/index-BMiZoKmm.js.map +1 -1
  57. package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
  58. package/dist/index-CWxIHdwX.js.map +1 -0
  59. package/dist/index-CaXWSOTk.js.map +1 -1
  60. package/dist/index-Dag88bW4.js.map +1 -1
  61. package/dist/index-qhscKTDy.js.map +1 -1
  62. package/dist/index-qunX30Xu.js.map +1 -1
  63. package/dist/index-x4stH3jD.js.map +1 -1
  64. package/dist/{index.core-COREBDNq.js → index.core-BmZe2jRQ.js} +9 -9
  65. package/dist/index.core-BmZe2jRQ.js.map +1 -0
  66. package/dist/index.core.d.ts +1 -1
  67. package/dist/index.d.ts +2 -2
  68. package/dist/indicators--eJGmVox.js.map +1 -1
  69. package/dist/{mockDatafeed-927foCM4.js → mockDatafeed-DHIDPcpX.js} +150 -146
  70. package/dist/mockDatafeed-DHIDPcpX.js.map +1 -0
  71. package/dist/optionsSync-QUiN4Inw.js +119 -0
  72. package/dist/optionsSync-QUiN4Inw.js.map +1 -0
  73. package/dist/plugins/3d/index.d.ts +2 -2
  74. package/dist/plugins/3d.d.ts +2 -2
  75. package/dist/plugins/3d.js.map +1 -1
  76. package/dist/plugins/analysis/index.d.ts +1 -1
  77. package/dist/plugins/analysis/indicators.d.ts +1 -1
  78. package/dist/plugins/analysis.d.ts +2 -2
  79. package/dist/plugins/analysis.js +2 -2
  80. package/dist/plugins/analysis.js.map +1 -1
  81. package/dist/plugins/annotations/index.d.ts +1 -1
  82. package/dist/plugins/annotations.d.ts +2 -2
  83. package/dist/plugins/annotations.js.map +1 -1
  84. package/dist/plugins/anomaly-detection.js +1 -1
  85. package/dist/plugins/anomaly-detection.js.map +1 -1
  86. package/dist/plugins/broken-axis.d.ts +2 -2
  87. package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
  88. package/dist/plugins/builtins/index.d.ts +1 -1
  89. package/dist/plugins/caching.d.ts +2 -2
  90. package/dist/plugins/clipboard/index.d.ts +2 -2
  91. package/dist/plugins/clipboard.d.ts +2 -2
  92. package/dist/plugins/clipboard.js.map +1 -1
  93. package/dist/plugins/context-menu/index.d.ts +1 -1
  94. package/dist/plugins/context-menu.d.ts +2 -2
  95. package/dist/plugins/context-menu.js +1 -1
  96. package/dist/plugins/context-menu.js.map +1 -1
  97. package/dist/plugins/data-export/index.d.ts +1 -1
  98. package/dist/plugins/data-export.d.ts +2 -2
  99. package/dist/plugins/data-export.js +2 -2
  100. package/dist/plugins/data-export.js.map +1 -1
  101. package/dist/plugins/data-transform.d.ts +2 -2
  102. package/dist/plugins/data-transform.js +19 -19
  103. package/dist/plugins/data-transform.js.map +1 -1
  104. package/dist/plugins/debug/index.d.ts +2 -2
  105. package/dist/plugins/debug.d.ts +2 -2
  106. package/dist/plugins/debug.js +2 -2
  107. package/dist/plugins/debug.js.map +1 -1
  108. package/dist/plugins/forecasting/index.d.ts +1 -1
  109. package/dist/plugins/forecasting.js.map +1 -1
  110. package/dist/plugins/gpu/index.d.ts +2 -2
  111. package/dist/plugins/gpu.d.ts +2 -2
  112. package/dist/plugins/gpu.js.map +1 -1
  113. package/dist/plugins/i18n/index.d.ts +2 -2
  114. package/dist/plugins/i18n.d.ts +2 -2
  115. package/dist/plugins/i18n.js.map +1 -1
  116. package/dist/plugins/index.d.ts +1 -1
  117. package/dist/plugins/keyboard.d.ts +2 -2
  118. package/dist/plugins/keyboard.js +65 -5
  119. package/dist/plugins/keyboard.js.map +1 -1
  120. package/dist/plugins/latex.js.map +1 -1
  121. package/dist/plugins/lazy-load.d.ts +2 -2
  122. package/dist/plugins/loading/index.d.ts +1 -1
  123. package/dist/plugins/loading.d.ts +2 -2
  124. package/dist/plugins/ml-integration.d.ts +2 -2
  125. package/dist/plugins/ml-integration.js +5 -5
  126. package/dist/plugins/ml-integration.js.map +1 -1
  127. package/dist/plugins/offscreen.d.ts +2 -2
  128. package/dist/plugins/pattern-recognition.d.ts +2 -2
  129. package/dist/plugins/pattern-recognition.js +1 -1
  130. package/dist/plugins/pattern-recognition.js.map +1 -1
  131. package/dist/plugins/radar.d.ts +2 -2
  132. package/dist/plugins/regression.d.ts +2 -2
  133. package/dist/plugins/regression.js +1 -1
  134. package/dist/plugins/regression.js.map +1 -1
  135. package/dist/plugins/roi.js +9 -9
  136. package/dist/plugins/roi.js.map +1 -1
  137. package/dist/plugins/snapshot/index.d.ts +1 -1
  138. package/dist/plugins/snapshot/types.d.ts +1 -1
  139. package/dist/plugins/snapshot.d.ts +2 -2
  140. package/dist/plugins/snapshot.js.map +1 -1
  141. package/dist/plugins/streaming/index.d.ts +2 -2
  142. package/dist/plugins/streaming.d.ts +2 -2
  143. package/dist/plugins/sync/index.d.ts +3 -2
  144. package/dist/plugins/sync.d.ts +2 -2
  145. package/dist/plugins/sync.js.map +1 -1
  146. package/dist/plugins/theme-editor/index.d.ts +1 -1
  147. package/dist/plugins/theme-editor.d.ts +2 -2
  148. package/dist/plugins/tools/index.d.ts +1 -1
  149. package/dist/plugins/tools/tooltip/index.d.ts +1 -1
  150. package/dist/plugins/tools.d.ts +2 -2
  151. package/dist/plugins/types.d.ts +1 -1
  152. package/dist/plugins/video-recorder.d.ts +2 -2
  153. package/dist/plugins/virtualization.d.ts +2 -2
  154. package/dist/plugins/virtualization.js +1 -1
  155. package/dist/pool-DZ8shSqv.js +109 -0
  156. package/dist/pool-DZ8shSqv.js.map +1 -0
  157. package/dist/react/StackedPlot.d.ts +31 -0
  158. package/dist/react/VeloPlot.d.ts +29 -0
  159. package/dist/react/index.d.ts +25 -3
  160. package/dist/react/useChartSync.d.ts +8 -0
  161. package/dist/react/useIndicator.d.ts +12 -0
  162. package/dist/react/useVeloPlot.d.ts +19 -0
  163. package/dist/react.js +328 -24
  164. package/dist/react.js.map +1 -1
  165. package/dist/scientific/index.d.ts +48 -0
  166. package/dist/scientific.d.ts +1 -0
  167. package/dist/scientific.js +91 -0
  168. package/dist/scientific.js.map +1 -0
  169. package/dist/solid/VeloPlot.d.ts +16 -0
  170. package/dist/solid/index.d.ts +13 -0
  171. package/dist/solid/useChartSync.d.ts +6 -0
  172. package/dist/solid/useIndicator.d.ts +11 -0
  173. package/dist/solid/useStackedPlot.d.ts +14 -0
  174. package/dist/solid/useVeloPlot.d.ts +18 -0
  175. package/dist/solid.d.ts +1 -0
  176. package/dist/solid.js +172 -0
  177. package/dist/solid.js.map +1 -0
  178. package/dist/stackedSync-tnrunZMt.js +100 -0
  179. package/dist/stackedSync-tnrunZMt.js.map +1 -0
  180. package/dist/svelte/StackedPlot.svelte +29 -0
  181. package/dist/svelte/StackedPlot.test.ts +114 -0
  182. package/dist/svelte/VeloPlot.svelte +44 -0
  183. package/dist/svelte/VeloPlot.test.ts +105 -0
  184. package/dist/svelte/index.d.ts +11 -0
  185. package/dist/svelte/index.test.ts +20 -0
  186. package/dist/svelte/index.ts +15 -0
  187. package/dist/svelte/useChartSync.d.ts +8 -0
  188. package/dist/svelte/useChartSync.test.ts +49 -0
  189. package/dist/svelte/useChartSync.ts +29 -0
  190. package/dist/svelte/useIndicator.d.ts +13 -0
  191. package/dist/svelte/useIndicator.test.ts +67 -0
  192. package/dist/svelte/useIndicator.ts +43 -0
  193. package/dist/svelte/useStackedPlot.d.ts +16 -0
  194. package/dist/svelte/useStackedPlot.test.ts +76 -0
  195. package/dist/svelte/useStackedPlot.ts +54 -0
  196. package/dist/svelte/useVeloPlot.d.ts +21 -0
  197. package/dist/svelte/useVeloPlot.test.ts +100 -0
  198. package/dist/svelte/useVeloPlot.ts +81 -0
  199. package/dist/svelte.d.ts +1 -0
  200. package/dist/svelte.js +143 -0
  201. package/dist/svelte.js.map +1 -0
  202. package/dist/testing/index.d.ts +1 -1
  203. package/dist/theme/index.d.ts +2 -1
  204. package/dist/trading.js +6 -6
  205. package/dist/types.d.ts +1 -1
  206. package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
  207. package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
  208. package/dist/velo-plot.full.js +452 -443
  209. package/dist/velo-plot.full.js.map +1 -1
  210. package/dist/velo-plot.js +15 -15
  211. package/dist/vue/StackedPlot.vue.d.ts +48 -0
  212. package/dist/vue/VeloPlot.vue.d.ts +64 -0
  213. package/dist/vue/index.d.ts +250 -0
  214. package/dist/vue/useChartSync.d.ts +52 -0
  215. package/dist/vue/useIndicator.d.ts +23 -0
  216. package/dist/vue/useStackedPlot.d.ts +15 -0
  217. package/dist/vue/useVeloPlot.d.ts +20 -0
  218. package/dist/vue.d.ts +1 -0
  219. package/dist/vue.js +312 -0
  220. package/dist/vue.js.map +1 -0
  221. package/dist/workers/indicatorsAsync.d.ts +2 -0
  222. package/dist/workers/pool.d.ts +9 -0
  223. package/package.json +88 -10
  224. package/dist/ChartCore-ivzLqxVb.js.map +0 -1
  225. package/dist/SciPlot-CEU4ApgD.js +0 -463
  226. package/dist/SciPlot-CEU4ApgD.js.map +0 -1
  227. package/dist/createStackedChart-DxNW0VkF.js +0 -705
  228. package/dist/createStackedChart-DxNW0VkF.js.map +0 -1
  229. package/dist/index-BBpJwOct.js.map +0 -1
  230. package/dist/index-DoYxf1cV.js.map +0 -1
  231. package/dist/index.core-COREBDNq.js.map +0 -1
  232. package/dist/mockDatafeed-927foCM4.js.map +0 -1
  233. package/dist/pool-15HMCNv8.js +0 -88
  234. package/dist/pool-15HMCNv8.js.map +0 -1
  235. package/dist/react/SciPlot.d.ts +0 -60
  236. package/dist/react/useSciPlot.d.ts +0 -56
package/dist/vue.js ADDED
@@ -0,0 +1,312 @@
1
+ import { ref as f, shallowRef as C, watch as m, onMounted as R, onUnmounted as p, defineComponent as A, createElementBlock as O, openBlock as P, normalizeStyle as L, normalizeClass as z, unref as j } from "vue";
2
+ import { c as E, i as B, r as k, a as V, b as $ } from "./chartSyncBridge-DbWrwtyP.js";
3
+ import { p as S, o as K, s as M, d as N } from "./optionsSync-QUiN4Inw.js";
4
+ import "./ChartCore-BpzRvN4Y.js";
5
+ import "./index-x4stH3jD.js";
6
+ import "./symbols-DT0eLlpW.js";
7
+ import { a as I, u as Z } from "./a11y-Bw6urYpr.js";
8
+ import { c as J } from "./createStackedChart-Dm-YqUT7.js";
9
+ import { s as b, a as T, b as x } from "./stackedSync-tnrunZMt.js";
10
+ function w(t = {}) {
11
+ const d = f(null), a = C(null), e = f(!1), n = f(null), u = f(null);
12
+ let r = null;
13
+ const c = { current: t };
14
+ let o = S(t);
15
+ return m(
16
+ () => t,
17
+ (l) => {
18
+ c.current = l;
19
+ const s = a.value;
20
+ if (!s) return;
21
+ const v = S(l);
22
+ K(o, v) && (M(s, o, v), o = v);
23
+ },
24
+ { deep: !0 }
25
+ ), R(() => {
26
+ const l = d.value;
27
+ if (l)
28
+ try {
29
+ const s = E(l, c.current, {
30
+ onBoundsChange: (v) => {
31
+ u.value = v;
32
+ },
33
+ onError: (v) => {
34
+ n.value = v;
35
+ }
36
+ });
37
+ a.value = s.chart, r = s.destroy, u.value = s.getBounds(), e.value = !0, o = S(c.current);
38
+ } catch (s) {
39
+ n.value = s instanceof Error ? s : new Error(String(s));
40
+ }
41
+ }), p(() => {
42
+ r == null || r(), r = null, a.value = null, e.value = !1;
43
+ }), {
44
+ containerRef: d,
45
+ chart: a,
46
+ isReady: e,
47
+ error: n,
48
+ bounds: u,
49
+ addSeries: (l) => {
50
+ var s;
51
+ (s = a.value) == null || s.addSeries(l), a.value && (u.value = a.value.getViewBounds());
52
+ },
53
+ updateSeries: (l, s) => {
54
+ var v;
55
+ return (v = a.value) == null ? void 0 : v.updateSeries(l, s);
56
+ },
57
+ removeSeries: (l) => {
58
+ var s;
59
+ return (s = a.value) == null ? void 0 : s.removeSeries(l);
60
+ },
61
+ zoom: (l) => {
62
+ var s;
63
+ return (s = a.value) == null ? void 0 : s.zoom(l);
64
+ },
65
+ resetZoom: () => {
66
+ var l;
67
+ (l = a.value) == null || l.resetZoom(), a.value && (u.value = a.value.getViewBounds());
68
+ }
69
+ };
70
+ }
71
+ const F = /* @__PURE__ */ A({
72
+ __name: "VeloPlot",
73
+ props: {
74
+ id: {},
75
+ renderer: {},
76
+ xAxis: {},
77
+ yAxis: {},
78
+ background: {},
79
+ devicePixelRatio: {},
80
+ theme: {},
81
+ colorScheme: {},
82
+ showLegend: { type: Boolean },
83
+ legendPosition: {},
84
+ showControls: { type: Boolean },
85
+ toolbar: {},
86
+ autoScroll: { type: Boolean },
87
+ showStatistics: { type: Boolean },
88
+ tooltip: {},
89
+ animations: { type: [Object, Boolean] },
90
+ responsive: { type: [Object, Boolean] },
91
+ plugins: {},
92
+ loading: { type: [Boolean, Object] },
93
+ layout: {},
94
+ readOnly: { type: Boolean },
95
+ debug: { type: [Boolean, Object] },
96
+ locale: {},
97
+ keyBindings: { type: [Boolean, Array] },
98
+ clipboard: { type: [Boolean, Object] },
99
+ autoResize: { type: Boolean },
100
+ series: { default: () => [] },
101
+ zoom: {},
102
+ width: { default: "100%" },
103
+ height: { default: 400 },
104
+ class: {},
105
+ cursor: {},
106
+ ariaLabel: {},
107
+ keyboardNav: { type: Boolean, default: !0 }
108
+ },
109
+ emits: ["zoomChange"],
110
+ setup(t, { expose: d, emit: a }) {
111
+ const e = t, {
112
+ containerRef: n,
113
+ chart: u,
114
+ isReady: r,
115
+ bounds: c,
116
+ addSeries: o,
117
+ updateSeries: i,
118
+ removeSeries: l,
119
+ resetZoom: s
120
+ } = w(e), v = f(/* @__PURE__ */ new Map());
121
+ let h = null;
122
+ return m(
123
+ () => [e.series, r.value, u.value],
124
+ () => {
125
+ !r.value || !u.value || (v.value = N(
126
+ {
127
+ addSeries: o,
128
+ updateSeries: i,
129
+ removeSeries: l,
130
+ autoScale: () => {
131
+ var y;
132
+ return (y = u.value) == null ? void 0 : y.autoScale();
133
+ }
134
+ },
135
+ e.series,
136
+ v.value
137
+ ));
138
+ },
139
+ { deep: !0, immediate: !0 }
140
+ ), m(
141
+ () => [r.value, u.value, e.keyboardNav, e.ariaLabel],
142
+ () => {
143
+ const y = n.value;
144
+ !y || !u.value || !r.value || (h == null || h.cleanup(), h = I(y, u.value, {
145
+ label: e.ariaLabel,
146
+ series: e.series,
147
+ bounds: c.value,
148
+ enableKeyboard: e.keyboardNav
149
+ }));
150
+ },
151
+ { immediate: !0 }
152
+ ), p(() => h == null ? void 0 : h.cleanup()), m(c, (y) => {
153
+ const g = n.value;
154
+ g && h && Z(g, h.srTable, {
155
+ label: e.ariaLabel,
156
+ series: e.series,
157
+ bounds: y
158
+ });
159
+ }), d({ getChart: () => u.value, resetZoom: s, getBounds: () => c.value }), (y, g) => (P(), O("div", {
160
+ ref_key: "containerRef",
161
+ ref: n,
162
+ class: z(["velo-plot-container", e.class]),
163
+ style: L({
164
+ position: "relative",
165
+ width: typeof t.width == "number" ? `${t.width}px` : t.width,
166
+ height: typeof t.height == "number" ? `${t.height}px` : t.height
167
+ })
168
+ }, null, 6));
169
+ }
170
+ });
171
+ function G(t) {
172
+ const d = f(null), a = C(null), e = f(!1);
173
+ let n = null, u = b(t.panes), r = /* @__PURE__ */ new Map();
174
+ const c = () => {
175
+ const o = d.value;
176
+ if (!o) return;
177
+ n == null || n();
178
+ const i = J({ ...t, container: o });
179
+ a.value = i, n = () => i.destroy(), u = b(t.panes), r = x(i, t.panes, /* @__PURE__ */ new Map()), i.whenReady().then(() => {
180
+ e.value = !0;
181
+ });
182
+ };
183
+ return R(c), p(() => {
184
+ n == null || n(), a.value = null, e.value = !1;
185
+ }), m(
186
+ () => t,
187
+ (o) => {
188
+ const i = a.value;
189
+ if (!i || !e.value) return;
190
+ if (b(o.panes) !== u) {
191
+ c();
192
+ return;
193
+ }
194
+ T(i, o), r = x(i, o.panes, r);
195
+ },
196
+ { deep: !0 }
197
+ ), {
198
+ containerRef: d,
199
+ stack: a,
200
+ isReady: e,
201
+ fitAll: (o) => {
202
+ var i;
203
+ return (i = a.value) == null ? void 0 : i.fitAll(o);
204
+ },
205
+ resetAll: () => {
206
+ var o;
207
+ return (o = a.value) == null ? void 0 : o.resetAll();
208
+ }
209
+ };
210
+ }
211
+ const U = ["aria-label", "data-ready"], ae = /* @__PURE__ */ A({
212
+ __name: "StackedPlot",
213
+ props: {
214
+ panes: {},
215
+ direction: {},
216
+ masterPaneId: {},
217
+ sharedXAxis: {},
218
+ sharedYAxis: {},
219
+ xAxis: {},
220
+ theme: {},
221
+ devicePixelRatio: {},
222
+ gap: {},
223
+ resizable: { type: [Boolean, Object] },
224
+ showLegend: { type: Boolean },
225
+ sync: { type: [Boolean, Object] },
226
+ layout: {},
227
+ width: { default: "100%" },
228
+ height: { default: 480 },
229
+ class: {},
230
+ ariaLabel: {}
231
+ },
232
+ setup(t, { expose: d }) {
233
+ const a = t, { containerRef: e, stack: n, isReady: u, fitAll: r, resetAll: c } = G(a);
234
+ return d({
235
+ getStack: () => n.value,
236
+ fitAll: r,
237
+ resetAll: c,
238
+ getBounds: () => {
239
+ var o;
240
+ return ((o = n.value) == null ? void 0 : o.getMaster().getViewBounds()) ?? null;
241
+ }
242
+ }), (o, i) => (P(), O("div", {
243
+ ref_key: "containerRef",
244
+ ref: e,
245
+ class: z(["velo-plot-stacked", a.class]),
246
+ role: "img",
247
+ "aria-label": t.ariaLabel ?? `Stacked chart with ${t.panes.length} panes`,
248
+ "data-ready": j(u),
249
+ style: L({
250
+ position: "relative",
251
+ width: typeof t.width == "number" ? `${t.width}px` : t.width,
252
+ height: typeof t.height == "number" ? `${t.height}px` : t.height
253
+ })
254
+ }, null, 14, U));
255
+ }
256
+ });
257
+ function le(t, d, a = {}) {
258
+ const e = f(null), n = f(!1), u = f(null);
259
+ return m(
260
+ () => [t(), d, JSON.stringify(a)],
261
+ async ([r], c, o) => {
262
+ if (!r) return;
263
+ let i = !1;
264
+ o(() => {
265
+ i = !0;
266
+ const l = e.value;
267
+ l && !B(r) && k(r, l.id);
268
+ }), n.value = !0, u.value = null;
269
+ try {
270
+ const l = await V(r, d, a);
271
+ i || (e.value = l, n.value = !1);
272
+ } catch (l) {
273
+ i || (u.value = l instanceof Error ? l : new Error(String(l)), n.value = !1);
274
+ }
275
+ },
276
+ { immediate: !0 }
277
+ ), p(() => {
278
+ const r = t(), c = e.value;
279
+ c && r && !B(r) && k(r, c.id);
280
+ }), { result: e, isLoading: n, error: u };
281
+ }
282
+ function X(t, d) {
283
+ const a = f(null);
284
+ let e = null;
285
+ return m(
286
+ () => [t(), JSON.stringify(d)],
287
+ ([n]) => {
288
+ if (e == null || e.destroy(), n.length < 2) {
289
+ a.value = null;
290
+ return;
291
+ }
292
+ e = $(n, d), a.value = e.group;
293
+ },
294
+ { immediate: !0 }
295
+ ), p(() => {
296
+ e == null || e.destroy(), a.value = null;
297
+ }), { group: a };
298
+ }
299
+ const ne = X, re = F, oe = w, se = w;
300
+ export {
301
+ re as SciPlot,
302
+ ae as StackedPlot,
303
+ F as VeloPlot,
304
+ ne as useChartGroup,
305
+ X as useChartSync,
306
+ le as useIndicator,
307
+ se as useSciChart,
308
+ oe as useSciPlot,
309
+ G as useStackedPlot,
310
+ w as useVeloPlot
311
+ };
312
+ //# sourceMappingURL=vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue.js","sources":["../src/vue/useVeloPlot.ts","../src/vue/VeloPlot.vue","../src/vue/useStackedPlot.ts","../src/vue/StackedPlot.vue","../src/vue/useIndicator.ts","../src/vue/useChartSync.ts","../src/vue/index.ts"],"sourcesContent":["/**\n * Vue composable for single charts.\n */\n\nimport { ref, shallowRef, onMounted, onUnmounted, watch } from \"vue\";\nimport type { Ref } from \"vue\";\nimport type { Chart } from \"../core/Chart\";\nimport type {\n SeriesOptions,\n SeriesUpdateData,\n ZoomOptions,\n Bounds,\n} from \"../types\";\nimport {\n createChartLifecycle,\n type ChartBindingOptions,\n optionsChanged,\n syncChartOptions,\n pickSyncableOptions,\n} from \"../bindings/shared\";\n\nexport interface UseVeloPlotOptions extends ChartBindingOptions {}\n\nexport interface UseVeloPlotReturn {\n containerRef: Ref<HTMLDivElement | null>;\n chart: Ref<Chart | null>;\n isReady: Ref<boolean>;\n error: Ref<Error | null>;\n bounds: Ref<Bounds | null>;\n addSeries: (options: SeriesOptions) => void;\n updateSeries: (id: string, data: SeriesUpdateData) => void;\n removeSeries: (id: string) => void;\n zoom: (options: ZoomOptions) => void;\n resetZoom: () => void;\n}\n\nexport function useVeloPlot(options: UseVeloPlotOptions = {}): UseVeloPlotReturn {\n const containerRef = ref<HTMLDivElement | null>(null);\n const chart = shallowRef<Chart | null>(null);\n const isReady = ref(false);\n const error = ref<Error | null>(null);\n const bounds = ref<Bounds | null>(null);\n\n let destroy: (() => void) | null = null;\n const optionsRef = { current: options };\n let prevSync = pickSyncableOptions(options);\n\n watch(\n () => options,\n (next) => {\n optionsRef.current = next;\n const c = chart.value;\n if (!c) return;\n const picked = pickSyncableOptions(next);\n if (optionsChanged(prevSync, picked)) {\n syncChartOptions(c, prevSync, picked);\n prevSync = picked;\n }\n },\n { deep: true },\n );\n\n onMounted(() => {\n const el = containerRef.value;\n if (!el) return;\n try {\n const handle = createChartLifecycle(el, optionsRef.current, {\n onBoundsChange: (b) => {\n bounds.value = b;\n },\n onError: (e) => {\n error.value = e;\n },\n });\n chart.value = handle.chart;\n destroy = handle.destroy;\n bounds.value = handle.getBounds();\n isReady.value = true;\n prevSync = pickSyncableOptions(optionsRef.current);\n } catch (e) {\n error.value = e instanceof Error ? e : new Error(String(e));\n }\n });\n\n onUnmounted(() => {\n destroy?.();\n destroy = null;\n chart.value = null;\n isReady.value = false;\n });\n\n const addSeries = (opts: SeriesOptions) => {\n chart.value?.addSeries(opts);\n if (chart.value) bounds.value = chart.value.getViewBounds();\n };\n\n return {\n containerRef,\n chart,\n isReady,\n error,\n bounds,\n addSeries,\n updateSeries: (id, data) => chart.value?.updateSeries(id, data),\n removeSeries: (id) => chart.value?.removeSeries(id),\n zoom: (z) => chart.value?.zoom(z),\n resetZoom: () => {\n chart.value?.resetZoom();\n if (chart.value) bounds.value = chart.value.getViewBounds();\n },\n };\n}\n","<script setup lang=\"ts\">\nimport { ref, watch, onUnmounted } from \"vue\";\nimport { useVeloPlot, type UseVeloPlotOptions } from \"./useVeloPlot\";\nimport {\n diffSeries,\n applyChartA11y,\n updateA11y,\n type VeloPlotSeries,\n} from \"../bindings/shared\";\nimport type { Bounds, CursorOptions, ZoomOptions } from \"../types\";\n\nconst props = withDefaults(\n defineProps<\n UseVeloPlotOptions & {\n series?: VeloPlotSeries[];\n zoom?: ZoomOptions;\n width?: number | string;\n height?: number | string;\n class?: string;\n cursor?: CursorOptions;\n ariaLabel?: string;\n keyboardNav?: boolean;\n }\n >(),\n {\n series: () => [],\n width: \"100%\",\n height: 400,\n keyboardNav: true,\n },\n);\n\nconst emit = defineEmits<{\n zoomChange: [bounds: Bounds];\n}>();\n\nconst {\n containerRef,\n chart,\n isReady,\n bounds,\n addSeries,\n updateSeries,\n removeSeries,\n resetZoom,\n} = useVeloPlot(props);\n\nconst previousSeries = ref(new Map<string, VeloPlotSeries>());\nlet a11yHandle: ReturnType<typeof applyChartA11y> | null = null;\n\nwatch(\n () => [props.series, isReady.value, chart.value] as const,\n () => {\n if (!isReady.value || !chart.value) return;\n previousSeries.value = diffSeries(\n {\n addSeries,\n updateSeries,\n removeSeries,\n autoScale: () => chart.value?.autoScale(),\n },\n props.series,\n previousSeries.value,\n );\n },\n { deep: true, immediate: true },\n);\n\nwatch(\n () => [isReady.value, chart.value, props.keyboardNav, props.ariaLabel] as const,\n () => {\n const el = containerRef.value;\n if (!el || !chart.value || !isReady.value) return;\n a11yHandle?.cleanup();\n a11yHandle = applyChartA11y(el, chart.value, {\n label: props.ariaLabel,\n series: props.series,\n bounds: bounds.value,\n enableKeyboard: props.keyboardNav,\n });\n },\n { immediate: true },\n);\n\nonUnmounted(() => a11yHandle?.cleanup());\n\nwatch(bounds, (b) => {\n const el = containerRef.value;\n if (el && a11yHandle) {\n updateA11y(el, a11yHandle.srTable, {\n label: props.ariaLabel,\n series: props.series,\n bounds: b,\n });\n }\n});\n\ndefineExpose({ getChart: () => chart.value, resetZoom, getBounds: () => bounds.value });\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"velo-plot-container\"\n :class=\"props.class\"\n :style=\"{\n position: 'relative',\n width: typeof width === 'number' ? `${width}px` : width,\n height: typeof height === 'number' ? `${height}px` : height,\n }\"\n />\n</template>\n","/**\n * Vue composable for stacked charts.\n */\n\nimport { ref, shallowRef, onMounted, onUnmounted, watch } from \"vue\";\nimport { createStackedChart } from \"../core/stacked\";\nimport type { StackedChart, StackedChartOptions } from \"../core/stacked\";\nimport type { Range } from \"../types\";\nimport {\n stackedStructureKey,\n syncStackedOptions,\n syncStackedPaneSeries,\n} from \"../bindings/shared\";\nimport type { VeloPlotSeries } from \"../bindings/shared\";\n\nexport interface UseStackedPlotOptions\n extends Omit<StackedChartOptions, \"container\"> {}\n\nexport function useStackedPlot(options: UseStackedPlotOptions) {\n const containerRef = ref<HTMLDivElement | null>(null);\n const stack = shallowRef<StackedChart | null>(null);\n const isReady = ref(false);\n\n let destroy: (() => void) | null = null;\n let structureKey = stackedStructureKey(options.panes);\n let paneSeries = new Map<string, Map<string, VeloPlotSeries>>();\n\n const mount = () => {\n const el = containerRef.value;\n if (!el) return;\n destroy?.();\n const created = createStackedChart({ ...options, container: el });\n stack.value = created;\n destroy = () => created.destroy();\n structureKey = stackedStructureKey(options.panes);\n paneSeries = syncStackedPaneSeries(created, options.panes, new Map());\n created.whenReady().then(() => {\n isReady.value = true;\n });\n };\n\n onMounted(mount);\n onUnmounted(() => {\n destroy?.();\n stack.value = null;\n isReady.value = false;\n });\n\n watch(\n () => options,\n (next) => {\n const current = stack.value;\n if (!current || !isReady.value) return;\n const nextKey = stackedStructureKey(next.panes);\n if (nextKey !== structureKey) {\n mount();\n return;\n }\n syncStackedOptions(current, next);\n paneSeries = syncStackedPaneSeries(current, next.panes, paneSeries);\n },\n { deep: true },\n );\n\n return {\n containerRef,\n stack,\n isReady,\n fitAll: (opts?: { x?: Range; padding?: number }) => stack.value?.fitAll(opts),\n resetAll: () => stack.value?.resetAll(),\n };\n}\n","<script setup lang=\"ts\">\nimport { useStackedPlot, type UseStackedPlotOptions } from \"./useStackedPlot\";\n\nconst props = withDefaults(\n defineProps<\n UseStackedPlotOptions & {\n width?: number | string;\n height?: number | string;\n class?: string;\n ariaLabel?: string;\n }\n >(),\n {\n width: \"100%\",\n height: 480,\n },\n);\n\nconst { containerRef, stack, isReady, fitAll, resetAll } = useStackedPlot(props);\n\ndefineExpose({\n getStack: () => stack.value,\n fitAll,\n resetAll,\n getBounds: () => stack.value?.getMaster().getViewBounds() ?? null,\n});\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"velo-plot-stacked\"\n :class=\"props.class\"\n role=\"img\"\n :aria-label=\"ariaLabel ?? `Stacked chart with ${panes.length} panes`\"\n :data-ready=\"isReady\"\n :style=\"{\n position: 'relative',\n width: typeof width === 'number' ? `${width}px` : width,\n height: typeof height === 'number' ? `${height}px` : height,\n }\"\n />\n</template>\n","import { ref, watch, onUnmounted } from \"vue\";\nimport type { AddIndicatorOptions, AddIndicatorResult } from \"../core/indicator/addIndicator\";\nimport type { IndicatorPresetName } from \"../core/indicator/indicatorPresets\";\nimport {\n addIndicatorToHost,\n isStackedChart,\n removeIndicatorFromChart,\n type IndicatorHost,\n} from \"../bindings/shared\";\nimport type { Chart } from \"../core/chart/types\";\n\nexport function useIndicator(\n host: () => IndicatorHost,\n preset: IndicatorPresetName,\n options: AddIndicatorOptions = {},\n) {\n const result = ref<(AddIndicatorResult & { paneId?: string }) | null>(null);\n const isLoading = ref(false);\n const error = ref<Error | null>(null);\n\n watch(\n () => [host(), preset, JSON.stringify(options)] as const,\n async ([h], _, onCleanup) => {\n if (!h) return;\n let cancelled = false;\n onCleanup(() => {\n cancelled = true;\n const res = result.value;\n if (res && !isStackedChart(h)) {\n removeIndicatorFromChart(h as Chart, res.id);\n }\n });\n isLoading.value = true;\n error.value = null;\n try {\n const res = await addIndicatorToHost(h, preset, options);\n if (!cancelled) {\n result.value = res;\n isLoading.value = false;\n }\n } catch (e) {\n if (!cancelled) {\n error.value = e instanceof Error ? e : new Error(String(e));\n isLoading.value = false;\n }\n }\n },\n { immediate: true },\n );\n\n onUnmounted(() => {\n const h = host();\n const res = result.value;\n if (res && h && !isStackedChart(h)) {\n removeIndicatorFromChart(h as Chart, res.id);\n }\n });\n\n return { result, isLoading, error };\n}\n","import { ref, watch, onUnmounted } from \"vue\";\nimport type { ChartLike, SyncOptions } from \"../core/sync\";\nimport { ChartGroup } from \"../core/sync\";\nimport { createChartSync } from \"../bindings/shared\";\n\nexport function useChartSync(\n charts: () => ChartLike[],\n options?: SyncOptions,\n) {\n const group = ref<ChartGroup | null>(null);\n let handle: ReturnType<typeof createChartSync> | null = null;\n\n watch(\n () => [charts(), JSON.stringify(options)] as const,\n ([list]) => {\n handle?.destroy();\n if (list.length < 2) {\n group.value = null;\n return;\n }\n handle = createChartSync(list, options);\n group.value = handle.group;\n },\n { immediate: true },\n );\n\n onUnmounted(() => {\n handle?.destroy();\n group.value = null;\n });\n\n return { group };\n}\n\nexport const useChartGroup = useChartSync;\n","export { default as VeloPlot } from \"./VeloPlot.vue\";\nexport { default as StackedPlot } from \"./StackedPlot.vue\";\nexport { useVeloPlot, type UseVeloPlotOptions, type UseVeloPlotReturn } from \"./useVeloPlot\";\nexport { useStackedPlot, type UseStackedPlotOptions } from \"./useStackedPlot\";\nexport { useIndicator } from \"./useIndicator\";\nexport { useChartSync, useChartGroup } from \"./useChartSync\";\n\nimport VeloPlotVue from \"./VeloPlot.vue\";\nimport { useVeloPlot as useVeloPlotImpl } from \"./useVeloPlot\";\n\n/** @deprecated Use `VeloPlot` instead. **Removed in v4.0.** */\nexport const SciPlot = VeloPlotVue;\n/** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */\nexport const useSciPlot = useVeloPlotImpl;\n/** @deprecated Use `useVeloPlot` instead. **Removed in v4.0.** */\nexport const useSciChart = useVeloPlotImpl;\n"],"names":["useVeloPlot","options","containerRef","ref","chart","shallowRef","isReady","error","bounds","destroy","optionsRef","prevSync","pickSyncableOptions","watch","next","c","picked","optionsChanged","syncChartOptions","onMounted","el","handle","createChartLifecycle","b","e","onUnmounted","opts","_a","id","data","z","props","__props","addSeries","updateSeries","removeSeries","resetZoom","previousSeries","a11yHandle","diffSeries","applyChartA11y","updateA11y","__expose","_createElementBlock","_normalizeClass","_normalizeStyle","useStackedPlot","stack","structureKey","stackedStructureKey","paneSeries","mount","created","createStackedChart","syncStackedPaneSeries","current","syncStackedOptions","fitAll","resetAll","_unref","useIndicator","host","preset","result","isLoading","h","_","onCleanup","cancelled","res","isStackedChart","removeIndicatorFromChart","addIndicatorToHost","useChartSync","charts","group","list","createChartSync","useChartGroup","SciPlot","VeloPlotVue","useSciPlot","useVeloPlotImpl","useS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0E,EAAM,QAAQtD,EAAO;AAAA,IACvB;AAAA,IACA,EAAE,WAAW,GAAA;AAAA,EAAK,GAGpBI,EAAY,MAAM;AAChB,IAAAJ,KAAA,QAAAA,EAAQ,WACRsD,EAAM,QAAQ;AAAA,EAChB,CAAC,GAEM,EAAE,OAAAA,EAAA;AACX;AAEO,MAAMG,KAAgBL,GCvBhBM,KAAUC,GAEVC,KAAaC,GAEbC,KAAcD;"}
@@ -47,4 +47,6 @@ export declare function bollingerBandsAsync(data: Float32Array | Float64Array |
47
47
  export declare function destroyIndicatorPool(): void;
48
48
  /** Exposed for tests */
49
49
  export declare function getIndicatorPoolSize(): number;
50
+ /** Exposed for tests */
51
+ export declare function isIndicatorPreferSync(): boolean;
50
52
  export {};
@@ -7,6 +7,12 @@ export interface WorkerPoolOptions {
7
7
  poolSize?: number;
8
8
  /** Run tasks on main thread when Worker is unavailable */
9
9
  syncFallback?: boolean;
10
+ /**
11
+ * If a worker never answers (common with broken Vite worker URLs in docs),
12
+ * fall back to syncHandler after this many ms (default: 250).
13
+ * Set 0 to disable.
14
+ */
15
+ timeoutMs?: number;
10
16
  }
11
17
  export declare class WorkerPool<TMessage extends {
12
18
  id: string;
@@ -16,6 +22,7 @@ export declare class WorkerPool<TMessage extends {
16
22
  private nextWorker;
17
23
  private readonly poolSize;
18
24
  private readonly syncFallback;
25
+ private readonly timeoutMs;
19
26
  private readonly workerFactory;
20
27
  private readonly syncHandler?;
21
28
  private destroyed;
@@ -25,6 +32,8 @@ export declare class WorkerPool<TMessage extends {
25
32
  private removeWorker;
26
33
  private workerErrorMessage;
27
34
  private rejectPendingWithSyncFallback;
35
+ private clearTaskTimer;
36
+ private settleWithSync;
28
37
  private spawnWorker;
29
38
  /** Dispatch a task to the pool. Falls back to syncHandler when no workers exist. */
30
39
  run(task: TMessage): Promise<TResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "velo-plot",
3
- "version": "2.20.0",
3
+ "version": "3.0.0",
4
4
  "author": "jigonzalez930209",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "description": "A high-performance scientific charting engine for web applications.",
20
20
  "engines": {
21
- "node": ">=24",
21
+ "node": ">=22",
22
22
  "pnpm": ">=11"
23
23
  },
24
24
  "type": "module",
@@ -38,10 +38,34 @@
38
38
  "types": "./dist/trading/index.d.ts",
39
39
  "import": "./dist/trading.js"
40
40
  },
41
+ "./scientific": {
42
+ "types": "./dist/scientific/index.d.ts",
43
+ "import": "./dist/scientific.js"
44
+ },
41
45
  "./react": {
42
46
  "types": "./dist/react/index.d.ts",
43
47
  "import": "./dist/react.js"
44
48
  },
49
+ "./vue": {
50
+ "types": "./dist/vue/index.d.ts",
51
+ "import": "./dist/vue.js"
52
+ },
53
+ "./svelte": {
54
+ "types": "./dist/svelte/index.d.ts",
55
+ "import": "./dist/svelte.js"
56
+ },
57
+ "./solid": {
58
+ "types": "./dist/solid/index.d.ts",
59
+ "import": "./dist/solid.js"
60
+ },
61
+ "./angular": {
62
+ "types": "./dist/angular/index.d.ts",
63
+ "import": "./dist/angular.js"
64
+ },
65
+ "./astro": {
66
+ "import": "./dist/astro/VeloPlot.astro"
67
+ },
68
+ "./astro/*": "./dist/astro/*",
45
69
  "./plugins/3d": {
46
70
  "types": "./dist/plugins/3d.d.ts",
47
71
  "import": "./dist/plugins/3d.js"
@@ -173,30 +197,82 @@
173
197
  "LICENSE"
174
198
  ],
175
199
  "peerDependencies": {
200
+ "@angular/core": ">=17.0.0",
201
+ "astro": ">=4.0.0",
176
202
  "react": ">=16.8.0",
177
- "react-dom": ">=16.8.0"
203
+ "react-dom": ">=16.8.0",
204
+ "solid-js": ">=1.8.0",
205
+ "svelte": ">=4.0.0",
206
+ "vue": ">=3.3.0"
207
+ },
208
+ "peerDependenciesMeta": {
209
+ "react": {
210
+ "optional": true
211
+ },
212
+ "react-dom": {
213
+ "optional": true
214
+ },
215
+ "vue": {
216
+ "optional": true
217
+ },
218
+ "svelte": {
219
+ "optional": true
220
+ },
221
+ "solid-js": {
222
+ "optional": true
223
+ },
224
+ "@angular/core": {
225
+ "optional": true
226
+ },
227
+ "astro": {
228
+ "optional": true
229
+ }
178
230
  },
179
231
  "devDependencies": {
232
+ "@angular/compiler": "^19.2.25",
233
+ "@angular/core": "^19.2.25",
234
+ "@angular/platform-browser-dynamic": "^19.2.25",
180
235
  "@playwright/test": "^1.52.0",
236
+ "@solidjs/testing-library": "^0.8.10",
237
+ "@sveltejs/vite-plugin-svelte": "^7.2.0",
238
+ "@testing-library/dom": "^10.4.1",
239
+ "@testing-library/react": "^16.3.2",
240
+ "@testing-library/svelte": "^5.4.2",
241
+ "@testing-library/vue": "^8.1.0",
181
242
  "@types/node": "^25.0.3",
182
- "@types/react": "^18.2.0",
183
- "@types/react-dom": "^18.2.0",
243
+ "@types/react": "^18.3.27",
244
+ "@types/react-dom": "^18.3.7",
245
+ "@vitejs/plugin-vue": "^6.0.7",
184
246
  "@vitest/coverage-v8": "^3.2.6",
247
+ "@vue/test-utils": "^2.4.11",
248
+ "astro": "^5.18.2",
185
249
  "happy-dom": "^20.10.6",
186
250
  "playwright": "^1.52.0",
251
+ "react": "^19.2.3",
252
+ "react-dom": "^19.2.3",
253
+ "solid-js": "^1.9.14",
254
+ "svelte": "^5.56.4",
255
+ "typedoc": "^0.28.20",
187
256
  "typescript": "^5.2.2",
188
257
  "vite": "^5.0.0",
189
258
  "vite-plugin-dts": "^3.6.0",
259
+ "vite-plugin-solid": "^2.11.12",
260
+ "vite-plugin-svelte": "^3.0.1",
190
261
  "vitepress": "^1.0.0-rc.31",
191
- "vitest": "^3.2.6"
262
+ "vitest": "^3.2.6",
263
+ "vue": "^3.5.26",
264
+ "zone.js": "^0.15.1"
192
265
  },
193
266
  "scripts": {
194
267
  "dev": "vite",
195
- "build": "tsc -p tsconfig.build.json && vite build -c vite.config.lib.ts",
268
+ "build": "tsc -p tsconfig.build.json && vite build -c vite.config.lib.ts && node scripts/copy-framework-assets.mjs",
196
269
  "preview": "vite preview",
197
270
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
198
- "test": "vitest run",
199
- "test:coverage": "vitest run --coverage",
271
+ "test": "vitest run && pnpm test:bindings",
272
+ "test:bindings": "vitest run --config vitest.bindings.config.ts",
273
+ "test:coverage": "pnpm test:coverage:bindings && pnpm test:coverage:core",
274
+ "test:coverage:core": "vitest run --coverage && node scripts/check-core-coverage.mjs",
275
+ "test:coverage:bindings": "vitest run --config vitest.bindings.config.ts --coverage && node scripts/check-bindings-coverage.mjs",
200
276
  "test:watch": "vitest",
201
277
  "test:dom": "vitest run .dom.test.ts",
202
278
  "test:e2e": "playwright test",
@@ -216,6 +292,8 @@
216
292
  "test:bench-regression": "node scripts/compare-benchmark-regression.mjs",
217
293
  "docs:dev": "vitepress dev docs",
218
294
  "docs:build": "vitepress build docs",
219
- "docs:preview": "vitepress preview docs"
295
+ "docs:preview": "vitepress preview docs",
296
+ "create-plugin": "node scripts/create-plugin.mjs",
297
+ "docs:api": "typedoc"
220
298
  }
221
299
  }