@luxalgo/vela 0.6.0 → 0.6.2
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/{DataProvider-DNx9ntBD.d.ts → DataProvider-CNmk84SH.d.cts} +27 -3
- package/dist/{DataProvider-Ce6PuCzQ.d.cts → DataProvider-DHX4x6-r.d.ts} +27 -3
- package/dist/{chunk-CA3N3PYT.js → chunk-7D6YIF34.js} +2151 -2464
- package/dist/{chunk-ZNL2X6U2.js → chunk-7Y7CJ7EN.js} +1 -1
- package/dist/{chunk-EMS6PO2T.js → chunk-PN5KWFZ4.js} +6 -1
- package/dist/chunk-QHZ7IXFL.js +2598 -0
- package/dist/chunk-TP56QRMK.js +503 -0
- package/dist/{chunk-7ROONW6H.js → chunk-U5KCQHAC.js} +141 -10
- package/dist/{contributions-Dlc7ZWZz.d.cts → contributions-DDpv7hEL.d.cts} +6 -2
- package/dist/{contributions-DToMhiw3.d.ts → contributions-ciV6Neyd.d.ts} +6 -2
- package/dist/{history-BZADxpKx.d.cts → history-CFqZm5re.d.ts} +21 -3
- package/dist/{history-BuHXJZJ2.d.ts → history-ChoT34nz.d.cts} +21 -3
- package/dist/index.cjs +3724 -2742
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/{options-BlQ00Fju.d.ts → options-BqGeFHtp.d.cts} +15 -1
- package/dist/{options-BlQ00Fju.d.cts → options-BqGeFHtp.d.ts} +15 -1
- package/dist/{plugin-BqjEa5r3.d.ts → plugin-C97gUCVf.d.ts} +7 -3
- package/dist/{plugin-BNPLOQO1.d.cts → plugin-CSb_sTiN.d.cts} +7 -3
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/ui.cjs +1001 -247
- package/dist/ui.d.cts +258 -11
- package/dist/ui.d.ts +258 -11
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +12358 -3961
- package/dist/vela.global.min.js +479 -124
- package/dist/widget.cjs +3463 -2867
- package/dist/widget.d.cts +20 -6
- package/dist/widget.d.ts +20 -6
- package/dist/widget.js +56 -11
- package/dist/workspace.cjs +3137 -2538
- package/dist/workspace.d.cts +22 -5
- package/dist/workspace.d.ts +22 -5
- package/dist/workspace.js +56 -8
- package/package.json +1 -1
- package/dist/chunk-OGRQW3M6.js +0 -1328
- package/dist/chunk-QWIEKZRE.js +0 -1042
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, TIMEZONES, normalizeTimezone, tzMenuLabel } from './chunk-
|
|
2
|
-
import { chartType, widgetActions, SidePanel, sidePanels, DEFAULT_PANEL_ORDER, getDrawingType } from './chunk-
|
|
3
|
-
import { Tooltip,
|
|
4
|
-
import {
|
|
1
|
+
import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, TIMEZONES, normalizeTimezone, tzMenuLabel } from './chunk-7D6YIF34.js';
|
|
2
|
+
import { chartType, widgetActions, SidePanel, sidePanels, DEFAULT_PANEL_ORDER, getDrawingType } from './chunk-7Y7CJ7EN.js';
|
|
3
|
+
import { Tooltip, Drawer } from './chunk-TP56QRMK.js';
|
|
4
|
+
import { Menu, Dialog } from './chunk-QHZ7IXFL.js';
|
|
5
|
+
import { iconMarkup, registerIcon, injectStyles, iconEl, SESSION_PRE, SESSION_POST, SESSION_OFF, icon, categoricalColor } from './chunk-PN5KWFZ4.js';
|
|
5
6
|
|
|
6
7
|
// src/widget/timeframe.ts
|
|
7
8
|
var UNIT_MS = {
|
|
@@ -1468,10 +1469,12 @@ var CSS5 = `
|
|
|
1468
1469
|
color: var(--vela-fg-muted);
|
|
1469
1470
|
font-size: 11px;
|
|
1470
1471
|
font-weight: 600;
|
|
1471
|
-
cursor:
|
|
1472
|
-
opacity: 0.55;
|
|
1472
|
+
cursor: pointer;
|
|
1473
1473
|
}
|
|
1474
|
-
.vela-bb-session-btn
|
|
1474
|
+
.vela-bb-session-btn:disabled { cursor: not-allowed; opacity: 0.55; }
|
|
1475
|
+
.vela-bb-session-btn:not(:disabled):hover { background: var(--vela-hover); color: var(--vela-fg-bright); }
|
|
1476
|
+
.vela-bb-session-btn.is-active { color: var(--vela-fg); background: var(--vela-surface-elev); }
|
|
1477
|
+
.vela-bb-session-btn.is-active:disabled { opacity: 0.8; }
|
|
1475
1478
|
.vela-bb-settings {
|
|
1476
1479
|
all: unset;
|
|
1477
1480
|
display: inline-flex;
|
|
@@ -1491,6 +1494,8 @@ var Bottombar = class {
|
|
|
1491
1494
|
constructor(host, opts) {
|
|
1492
1495
|
this.settingsTip = null;
|
|
1493
1496
|
this.rangeButtons = /* @__PURE__ */ new Map();
|
|
1497
|
+
this.sessionButtons = /* @__PURE__ */ new Map();
|
|
1498
|
+
this.sessionEl = null;
|
|
1494
1499
|
this.timer = null;
|
|
1495
1500
|
this.timezone = opts.timezone;
|
|
1496
1501
|
const doc = host.ownerDocument;
|
|
@@ -1520,12 +1525,19 @@ var Bottombar = class {
|
|
|
1520
1525
|
this.tzButton.append(this.clockEl, this.tzLabelEl);
|
|
1521
1526
|
const session = doc.createElement("span");
|
|
1522
1527
|
session.className = "vela-bb-session";
|
|
1528
|
+
this.sessionEl = session;
|
|
1523
1529
|
session.title = "Session \u2014 stocks & ETFs only";
|
|
1524
|
-
for (const [
|
|
1530
|
+
for (const [key, label] of [["regular", "RTH"], ["extended", "ETH"]]) {
|
|
1525
1531
|
const b = doc.createElement("button");
|
|
1526
|
-
b.className = "vela-bb-session-btn" + (
|
|
1532
|
+
b.className = "vela-bb-session-btn" + (key === "regular" ? " is-active" : "");
|
|
1527
1533
|
b.textContent = label;
|
|
1528
1534
|
b.disabled = true;
|
|
1535
|
+
b.addEventListener("click", () => {
|
|
1536
|
+
if (b.disabled) return;
|
|
1537
|
+
this.setSession({ session: key, enabled: true });
|
|
1538
|
+
opts.onSession?.(key);
|
|
1539
|
+
});
|
|
1540
|
+
this.sessionButtons.set(key, b);
|
|
1529
1541
|
session.appendChild(b);
|
|
1530
1542
|
}
|
|
1531
1543
|
const settingsBtn = doc.createElement("button");
|
|
@@ -1563,6 +1575,19 @@ var Bottombar = class {
|
|
|
1563
1575
|
else delete b.dataset.active;
|
|
1564
1576
|
}
|
|
1565
1577
|
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Reflect the ACTIVE chart's session posture. `enabled: false` (a continuous
|
|
1580
|
+
* market, or metadata not landed yet) shows the disabled RTH-active stub — the
|
|
1581
|
+
* pre-session-model look, byte-for-byte. Enabled, the chips become clickable and
|
|
1582
|
+
* the active one tracks the chart's current session.
|
|
1583
|
+
*/
|
|
1584
|
+
setSession(state) {
|
|
1585
|
+
if (this.sessionEl) this.sessionEl.title = state.enabled ? "Session \u2014 regular (RTH) vs extended (ETH) hours" : "Session \u2014 stocks & ETFs only";
|
|
1586
|
+
for (const [key, b] of this.sessionButtons) {
|
|
1587
|
+
b.disabled = !state.enabled;
|
|
1588
|
+
b.classList.toggle("is-active", state.enabled ? key === state.session : key === "regular");
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1566
1591
|
destroy() {
|
|
1567
1592
|
if (this.timer !== null) clearInterval(this.timer);
|
|
1568
1593
|
this.tzMenu.destroy();
|
|
@@ -4266,6 +4291,7 @@ function sanitizeCell(raw) {
|
|
|
4266
4291
|
if (typeof c.timeframe === "string") out.timeframe = c.timeframe;
|
|
4267
4292
|
if (typeof c.priceStyle === "string") out.priceStyle = c.priceStyle;
|
|
4268
4293
|
if (typeof c.bars === "number" && Number.isFinite(c.bars) && c.bars > 0) out.bars = c.bars;
|
|
4294
|
+
if (c.session === "regular" || c.session === "extended") out.session = c.session;
|
|
4269
4295
|
if (typeof c.watermark === "boolean") out.watermark = c.watermark;
|
|
4270
4296
|
if (typeof c.indicatorTitles === "boolean") out.indicatorTitles = c.indicatorTitles;
|
|
4271
4297
|
if (typeof c.indicatorValues === "boolean") out.indicatorValues = c.indicatorValues;
|
|
@@ -4375,6 +4401,111 @@ function indicatorLedger(i) {
|
|
|
4375
4401
|
};
|
|
4376
4402
|
}
|
|
4377
4403
|
|
|
4404
|
+
// src/core/options.ts
|
|
4405
|
+
var normalizeSession = (v) => v === "regular" || v === "extended" ? v : void 0;
|
|
4406
|
+
|
|
4407
|
+
// src/widget/market-status.ts
|
|
4408
|
+
function civilDate(ms, tz) {
|
|
4409
|
+
try {
|
|
4410
|
+
return new Intl.DateTimeFormat("en-CA", { timeZone: tz }).format(ms);
|
|
4411
|
+
} catch {
|
|
4412
|
+
return "";
|
|
4413
|
+
}
|
|
4414
|
+
}
|
|
4415
|
+
function isWeekday(ms, tz) {
|
|
4416
|
+
try {
|
|
4417
|
+
const wd = new Intl.DateTimeFormat("en-US", { timeZone: tz, weekday: "short" }).format(ms);
|
|
4418
|
+
return wd !== "Sat" && wd !== "Sun";
|
|
4419
|
+
} catch {
|
|
4420
|
+
return false;
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
function deriveMarketStatus(now, w, tz) {
|
|
4424
|
+
const within = (ws) => ws.find(([s, e]) => now >= s && now < e);
|
|
4425
|
+
if (within(w.regular)) return "open";
|
|
4426
|
+
const ext = within(w.extended);
|
|
4427
|
+
if (ext) return w.regular.some(([s]) => s >= now && s < ext[1]) ? "pre" : "post";
|
|
4428
|
+
if (isWeekday(now, tz)) {
|
|
4429
|
+
const today = civilDate(now, tz);
|
|
4430
|
+
if (today !== "" && !w.extended.some(([s]) => civilDate(s, tz) === today)) return "holiday";
|
|
4431
|
+
}
|
|
4432
|
+
return "closed";
|
|
4433
|
+
}
|
|
4434
|
+
function nextStatusBoundary(now, w) {
|
|
4435
|
+
let next = null;
|
|
4436
|
+
for (const ws of [w.regular, w.extended]) {
|
|
4437
|
+
for (const [s, e] of ws) {
|
|
4438
|
+
for (const t of [s, e]) {
|
|
4439
|
+
if (t > now && (next == null || t < next)) next = t;
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
return next;
|
|
4444
|
+
}
|
|
4445
|
+
var FETCH_BACK_MS = 4 * 864e5;
|
|
4446
|
+
var FETCH_AHEAD_MS = 10 * 864e5;
|
|
4447
|
+
var MIN_TIMER_MS = 15e3;
|
|
4448
|
+
var MAX_TIMER_MS = 36e5;
|
|
4449
|
+
var RETRY_MS = 6e4;
|
|
4450
|
+
var MarketStatusTracker = class {
|
|
4451
|
+
constructor(onStatus) {
|
|
4452
|
+
this.onStatus = onStatus;
|
|
4453
|
+
/** Invalidates detached async work — bumped by every track()/stop(). */
|
|
4454
|
+
this.epoch = 0;
|
|
4455
|
+
this.timer = null;
|
|
4456
|
+
}
|
|
4457
|
+
/** (Re)bind to a chart's data surface + symbol and start evaluating. */
|
|
4458
|
+
track(data, symbol) {
|
|
4459
|
+
const my = ++this.epoch;
|
|
4460
|
+
this.clearTimer();
|
|
4461
|
+
void this.evaluate(my, data, symbol);
|
|
4462
|
+
}
|
|
4463
|
+
stop() {
|
|
4464
|
+
this.epoch += 1;
|
|
4465
|
+
this.clearTimer();
|
|
4466
|
+
}
|
|
4467
|
+
async evaluate(my, data, symbol) {
|
|
4468
|
+
const resolved = data.resolve(symbol);
|
|
4469
|
+
const provider = resolved ? data.providerInstance(resolved.provider) : void 0;
|
|
4470
|
+
const si = await data.symbolInfo(symbol).catch(() => void 0);
|
|
4471
|
+
if (my !== this.epoch) return;
|
|
4472
|
+
const hasSessions = typeof si?.session === "string" && si.session !== "" && si.session !== "24x7";
|
|
4473
|
+
if (!provider?.getCalendar || !hasSessions || !resolved) {
|
|
4474
|
+
this.onStatus("open");
|
|
4475
|
+
return;
|
|
4476
|
+
}
|
|
4477
|
+
const tz = typeof si?.timezone === "string" && si.timezone !== "" ? si.timezone : "Etc/UTC";
|
|
4478
|
+
const now = Date.now();
|
|
4479
|
+
const range = { from: now - FETCH_BACK_MS, to: now + FETCH_AHEAD_MS };
|
|
4480
|
+
const [regular, extended] = await Promise.all([
|
|
4481
|
+
provider.getCalendar(resolved.ticker, { ...range, session: "regular" }).catch(() => null),
|
|
4482
|
+
provider.getCalendar(resolved.ticker, { ...range, session: "extended" }).catch(() => null)
|
|
4483
|
+
]);
|
|
4484
|
+
if (my !== this.epoch) return;
|
|
4485
|
+
if (!regular || !extended) {
|
|
4486
|
+
this.arm(my, data, symbol, RETRY_MS);
|
|
4487
|
+
return;
|
|
4488
|
+
}
|
|
4489
|
+
const w = { regular, extended };
|
|
4490
|
+
this.onStatus(deriveMarketStatus(now, w, tz));
|
|
4491
|
+
const boundary = nextStatusBoundary(now, w);
|
|
4492
|
+
const delay = Math.min(boundary != null ? boundary - now : MAX_TIMER_MS, MAX_TIMER_MS);
|
|
4493
|
+
this.arm(my, data, symbol, Math.max(delay, MIN_TIMER_MS));
|
|
4494
|
+
}
|
|
4495
|
+
arm(my, data, symbol, delay) {
|
|
4496
|
+
this.clearTimer();
|
|
4497
|
+
this.timer = setTimeout(() => {
|
|
4498
|
+
this.timer = null;
|
|
4499
|
+
if (my !== this.epoch) return;
|
|
4500
|
+
void this.evaluate(my, data, symbol);
|
|
4501
|
+
}, delay);
|
|
4502
|
+
}
|
|
4503
|
+
clearTimer() {
|
|
4504
|
+
if (this.timer != null) clearTimeout(this.timer);
|
|
4505
|
+
this.timer = null;
|
|
4506
|
+
}
|
|
4507
|
+
};
|
|
4508
|
+
|
|
4378
4509
|
// src/widget/layout-mode.ts
|
|
4379
4510
|
var MOBILE_BREAKPOINT_PX = 640;
|
|
4380
4511
|
var COARSE_BREAKPOINT_PX = 920;
|
|
@@ -5741,4 +5872,4 @@ var Toast = class {
|
|
|
5741
5872
|
}
|
|
5742
5873
|
};
|
|
5743
5874
|
|
|
5744
|
-
export { Bottombar, ChartContextMenu, DataWindow, DrawingPill, DrawingsDrawer, Glider, IndicatorPicker, LayoutModeController, MobileBar, MoreDrawer, ObjectTree, PAN_FAST, PanelDock, PriceScaleDrawer, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeDrawer, TimeframeQuick, TimezoneDrawer, Toast, Topbar, Watermark, WidgetHistory, ZOOM_IN, ZOOM_OUT, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, indicatorLedger, legacyWidgetState, loadPersisted, localStorageAdapter, parsePersisted, parseTimeframe, prefixedSymbol, priceStyleIcon, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, statuslineInkOf, timeframeLabel, timeframeMs, toolShortcutHints };
|
|
5875
|
+
export { Bottombar, ChartContextMenu, DataWindow, DrawingPill, DrawingsDrawer, Glider, IndicatorPicker, LayoutModeController, MarketStatusTracker, MobileBar, MoreDrawer, ObjectTree, PAN_FAST, PanelDock, PriceScaleDrawer, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeDrawer, TimeframeQuick, TimezoneDrawer, Toast, Topbar, Watermark, WidgetHistory, ZOOM_IN, ZOOM_OUT, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, indicatorLedger, legacyWidgetState, loadPersisted, localStorageAdapter, normalizeSession, parsePersisted, parseTimeframe, prefixedSymbol, priceStyleIcon, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, statuslineInkOf, timeframeLabel, timeframeMs, toolShortcutHints };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-
|
|
1
|
+
import { t as Millis, ad as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, az as SeriesSpec, aa as Fill, B as Background, ar as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aL as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, an as MarketSwitch, am as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BqGeFHtp.cjs';
|
|
2
|
+
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-CNmk84SH.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -398,6 +398,10 @@ interface NativeIndicatorContext {
|
|
|
398
398
|
readonly symbol: string;
|
|
399
399
|
readonly timeframe: string;
|
|
400
400
|
readonly live: boolean;
|
|
401
|
+
/** The chart's trading session (`'regular'` | `'extended'`); undefined = regular /
|
|
402
|
+
* no session model. A session switch reloads the market and RESTARTS the
|
|
403
|
+
* indicator, so this never changes within one context's lifetime. */
|
|
404
|
+
readonly session?: string;
|
|
401
405
|
/** The canonical bar array (a live accessor — always current). */
|
|
402
406
|
bars(): readonly OHLCV[];
|
|
403
407
|
/** Market-data access (trades / capabilities) for data-driven natives. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-
|
|
1
|
+
import { t as Millis, ad as InputSchema, ac as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, az as SeriesSpec, aa as Fill, B as Background, ar as PriceLine, a0 as DrawingLine, Y as DrawingBox, $ as DrawingLabel, a4 as DrawingPolyline, a1 as DrawingLinefill, a6 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, v as DrawingTypeKey, u as SnapMode, a2 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, r as DataWindowReadout, n as SymbolPickerFn, aL as PaneInfo, a9 as DrawingsOption, D as Drawing, b as VelaOptions, x as AddIndicatorOptions, an as MarketSwitch, am as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BqGeFHtp.js';
|
|
2
|
+
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-DHX4x6-r.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -398,6 +398,10 @@ interface NativeIndicatorContext {
|
|
|
398
398
|
readonly symbol: string;
|
|
399
399
|
readonly timeframe: string;
|
|
400
400
|
readonly live: boolean;
|
|
401
|
+
/** The chart's trading session (`'regular'` | `'extended'`); undefined = regular /
|
|
402
|
+
* no session model. A session switch reloads the market and RESTARTS the
|
|
403
|
+
* indicator, so this never changes within one context's lifetime. */
|
|
404
|
+
readonly session?: string;
|
|
401
405
|
/** The canonical bar array (a live accessor — always current). */
|
|
402
406
|
bars(): readonly OHLCV[];
|
|
403
407
|
/** Market-data access (trades / capabilities) for data-driven natives. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { V as VisibleRangePreset } from './options-
|
|
2
|
-
import { D as DataProvider } from './DataProvider-
|
|
3
|
-
import { S as ScriptingEngine, V as Vela } from './contributions-
|
|
1
|
+
import { V as VisibleRangePreset } from './options-BqGeFHtp.js';
|
|
2
|
+
import { D as DataProvider } from './DataProvider-DHX4x6-r.js';
|
|
3
|
+
import { S as ScriptingEngine, V as Vela } from './contributions-ciV6Neyd.js';
|
|
4
4
|
|
|
5
5
|
interface RangePreset {
|
|
6
6
|
/** Button label. */
|
|
@@ -27,6 +27,8 @@ interface BottombarOptions {
|
|
|
27
27
|
timezone: string;
|
|
28
28
|
onRange: (preset: RangePreset) => void;
|
|
29
29
|
onTimezone: (zone: string) => void;
|
|
30
|
+
/** RTH/ETH toggled by the user. Fires only while the toggle is ENABLED (see {@link Bottombar.setSession}). */
|
|
31
|
+
onSession?: (session: 'regular' | 'extended') => void;
|
|
30
32
|
onSettingsClick?: () => void;
|
|
31
33
|
}
|
|
32
34
|
declare class Bottombar {
|
|
@@ -37,12 +39,24 @@ declare class Bottombar {
|
|
|
37
39
|
private readonly tzMenu;
|
|
38
40
|
private readonly settingsTip;
|
|
39
41
|
private readonly rangeButtons;
|
|
42
|
+
private readonly sessionButtons;
|
|
43
|
+
private sessionEl;
|
|
40
44
|
private timezone;
|
|
41
45
|
private timer;
|
|
42
46
|
constructor(host: HTMLElement, opts: BottombarOptions);
|
|
43
47
|
setTimezone(zone: string): void;
|
|
44
48
|
/** Highlight (or clear with null) the active range chip — cleared on manual tf changes. */
|
|
45
49
|
setActiveRange(id: string | null): void;
|
|
50
|
+
/**
|
|
51
|
+
* Reflect the ACTIVE chart's session posture. `enabled: false` (a continuous
|
|
52
|
+
* market, or metadata not landed yet) shows the disabled RTH-active stub — the
|
|
53
|
+
* pre-session-model look, byte-for-byte. Enabled, the chips become clickable and
|
|
54
|
+
* the active one tracks the chart's current session.
|
|
55
|
+
*/
|
|
56
|
+
setSession(state: {
|
|
57
|
+
session: 'regular' | 'extended';
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
}): void;
|
|
46
60
|
destroy(): void;
|
|
47
61
|
private tzItems;
|
|
48
62
|
private tick;
|
|
@@ -130,6 +144,8 @@ interface CellState {
|
|
|
130
144
|
timeframe?: string;
|
|
131
145
|
priceStyle?: string;
|
|
132
146
|
bars?: number;
|
|
147
|
+
/** Trading session shown (`'extended'` persisted; absent = regular, the default). */
|
|
148
|
+
session?: string;
|
|
133
149
|
/** Symbol watermark visibility — a per-chart display pref. */
|
|
134
150
|
watermark?: boolean;
|
|
135
151
|
/** Indicator titles (the in-chart legend rows) visibility — a per-chart display pref. */
|
|
@@ -212,6 +228,8 @@ interface PersistedState {
|
|
|
212
228
|
priceStyle?: string;
|
|
213
229
|
timezone?: string;
|
|
214
230
|
bars?: string;
|
|
231
|
+
/** Trading session (`regular` | `extended`) — URL param `session`. */
|
|
232
|
+
session?: string;
|
|
215
233
|
watermark?: string;
|
|
216
234
|
/** Comma-joined favorite drawing-tool types. */
|
|
217
235
|
favorites?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { V as VisibleRangePreset } from './options-
|
|
2
|
-
import { D as DataProvider } from './DataProvider-
|
|
3
|
-
import { S as ScriptingEngine, V as Vela } from './contributions-
|
|
1
|
+
import { V as VisibleRangePreset } from './options-BqGeFHtp.cjs';
|
|
2
|
+
import { D as DataProvider } from './DataProvider-CNmk84SH.cjs';
|
|
3
|
+
import { S as ScriptingEngine, V as Vela } from './contributions-DDpv7hEL.cjs';
|
|
4
4
|
|
|
5
5
|
interface RangePreset {
|
|
6
6
|
/** Button label. */
|
|
@@ -27,6 +27,8 @@ interface BottombarOptions {
|
|
|
27
27
|
timezone: string;
|
|
28
28
|
onRange: (preset: RangePreset) => void;
|
|
29
29
|
onTimezone: (zone: string) => void;
|
|
30
|
+
/** RTH/ETH toggled by the user. Fires only while the toggle is ENABLED (see {@link Bottombar.setSession}). */
|
|
31
|
+
onSession?: (session: 'regular' | 'extended') => void;
|
|
30
32
|
onSettingsClick?: () => void;
|
|
31
33
|
}
|
|
32
34
|
declare class Bottombar {
|
|
@@ -37,12 +39,24 @@ declare class Bottombar {
|
|
|
37
39
|
private readonly tzMenu;
|
|
38
40
|
private readonly settingsTip;
|
|
39
41
|
private readonly rangeButtons;
|
|
42
|
+
private readonly sessionButtons;
|
|
43
|
+
private sessionEl;
|
|
40
44
|
private timezone;
|
|
41
45
|
private timer;
|
|
42
46
|
constructor(host: HTMLElement, opts: BottombarOptions);
|
|
43
47
|
setTimezone(zone: string): void;
|
|
44
48
|
/** Highlight (or clear with null) the active range chip — cleared on manual tf changes. */
|
|
45
49
|
setActiveRange(id: string | null): void;
|
|
50
|
+
/**
|
|
51
|
+
* Reflect the ACTIVE chart's session posture. `enabled: false` (a continuous
|
|
52
|
+
* market, or metadata not landed yet) shows the disabled RTH-active stub — the
|
|
53
|
+
* pre-session-model look, byte-for-byte. Enabled, the chips become clickable and
|
|
54
|
+
* the active one tracks the chart's current session.
|
|
55
|
+
*/
|
|
56
|
+
setSession(state: {
|
|
57
|
+
session: 'regular' | 'extended';
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
}): void;
|
|
46
60
|
destroy(): void;
|
|
47
61
|
private tzItems;
|
|
48
62
|
private tick;
|
|
@@ -130,6 +144,8 @@ interface CellState {
|
|
|
130
144
|
timeframe?: string;
|
|
131
145
|
priceStyle?: string;
|
|
132
146
|
bars?: number;
|
|
147
|
+
/** Trading session shown (`'extended'` persisted; absent = regular, the default). */
|
|
148
|
+
session?: string;
|
|
133
149
|
/** Symbol watermark visibility — a per-chart display pref. */
|
|
134
150
|
watermark?: boolean;
|
|
135
151
|
/** Indicator titles (the in-chart legend rows) visibility — a per-chart display pref. */
|
|
@@ -212,6 +228,8 @@ interface PersistedState {
|
|
|
212
228
|
priceStyle?: string;
|
|
213
229
|
timezone?: string;
|
|
214
230
|
bars?: string;
|
|
231
|
+
/** Trading session (`regular` | `extended`) — URL param `session`. */
|
|
232
|
+
session?: string;
|
|
215
233
|
watermark?: string;
|
|
216
234
|
/** Comma-joined favorite drawing-tool types. */
|
|
217
235
|
favorites?: string;
|