@luxalgo/vela 0.6.3 → 0.6.4

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 (45) hide show
  1. package/dist/{DataProvider-DHX4x6-r.d.ts → DataProvider-BmHkcwvJ.d.ts} +1 -1
  2. package/dist/{DataProvider-CNmk84SH.d.cts → DataProvider-DrN7ZIou.d.cts} +1 -1
  3. package/dist/{chunk-TP56QRMK.js → chunk-2R7BANEM.js} +1 -1
  4. package/dist/{chunk-U5KCQHAC.js → chunk-3QX6QOCX.js} +80 -12
  5. package/dist/{chunk-7D6YIF34.js → chunk-6FA4TDUF.js} +325 -67
  6. package/dist/{chunk-7Y7CJ7EN.js → chunk-BEJ57HP4.js} +8 -1
  7. package/dist/{chunk-QHZ7IXFL.js → chunk-OICPLNU7.js} +59 -9
  8. package/dist/{contributions-DDpv7hEL.d.cts → contributions-2bEmCF9S.d.cts} +2 -2
  9. package/dist/{contributions-ciV6Neyd.d.ts → contributions-DatoAzMx.d.ts} +2 -2
  10. package/dist/{history-CFqZm5re.d.ts → history-BmyjaVir.d.cts} +6 -6
  11. package/dist/{history-ChoT34nz.d.cts → history-CvOtsjT5.d.ts} +6 -6
  12. package/dist/index.cjs +394 -78
  13. package/dist/index.d.cts +36 -9
  14. package/dist/index.d.ts +36 -9
  15. package/dist/index.js +4 -4
  16. package/dist/{options-BqGeFHtp.d.ts → options-YdiaaVjt.d.cts} +20 -1
  17. package/dist/{options-BqGeFHtp.d.cts → options-YdiaaVjt.d.ts} +20 -1
  18. package/dist/{plugin-C97gUCVf.d.ts → plugin-BeCMF1VQ.d.ts} +3 -3
  19. package/dist/{plugin-CSb_sTiN.d.cts → plugin-CkiStRaI.d.cts} +3 -3
  20. package/dist/plugin.cjs +8 -0
  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 +59 -9
  31. package/dist/ui.d.cts +10 -2
  32. package/dist/ui.d.ts +10 -2
  33. package/dist/ui.js +2 -2
  34. package/dist/vela.global.js +394 -78
  35. package/dist/vela.global.min.js +84 -47
  36. package/dist/widget.cjs +646 -191
  37. package/dist/widget.d.cts +29 -8
  38. package/dist/widget.d.ts +29 -8
  39. package/dist/widget.js +145 -73
  40. package/dist/workspace.cjs +601 -142
  41. package/dist/workspace.d.cts +29 -5
  42. package/dist/workspace.d.ts +29 -5
  43. package/dist/workspace.js +143 -67
  44. package/package.json +1 -1
  45. /package/dist/{chunk-Q3XQHLIH.js → chunk-AOGZBKUE.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-BqGeFHtp.js';
1
+ import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-YdiaaVjt.js';
2
2
 
3
3
  /**
4
4
  * Symbol metadata an engine may need (e.g. Pine `syminfo.*`). Free-form beyond
@@ -1,4 +1,4 @@
1
- import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-BqGeFHtp.cjs';
1
+ import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-YdiaaVjt.cjs';
2
2
 
3
3
  /**
4
4
  * Symbol metadata an engine may need (e.g. Pine `syminfo.*`). Free-form beyond
@@ -1,4 +1,4 @@
1
- import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-QHZ7IXFL.js';
1
+ import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-OICPLNU7.js';
2
2
  import { injectStyles } from './chunk-PN5KWFZ4.js';
3
3
  import * as tooltip from '@zag-js/tooltip';
4
4
  import * as dialog from '@zag-js/dialog';
@@ -1,7 +1,7 @@
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';
1
+ import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, TIMEZONES, normalizeTimezone, tzMenuLabel } from './chunk-6FA4TDUF.js';
2
+ import { chartType, widgetActions, SidePanel, sidePanels, DEFAULT_PANEL_ORDER, getDrawingType } from './chunk-BEJ57HP4.js';
3
+ import { Tooltip, Drawer } from './chunk-2R7BANEM.js';
4
+ import { Menu, Dialog } from './chunk-OICPLNU7.js';
5
5
  import { iconMarkup, registerIcon, injectStyles, iconEl, SESSION_PRE, SESSION_POST, SESSION_OFF, icon, categoricalColor } from './chunk-PN5KWFZ4.js';
6
6
 
7
7
  // src/widget/timeframe.ts
@@ -492,12 +492,14 @@ var CSS2 = `
492
492
  color: var(--vela-fg-muted);
493
493
  }
494
494
  .vela-widget-tf-caret:hover { background: var(--vela-hover); color: var(--vela-fg-bright); }
495
+ /* The merged trigger is a plain button (hover feedback only) \u2014 the highlight
496
+ background marks the CURRENT chip among favorites, and a lone trigger with a
497
+ permanent highlight would read as stuck-pressed. */
495
498
  .vela-widget-tf-caret[data-solo='1'] {
496
499
  width: auto;
497
500
  padding: 0 6px 0 9px;
498
501
  gap: 4px;
499
502
  color: var(--vela-fg-bright);
500
- background: var(--vela-hover-strong);
501
503
  font-size: 13px;
502
504
  font-weight: 550;
503
505
  white-space: nowrap;
@@ -1526,7 +1528,8 @@ var Bottombar = class {
1526
1528
  const session = doc.createElement("span");
1527
1529
  session.className = "vela-bb-session";
1528
1530
  this.sessionEl = session;
1529
- session.title = "Session \u2014 stocks & ETFs only";
1531
+ session.style.display = "none";
1532
+ session.title = "Session \u2014 regular (RTH) vs extended (ETH) hours";
1530
1533
  for (const [key, label] of [["regular", "RTH"], ["extended", "ETH"]]) {
1531
1534
  const b = doc.createElement("button");
1532
1535
  b.className = "vela-bb-session-btn" + (key === "regular" ? " is-active" : "");
@@ -1577,15 +1580,15 @@ var Bottombar = class {
1577
1580
  }
1578
1581
  /**
1579
1582
  * 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
+ * market, or metadata not landed yet) HIDES the toggle entirelyRTH/ETH is
1584
+ * meaningless there. Enabled, the chips appear and the active one tracks the
1585
+ * chart's current session.
1583
1586
  */
1584
1587
  setSession(state) {
1585
- if (this.sessionEl) this.sessionEl.title = state.enabled ? "Session \u2014 regular (RTH) vs extended (ETH) hours" : "Session \u2014 stocks & ETFs only";
1588
+ if (this.sessionEl) this.sessionEl.style.display = state.enabled ? "" : "none";
1586
1589
  for (const [key, b] of this.sessionButtons) {
1587
1590
  b.disabled = !state.enabled;
1588
- b.classList.toggle("is-active", state.enabled ? key === state.session : key === "regular");
1591
+ b.classList.toggle("is-active", key === (state.enabled ? state.session : "regular"));
1589
1592
  }
1590
1593
  }
1591
1594
  destroy() {
@@ -3313,6 +3316,9 @@ var CSS8 = `
3313
3316
  letter-spacing: 0.08em;
3314
3317
  }
3315
3318
  .vela-dw-group:first-child { border-top: none; margin-top: 0; padding-top: 8px; }
3319
+ /* The readout is DATA, not chrome: selectable (an exception to the UI-wide
3320
+ user-select:none) so values can be copied out. The panel header stays chrome. */
3321
+ .vela-dw-group, .vela-dw-row { user-select: text; -webkit-user-select: text; cursor: text; }
3316
3322
  .vela-dw-row {
3317
3323
  display: flex;
3318
3324
  align-items: center;
@@ -3775,6 +3781,9 @@ var ChartContextMenu = class {
3775
3781
  host,
3776
3782
  items: [],
3777
3783
  placement: "bottom-start",
3784
+ // Pointer-anchored action menu: checked state reads as a leading ✓, not a
3785
+ // washed row (which would read as hover in a menu with no trigger button).
3786
+ checkmarks: true,
3778
3787
  onSelect: (id) => this.run(id)
3779
3788
  });
3780
3789
  host.addEventListener("contextmenu", this.onContextMenu);
@@ -4506,6 +4515,65 @@ var MarketStatusTracker = class {
4506
4515
  }
4507
4516
  };
4508
4517
 
4518
+ // src/widget/session-shading.ts
4519
+ function deriveSessionZones(regular, extended) {
4520
+ const pre = [];
4521
+ const post = [];
4522
+ for (const [extStart, extEnd] of extended) {
4523
+ const inside = regular.filter(([s, e]) => e > extStart && s < extEnd).sort((a, b) => a[0] - b[0]);
4524
+ let cursor = extStart;
4525
+ for (const [regStart, regEnd] of inside) {
4526
+ if (regStart > cursor) pre.push([cursor, Math.min(regStart, extEnd)]);
4527
+ cursor = Math.max(cursor, regEnd);
4528
+ }
4529
+ if (cursor < extEnd) post.push([cursor, extEnd]);
4530
+ }
4531
+ return { pre, post };
4532
+ }
4533
+ var FETCH_AHEAD_MS2 = 10 * 864e5;
4534
+ var MIN_LOOKBACK_MS = 3 * 864e5;
4535
+ var MAX_LOOKBACK_MS = 120 * 864e5;
4536
+ var SessionShadingTracker = class {
4537
+ constructor(onZones) {
4538
+ this.onZones = onZones;
4539
+ /** Invalidates detached async work — bumped by every track()/stop(). */
4540
+ this.epoch = 0;
4541
+ }
4542
+ /** (Re)bind to a chart's data surface + market and evaluate once. */
4543
+ track(data, symbol, opts) {
4544
+ const my = ++this.epoch;
4545
+ void this.evaluate(my, data, symbol, opts);
4546
+ }
4547
+ stop() {
4548
+ this.epoch += 1;
4549
+ }
4550
+ async evaluate(my, data, symbol, opts) {
4551
+ const resolved = data.resolve(symbol);
4552
+ const provider = resolved ? data.providerInstance(resolved.provider) : void 0;
4553
+ const si = await data.symbolInfo(symbol).catch(() => void 0);
4554
+ if (my !== this.epoch) return;
4555
+ const hasSessions = typeof si?.session === "string" && si.session !== "" && si.session !== "24x7";
4556
+ if (!provider?.getCalendar || !hasSessions || !resolved) {
4557
+ this.onZones(null);
4558
+ return;
4559
+ }
4560
+ if (opts.session !== "extended") {
4561
+ this.onZones({ pre: [], post: [] });
4562
+ return;
4563
+ }
4564
+ const now = Date.now();
4565
+ const lookback = Math.max(MIN_LOOKBACK_MS, Math.min(MAX_LOOKBACK_MS, opts.lookbackMs));
4566
+ const range = { from: now - lookback, to: now + FETCH_AHEAD_MS2 };
4567
+ const [regular, extended] = await Promise.all([
4568
+ provider.getCalendar(resolved.ticker, { ...range, session: "regular" }).catch(() => null),
4569
+ provider.getCalendar(resolved.ticker, { ...range, session: "extended" }).catch(() => null)
4570
+ ]);
4571
+ if (my !== this.epoch) return;
4572
+ if (!regular || !extended) return;
4573
+ this.onZones(deriveSessionZones(regular, extended));
4574
+ }
4575
+ };
4576
+
4509
4577
  // src/widget/layout-mode.ts
4510
4578
  var MOBILE_BREAKPOINT_PX = 640;
4511
4579
  var COARSE_BREAKPOINT_PX = 920;
@@ -5872,4 +5940,4 @@ var Toast = class {
5872
5940
  }
5873
5941
  };
5874
5942
 
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 };
5943
+ export { Bottombar, ChartContextMenu, DataWindow, DrawingPill, DrawingsDrawer, Glider, IndicatorPicker, LayoutModeController, MarketStatusTracker, MobileBar, MoreDrawer, ObjectTree, PAN_FAST, PanelDock, PriceScaleDrawer, RANGE_PRESETS, SessionShadingTracker, 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 };