@luxalgo/vela 0.6.11 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +110 -46
  2. package/dist/{DataProvider-BBf-jc6W.d.ts → DataProvider-DhzstpQb.d.ts} +1 -1
  3. package/dist/{DataProvider-p0TEyhlX.d.cts → DataProvider-DlMtrwqM.d.cts} +1 -1
  4. package/dist/{chunk-MTLJKZDZ.js → chunk-F4M24ANM.js} +122 -1
  5. package/dist/{chunk-IO3NYSQV.js → chunk-G52XAKZY.js} +184 -25
  6. package/dist/{chunk-73PEA4MU.js → chunk-JKGA36ZM.js} +635 -49
  7. package/dist/{contributions-Bbe2R-mQ.d.ts → contributions-37nni40G.d.ts} +6 -4
  8. package/dist/{contributions-CO01zWve.d.cts → contributions-lPojhTxI.d.cts} +6 -4
  9. package/dist/index.cjs +744 -37
  10. package/dist/index.d.cts +6 -6
  11. package/dist/index.d.ts +6 -6
  12. package/dist/index.js +2 -2
  13. package/dist/{options-yp7sA96q.d.cts → options-CYS5Wmlx.d.cts} +71 -2
  14. package/dist/{options-yp7sA96q.d.ts → options-CYS5Wmlx.d.ts} +71 -2
  15. package/dist/{plugin-CkkH8QnX.d.cts → plugin-Cwikpz1m.d.cts} +10 -3
  16. package/dist/{plugin-DwxjM3Ni.d.ts → plugin-DHyaoMjW.d.ts} +10 -3
  17. package/dist/plugin.cjs +110 -0
  18. package/dist/plugin.d.cts +4 -4
  19. package/dist/plugin.d.ts +4 -4
  20. package/dist/plugin.js +1 -1
  21. package/dist/providers/binance.d.cts +2 -2
  22. package/dist/providers/binance.d.ts +2 -2
  23. package/dist/providers/coinbase.d.cts +2 -2
  24. package/dist/providers/coinbase.d.ts +2 -2
  25. package/dist/providers/hyperliquid.d.cts +2 -2
  26. package/dist/providers/hyperliquid.d.ts +2 -2
  27. package/dist/{statusline-CHPDuKNp.d.ts → statusline-model-CiJm-riV.d.cts} +7 -85
  28. package/dist/{statusline-DTHZUFqK.d.cts → statusline-model-D-q_OOx9.d.ts} +7 -85
  29. package/dist/ui.d.cts +1 -1
  30. package/dist/ui.d.ts +1 -1
  31. package/dist/vela.global.js +744 -37
  32. package/dist/vela.global.min.js +52 -52
  33. package/dist/widget.cjs +927 -61
  34. package/dist/widget.d.cts +118 -7
  35. package/dist/widget.d.ts +118 -7
  36. package/dist/widget.js +4 -4
  37. package/dist/workspace.cjs +927 -61
  38. package/dist/workspace.d.cts +5 -5
  39. package/dist/workspace.d.ts +5 -5
  40. package/dist/workspace.js +3 -3
  41. package/package.json +1 -1
package/dist/widget.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { V as Vela, W as WidgetContext, K as SidePanelButton } from './contributions-CO01zWve.cjs';
2
- export { C as CellStateContext, az as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, M as SidePanelDescriptor, Q as SidePanelHandle, U as StatePersistenceHandler, _ as SymbolRankingHook, a3 as WidgetActionDescriptor, a4 as WidgetActionTarget, a5 as WidgetAttachment, af as registerSidePanel, ag as registerStatePersistence, ah as registerSymbolRanking, ai as registerWidgetAction, aj as registerWidgetAttachment, al as sidePanels, am as statePersistenceHandlers, an as symbolRanking, ao as topbarActionOverride, at as unregisterSidePanel, au as unregisterStatePersistence, av as unregisterWidgetAction, aw as unregisterWidgetAttachment, ax as widgetActions, ay as widgetAttachments } from './contributions-CO01zWve.cjs';
3
- import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, s as DataWindowReadout } from './options-yp7sA96q.cjs';
4
- import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, P as PanelsState } from './statusline-DTHZUFqK.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-DTHZUFqK.cjs';
1
+ import { V as Vela, W as WidgetContext, K as SidePanelButton } from './contributions-lPojhTxI.cjs';
2
+ export { C as CellStateContext, az as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, M as SidePanelDescriptor, Q as SidePanelHandle, U as StatePersistenceHandler, _ as SymbolRankingHook, a3 as WidgetActionDescriptor, a4 as WidgetActionTarget, a5 as WidgetAttachment, af as registerSidePanel, ag as registerStatePersistence, ah as registerSymbolRanking, ai as registerWidgetAction, aj as registerWidgetAttachment, al as sidePanels, am as statePersistenceHandlers, an as symbolRanking, ao as topbarActionOverride, at as unregisterSidePanel, au as unregisterStatePersistence, av as unregisterWidgetAction, aw as unregisterWidgetAttachment, ax as widgetActions, ay as widgetAttachments } from './contributions-lPojhTxI.cjs';
3
+ import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, s as DataWindowReadout } from './options-CYS5Wmlx.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-CiJm-riV.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 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-CiJm-riV.cjs';
6
6
  import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
7
- import { a as SymbolDescriptor } from './DataProvider-p0TEyhlX.cjs';
7
+ import { a as SymbolDescriptor } from './DataProvider-DlMtrwqM.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
 
@@ -196,6 +196,117 @@ declare class Topbar {
196
196
  private styleItems;
197
197
  }
198
198
 
199
+ /** How the status line reads a bar out: the four O/H/L/C values (bar-shaped styles),
200
+ * or the single plotted value — the close — for one-line styles (line/area/baseline). */
201
+ type StatuslineReadout = 'ohlc' | 'value';
202
+ /** The market session states the status badge can wear. Crypto venues trade
203
+ * continuously and stay 'open'; the full vocabulary is ready for providers that
204
+ * carry a session model (equities RTH/ETH, exchange holidays). */
205
+ type MarketStatus = 'open' | 'pre' | 'post' | 'closed' | 'holiday';
206
+ /** Host hooks behind the right-click action menu. Part toggles route through the host
207
+ * (never straight into {@link Statusline.setPartVisible}) so its persistence and
208
+ * style-link mirroring follow; the chart toggle reaches the renderer the host owns. */
209
+ interface StatuslineMenuHooks {
210
+ setPart: (part: StatuslinePart, visible: boolean) => void;
211
+ /** Whether the main price series is currently painted (the renderer's `candleVisible`). */
212
+ chartVisible: () => boolean;
213
+ setChartVisible: (visible: boolean) => void;
214
+ }
215
+ declare class Statusline {
216
+ private readonly host;
217
+ /** The avatar's icon URL for a raw symbol — the shell routes it to the owning
218
+ * provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
219
+ private readonly iconFor?;
220
+ readonly el: HTMLElement;
221
+ private readonly ohlcEl;
222
+ private readonly changeEl;
223
+ private readonly symbolEl;
224
+ private readonly marketEl;
225
+ /** The badge itself — a kit callout bubble (the same element as {@link marketEl}). */
226
+ private readonly marketBubble;
227
+ private marketTip;
228
+ /** The show-chart eye — visible only while the chart is hidden. */
229
+ private readonly eyeEl;
230
+ private eyeTip;
231
+ private avatarEl;
232
+ private metaEl;
233
+ private readonly parts;
234
+ /** The right-click action menu — present once a host wires it via {@link attachMenu}. */
235
+ private menu;
236
+ private menuHooks;
237
+ /** Mirror of the renderer's `candleVisible` — see {@link setChartHidden}. */
238
+ private chartHidden;
239
+ private lastBar;
240
+ private hoverBar;
241
+ private unsubs;
242
+ /** Up/down ink for the OHLC + change values — the ACTIVE price style's configured
243
+ * colors (candle bodies, bar ticks, the line color, …); null falls back to the theme
244
+ * tokens. `isUp` overrides the close-vs-open direction rule where the style paints by
245
+ * something else (baseline: position against the baseline price). */
246
+ private upColor;
247
+ private downColor;
248
+ private isUp;
249
+ /** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
250
+ private readout;
251
+ /** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
252
+ private fitMode;
253
+ private fitRO;
254
+ constructor(host: HTMLElement, symbol: string,
255
+ /** The avatar's icon URL for a raw symbol — the shell routes it to the owning
256
+ * provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
257
+ iconFor?: ((symbol: string) => string | undefined) | undefined);
258
+ setSymbol(symbol: string): void;
259
+ /**
260
+ * Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
261
+ * Segments that don't fit are hidden outright rather than clipped mid-glyph, least
262
+ * important first: OHLC, then the bar change, the venue/timeframe meta, and the
263
+ * market badge; the logo + ticker always stay. Re-fits live on host resizes.
264
+ */
265
+ setFitMode(on: boolean): void;
266
+ /** Project the parts config onto the segments (the baseline fit() prunes from). */
267
+ private syncParts;
268
+ /** Hide overflowing segments until the row fits its max-width (fit mode only). */
269
+ private fit;
270
+ /** Shape + color the value readout after the active price style: its own up/down
271
+ * colors (candle bodies, bar ticks, the line color, …), the direction rule that
272
+ * picks between them (`isUp` replaces close-vs-open where the style paints by
273
+ * something else — baseline by position), and whether the readout is the four
274
+ * O/H/L/C values or the single plotted value (one-line styles). Null colors fall
275
+ * back to the theme's up/down tokens. See {@link statuslineInkOf}, which derives
276
+ * all of it from the live renderer. */
277
+ setDirectionColors(up: string | null, down: string | null, isUp?: ((bar: {
278
+ open: number;
279
+ close: number;
280
+ }) => boolean) | null, readout?: StatuslineReadout): void;
281
+ /** The "· BINANCE · 1h" segment after the symbol — venue first, then resolution. */
282
+ setMeta(timeframe: string, provider: string): void;
283
+ /** Dress the market badge for a session state: its icon, tinted circle, and the
284
+ * hover label. Callers with no session model leave the constructor's 'open'. */
285
+ setMarketStatus(status: MarketStatus): void;
286
+ /** Show/hide one part — the settings dialog's Status line tab and the right-click
287
+ * menu both drive these. 'name' owns the venue/timeframe meta too (see
288
+ * {@link segmentVisibility}). */
289
+ setPartVisible(part: StatuslinePart, visible: boolean): void;
290
+ partVisible(part: StatuslinePart): boolean;
291
+ /** Mirror the chart's (price series') visibility: dim the whole line like a hidden
292
+ * indicator's legend row, drop the value readout (OHLC + bar change — values of a
293
+ * series that isn't painted), and put the show-chart eye out in its place. The
294
+ * parts config is untouched, so showing the chart restores the readout exactly as
295
+ * configured. Idempotent; {@link render} re-syncs it from the live renderer, so
296
+ * toggles made elsewhere (the object tree's eye) converge too. */
297
+ setChartHidden(hidden: boolean): void;
298
+ /** Wire the right-click action menu: one checkable toggle per part plus hide/show
299
+ * for the chart itself. The menu is built once; later calls just swap the hooks. */
300
+ attachMenu(hooks: StatuslineMenuHooks): void;
301
+ private readonly onContextMenu;
302
+ private runMenuItem;
303
+ /** (Re)bind to a chart instance — called after every widget rebuild. */
304
+ onChart(chart: Vela): void;
305
+ destroy(): void;
306
+ private detach;
307
+ private render;
308
+ }
309
+
199
310
  declare class Watermark {
200
311
  readonly el: HTMLElement;
201
312
  private readonly text;
@@ -665,4 +776,4 @@ declare function fmtPrice(n: number | null | undefined, dp?: number): string;
665
776
  /** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable. */
666
777
  declare function fmtChange(open: number | null | undefined, close: number | null | undefined): string;
667
778
 
668
- 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 };
779
+ 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 };
package/dist/widget.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { V as Vela, W as WidgetContext, K as SidePanelButton } from './contributions-Bbe2R-mQ.js';
2
- export { C as CellStateContext, az as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, M as SidePanelDescriptor, Q as SidePanelHandle, U as StatePersistenceHandler, _ as SymbolRankingHook, a3 as WidgetActionDescriptor, a4 as WidgetActionTarget, a5 as WidgetAttachment, af as registerSidePanel, ag as registerStatePersistence, ah as registerSymbolRanking, ai as registerWidgetAction, aj as registerWidgetAttachment, al as sidePanels, am as statePersistenceHandlers, an as symbolRanking, ao as topbarActionOverride, at as unregisterSidePanel, au as unregisterStatePersistence, av as unregisterWidgetAction, aw as unregisterWidgetAttachment, ax as widgetActions, ay as widgetAttachments } from './contributions-Bbe2R-mQ.js';
3
- import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, s as DataWindowReadout } from './options-yp7sA96q.js';
4
- import { c as VelaShellOptions, W as WidgetHistory, b as RangePreset, f as WorkspaceState, j as TopbarComposition, P as PanelsState } from './statusline-CHPDuKNp.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-CHPDuKNp.js';
1
+ import { V as Vela, W as WidgetContext, K as SidePanelButton } from './contributions-37nni40G.js';
2
+ export { C as CellStateContext, az as DEFAULT_PANEL_ORDER, E as ExternalIndicatorEntry, O as OVERRIDABLE_TOPBAR_IDS, M as SidePanelDescriptor, Q as SidePanelHandle, U as StatePersistenceHandler, _ as SymbolRankingHook, a3 as WidgetActionDescriptor, a4 as WidgetActionTarget, a5 as WidgetAttachment, af as registerSidePanel, ag as registerStatePersistence, ah as registerSymbolRanking, ai as registerWidgetAction, aj as registerWidgetAttachment, al as sidePanels, am as statePersistenceHandlers, an as symbolRanking, ao as topbarActionOverride, at as unregisterSidePanel, au as unregisterStatePersistence, av as unregisterWidgetAction, aw as unregisterWidgetAttachment, ax as widgetActions, ay as widgetAttachments } from './contributions-37nni40G.js';
3
+ import { b as VelaOptions, d as MarketSession, T as ThemeName, c as VelaTheme, s as DataWindowReadout } from './options-CYS5Wmlx.js';
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-D-q_OOx9.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 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-D-q_OOx9.js';
6
6
  import { K as KeymapManager } from './keymap-CGOz5F5f.js';
7
- import { a as SymbolDescriptor } from './DataProvider-BBf-jc6W.js';
7
+ import { a as SymbolDescriptor } from './DataProvider-DhzstpQb.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
 
@@ -196,6 +196,117 @@ declare class Topbar {
196
196
  private styleItems;
197
197
  }
198
198
 
199
+ /** How the status line reads a bar out: the four O/H/L/C values (bar-shaped styles),
200
+ * or the single plotted value — the close — for one-line styles (line/area/baseline). */
201
+ type StatuslineReadout = 'ohlc' | 'value';
202
+ /** The market session states the status badge can wear. Crypto venues trade
203
+ * continuously and stay 'open'; the full vocabulary is ready for providers that
204
+ * carry a session model (equities RTH/ETH, exchange holidays). */
205
+ type MarketStatus = 'open' | 'pre' | 'post' | 'closed' | 'holiday';
206
+ /** Host hooks behind the right-click action menu. Part toggles route through the host
207
+ * (never straight into {@link Statusline.setPartVisible}) so its persistence and
208
+ * style-link mirroring follow; the chart toggle reaches the renderer the host owns. */
209
+ interface StatuslineMenuHooks {
210
+ setPart: (part: StatuslinePart, visible: boolean) => void;
211
+ /** Whether the main price series is currently painted (the renderer's `candleVisible`). */
212
+ chartVisible: () => boolean;
213
+ setChartVisible: (visible: boolean) => void;
214
+ }
215
+ declare class Statusline {
216
+ private readonly host;
217
+ /** The avatar's icon URL for a raw symbol — the shell routes it to the owning
218
+ * provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
219
+ private readonly iconFor?;
220
+ readonly el: HTMLElement;
221
+ private readonly ohlcEl;
222
+ private readonly changeEl;
223
+ private readonly symbolEl;
224
+ private readonly marketEl;
225
+ /** The badge itself — a kit callout bubble (the same element as {@link marketEl}). */
226
+ private readonly marketBubble;
227
+ private marketTip;
228
+ /** The show-chart eye — visible only while the chart is hidden. */
229
+ private readonly eyeEl;
230
+ private eyeTip;
231
+ private avatarEl;
232
+ private metaEl;
233
+ private readonly parts;
234
+ /** The right-click action menu — present once a host wires it via {@link attachMenu}. */
235
+ private menu;
236
+ private menuHooks;
237
+ /** Mirror of the renderer's `candleVisible` — see {@link setChartHidden}. */
238
+ private chartHidden;
239
+ private lastBar;
240
+ private hoverBar;
241
+ private unsubs;
242
+ /** Up/down ink for the OHLC + change values — the ACTIVE price style's configured
243
+ * colors (candle bodies, bar ticks, the line color, …); null falls back to the theme
244
+ * tokens. `isUp` overrides the close-vs-open direction rule where the style paints by
245
+ * something else (baseline: position against the baseline price). */
246
+ private upColor;
247
+ private downColor;
248
+ private isUp;
249
+ /** 'ohlc' for bar-shaped styles; 'value' (the single plotted close) for line styles. */
250
+ private readout;
251
+ /** Fit mode (multi-chart cells): one row, overflowing segments hidden — see {@link setFitMode}. */
252
+ private fitMode;
253
+ private fitRO;
254
+ constructor(host: HTMLElement, symbol: string,
255
+ /** The avatar's icon URL for a raw symbol — the shell routes it to the owning
256
+ * provider's `resolveSymbolIcon`. Absent ⇒ the initials badge. */
257
+ iconFor?: ((symbol: string) => string | undefined) | undefined);
258
+ setSymbol(symbol: string): void;
259
+ /**
260
+ * Multi-chart cells: keep the line on ONE row whatever the cell width — never wrap.
261
+ * Segments that don't fit are hidden outright rather than clipped mid-glyph, least
262
+ * important first: OHLC, then the bar change, the venue/timeframe meta, and the
263
+ * market badge; the logo + ticker always stay. Re-fits live on host resizes.
264
+ */
265
+ setFitMode(on: boolean): void;
266
+ /** Project the parts config onto the segments (the baseline fit() prunes from). */
267
+ private syncParts;
268
+ /** Hide overflowing segments until the row fits its max-width (fit mode only). */
269
+ private fit;
270
+ /** Shape + color the value readout after the active price style: its own up/down
271
+ * colors (candle bodies, bar ticks, the line color, …), the direction rule that
272
+ * picks between them (`isUp` replaces close-vs-open where the style paints by
273
+ * something else — baseline by position), and whether the readout is the four
274
+ * O/H/L/C values or the single plotted value (one-line styles). Null colors fall
275
+ * back to the theme's up/down tokens. See {@link statuslineInkOf}, which derives
276
+ * all of it from the live renderer. */
277
+ setDirectionColors(up: string | null, down: string | null, isUp?: ((bar: {
278
+ open: number;
279
+ close: number;
280
+ }) => boolean) | null, readout?: StatuslineReadout): void;
281
+ /** The "· BINANCE · 1h" segment after the symbol — venue first, then resolution. */
282
+ setMeta(timeframe: string, provider: string): void;
283
+ /** Dress the market badge for a session state: its icon, tinted circle, and the
284
+ * hover label. Callers with no session model leave the constructor's 'open'. */
285
+ setMarketStatus(status: MarketStatus): void;
286
+ /** Show/hide one part — the settings dialog's Status line tab and the right-click
287
+ * menu both drive these. 'name' owns the venue/timeframe meta too (see
288
+ * {@link segmentVisibility}). */
289
+ setPartVisible(part: StatuslinePart, visible: boolean): void;
290
+ partVisible(part: StatuslinePart): boolean;
291
+ /** Mirror the chart's (price series') visibility: dim the whole line like a hidden
292
+ * indicator's legend row, drop the value readout (OHLC + bar change — values of a
293
+ * series that isn't painted), and put the show-chart eye out in its place. The
294
+ * parts config is untouched, so showing the chart restores the readout exactly as
295
+ * configured. Idempotent; {@link render} re-syncs it from the live renderer, so
296
+ * toggles made elsewhere (the object tree's eye) converge too. */
297
+ setChartHidden(hidden: boolean): void;
298
+ /** Wire the right-click action menu: one checkable toggle per part plus hide/show
299
+ * for the chart itself. The menu is built once; later calls just swap the hooks. */
300
+ attachMenu(hooks: StatuslineMenuHooks): void;
301
+ private readonly onContextMenu;
302
+ private runMenuItem;
303
+ /** (Re)bind to a chart instance — called after every widget rebuild. */
304
+ onChart(chart: Vela): void;
305
+ destroy(): void;
306
+ private detach;
307
+ private render;
308
+ }
309
+
199
310
  declare class Watermark {
200
311
  readonly el: HTMLElement;
201
312
  private readonly text;
@@ -665,4 +776,4 @@ declare function fmtPrice(n: number | null | undefined, dp?: number): string;
665
776
  /** Signed change + percent ("+123.45 (+1.23%)") from open→close; `''` when unavailable. */
666
777
  declare function fmtChange(open: number | null | undefined, close: number | null | undefined): string;
667
778
 
668
- 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 };
779
+ 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 };
package/dist/widget.js CHANGED
@@ -1,7 +1,7 @@
1
- import { VelaWorkspace } from './chunk-IO3NYSQV.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-IO3NYSQV.js';
3
- export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-73PEA4MU.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-MTLJKZDZ.js';
1
+ import { VelaWorkspace } from './chunk-G52XAKZY.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-G52XAKZY.js';
3
+ export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-JKGA36ZM.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-F4M24ANM.js';
5
5
  import './chunk-G77Y7LK2.js';
6
6
  import './chunk-MHY7MVXH.js';
7
7
  import './chunk-KG4YT3TI.js';