@luxalgo/vela 0.5.3 → 0.6.0

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-gnzv-dgc.d.cts → DataProvider-Ce6PuCzQ.d.cts} +10 -1
  3. package/dist/{DataProvider-DTOEXKTI.d.ts → DataProvider-DNx9ntBD.d.ts} +10 -1
  4. package/dist/{chunk-EY63XBFZ.js → chunk-7ROONW6H.js} +132 -23
  5. package/dist/{chunk-L5NTMWPP.js → chunk-CA3N3PYT.js} +785 -857
  6. package/dist/{chunk-LJLZR44Y.js → chunk-EMS6PO2T.js} +5 -7
  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-DToMhiw3.d.ts} +9 -2
  11. package/dist/{contributions-b6AVrqqG.d.ts → contributions-Dlc7ZWZz.d.cts} +9 -2
  12. package/dist/{history-Ci3M0xLV.d.ts → history-BZADxpKx.d.cts} +5 -3
  13. package/dist/{history-Cf1lVsap.d.cts → history-BuHXJZJ2.d.ts} +5 -3
  14. package/dist/index.cjs +2761 -1597
  15. package/dist/index.d.cts +14 -6
  16. package/dist/index.d.ts +14 -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-BNPLOQO1.d.cts} +3 -3
  21. package/dist/{plugin-DP6A4t4o.d.ts → plugin-BqjEa5r3.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 +3729 -2565
  37. package/dist/vela.global.min.js +315 -66
  38. package/dist/widget.cjs +2359 -1054
  39. package/dist/widget.d.cts +30 -16
  40. package/dist/widget.d.ts +30 -16
  41. package/dist/widget.js +37 -14
  42. package/dist/workspace.cjs +2259 -944
  43. package/dist/workspace.d.cts +10 -5
  44. package/dist/workspace.d.ts +10 -5
  45. package/dist/workspace.js +29 -8
  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-Dlc7ZWZz.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-Dlc7ZWZz.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-BZADxpKx.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-BZADxpKx.cjs';
7
+ import { a as SymbolDescriptor } from './DataProvider-Ce6PuCzQ.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;
@@ -139,12 +141,17 @@ declare class VelaWidget {
139
141
  * drifting out of sync with the topbar. */
140
142
  private syncTimeframeChrome;
141
143
  /**
142
- * The provider name to show: the one that RESOLVED the symbol, not the one configured.
143
- * They differ whenever the `provider` option is just a default (or names something that
144
- * isn't registered) the status line must not claim a venue that served nothing.
144
+ * The venue label to show: the LISTING prefix the resolved symbol's data declares
145
+ * (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol never the one
146
+ * configured or typed. They differ whenever the `provider` option is just a default,
147
+ * the prefix was a listing venue, or the spelling isn't registered — the status line
148
+ * must not claim a venue that served nothing.
145
149
  */
146
150
  private providerLabel;
147
151
  setTimeframe(tf: string): void;
152
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
153
+ * set persists with the rest of the shell state. */
154
+ private setTimeframeFavorite;
148
155
  /**
149
156
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
150
157
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -255,8 +262,14 @@ interface TopbarOptions {
255
262
  onSymbolClick?: () => void;
256
263
  timeframe: string;
257
264
  timeframes: readonly string[];
265
+ /** Favorite timeframes — duration-sorted quick-switch chips, stars in the
266
+ * dropdown rows. Push later changes with {@link Topbar.setTimeframeFavorites}. */
267
+ timeframeFavorites?: readonly string[];
258
268
  priceStyle: string;
259
269
  onTimeframe: (tf: string) => void;
270
+ /** A dropdown star was toggled. Omitted, the dropdown carries no stars and the
271
+ * chips never render — the host owns (and persists) the favorite set. */
272
+ onTimeframeFavorite?: (tf: string, on: boolean) => void;
260
273
  onPriceStyle: (style: string) => void;
261
274
  /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
262
275
  * given) — the grid-canvas picker composing uniform grids, with the workspace
@@ -294,7 +307,10 @@ interface TopbarOptions {
294
307
  declare class Topbar {
295
308
  readonly el: HTMLElement;
296
309
  private readonly symbolEl;
297
- private readonly tfButton;
310
+ /** Duration-sorted favorite chips (plus an unstarred current, when needed). */
311
+ private readonly tfChipsHost;
312
+ private readonly tfCaret;
313
+ private tfFavs;
298
314
  private readonly styleButton;
299
315
  private layoutButton;
300
316
  private layoutPicker;
@@ -325,6 +341,10 @@ declare class Topbar {
325
341
  constructor(host: HTMLElement, opts: TopbarOptions);
326
342
  setSymbol(symbol: string): void;
327
343
  setTimeframe(tf: string): void;
344
+ /** Reflect the favorite-timeframe set — the quick-switch chips and the dropdown stars. */
345
+ setTimeframeFavorites(favs: readonly string[]): void;
346
+ /** Rebuild the quick-switch chips (current value changed, or the favorite set did). */
347
+ private renderTfChips;
328
348
  setPriceStyle(style: string): void;
329
349
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
330
350
  setLayout(id: string): void;
@@ -447,12 +467,6 @@ declare class Watermark {
447
467
  destroy(): void;
448
468
  }
449
469
 
450
- /**
451
- * Rank: ticker prefix > ticker substring > description substring > venue-name substring (typing
452
- * `binance` surfaces that venue's symbols after any literal matches). An optional venue prefix
453
- * (see {@link parseQuery}) scopes the pool first — venue alone browses it whole, alphabetically.
454
- * Pure — unit-tested.
455
- */
456
470
  declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
457
471
  interface SymbolPickerOptions {
458
472
  /** `provider` is the venue of the chosen row — absent only for a source that has none. */
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-DToMhiw3.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-DToMhiw3.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-BuHXJZJ2.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-BuHXJZJ2.js';
7
+ import { a as SymbolDescriptor } from './DataProvider-DNx9ntBD.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;
@@ -139,12 +141,17 @@ declare class VelaWidget {
139
141
  * drifting out of sync with the topbar. */
140
142
  private syncTimeframeChrome;
141
143
  /**
142
- * The provider name to show: the one that RESOLVED the symbol, not the one configured.
143
- * They differ whenever the `provider` option is just a default (or names something that
144
- * isn't registered) the status line must not claim a venue that served nothing.
144
+ * The venue label to show: the LISTING prefix the resolved symbol's data declares
145
+ * (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol never the one
146
+ * configured or typed. They differ whenever the `provider` option is just a default,
147
+ * the prefix was a listing venue, or the spelling isn't registered — the status line
148
+ * must not claim a venue that served nothing.
145
149
  */
146
150
  private providerLabel;
147
151
  setTimeframe(tf: string): void;
152
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
153
+ * set persists with the rest of the shell state. */
154
+ private setTimeframeFavorite;
148
155
  /**
149
156
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
150
157
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -255,8 +262,14 @@ interface TopbarOptions {
255
262
  onSymbolClick?: () => void;
256
263
  timeframe: string;
257
264
  timeframes: readonly string[];
265
+ /** Favorite timeframes — duration-sorted quick-switch chips, stars in the
266
+ * dropdown rows. Push later changes with {@link Topbar.setTimeframeFavorites}. */
267
+ timeframeFavorites?: readonly string[];
258
268
  priceStyle: string;
259
269
  onTimeframe: (tf: string) => void;
270
+ /** A dropdown star was toggled. Omitted, the dropdown carries no stars and the
271
+ * chips never render — the host owns (and persists) the favorite set. */
272
+ onTimeframeFavorite?: (tf: string, on: boolean) => void;
260
273
  onPriceStyle: (style: string) => void;
261
274
  /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
262
275
  * given) — the grid-canvas picker composing uniform grids, with the workspace
@@ -294,7 +307,10 @@ interface TopbarOptions {
294
307
  declare class Topbar {
295
308
  readonly el: HTMLElement;
296
309
  private readonly symbolEl;
297
- private readonly tfButton;
310
+ /** Duration-sorted favorite chips (plus an unstarred current, when needed). */
311
+ private readonly tfChipsHost;
312
+ private readonly tfCaret;
313
+ private tfFavs;
298
314
  private readonly styleButton;
299
315
  private layoutButton;
300
316
  private layoutPicker;
@@ -325,6 +341,10 @@ declare class Topbar {
325
341
  constructor(host: HTMLElement, opts: TopbarOptions);
326
342
  setSymbol(symbol: string): void;
327
343
  setTimeframe(tf: string): void;
344
+ /** Reflect the favorite-timeframe set — the quick-switch chips and the dropdown stars. */
345
+ setTimeframeFavorites(favs: readonly string[]): void;
346
+ /** Rebuild the quick-switch chips (current value changed, or the favorite set did). */
347
+ private renderTfChips;
328
348
  setPriceStyle(style: string): void;
329
349
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
330
350
  setLayout(id: string): void;
@@ -447,12 +467,6 @@ declare class Watermark {
447
467
  destroy(): void;
448
468
  }
449
469
 
450
- /**
451
- * Rank: ticker prefix > ticker substring > description substring > venue-name substring (typing
452
- * `binance` surfaces that venue's symbols after any literal matches). An optional venue prefix
453
- * (see {@link parseQuery}) scopes the pool first — venue alone browses it whole, alphabetically.
454
- * Pure — unit-tested.
455
- */
456
470
  declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
457
471
  interface SymbolPickerOptions {
458
472
  /** `provider` is the venue of the chosen row — absent only for a source that has none. */
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-7ROONW6H.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-7ROONW6H.js';
3
+ import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-CA3N3PYT.js';
4
+ export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-CA3N3PYT.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
  });
@@ -476,13 +481,15 @@ var VelaWidget = class {
476
481
  this.statusline?.setMeta(tf, this.providerLabel());
477
482
  }
478
483
  /**
479
- * The provider name to show: the one that RESOLVED the symbol, not the one configured.
480
- * They differ whenever the `provider` option is just a default (or names something that
481
- * isn't registered) the status line must not claim a venue that served nothing.
484
+ * The venue label to show: the LISTING prefix the resolved symbol's data declares
485
+ * (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol never the one
486
+ * configured or typed. They differ whenever the `provider` option is just a default,
487
+ * the prefix was a listing venue, or the spelling isn't registered — the status line
488
+ * must not claim a venue that served nothing.
482
489
  */
483
490
  providerLabel() {
484
- const resolved = this.inner?.data.resolve(this.symbol)?.provider;
485
- return resolved ?? parseSymbol(this.symbol).provider ?? "";
491
+ const display = this.inner?.data.displayPrefix(this.symbol);
492
+ return display ?? parseSymbol(this.symbol).provider ?? "";
486
493
  }
487
494
  setTimeframe(tf) {
488
495
  if (tf === this.timeframe || this.destroyed) return;
@@ -493,6 +500,14 @@ var VelaWidget = class {
493
500
  this.markStateDirty();
494
501
  void this.inner?.setMarket({ timeframe: tf, bars: this.bars });
495
502
  }
503
+ /** Star/unstar a timeframe — the topbar chips and dropdown stars follow, and the
504
+ * set persists with the rest of the shell state. */
505
+ setTimeframeFavorite(tf, on) {
506
+ if (on === this.tfFavs.includes(tf)) return;
507
+ this.tfFavs = on ? [tf, ...this.tfFavs] : this.tfFavs.filter((f) => f !== tf);
508
+ this.topbar.setTimeframeFavorites(this.tfFavs);
509
+ this.markStateDirty();
510
+ }
496
511
  /**
497
512
  * Switch the chart symbol in place. An `EXCHANGE:` prefix pins the venue (the
498
513
  * symbol picker composes one from the row the user pointed at) — a bare ticker
@@ -550,6 +565,7 @@ var VelaWidget = class {
550
565
  });
551
566
  const state = { version: 1, layout: "1", activeCellId: "c1", timezone: this.timezone, charts: [{ id: "c1", ...cell }] };
552
567
  if (this.favs.length > 0) state.favorites = [...this.favs];
568
+ if (this.tfFavs.length > 0) state.timeframeFavorites = [...this.tfFavs];
553
569
  const panels = this.dock.getState();
554
570
  if (panels) state.panels = panels;
555
571
  return state;
@@ -573,6 +589,10 @@ var VelaWidget = class {
573
589
  this.favs = [...st.favorites];
574
590
  this.inner?.drawings.setFavorites(this.favs);
575
591
  }
592
+ if (st.timeframeFavorites) {
593
+ this.tfFavs = [...st.timeframeFavorites];
594
+ this.topbar.setTimeframeFavorites(this.tfFavs);
595
+ }
576
596
  this.dock.applyState(st.panels);
577
597
  if (cell) {
578
598
  const style = fromUrl.priceStyle ?? cell.priceStyle;
@@ -829,6 +849,9 @@ var VelaWidget = class {
829
849
  for (const [language, make] of Object.entries(resolveEngines(engines))) chart.registerEngine(language, make());
830
850
  this.inner = chart;
831
851
  this.symbolPicker.setSource(() => chart.data.symbols());
852
+ void chart.data.ready().then(() => {
853
+ if (this.inner === chart) this.statusline?.setMeta(this.timeframe, this.providerLabel());
854
+ });
832
855
  if (this.layoutCtl !== void 0) chart.renderer.setLayoutMode(this.layoutCtl.current);
833
856
  this.objectTree.setSymbol(this.symbol);
834
857
  chart.renderer.setLegendActions(legendActionsProviderFor(chart, () => this.context()));