@luxalgo/vela 0.5.3 → 0.5.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 (47) hide show
  1. package/README.md +3 -2
  2. package/dist/{DataProvider-DTOEXKTI.d.ts → DataProvider-Cqc_BaJ9.d.ts} +1 -1
  3. package/dist/{DataProvider-gnzv-dgc.d.cts → DataProvider-DgS2UyMc.d.cts} +1 -1
  4. package/dist/{chunk-L5NTMWPP.js → chunk-D6WM5IUE.js} +724 -851
  5. package/dist/{chunk-LJLZR44Y.js → chunk-EMS6PO2T.js} +5 -7
  6. package/dist/{chunk-EY63XBFZ.js → chunk-JBQUY2RI.js} +119 -12
  7. package/dist/chunk-OGRQW3M6.js +1328 -0
  8. package/dist/{chunk-P556H6EA.js → chunk-QWIEKZRE.js} +59 -34
  9. package/dist/{chunk-WJKLBYRM.js → chunk-ZNL2X6U2.js} +1 -1
  10. package/dist/{contributions-Ci_i3IN2.d.cts → contributions-4Nh1jbvb.d.cts} +2 -2
  11. package/dist/{contributions-b6AVrqqG.d.ts → contributions-DuIxJWeH.d.ts} +2 -2
  12. package/dist/{history-Cf1lVsap.d.cts → history-FsmvCIo4.d.ts} +5 -3
  13. package/dist/{history-Ci3M0xLV.d.ts → history-HofqYEh2.d.cts} +5 -3
  14. package/dist/index.cjs +2715 -1606
  15. package/dist/index.d.cts +6 -6
  16. package/dist/index.d.ts +6 -6
  17. package/dist/index.js +4 -4
  18. package/dist/{options-XTBpbx0s.d.ts → options-BlQ00Fju.d.cts} +3 -1
  19. package/dist/{options-XTBpbx0s.d.cts → options-BlQ00Fju.d.ts} +3 -1
  20. package/dist/{plugin-DlidwMj6.d.cts → plugin-DJR6z3e0.d.cts} +3 -3
  21. package/dist/{plugin-DP6A4t4o.d.ts → plugin-N_EaXN4-.d.ts} +3 -3
  22. package/dist/plugin.cjs +4 -0
  23. package/dist/plugin.d.cts +4 -4
  24. package/dist/plugin.d.ts +4 -4
  25. package/dist/plugin.js +2 -2
  26. package/dist/providers/binance.d.cts +2 -2
  27. package/dist/providers/binance.d.ts +2 -2
  28. package/dist/providers/coinbase.d.cts +2 -2
  29. package/dist/providers/coinbase.d.ts +2 -2
  30. package/dist/providers/hyperliquid.d.cts +2 -2
  31. package/dist/providers/hyperliquid.d.ts +2 -2
  32. package/dist/ui.cjs +1318 -4
  33. package/dist/ui.d.cts +383 -2
  34. package/dist/ui.d.ts +383 -2
  35. package/dist/ui.js +3 -3
  36. package/dist/vela.global.js +2709 -1600
  37. package/dist/vela.global.min.js +315 -66
  38. package/dist/widget.cjs +2275 -1032
  39. package/dist/widget.d.cts +25 -7
  40. package/dist/widget.d.ts +25 -7
  41. package/dist/widget.js +27 -9
  42. package/dist/workspace.cjs +2181 -926
  43. package/dist/workspace.d.cts +10 -5
  44. package/dist/workspace.d.ts +10 -5
  45. package/dist/workspace.js +25 -7
  46. package/package.json +1 -1
  47. package/dist/chunk-ATPU5CI6.js +0 -81
@@ -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-XTBpbx0s.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-Cf1lVsap.cjs';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-Cf1lVsap.cjs';
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-HofqYEh2.cjs';
3
+ export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-HofqYEh2.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-Ci_i3IN2.cjs';
6
- import { M as MarketDataFeed } from './DataProvider-gnzv-dgc.cjs';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-4Nh1jbvb.cjs';
6
+ import { M as MarketDataFeed } from './DataProvider-DgS2UyMc.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[];
@@ -435,6 +435,8 @@ declare class VelaWorkspace {
435
435
  private historyUnsub;
436
436
  /** Favorite drawing tools — a WORKSPACE preference (one star set, every cell). */
437
437
  private favs;
438
+ /** Favorite timeframes — the shared topbar's quick-switch chips, one set for the grid. */
439
+ private tfFavs;
438
440
  /** Live sync configuration (mutable copy of the option). */
439
441
  private readonly syncOpts;
440
442
  private readonly persistKey;
@@ -621,6 +623,9 @@ declare class VelaWorkspace {
621
623
  private onCellIndicatorsChanged;
622
624
  /** Timeframe changes routed from the topbar menu / quick entry (chip state follows). */
623
625
  private setActiveTimeframe;
626
+ /** Star/unstar a timeframe — a WORKSPACE preference (one chip row, whatever the
627
+ * active cell); the topbar follows and the set persists with the document. */
628
+ private setTimeframeFavorite;
624
629
  /** The mode flipped (container resized across the breakpoint, or a coarse-pointer
625
630
  * change). Close the open surfaces — a desktop card must not linger over the
626
631
  * mobile chrome (and vice versa) — and re-present every cell's own chrome. */
@@ -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-XTBpbx0s.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-Ci3M0xLV.js';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-Ci3M0xLV.js';
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-FsmvCIo4.js';
3
+ export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-FsmvCIo4.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-b6AVrqqG.js';
6
- import { M as MarketDataFeed } from './DataProvider-DTOEXKTI.js';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-DuIxJWeH.js';
6
+ import { M as MarketDataFeed } from './DataProvider-Cqc_BaJ9.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[];
@@ -435,6 +435,8 @@ declare class VelaWorkspace {
435
435
  private historyUnsub;
436
436
  /** Favorite drawing tools — a WORKSPACE preference (one star set, every cell). */
437
437
  private favs;
438
+ /** Favorite timeframes — the shared topbar's quick-switch chips, one set for the grid. */
439
+ private tfFavs;
438
440
  /** Live sync configuration (mutable copy of the option). */
439
441
  private readonly syncOpts;
440
442
  private readonly persistKey;
@@ -621,6 +623,9 @@ declare class VelaWorkspace {
621
623
  private onCellIndicatorsChanged;
622
624
  /** Timeframe changes routed from the topbar menu / quick entry (chip state follows). */
623
625
  private setActiveTimeframe;
626
+ /** Star/unstar a timeframe — a WORKSPACE preference (one chip row, whatever the
627
+ * active cell); the topbar follows and the set persists with the document. */
628
+ private setTimeframeFavorite;
624
629
  /** The mode flipped (container resized across the breakpoint, or a coarse-pointer
625
630
  * change). Close the open surfaces — a desktop card must not linger over the
626
631
  * mobile chrome (and vice versa) — and re-present every cell's own chrome. */
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-EY63XBFZ.js';
2
- export { decodeState, encodeState, sanitizeState } from './chunk-EY63XBFZ.js';
3
- import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-L5NTMWPP.js';
4
- import { resolveEngines, legendActionsProviderFor, rendererDefaults, widgetActions, widgetAttachments } from './chunk-WJKLBYRM.js';
5
- import { applyPlotOverlayTokens, ensureUIHost, KeymapManager, Menu, isEditableTarget } from './chunk-P556H6EA.js';
6
- import './chunk-ATPU5CI6.js';
7
- import { registerIcon, svg16, injectStyles } from './chunk-LJLZR44Y.js';
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-JBQUY2RI.js';
2
+ export { decodeState, encodeState, sanitizeState } from './chunk-JBQUY2RI.js';
3
+ import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-D6WM5IUE.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';
8
8
 
9
9
  // src/workspace/sync.ts
10
10
  function syncTargets(originId, setting, cellIds) {
@@ -920,6 +920,8 @@ var VelaWorkspace = class {
920
920
  this.historyUnsub = null;
921
921
  /** Favorite drawing tools — a WORKSPACE preference (one star set, every cell). */
922
922
  this.favs = [];
923
+ /** Favorite timeframes — the shared topbar's quick-switch chips, one set for the grid. */
924
+ this.tfFavs = [];
923
925
  /** Live sync configuration (mutable copy of the option). */
924
926
  this.syncOpts = {};
925
927
  this.stateTimer = null;
@@ -983,6 +985,7 @@ var VelaWorkspace = class {
983
985
  }
984
986
  this.timezone = boot?.timezone ?? opts.timezone ?? "Etc/UTC";
985
987
  if (boot?.favorites) this.favs = [...boot.favorites];
988
+ if (boot?.timeframeFavorites) this.tfFavs = [...boot.timeframeFavorites];
986
989
  const sync = boot?.sync ?? opts.sync;
987
990
  for (const kind of ["viewport", "symbol", "timeframe", "crosshair", "drawings"]) {
988
991
  this.applySyncSetting(kind, sync?.[kind]);
@@ -1037,8 +1040,10 @@ var VelaWorkspace = class {
1037
1040
  onAlertsClick: (anchor) => this.openAlertsMenu(anchor),
1038
1041
  timeframe: "60",
1039
1042
  timeframes: opts.timeframes ?? DEFAULT_TIMEFRAMES,
1043
+ timeframeFavorites: this.tfFavs,
1040
1044
  priceStyle: "candles",
1041
1045
  onTimeframe: (tf) => this.setActiveTimeframe(tf),
1046
+ onTimeframeFavorite: (tf, on) => this.setTimeframeFavorite(tf, on),
1042
1047
  onPriceStyle: (style) => this.active.setPriceStyle(style),
1043
1048
  layout: {
1044
1049
  current: this.def.id,
@@ -1289,6 +1294,7 @@ var VelaWorkspace = class {
1289
1294
  const state = { version: 1, layout: this.def.id, timezone: this.timezone, sync: { ...this.syncOpts }, charts };
1290
1295
  if (this.activeId) state.activeCellId = this.activeId;
1291
1296
  if (this.favs.length > 0) state.favorites = [...this.favs];
1297
+ if (this.tfFavs.length > 0) state.timeframeFavorites = [...this.tfFavs];
1292
1298
  if (this.trackSizes.size > 0) state.trackSizes = Object.fromEntries([...this.trackSizes].map(([k, v]) => [k, { ...v }]));
1293
1299
  const panels = this.dock.getState();
1294
1300
  if (panels) state.panels = panels;
@@ -1309,6 +1315,10 @@ var VelaWorkspace = class {
1309
1315
  this.bottombar?.setTimezone(st.timezone);
1310
1316
  }
1311
1317
  if (st.favorites) this.favs = [...st.favorites];
1318
+ if (st.timeframeFavorites) {
1319
+ this.tfFavs = [...st.timeframeFavorites];
1320
+ this.topbar.setTimeframeFavorites(this.tfFavs);
1321
+ }
1312
1322
  this.dock.applyState(st.panels);
1313
1323
  for (const kind of ["viewport", "symbol", "timeframe", "crosshair", "drawings"]) this.applySyncSetting(kind, st.sync?.[kind]);
1314
1324
  this.trackSizes.clear();
@@ -1884,6 +1894,14 @@ var VelaWorkspace = class {
1884
1894
  this.bottombar?.setActiveRange(null);
1885
1895
  this.active.setTimeframe(tf);
1886
1896
  }
1897
+ /** Star/unstar a timeframe — a WORKSPACE preference (one chip row, whatever the
1898
+ * active cell); the topbar follows and the set persists with the document. */
1899
+ setTimeframeFavorite(tf, on) {
1900
+ if (on === this.tfFavs.includes(tf)) return;
1901
+ this.tfFavs = on ? [tf, ...this.tfFavs] : this.tfFavs.filter((f) => f !== tf);
1902
+ this.topbar.setTimeframeFavorites(this.tfFavs);
1903
+ this.markStateDirty();
1904
+ }
1887
1905
  /** The mode flipped (container resized across the breakpoint, or a coarse-pointer
1888
1906
  * change). Close the open surfaces — a desktop card must not linger over the
1889
1907
  * mobile chrome (and vice versa) — and re-present every cell's own chrome. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxalgo/vela",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
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",
@@ -1,81 +0,0 @@
1
- import { isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha } from './chunk-LJLZR44Y.js';
2
-
3
- // src/core/tokens.ts
4
- var STATIC_TOKENS = {
5
- "--vela-space-1": "4px",
6
- "--vela-space-2": "8px",
7
- "--vela-space-3": "12px",
8
- "--vela-space-4": "16px",
9
- "--vela-radius-sm": "4px",
10
- "--vela-radius-md": "6px",
11
- "--vela-radius-lg": "10px",
12
- "--vela-z-tooltip": "60",
13
- "--vela-z-menu": "50",
14
- "--vela-z-dialog": "40",
15
- "--vela-ease": "cubic-bezier(0.22, 1, 0.36, 1)",
16
- "--vela-dur-fast": "90ms",
17
- "--vela-dur-med": "160ms",
18
- "--vela-font-size-sm": "11px",
19
- "--vela-font-size-md": "12px",
20
- "--vela-font-size-lg": "14px"
21
- };
22
- function themeTokens(t) {
23
- const dark = isDarkColor(t.background);
24
- const wash = (a) => dark ? `rgba(255,255,255,${a})` : withAlpha(t.textColor, a + 0.02);
25
- const elevated = mix(t.background, dark ? "#ffffff" : t.textColor, dark ? 0.03 : 0.05);
26
- return {
27
- "--vela-font": t.fontFamily,
28
- "--vela-bg": t.background,
29
- // Chrome text is slightly brighter than the chart's own axis text, which is
30
- // deliberately recessive; the chart keeps using `t.textColor` directly.
31
- "--vela-fg": dark ? "#d1d4dc" : t.textColor,
32
- "--vela-fg-muted": dark ? "#868a96" : withAlpha(t.textColor, 0.62),
33
- "--vela-fg-faint": withAlpha(t.textColor, 0.35),
34
- "--vela-fg-bright": dark ? "#f0f3fa" : "#000000",
35
- "--vela-surface": t.background,
36
- // Panels and menus float ABOVE the chart, so their surface is the wash flattened onto
37
- // the chart background — opaque, or candles read through the panel.
38
- "--vela-surface-elev": elevated,
39
- "--vela-surface-overlay": elevated,
40
- // Recessed fields (inputs, selects) read as cut INTO their panel, so they fall back
41
- // to the chart surface and are separated from the panel by their border alone.
42
- "--vela-surface-sunken": t.background,
43
- "--vela-border": t.borderColor,
44
- "--vela-border-strong": dark ? "#34353b" : withAlpha(t.textColor, 0.28),
45
- "--vela-border-soft": t.borderColor,
46
- // Barely-there rules INSIDE a panel (row separators), where a full border would
47
- // chop the list into boxes.
48
- "--vela-border-faint": withAlpha(t.textColor, 0.08),
49
- "--vela-hover": wash(0.06),
50
- "--vela-active": wash(0.1),
51
- // A deliberately stronger hover for rows inside an already-tinted surface (menu
52
- // items in an active flyout), where the normal wash would not separate from it.
53
- "--vela-hover-strong": wash(0.16),
54
- "--vela-focus": withAlpha(t.textColor, 0.5),
55
- "--vela-focus-soft": withAlpha(t.textColor, 0.12),
56
- // Separator hover — the SAME wash the chart's pane separators paint on hover
57
- // (soft full-thickness band + solid 2px center line), so DOM-drawn dividers
58
- // (the workspace grid) and canvas-drawn ones read as one family.
59
- "--vela-separator-hover-band": withAlpha(t.textColor, 0.1),
60
- "--vela-separator-hover-line": withAlpha(t.textColor, 0.55),
61
- "--vela-scroll": withAlpha(t.textColor, 0.3),
62
- "--vela-accent": ACCENT,
63
- "--vela-accent-bright": ACCENT_BRIGHT,
64
- "--vela-highlight": HIGHLIGHT,
65
- // The inverse chip: a filled selected state (active tab, ticked checkbox). Its ink
66
- // must contrast the fill, so the pair flips together with the theme.
67
- "--vela-selected-bg": dark ? "#f0f3fa" : t.textColor,
68
- "--vela-selected-fg": dark ? t.background : "#ffffff",
69
- // Fixed ink for saturated fills (accent buttons, categorical avatars) — those fills
70
- // are theme-independent, so their ink is too.
71
- "--vela-fg-on-fill": "#ffffff",
72
- "--vela-up": t.upColor,
73
- "--vela-down": t.downColor,
74
- "--vela-danger": t.downColor,
75
- "--vela-shadow": "0 8px 30px rgba(0,0,0,0.5)",
76
- "--vela-shadow-dialog": "0 20px 60px rgba(0,0,0,0.5)",
77
- "--vela-backdrop": "rgba(0,0,0,0.45)"
78
- };
79
- }
80
-
81
- export { STATIC_TOKENS, themeTokens };