@forgecharts/sdk 1.5.71 → 1.5.72
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/react/index.js +34 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +34 -3
- package/dist/react/internal.js.map +1 -1
- package/dist/react/shell/useWatchlistQuotes.d.ts +12 -0
- package/dist/react/shell/useWatchlistQuotes.d.ts.map +1 -1
- package/dist/react/workspace/ChartWorkspace.d.ts +12 -1
- package/dist/react/workspace/ChartWorkspace.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -18144,7 +18144,7 @@ var DEMONSTRATION_STROKE = "rgba(255, 200, 50, 0.7)";
|
|
|
18144
18144
|
var DEMONSTRATION_COLOR = "var(--crosshair-overlay, rgba(255,255,255,0.75))";
|
|
18145
18145
|
|
|
18146
18146
|
// src/version.ts
|
|
18147
|
-
var FORGECHARTS_VERSION = "1.5.
|
|
18147
|
+
var FORGECHARTS_VERSION = "1.5.72" ;
|
|
18148
18148
|
function applyRuntimeConfig(caps, config) {
|
|
18149
18149
|
if (!config) return caps;
|
|
18150
18150
|
const orderEntry = config.enableOrderEntry === false ? false : caps.orderEntry;
|
|
@@ -18371,11 +18371,19 @@ var _listeners = /* @__PURE__ */ new Set();
|
|
|
18371
18371
|
var _subscribed = /* @__PURE__ */ new Set();
|
|
18372
18372
|
var _reconnectTimer = null;
|
|
18373
18373
|
var _authToken = null;
|
|
18374
|
+
var _baseUrl = null;
|
|
18374
18375
|
function setWsAuthToken(token) {
|
|
18375
18376
|
_authToken = token;
|
|
18376
18377
|
}
|
|
18378
|
+
function setWsBaseUrl(url) {
|
|
18379
|
+
if (!url) {
|
|
18380
|
+
_baseUrl = null;
|
|
18381
|
+
return;
|
|
18382
|
+
}
|
|
18383
|
+
_baseUrl = url.replace(/\/$/, "").replace(/^http/, "ws");
|
|
18384
|
+
}
|
|
18377
18385
|
function _wsUrl() {
|
|
18378
|
-
const base = typeof window === "undefined" ? "ws://localhost:4001/ws" : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws
|
|
18386
|
+
const base = _baseUrl ?? (typeof window === "undefined" ? "ws://localhost:4001/ws" : `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`);
|
|
18379
18387
|
return _authToken ? `${base}?token=${encodeURIComponent(_authToken)}` : base;
|
|
18380
18388
|
}
|
|
18381
18389
|
function _send(msg) {
|
|
@@ -31293,6 +31301,8 @@ function ChartWorkspace({
|
|
|
31293
31301
|
symbolResolver,
|
|
31294
31302
|
rollRule,
|
|
31295
31303
|
onRollRuleChange,
|
|
31304
|
+
quotesWsUrl,
|
|
31305
|
+
getQuotesAuthToken,
|
|
31296
31306
|
extraTfGroups,
|
|
31297
31307
|
// RightToolbar
|
|
31298
31308
|
watchlistOpen,
|
|
@@ -31349,6 +31359,27 @@ function ChartWorkspace({
|
|
|
31349
31359
|
tradingBridge,
|
|
31350
31360
|
tradingOverlayStore
|
|
31351
31361
|
}) {
|
|
31362
|
+
const [quotesReady, setQuotesReady] = React11.useState(false);
|
|
31363
|
+
React11.useEffect(() => {
|
|
31364
|
+
let cancelled = false;
|
|
31365
|
+
if (!quotesWsUrl || !getQuotesAuthToken) {
|
|
31366
|
+
setQuotesReady(false);
|
|
31367
|
+
return void 0;
|
|
31368
|
+
}
|
|
31369
|
+
void (async () => {
|
|
31370
|
+
try {
|
|
31371
|
+
const token = await getQuotesAuthToken();
|
|
31372
|
+
if (cancelled) return;
|
|
31373
|
+
setWsAuthToken(token || null);
|
|
31374
|
+
setWsBaseUrl(quotesWsUrl);
|
|
31375
|
+
setQuotesReady(true);
|
|
31376
|
+
} catch {
|
|
31377
|
+
}
|
|
31378
|
+
})();
|
|
31379
|
+
return () => {
|
|
31380
|
+
cancelled = true;
|
|
31381
|
+
};
|
|
31382
|
+
}, [quotesWsUrl, getQuotesAuthToken]);
|
|
31352
31383
|
const capabilities = useChartCapabilities();
|
|
31353
31384
|
const dataBlocked = useLicenseDataBlocked();
|
|
31354
31385
|
useHostLicense(hostApiUrl, getAuthToken);
|
|
@@ -31529,7 +31560,7 @@ function ChartWorkspace({
|
|
|
31529
31560
|
onClose: closeWatchlist,
|
|
31530
31561
|
onSelectSymbol: onSymbolChange,
|
|
31531
31562
|
symbolResolver,
|
|
31532
|
-
liveQuotes:
|
|
31563
|
+
liveQuotes: quotesReady,
|
|
31533
31564
|
...hostApiUrl !== void 0 ? { apiUrl: hostApiUrl } : {},
|
|
31534
31565
|
...getAuthToken !== void 0 ? { getAuthToken } : {}
|
|
31535
31566
|
}
|