@luxalgo/vela 0.6.6 → 0.6.8
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/dist/{DataProvider-JJq7M2it.d.ts → DataProvider-BSLlBpB9.d.ts} +10 -0
- package/dist/{DataProvider-DDUYw2qP.d.cts → DataProvider-BsQM2WNH.d.cts} +10 -0
- package/dist/{chunk-OEUGUXL7.js → chunk-L3I2CCYO.js} +49 -1
- package/dist/{chunk-TMXK2SJR.js → chunk-N7LGMKCE.js} +523 -142
- package/dist/{chunk-JQFO2WMU.js → chunk-SQETIBFU.js} +83 -9
- package/dist/chunk-W4EJWLEO.js +12 -0
- package/dist/{contributions-BqCIsbaP.d.ts → contributions-DLLdV9jD.d.ts} +59 -3
- package/dist/{contributions-DNMqrAuw.d.cts → contributions-Vw-Hm58R.d.cts} +59 -3
- package/dist/index.cjs +110 -8
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +2 -2
- package/dist/{plugin-CN8U2__Q.d.cts → plugin-BnJgjLAy.d.cts} +2 -2
- package/dist/{plugin-WnvNNJOp.d.ts → plugin-CC7rBrOY.d.ts} +2 -2
- package/dist/plugin.cjs +28 -0
- package/dist/plugin.d.cts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.js +1 -1
- package/dist/providers/binance.cjs +16 -0
- package/dist/providers/binance.d.cts +4 -1
- package/dist/providers/binance.d.ts +4 -1
- package/dist/providers/binance.js +7 -0
- package/dist/providers/coinbase.cjs +16 -0
- package/dist/providers/coinbase.d.cts +4 -1
- package/dist/providers/coinbase.d.ts +4 -1
- package/dist/providers/coinbase.js +7 -0
- package/dist/providers/hyperliquid.cjs +16 -0
- package/dist/providers/hyperliquid.d.cts +4 -1
- package/dist/providers/hyperliquid.d.ts +4 -1
- package/dist/providers/hyperliquid.js +7 -0
- package/dist/{bottombar-COnL2Sk4.d.ts → statusline-CGkB2EOo.d.ts} +137 -8
- package/dist/{bottombar-DeDXbF_K.d.cts → statusline-DqzBqy42.d.cts} +137 -8
- package/dist/vela.global.js +136 -8
- package/dist/vela.global.min.js +42 -42
- package/dist/widget.cjs +667 -148
- package/dist/widget.d.cts +50 -81
- package/dist/widget.d.ts +50 -81
- package/dist/widget.js +5 -4
- package/dist/workspace.cjs +613 -150
- package/dist/workspace.d.cts +62 -9
- package/dist/workspace.d.ts +62 -9
- package/dist/workspace.js +4 -3
- package/package.json +1 -1
package/dist/widget.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { V as Vela, W as WidgetContext, A as SidePanelButton } from './contributions-
|
|
2
|
-
export { C as CellStateContext,
|
|
1
|
+
import { V as Vela, W as WidgetContext, A as SidePanelButton } from './contributions-Vw-Hm58R.cjs';
|
|
2
|
+
export { C as CellStateContext, as as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, G as SidePanelDescriptor, H as SidePanelHandle, K as StatePersistenceHandler, U as SymbolRankingHook, $ as WidgetActionDescriptor, a0 as WidgetActionTarget, a1 as WidgetAttachment, a9 as registerSidePanel, aa as registerStatePersistence, ab as registerSymbolRanking, ac as registerWidgetAction, ad as registerWidgetAttachment, af as sidePanels, ag as statePersistenceHandlers, ah as symbolRanking, ai as topbarActionOverride, am as unregisterSidePanel, an as unregisterStatePersistence, ao as unregisterWidgetAction, ap as unregisterWidgetAttachment, aq as widgetActions, ar as widgetAttachments } from './contributions-Vw-Hm58R.cjs';
|
|
3
3
|
import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, r as DataWindowReadout } from './options-BaVTMXaO.cjs';
|
|
4
|
-
import {
|
|
5
|
-
export { B as Bottombar,
|
|
4
|
+
import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, P as PanelsState } from './statusline-DqzBqy42.cjs';
|
|
5
|
+
export { B as Bottombar, k as BottombarOptions, C as CellState, g as ChartState, I as IndicatorLoader, l as IndicatorManifest, m as IndicatorManifestEntry, n as RANGE_PRESETS, R as ResolvedIndicator, o as ResolvedTopbarComposition, p as Statusline, q as TOPBAR_BUILTIN_IDS, r as TOPBAR_DEFAULT_LEFT, t as TOPBAR_DEFAULT_RIGHT, V as VelaStorage, u as WidgetStorage, h as decodeState, i as encodeState, v as localStorageAdapter, w as pinnedTopbarActionIds, x as resolveIndicators, y as resolveTopbarComposition, s as sanitizeState, z as topbarHas } from './statusline-DqzBqy42.cjs';
|
|
6
6
|
import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-BsQM2WNH.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
|
|
|
@@ -104,6 +104,11 @@ interface TopbarOptions {
|
|
|
104
104
|
onAlertsClick?: (anchor: HTMLElement) => void;
|
|
105
105
|
/** Live widget context for contributed actions (topbar target). */
|
|
106
106
|
getContext?: () => WidgetContext;
|
|
107
|
+
/** The host's declarative composition (see {@link TopbarComposition}) — which
|
|
108
|
+
* entries render, per side, in list order. An undeclared side keeps its default.
|
|
109
|
+
* The shell that owns this bar also gates the matching mobile entries and
|
|
110
|
+
* keyboard chords on the same composition — the bar only handles its own DOM. */
|
|
111
|
+
composition?: TopbarComposition;
|
|
107
112
|
}
|
|
108
113
|
declare class Topbar {
|
|
109
114
|
readonly el: HTMLElement;
|
|
@@ -133,6 +138,19 @@ declare class Topbar {
|
|
|
133
138
|
private panelTooltips;
|
|
134
139
|
private readonly host;
|
|
135
140
|
private alertsBadge;
|
|
141
|
+
/** The resolved composition (defaults applied) — what renders, where, in order. */
|
|
142
|
+
private readonly comp;
|
|
143
|
+
/** Pinned contributed-action slots, by action id (composition entries that name one,
|
|
144
|
+
* plus built-in slots taken over by an override). */
|
|
145
|
+
private readonly pinned;
|
|
146
|
+
/** Overrides that LEFT their native slot (default side + a declared `order`) — they
|
|
147
|
+
* render through the flow cluster like ordinary actions. */
|
|
148
|
+
private readonly flowingOverrides;
|
|
149
|
+
/** Tooltips of the CURRENT icon-only action buttons — rebuilt with every
|
|
150
|
+
* renderActions pass (contributed buttons are replaceChildren'd away). */
|
|
151
|
+
private actionTooltips;
|
|
152
|
+
/** `iconOnly` misuse warned once per action id (renderActions re-runs freely). */
|
|
153
|
+
private readonly warnedIconless;
|
|
136
154
|
private readonly opts;
|
|
137
155
|
private timeframe;
|
|
138
156
|
private priceStyle;
|
|
@@ -151,7 +169,10 @@ declare class Topbar {
|
|
|
151
169
|
setLayout(id: string): void;
|
|
152
170
|
private renderLayoutButton;
|
|
153
171
|
private renderStyleButton;
|
|
154
|
-
/** Re-project the contributed topbar actions (call after registrations change).
|
|
172
|
+
/** Re-project the contributed topbar actions (call after registrations change).
|
|
173
|
+
* An action PINNED by the composition renders into its named slot (list position
|
|
174
|
+
* wins over `align`/`order`); the rest flow into the side's `actions` slot — or
|
|
175
|
+
* not at all when an explicit list omits it (the list is the side's contract). */
|
|
155
176
|
renderActions(): void;
|
|
156
177
|
setIndicatorCount(_n: number): void;
|
|
157
178
|
/** Enable/disable the undo and redo tools from the host's unified history. */
|
|
@@ -175,78 +196,6 @@ declare class Topbar {
|
|
|
175
196
|
private styleItems;
|
|
176
197
|
}
|
|
177
198
|
|
|
178
|
-
/** How the status line reads a bar out: the four O/H/L/C values (bar-shaped styles),
|
|
179
|
-
* or the single plotted value — the close — for one-line styles (line/area/baseline). */
|
|
180
|
-
type StatuslineReadout = 'ohlc' | 'value';
|
|
181
|
-
/** The market session states the status badge can wear. Crypto venues trade
|
|
182
|
-
* continuously and stay 'open'; the full vocabulary is ready for providers that
|
|
183
|
-
* carry a session model (equities RTH/ETH, exchange holidays). */
|
|
184
|
-
type MarketStatus = 'open' | 'pre' | 'post' | 'closed' | 'holiday';
|
|
185
|
-
declare class Statusline {
|
|
186
|
-
private readonly host;
|
|
187
|
-
readonly el: HTMLElement;
|
|
188
|
-
private readonly ohlcEl;
|
|
189
|
-
private readonly changeEl;
|
|
190
|
-
private readonly symbolEl;
|
|
191
|
-
private readonly marketEl;
|
|
192
|
-
private marketTip;
|
|
193
|
-
private avatarEl;
|
|
194
|
-
private metaEl;
|
|
195
|
-
private readonly parts;
|
|
196
|
-
private lastBar;
|
|
197
|
-
private hoverBar;
|
|
198
|
-
private unsubs;
|
|
199
|
-
/** Up/down ink for the OHLC + change values — the ACTIVE price style's configured
|
|
200
|
-
* colors (candle bodies, bar ticks, the line color, …); null falls back to the theme
|
|
201
|
-
* tokens. `isUp` overrides the close-vs-open direction rule where the style paints by
|
|
202
|
-
* something else (baseline: position against the baseline price). */
|
|
203
|
-
private upColor;
|
|
204
|
-
private downColor;
|
|
205
|
-
private isUp;
|
|
206
|
-
/** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
|
|
207
|
-
private readout;
|
|
208
|
-
/** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
|
|
209
|
-
private fitMode;
|
|
210
|
-
private fitRO;
|
|
211
|
-
constructor(host: HTMLElement, symbol: string);
|
|
212
|
-
setSymbol(symbol: string): void;
|
|
213
|
-
/**
|
|
214
|
-
* Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
|
|
215
|
-
* Segments that don't fit are hidden outright rather than clipped mid-glyph, least
|
|
216
|
-
* important first: OHLC, then the bar change, the venue/timeframe meta, and the
|
|
217
|
-
* market badge; the logo + ticker always stay. Re-fits live on host resizes.
|
|
218
|
-
*/
|
|
219
|
-
setFitMode(on: boolean): void;
|
|
220
|
-
/** Project the parts config onto the segments (the baseline fit() prunes from). */
|
|
221
|
-
private syncParts;
|
|
222
|
-
/** Hide overflowing segments until the row fits its max-width (fit mode only). */
|
|
223
|
-
private fit;
|
|
224
|
-
/** Shape + color the value readout after the active price style: its own up/down
|
|
225
|
-
* colors (candle bodies, bar ticks, the line color, …), the direction rule that
|
|
226
|
-
* picks between them (`isUp` replaces close-vs-open where the style paints by
|
|
227
|
-
* something else — baseline by position), and whether the readout is the four
|
|
228
|
-
* O/H/L/C values or the single plotted value (one-line styles). Null colors fall
|
|
229
|
-
* back to the theme's up/down tokens. See {@link statuslineInkOf}, which derives
|
|
230
|
-
* all of it from the live renderer. */
|
|
231
|
-
setDirectionColors(up: string | null, down: string | null, isUp?: ((bar: {
|
|
232
|
-
open: number;
|
|
233
|
-
close: number;
|
|
234
|
-
}) => boolean) | null, readout?: StatuslineReadout): void;
|
|
235
|
-
/** Show/hide one part (the settings dialog's Status line tab drives these). */
|
|
236
|
-
/** The "· BINANCE · 1h" segment after the symbol — venue first, then resolution. */
|
|
237
|
-
setMeta(timeframe: string, provider: string): void;
|
|
238
|
-
/** Dress the market badge for a session state: its icon, tinted circle, and the
|
|
239
|
-
* hover label. Callers with no session model leave the constructor's 'open'. */
|
|
240
|
-
setMarketStatus(status: MarketStatus): void;
|
|
241
|
-
setPartVisible(part: 'name' | 'market' | 'ohlc' | 'change', visible: boolean): void;
|
|
242
|
-
partVisible(part: 'name' | 'market' | 'ohlc' | 'change'): boolean;
|
|
243
|
-
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
244
|
-
onChart(chart: Vela): void;
|
|
245
|
-
destroy(): void;
|
|
246
|
-
private detach;
|
|
247
|
-
private render;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
199
|
declare class Watermark {
|
|
251
200
|
readonly el: HTMLElement;
|
|
252
201
|
private readonly text;
|
|
@@ -268,7 +217,7 @@ declare class Watermark {
|
|
|
268
217
|
destroy(): void;
|
|
269
218
|
}
|
|
270
219
|
|
|
271
|
-
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
|
|
220
|
+
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number, top?: readonly string[] | false): SymbolDescriptor[];
|
|
272
221
|
interface SymbolPickerOptions {
|
|
273
222
|
/** `provider` is the venue of the chosen row — absent only for a source that has none. */
|
|
274
223
|
/** Called with the CHOSEN symbol — `EXCHANGE:`-prefixed when the row named a venue,
|
|
@@ -276,8 +225,12 @@ interface SymbolPickerOptions {
|
|
|
276
225
|
onSelect: (symbol: string) => void;
|
|
277
226
|
onOpenChange?: (open: boolean) => void;
|
|
278
227
|
host?: HTMLElement;
|
|
228
|
+
/** The row's icon URL — routed to the descriptor's OWNING provider
|
|
229
|
+
* (`resolveSymbolIcon`). Absent or `undefined` per row ⇒ the initials badge. */
|
|
230
|
+
iconFor?: (d: SymbolDescriptor) => string | undefined;
|
|
279
231
|
}
|
|
280
232
|
declare class SymbolPicker {
|
|
233
|
+
private readonly opts;
|
|
281
234
|
private readonly dialog;
|
|
282
235
|
private readonly input;
|
|
283
236
|
private readonly list;
|
|
@@ -288,6 +241,9 @@ declare class SymbolPicker {
|
|
|
288
241
|
private activeTab;
|
|
289
242
|
private tabs;
|
|
290
243
|
private visible;
|
|
244
|
+
/** The ranked pool cache — `key` fingerprints the raw pool the ranking ran on. */
|
|
245
|
+
private ranked;
|
|
246
|
+
private ranking;
|
|
291
247
|
constructor(opts: SymbolPickerOptions);
|
|
292
248
|
/** Wire where symbols come from (re-called on every widget rebuild). */
|
|
293
249
|
setSource(source: () => readonly SymbolDescriptor[]): void;
|
|
@@ -297,6 +253,11 @@ declare class SymbolPicker {
|
|
|
297
253
|
private select;
|
|
298
254
|
private moveHighlight;
|
|
299
255
|
private renderHighlight;
|
|
256
|
+
/** The picker's pool: the source, shaped by the registered symbol ranking. Cached —
|
|
257
|
+
* the hook runs when the pool CHANGES (an index lands or refreshes), never per
|
|
258
|
+
* keystroke; an async hook resolves onto the next repaint (stale-while-revalidate
|
|
259
|
+
* in between, the raw pool before the first resolve). */
|
|
260
|
+
private pool;
|
|
300
261
|
private computeRows;
|
|
301
262
|
private refresh;
|
|
302
263
|
/** Append the page the grown `visible` just uncovered — rows already on screen stay put. */
|
|
@@ -428,9 +389,14 @@ declare class PanelDock {
|
|
|
428
389
|
}
|
|
429
390
|
|
|
430
391
|
declare class ObjectTree extends SidePanel {
|
|
392
|
+
/** The price row's avatar icon URL for a raw symbol — routed by the shell to the
|
|
393
|
+
* owning provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
394
|
+
private readonly iconFor?;
|
|
431
395
|
private chart;
|
|
432
396
|
private selectedDrawing;
|
|
433
397
|
private symbolName;
|
|
398
|
+
/** The raw (possibly venue-prefixed) symbol — what icon resolution routes on. */
|
|
399
|
+
private symbolRaw;
|
|
434
400
|
/** Drawing bundles — a view-side grouping, held for the panel's lifetime and never persisted.
|
|
435
401
|
* Kept per chart because a workspace points this one panel at whichever chart is active, and
|
|
436
402
|
* each chart's bundles have to survive the switch. */
|
|
@@ -454,7 +420,10 @@ declare class ObjectTree extends SidePanel {
|
|
|
454
420
|
private menu;
|
|
455
421
|
private menuActions;
|
|
456
422
|
private drag;
|
|
457
|
-
constructor(host: HTMLElement
|
|
423
|
+
constructor(host: HTMLElement,
|
|
424
|
+
/** The price row's avatar icon URL for a raw symbol — routed by the shell to the
|
|
425
|
+
* owning provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
426
|
+
iconFor?: ((symbol: string) => string | undefined) | undefined);
|
|
458
427
|
toggle(open?: boolean): void;
|
|
459
428
|
setSymbol(symbol: string): void;
|
|
460
429
|
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
@@ -685,4 +654,4 @@ declare function fmtPrice(n: number | null | undefined, dp?: number): string;
|
|
|
685
654
|
/** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable. */
|
|
686
655
|
declare function fmtChange(open: number | null | undefined, close: number | null | undefined): string;
|
|
687
656
|
|
|
688
|
-
export { type BuiltInPanel, ChartContextMenu, type ContextMenuCallbacks, DataWindow, type DataWindowLine, type DataWindowSection, IndicatorPicker, type IndicatorPickerOptions, type IndicatorRow, ObjectTree, type PanelChrome, PanelDock, type PanelDockDeps, PanelsState, type ParsedTimeframe, RangePreset, ShortcutsHelp, SidePanel, SidePanelButton,
|
|
657
|
+
export { type BuiltInPanel, ChartContextMenu, type ContextMenuCallbacks, DataWindow, type DataWindowLine, type DataWindowSection, IndicatorPicker, type IndicatorPickerOptions, type IndicatorRow, ObjectTree, type PanelChrome, PanelDock, type PanelDockDeps, PanelsState, type ParsedTimeframe, RangePreset, ShortcutsHelp, SidePanel, SidePanelButton, SymbolPicker, type SymbolPickerOptions, TIMEZONES, TimeframeQuick, type TimeframeQuickOptions, type TimezoneEntry, Topbar, TopbarComposition, type TopbarOptions, VelaShellOptions, VelaWidget, type VelaWidgetOptions, Watermark, WidgetContext, WorkspaceState, dataWindowSections, decimalsFor, filterSymbols, fmtChange, fmtPrice, normalizeTimezone, parseTimeframe, priceStyleLabel, timeframeLabel, timeframeMs, tzButtonLabel, tzMenuLabel, tzOffset };
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { V as Vela, W as WidgetContext, A as SidePanelButton } from './contributions-
|
|
2
|
-
export { C as CellStateContext,
|
|
1
|
+
import { V as Vela, W as WidgetContext, A as SidePanelButton } from './contributions-DLLdV9jD.js';
|
|
2
|
+
export { C as CellStateContext, as as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, G as SidePanelDescriptor, H as SidePanelHandle, K as StatePersistenceHandler, U as SymbolRankingHook, $ as WidgetActionDescriptor, a0 as WidgetActionTarget, a1 as WidgetAttachment, a9 as registerSidePanel, aa as registerStatePersistence, ab as registerSymbolRanking, ac as registerWidgetAction, ad as registerWidgetAttachment, af as sidePanels, ag as statePersistenceHandlers, ah as symbolRanking, ai as topbarActionOverride, am as unregisterSidePanel, an as unregisterStatePersistence, ao as unregisterWidgetAction, ap as unregisterWidgetAttachment, aq as widgetActions, ar as widgetAttachments } from './contributions-DLLdV9jD.js';
|
|
3
3
|
import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, r as DataWindowReadout } from './options-BaVTMXaO.js';
|
|
4
|
-
import {
|
|
5
|
-
export { B as Bottombar,
|
|
4
|
+
import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, P as PanelsState } from './statusline-CGkB2EOo.js';
|
|
5
|
+
export { B as Bottombar, k as BottombarOptions, C as CellState, g as ChartState, I as IndicatorLoader, l as IndicatorManifest, m as IndicatorManifestEntry, n as RANGE_PRESETS, R as ResolvedIndicator, o as ResolvedTopbarComposition, p as Statusline, q as TOPBAR_BUILTIN_IDS, r as TOPBAR_DEFAULT_LEFT, t as TOPBAR_DEFAULT_RIGHT, V as VelaStorage, u as WidgetStorage, h as decodeState, i as encodeState, v as localStorageAdapter, w as pinnedTopbarActionIds, x as resolveIndicators, y as resolveTopbarComposition, s as sanitizeState, z as topbarHas } from './statusline-CGkB2EOo.js';
|
|
6
6
|
import { K as KeymapManager } from './keymap-CGOz5F5f.js';
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-BSLlBpB9.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
|
|
|
@@ -104,6 +104,11 @@ interface TopbarOptions {
|
|
|
104
104
|
onAlertsClick?: (anchor: HTMLElement) => void;
|
|
105
105
|
/** Live widget context for contributed actions (topbar target). */
|
|
106
106
|
getContext?: () => WidgetContext;
|
|
107
|
+
/** The host's declarative composition (see {@link TopbarComposition}) — which
|
|
108
|
+
* entries render, per side, in list order. An undeclared side keeps its default.
|
|
109
|
+
* The shell that owns this bar also gates the matching mobile entries and
|
|
110
|
+
* keyboard chords on the same composition — the bar only handles its own DOM. */
|
|
111
|
+
composition?: TopbarComposition;
|
|
107
112
|
}
|
|
108
113
|
declare class Topbar {
|
|
109
114
|
readonly el: HTMLElement;
|
|
@@ -133,6 +138,19 @@ declare class Topbar {
|
|
|
133
138
|
private panelTooltips;
|
|
134
139
|
private readonly host;
|
|
135
140
|
private alertsBadge;
|
|
141
|
+
/** The resolved composition (defaults applied) — what renders, where, in order. */
|
|
142
|
+
private readonly comp;
|
|
143
|
+
/** Pinned contributed-action slots, by action id (composition entries that name one,
|
|
144
|
+
* plus built-in slots taken over by an override). */
|
|
145
|
+
private readonly pinned;
|
|
146
|
+
/** Overrides that LEFT their native slot (default side + a declared `order`) — they
|
|
147
|
+
* render through the flow cluster like ordinary actions. */
|
|
148
|
+
private readonly flowingOverrides;
|
|
149
|
+
/** Tooltips of the CURRENT icon-only action buttons — rebuilt with every
|
|
150
|
+
* renderActions pass (contributed buttons are replaceChildren'd away). */
|
|
151
|
+
private actionTooltips;
|
|
152
|
+
/** `iconOnly` misuse warned once per action id (renderActions re-runs freely). */
|
|
153
|
+
private readonly warnedIconless;
|
|
136
154
|
private readonly opts;
|
|
137
155
|
private timeframe;
|
|
138
156
|
private priceStyle;
|
|
@@ -151,7 +169,10 @@ declare class Topbar {
|
|
|
151
169
|
setLayout(id: string): void;
|
|
152
170
|
private renderLayoutButton;
|
|
153
171
|
private renderStyleButton;
|
|
154
|
-
/** Re-project the contributed topbar actions (call after registrations change).
|
|
172
|
+
/** Re-project the contributed topbar actions (call after registrations change).
|
|
173
|
+
* An action PINNED by the composition renders into its named slot (list position
|
|
174
|
+
* wins over `align`/`order`); the rest flow into the side's `actions` slot — or
|
|
175
|
+
* not at all when an explicit list omits it (the list is the side's contract). */
|
|
155
176
|
renderActions(): void;
|
|
156
177
|
setIndicatorCount(_n: number): void;
|
|
157
178
|
/** Enable/disable the undo and redo tools from the host's unified history. */
|
|
@@ -175,78 +196,6 @@ declare class Topbar {
|
|
|
175
196
|
private styleItems;
|
|
176
197
|
}
|
|
177
198
|
|
|
178
|
-
/** How the status line reads a bar out: the four O/H/L/C values (bar-shaped styles),
|
|
179
|
-
* or the single plotted value — the close — for one-line styles (line/area/baseline). */
|
|
180
|
-
type StatuslineReadout = 'ohlc' | 'value';
|
|
181
|
-
/** The market session states the status badge can wear. Crypto venues trade
|
|
182
|
-
* continuously and stay 'open'; the full vocabulary is ready for providers that
|
|
183
|
-
* carry a session model (equities RTH/ETH, exchange holidays). */
|
|
184
|
-
type MarketStatus = 'open' | 'pre' | 'post' | 'closed' | 'holiday';
|
|
185
|
-
declare class Statusline {
|
|
186
|
-
private readonly host;
|
|
187
|
-
readonly el: HTMLElement;
|
|
188
|
-
private readonly ohlcEl;
|
|
189
|
-
private readonly changeEl;
|
|
190
|
-
private readonly symbolEl;
|
|
191
|
-
private readonly marketEl;
|
|
192
|
-
private marketTip;
|
|
193
|
-
private avatarEl;
|
|
194
|
-
private metaEl;
|
|
195
|
-
private readonly parts;
|
|
196
|
-
private lastBar;
|
|
197
|
-
private hoverBar;
|
|
198
|
-
private unsubs;
|
|
199
|
-
/** Up/down ink for the OHLC + change values — the ACTIVE price style's configured
|
|
200
|
-
* colors (candle bodies, bar ticks, the line color, …); null falls back to the theme
|
|
201
|
-
* tokens. `isUp` overrides the close-vs-open direction rule where the style paints by
|
|
202
|
-
* something else (baseline: position against the baseline price). */
|
|
203
|
-
private upColor;
|
|
204
|
-
private downColor;
|
|
205
|
-
private isUp;
|
|
206
|
-
/** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
|
|
207
|
-
private readout;
|
|
208
|
-
/** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
|
|
209
|
-
private fitMode;
|
|
210
|
-
private fitRO;
|
|
211
|
-
constructor(host: HTMLElement, symbol: string);
|
|
212
|
-
setSymbol(symbol: string): void;
|
|
213
|
-
/**
|
|
214
|
-
* Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
|
|
215
|
-
* Segments that don't fit are hidden outright rather than clipped mid-glyph, least
|
|
216
|
-
* important first: OHLC, then the bar change, the venue/timeframe meta, and the
|
|
217
|
-
* market badge; the logo + ticker always stay. Re-fits live on host resizes.
|
|
218
|
-
*/
|
|
219
|
-
setFitMode(on: boolean): void;
|
|
220
|
-
/** Project the parts config onto the segments (the baseline fit() prunes from). */
|
|
221
|
-
private syncParts;
|
|
222
|
-
/** Hide overflowing segments until the row fits its max-width (fit mode only). */
|
|
223
|
-
private fit;
|
|
224
|
-
/** Shape + color the value readout after the active price style: its own up/down
|
|
225
|
-
* colors (candle bodies, bar ticks, the line color, …), the direction rule that
|
|
226
|
-
* picks between them (`isUp` replaces close-vs-open where the style paints by
|
|
227
|
-
* something else — baseline by position), and whether the readout is the four
|
|
228
|
-
* O/H/L/C values or the single plotted value (one-line styles). Null colors fall
|
|
229
|
-
* back to the theme's up/down tokens. See {@link statuslineInkOf}, which derives
|
|
230
|
-
* all of it from the live renderer. */
|
|
231
|
-
setDirectionColors(up: string | null, down: string | null, isUp?: ((bar: {
|
|
232
|
-
open: number;
|
|
233
|
-
close: number;
|
|
234
|
-
}) => boolean) | null, readout?: StatuslineReadout): void;
|
|
235
|
-
/** Show/hide one part (the settings dialog's Status line tab drives these). */
|
|
236
|
-
/** The "· BINANCE · 1h" segment after the symbol — venue first, then resolution. */
|
|
237
|
-
setMeta(timeframe: string, provider: string): void;
|
|
238
|
-
/** Dress the market badge for a session state: its icon, tinted circle, and the
|
|
239
|
-
* hover label. Callers with no session model leave the constructor's 'open'. */
|
|
240
|
-
setMarketStatus(status: MarketStatus): void;
|
|
241
|
-
setPartVisible(part: 'name' | 'market' | 'ohlc' | 'change', visible: boolean): void;
|
|
242
|
-
partVisible(part: 'name' | 'market' | 'ohlc' | 'change'): boolean;
|
|
243
|
-
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
244
|
-
onChart(chart: Vela): void;
|
|
245
|
-
destroy(): void;
|
|
246
|
-
private detach;
|
|
247
|
-
private render;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
199
|
declare class Watermark {
|
|
251
200
|
readonly el: HTMLElement;
|
|
252
201
|
private readonly text;
|
|
@@ -268,7 +217,7 @@ declare class Watermark {
|
|
|
268
217
|
destroy(): void;
|
|
269
218
|
}
|
|
270
219
|
|
|
271
|
-
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
|
|
220
|
+
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number, top?: readonly string[] | false): SymbolDescriptor[];
|
|
272
221
|
interface SymbolPickerOptions {
|
|
273
222
|
/** `provider` is the venue of the chosen row — absent only for a source that has none. */
|
|
274
223
|
/** Called with the CHOSEN symbol — `EXCHANGE:`-prefixed when the row named a venue,
|
|
@@ -276,8 +225,12 @@ interface SymbolPickerOptions {
|
|
|
276
225
|
onSelect: (symbol: string) => void;
|
|
277
226
|
onOpenChange?: (open: boolean) => void;
|
|
278
227
|
host?: HTMLElement;
|
|
228
|
+
/** The row's icon URL — routed to the descriptor's OWNING provider
|
|
229
|
+
* (`resolveSymbolIcon`). Absent or `undefined` per row ⇒ the initials badge. */
|
|
230
|
+
iconFor?: (d: SymbolDescriptor) => string | undefined;
|
|
279
231
|
}
|
|
280
232
|
declare class SymbolPicker {
|
|
233
|
+
private readonly opts;
|
|
281
234
|
private readonly dialog;
|
|
282
235
|
private readonly input;
|
|
283
236
|
private readonly list;
|
|
@@ -288,6 +241,9 @@ declare class SymbolPicker {
|
|
|
288
241
|
private activeTab;
|
|
289
242
|
private tabs;
|
|
290
243
|
private visible;
|
|
244
|
+
/** The ranked pool cache — `key` fingerprints the raw pool the ranking ran on. */
|
|
245
|
+
private ranked;
|
|
246
|
+
private ranking;
|
|
291
247
|
constructor(opts: SymbolPickerOptions);
|
|
292
248
|
/** Wire where symbols come from (re-called on every widget rebuild). */
|
|
293
249
|
setSource(source: () => readonly SymbolDescriptor[]): void;
|
|
@@ -297,6 +253,11 @@ declare class SymbolPicker {
|
|
|
297
253
|
private select;
|
|
298
254
|
private moveHighlight;
|
|
299
255
|
private renderHighlight;
|
|
256
|
+
/** The picker's pool: the source, shaped by the registered symbol ranking. Cached —
|
|
257
|
+
* the hook runs when the pool CHANGES (an index lands or refreshes), never per
|
|
258
|
+
* keystroke; an async hook resolves onto the next repaint (stale-while-revalidate
|
|
259
|
+
* in between, the raw pool before the first resolve). */
|
|
260
|
+
private pool;
|
|
300
261
|
private computeRows;
|
|
301
262
|
private refresh;
|
|
302
263
|
/** Append the page the grown `visible` just uncovered — rows already on screen stay put. */
|
|
@@ -428,9 +389,14 @@ declare class PanelDock {
|
|
|
428
389
|
}
|
|
429
390
|
|
|
430
391
|
declare class ObjectTree extends SidePanel {
|
|
392
|
+
/** The price row's avatar icon URL for a raw symbol — routed by the shell to the
|
|
393
|
+
* owning provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
394
|
+
private readonly iconFor?;
|
|
431
395
|
private chart;
|
|
432
396
|
private selectedDrawing;
|
|
433
397
|
private symbolName;
|
|
398
|
+
/** The raw (possibly venue-prefixed) symbol — what icon resolution routes on. */
|
|
399
|
+
private symbolRaw;
|
|
434
400
|
/** Drawing bundles — a view-side grouping, held for the panel's lifetime and never persisted.
|
|
435
401
|
* Kept per chart because a workspace points this one panel at whichever chart is active, and
|
|
436
402
|
* each chart's bundles have to survive the switch. */
|
|
@@ -454,7 +420,10 @@ declare class ObjectTree extends SidePanel {
|
|
|
454
420
|
private menu;
|
|
455
421
|
private menuActions;
|
|
456
422
|
private drag;
|
|
457
|
-
constructor(host: HTMLElement
|
|
423
|
+
constructor(host: HTMLElement,
|
|
424
|
+
/** The price row's avatar icon URL for a raw symbol — routed by the shell to the
|
|
425
|
+
* owning provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
426
|
+
iconFor?: ((symbol: string) => string | undefined) | undefined);
|
|
458
427
|
toggle(open?: boolean): void;
|
|
459
428
|
setSymbol(symbol: string): void;
|
|
460
429
|
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
@@ -685,4 +654,4 @@ declare function fmtPrice(n: number | null | undefined, dp?: number): string;
|
|
|
685
654
|
/** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable. */
|
|
686
655
|
declare function fmtChange(open: number | null | undefined, close: number | null | undefined): string;
|
|
687
656
|
|
|
688
|
-
export { type BuiltInPanel, ChartContextMenu, type ContextMenuCallbacks, DataWindow, type DataWindowLine, type DataWindowSection, IndicatorPicker, type IndicatorPickerOptions, type IndicatorRow, ObjectTree, type PanelChrome, PanelDock, type PanelDockDeps, PanelsState, type ParsedTimeframe, RangePreset, ShortcutsHelp, SidePanel, SidePanelButton,
|
|
657
|
+
export { type BuiltInPanel, ChartContextMenu, type ContextMenuCallbacks, DataWindow, type DataWindowLine, type DataWindowSection, IndicatorPicker, type IndicatorPickerOptions, type IndicatorRow, ObjectTree, type PanelChrome, PanelDock, type PanelDockDeps, PanelsState, type ParsedTimeframe, RangePreset, ShortcutsHelp, SidePanel, SidePanelButton, SymbolPicker, type SymbolPickerOptions, TIMEZONES, TimeframeQuick, type TimeframeQuickOptions, type TimezoneEntry, Topbar, TopbarComposition, type TopbarOptions, VelaShellOptions, VelaWidget, type VelaWidgetOptions, Watermark, WidgetContext, WorkspaceState, dataWindowSections, decimalsFor, filterSymbols, fmtChange, fmtPrice, normalizeTimezone, parseTimeframe, priceStyleLabel, timeframeLabel, timeframeMs, tzButtonLabel, tzMenuLabel, tzOffset };
|
package/dist/widget.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { VelaWorkspace } 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, localStorageAdapter, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, timeframeLabel, timeframeMs } from './chunk-
|
|
3
|
-
export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-
|
|
4
|
-
export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, SidePanel, clampPanelWidth, registerSidePanel, registerStatePersistence, registerWidgetAction, registerWidgetAttachment, sidePanels, statePersistenceHandlers, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-
|
|
1
|
+
import { VelaWorkspace } from './chunk-N7LGMKCE.js';
|
|
2
|
+
export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, localStorageAdapter, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, timeframeLabel, timeframeMs } from './chunk-N7LGMKCE.js';
|
|
3
|
+
export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-SQETIBFU.js';
|
|
4
|
+
export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, OVERRIDABLE_TOPBAR_IDS, SidePanel, TOPBAR_BUILTIN_IDS, TOPBAR_DEFAULT_LEFT, TOPBAR_DEFAULT_RIGHT, clampPanelWidth, pinnedTopbarActionIds, registerSidePanel, registerStatePersistence, registerSymbolRanking, registerWidgetAction, registerWidgetAttachment, resolveTopbarComposition, sidePanels, statePersistenceHandlers, symbolRanking, topbarActionOverride, topbarHas, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-L3I2CCYO.js';
|
|
5
5
|
import './chunk-2R7BANEM.js';
|
|
6
6
|
import './chunk-OICPLNU7.js';
|
|
7
7
|
import './chunk-PN5KWFZ4.js';
|
|
8
|
+
import './chunk-W4EJWLEO.js';
|
|
8
9
|
|
|
9
10
|
// src/widget/VelaWidget.ts
|
|
10
11
|
var deprecationWarned = false;
|