acttrader-charts 1.3.0-beta.24 → 1.3.0-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +25 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/dist/webview/chart.html +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25314,6 +25314,10 @@ var _ChartEngine = class _ChartEngine {
|
|
|
25314
25314
|
this.logoImage = null;
|
|
25315
25315
|
// ── State persistence ─────────────────────────────────────────────────────
|
|
25316
25316
|
this.isRestoringState = false;
|
|
25317
|
+
this.onPointerEnter = () => {
|
|
25318
|
+
this._cachedWrapRect = null;
|
|
25319
|
+
this._cachedDrawRect = null;
|
|
25320
|
+
};
|
|
25317
25321
|
this.onMouseMove = (e) => {
|
|
25318
25322
|
if (this._mobileCrosshairActive) return;
|
|
25319
25323
|
if (Date.now() - this._lastTouchTime < 500) return;
|
|
@@ -26462,19 +26466,29 @@ var _ChartEngine = class _ChartEngine {
|
|
|
26462
26466
|
throw new Error("acttrader-charts requires a browser environment");
|
|
26463
26467
|
}
|
|
26464
26468
|
enableKeyboardOverlayMode();
|
|
26465
|
-
|
|
26466
|
-
|
|
26467
|
-
|
|
26468
|
-
|
|
26469
|
-
|
|
26470
|
-
|
|
26469
|
+
const invalidate = () => {
|
|
26470
|
+
this._cachedWrapRect = null;
|
|
26471
|
+
this._cachedDrawRect = null;
|
|
26472
|
+
};
|
|
26473
|
+
const vv = window.visualViewport;
|
|
26474
|
+
if (vv) {
|
|
26471
26475
|
vv.addEventListener("resize", invalidate);
|
|
26472
26476
|
vv.addEventListener("scroll", invalidate);
|
|
26473
|
-
|
|
26477
|
+
}
|
|
26478
|
+
document.addEventListener("scroll", invalidate, { capture: true, passive: true });
|
|
26479
|
+
window.addEventListener("resize", invalidate);
|
|
26480
|
+
const layoutObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver(invalidate) : null;
|
|
26481
|
+
layoutObserver?.observe(document.documentElement);
|
|
26482
|
+
if (document.body) layoutObserver?.observe(document.body);
|
|
26483
|
+
this.disposeVvListener = () => {
|
|
26484
|
+
if (vv) {
|
|
26474
26485
|
vv.removeEventListener("resize", invalidate);
|
|
26475
26486
|
vv.removeEventListener("scroll", invalidate);
|
|
26476
|
-
}
|
|
26477
|
-
|
|
26487
|
+
}
|
|
26488
|
+
document.removeEventListener("scroll", invalidate, { capture: true });
|
|
26489
|
+
window.removeEventListener("resize", invalidate);
|
|
26490
|
+
layoutObserver?.disconnect();
|
|
26491
|
+
};
|
|
26478
26492
|
const {
|
|
26479
26493
|
container,
|
|
26480
26494
|
theme = "dark",
|
|
@@ -27392,6 +27406,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
27392
27406
|
this.scheduleViewportPersist();
|
|
27393
27407
|
}
|
|
27394
27408
|
);
|
|
27409
|
+
this.drawCanvas.addEventListener("mouseenter", this.onPointerEnter);
|
|
27395
27410
|
this.drawCanvas.addEventListener("mousemove", this.onMouseMove);
|
|
27396
27411
|
this.drawCanvas.addEventListener("mouseleave", this.onMouseLeave);
|
|
27397
27412
|
this.drawCanvas.addEventListener("mousedown", this.onCanvasClick);
|
|
@@ -29844,6 +29859,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
29844
29859
|
this.advancedToolbar?.destroy();
|
|
29845
29860
|
this.mobileHeader?.destroy();
|
|
29846
29861
|
this.leftBar?.destroy();
|
|
29862
|
+
this.drawCanvas.removeEventListener("mouseenter", this.onPointerEnter);
|
|
29847
29863
|
this.drawCanvas.removeEventListener("mousemove", this.onMouseMove);
|
|
29848
29864
|
this.drawCanvas.removeEventListener("mouseleave", this.onMouseLeave);
|
|
29849
29865
|
this.drawCanvas.removeEventListener("mousedown", this.onCanvasClick);
|