@forgecharts/sdk 1.5.47 → 1.5.49
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/datafeed/DatafeedConnector.d.ts +2 -1
- package/dist/datafeed/DatafeedConnector.d.ts.map +1 -1
- package/dist/index.js +65 -62
- package/dist/index.js.map +1 -1
- package/dist/internal.js +65 -62
- package/dist/internal.js.map +1 -1
- package/dist/react/canvas/ChartContextMenu.d.ts +1 -7
- package/dist/react/canvas/ChartContextMenu.d.ts.map +1 -1
- package/dist/react/index.js +65 -62
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +65 -62
- package/dist/react/internal.js.map +1 -1
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextStyle, Application, Container, Graphics, Text, FillGradient, CanvasTextMetrics } from 'pixi.js';
|
|
2
2
|
import { forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback, createContext, useMemo, useContext } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import ReactDOM from 'react-dom';
|
|
4
|
+
import ReactDOM, { createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
// ../shared/src/time/timeframeRegistry.ts
|
|
7
7
|
function isCalendarTimeframe(key) {
|
|
@@ -10353,6 +10353,7 @@ function toOHLCV(bar) {
|
|
|
10353
10353
|
function _historyWindow(tf) {
|
|
10354
10354
|
return 500 * (parseTfSeconds(tf) ?? 3600);
|
|
10355
10355
|
}
|
|
10356
|
+
var BATCH_SUPPRESSION_MS = 1e4;
|
|
10356
10357
|
function _pageSize(tf) {
|
|
10357
10358
|
return 500 * (parseTfSeconds(tf) ?? 3600);
|
|
10358
10359
|
}
|
|
@@ -10388,7 +10389,8 @@ var DatafeedConnector = class {
|
|
|
10388
10389
|
*/
|
|
10389
10390
|
_emptyPageStreak = 0;
|
|
10390
10391
|
/**
|
|
10391
|
-
* Safety timer: clears `batchPending` if bar_batch never arrives
|
|
10392
|
+
* Safety timer: clears `batchPending` if bar_batch never arrives, so live
|
|
10393
|
+
* ticks resume. It no longer gates the chart reveal.
|
|
10392
10394
|
* Prevents the chart from staying blank when a provider doesn't fire onHistoricalReady.
|
|
10393
10395
|
*/
|
|
10394
10396
|
_batchSafetyTimer = null;
|
|
@@ -10463,9 +10465,7 @@ var DatafeedConnector = class {
|
|
|
10463
10465
|
loadedFired = true;
|
|
10464
10466
|
this._cb.onLoaded(symbol, timeframe, engine.getBars().length);
|
|
10465
10467
|
};
|
|
10466
|
-
|
|
10467
|
-
fireLoaded();
|
|
10468
|
-
}
|
|
10468
|
+
fireLoaded();
|
|
10469
10469
|
const prefetchTo = from;
|
|
10470
10470
|
const prefetchFrom = from - _pageSize(timeframe);
|
|
10471
10471
|
void this._datafeed.getHistoricalBars(symbol, timeframe, prefetchFrom, prefetchTo - 1).then(({ bars: prefetchedBars }) => {
|
|
@@ -10479,8 +10479,7 @@ var DatafeedConnector = class {
|
|
|
10479
10479
|
this._batchSafetyTimer = setTimeout(() => {
|
|
10480
10480
|
batchPending = false;
|
|
10481
10481
|
this._batchSafetyTimer = null;
|
|
10482
|
-
|
|
10483
|
-
}, 6e4);
|
|
10482
|
+
}, BATCH_SUPPRESSION_MS);
|
|
10484
10483
|
}
|
|
10485
10484
|
this._datafeed.subscribeBars(symbol, timeframe, (bar) => {
|
|
10486
10485
|
if (this._activeUID === uid) {
|
|
@@ -21292,60 +21291,64 @@ function ChartContextMenu({
|
|
|
21292
21291
|
onClearIndicators,
|
|
21293
21292
|
onResetView
|
|
21294
21293
|
}) {
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
onClose()
|
|
21299
|
-
|
|
21300
|
-
|
|
21301
|
-
|
|
21302
|
-
|
|
21303
|
-
|
|
21304
|
-
|
|
21305
|
-
|
|
21306
|
-
|
|
21307
|
-
|
|
21308
|
-
|
|
21309
|
-
|
|
21310
|
-
|
|
21311
|
-
|
|
21312
|
-
|
|
21313
|
-
|
|
21314
|
-
"
|
|
21315
|
-
|
|
21316
|
-
|
|
21317
|
-
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21321
|
-
|
|
21322
|
-
|
|
21323
|
-
|
|
21324
|
-
|
|
21325
|
-
|
|
21326
|
-
"
|
|
21327
|
-
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21333
|
-
|
|
21334
|
-
|
|
21335
|
-
|
|
21336
|
-
|
|
21337
|
-
|
|
21338
|
-
|
|
21339
|
-
|
|
21340
|
-
|
|
21341
|
-
|
|
21342
|
-
|
|
21343
|
-
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21294
|
+
if (typeof document === "undefined") return null;
|
|
21295
|
+
return createPortal(
|
|
21296
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21297
|
+
/* @__PURE__ */ jsx("div", { className: "chart-ctx-backdrop", onClick: onClose, onContextMenu: (e) => {
|
|
21298
|
+
e.preventDefault();
|
|
21299
|
+
onClose();
|
|
21300
|
+
} }),
|
|
21301
|
+
/* @__PURE__ */ jsxs("div", { className: "chart-ctx-menu", style: { left: x, top: y }, children: [
|
|
21302
|
+
/* @__PURE__ */ jsx(
|
|
21303
|
+
"button",
|
|
21304
|
+
{
|
|
21305
|
+
className: "chart-ctx-item",
|
|
21306
|
+
onClick: () => {
|
|
21307
|
+
onSettings();
|
|
21308
|
+
onClose();
|
|
21309
|
+
},
|
|
21310
|
+
children: "Settings\u2026"
|
|
21311
|
+
}
|
|
21312
|
+
),
|
|
21313
|
+
/* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
|
|
21314
|
+
/* @__PURE__ */ jsx(
|
|
21315
|
+
"button",
|
|
21316
|
+
{
|
|
21317
|
+
className: "chart-ctx-item",
|
|
21318
|
+
onClick: () => {
|
|
21319
|
+
onResetView();
|
|
21320
|
+
onClose();
|
|
21321
|
+
},
|
|
21322
|
+
children: "Reset Chart View"
|
|
21323
|
+
}
|
|
21324
|
+
),
|
|
21325
|
+
/* @__PURE__ */ jsx("div", { className: "chart-ctx-divider" }),
|
|
21326
|
+
/* @__PURE__ */ jsx(
|
|
21327
|
+
"button",
|
|
21328
|
+
{
|
|
21329
|
+
className: "chart-ctx-item chart-ctx-item--danger",
|
|
21330
|
+
onClick: () => {
|
|
21331
|
+
onClearIndicators();
|
|
21332
|
+
onClose();
|
|
21333
|
+
},
|
|
21334
|
+
children: "Clear Indicators"
|
|
21335
|
+
}
|
|
21336
|
+
),
|
|
21337
|
+
/* @__PURE__ */ jsx(
|
|
21338
|
+
"button",
|
|
21339
|
+
{
|
|
21340
|
+
className: "chart-ctx-item chart-ctx-item--danger",
|
|
21341
|
+
onClick: () => {
|
|
21342
|
+
onClearDrawings();
|
|
21343
|
+
onClose();
|
|
21344
|
+
},
|
|
21345
|
+
children: "Clear Drawings"
|
|
21346
|
+
}
|
|
21347
|
+
)
|
|
21348
|
+
] })
|
|
21349
|
+
] }),
|
|
21350
|
+
document.body
|
|
21351
|
+
);
|
|
21349
21352
|
}
|
|
21350
21353
|
var SECTIONS = [
|
|
21351
21354
|
{ id: "symbol", label: "Symbol", icon: "\u{1D446}" },
|
|
@@ -25523,7 +25526,7 @@ var demonstrationTool = {
|
|
|
25523
25526
|
};
|
|
25524
25527
|
|
|
25525
25528
|
// src/version.ts
|
|
25526
|
-
var FORGECHARTS_VERSION = "1.5.
|
|
25529
|
+
var FORGECHARTS_VERSION = "1.5.49" ;
|
|
25527
25530
|
|
|
25528
25531
|
// src/compatibility.ts
|
|
25529
25532
|
var MIN_KIT_API = 1;
|