@luxalgo/vela 0.8.5 → 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-BUdlkx9I.d.ts → DataProvider-BGlB1zSc.d.ts} +1 -1
  2. package/dist/{DataProvider-DdqMxKdl.d.cts → DataProvider-zJGp58kb.d.cts} +1 -1
  3. package/dist/{chunk-BN4DNS3O.js → chunk-4WAHYL7Y.js} +1125 -468
  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-QYIO37K7.js → chunk-XIRSR3D6.js} +2374 -1529
  8. package/dist/{chunk-ALTGHKIM.js → chunk-YRCL3WMD.js} +510 -406
  9. package/dist/{contributions-D8xuYc9U.d.cts → contributions-BjefWpxQ.d.ts} +71 -22
  10. package/dist/{contributions-P9fBBuY1.d.ts → contributions-CpCJisTC.d.cts} +71 -22
  11. package/dist/index.cjs +4022 -2088
  12. package/dist/index.d.cts +51 -25
  13. package/dist/index.d.ts +51 -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-BI5Tp32b.d.cts → options-CpegHml_.d.cts} +74 -9
  98. package/dist/{options-BI5Tp32b.d.ts → options-D4L3_hv_.d.ts} +74 -9
  99. package/dist/{plugin-D5Z-Q6TX.d.ts → plugin-DTmulpKM.d.ts} +81 -35
  100. package/dist/{plugin-B8F1nor8.d.cts → plugin-DpNp4aBi.d.cts} +81 -35
  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-CTwtDIca.d.cts → statusline-model-C3yIY9WE.d.ts} +11 -3
  120. package/dist/{statusline-model-D9kWC9X5.d.ts → 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 +3987 -2055
  128. package/dist/vela.global.min.js +57 -57
  129. package/dist/widget.cjs +5330 -2699
  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 +5319 -2706
  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,3 +1,5 @@
1
+ import { M as MessageLike, T as Translator, m as TextDirection, b as LocalizationOptions } from './types-BlrXRLIR.cjs';
2
+
1
3
  /**
2
4
  * Canonical time in Vela: Unix epoch **milliseconds**.
3
5
  *
@@ -86,7 +88,11 @@ interface SeriesDisplay {
86
88
  interface SeriesBase {
87
89
  /** Content-addressed, stable across re-runs of identical source (see identity.ts). */
88
90
  id: string;
91
+ /** The series' name: its identity for engines and hosts (output keys, series ids). */
89
92
  title: string;
93
+ /** What the legend, the data window and the settings show instead of {@link title}, in
94
+ * the chart's language. Absent ⇒ {@link title}. */
95
+ displayTitle?: MessageLike;
90
96
  /** Pane this series belongs to; resolved by the orchestrator. */
91
97
  paneId: string;
92
98
  /** Declared draw-order intent; the renderer owns final z-ordering. */
@@ -381,6 +387,8 @@ interface PriceLine {
381
387
  lineStyle?: LineStyle;
382
388
  width?: number;
383
389
  title?: string;
390
+ /** {@link title} in the chart's language. Absent ⇒ {@link title}. */
391
+ displayTitle?: MessageLike;
384
392
  }
385
393
  /**
386
394
  * The renderer-neutral, full description of what to draw. In the engine-owned
@@ -436,8 +444,26 @@ interface TradeExecution {
436
444
  * declarations onto this at its boundary). Drives the renderer's settings dialog
437
445
  * (the gear settings UI).
438
446
  */
447
+
439
448
  type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'price' | 'time' | 'session' | 'timeframe' | 'symbol' | 'text_area';
440
449
  type InputValue = number | string | boolean;
450
+ /**
451
+ * The display side of an input: what the settings dialog and the legend SHOW, in the
452
+ * chart's language. The input's own `title`, `group` and `options` stay what they are
453
+ * (a script reads them, layouts persist the option values), and this side-car only
454
+ * changes how they read. Each field is optional and falls back to the identity field.
455
+ */
456
+ interface InputDisplay {
457
+ /** Shown instead of `title`. */
458
+ title?: MessageLike;
459
+ /** Shown instead of `tooltip`. */
460
+ tooltip?: MessageLike;
461
+ /** Shown instead of `group` as the section heading. */
462
+ group?: MessageLike;
463
+ /** Shown label per stored option value (`'Close'` → a translated "Close"). Values
464
+ * without an entry show as themselves. */
465
+ options?: Readonly<Record<string, MessageLike>>;
466
+ }
441
467
  /**
442
468
  * Host-provided symbol picker for the settings dialog's `input.symbol` control. Called when the
443
469
  * user activates the field: the host opens its own symbol-selection UI (e.g. the app's ticker
@@ -483,6 +509,8 @@ interface InputSchema {
483
509
  * `inline=` row show while ANY member's gate passes. A hidden input keeps its value. */
484
510
  when?: InputWhen;
485
511
  tooltip?: string;
512
+ /** Translatable display text for this input (see {@link InputDisplay}). */
513
+ display?: InputDisplay;
486
514
  }
487
515
  /**
488
516
  * The DELTAS of a value bag against its schema's declaration defaults — what state
@@ -528,6 +556,11 @@ interface IndicatorModel {
528
556
  * `indicator(..., shorttitle=)`.
529
557
  */
530
558
  shorttitle?: string;
559
+ /** What the chart SHOWS for {@link title}, in its language (a native indicator's
560
+ * translatable name). Absent ⇒ {@link title}. */
561
+ displayTitle?: MessageLike;
562
+ /** What the chart shows for {@link shorttitle}. Absent ⇒ {@link shorttitle}. */
563
+ displayShorttitle?: MessageLike;
531
564
  overlay: boolean;
532
565
  paneHint: PaneHint;
533
566
  /**
@@ -891,11 +924,13 @@ interface DrawingText {
891
924
  * renderer's settings popup builds controls generically — adding a new drawing
892
925
  * type is a schema entry, not new UI code.
893
926
  */
927
+
894
928
  type FieldKind = 'color' | 'number' | 'select' | 'lineStyle' | 'boolean' | 'text' | 'opacity';
895
929
  interface SettingsField {
896
930
  /** Dot-path into the drawing, e.g. `'style.lineColor'`, `'text.value'`, `'locked'`. */
897
931
  path: string;
898
- label: string;
932
+ /** What the settings show; a message reads in the chart's language. */
933
+ label: MessageLike;
899
934
  kind: FieldKind;
900
935
  /** number/opacity bounds. */
901
936
  min?: number;
@@ -904,7 +939,7 @@ interface SettingsField {
904
939
  /** select options. */
905
940
  options?: ReadonlyArray<{
906
941
  value: string;
907
- label: string;
942
+ label: MessageLike;
908
943
  }>;
909
944
  /** Cosmetic grouping in the popup. */
910
945
  group?: 'line' | 'fill' | 'text' | 'behavior';
@@ -914,6 +949,10 @@ interface SettingsField {
914
949
  path: string;
915
950
  in: readonly unknown[];
916
951
  };
952
+ /** The label of the one row this field shares with the next one: a color and its line
953
+ * style ("Midline" for "Midline color" + "Midline style"), or an upper and a lower color
954
+ * ("Bands"). */
955
+ rowLabel?: MessageLike;
917
956
  }
918
957
  interface SettingsSchema {
919
958
  fields: SettingsField[];
@@ -1046,6 +1085,10 @@ declare abstract class Drawing {
1046
1085
  max: number;
1047
1086
  } | null;
1048
1087
  abstract schema(): SettingsSchema;
1088
+ /** The text a fresh drawing of this type starts with ("Note", "Callout"), as a message,
1089
+ * or null for a type that seeds none. A new drawing stores its English source; the chart
1090
+ * that places one interactively writes it in its own language instead. */
1091
+ placeholderText(): MessageLike | null;
1049
1092
  /**
1050
1093
  * Editable per-level config for a rich "gear" settings panel (Fibonacci levels):
1051
1094
  * each entry's `color` / `enabled` / `label` is mutated via a `levels.<i>.<field>`
@@ -1076,6 +1119,7 @@ declare abstract class Drawing {
1076
1119
  */
1077
1120
  interface ToolDefinition {
1078
1121
  type: DrawingTypeKey;
1122
+ /** The tool's name, in the language the definition was built for. */
1079
1123
  label: string;
1080
1124
  /** Inline SVG markup (no DOM). */
1081
1125
  icon: string;
@@ -1098,7 +1142,8 @@ interface ToolbarDefinition {
1098
1142
  /** A developer-supplied explicit group (just type keys; the registry fills the rest). */
1099
1143
  interface ToolbarGroupConfig {
1100
1144
  id: string;
1101
- label: string;
1145
+ /** The group's name; a message (`msg()`) reads in the chart's language. */
1146
+ label: MessageLike;
1102
1147
  tools: DrawingTypeKey[];
1103
1148
  }
1104
1149
  /** Public `options.drawings` shape. `true` = default toolbar; object = customize. */
@@ -1107,14 +1152,15 @@ type DrawingsOption = boolean | {
1107
1152
  tools?: DrawingTypeKey[];
1108
1153
  groups?: ToolbarGroupConfig[];
1109
1154
  };
1110
- /** The default toolbar — every registered type, grouped into the canonical seven-button layout. */
1111
- declare function defaultToolbar(): ToolbarDefinition;
1155
+ /** The default toolbar — every registered type, grouped into the canonical seven-button
1156
+ * layout, labelled in `i18n`'s language (English without one). */
1157
+ declare function defaultToolbar(i18n?: Translator | null): ToolbarDefinition;
1112
1158
  /**
1113
1159
  * Resolve `options.drawings` into a concrete toolbar definition + initial visibility.
1114
1160
  * Default (undefined) ⇒ toolbar VISIBLE; `false` ⇒ subsystem available but toolbar hidden
1115
1161
  * (headless use still works via `chart.drawings.add(...)`); object ⇒ `toolbar ?? true`.
1116
1162
  */
1117
- declare function buildToolbar(option: DrawingsOption | undefined): {
1163
+ declare function buildToolbar(option: DrawingsOption | undefined, i18n?: Translator | null): {
1118
1164
  definition: ToolbarDefinition;
1119
1165
  visible: boolean;
1120
1166
  };
@@ -1133,7 +1179,10 @@ interface DrawingToolDefaults {
1133
1179
  /** A named, saved look for one tool (a "style"): applied, it sets the same settings a
1134
1180
  * remembered default does — style, text styling and per-type settings. */
1135
1181
  interface DrawingToolTemplate {
1182
+ /** The style's name: its identity among the tool's styles. */
1136
1183
  name: string;
1184
+ /** What a built-in style's name reads as in the chart's language. Absent ⇒ {@link name}. */
1185
+ label?: MessageLike;
1137
1186
  settings: DrawingToolDefaults;
1138
1187
  }
1139
1188
 
@@ -1412,6 +1461,11 @@ interface MarkClickEvent {
1412
1461
  group?: string;
1413
1462
  }
1414
1463
 
1464
+ /** The language and direction attributes of a renderer's root element (`null` = unset). */
1465
+ interface RendererRootAttributes {
1466
+ lang: string | null;
1467
+ dir: TextDirection | null;
1468
+ }
1415
1469
  /** What a rendering backend supports — drives graceful degradation + warnings. */
1416
1470
  interface RendererCapabilities {
1417
1471
  panes: boolean;
@@ -1635,6 +1689,14 @@ interface IChartRenderer {
1635
1689
  readFeature(key: string): unknown;
1636
1690
  mount(container: HTMLElement, theme: VelaTheme): void;
1637
1691
  setTheme(theme: VelaTheme): void;
1692
+ /**
1693
+ * Adopt the chart's localization: render text through `i18n` and numbers and dates
1694
+ * through `i18n.format`, then repaint. Called once after `mount` and again after every
1695
+ * `chart.setLocale`. `lang` and `dir` are what the renderer's root element should carry
1696
+ * (`null` = leave the attribute alone, the host page decides). Optional: a renderer
1697
+ * without it keeps English text and formatting.
1698
+ */
1699
+ setLocalization?(i18n: Translator, root: RendererRootAttributes): void;
1638
1700
  resize(): void;
1639
1701
  destroy(): void;
1640
1702
  /**
@@ -1895,7 +1957,7 @@ interface IChartRenderer {
1895
1957
  /** Host-app settings tabs (callback rows) shown by the renderer's settings dialog.
1896
1958
  * `id` names a section for the visibility policy (defaults to the title's slug). */
1897
1959
  setSettingsSections?(sections: ReadonlyArray<{
1898
- title: string;
1960
+ title: MessageLike;
1899
1961
  rows: readonly unknown[];
1900
1962
  id?: string;
1901
1963
  }>): void;
@@ -2013,7 +2075,10 @@ type ThemeName = 'dark' | 'light';
2013
2075
  * Built-in default: `NativeRenderer`.
2014
2076
  * from `'vela/renderers/lwc'` and pass it as `options.renderer`. */
2015
2077
  type RendererConstructor = new (opts?: RendererDisplayOptions) => IChartRenderer;
2016
- interface VelaOptions extends MarketConfig {
2078
+ /** The chart's options. Its {@link LocalizationOptions} (`locale`, `direction`, `messages`,
2079
+ * `numberingSystem`, `hourCycle`, `weekStart`, `formatters`) change at runtime through
2080
+ * `chart.setLocale`. */
2081
+ interface VelaOptions extends MarketConfig, LocalizationOptions {
2017
2082
  /** false = static history; true = history + live forming candle. */
2018
2083
  live?: boolean;
2019
2084
  theme?: ThemeName | VelaTheme;
@@ -2268,4 +2333,4 @@ interface AddIndicatorOptions {
2268
2333
  title?: string;
2269
2334
  }
2270
2335
 
2271
- export { type DataWindowGroup as $, type AxisLongPressEvent as A, type ToolbarDefinition as B, type CrosshairEvent as C, Drawing as D, type MarketSnapshot as E, type AddIndicatorOptions as F, type AnimationConfig as G, type Background as H, type InputValue as I, type BoxFontFamily as J, type BoxHAlign as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxTextSize as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxVAlign as X, type CandleBarColor as Y, type CandleSeries as Z, type CandleStyle as _, type VisibleRange as a, type SeriesSurface as a$, type DataWindowOHLC as a0, type DataWindowRow as a1, type DirtyRange as a2, type DrawingBox as a3, type DrawingExtend as a4, type DrawingIntent as a5, type DrawingLabel as a6, type DrawingLine as a7, type DrawingLinefill as a8, type DrawingMode as a9, type MarkContentSource as aA, type MarkGlyph as aB, type MarkPanelItem as aC, type MarkShape as aD, type MarkerPoint as aE, type MarkerSeries as aF, type MarketSwitch as aG, type PaneAxis as aH, type PaneAxisBand as aI, type PaneHint as aJ, type PaneKind as aK, type PolylinePoint as aL, type PriceAxisOptions as aM, type PriceAxisTick as aN, type PriceAxisTickContext as aO, type PriceAxisTicksFn as aP, type PriceLine as aQ, type Projector as aR, type ProviderName as aS, type RendererConstructor as aT, type Scene as aU, type SchemaPatch as aV, SecondClock as aW, type SeriesDisplay as aX, type SeriesKind as aY, type SeriesPoint as aZ, type SeriesSpec as a_, type DrawingPoint as aa, type DrawingPolyline as ab, type DrawingSeriesBar as ac, type DrawingSeriesGateway as ad, type DrawingSeriesState as ae, type DrawingStyle as af, type DrawingTable as ag, type DrawingText as ah, type DrawingXLoc as ai, type DrawingsOption as aj, type Fill as ak, type FillGradientStop as al, type IndicatorMeta as am, type InputCondition as an, type InputSchema as ao, type InputType as ap, type InputWhen as aq, type IntroAnimation as ar, type IntroConfig as as, type IntroStyle as at, type LabelStyle as au, type LabelYLoc as av, type LineLikeKind as aw, type LineLikeSeries as ax, type LineLikeStyle as ay, type MarkContent as az, type VelaOptions as b, type SeriesValueDelta as b0, type SettingsField as b1, type SettingsSchema as b2, type SettingsVisibilityPolicy as b3, type TableCell as b4, type TableMerge as b5, type TablePosition as b6, type ToolbarGroupConfig as b7, type TradeExecution as b8, type ValuePatch as b9, buildToolbar as ba, defaultToolbar as bb, inputDeltas as bc, inputVisible as bd, seriesInScale as be, seriesShownOn as bf, type PaneInfo as bg, type DrawingToolDefaults as bh, type DrawingToolTemplate as bi, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type Pane as i, type PaneAction as j, type MoveTarget as k, type IndicatorModel as l, type ScenePatch as m, type SymbolPickerFn as n, type LegendActionView as o, type LegendCalloutView as p, type InputChangeEvent as q, type ClickEvent as r, type TimelineMark as s, type MarkGroup as t, type MarkClickEvent as u, type DataWindowReadout as v, type IDrawingsRendererPort as w, type Millis as x, type SnapMode as y, type DrawingTypeKey as z };
2336
+ export { type CandleStyle as $, type AxisLongPressEvent as A, type DrawingTypeKey as B, type CrosshairEvent as C, Drawing as D, type ToolbarDefinition as E, type MarketSnapshot as F, type AddIndicatorOptions as G, type AnimationConfig as H, type InputValue as I, type Background as J, type BoxFontFamily as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxHAlign as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxTextSize as X, type BoxVAlign as Y, type CandleBarColor as Z, type CandleSeries as _, type VisibleRange as a, type SeriesPoint as a$, type DataWindowGroup as a0, type DataWindowOHLC as a1, type DataWindowRow as a2, type DirtyRange as a3, type DrawingBox as a4, type DrawingExtend as a5, type DrawingIntent as a6, type DrawingLabel as a7, type DrawingLine as a8, type DrawingLinefill as a9, type LineLikeStyle as aA, type MarkContent as aB, type MarkContentSource as aC, type MarkGlyph as aD, type MarkPanelItem as aE, type MarkShape as aF, type MarkerPoint as aG, type MarkerSeries as aH, type MarketSwitch as aI, type PaneAxis as aJ, type PaneAxisBand as aK, type PaneHint as aL, type PaneKind as aM, type PolylinePoint as aN, type PriceAxisOptions as aO, type PriceAxisTick as aP, type PriceAxisTickContext as aQ, type PriceAxisTicksFn as aR, type PriceLine as aS, type Projector as aT, type ProviderName as aU, type RendererConstructor as aV, type Scene as aW, type SchemaPatch as aX, SecondClock as aY, type SeriesDisplay as aZ, type SeriesKind as a_, type DrawingMode as aa, type DrawingPoint as ab, type DrawingPolyline as ac, type DrawingSeriesBar as ad, type DrawingSeriesGateway as ae, type DrawingSeriesState as af, type DrawingStyle as ag, type DrawingTable as ah, type DrawingText as ai, type DrawingXLoc as aj, type DrawingsOption as ak, type Fill as al, type FillGradientStop as am, type IndicatorMeta as an, type InputCondition as ao, type InputDisplay as ap, type InputSchema as aq, type InputType as ar, type InputWhen as as, type IntroAnimation as at, type IntroConfig as au, type IntroStyle as av, type LabelStyle as aw, type LabelYLoc as ax, type LineLikeKind as ay, type LineLikeSeries as az, type VelaOptions as b, type SeriesSpec as b0, type SeriesSurface as b1, type SeriesValueDelta as b2, type SettingsField as b3, type SettingsSchema as b4, type SettingsVisibilityPolicy as b5, type TableCell as b6, type TableMerge as b7, type TablePosition as b8, type ToolbarGroupConfig as b9, type TradeExecution as ba, type ValuePatch as bb, buildToolbar as bc, defaultToolbar as bd, inputDeltas as be, inputVisible as bf, seriesInScale as bg, seriesShownOn as bh, type PaneInfo as bi, type DrawingToolDefaults as bj, type DrawingToolTemplate as bk, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type RendererRootAttributes as i, type Pane as j, type PaneAction as k, type MoveTarget as l, type IndicatorModel as m, type ScenePatch as n, type SymbolPickerFn as o, type LegendActionView as p, type LegendCalloutView as q, type InputChangeEvent as r, type ClickEvent as s, type TimelineMark as t, type MarkGroup as u, type MarkClickEvent as v, type DataWindowReadout as w, type IDrawingsRendererPort as x, type Millis as y, type SnapMode as z };
@@ -1,3 +1,5 @@
1
+ import { M as MessageLike, T as Translator, m as TextDirection, b as LocalizationOptions } from './types-BlrXRLIR.js';
2
+
1
3
  /**
2
4
  * Canonical time in Vela: Unix epoch **milliseconds**.
3
5
  *
@@ -86,7 +88,11 @@ interface SeriesDisplay {
86
88
  interface SeriesBase {
87
89
  /** Content-addressed, stable across re-runs of identical source (see identity.ts). */
88
90
  id: string;
91
+ /** The series' name: its identity for engines and hosts (output keys, series ids). */
89
92
  title: string;
93
+ /** What the legend, the data window and the settings show instead of {@link title}, in
94
+ * the chart's language. Absent ⇒ {@link title}. */
95
+ displayTitle?: MessageLike;
90
96
  /** Pane this series belongs to; resolved by the orchestrator. */
91
97
  paneId: string;
92
98
  /** Declared draw-order intent; the renderer owns final z-ordering. */
@@ -381,6 +387,8 @@ interface PriceLine {
381
387
  lineStyle?: LineStyle;
382
388
  width?: number;
383
389
  title?: string;
390
+ /** {@link title} in the chart's language. Absent ⇒ {@link title}. */
391
+ displayTitle?: MessageLike;
384
392
  }
385
393
  /**
386
394
  * The renderer-neutral, full description of what to draw. In the engine-owned
@@ -436,8 +444,26 @@ interface TradeExecution {
436
444
  * declarations onto this at its boundary). Drives the renderer's settings dialog
437
445
  * (the gear settings UI).
438
446
  */
447
+
439
448
  type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'price' | 'time' | 'session' | 'timeframe' | 'symbol' | 'text_area';
440
449
  type InputValue = number | string | boolean;
450
+ /**
451
+ * The display side of an input: what the settings dialog and the legend SHOW, in the
452
+ * chart's language. The input's own `title`, `group` and `options` stay what they are
453
+ * (a script reads them, layouts persist the option values), and this side-car only
454
+ * changes how they read. Each field is optional and falls back to the identity field.
455
+ */
456
+ interface InputDisplay {
457
+ /** Shown instead of `title`. */
458
+ title?: MessageLike;
459
+ /** Shown instead of `tooltip`. */
460
+ tooltip?: MessageLike;
461
+ /** Shown instead of `group` as the section heading. */
462
+ group?: MessageLike;
463
+ /** Shown label per stored option value (`'Close'` → a translated "Close"). Values
464
+ * without an entry show as themselves. */
465
+ options?: Readonly<Record<string, MessageLike>>;
466
+ }
441
467
  /**
442
468
  * Host-provided symbol picker for the settings dialog's `input.symbol` control. Called when the
443
469
  * user activates the field: the host opens its own symbol-selection UI (e.g. the app's ticker
@@ -483,6 +509,8 @@ interface InputSchema {
483
509
  * `inline=` row show while ANY member's gate passes. A hidden input keeps its value. */
484
510
  when?: InputWhen;
485
511
  tooltip?: string;
512
+ /** Translatable display text for this input (see {@link InputDisplay}). */
513
+ display?: InputDisplay;
486
514
  }
487
515
  /**
488
516
  * The DELTAS of a value bag against its schema's declaration defaults — what state
@@ -528,6 +556,11 @@ interface IndicatorModel {
528
556
  * `indicator(..., shorttitle=)`.
529
557
  */
530
558
  shorttitle?: string;
559
+ /** What the chart SHOWS for {@link title}, in its language (a native indicator's
560
+ * translatable name). Absent ⇒ {@link title}. */
561
+ displayTitle?: MessageLike;
562
+ /** What the chart shows for {@link shorttitle}. Absent ⇒ {@link shorttitle}. */
563
+ displayShorttitle?: MessageLike;
531
564
  overlay: boolean;
532
565
  paneHint: PaneHint;
533
566
  /**
@@ -891,11 +924,13 @@ interface DrawingText {
891
924
  * renderer's settings popup builds controls generically — adding a new drawing
892
925
  * type is a schema entry, not new UI code.
893
926
  */
927
+
894
928
  type FieldKind = 'color' | 'number' | 'select' | 'lineStyle' | 'boolean' | 'text' | 'opacity';
895
929
  interface SettingsField {
896
930
  /** Dot-path into the drawing, e.g. `'style.lineColor'`, `'text.value'`, `'locked'`. */
897
931
  path: string;
898
- label: string;
932
+ /** What the settings show; a message reads in the chart's language. */
933
+ label: MessageLike;
899
934
  kind: FieldKind;
900
935
  /** number/opacity bounds. */
901
936
  min?: number;
@@ -904,7 +939,7 @@ interface SettingsField {
904
939
  /** select options. */
905
940
  options?: ReadonlyArray<{
906
941
  value: string;
907
- label: string;
942
+ label: MessageLike;
908
943
  }>;
909
944
  /** Cosmetic grouping in the popup. */
910
945
  group?: 'line' | 'fill' | 'text' | 'behavior';
@@ -914,6 +949,10 @@ interface SettingsField {
914
949
  path: string;
915
950
  in: readonly unknown[];
916
951
  };
952
+ /** The label of the one row this field shares with the next one: a color and its line
953
+ * style ("Midline" for "Midline color" + "Midline style"), or an upper and a lower color
954
+ * ("Bands"). */
955
+ rowLabel?: MessageLike;
917
956
  }
918
957
  interface SettingsSchema {
919
958
  fields: SettingsField[];
@@ -1046,6 +1085,10 @@ declare abstract class Drawing {
1046
1085
  max: number;
1047
1086
  } | null;
1048
1087
  abstract schema(): SettingsSchema;
1088
+ /** The text a fresh drawing of this type starts with ("Note", "Callout"), as a message,
1089
+ * or null for a type that seeds none. A new drawing stores its English source; the chart
1090
+ * that places one interactively writes it in its own language instead. */
1091
+ placeholderText(): MessageLike | null;
1049
1092
  /**
1050
1093
  * Editable per-level config for a rich "gear" settings panel (Fibonacci levels):
1051
1094
  * each entry's `color` / `enabled` / `label` is mutated via a `levels.<i>.<field>`
@@ -1076,6 +1119,7 @@ declare abstract class Drawing {
1076
1119
  */
1077
1120
  interface ToolDefinition {
1078
1121
  type: DrawingTypeKey;
1122
+ /** The tool's name, in the language the definition was built for. */
1079
1123
  label: string;
1080
1124
  /** Inline SVG markup (no DOM). */
1081
1125
  icon: string;
@@ -1098,7 +1142,8 @@ interface ToolbarDefinition {
1098
1142
  /** A developer-supplied explicit group (just type keys; the registry fills the rest). */
1099
1143
  interface ToolbarGroupConfig {
1100
1144
  id: string;
1101
- label: string;
1145
+ /** The group's name; a message (`msg()`) reads in the chart's language. */
1146
+ label: MessageLike;
1102
1147
  tools: DrawingTypeKey[];
1103
1148
  }
1104
1149
  /** Public `options.drawings` shape. `true` = default toolbar; object = customize. */
@@ -1107,14 +1152,15 @@ type DrawingsOption = boolean | {
1107
1152
  tools?: DrawingTypeKey[];
1108
1153
  groups?: ToolbarGroupConfig[];
1109
1154
  };
1110
- /** The default toolbar — every registered type, grouped into the canonical seven-button layout. */
1111
- declare function defaultToolbar(): ToolbarDefinition;
1155
+ /** The default toolbar — every registered type, grouped into the canonical seven-button
1156
+ * layout, labelled in `i18n`'s language (English without one). */
1157
+ declare function defaultToolbar(i18n?: Translator | null): ToolbarDefinition;
1112
1158
  /**
1113
1159
  * Resolve `options.drawings` into a concrete toolbar definition + initial visibility.
1114
1160
  * Default (undefined) ⇒ toolbar VISIBLE; `false` ⇒ subsystem available but toolbar hidden
1115
1161
  * (headless use still works via `chart.drawings.add(...)`); object ⇒ `toolbar ?? true`.
1116
1162
  */
1117
- declare function buildToolbar(option: DrawingsOption | undefined): {
1163
+ declare function buildToolbar(option: DrawingsOption | undefined, i18n?: Translator | null): {
1118
1164
  definition: ToolbarDefinition;
1119
1165
  visible: boolean;
1120
1166
  };
@@ -1133,7 +1179,10 @@ interface DrawingToolDefaults {
1133
1179
  /** A named, saved look for one tool (a "style"): applied, it sets the same settings a
1134
1180
  * remembered default does — style, text styling and per-type settings. */
1135
1181
  interface DrawingToolTemplate {
1182
+ /** The style's name: its identity among the tool's styles. */
1136
1183
  name: string;
1184
+ /** What a built-in style's name reads as in the chart's language. Absent ⇒ {@link name}. */
1185
+ label?: MessageLike;
1137
1186
  settings: DrawingToolDefaults;
1138
1187
  }
1139
1188
 
@@ -1412,6 +1461,11 @@ interface MarkClickEvent {
1412
1461
  group?: string;
1413
1462
  }
1414
1463
 
1464
+ /** The language and direction attributes of a renderer's root element (`null` = unset). */
1465
+ interface RendererRootAttributes {
1466
+ lang: string | null;
1467
+ dir: TextDirection | null;
1468
+ }
1415
1469
  /** What a rendering backend supports — drives graceful degradation + warnings. */
1416
1470
  interface RendererCapabilities {
1417
1471
  panes: boolean;
@@ -1635,6 +1689,14 @@ interface IChartRenderer {
1635
1689
  readFeature(key: string): unknown;
1636
1690
  mount(container: HTMLElement, theme: VelaTheme): void;
1637
1691
  setTheme(theme: VelaTheme): void;
1692
+ /**
1693
+ * Adopt the chart's localization: render text through `i18n` and numbers and dates
1694
+ * through `i18n.format`, then repaint. Called once after `mount` and again after every
1695
+ * `chart.setLocale`. `lang` and `dir` are what the renderer's root element should carry
1696
+ * (`null` = leave the attribute alone, the host page decides). Optional: a renderer
1697
+ * without it keeps English text and formatting.
1698
+ */
1699
+ setLocalization?(i18n: Translator, root: RendererRootAttributes): void;
1638
1700
  resize(): void;
1639
1701
  destroy(): void;
1640
1702
  /**
@@ -1895,7 +1957,7 @@ interface IChartRenderer {
1895
1957
  /** Host-app settings tabs (callback rows) shown by the renderer's settings dialog.
1896
1958
  * `id` names a section for the visibility policy (defaults to the title's slug). */
1897
1959
  setSettingsSections?(sections: ReadonlyArray<{
1898
- title: string;
1960
+ title: MessageLike;
1899
1961
  rows: readonly unknown[];
1900
1962
  id?: string;
1901
1963
  }>): void;
@@ -2013,7 +2075,10 @@ type ThemeName = 'dark' | 'light';
2013
2075
  * Built-in default: `NativeRenderer`.
2014
2076
  * from `'vela/renderers/lwc'` and pass it as `options.renderer`. */
2015
2077
  type RendererConstructor = new (opts?: RendererDisplayOptions) => IChartRenderer;
2016
- interface VelaOptions extends MarketConfig {
2078
+ /** The chart's options. Its {@link LocalizationOptions} (`locale`, `direction`, `messages`,
2079
+ * `numberingSystem`, `hourCycle`, `weekStart`, `formatters`) change at runtime through
2080
+ * `chart.setLocale`. */
2081
+ interface VelaOptions extends MarketConfig, LocalizationOptions {
2017
2082
  /** false = static history; true = history + live forming candle. */
2018
2083
  live?: boolean;
2019
2084
  theme?: ThemeName | VelaTheme;
@@ -2268,4 +2333,4 @@ interface AddIndicatorOptions {
2268
2333
  title?: string;
2269
2334
  }
2270
2335
 
2271
- export { type DataWindowGroup as $, type AxisLongPressEvent as A, type ToolbarDefinition as B, type CrosshairEvent as C, Drawing as D, type MarketSnapshot as E, type AddIndicatorOptions as F, type AnimationConfig as G, type Background as H, type InputValue as I, type BoxFontFamily as J, type BoxHAlign as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxTextSize as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxVAlign as X, type CandleBarColor as Y, type CandleSeries as Z, type CandleStyle as _, type VisibleRange as a, type SeriesSurface as a$, type DataWindowOHLC as a0, type DataWindowRow as a1, type DirtyRange as a2, type DrawingBox as a3, type DrawingExtend as a4, type DrawingIntent as a5, type DrawingLabel as a6, type DrawingLine as a7, type DrawingLinefill as a8, type DrawingMode as a9, type MarkContentSource as aA, type MarkGlyph as aB, type MarkPanelItem as aC, type MarkShape as aD, type MarkerPoint as aE, type MarkerSeries as aF, type MarketSwitch as aG, type PaneAxis as aH, type PaneAxisBand as aI, type PaneHint as aJ, type PaneKind as aK, type PolylinePoint as aL, type PriceAxisOptions as aM, type PriceAxisTick as aN, type PriceAxisTickContext as aO, type PriceAxisTicksFn as aP, type PriceLine as aQ, type Projector as aR, type ProviderName as aS, type RendererConstructor as aT, type Scene as aU, type SchemaPatch as aV, SecondClock as aW, type SeriesDisplay as aX, type SeriesKind as aY, type SeriesPoint as aZ, type SeriesSpec as a_, type DrawingPoint as aa, type DrawingPolyline as ab, type DrawingSeriesBar as ac, type DrawingSeriesGateway as ad, type DrawingSeriesState as ae, type DrawingStyle as af, type DrawingTable as ag, type DrawingText as ah, type DrawingXLoc as ai, type DrawingsOption as aj, type Fill as ak, type FillGradientStop as al, type IndicatorMeta as am, type InputCondition as an, type InputSchema as ao, type InputType as ap, type InputWhen as aq, type IntroAnimation as ar, type IntroConfig as as, type IntroStyle as at, type LabelStyle as au, type LabelYLoc as av, type LineLikeKind as aw, type LineLikeSeries as ax, type LineLikeStyle as ay, type MarkContent as az, type VelaOptions as b, type SeriesValueDelta as b0, type SettingsField as b1, type SettingsSchema as b2, type SettingsVisibilityPolicy as b3, type TableCell as b4, type TableMerge as b5, type TablePosition as b6, type ToolbarGroupConfig as b7, type TradeExecution as b8, type ValuePatch as b9, buildToolbar as ba, defaultToolbar as bb, inputDeltas as bc, inputVisible as bd, seriesInScale as be, seriesShownOn as bf, type PaneInfo as bg, type DrawingToolDefaults as bh, type DrawingToolTemplate as bi, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type Pane as i, type PaneAction as j, type MoveTarget as k, type IndicatorModel as l, type ScenePatch as m, type SymbolPickerFn as n, type LegendActionView as o, type LegendCalloutView as p, type InputChangeEvent as q, type ClickEvent as r, type TimelineMark as s, type MarkGroup as t, type MarkClickEvent as u, type DataWindowReadout as v, type IDrawingsRendererPort as w, type Millis as x, type SnapMode as y, type DrawingTypeKey as z };
2336
+ export { type CandleStyle as $, type AxisLongPressEvent as A, type DrawingTypeKey as B, type CrosshairEvent as C, Drawing as D, type ToolbarDefinition as E, type MarketSnapshot as F, type AddIndicatorOptions as G, type AnimationConfig as H, type InputValue as I, type Background as J, type BoxFontFamily as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxHAlign as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxTextSize as X, type BoxVAlign as Y, type CandleBarColor as Z, type CandleSeries as _, type VisibleRange as a, type SeriesPoint as a$, type DataWindowGroup as a0, type DataWindowOHLC as a1, type DataWindowRow as a2, type DirtyRange as a3, type DrawingBox as a4, type DrawingExtend as a5, type DrawingIntent as a6, type DrawingLabel as a7, type DrawingLine as a8, type DrawingLinefill as a9, type LineLikeStyle as aA, type MarkContent as aB, type MarkContentSource as aC, type MarkGlyph as aD, type MarkPanelItem as aE, type MarkShape as aF, type MarkerPoint as aG, type MarkerSeries as aH, type MarketSwitch as aI, type PaneAxis as aJ, type PaneAxisBand as aK, type PaneHint as aL, type PaneKind as aM, type PolylinePoint as aN, type PriceAxisOptions as aO, type PriceAxisTick as aP, type PriceAxisTickContext as aQ, type PriceAxisTicksFn as aR, type PriceLine as aS, type Projector as aT, type ProviderName as aU, type RendererConstructor as aV, type Scene as aW, type SchemaPatch as aX, SecondClock as aY, type SeriesDisplay as aZ, type SeriesKind as a_, type DrawingMode as aa, type DrawingPoint as ab, type DrawingPolyline as ac, type DrawingSeriesBar as ad, type DrawingSeriesGateway as ae, type DrawingSeriesState as af, type DrawingStyle as ag, type DrawingTable as ah, type DrawingText as ai, type DrawingXLoc as aj, type DrawingsOption as ak, type Fill as al, type FillGradientStop as am, type IndicatorMeta as an, type InputCondition as ao, type InputDisplay as ap, type InputSchema as aq, type InputType as ar, type InputWhen as as, type IntroAnimation as at, type IntroConfig as au, type IntroStyle as av, type LabelStyle as aw, type LabelYLoc as ax, type LineLikeKind as ay, type LineLikeSeries as az, type VelaOptions as b, type SeriesSpec as b0, type SeriesSurface as b1, type SeriesValueDelta as b2, type SettingsField as b3, type SettingsSchema as b4, type SettingsVisibilityPolicy as b5, type TableCell as b6, type TableMerge as b7, type TablePosition as b8, type ToolbarGroupConfig as b9, type TradeExecution as ba, type ValuePatch as bb, buildToolbar as bc, defaultToolbar as bd, inputDeltas as be, inputVisible as bf, seriesInScale as bg, seriesShownOn as bh, type PaneInfo as bi, type DrawingToolDefaults as bj, type DrawingToolTemplate as bk, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type RendererRootAttributes as i, type Pane as j, type PaneAction as k, type MoveTarget as l, type IndicatorModel as m, type ScenePatch as n, type SymbolPickerFn as o, type LegendActionView as p, type LegendCalloutView as q, type InputChangeEvent as r, type ClickEvent as s, type TimelineMark as t, type MarkGroup as u, type MarkClickEvent as v, type DataWindowReadout as w, type IDrawingsRendererPort as x, type Millis as y, type SnapMode as z };