@luxalgo/vela 0.5.0 → 0.5.2
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-Dzd-Erlk.d.ts → DataProvider-DTOEXKTI.d.ts} +1 -1
- package/dist/{DataProvider-DKNDHpNv.d.cts → DataProvider-gnzv-dgc.d.cts} +1 -1
- package/dist/{chunk-KM6LHB3Y.js → chunk-ATPU5CI6.js} +6 -1
- package/dist/{chunk-7UFX5ZIG.js → chunk-B5TIKQJ5.js} +65 -7
- package/dist/{chunk-GYD2THPV.js → chunk-LJLZR44Y.js} +9 -2
- package/dist/{chunk-RHIDOUFL.js → chunk-P556H6EA.js} +329 -10
- package/dist/{chunk-KCCZNKH7.js → chunk-RRFGWZNJ.js} +1915 -367
- package/dist/{chunk-OVQKKXLZ.js → chunk-Y7TK4ZWK.js} +1810 -153
- package/dist/{contributions-o1GRKPI_.d.cts → contributions-Ci_i3IN2.d.cts} +77 -31
- package/dist/{contributions-hX3EUyjG.d.ts → contributions-b6AVrqqG.d.ts} +77 -31
- package/dist/{history-LJkz4-sS.d.cts → history-Cf1lVsap.d.cts} +22 -5
- package/dist/{history-Dzxz-MQj.d.ts → history-Ci3M0xLV.d.ts} +22 -5
- package/dist/index.cjs +2010 -397
- package/dist/index.d.cts +83 -25
- package/dist/index.d.ts +83 -25
- package/dist/index.js +4 -4
- package/dist/{options-Q-576hIi.d.cts → options-XTBpbx0s.d.cts} +61 -1
- package/dist/{options-Q-576hIi.d.ts → options-XTBpbx0s.d.ts} +61 -1
- package/dist/{plugin-aGUD1epn.d.ts → plugin-CnNd7cuF.d.ts} +305 -8
- package/dist/{plugin-D94muTV-.d.cts → plugin-DfH4Y-Om.d.cts} +305 -8
- package/dist/plugin.cjs +58 -7
- 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 +342 -9
- package/dist/ui.d.cts +64 -2
- package/dist/ui.d.ts +64 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +2010 -397
- package/dist/vela.global.min.js +115 -34
- package/dist/widget.cjs +5987 -2242
- package/dist/widget.d.cts +89 -17
- package/dist/widget.d.ts +89 -17
- package/dist/widget.js +169 -18
- package/dist/workspace.cjs +5627 -1587
- package/dist/workspace.d.cts +106 -12
- package/dist/workspace.d.ts +106 -12
- package/dist/workspace.js +494 -52
- package/package.json +1 -1
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-Ci_i3IN2.cjs';
|
|
2
|
+
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-Ci_i3IN2.cjs';
|
|
3
|
+
import { b as VelaOptions, q as DataWindowReadout } from './options-XTBpbx0s.cjs';
|
|
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-Cf1lVsap.cjs';
|
|
6
|
+
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-Cf1lVsap.cjs';
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-gnzv-dgc.cjs';
|
|
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
|
|
|
@@ -30,6 +30,7 @@ declare class VelaWidget {
|
|
|
30
30
|
private shortcutsHelp;
|
|
31
31
|
private readonly contextMenu;
|
|
32
32
|
private readonly symbolPicker;
|
|
33
|
+
/** Null when the host disabled it (`indicatorPicker: false`). */
|
|
33
34
|
private readonly indicatorPicker;
|
|
34
35
|
private readonly tfQuick;
|
|
35
36
|
private inner;
|
|
@@ -53,6 +54,8 @@ declare class VelaWidget {
|
|
|
53
54
|
private watermarkOn;
|
|
54
55
|
/** Indicator titles (the in-chart legend rows) shown — reapplied across rebuilds. */
|
|
55
56
|
private indicatorTitlesOn;
|
|
57
|
+
/** Plot values beside the legend titles shown — reapplied across rebuilds. */
|
|
58
|
+
private indicatorValuesOn;
|
|
56
59
|
private pendingRange;
|
|
57
60
|
/** Symbol already reported as unservable (the core re-reports on every index settle). */
|
|
58
61
|
private unresolvedToasted;
|
|
@@ -96,7 +99,30 @@ declare class VelaWidget {
|
|
|
96
99
|
private indicatorsPromise;
|
|
97
100
|
private destroyed;
|
|
98
101
|
private buildSeq;
|
|
102
|
+
/** The chrome size class — writes `data-layout` on the root (all mobile CSS keys
|
|
103
|
+
* off it) and pushes the mode into the renderer chrome on every change/rebuild. */
|
|
104
|
+
private layoutCtl;
|
|
105
|
+
private readonly mobileBar;
|
|
106
|
+
private readonly drawingPill;
|
|
107
|
+
private tfDrawer;
|
|
108
|
+
private drawingsDrawer;
|
|
109
|
+
private moreDrawer;
|
|
110
|
+
private timezoneDrawer;
|
|
111
|
+
private priceScaleDrawer;
|
|
112
|
+
/** Plot-local y of the last price-axis long-press (targets the pane under the finger). */
|
|
113
|
+
private priceScalePressY;
|
|
114
|
+
/** The active range chip id (both bottom bars + the timeframe drawer mirror it). */
|
|
115
|
+
private activeRangeId;
|
|
99
116
|
constructor(container: HTMLElement | string, opts: VelaWidgetOptions);
|
|
117
|
+
/** The mode flipped (container resized across the breakpoint, or a coarse-pointer
|
|
118
|
+
* change). Close the open surfaces — a desktop card must not linger over the
|
|
119
|
+
* mobile chrome (and vice versa) — and re-present the renderer's own chrome. */
|
|
120
|
+
private onLayoutModeChange;
|
|
121
|
+
private openTimeframeDrawer;
|
|
122
|
+
private openDrawingsDrawer;
|
|
123
|
+
private openMoreDrawer;
|
|
124
|
+
private openTimezoneDrawer;
|
|
125
|
+
private openPriceScaleDrawer;
|
|
100
126
|
/** Mount registered attachments not yet mounted on this widget (idempotent per id). */
|
|
101
127
|
private mountAttachments;
|
|
102
128
|
/** The context handed to contributed actions (see `registerWidgetAction`). */
|
|
@@ -158,6 +184,8 @@ declare class VelaWidget {
|
|
|
158
184
|
setWatermarkVisible(visible: boolean): void;
|
|
159
185
|
/** Show/hide the indicator titles — the in-chart legend rows (persisted). */
|
|
160
186
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
187
|
+
/** Show/hide the plot values beside every indicator's legend title (persisted). */
|
|
188
|
+
setIndicatorValuesVisible(visible: boolean): void;
|
|
161
189
|
/** Applied LIVE (renderer feature) — no rebuild; persists across rebuilds. */
|
|
162
190
|
setPriceStyle(style: string): void;
|
|
163
191
|
/** OHLC/change ink in the status line follows the ACTIVE price style's configured
|
|
@@ -215,6 +243,12 @@ declare class VelaWidget {
|
|
|
215
243
|
private persistNow;
|
|
216
244
|
}
|
|
217
245
|
|
|
246
|
+
/** The current layout's footprint on the canvas (mirrors the workspace's LayoutShape). */
|
|
247
|
+
type LayoutPickerShape = {
|
|
248
|
+
rows: number;
|
|
249
|
+
cols: number;
|
|
250
|
+
};
|
|
251
|
+
|
|
218
252
|
declare function priceStyleLabel(id: string): string;
|
|
219
253
|
interface TopbarOptions {
|
|
220
254
|
symbol: string;
|
|
@@ -224,23 +258,28 @@ interface TopbarOptions {
|
|
|
224
258
|
priceStyle: string;
|
|
225
259
|
onTimeframe: (tf: string) => void;
|
|
226
260
|
onPriceStyle: (style: string) => void;
|
|
227
|
-
/** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
|
|
228
|
-
*
|
|
261
|
+
/** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
|
|
262
|
+
* given) — the grid-canvas picker composing uniform grids, with the workspace
|
|
263
|
+
* SYNC switches beside it. Everything is read live, so plugin-registered
|
|
264
|
+
* layouts and setting flips appear automatically. */
|
|
229
265
|
layout?: {
|
|
230
266
|
current: string;
|
|
231
|
-
|
|
267
|
+
/** Current layout's picker-canvas shape (null = not canvas-expressible). */
|
|
268
|
+
shape: () => LayoutPickerShape | null;
|
|
269
|
+
/** Registered layouts the canvas cannot express — rendered as labeled rows. */
|
|
270
|
+
presets: () => Array<{
|
|
232
271
|
id: string;
|
|
233
272
|
label: string;
|
|
234
273
|
}>;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
274
|
+
onSelectGrid: (rows: number, cols: number) => void;
|
|
275
|
+
onSelectPreset: (id: string) => void;
|
|
276
|
+
/** SYNC switch rows (re-read on every open and after each toggle). */
|
|
277
|
+
syncs: () => Array<{
|
|
239
278
|
id: string;
|
|
240
279
|
label: string;
|
|
241
280
|
checked: boolean;
|
|
242
281
|
}>;
|
|
243
|
-
|
|
282
|
+
onToggleSync: (id: string) => void;
|
|
244
283
|
};
|
|
245
284
|
onIndicatorsClick?: () => void;
|
|
246
285
|
/** Unified undo/redo (same stack as Ctrl+Z / Ctrl+Y). Enabled state is pushed with
|
|
@@ -258,12 +297,16 @@ declare class Topbar {
|
|
|
258
297
|
private readonly tfButton;
|
|
259
298
|
private readonly styleButton;
|
|
260
299
|
private layoutButton;
|
|
261
|
-
private
|
|
300
|
+
private layoutPicker;
|
|
262
301
|
private layoutId;
|
|
263
302
|
private readonly tfMenu;
|
|
264
303
|
private readonly styleMenu;
|
|
265
304
|
private readonly tooltips;
|
|
266
305
|
private readonly actionsHost;
|
|
306
|
+
/** Left-aligned contributed actions (`align: 'left'`) — right after the dropdowns. */
|
|
307
|
+
private readonly leftActionsHost;
|
|
308
|
+
/** The hairline after the left cluster — hidden while the cluster is empty. */
|
|
309
|
+
private readonly leftActionsSep;
|
|
267
310
|
/** The side-panel toggle group — filled by the dock through {@link setPanelButtons}. */
|
|
268
311
|
private readonly panelsHost;
|
|
269
312
|
private undoBtn;
|
|
@@ -286,7 +329,6 @@ declare class Topbar {
|
|
|
286
329
|
/** Reflect the current workspace layout (no-op without the layout dropdown). */
|
|
287
330
|
setLayout(id: string): void;
|
|
288
331
|
private renderLayoutButton;
|
|
289
|
-
private layoutItems;
|
|
290
332
|
private renderStyleButton;
|
|
291
333
|
/** Re-project the contributed topbar actions (call after registrations change). */
|
|
292
334
|
renderActions(): void;
|
|
@@ -342,8 +384,22 @@ declare class Statusline {
|
|
|
342
384
|
private isUp;
|
|
343
385
|
/** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
|
|
344
386
|
private readout;
|
|
387
|
+
/** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
|
|
388
|
+
private fitMode;
|
|
389
|
+
private fitRO;
|
|
345
390
|
constructor(host: HTMLElement, symbol: string);
|
|
346
391
|
setSymbol(symbol: string): void;
|
|
392
|
+
/**
|
|
393
|
+
* Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
|
|
394
|
+
* Segments that don't fit are hidden outright rather than clipped mid-glyph, least
|
|
395
|
+
* important first: OHLC, then the bar change, the venue/timeframe meta, and the
|
|
396
|
+
* market badge; the logo + ticker always stay. Re-fits live on host resizes.
|
|
397
|
+
*/
|
|
398
|
+
setFitMode(on: boolean): void;
|
|
399
|
+
/** Project the parts config onto the segments (the baseline fit() prunes from). */
|
|
400
|
+
private syncParts;
|
|
401
|
+
/** Hide overflowing segments until the row fits its max-width (fit mode only). */
|
|
402
|
+
private fit;
|
|
347
403
|
/** Shape + color the value readout after the active price style: its own up/down
|
|
348
404
|
* colors (candle bodies, bar ticks, the line color, …), the direction rule that
|
|
349
405
|
* picks between them (`isUp` replaces close-vs-open where the style paints by
|
|
@@ -372,9 +428,22 @@ declare class Statusline {
|
|
|
372
428
|
|
|
373
429
|
declare class Watermark {
|
|
374
430
|
readonly el: HTMLElement;
|
|
431
|
+
private readonly text;
|
|
432
|
+
private readonly resizeObserver;
|
|
433
|
+
/** The host's visibility preference (the persisted watermark toggle). */
|
|
434
|
+
private shown;
|
|
435
|
+
/** A bar load is in flight with nothing painted — the loading affordance owns the
|
|
436
|
+
* canvas, so the mark stays out of its way. Starts true: the FIRST `load:start`
|
|
437
|
+
* fires during chart construction, before any subscriber can see it. */
|
|
438
|
+
private loading;
|
|
375
439
|
constructor(host: HTMLElement, symbol: string, timeframe: string);
|
|
376
440
|
setVisible(visible: boolean): void;
|
|
441
|
+
/** Loading and the watermark never share the canvas — hidden while a load is up. */
|
|
442
|
+
setLoading(loading: boolean): void;
|
|
443
|
+
private sync;
|
|
377
444
|
update(symbol: string, timeframe: string): void;
|
|
445
|
+
/** Measure the text at the cap and shrink it to the chart's own width. */
|
|
446
|
+
private fit;
|
|
378
447
|
destroy(): void;
|
|
379
448
|
}
|
|
380
449
|
|
|
@@ -519,6 +588,9 @@ declare class PanelDock {
|
|
|
519
588
|
toggle(id: string, open?: boolean): void;
|
|
520
589
|
/** The open panel's id, or null when the column is closed. */
|
|
521
590
|
get openId(): string | null;
|
|
591
|
+
/** The docked panels in dock order — what a non-topbar chrome (the mobile
|
|
592
|
+
* three-dots drawer) lists so every panel stays reachable there too. */
|
|
593
|
+
list(): ReadonlyArray<SidePanelButton>;
|
|
522
594
|
/** The dock's persistable state, or null when there is nothing worth saving. */
|
|
523
595
|
getState(): PanelsState | null;
|
|
524
596
|
/**
|
|
@@ -786,7 +858,7 @@ declare function normalizeTimezone(zone: string): string;
|
|
|
786
858
|
declare function tzOffset(zone: string, date?: Date): string;
|
|
787
859
|
/** Dropdown row label — UTC omits the offset prefix. */
|
|
788
860
|
declare function tzMenuLabel(zone: string, location: string): string;
|
|
789
|
-
/** Compact label for the bottom-bar button ("UTC", "UTC+2
|
|
861
|
+
/** Compact label for the bottom-bar button — just the offset ("UTC", "UTC+2", "UTC-9:30"). */
|
|
790
862
|
declare function tzButtonLabel(zone: string): string;
|
|
791
863
|
|
|
792
864
|
/** Sensible decimal count for a price magnitude (crypto-friendly). */
|
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-b6AVrqqG.js';
|
|
2
|
+
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-b6AVrqqG.js';
|
|
3
|
+
import { b as VelaOptions, q as DataWindowReadout } from './options-XTBpbx0s.js';
|
|
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-Ci3M0xLV.js';
|
|
6
|
+
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-Ci3M0xLV.js';
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-DTOEXKTI.js';
|
|
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
|
|
|
@@ -30,6 +30,7 @@ declare class VelaWidget {
|
|
|
30
30
|
private shortcutsHelp;
|
|
31
31
|
private readonly contextMenu;
|
|
32
32
|
private readonly symbolPicker;
|
|
33
|
+
/** Null when the host disabled it (`indicatorPicker: false`). */
|
|
33
34
|
private readonly indicatorPicker;
|
|
34
35
|
private readonly tfQuick;
|
|
35
36
|
private inner;
|
|
@@ -53,6 +54,8 @@ declare class VelaWidget {
|
|
|
53
54
|
private watermarkOn;
|
|
54
55
|
/** Indicator titles (the in-chart legend rows) shown — reapplied across rebuilds. */
|
|
55
56
|
private indicatorTitlesOn;
|
|
57
|
+
/** Plot values beside the legend titles shown — reapplied across rebuilds. */
|
|
58
|
+
private indicatorValuesOn;
|
|
56
59
|
private pendingRange;
|
|
57
60
|
/** Symbol already reported as unservable (the core re-reports on every index settle). */
|
|
58
61
|
private unresolvedToasted;
|
|
@@ -96,7 +99,30 @@ declare class VelaWidget {
|
|
|
96
99
|
private indicatorsPromise;
|
|
97
100
|
private destroyed;
|
|
98
101
|
private buildSeq;
|
|
102
|
+
/** The chrome size class — writes `data-layout` on the root (all mobile CSS keys
|
|
103
|
+
* off it) and pushes the mode into the renderer chrome on every change/rebuild. */
|
|
104
|
+
private layoutCtl;
|
|
105
|
+
private readonly mobileBar;
|
|
106
|
+
private readonly drawingPill;
|
|
107
|
+
private tfDrawer;
|
|
108
|
+
private drawingsDrawer;
|
|
109
|
+
private moreDrawer;
|
|
110
|
+
private timezoneDrawer;
|
|
111
|
+
private priceScaleDrawer;
|
|
112
|
+
/** Plot-local y of the last price-axis long-press (targets the pane under the finger). */
|
|
113
|
+
private priceScalePressY;
|
|
114
|
+
/** The active range chip id (both bottom bars + the timeframe drawer mirror it). */
|
|
115
|
+
private activeRangeId;
|
|
99
116
|
constructor(container: HTMLElement | string, opts: VelaWidgetOptions);
|
|
117
|
+
/** The mode flipped (container resized across the breakpoint, or a coarse-pointer
|
|
118
|
+
* change). Close the open surfaces — a desktop card must not linger over the
|
|
119
|
+
* mobile chrome (and vice versa) — and re-present the renderer's own chrome. */
|
|
120
|
+
private onLayoutModeChange;
|
|
121
|
+
private openTimeframeDrawer;
|
|
122
|
+
private openDrawingsDrawer;
|
|
123
|
+
private openMoreDrawer;
|
|
124
|
+
private openTimezoneDrawer;
|
|
125
|
+
private openPriceScaleDrawer;
|
|
100
126
|
/** Mount registered attachments not yet mounted on this widget (idempotent per id). */
|
|
101
127
|
private mountAttachments;
|
|
102
128
|
/** The context handed to contributed actions (see `registerWidgetAction`). */
|
|
@@ -158,6 +184,8 @@ declare class VelaWidget {
|
|
|
158
184
|
setWatermarkVisible(visible: boolean): void;
|
|
159
185
|
/** Show/hide the indicator titles — the in-chart legend rows (persisted). */
|
|
160
186
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
187
|
+
/** Show/hide the plot values beside every indicator's legend title (persisted). */
|
|
188
|
+
setIndicatorValuesVisible(visible: boolean): void;
|
|
161
189
|
/** Applied LIVE (renderer feature) — no rebuild; persists across rebuilds. */
|
|
162
190
|
setPriceStyle(style: string): void;
|
|
163
191
|
/** OHLC/change ink in the status line follows the ACTIVE price style's configured
|
|
@@ -215,6 +243,12 @@ declare class VelaWidget {
|
|
|
215
243
|
private persistNow;
|
|
216
244
|
}
|
|
217
245
|
|
|
246
|
+
/** The current layout's footprint on the canvas (mirrors the workspace's LayoutShape). */
|
|
247
|
+
type LayoutPickerShape = {
|
|
248
|
+
rows: number;
|
|
249
|
+
cols: number;
|
|
250
|
+
};
|
|
251
|
+
|
|
218
252
|
declare function priceStyleLabel(id: string): string;
|
|
219
253
|
interface TopbarOptions {
|
|
220
254
|
symbol: string;
|
|
@@ -224,23 +258,28 @@ interface TopbarOptions {
|
|
|
224
258
|
priceStyle: string;
|
|
225
259
|
onTimeframe: (tf: string) => void;
|
|
226
260
|
onPriceStyle: (style: string) => void;
|
|
227
|
-
/** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
|
|
228
|
-
*
|
|
261
|
+
/** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
|
|
262
|
+
* given) — the grid-canvas picker composing uniform grids, with the workspace
|
|
263
|
+
* SYNC switches beside it. Everything is read live, so plugin-registered
|
|
264
|
+
* layouts and setting flips appear automatically. */
|
|
229
265
|
layout?: {
|
|
230
266
|
current: string;
|
|
231
|
-
|
|
267
|
+
/** Current layout's picker-canvas shape (null = not canvas-expressible). */
|
|
268
|
+
shape: () => LayoutPickerShape | null;
|
|
269
|
+
/** Registered layouts the canvas cannot express — rendered as labeled rows. */
|
|
270
|
+
presets: () => Array<{
|
|
232
271
|
id: string;
|
|
233
272
|
label: string;
|
|
234
273
|
}>;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
274
|
+
onSelectGrid: (rows: number, cols: number) => void;
|
|
275
|
+
onSelectPreset: (id: string) => void;
|
|
276
|
+
/** SYNC switch rows (re-read on every open and after each toggle). */
|
|
277
|
+
syncs: () => Array<{
|
|
239
278
|
id: string;
|
|
240
279
|
label: string;
|
|
241
280
|
checked: boolean;
|
|
242
281
|
}>;
|
|
243
|
-
|
|
282
|
+
onToggleSync: (id: string) => void;
|
|
244
283
|
};
|
|
245
284
|
onIndicatorsClick?: () => void;
|
|
246
285
|
/** Unified undo/redo (same stack as Ctrl+Z / Ctrl+Y). Enabled state is pushed with
|
|
@@ -258,12 +297,16 @@ declare class Topbar {
|
|
|
258
297
|
private readonly tfButton;
|
|
259
298
|
private readonly styleButton;
|
|
260
299
|
private layoutButton;
|
|
261
|
-
private
|
|
300
|
+
private layoutPicker;
|
|
262
301
|
private layoutId;
|
|
263
302
|
private readonly tfMenu;
|
|
264
303
|
private readonly styleMenu;
|
|
265
304
|
private readonly tooltips;
|
|
266
305
|
private readonly actionsHost;
|
|
306
|
+
/** Left-aligned contributed actions (`align: 'left'`) — right after the dropdowns. */
|
|
307
|
+
private readonly leftActionsHost;
|
|
308
|
+
/** The hairline after the left cluster — hidden while the cluster is empty. */
|
|
309
|
+
private readonly leftActionsSep;
|
|
267
310
|
/** The side-panel toggle group — filled by the dock through {@link setPanelButtons}. */
|
|
268
311
|
private readonly panelsHost;
|
|
269
312
|
private undoBtn;
|
|
@@ -286,7 +329,6 @@ declare class Topbar {
|
|
|
286
329
|
/** Reflect the current workspace layout (no-op without the layout dropdown). */
|
|
287
330
|
setLayout(id: string): void;
|
|
288
331
|
private renderLayoutButton;
|
|
289
|
-
private layoutItems;
|
|
290
332
|
private renderStyleButton;
|
|
291
333
|
/** Re-project the contributed topbar actions (call after registrations change). */
|
|
292
334
|
renderActions(): void;
|
|
@@ -342,8 +384,22 @@ declare class Statusline {
|
|
|
342
384
|
private isUp;
|
|
343
385
|
/** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
|
|
344
386
|
private readout;
|
|
387
|
+
/** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
|
|
388
|
+
private fitMode;
|
|
389
|
+
private fitRO;
|
|
345
390
|
constructor(host: HTMLElement, symbol: string);
|
|
346
391
|
setSymbol(symbol: string): void;
|
|
392
|
+
/**
|
|
393
|
+
* Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
|
|
394
|
+
* Segments that don't fit are hidden outright rather than clipped mid-glyph, least
|
|
395
|
+
* important first: OHLC, then the bar change, the venue/timeframe meta, and the
|
|
396
|
+
* market badge; the logo + ticker always stay. Re-fits live on host resizes.
|
|
397
|
+
*/
|
|
398
|
+
setFitMode(on: boolean): void;
|
|
399
|
+
/** Project the parts config onto the segments (the baseline fit() prunes from). */
|
|
400
|
+
private syncParts;
|
|
401
|
+
/** Hide overflowing segments until the row fits its max-width (fit mode only). */
|
|
402
|
+
private fit;
|
|
347
403
|
/** Shape + color the value readout after the active price style: its own up/down
|
|
348
404
|
* colors (candle bodies, bar ticks, the line color, …), the direction rule that
|
|
349
405
|
* picks between them (`isUp` replaces close-vs-open where the style paints by
|
|
@@ -372,9 +428,22 @@ declare class Statusline {
|
|
|
372
428
|
|
|
373
429
|
declare class Watermark {
|
|
374
430
|
readonly el: HTMLElement;
|
|
431
|
+
private readonly text;
|
|
432
|
+
private readonly resizeObserver;
|
|
433
|
+
/** The host's visibility preference (the persisted watermark toggle). */
|
|
434
|
+
private shown;
|
|
435
|
+
/** A bar load is in flight with nothing painted — the loading affordance owns the
|
|
436
|
+
* canvas, so the mark stays out of its way. Starts true: the FIRST `load:start`
|
|
437
|
+
* fires during chart construction, before any subscriber can see it. */
|
|
438
|
+
private loading;
|
|
375
439
|
constructor(host: HTMLElement, symbol: string, timeframe: string);
|
|
376
440
|
setVisible(visible: boolean): void;
|
|
441
|
+
/** Loading and the watermark never share the canvas — hidden while a load is up. */
|
|
442
|
+
setLoading(loading: boolean): void;
|
|
443
|
+
private sync;
|
|
377
444
|
update(symbol: string, timeframe: string): void;
|
|
445
|
+
/** Measure the text at the cap and shrink it to the chart's own width. */
|
|
446
|
+
private fit;
|
|
378
447
|
destroy(): void;
|
|
379
448
|
}
|
|
380
449
|
|
|
@@ -519,6 +588,9 @@ declare class PanelDock {
|
|
|
519
588
|
toggle(id: string, open?: boolean): void;
|
|
520
589
|
/** The open panel's id, or null when the column is closed. */
|
|
521
590
|
get openId(): string | null;
|
|
591
|
+
/** The docked panels in dock order — what a non-topbar chrome (the mobile
|
|
592
|
+
* three-dots drawer) lists so every panel stays reachable there too. */
|
|
593
|
+
list(): ReadonlyArray<SidePanelButton>;
|
|
522
594
|
/** The dock's persistable state, or null when there is nothing worth saving. */
|
|
523
595
|
getState(): PanelsState | null;
|
|
524
596
|
/**
|
|
@@ -786,7 +858,7 @@ declare function normalizeTimezone(zone: string): string;
|
|
|
786
858
|
declare function tzOffset(zone: string, date?: Date): string;
|
|
787
859
|
/** Dropdown row label — UTC omits the offset prefix. */
|
|
788
860
|
declare function tzMenuLabel(zone: string, location: string): string;
|
|
789
|
-
/** Compact label for the bottom-bar button ("UTC", "UTC+2
|
|
861
|
+
/** Compact label for the bottom-bar button — just the offset ("UTC", "UTC+2", "UTC-9:30"). */
|
|
790
862
|
declare function tzButtonLabel(zone: string): string;
|
|
791
863
|
|
|
792
864
|
/** Sensible decimal count for a price magnitude (crypto-friendly). */
|