@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.
Files changed (46) hide show
  1. package/dist/{DataProvider-DNx9ntBD.d.ts → DataProvider-CNmk84SH.d.cts} +27 -3
  2. package/dist/{DataProvider-Ce6PuCzQ.d.cts → DataProvider-DHX4x6-r.d.ts} +27 -3
  3. package/dist/{chunk-CA3N3PYT.js → chunk-7D6YIF34.js} +2151 -2464
  4. package/dist/{chunk-ZNL2X6U2.js → chunk-7Y7CJ7EN.js} +1 -1
  5. package/dist/{chunk-EMS6PO2T.js → chunk-PN5KWFZ4.js} +6 -1
  6. package/dist/chunk-QHZ7IXFL.js +2598 -0
  7. package/dist/chunk-TP56QRMK.js +503 -0
  8. package/dist/{chunk-7ROONW6H.js → chunk-U5KCQHAC.js} +141 -10
  9. package/dist/{contributions-Dlc7ZWZz.d.cts → contributions-DDpv7hEL.d.cts} +6 -2
  10. package/dist/{contributions-DToMhiw3.d.ts → contributions-ciV6Neyd.d.ts} +6 -2
  11. package/dist/{history-BZADxpKx.d.cts → history-CFqZm5re.d.ts} +21 -3
  12. package/dist/{history-BuHXJZJ2.d.ts → history-ChoT34nz.d.cts} +21 -3
  13. package/dist/index.cjs +3724 -2742
  14. package/dist/index.d.cts +6 -6
  15. package/dist/index.d.ts +6 -6
  16. package/dist/index.js +4 -4
  17. package/dist/{options-BlQ00Fju.d.ts → options-BqGeFHtp.d.cts} +15 -1
  18. package/dist/{options-BlQ00Fju.d.cts → options-BqGeFHtp.d.ts} +15 -1
  19. package/dist/{plugin-BqjEa5r3.d.ts → plugin-C97gUCVf.d.ts} +7 -3
  20. package/dist/{plugin-BNPLOQO1.d.cts → plugin-CSb_sTiN.d.cts} +7 -3
  21. package/dist/plugin.d.cts +4 -4
  22. package/dist/plugin.d.ts +4 -4
  23. package/dist/plugin.js +2 -2
  24. package/dist/providers/binance.d.cts +2 -2
  25. package/dist/providers/binance.d.ts +2 -2
  26. package/dist/providers/coinbase.d.cts +2 -2
  27. package/dist/providers/coinbase.d.ts +2 -2
  28. package/dist/providers/hyperliquid.d.cts +2 -2
  29. package/dist/providers/hyperliquid.d.ts +2 -2
  30. package/dist/ui.cjs +1001 -247
  31. package/dist/ui.d.cts +258 -11
  32. package/dist/ui.d.ts +258 -11
  33. package/dist/ui.js +3 -3
  34. package/dist/vela.global.js +12358 -3961
  35. package/dist/vela.global.min.js +479 -124
  36. package/dist/widget.cjs +3463 -2867
  37. package/dist/widget.d.cts +20 -6
  38. package/dist/widget.d.ts +20 -6
  39. package/dist/widget.js +56 -11
  40. package/dist/workspace.cjs +3137 -2538
  41. package/dist/workspace.d.cts +22 -5
  42. package/dist/workspace.d.ts +22 -5
  43. package/dist/workspace.js +56 -8
  44. package/package.json +1 -1
  45. package/dist/chunk-OGRQW3M6.js +0 -1328
  46. package/dist/chunk-QWIEKZRE.js +0 -1042
@@ -1,9 +1,9 @@
1
- import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend } from './options-BlQ00Fju.cjs';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-BZADxpKx.cjs';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-BZADxpKx.cjs';
1
+ import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BqGeFHtp.cjs';
2
+ import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-ChoT34nz.cjs';
3
+ export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-ChoT34nz.cjs';
4
4
  import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
5
- import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-Dlc7ZWZz.cjs';
6
- import { M as MarketDataFeed } from './DataProvider-Ce6PuCzQ.cjs';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-DDpv7hEL.cjs';
6
+ import { M as MarketDataFeed } from './DataProvider-CNmk84SH.cjs';
7
7
 
8
8
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
9
9
  declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
@@ -35,6 +35,8 @@ interface CellSeed {
35
35
  timeframe?: string;
36
36
  priceStyle?: string;
37
37
  bars?: number;
38
+ /** Trading session to show (markets that have one; `regular` is the default). */
39
+ session?: string;
38
40
  /** Offline bars for this cell — replaces the provider (boot-only). */
39
41
  data?: OHLCV[];
40
42
  /** Initial visible window (boot-only). */
@@ -118,11 +120,15 @@ declare class ChartCell {
118
120
  lastCrossPrice: number | null;
119
121
  /** The bottombar range chip this cell is framed on (null = none). */
120
122
  activeRangeId: string | null;
123
+ /** Latched verdict of {@link sessionAvailable} (async metadata, sticky per symbol). */
124
+ private sessionAvailableFlag;
121
125
  private inner;
122
126
  /** The live app theme — seeded from deps, updated on `theme:changed` (the base the
123
127
  * plot-overlay tokens re-derive from). */
124
128
  private appTheme;
125
129
  private readonly statusline;
130
+ /** Keeps this cell's market badge on the symbol's real calendar (see {@link MarketStatusTracker}). */
131
+ private readonly marketStatus;
126
132
  private readonly watermark;
127
133
  private readonly contextMenu;
128
134
  private readonly offMarket;
@@ -150,6 +156,17 @@ declare class ChartCell {
150
156
  private indicatorValuesOn;
151
157
  private destroyed;
152
158
  constructor(id: string, gridHost: HTMLElement, seed: CellBoot, deps: CellDeps);
159
+ /**
160
+ * Does this cell's market HAVE sessions (RTH/ETH meaningful)? Derived from the
161
+ * symbol's own metadata (`syminfo.session !== '24x7'`), asynchronously — the
162
+ * workspace re-projects the shared bottombar when the verdict lands or changes.
163
+ */
164
+ get sessionAvailable(): boolean;
165
+ /** This cell's shown session (`regular` when unset — the provider default). */
166
+ get session(): MarketSession;
167
+ /** Switch this cell's shown session in place (a reload — RTH and ETH are different bars). */
168
+ setSession(session: MarketSession): void;
169
+ private refreshSessionAvailable;
153
170
  /** Show/hide this cell's symbol watermark (persisted per cell). */
154
171
  setWatermarkVisible(visible: boolean): void;
155
172
  /** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
@@ -1,9 +1,9 @@
1
- import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend } from './options-BlQ00Fju.js';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-BuHXJZJ2.js';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-BuHXJZJ2.js';
1
+ import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BqGeFHtp.js';
2
+ import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-CFqZm5re.js';
3
+ export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-CFqZm5re.js';
4
4
  import { K as KeymapManager } from './keymap-CGOz5F5f.js';
5
- import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-DToMhiw3.js';
6
- import { M as MarketDataFeed } from './DataProvider-DNx9ntBD.js';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-ciV6Neyd.js';
6
+ import { M as MarketDataFeed } from './DataProvider-DHX4x6-r.js';
7
7
 
8
8
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
9
9
  declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
@@ -35,6 +35,8 @@ interface CellSeed {
35
35
  timeframe?: string;
36
36
  priceStyle?: string;
37
37
  bars?: number;
38
+ /** Trading session to show (markets that have one; `regular` is the default). */
39
+ session?: string;
38
40
  /** Offline bars for this cell — replaces the provider (boot-only). */
39
41
  data?: OHLCV[];
40
42
  /** Initial visible window (boot-only). */
@@ -118,11 +120,15 @@ declare class ChartCell {
118
120
  lastCrossPrice: number | null;
119
121
  /** The bottombar range chip this cell is framed on (null = none). */
120
122
  activeRangeId: string | null;
123
+ /** Latched verdict of {@link sessionAvailable} (async metadata, sticky per symbol). */
124
+ private sessionAvailableFlag;
121
125
  private inner;
122
126
  /** The live app theme — seeded from deps, updated on `theme:changed` (the base the
123
127
  * plot-overlay tokens re-derive from). */
124
128
  private appTheme;
125
129
  private readonly statusline;
130
+ /** Keeps this cell's market badge on the symbol's real calendar (see {@link MarketStatusTracker}). */
131
+ private readonly marketStatus;
126
132
  private readonly watermark;
127
133
  private readonly contextMenu;
128
134
  private readonly offMarket;
@@ -150,6 +156,17 @@ declare class ChartCell {
150
156
  private indicatorValuesOn;
151
157
  private destroyed;
152
158
  constructor(id: string, gridHost: HTMLElement, seed: CellBoot, deps: CellDeps);
159
+ /**
160
+ * Does this cell's market HAVE sessions (RTH/ETH meaningful)? Derived from the
161
+ * symbol's own metadata (`syminfo.session !== '24x7'`), asynchronously — the
162
+ * workspace re-projects the shared bottombar when the verdict lands or changes.
163
+ */
164
+ get sessionAvailable(): boolean;
165
+ /** This cell's shown session (`regular` when unset — the provider default). */
166
+ get session(): MarketSession;
167
+ /** Switch this cell's shown session in place (a reload — RTH and ETH are different bars). */
168
+ setSession(session: MarketSession): void;
169
+ private refreshSessionAvailable;
153
170
  /** Show/hide this cell's symbol watermark (persisted per cell). */
154
171
  setWatermarkVisible(visible: boolean): void;
155
172
  /** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
package/dist/workspace.js CHANGED
@@ -1,10 +1,10 @@
1
- import { WidgetHistory, prefixedSymbol, Watermark, Statusline, ChartContextMenu, statuslineInkOf, indicatorLedger, Glider, localStorageAdapter, decodeState, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, Toast, Bottombar, MobileBar, DrawingPill, LayoutModeController, toolShortcutHints, resolveIndicators, sanitizeState, encodeState, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp } from './chunk-7ROONW6H.js';
2
- export { decodeState, encodeState, sanitizeState } from './chunk-7ROONW6H.js';
3
- import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-CA3N3PYT.js';
4
- import { resolveEngines, legendActionsProviderFor, rendererDefaults, widgetActions, widgetAttachments } from './chunk-ZNL2X6U2.js';
5
- import { KeymapManager, Menu, isEditableTarget } from './chunk-QWIEKZRE.js';
6
- import { applyPlotOverlayTokens, ensureUIHost } from './chunk-OGRQW3M6.js';
7
- import { registerIcon, svg16, injectStyles } from './chunk-EMS6PO2T.js';
1
+ import { WidgetHistory, prefixedSymbol, normalizeSession, Watermark, Statusline, MarketStatusTracker, ChartContextMenu, statuslineInkOf, indicatorLedger, Glider, localStorageAdapter, decodeState, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, Toast, Bottombar, MobileBar, DrawingPill, LayoutModeController, toolShortcutHints, resolveIndicators, sanitizeState, encodeState, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp } from './chunk-U5KCQHAC.js';
2
+ export { decodeState, encodeState, sanitizeState } from './chunk-U5KCQHAC.js';
3
+ import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-7D6YIF34.js';
4
+ import { resolveEngines, legendActionsProviderFor, rendererDefaults, widgetActions, widgetAttachments } from './chunk-7Y7CJ7EN.js';
5
+ import { KeymapManager, isEditableTarget } from './chunk-TP56QRMK.js';
6
+ import { applyPlotOverlayTokens, ensureUIHost, Menu } from './chunk-QHZ7IXFL.js';
7
+ import { registerIcon, svg16, injectStyles } from './chunk-PN5KWFZ4.js';
8
8
 
9
9
  // src/workspace/sync.ts
10
10
  function syncTargets(originId, setting, cellIds) {
@@ -39,6 +39,7 @@ function seedDefaults(opts) {
39
39
  timeframe: opts.timeframe,
40
40
  bars: opts.bars,
41
41
  priceStyle: opts.priceStyle,
42
+ session: opts.session,
42
43
  data: opts.data,
43
44
  visibleRange: opts.visibleRange
44
45
  };
@@ -67,6 +68,8 @@ var ChartCell = class {
67
68
  this.lastCrossPrice = null;
68
69
  /** The bottombar range chip this cell is framed on (null = none). */
69
70
  this.activeRangeId = null;
71
+ /** Latched verdict of {@link sessionAvailable} (async metadata, sticky per symbol). */
72
+ this.sessionAvailableFlag = false;
70
73
  this.manifest = [];
71
74
  /** A restored ledger's manifest entry NAMES, waiting for the manifest to resolve
72
75
  * (a pool/persisted cell can be built before the shared manifest has loaded). */
@@ -86,7 +89,7 @@ var ChartCell = class {
86
89
  this.destroyed = false;
87
90
  this.appTheme = deps.theme;
88
91
  const symbol = prefixedSymbol(seed);
89
- this.state = { symbol, provider: parseSymbol(symbol ?? "").provider ?? void 0, timeframe: seed.timeframe, priceStyle: seed.priceStyle, bars: seed.bars };
92
+ this.state = { symbol, provider: parseSymbol(symbol ?? "").provider ?? void 0, timeframe: seed.timeframe, priceStyle: seed.priceStyle, bars: seed.bars, session: normalizeSession(seed.session) };
90
93
  const doc = gridHost.ownerDocument;
91
94
  this.host = doc.createElement("div");
92
95
  this.host.className = "vela-cell";
@@ -103,6 +106,7 @@ var ChartCell = class {
103
106
  timeframe: seed.timeframe,
104
107
  bars: seed.bars,
105
108
  priceStyle: seed.priceStyle,
109
+ session: normalizeSession(seed.session),
106
110
  data: seed.data,
107
111
  visibleRange: seed.visibleRange,
108
112
  theme: deps.theme,
@@ -161,8 +165,11 @@ var ChartCell = class {
161
165
  this.statusline = deps.statusline ? new Statusline(this.host, symbol ?? "") : null;
162
166
  this.statusline?.setMeta(seed.timeframe ?? "60", this.state.provider ?? "");
163
167
  this.statusline?.onChart(this.inner);
168
+ this.marketStatus = this.statusline ? new MarketStatusTracker((s) => this.statusline?.setMarketStatus(s)) : null;
164
169
  void this.inner.data.ready().then(() => {
165
170
  if (this.inner && this.state.symbol) this.statusline?.setMeta(this.state.timeframe ?? "60", this.inner.data.displayPrefix(this.state.symbol) ?? this.state.provider ?? "");
171
+ this.refreshSessionAvailable();
172
+ if (this.inner && this.state.symbol) this.marketStatus?.track(this.inner.data, this.state.symbol);
166
173
  });
167
174
  this.syncStatuslineColors();
168
175
  this.contextMenu = new ChartContextMenu(this.host, {
@@ -284,14 +291,49 @@ var ChartCell = class {
284
291
  this.state.symbol = symbol2;
285
292
  this.state.provider = parseSymbol(symbol2).provider ?? void 0;
286
293
  this.state.timeframe = timeframe;
294
+ this.state.session = normalizeSession(this.inner?.market.session);
287
295
  this.watermark?.update(symbol2, timeframe);
288
296
  this.statusline?.setSymbol(symbol2);
289
297
  this.statusline?.setMeta(timeframe, this.inner?.data.displayPrefix(symbol2) ?? this.state.provider ?? "");
290
298
  if (this.inner) this.statusline?.onChart(this.inner);
291
299
  this.refreshNativeCatalog();
300
+ this.refreshSessionAvailable();
301
+ if (this.inner) this.marketStatus?.track(this.inner.data, symbol2);
292
302
  this.deps.onMarketChanged(this.id);
293
303
  });
294
304
  }
305
+ /**
306
+ * Does this cell's market HAVE sessions (RTH/ETH meaningful)? Derived from the
307
+ * symbol's own metadata (`syminfo.session !== '24x7'`), asynchronously — the
308
+ * workspace re-projects the shared bottombar when the verdict lands or changes.
309
+ */
310
+ get sessionAvailable() {
311
+ return this.sessionAvailableFlag;
312
+ }
313
+ /** This cell's shown session (`regular` when unset — the provider default). */
314
+ get session() {
315
+ return normalizeSession(this.state.session) ?? "regular";
316
+ }
317
+ /** Switch this cell's shown session in place (a reload — RTH and ETH are different bars). */
318
+ setSession(session) {
319
+ if (session === this.session) return;
320
+ this.state.session = session;
321
+ this.deps.onStateDirty();
322
+ void this.inner?.setMarket({ session });
323
+ }
324
+ refreshSessionAvailable() {
325
+ const chart = this.inner;
326
+ const symbol = this.state.symbol;
327
+ if (!chart || !symbol) return;
328
+ void chart.data.symbolInfo(symbol).then((si) => {
329
+ if (this.inner !== chart) return;
330
+ const available = typeof si?.session === "string" && si.session !== "" && si.session !== "24x7";
331
+ if (available !== this.sessionAvailableFlag) {
332
+ this.sessionAvailableFlag = available;
333
+ this.deps.onMarketChanged(this.id);
334
+ }
335
+ });
336
+ }
295
337
  /** Show/hide this cell's symbol watermark (persisted per cell). */
296
338
  setWatermarkVisible(visible) {
297
339
  this.watermarkOn = visible;
@@ -568,6 +610,7 @@ var ChartCell = class {
568
610
  this.offMarket();
569
611
  this.contextMenu.destroy();
570
612
  this.history.destroy();
613
+ this.marketStatus?.stop();
571
614
  this.statusline?.destroy();
572
615
  this.watermark?.destroy();
573
616
  this.inner?.destroy();
@@ -1149,6 +1192,9 @@ var VelaWorkspace = class {
1149
1192
  this.bottombar?.setActiveRange(preset.id);
1150
1193
  },
1151
1194
  onTimezone: (zone) => this.setTimezone(zone),
1195
+ // RTH/ETH acts on the ACTIVE cell (like the range chips): sessions
1196
+ // are a per-chart market dimension, not a shell preference.
1197
+ onSession: (session) => this.active.setSession(session),
1152
1198
  onSettingsClick: () => this.active.chart.renderer.openSettings()
1153
1199
  }) : null;
1154
1200
  this.mobileBar = opts.bottombar !== false ? new MobileBar(this.root, {
@@ -1481,6 +1527,7 @@ var VelaWorkspace = class {
1481
1527
  this.objectTree.setSymbol(cell.symbol);
1482
1528
  this.dock.onChart(cell.chart);
1483
1529
  this.bottombar?.setActiveRange(cell.activeRangeId);
1530
+ this.bottombar?.setSession({ session: cell.session, enabled: cell.sessionAvailable });
1484
1531
  this.indicatorPicker?.sync();
1485
1532
  this.glider.stop();
1486
1533
  const d = cell.chart.drawings;
@@ -1882,6 +1929,7 @@ var VelaWorkspace = class {
1882
1929
  this.mobileBar?.setSymbol(cell.symbol);
1883
1930
  this.mobileBar?.setTimeframe(cell.timeframe);
1884
1931
  this.objectTree.setSymbol(cell.symbol);
1932
+ this.bottombar?.setSession({ session: cell.session, enabled: cell.sessionAvailable });
1885
1933
  }
1886
1934
  /** Trigger ② — a cell's indicator ledger changed: count + picker only if active. */
1887
1935
  onCellIndicatorsChanged(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxalgo/vela",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://luxalgo.com/vela",