@luxalgo/vela 0.8.5 → 0.9.1
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-DdqMxKdl.d.cts → DataProvider-B5i0_yY4.d.cts} +1 -1
- package/dist/{DataProvider-BUdlkx9I.d.ts → DataProvider-CPFgSyAm.d.ts} +1 -1
- package/dist/{chunk-QYIO37K7.js → chunk-3H6JO4VL.js} +2405 -1542
- package/dist/{chunk-BN4DNS3O.js → chunk-BLVL7WXF.js} +1156 -468
- package/dist/chunk-O6L27KRB.js +1331 -0
- package/dist/{chunk-WY5H4S4I.js → chunk-PZN4RS4T.js} +91 -36
- package/dist/{chunk-ALTGHKIM.js → chunk-Q7POFYNE.js} +516 -406
- package/dist/{chunk-AUOB7A5Y.js → chunk-WHPQQYH7.js} +29 -13
- package/dist/{contributions-D8xuYc9U.d.cts → contributions-BfBaF6eE.d.ts} +71 -22
- package/dist/{contributions-P9fBBuY1.d.ts → contributions-DupwEkzc.d.cts} +71 -22
- package/dist/index.cjs +4040 -2087
- package/dist/index.d.cts +53 -25
- package/dist/index.d.ts +53 -25
- package/dist/index.js +5 -5
- package/dist/{keymap-CGOz5F5f.d.cts → keymap-C48ughm6.d.ts} +9 -6
- package/dist/{keymap-CGOz5F5f.d.ts → keymap-W0hiajU6.d.cts} +9 -6
- package/dist/locales/ar.cjs +2262 -0
- package/dist/locales/ar.d.cts +5 -0
- package/dist/locales/ar.d.ts +5 -0
- package/dist/locales/ar.js +2260 -0
- package/dist/locales/de.cjs +2262 -0
- package/dist/locales/de.d.cts +5 -0
- package/dist/locales/de.d.ts +5 -0
- package/dist/locales/de.js +2260 -0
- package/dist/locales/en.cjs +2262 -0
- package/dist/locales/en.d.cts +5 -0
- package/dist/locales/en.d.ts +5 -0
- package/dist/locales/en.js +2260 -0
- package/dist/locales/es.cjs +2262 -0
- package/dist/locales/es.d.cts +5 -0
- package/dist/locales/es.d.ts +5 -0
- package/dist/locales/es.js +2260 -0
- package/dist/locales/fr.cjs +2262 -0
- package/dist/locales/fr.d.cts +5 -0
- package/dist/locales/fr.d.ts +5 -0
- package/dist/locales/fr.js +2260 -0
- package/dist/locales/he.cjs +2262 -0
- package/dist/locales/he.d.cts +5 -0
- package/dist/locales/he.d.ts +5 -0
- package/dist/locales/he.js +2260 -0
- package/dist/locales/hi.cjs +2262 -0
- package/dist/locales/hi.d.cts +5 -0
- package/dist/locales/hi.d.ts +5 -0
- package/dist/locales/hi.js +2260 -0
- package/dist/locales/id.cjs +2262 -0
- package/dist/locales/id.d.cts +5 -0
- package/dist/locales/id.d.ts +5 -0
- package/dist/locales/id.js +2260 -0
- package/dist/locales/it.cjs +2262 -0
- package/dist/locales/it.d.cts +5 -0
- package/dist/locales/it.d.ts +5 -0
- package/dist/locales/it.js +2260 -0
- package/dist/locales/ja.cjs +2262 -0
- package/dist/locales/ja.d.cts +5 -0
- package/dist/locales/ja.d.ts +5 -0
- package/dist/locales/ja.js +2260 -0
- package/dist/locales/ko.cjs +2262 -0
- package/dist/locales/ko.d.cts +5 -0
- package/dist/locales/ko.d.ts +5 -0
- package/dist/locales/ko.js +2260 -0
- package/dist/locales/ms.cjs +2262 -0
- package/dist/locales/ms.d.cts +5 -0
- package/dist/locales/ms.d.ts +5 -0
- package/dist/locales/ms.js +2260 -0
- package/dist/locales/pl.cjs +2262 -0
- package/dist/locales/pl.d.cts +5 -0
- package/dist/locales/pl.d.ts +5 -0
- package/dist/locales/pl.js +2260 -0
- package/dist/locales/pt-BR.cjs +2262 -0
- package/dist/locales/pt-BR.d.cts +5 -0
- package/dist/locales/pt-BR.d.ts +5 -0
- package/dist/locales/pt-BR.js +2260 -0
- package/dist/locales/ru.cjs +2262 -0
- package/dist/locales/ru.d.cts +5 -0
- package/dist/locales/ru.d.ts +5 -0
- package/dist/locales/ru.js +2260 -0
- package/dist/locales/th.cjs +2262 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/locales/th.js +2260 -0
- package/dist/locales/tr.cjs +2262 -0
- package/dist/locales/tr.d.cts +5 -0
- package/dist/locales/tr.d.ts +5 -0
- package/dist/locales/tr.js +2260 -0
- package/dist/locales/vi.cjs +2262 -0
- package/dist/locales/vi.d.cts +5 -0
- package/dist/locales/vi.d.ts +5 -0
- package/dist/locales/vi.js +2260 -0
- package/dist/locales/zh-Hans.cjs +2262 -0
- package/dist/locales/zh-Hans.d.cts +5 -0
- package/dist/locales/zh-Hans.d.ts +5 -0
- package/dist/locales/zh-Hans.js +2260 -0
- package/dist/locales/zh-Hant.cjs +2262 -0
- package/dist/locales/zh-Hant.d.cts +5 -0
- package/dist/locales/zh-Hant.d.ts +5 -0
- package/dist/locales/zh-Hant.js +2260 -0
- package/dist/{options-BI5Tp32b.d.ts → options-B7aL1pbf.d.ts} +74 -9
- package/dist/{options-BI5Tp32b.d.cts → options-I1H2HDWw.d.cts} +74 -9
- package/dist/{plugin-B8F1nor8.d.cts → plugin-BGz-Vsdv.d.cts} +81 -35
- package/dist/{plugin-D5Z-Q6TX.d.ts → plugin-BZHypj8h.d.ts} +81 -35
- package/dist/plugin.cjs +1268 -319
- package/dist/plugin.d.cts +7 -6
- package/dist/plugin.d.ts +7 -6
- package/dist/plugin.js +3 -3
- package/dist/providers/binance.cjs +1 -1
- package/dist/providers/binance.d.cts +3 -2
- package/dist/providers/binance.d.ts +3 -2
- package/dist/providers/binance.js +1 -1
- package/dist/providers/coinbase.cjs +1 -1
- package/dist/providers/coinbase.d.cts +3 -2
- package/dist/providers/coinbase.d.ts +3 -2
- package/dist/providers/coinbase.js +1 -1
- package/dist/providers/hyperliquid.cjs +1 -1
- package/dist/providers/hyperliquid.d.cts +3 -2
- package/dist/providers/hyperliquid.d.ts +3 -2
- package/dist/providers/hyperliquid.js +1 -1
- package/dist/{side-panel-_2UK1gSm.d.ts → side-panel-BEQJqSjR.d.cts} +14 -2
- package/dist/{side-panel-_2UK1gSm.d.cts → side-panel-Ud0SBAnE.d.ts} +14 -2
- package/dist/{statusline-model-CTwtDIca.d.cts → statusline-model-Dfb_GD9u.d.ts} +14 -3
- package/dist/{statusline-model-D9kWC9X5.d.ts → statusline-model-PHt0YhmI.d.cts} +14 -3
- package/dist/types-Bwf63xGI.d.cts +2518 -0
- package/dist/types-Bwf63xGI.d.ts +2518 -0
- package/dist/ui.cjs +1008 -56
- package/dist/ui.d.cts +21 -2
- package/dist/ui.d.ts +21 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +4005 -2054
- package/dist/vela.global.min.js +57 -57
- package/dist/widget.cjs +5384 -2698
- package/dist/widget.d.cts +100 -26
- package/dist/widget.d.ts +100 -26
- package/dist/widget.js +19 -11
- package/dist/workspace.cjs +5373 -2705
- package/dist/workspace.d.cts +63 -15
- package/dist/workspace.d.ts +63 -15
- package/dist/workspace.js +6 -6
- package/package.json +9 -2
- package/dist/chunk-I2U4NZD2.js +0 -340
- /package/dist/{chunk-W5YPYZ2P.js → chunk-3EYCX2L4.js} +0 -0
package/dist/widget.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { V as Vela, W as WidgetContext, a1 as SidePanelButton } from './contributions-
|
|
2
|
-
export { C as CellStateContext, i as ContextMenuPointer, aJ as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, a2 as SidePanelDescriptor, a3 as SidePanelHandle, a5 as StatePersistenceHandler, a9 as SymbolRankingHook, ad as WidgetActionDescriptor, ae as WidgetActionTarget, af as WidgetAttachment, ap as registerSidePanel, aq as registerStatePersistence, ar as registerSymbolRanking, as as registerWidgetAction, at as registerWidgetAttachment, av as sidePanels, aw as statePersistenceHandlers, ax as symbolRanking, ay as topbarActionOverride, aD as unregisterSidePanel, aE as unregisterStatePersistence, aF as unregisterWidgetAction, aG as unregisterWidgetAttachment, aH as widgetActions, aI as widgetAttachments } from './contributions-
|
|
3
|
-
import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme,
|
|
4
|
-
import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, a as StatuslinePart, P as PanelsState } from './statusline-model-
|
|
5
|
-
export { B as Bottombar, k as BottombarOptions, C as CellState, g as ChartState, D as DrawingToolsState, I as IndicatorLoader, l as IndicatorManifest, m as IndicatorManifestEntry, n as RANGE_PRESETS, R as ResolvedIndicator, o as ResolvedTopbarComposition, p as TOPBAR_BUILTIN_IDS, q as TOPBAR_DEFAULT_LEFT, r as TOPBAR_DEFAULT_RIGHT, V as VelaStorage, t as WidgetStorage, h as decodeState, i as encodeState, u as localStorageAdapter, v as pinnedTopbarActionIds, w as resolveIndicators, x as resolveTopbarComposition, s as sanitizeState, y as topbarHas } from './statusline-model-
|
|
6
|
-
import { K as KeymapManager } from './keymap-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { V as Vela, W as WidgetContext, a1 as SidePanelButton } from './contributions-DupwEkzc.cjs';
|
|
2
|
+
export { C as CellStateContext, i as ContextMenuPointer, aJ as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, a2 as SidePanelDescriptor, a3 as SidePanelHandle, a5 as StatePersistenceHandler, a9 as SymbolRankingHook, ad as WidgetActionDescriptor, ae as WidgetActionTarget, af as WidgetAttachment, ap as registerSidePanel, aq as registerStatePersistence, ar as registerSymbolRanking, as as registerWidgetAction, at as registerWidgetAttachment, av as sidePanels, aw as statePersistenceHandlers, ax as symbolRanking, ay as topbarActionOverride, aD as unregisterSidePanel, aE as unregisterStatePersistence, aF as unregisterWidgetAction, aG as unregisterWidgetAttachment, aH as widgetActions, aI as widgetAttachments } from './contributions-DupwEkzc.cjs';
|
|
3
|
+
import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, w as DataWindowReadout } from './options-I1H2HDWw.cjs';
|
|
4
|
+
import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, a as StatuslinePart, P as PanelsState } from './statusline-model-PHt0YhmI.cjs';
|
|
5
|
+
export { B as Bottombar, k as BottombarOptions, C as CellState, g as ChartState, D as DrawingToolsState, I as IndicatorLoader, l as IndicatorManifest, m as IndicatorManifestEntry, n as RANGE_PRESETS, R as ResolvedIndicator, o as ResolvedTopbarComposition, p as TOPBAR_BUILTIN_IDS, q as TOPBAR_DEFAULT_LEFT, r as TOPBAR_DEFAULT_RIGHT, V as VelaStorage, t as WidgetStorage, h as decodeState, i as encodeState, u as localStorageAdapter, v as pinnedTopbarActionIds, w as resolveIndicators, x as resolveTopbarComposition, s as sanitizeState, y as topbarHas } from './statusline-model-PHt0YhmI.cjs';
|
|
6
|
+
import { K as KeymapManager } from './keymap-W0hiajU6.cjs';
|
|
7
|
+
import { T as Translator, b as LocalizationOptions, c as LocaleChangedEvent, M as MessageLike, i as MessageDescriptor } from './types-Bwf63xGI.cjs';
|
|
8
|
+
import { a as SymbolDescriptor } from './DataProvider-B5i0_yY4.cjs';
|
|
9
|
+
import { d as SidePanel } from './side-panel-BEQJqSjR.cjs';
|
|
10
|
+
export { C as CONTEXT_MENU_BUILTIN_ORDER, 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-BEQJqSjR.cjs';
|
|
10
11
|
|
|
11
12
|
interface VelaWidgetOptions extends VelaOptions, VelaShellOptions {
|
|
12
13
|
/** @deprecated No longer supported — the option is ignored (a console warning
|
|
@@ -41,13 +42,18 @@ declare class VelaWidget {
|
|
|
41
42
|
setIndicatorValuesVisible(visible: boolean): void;
|
|
42
43
|
setTheme(theme: ThemeName | VelaTheme): void;
|
|
43
44
|
setTimezone(zone: string): void;
|
|
45
|
+
/** The widget's translator (see `VelaWorkspace.i18n`). */
|
|
46
|
+
get i18n(): Translator;
|
|
47
|
+
/** Change the language, direction or formatting at runtime (see `VelaWorkspace.setLocale`). */
|
|
48
|
+
setLocale(next: string | LocalizationOptions): void;
|
|
44
49
|
applyRange(preset: RangePreset): void;
|
|
45
50
|
/** The unified state document (`layout: '1'`, one cell). */
|
|
46
51
|
getState(): WorkspaceState;
|
|
47
52
|
/** Restore a state document IN PLACE — the chart instance survives. */
|
|
48
53
|
applyState(state: unknown): void;
|
|
49
|
-
/** Subscribe to `state:changed`
|
|
54
|
+
/** Subscribe to `state:changed` or `locale:changed` (unknown names no-op). */
|
|
50
55
|
on(event: 'state:changed', handler: () => void): () => void;
|
|
56
|
+
on(event: 'locale:changed', handler: (payload: LocaleChangedEvent) => void): () => void;
|
|
51
57
|
destroy(): void;
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -57,7 +63,8 @@ type LayoutPickerShape = {
|
|
|
57
63
|
cols: number;
|
|
58
64
|
};
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
/** A price style's name, in `i18n`'s language (English without one). */
|
|
67
|
+
declare function priceStyleLabel(id: string, i18n?: Translator | null): string;
|
|
61
68
|
interface TopbarOptions {
|
|
62
69
|
symbol: string;
|
|
63
70
|
onSymbolClick?: () => void;
|
|
@@ -112,6 +119,8 @@ interface TopbarOptions {
|
|
|
112
119
|
* The shell that owns this bar also gates the matching mobile entries and
|
|
113
120
|
* keyboard chords on the same composition — the bar only handles its own DOM. */
|
|
114
121
|
composition?: TopbarComposition;
|
|
122
|
+
/** The shell's translator (labels, tooltips, menus). Absent: English. */
|
|
123
|
+
i18n?: Translator;
|
|
115
124
|
}
|
|
116
125
|
declare class Topbar {
|
|
117
126
|
readonly el: HTMLElement;
|
|
@@ -160,6 +169,10 @@ declare class Topbar {
|
|
|
160
169
|
private readonly onHairlineSync;
|
|
161
170
|
private hairlineRo;
|
|
162
171
|
private hairlineRaf;
|
|
172
|
+
/** Re-apply each fixed label in the current language (see {@link relocalize}). */
|
|
173
|
+
private readonly relabels;
|
|
174
|
+
private get i18n();
|
|
175
|
+
private t;
|
|
163
176
|
constructor(host: HTMLElement, opts: TopbarOptions);
|
|
164
177
|
setSymbol(symbol: string): void;
|
|
165
178
|
setTimeframe(tf: string): void;
|
|
@@ -193,6 +206,10 @@ declare class Topbar {
|
|
|
193
206
|
destroy(): void;
|
|
194
207
|
/** One icon-only tool button with its kit tooltip, parked in `sink` for disposal. */
|
|
195
208
|
private toolButton;
|
|
209
|
+
/** A kit tooltip whose text follows the language. */
|
|
210
|
+
private labeledTooltip;
|
|
211
|
+
/** Re-read every label, tooltip and menu in the current language. */
|
|
212
|
+
relocalize(): void;
|
|
196
213
|
/** Paint each `.vela-sep` as exactly one device pixel, snapped to the pixel grid. */
|
|
197
214
|
private syncHairlines;
|
|
198
215
|
private tfItems;
|
|
@@ -271,6 +288,10 @@ declare class Statusline {
|
|
|
271
288
|
private fitKey;
|
|
272
289
|
/** Web fonts landing after the last fit change every width without a resize. */
|
|
273
290
|
private readonly onFontsLoaded;
|
|
291
|
+
/** The bound chart's translator (English until {@link onChart}). */
|
|
292
|
+
private i18n;
|
|
293
|
+
private meta;
|
|
294
|
+
private t;
|
|
274
295
|
constructor(host: HTMLElement, symbol: string,
|
|
275
296
|
/** The avatar's icon URL for a raw symbol — the shell routes it to the owning
|
|
276
297
|
* provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
@@ -308,6 +329,8 @@ declare class Statusline {
|
|
|
308
329
|
}) => boolean) | null, readout?: StatuslineReadout): void;
|
|
309
330
|
/** The "· BINANCE · 1h" segment after the symbol — venue first, then resolution. */
|
|
310
331
|
setMeta(timeframe: string, provider: string): void;
|
|
332
|
+
/** Re-read every label and value in the chart's language. */
|
|
333
|
+
relocalize(): void;
|
|
311
334
|
/** Dress the market badge for a session state: its icon, tinted circle, and the
|
|
312
335
|
* hover label. Callers with no session model leave the constructor's 'open'. */
|
|
313
336
|
setMarketStatus(status: MarketStatus): void;
|
|
@@ -348,6 +371,7 @@ declare class Statusline {
|
|
|
348
371
|
}
|
|
349
372
|
|
|
350
373
|
declare class Watermark {
|
|
374
|
+
private readonly i18n;
|
|
351
375
|
readonly el: HTMLElement;
|
|
352
376
|
private readonly text;
|
|
353
377
|
private readonly replayLine;
|
|
@@ -362,7 +386,11 @@ declare class Watermark {
|
|
|
362
386
|
* canvas, so the mark stays out of its way. Starts true: the FIRST `load:start`
|
|
363
387
|
* fires during chart construction, before any subscriber can see it. */
|
|
364
388
|
private loading;
|
|
365
|
-
|
|
389
|
+
private readonly replayText;
|
|
390
|
+
private symbol;
|
|
391
|
+
private timeframe;
|
|
392
|
+
/** `i18n` reads the chart's translator (absent: English). */
|
|
393
|
+
constructor(host: HTMLElement, symbol: string, timeframe: string, i18n?: () => Translator | null | undefined);
|
|
366
394
|
setVisible(visible: boolean): void;
|
|
367
395
|
/** Show/hide the replay line (the host's toggle); it only ever shows while replaying. */
|
|
368
396
|
setReplayVisible(visible: boolean): void;
|
|
@@ -372,6 +400,8 @@ declare class Watermark {
|
|
|
372
400
|
setLoading(loading: boolean): void;
|
|
373
401
|
private sync;
|
|
374
402
|
update(symbol: string, timeframe: string): void;
|
|
403
|
+
/** Re-read the mark and the replay line in the chart's language. */
|
|
404
|
+
relocalize(): void;
|
|
375
405
|
/** Measure the text at the cap and shrink it to the price pane's width. */
|
|
376
406
|
private fit;
|
|
377
407
|
destroy(): void;
|
|
@@ -388,6 +418,8 @@ interface SymbolPickerOptions {
|
|
|
388
418
|
/** The row's icon URL — routed to the descriptor's OWNING provider
|
|
389
419
|
* (`resolveSymbolIcon`). Absent or `undefined` per row ⇒ the initials badge. */
|
|
390
420
|
iconFor?: (d: SymbolDescriptor) => string | undefined;
|
|
421
|
+
/** The shell's translator. Absent: English. */
|
|
422
|
+
i18n?: Translator;
|
|
391
423
|
}
|
|
392
424
|
declare class SymbolPicker {
|
|
393
425
|
private readonly opts;
|
|
@@ -399,6 +431,7 @@ declare class SymbolPicker {
|
|
|
399
431
|
private highlighted;
|
|
400
432
|
private seed;
|
|
401
433
|
private activeTab;
|
|
434
|
+
private readonly tabButtons;
|
|
402
435
|
private tabs;
|
|
403
436
|
private visible;
|
|
404
437
|
/** The last filter pass returned fewer raw rows than asked — the pool is drained
|
|
@@ -434,6 +467,8 @@ declare class SymbolPicker {
|
|
|
434
467
|
* keystroke; an async hook resolves onto the next repaint (stale-while-revalidate
|
|
435
468
|
* in between, the raw pool before the first resolve). */
|
|
436
469
|
private pool;
|
|
470
|
+
/** The dialog's fixed text in the shell's language, re-read on every open. */
|
|
471
|
+
relabel(): void;
|
|
437
472
|
private computeRows;
|
|
438
473
|
private refresh;
|
|
439
474
|
/** Append the page the grown `visible` just uncovered — rows already on screen stay put. */
|
|
@@ -442,7 +477,12 @@ declare class SymbolPicker {
|
|
|
442
477
|
}
|
|
443
478
|
|
|
444
479
|
interface IndicatorRow {
|
|
480
|
+
/** The name the picker shows, in the shell's language. */
|
|
445
481
|
name: string;
|
|
482
|
+
/** Other names search matches: the English name when {@link name} is a translation, and
|
|
483
|
+
* the short title (`RSI`) in both languages. A reader of any language still finds an
|
|
484
|
+
* indicator by the names its literature uses. */
|
|
485
|
+
aliases?: readonly string[];
|
|
446
486
|
language?: string;
|
|
447
487
|
category?: string;
|
|
448
488
|
/** Core-computed (native) indicator — accent styling + 'native' routing. */
|
|
@@ -461,6 +501,8 @@ interface IndicatorPickerOptions {
|
|
|
461
501
|
onRemove: (instanceIndex: number) => void;
|
|
462
502
|
onOpenChange?: (open: boolean) => void;
|
|
463
503
|
host?: HTMLElement;
|
|
504
|
+
/** The shell's translator. Absent: English. */
|
|
505
|
+
i18n?: Translator;
|
|
464
506
|
}
|
|
465
507
|
declare class IndicatorPicker {
|
|
466
508
|
private readonly dialog;
|
|
@@ -470,6 +512,9 @@ declare class IndicatorPicker {
|
|
|
470
512
|
private isOpen;
|
|
471
513
|
constructor(opts: IndicatorPickerOptions);
|
|
472
514
|
open(): void;
|
|
515
|
+
/** The dialog's fixed text in the shell's language, re-read on every open. */
|
|
516
|
+
relabel(): void;
|
|
517
|
+
private t;
|
|
473
518
|
/** Re-render the lists if the dialog is open (async catalog updates land late). */
|
|
474
519
|
sync(): void;
|
|
475
520
|
close(): void;
|
|
@@ -481,12 +526,18 @@ interface TimeframeQuickOptions {
|
|
|
481
526
|
onApply: (canonical: string) => void;
|
|
482
527
|
onOpenChange?: (open: boolean) => void;
|
|
483
528
|
host?: HTMLElement;
|
|
529
|
+
/** The shell's translator. Absent: English. */
|
|
530
|
+
i18n?: Translator;
|
|
484
531
|
}
|
|
485
532
|
declare class TimeframeQuick {
|
|
486
533
|
private readonly dialog;
|
|
487
534
|
private readonly input;
|
|
488
535
|
private readonly hint;
|
|
536
|
+
private readonly i18n;
|
|
537
|
+
private t;
|
|
489
538
|
constructor(opts: TimeframeQuickOptions);
|
|
539
|
+
/** The dialog's title in the shell's language, re-read on every open. */
|
|
540
|
+
relabel(): void;
|
|
490
541
|
open(seed?: string): void;
|
|
491
542
|
get isOpen(): boolean;
|
|
492
543
|
/** Text typed at the entry that never reached its field: closed, it opens seeded
|
|
@@ -511,11 +562,13 @@ interface PanelDockDeps {
|
|
|
511
562
|
context(): WidgetContext;
|
|
512
563
|
/** The dock's persistable state changed (open panel, or a width). */
|
|
513
564
|
changed?(): void;
|
|
565
|
+
/** The shell's translator (panel titles). Absent: English. */
|
|
566
|
+
i18n?: Translator;
|
|
514
567
|
}
|
|
515
568
|
/** A panel the SHELL owns and destroys — the dock only docks it. */
|
|
516
569
|
interface BuiltInPanel {
|
|
517
570
|
id: string;
|
|
518
|
-
title:
|
|
571
|
+
title: MessageLike;
|
|
519
572
|
icon: string;
|
|
520
573
|
order: number;
|
|
521
574
|
panel: SidePanel;
|
|
@@ -552,6 +605,8 @@ declare class PanelDock {
|
|
|
552
605
|
/** The docked panels in dock order — what a non-topbar chrome (the mobile
|
|
553
606
|
* three-dots drawer) lists so every panel stays reachable there too. */
|
|
554
607
|
list(): ReadonlyArray<SidePanelButton>;
|
|
608
|
+
/** Re-read every panel's header and the toggle tooltips in the current language. */
|
|
609
|
+
relocalize(): void;
|
|
555
610
|
/** The dock's persistable state, or null when there is nothing worth saving. */
|
|
556
611
|
getState(): PanelsState | null;
|
|
557
612
|
/**
|
|
@@ -608,7 +663,9 @@ declare class ObjectTree extends SidePanel {
|
|
|
608
663
|
constructor(host: HTMLElement,
|
|
609
664
|
/** The price row's avatar icon URL for a raw symbol — routed by the shell to the
|
|
610
665
|
* owning provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
|
|
611
|
-
iconFor?: ((symbol: string) => string | undefined) | undefined
|
|
666
|
+
iconFor?: ((symbol: string) => string | undefined) | undefined,
|
|
667
|
+
/** The shell's translator. Absent: English. */
|
|
668
|
+
i18n?: Translator);
|
|
612
669
|
toggle(open?: boolean, instant?: boolean): void;
|
|
613
670
|
setSymbol(symbol: string): void;
|
|
614
671
|
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
@@ -617,6 +674,7 @@ declare class ObjectTree extends SidePanel {
|
|
|
617
674
|
private detach;
|
|
618
675
|
/** Read the chart into the layout's input. Every chart query happens here, once a pass. */
|
|
619
676
|
private snapshot;
|
|
677
|
+
relocalize(): void;
|
|
620
678
|
/**
|
|
621
679
|
* Repaint because something changed — unless the panel is mid-interaction. A live drag
|
|
622
680
|
* resolves drops against the rows as currently rendered, and a rename lives in an input
|
|
@@ -742,15 +800,16 @@ interface DataWindowSection {
|
|
|
742
800
|
* direction), then one section per indicator with a line per plot in the plot's own color.
|
|
743
801
|
* Empty when the chart holds no bar to read.
|
|
744
802
|
*/
|
|
745
|
-
declare function dataWindowSections(readout: DataWindowReadout): DataWindowSection[];
|
|
803
|
+
declare function dataWindowSections(readout: DataWindowReadout, i18n?: Translator | null): DataWindowSection[];
|
|
746
804
|
declare class DataWindow extends SidePanel {
|
|
747
805
|
private chart;
|
|
748
806
|
private unsubs;
|
|
749
|
-
constructor(host: HTMLElement);
|
|
807
|
+
constructor(host: HTMLElement, i18n?: Translator);
|
|
750
808
|
toggle(open?: boolean, instant?: boolean): void;
|
|
751
809
|
/** (Re)bind to a chart instance — called after every widget rebuild. */
|
|
752
810
|
onChart(chart: Vela): void;
|
|
753
811
|
destroy(): void;
|
|
812
|
+
relocalize(): void;
|
|
754
813
|
private detach;
|
|
755
814
|
private refresh;
|
|
756
815
|
}
|
|
@@ -759,7 +818,9 @@ declare class ShortcutsHelp {
|
|
|
759
818
|
private readonly dialog;
|
|
760
819
|
private readonly list;
|
|
761
820
|
private readonly keymap;
|
|
762
|
-
|
|
821
|
+
private readonly i18n;
|
|
822
|
+
/** `i18n` returns the shell's current translator; the panel reads it each time it opens. */
|
|
823
|
+
constructor(keymap: KeymapManager, host?: HTMLElement, onOpenChange?: (open: boolean) => void, i18n?: () => Translator);
|
|
763
824
|
open(): void;
|
|
764
825
|
close(): void;
|
|
765
826
|
destroy(): void;
|
|
@@ -821,33 +882,46 @@ interface ParsedTimeframe {
|
|
|
821
882
|
/** Compact chip ("3M"). */
|
|
822
883
|
short?: string;
|
|
823
884
|
}
|
|
824
|
-
/** Parse a typed timeframe string. `valid` is false for empty/garbage input (count ≥ 1).
|
|
825
|
-
|
|
885
|
+
/** Parse a typed timeframe string. `valid` is false for empty/garbage input (count ≥ 1).
|
|
886
|
+
* The labels read in `i18n`'s language (English without one). */
|
|
887
|
+
declare function parseTimeframe(text: string, i18n?: Translator | null): ParsedTimeframe;
|
|
826
888
|
/** Duration in ms of an existing timeframe value (`1`, `60`, `4h`, `D`, `W`, …), NaN if unknown. */
|
|
827
889
|
declare function timeframeMs(value: string): number;
|
|
828
|
-
/** Compact display label for any timeframe value ("60" → "1h", "D" → "1D")
|
|
829
|
-
|
|
890
|
+
/** Compact display label for any timeframe value ("60" → "1h", "D" → "1D"), in `i18n`'s
|
|
891
|
+
* language (English without one). */
|
|
892
|
+
declare function timeframeLabel(value: string, i18n?: Translator | null): string;
|
|
830
893
|
|
|
831
894
|
interface TimezoneEntry {
|
|
832
895
|
value: string;
|
|
896
|
+
/** The place the zone is named after, in English. */
|
|
833
897
|
label: string;
|
|
898
|
+
/** The same name as a message, for pickers in other languages. */
|
|
899
|
+
name: MessageDescriptor;
|
|
834
900
|
}
|
|
835
901
|
declare const TIMEZONES: readonly TimezoneEntry[];
|
|
836
902
|
/** The renderer's config default is the bare `'UTC'` alias — fold it (and any other
|
|
837
903
|
* UTC spelling) onto the catalog's `'Etc/UTC'` so selection checks land on one entry. */
|
|
838
904
|
declare function normalizeTimezone(zone: string): string;
|
|
839
|
-
/** Current UTC offset of an IANA zone as `"UTC"`, `"UTC+2"` or `"UTC-9:30"`.
|
|
905
|
+
/** Current UTC offset of an IANA zone as `"UTC"`, `"UTC+2"` or `"UTC-9:30"`. The
|
|
906
|
+
* formatter stays pinned to en-US whatever the chart's locale: the `GMT±h:mm` it emits is
|
|
907
|
+
* PARSED below, and a localized one could spell the offset differently. */
|
|
840
908
|
declare function tzOffset(zone: string, date?: Date): string;
|
|
841
|
-
/** Dropdown row label — UTC omits the offset prefix.
|
|
842
|
-
|
|
909
|
+
/** Dropdown row label — UTC omits the offset prefix. `location` is the zone's place name
|
|
910
|
+
* as the picker shows it; `i18n` places the offset the way its language writes it. */
|
|
911
|
+
declare function tzMenuLabel(zone: string, location: string, i18n?: Translator | null): string;
|
|
843
912
|
/** Compact label for the bottom-bar button — just the offset ("UTC", "UTC+2", "UTC-9:30"). */
|
|
844
913
|
declare function tzButtonLabel(zone: string): string;
|
|
845
914
|
|
|
846
915
|
/** Sensible decimal count for a price magnitude (crypto-friendly). */
|
|
847
916
|
declare function decimalsFor(ref: number): number;
|
|
848
|
-
/** Locale-formatted price; `'—'` for null/non-finite.
|
|
917
|
+
/** Locale-formatted price; `'—'` for null/non-finite.
|
|
918
|
+
* @deprecated English only. Format through the chart's translator:
|
|
919
|
+
* `chart.i18n.format.price(n, { decimals, grouping: true, surface: 'statusLine' })`. */
|
|
849
920
|
declare function fmtPrice(n: number | null | undefined, dp?: number): string;
|
|
850
|
-
/** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable.
|
|
921
|
+
/** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable.
|
|
922
|
+
* @deprecated English only. Compose it from the chart's translator:
|
|
923
|
+
* `chart.i18n.format.price(diff, { decimals, grouping: true })` and
|
|
924
|
+
* `chart.i18n.format.percent(pct)`. */
|
|
851
925
|
declare function fmtChange(open: number | null | undefined, close: number | null | undefined): string;
|
|
852
926
|
|
|
853
927
|
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, Statusline, type StatuslineMenuHooks, StatuslinePart, 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 };
|