@luxalgo/vela 0.8.4 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/{DataProvider-Byo8pEv0.d.ts → DataProvider-BGlB1zSc.d.ts} +1 -1
  2. package/dist/{DataProvider-Bw58CjYy.d.cts → DataProvider-zJGp58kb.d.cts} +1 -1
  3. package/dist/{chunk-MOJ4T26N.js → chunk-4WAHYL7Y.js} +1151 -474
  4. package/dist/chunk-O6L27KRB.js +1331 -0
  5. package/dist/{chunk-WY5H4S4I.js → chunk-PZN4RS4T.js} +91 -36
  6. package/dist/{chunk-AUOB7A5Y.js → chunk-WHPQQYH7.js} +29 -13
  7. package/dist/{chunk-UNUVPQFW.js → chunk-XIRSR3D6.js} +2837 -1604
  8. package/dist/{chunk-ALTGHKIM.js → chunk-YRCL3WMD.js} +510 -406
  9. package/dist/{contributions-BY3zSYiZ.d.ts → contributions-BjefWpxQ.d.ts} +106 -25
  10. package/dist/{contributions-DOm40g5-.d.cts → contributions-CpCJisTC.d.cts} +106 -25
  11. package/dist/index.cjs +4485 -2163
  12. package/dist/index.d.cts +67 -25
  13. package/dist/index.d.ts +67 -25
  14. package/dist/index.js +5 -5
  15. package/dist/{keymap-CGOz5F5f.d.ts → keymap-B9_FLhfJ.d.cts} +9 -6
  16. package/dist/{keymap-CGOz5F5f.d.cts → keymap-UolhuXH1.d.ts} +9 -6
  17. package/dist/locales/ar.cjs +2260 -0
  18. package/dist/locales/ar.d.cts +5 -0
  19. package/dist/locales/ar.d.ts +5 -0
  20. package/dist/locales/ar.js +2258 -0
  21. package/dist/locales/de.cjs +2260 -0
  22. package/dist/locales/de.d.cts +5 -0
  23. package/dist/locales/de.d.ts +5 -0
  24. package/dist/locales/de.js +2258 -0
  25. package/dist/locales/en.cjs +2260 -0
  26. package/dist/locales/en.d.cts +5 -0
  27. package/dist/locales/en.d.ts +5 -0
  28. package/dist/locales/en.js +2258 -0
  29. package/dist/locales/es.cjs +2260 -0
  30. package/dist/locales/es.d.cts +5 -0
  31. package/dist/locales/es.d.ts +5 -0
  32. package/dist/locales/es.js +2258 -0
  33. package/dist/locales/fr.cjs +2260 -0
  34. package/dist/locales/fr.d.cts +5 -0
  35. package/dist/locales/fr.d.ts +5 -0
  36. package/dist/locales/fr.js +2258 -0
  37. package/dist/locales/he.cjs +2260 -0
  38. package/dist/locales/he.d.cts +5 -0
  39. package/dist/locales/he.d.ts +5 -0
  40. package/dist/locales/he.js +2258 -0
  41. package/dist/locales/hi.cjs +2260 -0
  42. package/dist/locales/hi.d.cts +5 -0
  43. package/dist/locales/hi.d.ts +5 -0
  44. package/dist/locales/hi.js +2258 -0
  45. package/dist/locales/id.cjs +2260 -0
  46. package/dist/locales/id.d.cts +5 -0
  47. package/dist/locales/id.d.ts +5 -0
  48. package/dist/locales/id.js +2258 -0
  49. package/dist/locales/it.cjs +2260 -0
  50. package/dist/locales/it.d.cts +5 -0
  51. package/dist/locales/it.d.ts +5 -0
  52. package/dist/locales/it.js +2258 -0
  53. package/dist/locales/ja.cjs +2260 -0
  54. package/dist/locales/ja.d.cts +5 -0
  55. package/dist/locales/ja.d.ts +5 -0
  56. package/dist/locales/ja.js +2258 -0
  57. package/dist/locales/ko.cjs +2260 -0
  58. package/dist/locales/ko.d.cts +5 -0
  59. package/dist/locales/ko.d.ts +5 -0
  60. package/dist/locales/ko.js +2258 -0
  61. package/dist/locales/ms.cjs +2260 -0
  62. package/dist/locales/ms.d.cts +5 -0
  63. package/dist/locales/ms.d.ts +5 -0
  64. package/dist/locales/ms.js +2258 -0
  65. package/dist/locales/pl.cjs +2260 -0
  66. package/dist/locales/pl.d.cts +5 -0
  67. package/dist/locales/pl.d.ts +5 -0
  68. package/dist/locales/pl.js +2258 -0
  69. package/dist/locales/pt-BR.cjs +2260 -0
  70. package/dist/locales/pt-BR.d.cts +5 -0
  71. package/dist/locales/pt-BR.d.ts +5 -0
  72. package/dist/locales/pt-BR.js +2258 -0
  73. package/dist/locales/ru.cjs +2260 -0
  74. package/dist/locales/ru.d.cts +5 -0
  75. package/dist/locales/ru.d.ts +5 -0
  76. package/dist/locales/ru.js +2258 -0
  77. package/dist/locales/th.cjs +2260 -0
  78. package/dist/locales/th.d.cts +5 -0
  79. package/dist/locales/th.d.ts +5 -0
  80. package/dist/locales/th.js +2258 -0
  81. package/dist/locales/tr.cjs +2260 -0
  82. package/dist/locales/tr.d.cts +5 -0
  83. package/dist/locales/tr.d.ts +5 -0
  84. package/dist/locales/tr.js +2258 -0
  85. package/dist/locales/vi.cjs +2260 -0
  86. package/dist/locales/vi.d.cts +5 -0
  87. package/dist/locales/vi.d.ts +5 -0
  88. package/dist/locales/vi.js +2258 -0
  89. package/dist/locales/zh-Hans.cjs +2260 -0
  90. package/dist/locales/zh-Hans.d.cts +5 -0
  91. package/dist/locales/zh-Hans.d.ts +5 -0
  92. package/dist/locales/zh-Hans.js +2258 -0
  93. package/dist/locales/zh-Hant.cjs +2260 -0
  94. package/dist/locales/zh-Hant.d.cts +5 -0
  95. package/dist/locales/zh-Hant.d.ts +5 -0
  96. package/dist/locales/zh-Hant.js +2258 -0
  97. package/dist/{options-CSXbjMM5.d.cts → options-CpegHml_.d.cts} +110 -10
  98. package/dist/{options-CSXbjMM5.d.ts → options-D4L3_hv_.d.ts} +110 -10
  99. package/dist/{plugin-BDxUhGO3.d.ts → plugin-DTmulpKM.d.ts} +92 -40
  100. package/dist/{plugin-CiQVyETg.d.cts → plugin-DpNp4aBi.d.cts} +92 -40
  101. package/dist/plugin.cjs +1267 -319
  102. package/dist/plugin.d.cts +7 -6
  103. package/dist/plugin.d.ts +7 -6
  104. package/dist/plugin.js +3 -3
  105. package/dist/providers/binance.cjs +1 -1
  106. package/dist/providers/binance.d.cts +3 -2
  107. package/dist/providers/binance.d.ts +3 -2
  108. package/dist/providers/binance.js +1 -1
  109. package/dist/providers/coinbase.cjs +1 -1
  110. package/dist/providers/coinbase.d.cts +3 -2
  111. package/dist/providers/coinbase.d.ts +3 -2
  112. package/dist/providers/coinbase.js +1 -1
  113. package/dist/providers/hyperliquid.cjs +1 -1
  114. package/dist/providers/hyperliquid.d.cts +3 -2
  115. package/dist/providers/hyperliquid.d.ts +3 -2
  116. package/dist/providers/hyperliquid.js +1 -1
  117. package/dist/{side-panel-_2UK1gSm.d.ts → side-panel-BqUnpfev.d.cts} +13 -2
  118. package/dist/{side-panel-_2UK1gSm.d.cts → side-panel-CYmH1Opm.d.ts} +13 -2
  119. package/dist/{statusline-model-C9tYXuux.d.ts → statusline-model-C3yIY9WE.d.ts} +11 -3
  120. package/dist/{statusline-model-DUBX6Fib.d.cts → statusline-model-pGs3Xvp-.d.cts} +11 -3
  121. package/dist/types-BlrXRLIR.d.cts +2515 -0
  122. package/dist/types-BlrXRLIR.d.ts +2515 -0
  123. package/dist/ui.cjs +1008 -56
  124. package/dist/ui.d.cts +21 -2
  125. package/dist/ui.d.ts +21 -2
  126. package/dist/ui.js +3 -3
  127. package/dist/vela.global.js +4451 -2131
  128. package/dist/vela.global.min.js +57 -57
  129. package/dist/widget.cjs +5819 -2780
  130. package/dist/widget.d.cts +100 -26
  131. package/dist/widget.d.ts +100 -26
  132. package/dist/widget.js +19 -11
  133. package/dist/workspace.cjs +5808 -2787
  134. package/dist/workspace.d.cts +63 -15
  135. package/dist/workspace.d.ts +63 -15
  136. package/dist/workspace.js +6 -6
  137. package/package.json +9 -2
  138. package/dist/chunk-I2U4NZD2.js +0 -340
  139. /package/dist/{chunk-W5YPYZ2P.js → chunk-3EYCX2L4.js} +0 -0
@@ -1,5 +1,6 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.js';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-Byo8pEv0.js';
1
+ import { y as Millis, aq as InputSchema, an as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, m as IndicatorModel, l as MoveTarget, aJ as PaneAxis, b0 as SeriesSpec, al as Fill, J as Background, aS as PriceLine, a8 as DrawingLine, a4 as DrawingBox, a7 as DrawingLabel, ac as DrawingPolyline, a9 as DrawingLinefill, ah as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, B as DrawingTypeKey, z as SnapMode, aa as DrawingMode, v as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, p as LegendActionView, q as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, s as ClickEvent, A as AxisLongPressEvent, w as DataWindowReadout, o as SymbolPickerFn, W as WallClock, bi as PaneInfo, ak as DrawingsOption, ae as DrawingSeriesGateway, bj as DrawingToolDefaults, bk as DrawingToolTemplate, D as Drawing, t as TimelineMark, u as MarkGroup, b as VelaOptions, G as AddIndicatorOptions, aI as MarketSwitch, F as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-D4L3_hv_.js';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-BGlB1zSc.js';
3
+ import { M as MessageLike, T as Translator, c as LocaleChangedEvent, b as LocalizationOptions } from './types-BlrXRLIR.js';
3
4
 
4
5
  /**
5
6
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -502,7 +503,13 @@ interface NativeIndicatorContext {
502
503
  bars(): readonly OHLCV[];
503
504
  /** Market-data access (trades / capabilities) for data-driven natives. */
504
505
  readonly data: DataControl;
505
- /** Push a fresh render output; the chart mounts it (first call) or patches it (subsequent). */
506
+ /**
507
+ * Push a fresh render output; the chart mounts it (first call) or patches it (subsequent).
508
+ * Series payloads are index-aligned: one slot per bar of `bars()` AS IT STANDS AT THE
509
+ * CALL, first slot on its first bar. The chart keeps an emitted output on those bars
510
+ * when history later lands in front of them (or the oldest bars are trimmed), until the
511
+ * next emit replaces it.
512
+ */
506
513
  emit(out: NativeIndicatorOutput): void;
507
514
  /**
508
515
  * Push a BESPOKE render payload to the renderer's native layer for this indicator's type (for a
@@ -521,7 +528,8 @@ interface NativeIndicatorContext {
521
528
  interface NativeIndicator {
522
529
  /** Begin: compute + emit the first output. */
523
530
  start(ctx: NativeIndicatorContext, inputs: Record<string, InputValue>): void;
524
- /** A live tick arrived (bars changed) — recompute + emit. */
531
+ /** The bars changed — a live tick, older history landing, or the candles re-derived
532
+ * by a price style — recompute + emit. */
525
533
  onBars(): void;
526
534
  /** The viewport changed (scroll/zoom) — for range-aware natives (see `reactsToViewport`). */
527
535
  onViewport(range: VisibleRange): void;
@@ -533,7 +541,10 @@ interface NativeIndicator {
533
541
  suspend(): void;
534
542
  /** Shown again — resume + re-emit. */
535
543
  resume(): void;
536
- /** Removed — full teardown (clear caches, stop timers). Only ever called after `start`. */
544
+ /** Removed, or replaced by a fresh instance (a market switch stops it as the switch
545
+ * begins) — full teardown (clear caches, stop timers). Only ever called after `start`.
546
+ * Pushes made inside `stop()` still land (a layer-backed native clears its channel
547
+ * here); once it returns, the context drops every push and emit. */
537
548
  stop(): void;
538
549
  }
539
550
  /**
@@ -543,18 +554,30 @@ interface NativeIndicator {
543
554
  */
544
555
  interface NativeIndicatorDescriptor {
545
556
  readonly type: string;
546
- /** Full display name (picker, settings header, handle title). */
547
- readonly title: string;
557
+ /** Full display name (picker, settings header, handle title). A message (`msg()`)
558
+ * reads in the chart's language. */
559
+ readonly title: MessageLike;
548
560
  /**
549
561
  * Compact name for the on-chart legend chip, the settings-dialog header and the
550
562
  * object tree's indicator rows.
551
563
  * Absent ⇒ {@link title}. The picker keeps the full title either way.
552
564
  */
553
- readonly shortTitle?: string;
565
+ readonly shortTitle?: MessageLike;
554
566
  readonly paneHint: 'price' | 'new';
555
567
  readonly overlay: boolean;
556
568
  /** Whether instances react to viewport changes (drives the orchestrator's viewport poke). */
557
569
  readonly reactsToViewport?: boolean;
570
+ /**
571
+ * Compute only over the chart's COMPLETE history, the way script indicators do. While
572
+ * the history is still loading (a deep load streaming in, a source healing a cold
573
+ * symbol, a deeper depth being fetched), the instance is not started — its legend row
574
+ * shows a loading state, and `ready` / `indicator:added` wait — or, when it already
575
+ * runs, `onBars()` is held and the previous output stays on its bars. The first
576
+ * compute (or the re-run) comes once the history completes, so values computed over
577
+ * a partial history never paint and never repaint. Absent ⇒ the instance starts on
578
+ * the first bars and `onBars()` fires for every history chunk as it lands.
579
+ */
580
+ readonly waitsForHistory?: boolean;
558
581
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
559
582
  readonly beta?: boolean;
560
583
  /**
@@ -607,12 +630,19 @@ interface NativeIndicatorInfo {
607
630
  declare function registerNativeIndicator(descriptor: NativeIndicatorDescriptor): void;
608
631
  /** Remove a registered native-indicator type (mainly for tests). */
609
632
  declare function unregisterNativeIndicator(type: string): void;
610
- /** Look up a registered native-indicator descriptor (undefined if the type isn't registered). */
611
- declare function getNativeIndicator(type: string): NativeIndicatorDescriptor | undefined;
633
+ /** A registered descriptor as the read APIs hand it out: its names as plain text. */
634
+ type ResolvedNativeIndicatorDescriptor = NativeIndicatorDescriptor & {
635
+ readonly title: string;
636
+ readonly shortTitle?: string;
637
+ };
638
+ /** Look up a registered native-indicator descriptor (undefined if the type isn't registered).
639
+ * Its names read in `i18n`'s language (English without one). */
640
+ declare function getNativeIndicator(type: string, i18n?: Translator): ResolvedNativeIndicatorDescriptor | undefined;
612
641
  /** All registered native-indicator types (for a host "add native indicator" menu). */
613
642
  declare function nativeIndicatorTypes(): string[];
614
- /** All registered native-indicator descriptors (for building a catalog with metadata + capability). */
615
- declare function nativeIndicatorDescriptors(): NativeIndicatorDescriptor[];
643
+ /** All registered native-indicator descriptors (for building a catalog with metadata +
644
+ * capability), their names in `i18n`'s language (English without one). */
645
+ declare function nativeIndicatorDescriptors(i18n?: Translator): ResolvedNativeIndicatorDescriptor[];
616
646
 
617
647
  /**
618
648
  * Why a script computed. The distinction that matters most is `'tick'` vs `'bar'`: a tick
@@ -905,6 +935,12 @@ interface VelaEventMap extends Record<string, unknown> {
905
935
  * leave the app theme alone.
906
936
  */
907
937
  "theme:changed": VelaTheme;
938
+ /**
939
+ * The chart's localization changed through `chart.setLocale(...)` — after the chart has
940
+ * re-rendered its text and numbers. Carries the resolved locale and chrome direction so
941
+ * host chrome around the chart can follow.
942
+ */
943
+ "locale:changed": LocaleChangedEvent;
908
944
  /**
909
945
  * The base price style is switching `from` → `to` (candles, line, area, a chart-type
910
946
  * id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
@@ -1264,7 +1300,7 @@ declare class RendererControl {
1264
1300
  /** Contribute host settings tabs (callback rows) to the renderer's settings dialog —
1265
1301
  * e.g. the widget's Status line toggles. Silent no-op without a dialog. */
1266
1302
  setSettingsSections(sections: ReadonlyArray<{
1267
- title: string;
1303
+ title: MessageLike;
1268
1304
  rows: readonly unknown[];
1269
1305
  id?: string;
1270
1306
  }>): this;
@@ -1305,6 +1341,7 @@ interface PaneController {
1305
1341
  removePaneAndIndicators(paneId: string): void;
1306
1342
  collapsePane(paneId: string, collapsed: boolean): void;
1307
1343
  maximizePane(paneId: string | null): void;
1344
+ setPaneHeightWeight(paneId: string, weight: number): void;
1308
1345
  moveIndicator(id: string, target: MoveTarget): void;
1309
1346
  }
1310
1347
  /**
@@ -1327,6 +1364,14 @@ declare class PanesControl {
1327
1364
  collapse(paneId: string, collapsed?: boolean): this;
1328
1365
  /** Maximize one pane to fill the plot, or restore the split (`null`). */
1329
1366
  maximize(paneId: string | null): this;
1367
+ /**
1368
+ * Set a pane's height weight: the panes share the plot height in proportion to their
1369
+ * weights, so `setHeightWeight('price', 6)` next to two study panes at 1 gives the price
1370
+ * pane three quarters of the height. The weight sticks until the user drags a separator
1371
+ * or it is set again; a collapsed pane applies it when expanded. `weight` must be a
1372
+ * positive number.
1373
+ */
1374
+ setHeightWeight(paneId: string, weight: number): this;
1330
1375
  /** Move/merge an indicator to a pane — sugar for `handle.moveTo(...)` by id. */
1331
1376
  moveIndicator(id: string, target: MoveTarget): this;
1332
1377
  private guard;
@@ -1372,10 +1417,14 @@ interface AddInit {
1372
1417
  */
1373
1418
  declare class DrawingController {
1374
1419
  private readonly events;
1420
+ /** The chart's translator: the toolbar reaches the renderer labelled in its language. */
1421
+ private readonly i18n;
1375
1422
  private readonly store;
1376
1423
  private readonly history;
1377
1424
  private readonly port;
1378
1425
  private readonly enabled;
1426
+ /** The toolbar as last configured — re-read in the chart's language on {@link relocalize}. */
1427
+ private toolbarOption;
1379
1428
  private activeTool;
1380
1429
  /** Mirror of the renderer's sticky magnet mode (the renderer default is 'off'). */
1381
1430
  private snapMode;
@@ -1392,7 +1441,9 @@ declare class DrawingController {
1392
1441
  /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
1442
  private templates;
1394
1443
  private readonly subs;
1395
- constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1444
+ constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway,
1445
+ /** The chart's translator: the toolbar reaches the renderer labelled in its language. */
1446
+ i18n?: () => Translator | null);
1396
1447
  /** Whether the active renderer supports interactive drawings. */
1397
1448
  get supported(): boolean;
1398
1449
  setTool(type: DrawingTypeKey | null): void;
@@ -1431,6 +1482,8 @@ declare class DrawingController {
1431
1482
  removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
1483
  private pushTemplates;
1433
1484
  setToolbar(option: DrawingsOption): void;
1485
+ /** The chart's language changed: hand the renderer the toolbar relabelled in it. */
1486
+ relocalize(): void;
1434
1487
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1435
1488
  * inert on a renderer without the optional `setExternalGhost` seam. */
1436
1489
  setExternalGhost(doc: SerializedDrawing | null): void;
@@ -1734,7 +1787,27 @@ declare class Vela {
1734
1787
  private readonly drawingsControl;
1735
1788
  private readonly marksControl;
1736
1789
  private readonly replayControl;
1790
+ private readonly localeState;
1791
+ private readonly rendererPort;
1737
1792
  constructor(container: HTMLElement | string, options?: VelaOptions, deps?: VelaDeps);
1793
+ /**
1794
+ * The chart's translator: its resolved locale and direction, `t()` for messages, and
1795
+ * `format` for numbers and dates in the chart's locale. The same object for the
1796
+ * chart's lifetime; it reads the new settings after {@link setLocale}.
1797
+ */
1798
+ get i18n(): Translator;
1799
+ /**
1800
+ * Change the chart's language, direction or formatting at runtime — a locale tag
1801
+ * (`chart.setLocale('de')`) or any {@link LocalizationOptions} fields. Fields you pass
1802
+ * replace their current value (an explicit `undefined` restores the default); the
1803
+ * others are kept. The chart re-renders its text, axes and readouts in place (no
1804
+ * indicator re-run) and emits `locale:changed`. Register the locale's pack
1805
+ * (`registerLocale`) first for translated text.
1806
+ */
1807
+ setLocale(next: string | LocalizationOptions): this;
1808
+ /** Hand the renderer the translator and the root attributes the host asked for: `lang`
1809
+ * once a locale is set, `dir` once a direction is (unset, the host page decides). */
1810
+ private pushLocalization;
1738
1811
  /**
1739
1812
  * Register a scripting engine so `addIndicator({ language })` can run that
1740
1813
  * language. Vela ships NO engine — install the one you need (Pine Script:
@@ -1939,6 +2012,10 @@ interface WidgetContext {
1939
2012
  * (Dialog/Menu/Tooltip) from an action; without an explicit host they portal to
1940
2013
  * the body, OUTSIDE the theme variables. A multi-chart shell hands its own root. */
1941
2014
  host: HTMLElement;
2015
+ /** The shell's translator: `i18n.t(msg(...))` for text an action or panel renders,
2016
+ * `i18n.format` for its numbers and dates, `i18n.direction` for its layout. It follows
2017
+ * `setLocale`; listen to the shell's `locale:changed` to re-render. */
2018
+ i18n: Translator;
1942
2019
  /** The widget's feedback pill (bottom-center, auto-hides). */
1943
2020
  toast(message: string, kind?: 'info' | 'success' | 'error'): void;
1944
2021
  /** Add a SCRIPT indicator to the active chart THROUGH THE SHELL — unlike the raw
@@ -1975,6 +2052,8 @@ interface ContextMenuPointer {
1975
2052
  time: number | null;
1976
2053
  /** The kind of pane the pointer is on; null off the plot. */
1977
2054
  paneKind: 'price' | 'study' | null;
2055
+ /** The id of the pane the pointer is on, as `chart.panes.list()` reports it; null off the plot. */
2056
+ paneId: string | null;
1978
2057
  }
1979
2058
  /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1980
2059
  interface ExternalIndicatorEntry {
@@ -2005,8 +2084,9 @@ interface WidgetActionDescriptor {
2005
2084
  id: string;
2006
2085
  target: WidgetActionTarget;
2007
2086
  /** Always required, even icon-only: it is the button's aria-label and tooltip, the
2008
- * mobile drawer row's text, and the context-menu item's label. */
2009
- label: string;
2087
+ * mobile drawer row's text, and the context-menu item's label. A message
2088
+ * (`msg(id, 'English')`) follows the shell's language; a plain string shows as is. */
2089
+ label: MessageLike;
2010
2090
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2011
2091
  icon?: string;
2012
2092
  /** Topbar only: render the DESKTOP button icon-only, like the built-in tools — the
@@ -2072,7 +2152,7 @@ interface SidePanelHeader {
2072
2152
  slot: HTMLElement;
2073
2153
  /** Replace the header title (an empty string hides it). The topbar toggle keeps the
2074
2154
  * DECLARED `title` as its tooltip. */
2075
- setTitle(title: string): void;
2155
+ setTitle(title: MessageLike): void;
2076
2156
  /** Whether the panel covers every chart right now (see `maximizable`). */
2077
2157
  readonly maximized: boolean;
2078
2158
  /** Maximize the panel over the shell's charts, or restore it — what its header button
@@ -2092,8 +2172,8 @@ interface SidePanelHeader {
2092
2172
  interface SidePanelDescriptor {
2093
2173
  /** Stable id — re-registering an id replaces it. Also the key its width persists under. */
2094
2174
  id: string;
2095
- /** Header title, and the tooltip of its topbar button. */
2096
- title: string;
2175
+ /** Header title, and the tooltip of its topbar button. A message follows the shell's language. */
2176
+ title: MessageLike;
2097
2177
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2098
2178
  icon: string;
2099
2179
  /** Sort key among the panel buttons (ascending; default 100 — after the built-ins). */
@@ -2176,7 +2256,8 @@ interface LegendActionDescriptor {
2176
2256
  id: string;
2177
2257
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2178
2258
  icon: string;
2179
- tooltip: string;
2259
+ /** Hover text. A message follows the chart's language. */
2260
+ tooltip: MessageLike;
2180
2261
  /** Sort key within the contributed group (ascending; default 0). */
2181
2262
  order?: number;
2182
2263
  /** Per-indicator gate — omitted ⇒ shown on every row. */
@@ -2193,10 +2274,10 @@ declare function legendActions(): LegendActionDescriptor[];
2193
2274
  * indicator — the same signature as a legend action's `run`. */
2194
2275
  type LegendCalloutItem = {
2195
2276
  type: 'text';
2196
- text: string;
2277
+ text: MessageLike;
2197
2278
  } | {
2198
2279
  type: 'button';
2199
- label: string;
2280
+ label: MessageLike;
2200
2281
  /** Emphasized (selection-colored) button — the panel's main action. */
2201
2282
  primary?: boolean;
2202
2283
  /** Close the panel after `run` (default true). */
@@ -2205,7 +2286,7 @@ type LegendCalloutItem = {
2205
2286
  };
2206
2287
  /** The panel a clickable callout deploys: an optional heading over ordered blocks. */
2207
2288
  interface LegendCalloutContent {
2208
- title?: string;
2289
+ title?: MessageLike;
2209
2290
  items: LegendCalloutItem[];
2210
2291
  }
2211
2292
  /** A callout's resolved presentation for one row — what {@link LegendCalloutDescriptor.callout} returns. */
@@ -2216,8 +2297,8 @@ interface LegendCalloutSpec {
2216
2297
  background: string;
2217
2298
  /** Icon ink (default: the legend row's text color). */
2218
2299
  color?: string;
2219
- /** Hover text; also the bubble's accessible name. */
2220
- tooltip: string;
2300
+ /** Hover text; also the bubble's accessible name. A message follows the chart's language. */
2301
+ tooltip: MessageLike;
2221
2302
  /** Deployed panel — presence makes the bubble clickable. */
2222
2303
  content?: LegendCalloutContent;
2223
2304
  }
@@ -1,5 +1,6 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.cjs';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-Bw58CjYy.cjs';
1
+ import { y as Millis, aq as InputSchema, an as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, m as IndicatorModel, l as MoveTarget, aJ as PaneAxis, b0 as SeriesSpec, al as Fill, J as Background, aS as PriceLine, a8 as DrawingLine, a4 as DrawingBox, a7 as DrawingLabel, ac as DrawingPolyline, a9 as DrawingLinefill, ah as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, B as DrawingTypeKey, z as SnapMode, aa as DrawingMode, v as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, p as LegendActionView, q as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, s as ClickEvent, A as AxisLongPressEvent, w as DataWindowReadout, o as SymbolPickerFn, W as WallClock, bi as PaneInfo, ak as DrawingsOption, ae as DrawingSeriesGateway, bj as DrawingToolDefaults, bk as DrawingToolTemplate, D as Drawing, t as TimelineMark, u as MarkGroup, b as VelaOptions, G as AddIndicatorOptions, aI as MarketSwitch, F as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CpegHml_.cjs';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-zJGp58kb.cjs';
3
+ import { M as MessageLike, T as Translator, c as LocaleChangedEvent, b as LocalizationOptions } from './types-BlrXRLIR.cjs';
3
4
 
4
5
  /**
5
6
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -502,7 +503,13 @@ interface NativeIndicatorContext {
502
503
  bars(): readonly OHLCV[];
503
504
  /** Market-data access (trades / capabilities) for data-driven natives. */
504
505
  readonly data: DataControl;
505
- /** Push a fresh render output; the chart mounts it (first call) or patches it (subsequent). */
506
+ /**
507
+ * Push a fresh render output; the chart mounts it (first call) or patches it (subsequent).
508
+ * Series payloads are index-aligned: one slot per bar of `bars()` AS IT STANDS AT THE
509
+ * CALL, first slot on its first bar. The chart keeps an emitted output on those bars
510
+ * when history later lands in front of them (or the oldest bars are trimmed), until the
511
+ * next emit replaces it.
512
+ */
506
513
  emit(out: NativeIndicatorOutput): void;
507
514
  /**
508
515
  * Push a BESPOKE render payload to the renderer's native layer for this indicator's type (for a
@@ -521,7 +528,8 @@ interface NativeIndicatorContext {
521
528
  interface NativeIndicator {
522
529
  /** Begin: compute + emit the first output. */
523
530
  start(ctx: NativeIndicatorContext, inputs: Record<string, InputValue>): void;
524
- /** A live tick arrived (bars changed) — recompute + emit. */
531
+ /** The bars changed — a live tick, older history landing, or the candles re-derived
532
+ * by a price style — recompute + emit. */
525
533
  onBars(): void;
526
534
  /** The viewport changed (scroll/zoom) — for range-aware natives (see `reactsToViewport`). */
527
535
  onViewport(range: VisibleRange): void;
@@ -533,7 +541,10 @@ interface NativeIndicator {
533
541
  suspend(): void;
534
542
  /** Shown again — resume + re-emit. */
535
543
  resume(): void;
536
- /** Removed — full teardown (clear caches, stop timers). Only ever called after `start`. */
544
+ /** Removed, or replaced by a fresh instance (a market switch stops it as the switch
545
+ * begins) — full teardown (clear caches, stop timers). Only ever called after `start`.
546
+ * Pushes made inside `stop()` still land (a layer-backed native clears its channel
547
+ * here); once it returns, the context drops every push and emit. */
537
548
  stop(): void;
538
549
  }
539
550
  /**
@@ -543,18 +554,30 @@ interface NativeIndicator {
543
554
  */
544
555
  interface NativeIndicatorDescriptor {
545
556
  readonly type: string;
546
- /** Full display name (picker, settings header, handle title). */
547
- readonly title: string;
557
+ /** Full display name (picker, settings header, handle title). A message (`msg()`)
558
+ * reads in the chart's language. */
559
+ readonly title: MessageLike;
548
560
  /**
549
561
  * Compact name for the on-chart legend chip, the settings-dialog header and the
550
562
  * object tree's indicator rows.
551
563
  * Absent ⇒ {@link title}. The picker keeps the full title either way.
552
564
  */
553
- readonly shortTitle?: string;
565
+ readonly shortTitle?: MessageLike;
554
566
  readonly paneHint: 'price' | 'new';
555
567
  readonly overlay: boolean;
556
568
  /** Whether instances react to viewport changes (drives the orchestrator's viewport poke). */
557
569
  readonly reactsToViewport?: boolean;
570
+ /**
571
+ * Compute only over the chart's COMPLETE history, the way script indicators do. While
572
+ * the history is still loading (a deep load streaming in, a source healing a cold
573
+ * symbol, a deeper depth being fetched), the instance is not started — its legend row
574
+ * shows a loading state, and `ready` / `indicator:added` wait — or, when it already
575
+ * runs, `onBars()` is held and the previous output stays on its bars. The first
576
+ * compute (or the re-run) comes once the history completes, so values computed over
577
+ * a partial history never paint and never repaint. Absent ⇒ the instance starts on
578
+ * the first bars and `onBars()` fires for every history chunk as it lands.
579
+ */
580
+ readonly waitsForHistory?: boolean;
558
581
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
559
582
  readonly beta?: boolean;
560
583
  /**
@@ -607,12 +630,19 @@ interface NativeIndicatorInfo {
607
630
  declare function registerNativeIndicator(descriptor: NativeIndicatorDescriptor): void;
608
631
  /** Remove a registered native-indicator type (mainly for tests). */
609
632
  declare function unregisterNativeIndicator(type: string): void;
610
- /** Look up a registered native-indicator descriptor (undefined if the type isn't registered). */
611
- declare function getNativeIndicator(type: string): NativeIndicatorDescriptor | undefined;
633
+ /** A registered descriptor as the read APIs hand it out: its names as plain text. */
634
+ type ResolvedNativeIndicatorDescriptor = NativeIndicatorDescriptor & {
635
+ readonly title: string;
636
+ readonly shortTitle?: string;
637
+ };
638
+ /** Look up a registered native-indicator descriptor (undefined if the type isn't registered).
639
+ * Its names read in `i18n`'s language (English without one). */
640
+ declare function getNativeIndicator(type: string, i18n?: Translator): ResolvedNativeIndicatorDescriptor | undefined;
612
641
  /** All registered native-indicator types (for a host "add native indicator" menu). */
613
642
  declare function nativeIndicatorTypes(): string[];
614
- /** All registered native-indicator descriptors (for building a catalog with metadata + capability). */
615
- declare function nativeIndicatorDescriptors(): NativeIndicatorDescriptor[];
643
+ /** All registered native-indicator descriptors (for building a catalog with metadata +
644
+ * capability), their names in `i18n`'s language (English without one). */
645
+ declare function nativeIndicatorDescriptors(i18n?: Translator): ResolvedNativeIndicatorDescriptor[];
616
646
 
617
647
  /**
618
648
  * Why a script computed. The distinction that matters most is `'tick'` vs `'bar'`: a tick
@@ -905,6 +935,12 @@ interface VelaEventMap extends Record<string, unknown> {
905
935
  * leave the app theme alone.
906
936
  */
907
937
  "theme:changed": VelaTheme;
938
+ /**
939
+ * The chart's localization changed through `chart.setLocale(...)` — after the chart has
940
+ * re-rendered its text and numbers. Carries the resolved locale and chrome direction so
941
+ * host chrome around the chart can follow.
942
+ */
943
+ "locale:changed": LocaleChangedEvent;
908
944
  /**
909
945
  * The base price style is switching `from` → `to` (candles, line, area, a chart-type
910
946
  * id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
@@ -1264,7 +1300,7 @@ declare class RendererControl {
1264
1300
  /** Contribute host settings tabs (callback rows) to the renderer's settings dialog —
1265
1301
  * e.g. the widget's Status line toggles. Silent no-op without a dialog. */
1266
1302
  setSettingsSections(sections: ReadonlyArray<{
1267
- title: string;
1303
+ title: MessageLike;
1268
1304
  rows: readonly unknown[];
1269
1305
  id?: string;
1270
1306
  }>): this;
@@ -1305,6 +1341,7 @@ interface PaneController {
1305
1341
  removePaneAndIndicators(paneId: string): void;
1306
1342
  collapsePane(paneId: string, collapsed: boolean): void;
1307
1343
  maximizePane(paneId: string | null): void;
1344
+ setPaneHeightWeight(paneId: string, weight: number): void;
1308
1345
  moveIndicator(id: string, target: MoveTarget): void;
1309
1346
  }
1310
1347
  /**
@@ -1327,6 +1364,14 @@ declare class PanesControl {
1327
1364
  collapse(paneId: string, collapsed?: boolean): this;
1328
1365
  /** Maximize one pane to fill the plot, or restore the split (`null`). */
1329
1366
  maximize(paneId: string | null): this;
1367
+ /**
1368
+ * Set a pane's height weight: the panes share the plot height in proportion to their
1369
+ * weights, so `setHeightWeight('price', 6)` next to two study panes at 1 gives the price
1370
+ * pane three quarters of the height. The weight sticks until the user drags a separator
1371
+ * or it is set again; a collapsed pane applies it when expanded. `weight` must be a
1372
+ * positive number.
1373
+ */
1374
+ setHeightWeight(paneId: string, weight: number): this;
1330
1375
  /** Move/merge an indicator to a pane — sugar for `handle.moveTo(...)` by id. */
1331
1376
  moveIndicator(id: string, target: MoveTarget): this;
1332
1377
  private guard;
@@ -1372,10 +1417,14 @@ interface AddInit {
1372
1417
  */
1373
1418
  declare class DrawingController {
1374
1419
  private readonly events;
1420
+ /** The chart's translator: the toolbar reaches the renderer labelled in its language. */
1421
+ private readonly i18n;
1375
1422
  private readonly store;
1376
1423
  private readonly history;
1377
1424
  private readonly port;
1378
1425
  private readonly enabled;
1426
+ /** The toolbar as last configured — re-read in the chart's language on {@link relocalize}. */
1427
+ private toolbarOption;
1379
1428
  private activeTool;
1380
1429
  /** Mirror of the renderer's sticky magnet mode (the renderer default is 'off'). */
1381
1430
  private snapMode;
@@ -1392,7 +1441,9 @@ declare class DrawingController {
1392
1441
  /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
1442
  private templates;
1394
1443
  private readonly subs;
1395
- constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1444
+ constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway,
1445
+ /** The chart's translator: the toolbar reaches the renderer labelled in its language. */
1446
+ i18n?: () => Translator | null);
1396
1447
  /** Whether the active renderer supports interactive drawings. */
1397
1448
  get supported(): boolean;
1398
1449
  setTool(type: DrawingTypeKey | null): void;
@@ -1431,6 +1482,8 @@ declare class DrawingController {
1431
1482
  removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
1483
  private pushTemplates;
1433
1484
  setToolbar(option: DrawingsOption): void;
1485
+ /** The chart's language changed: hand the renderer the toolbar relabelled in it. */
1486
+ relocalize(): void;
1434
1487
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1435
1488
  * inert on a renderer without the optional `setExternalGhost` seam. */
1436
1489
  setExternalGhost(doc: SerializedDrawing | null): void;
@@ -1734,7 +1787,27 @@ declare class Vela {
1734
1787
  private readonly drawingsControl;
1735
1788
  private readonly marksControl;
1736
1789
  private readonly replayControl;
1790
+ private readonly localeState;
1791
+ private readonly rendererPort;
1737
1792
  constructor(container: HTMLElement | string, options?: VelaOptions, deps?: VelaDeps);
1793
+ /**
1794
+ * The chart's translator: its resolved locale and direction, `t()` for messages, and
1795
+ * `format` for numbers and dates in the chart's locale. The same object for the
1796
+ * chart's lifetime; it reads the new settings after {@link setLocale}.
1797
+ */
1798
+ get i18n(): Translator;
1799
+ /**
1800
+ * Change the chart's language, direction or formatting at runtime — a locale tag
1801
+ * (`chart.setLocale('de')`) or any {@link LocalizationOptions} fields. Fields you pass
1802
+ * replace their current value (an explicit `undefined` restores the default); the
1803
+ * others are kept. The chart re-renders its text, axes and readouts in place (no
1804
+ * indicator re-run) and emits `locale:changed`. Register the locale's pack
1805
+ * (`registerLocale`) first for translated text.
1806
+ */
1807
+ setLocale(next: string | LocalizationOptions): this;
1808
+ /** Hand the renderer the translator and the root attributes the host asked for: `lang`
1809
+ * once a locale is set, `dir` once a direction is (unset, the host page decides). */
1810
+ private pushLocalization;
1738
1811
  /**
1739
1812
  * Register a scripting engine so `addIndicator({ language })` can run that
1740
1813
  * language. Vela ships NO engine — install the one you need (Pine Script:
@@ -1939,6 +2012,10 @@ interface WidgetContext {
1939
2012
  * (Dialog/Menu/Tooltip) from an action; without an explicit host they portal to
1940
2013
  * the body, OUTSIDE the theme variables. A multi-chart shell hands its own root. */
1941
2014
  host: HTMLElement;
2015
+ /** The shell's translator: `i18n.t(msg(...))` for text an action or panel renders,
2016
+ * `i18n.format` for its numbers and dates, `i18n.direction` for its layout. It follows
2017
+ * `setLocale`; listen to the shell's `locale:changed` to re-render. */
2018
+ i18n: Translator;
1942
2019
  /** The widget's feedback pill (bottom-center, auto-hides). */
1943
2020
  toast(message: string, kind?: 'info' | 'success' | 'error'): void;
1944
2021
  /** Add a SCRIPT indicator to the active chart THROUGH THE SHELL — unlike the raw
@@ -1975,6 +2052,8 @@ interface ContextMenuPointer {
1975
2052
  time: number | null;
1976
2053
  /** The kind of pane the pointer is on; null off the plot. */
1977
2054
  paneKind: 'price' | 'study' | null;
2055
+ /** The id of the pane the pointer is on, as `chart.panes.list()` reports it; null off the plot. */
2056
+ paneId: string | null;
1978
2057
  }
1979
2058
  /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1980
2059
  interface ExternalIndicatorEntry {
@@ -2005,8 +2084,9 @@ interface WidgetActionDescriptor {
2005
2084
  id: string;
2006
2085
  target: WidgetActionTarget;
2007
2086
  /** Always required, even icon-only: it is the button's aria-label and tooltip, the
2008
- * mobile drawer row's text, and the context-menu item's label. */
2009
- label: string;
2087
+ * mobile drawer row's text, and the context-menu item's label. A message
2088
+ * (`msg(id, 'English')`) follows the shell's language; a plain string shows as is. */
2089
+ label: MessageLike;
2010
2090
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2011
2091
  icon?: string;
2012
2092
  /** Topbar only: render the DESKTOP button icon-only, like the built-in tools — the
@@ -2072,7 +2152,7 @@ interface SidePanelHeader {
2072
2152
  slot: HTMLElement;
2073
2153
  /** Replace the header title (an empty string hides it). The topbar toggle keeps the
2074
2154
  * DECLARED `title` as its tooltip. */
2075
- setTitle(title: string): void;
2155
+ setTitle(title: MessageLike): void;
2076
2156
  /** Whether the panel covers every chart right now (see `maximizable`). */
2077
2157
  readonly maximized: boolean;
2078
2158
  /** Maximize the panel over the shell's charts, or restore it — what its header button
@@ -2092,8 +2172,8 @@ interface SidePanelHeader {
2092
2172
  interface SidePanelDescriptor {
2093
2173
  /** Stable id — re-registering an id replaces it. Also the key its width persists under. */
2094
2174
  id: string;
2095
- /** Header title, and the tooltip of its topbar button. */
2096
- title: string;
2175
+ /** Header title, and the tooltip of its topbar button. A message follows the shell's language. */
2176
+ title: MessageLike;
2097
2177
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2098
2178
  icon: string;
2099
2179
  /** Sort key among the panel buttons (ascending; default 100 — after the built-ins). */
@@ -2176,7 +2256,8 @@ interface LegendActionDescriptor {
2176
2256
  id: string;
2177
2257
  /** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
2178
2258
  icon: string;
2179
- tooltip: string;
2259
+ /** Hover text. A message follows the chart's language. */
2260
+ tooltip: MessageLike;
2180
2261
  /** Sort key within the contributed group (ascending; default 0). */
2181
2262
  order?: number;
2182
2263
  /** Per-indicator gate — omitted ⇒ shown on every row. */
@@ -2193,10 +2274,10 @@ declare function legendActions(): LegendActionDescriptor[];
2193
2274
  * indicator — the same signature as a legend action's `run`. */
2194
2275
  type LegendCalloutItem = {
2195
2276
  type: 'text';
2196
- text: string;
2277
+ text: MessageLike;
2197
2278
  } | {
2198
2279
  type: 'button';
2199
- label: string;
2280
+ label: MessageLike;
2200
2281
  /** Emphasized (selection-colored) button — the panel's main action. */
2201
2282
  primary?: boolean;
2202
2283
  /** Close the panel after `run` (default true). */
@@ -2205,7 +2286,7 @@ type LegendCalloutItem = {
2205
2286
  };
2206
2287
  /** The panel a clickable callout deploys: an optional heading over ordered blocks. */
2207
2288
  interface LegendCalloutContent {
2208
- title?: string;
2289
+ title?: MessageLike;
2209
2290
  items: LegendCalloutItem[];
2210
2291
  }
2211
2292
  /** A callout's resolved presentation for one row — what {@link LegendCalloutDescriptor.callout} returns. */
@@ -2216,8 +2297,8 @@ interface LegendCalloutSpec {
2216
2297
  background: string;
2217
2298
  /** Icon ink (default: the legend row's text color). */
2218
2299
  color?: string;
2219
- /** Hover text; also the bubble's accessible name. */
2220
- tooltip: string;
2300
+ /** Hover text; also the bubble's accessible name. A message follows the chart's language. */
2301
+ tooltip: MessageLike;
2221
2302
  /** Deployed panel — presence makes the bubble clickable. */
2222
2303
  content?: LegendCalloutContent;
2223
2304
  }