@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.
- package/README.md +3 -2
- package/dist/{DataProvider-gnzv-dgc.d.cts → DataProvider-Ce6PuCzQ.d.cts} +10 -1
- package/dist/{DataProvider-DTOEXKTI.d.ts → DataProvider-DNx9ntBD.d.ts} +10 -1
- package/dist/{chunk-EY63XBFZ.js → chunk-7ROONW6H.js} +132 -23
- package/dist/{chunk-L5NTMWPP.js → chunk-CA3N3PYT.js} +785 -857
- package/dist/{chunk-LJLZR44Y.js → chunk-EMS6PO2T.js} +5 -7
- package/dist/chunk-OGRQW3M6.js +1328 -0
- package/dist/{chunk-P556H6EA.js → chunk-QWIEKZRE.js} +59 -34
- package/dist/{chunk-WJKLBYRM.js → chunk-ZNL2X6U2.js} +1 -1
- package/dist/{contributions-Ci_i3IN2.d.cts → contributions-DToMhiw3.d.ts} +9 -2
- package/dist/{contributions-b6AVrqqG.d.ts → contributions-Dlc7ZWZz.d.cts} +9 -2
- package/dist/{history-Ci3M0xLV.d.ts → history-BZADxpKx.d.cts} +5 -3
- package/dist/{history-Cf1lVsap.d.cts → history-BuHXJZJ2.d.ts} +5 -3
- package/dist/index.cjs +2761 -1597
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +4 -4
- package/dist/{options-XTBpbx0s.d.ts → options-BlQ00Fju.d.cts} +3 -1
- package/dist/{options-XTBpbx0s.d.cts → options-BlQ00Fju.d.ts} +3 -1
- package/dist/{plugin-DlidwMj6.d.cts → plugin-BNPLOQO1.d.cts} +3 -3
- package/dist/{plugin-DP6A4t4o.d.ts → plugin-BqjEa5r3.d.ts} +3 -3
- package/dist/plugin.cjs +4 -0
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/ui.cjs +1318 -4
- package/dist/ui.d.cts +383 -2
- package/dist/ui.d.ts +383 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +3729 -2565
- package/dist/vela.global.min.js +315 -66
- package/dist/widget.cjs +2359 -1054
- package/dist/widget.d.cts +30 -16
- package/dist/widget.d.ts +30 -16
- package/dist/widget.js +37 -14
- package/dist/workspace.cjs +2259 -944
- package/dist/workspace.d.cts +10 -5
- package/dist/workspace.d.ts +10 -5
- package/dist/workspace.js +29 -8
- package/package.json +1 -1
- 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-
|
|
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-
|
|
3
|
-
import { b as VelaOptions, q as DataWindowReadout } from './options-
|
|
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-
|
|
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-
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
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
|
|
143
|
-
*
|
|
144
|
-
*
|
|
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
|
-
|
|
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-
|
|
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-
|
|
3
|
-
import { b as VelaOptions, q as DataWindowReadout } from './options-
|
|
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-
|
|
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-
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
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
|
|
143
|
-
*
|
|
144
|
-
*
|
|
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
|
-
|
|
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-
|
|
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-
|
|
3
|
-
import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-
|
|
4
|
-
export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-
|
|
5
|
-
import { widgetActions, widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-
|
|
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-
|
|
7
|
-
import {
|
|
8
|
-
import './chunk-
|
|
9
|
-
import { injectStyles } from './chunk-
|
|
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
|
|
480
|
-
*
|
|
481
|
-
*
|
|
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
|
|
485
|
-
return
|
|
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()));
|