@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
package/dist/widget.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-Ci_i3IN2.cjs';
2
- export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-Ci_i3IN2.cjs';
3
- import { b as VelaOptions, q as DataWindowReadout } from './options-XTBpbx0s.cjs';
1
+ import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-4Nh1jbvb.cjs';
2
+ export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-4Nh1jbvb.cjs';
3
+ import { b as VelaOptions, q as DataWindowReadout } from './options-BlQ00Fju.cjs';
4
4
  import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
5
- import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-Cf1lVsap.cjs';
6
- export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-Cf1lVsap.cjs';
7
- import { a as SymbolDescriptor } from './DataProvider-gnzv-dgc.cjs';
5
+ import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-HofqYEh2.cjs';
6
+ export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-HofqYEh2.cjs';
7
+ import { a as SymbolDescriptor } from './DataProvider-DgS2UyMc.cjs';
8
8
  import { d as SidePanel } from './side-panel-CT9ZwIGz.cjs';
9
9
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.cjs';
10
10
 
@@ -93,6 +93,8 @@ declare class VelaWidget {
93
93
  private readonly stateListeners;
94
94
  /** Favorite drawing-tool types — mirrored from chart events, reapplied on rebuilds. */
95
95
  private favs;
96
+ /** Favorite timeframes — the topbar's quick-switch chips, persisted with the shell. */
97
+ private tfFavs;
96
98
  /** Mounted attachment disposers (by id), torn down at destroy. */
97
99
  private readonly attachmentDisposers;
98
100
  private readonly onUnload;
@@ -145,6 +147,9 @@ declare class VelaWidget {
145
147
  */
146
148
  private providerLabel;
147
149
  setTimeframe(tf: string): void;
150
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
151
+ * set persists with the rest of the shell state. */
152
+ private setTimeframeFavorite;
148
153
  /**
149
154
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
150
155
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -255,8 +260,14 @@ interface TopbarOptions {
255
260
  onSymbolClick?: () => void;
256
261
  timeframe: string;
257
262
  timeframes: readonly string[];
263
+ /** Favorite timeframes — duration-sorted quick-switch chips, stars in the
264
+ * dropdown rows. Push later changes with {@link Topbar.setTimeframeFavorites}. */
265
+ timeframeFavorites?: readonly string[];
258
266
  priceStyle: string;
259
267
  onTimeframe: (tf: string) => void;
268
+ /** A dropdown star was toggled. Omitted, the dropdown carries no stars and the
269
+ * chips never render — the host owns (and persists) the favorite set. */
270
+ onTimeframeFavorite?: (tf: string, on: boolean) => void;
260
271
  onPriceStyle: (style: string) => void;
261
272
  /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
262
273
  * given) — the grid-canvas picker composing uniform grids, with the workspace
@@ -294,7 +305,10 @@ interface TopbarOptions {
294
305
  declare class Topbar {
295
306
  readonly el: HTMLElement;
296
307
  private readonly symbolEl;
297
- private readonly tfButton;
308
+ /** Duration-sorted favorite chips (plus an unstarred current, when needed). */
309
+ private readonly tfChipsHost;
310
+ private readonly tfCaret;
311
+ private tfFavs;
298
312
  private readonly styleButton;
299
313
  private layoutButton;
300
314
  private layoutPicker;
@@ -325,6 +339,10 @@ declare class Topbar {
325
339
  constructor(host: HTMLElement, opts: TopbarOptions);
326
340
  setSymbol(symbol: string): void;
327
341
  setTimeframe(tf: string): void;
342
+ /** Reflect the favorite-timeframe set — the quick-switch chips and the dropdown stars. */
343
+ setTimeframeFavorites(favs: readonly string[]): void;
344
+ /** Rebuild the quick-switch chips (current value changed, or the favorite set did). */
345
+ private renderTfChips;
328
346
  setPriceStyle(style: string): void;
329
347
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
330
348
  setLayout(id: string): void;
package/dist/widget.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-b6AVrqqG.js';
2
- export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-b6AVrqqG.js';
3
- import { b as VelaOptions, q as DataWindowReadout } from './options-XTBpbx0s.js';
1
+ import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-DuIxJWeH.js';
2
+ export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-DuIxJWeH.js';
3
+ import { b as VelaOptions, q as DataWindowReadout } from './options-BlQ00Fju.js';
4
4
  import { K as KeymapManager } from './keymap-CGOz5F5f.js';
5
- import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-Ci3M0xLV.js';
6
- export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-Ci3M0xLV.js';
7
- import { a as SymbolDescriptor } from './DataProvider-DTOEXKTI.js';
5
+ import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-FsmvCIo4.js';
6
+ export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-FsmvCIo4.js';
7
+ import { a as SymbolDescriptor } from './DataProvider-Cqc_BaJ9.js';
8
8
  import { d as SidePanel } from './side-panel-CT9ZwIGz.js';
9
9
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.js';
10
10
 
@@ -93,6 +93,8 @@ declare class VelaWidget {
93
93
  private readonly stateListeners;
94
94
  /** Favorite drawing-tool types — mirrored from chart events, reapplied on rebuilds. */
95
95
  private favs;
96
+ /** Favorite timeframes — the topbar's quick-switch chips, persisted with the shell. */
97
+ private tfFavs;
96
98
  /** Mounted attachment disposers (by id), torn down at destroy. */
97
99
  private readonly attachmentDisposers;
98
100
  private readonly onUnload;
@@ -145,6 +147,9 @@ declare class VelaWidget {
145
147
  */
146
148
  private providerLabel;
147
149
  setTimeframe(tf: string): void;
150
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
151
+ * set persists with the rest of the shell state. */
152
+ private setTimeframeFavorite;
148
153
  /**
149
154
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
150
155
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -255,8 +260,14 @@ interface TopbarOptions {
255
260
  onSymbolClick?: () => void;
256
261
  timeframe: string;
257
262
  timeframes: readonly string[];
263
+ /** Favorite timeframes — duration-sorted quick-switch chips, stars in the
264
+ * dropdown rows. Push later changes with {@link Topbar.setTimeframeFavorites}. */
265
+ timeframeFavorites?: readonly string[];
258
266
  priceStyle: string;
259
267
  onTimeframe: (tf: string) => void;
268
+ /** A dropdown star was toggled. Omitted, the dropdown carries no stars and the
269
+ * chips never render — the host owns (and persists) the favorite set. */
270
+ onTimeframeFavorite?: (tf: string, on: boolean) => void;
260
271
  onPriceStyle: (style: string) => void;
261
272
  /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
262
273
  * given) — the grid-canvas picker composing uniform grids, with the workspace
@@ -294,7 +305,10 @@ interface TopbarOptions {
294
305
  declare class Topbar {
295
306
  readonly el: HTMLElement;
296
307
  private readonly symbolEl;
297
- private readonly tfButton;
308
+ /** Duration-sorted favorite chips (plus an unstarred current, when needed). */
309
+ private readonly tfChipsHost;
310
+ private readonly tfCaret;
311
+ private tfFavs;
298
312
  private readonly styleButton;
299
313
  private layoutButton;
300
314
  private layoutPicker;
@@ -325,6 +339,10 @@ declare class Topbar {
325
339
  constructor(host: HTMLElement, opts: TopbarOptions);
326
340
  setSymbol(symbol: string): void;
327
341
  setTimeframe(tf: string): void;
342
+ /** Reflect the favorite-timeframe set — the quick-switch chips and the dropdown stars. */
343
+ setTimeframeFavorites(favs: readonly string[]): void;
344
+ /** Rebuild the quick-switch chips (current value changed, or the favorite set did). */
345
+ private renderTfChips;
328
346
  setPriceStyle(style: string): void;
329
347
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
330
348
  setLayout(id: string): void;
package/dist/widget.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, MobileBar, DrawingPill, LayoutModeController, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-EY63XBFZ.js';
2
- export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, legacyWidgetState, loadPersisted, localStorageAdapter, parsePersisted, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, timeframeLabel, timeframeMs } from './chunk-EY63XBFZ.js';
3
- import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-L5NTMWPP.js';
4
- export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-L5NTMWPP.js';
5
- import { widgetActions, widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-WJKLBYRM.js';
6
- export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, SidePanel, clampPanelWidth, registerSidePanel, registerWidgetAction, registerWidgetAttachment, sidePanels, unregisterSidePanel, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-WJKLBYRM.js';
7
- import { ensureUIHost, KeymapManager, Menu, applyPlotOverlayTokens, isEditableTarget } from './chunk-P556H6EA.js';
8
- import './chunk-ATPU5CI6.js';
9
- import { injectStyles } from './chunk-LJLZR44Y.js';
1
+ import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, MobileBar, DrawingPill, LayoutModeController, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-JBQUY2RI.js';
2
+ export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, legacyWidgetState, loadPersisted, localStorageAdapter, parsePersisted, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, timeframeLabel, timeframeMs } from './chunk-JBQUY2RI.js';
3
+ import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-D6WM5IUE.js';
4
+ export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-D6WM5IUE.js';
5
+ import { widgetActions, widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-ZNL2X6U2.js';
6
+ export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, SidePanel, clampPanelWidth, registerSidePanel, registerWidgetAction, registerWidgetAttachment, sidePanels, unregisterSidePanel, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-ZNL2X6U2.js';
7
+ import { KeymapManager, Menu, isEditableTarget } from './chunk-QWIEKZRE.js';
8
+ import { ensureUIHost, applyPlotOverlayTokens } from './chunk-OGRQW3M6.js';
9
+ import { injectStyles } from './chunk-EMS6PO2T.js';
10
10
 
11
11
  // src/widget/url-state.ts
12
12
  var PARAMS = [
@@ -106,6 +106,8 @@ var VelaWidget = class {
106
106
  this.stateListeners = /* @__PURE__ */ new Set();
107
107
  /** Favorite drawing-tool types — mirrored from chart events, reapplied on rebuilds. */
108
108
  this.favs = [];
109
+ /** Favorite timeframes — the topbar's quick-switch chips, persisted with the shell. */
110
+ this.tfFavs = [];
109
111
  /** Mounted attachment disposers (by id), torn down at destroy. */
110
112
  this.attachmentDisposers = /* @__PURE__ */ new Map();
111
113
  this.onUnload = () => this.persistNow();
@@ -148,6 +150,7 @@ var VelaWidget = class {
148
150
  this.indicatorTitlesOn = bootCell?.indicatorTitles ?? true;
149
151
  this.indicatorValuesOn = bootCell?.indicatorValues ?? true;
150
152
  this.favs = boot?.favorites ? [...boot.favorites] : [];
153
+ this.tfFavs = boot?.timeframeFavorites ? [...boot.timeframeFavorites] : [];
151
154
  this.savedConfig = bootCell?.rendererConfig ?? null;
152
155
  this.savedDrawings = bootCell?.drawings ?? null;
153
156
  this.pendingIndicators = bootCell?.indicators ?? null;
@@ -207,8 +210,10 @@ var VelaWidget = class {
207
210
  onAlertsClick: (anchor) => this.openAlertsMenu(anchor),
208
211
  timeframe: this.timeframe,
209
212
  timeframes: opts.timeframes ?? DEFAULT_TIMEFRAMES,
213
+ timeframeFavorites: this.tfFavs,
210
214
  priceStyle: this.priceStyle,
211
215
  onTimeframe: (tf) => this.setTimeframe(tf),
216
+ onTimeframeFavorite: (tf, on) => this.setTimeframeFavorite(tf, on),
212
217
  onPriceStyle: (style) => this.setPriceStyle(style),
213
218
  getContext: () => this.context()
214
219
  });
@@ -493,6 +498,14 @@ var VelaWidget = class {
493
498
  this.markStateDirty();
494
499
  void this.inner?.setMarket({ timeframe: tf, bars: this.bars });
495
500
  }
501
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
502
+ * set persists with the rest of the shell state. */
503
+ setTimeframeFavorite(tf, on) {
504
+ if (on === this.tfFavs.includes(tf)) return;
505
+ this.tfFavs = on ? [tf, ...this.tfFavs] : this.tfFavs.filter((f) => f !== tf);
506
+ this.topbar.setTimeframeFavorites(this.tfFavs);
507
+ this.markStateDirty();
508
+ }
496
509
  /**
497
510
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
498
511
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -550,6 +563,7 @@ var VelaWidget = class {
550
563
  });
551
564
  const state = { version: 1, layout: "1", activeCellId: "c1", timezone: this.timezone, charts: [{ id: "c1", ...cell }] };
552
565
  if (this.favs.length > 0) state.favorites = [...this.favs];
566
+ if (this.tfFavs.length > 0) state.timeframeFavorites = [...this.tfFavs];
553
567
  const panels = this.dock.getState();
554
568
  if (panels) state.panels = panels;
555
569
  return state;
@@ -573,6 +587,10 @@ var VelaWidget = class {
573
587
  this.favs = [...st.favorites];
574
588
  this.inner?.drawings.setFavorites(this.favs);
575
589
  }
590
+ if (st.timeframeFavorites) {
591
+ this.tfFavs = [...st.timeframeFavorites];
592
+ this.topbar.setTimeframeFavorites(this.tfFavs);
593
+ }
576
594
  this.dock.applyState(st.panels);
577
595
  if (cell) {
578
596
  const style = fromUrl.priceStyle ?? cell.priceStyle;