@luxalgo/vela 0.8.5 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/{DataProvider-DdqMxKdl.d.cts → DataProvider-B5i0_yY4.d.cts} +1 -1
  2. package/dist/{DataProvider-BUdlkx9I.d.ts → DataProvider-CPFgSyAm.d.ts} +1 -1
  3. package/dist/{chunk-QYIO37K7.js → chunk-3H6JO4VL.js} +2405 -1542
  4. package/dist/{chunk-BN4DNS3O.js → chunk-BLVL7WXF.js} +1156 -468
  5. package/dist/chunk-O6L27KRB.js +1331 -0
  6. package/dist/{chunk-WY5H4S4I.js → chunk-PZN4RS4T.js} +91 -36
  7. package/dist/{chunk-ALTGHKIM.js → chunk-Q7POFYNE.js} +516 -406
  8. package/dist/{chunk-AUOB7A5Y.js → chunk-WHPQQYH7.js} +29 -13
  9. package/dist/{contributions-D8xuYc9U.d.cts → contributions-BfBaF6eE.d.ts} +71 -22
  10. package/dist/{contributions-P9fBBuY1.d.ts → contributions-DupwEkzc.d.cts} +71 -22
  11. package/dist/index.cjs +4040 -2087
  12. package/dist/index.d.cts +53 -25
  13. package/dist/index.d.ts +53 -25
  14. package/dist/index.js +5 -5
  15. package/dist/{keymap-CGOz5F5f.d.cts → keymap-C48ughm6.d.ts} +9 -6
  16. package/dist/{keymap-CGOz5F5f.d.ts → keymap-W0hiajU6.d.cts} +9 -6
  17. package/dist/locales/ar.cjs +2262 -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 +2260 -0
  21. package/dist/locales/de.cjs +2262 -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 +2260 -0
  25. package/dist/locales/en.cjs +2262 -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 +2260 -0
  29. package/dist/locales/es.cjs +2262 -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 +2260 -0
  33. package/dist/locales/fr.cjs +2262 -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 +2260 -0
  37. package/dist/locales/he.cjs +2262 -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 +2260 -0
  41. package/dist/locales/hi.cjs +2262 -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 +2260 -0
  45. package/dist/locales/id.cjs +2262 -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 +2260 -0
  49. package/dist/locales/it.cjs +2262 -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 +2260 -0
  53. package/dist/locales/ja.cjs +2262 -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 +2260 -0
  57. package/dist/locales/ko.cjs +2262 -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 +2260 -0
  61. package/dist/locales/ms.cjs +2262 -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 +2260 -0
  65. package/dist/locales/pl.cjs +2262 -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 +2260 -0
  69. package/dist/locales/pt-BR.cjs +2262 -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 +2260 -0
  73. package/dist/locales/ru.cjs +2262 -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 +2260 -0
  77. package/dist/locales/th.cjs +2262 -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 +2260 -0
  81. package/dist/locales/tr.cjs +2262 -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 +2260 -0
  85. package/dist/locales/vi.cjs +2262 -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 +2260 -0
  89. package/dist/locales/zh-Hans.cjs +2262 -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 +2260 -0
  93. package/dist/locales/zh-Hant.cjs +2262 -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 +2260 -0
  97. package/dist/{options-BI5Tp32b.d.ts → options-B7aL1pbf.d.ts} +74 -9
  98. package/dist/{options-BI5Tp32b.d.cts → options-I1H2HDWw.d.cts} +74 -9
  99. package/dist/{plugin-B8F1nor8.d.cts → plugin-BGz-Vsdv.d.cts} +81 -35
  100. package/dist/{plugin-D5Z-Q6TX.d.ts → plugin-BZHypj8h.d.ts} +81 -35
  101. package/dist/plugin.cjs +1268 -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-BEQJqSjR.d.cts} +14 -2
  118. package/dist/{side-panel-_2UK1gSm.d.cts → side-panel-Ud0SBAnE.d.ts} +14 -2
  119. package/dist/{statusline-model-CTwtDIca.d.cts → statusline-model-Dfb_GD9u.d.ts} +14 -3
  120. package/dist/{statusline-model-D9kWC9X5.d.ts → statusline-model-PHt0YhmI.d.cts} +14 -3
  121. package/dist/types-Bwf63xGI.d.cts +2518 -0
  122. package/dist/types-Bwf63xGI.d.ts +2518 -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 +4005 -2054
  128. package/dist/vela.global.min.js +57 -57
  129. package/dist/widget.cjs +5384 -2698
  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 +5373 -2705
  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,16 +1,51 @@
1
- import { z as DrawingTypeKey, af as DrawingStyle, S as SerializedDrawing, D as Drawing, O as OHLCV, aY as SeriesKind, c as VelaTheme } from './options-BI5Tp32b.cjs';
2
- import { f as DataControl } from './contributions-D8xuYc9U.cjs';
3
- import './side-panel-_2UK1gSm.cjs';
1
+ import { i as MessageDescriptor, a as MessageArgs, L as LocalePack, b as LocalizationOptions, T as Translator, M as MessageLike } from './types-Bwf63xGI.cjs';
2
+ import { B as DrawingTypeKey, ag as DrawingStyle, S as SerializedDrawing, D as Drawing, O as OHLCV, a_ as SeriesKind, c as VelaTheme } from './options-I1H2HDWw.cjs';
3
+ import { f as DataControl } from './contributions-DupwEkzc.cjs';
4
+ import './side-panel-BEQJqSjR.cjs';
4
5
  import './icons-BZYbJXSV.cjs';
5
- import './keymap-CGOz5F5f.cjs';
6
- import './DataProvider-DdqMxKdl.cjs';
6
+ import './keymap-W0hiajU6.cjs';
7
+ import './DataProvider-B5i0_yY4.cjs';
8
+
9
+ /** Values a message interpolates. */
10
+ type MessageValues = Readonly<Record<string, string | number>>;
11
+
12
+ /**
13
+ * Declare a translatable message: a stable, dotted id and its English text in ICU message
14
+ * syntax (`'{count, plural, one {# bar} other {# bars}}'`). The descriptor is inert data;
15
+ * a translator's `t()` resolves it. The build extracts every `msg()` call with literal
16
+ * arguments into the English catalog, so keep both arguments string literals.
17
+ */
18
+ declare function msg(id: string, defaultMessage: string): MessageDescriptor;
19
+ /**
20
+ * A message with values bound to its arguments, for display text declared before its
21
+ * values are known to the code that renders it (`withValues(BAND, { n: 2 })` reads
22
+ * "Band #2"). A translator formats the bound values; values passed to `t()` win.
23
+ */
24
+ declare function withValues(message: MessageDescriptor, values: MessageArgs): MessageDescriptor;
25
+
26
+ /**
27
+ * Register a locale pack: a locale tag and its messages (id → ICU message). Several packs
28
+ * may share a tag (the core's, a plugin's, the host's); for the same id the pack
29
+ * registered last wins. Registration is a call, never an import side effect. Returns the
30
+ * disposer that removes this pack again.
31
+ */
32
+ declare function registerLocale(pack: LocalePack): () => void;
33
+ /** The tags of every registered pack, in registration order (duplicates collapsed). */
34
+ declare function registeredLocales(): string[];
35
+
36
+ /**
37
+ * A standalone translator for UI built outside a chart (a kit component, a host panel).
38
+ * Charts, workspaces and widgets carry their own as `i18n`.
39
+ */
40
+ declare function createTranslator(options?: LocalizationOptions): Translator;
7
41
 
8
42
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
43
  interface DrawingTypeMeta {
10
44
  type: DrawingTypeKey;
11
45
  /** Toolbar group id (e.g. `'lines'`, `'shapes'`, `'annotations'`). */
12
46
  group: string;
13
- label: string;
47
+ /** The tool's name (toolbar, settings, object tree); a message reads in the chart's language. */
48
+ label: MessageLike;
14
49
  /** Inline SVG markup for the toolbar button — no DOM, renderer paints it. */
15
50
  icon: string;
16
51
  defaultStyle: DrawingStyle;
@@ -20,7 +55,7 @@ interface DrawingTypeMeta {
20
55
  coversSeries?: boolean;
21
56
  /** One short sentence prompting the placement gesture, shown by the renderer at the
22
57
  * bottom of the chart while the tool is armed and no placement has started yet. */
23
- placementHint?: string;
58
+ placementHint?: MessageLike;
24
59
  /** Build an instance from a (partial) serialized record. Serves create + deserialize. */
25
60
  create(init: Partial<SerializedDrawing> & {
26
61
  paneId: string;
@@ -29,8 +64,15 @@ interface DrawingTypeMeta {
29
64
  /** Register (or replace) a drawing type. Built-ins register at module load; new
30
65
  * types (fibs/patterns) call this — no base/port/facade change. */
31
66
  declare function registerDrawingType(meta: DrawingTypeMeta): void;
32
- declare function getDrawingType(type: string): DrawingTypeMeta | undefined;
33
- declare function drawingTypes(): DrawingTypeMeta[];
67
+ /** A registered type as the read APIs hand it out: its label and hint as plain text. */
68
+ type ResolvedDrawingTypeMeta = DrawingTypeMeta & {
69
+ label: string;
70
+ placementHint?: string;
71
+ };
72
+ /** A registered drawing type, its label and hint in `i18n`'s language (English without one). */
73
+ declare function getDrawingType(type: string, i18n?: Translator): ResolvedDrawingTypeMeta | undefined;
74
+ /** Every registered drawing type, labels in `i18n`'s language (English without one). */
75
+ declare function drawingTypes(i18n?: Translator): ResolvedDrawingTypeMeta[];
34
76
  /** Build a fresh drawing of `type` on `paneId`, seeding the type's default style. */
35
77
  declare function createDrawing(type: DrawingTypeKey, init: Partial<SerializedDrawing> & {
36
78
  paneId: string;
@@ -222,8 +264,9 @@ interface SeriesDataEngine {
222
264
  interface ChartTypeDefinition {
223
265
  /** The price-style id (`'heikinashi'`; a plugin might register `'footprint'`, `'renko'`…). */
224
266
  id: string;
225
- /** Human-readable label for style pickers. Defaults to the id. */
226
- label?: string;
267
+ /** Human-readable label for style pickers. Defaults to the id. A message (`msg()`)
268
+ * reads in the chart's language. */
269
+ label?: MessageLike;
227
270
  /** Raw `<svg>` markup for style pickers (surfaced as icon id `style-<id>`). */
228
271
  icon?: string;
229
272
  /** Optional SETTINGS SECTION rendered inside the chart-settings dialog — declarative
@@ -270,7 +313,7 @@ type SettingsRowWhen = SettingsRowCondition | readonly SettingsRowCondition[];
270
313
  interface SettingsRowSwatch {
271
314
  key: string;
272
315
  /** Names the color for the swatch's tooltip (`'Highlight color'`). */
273
- label: string;
316
+ label: MessageLike;
274
317
  defval: string;
275
318
  /**
276
319
  * Optional visibility gate, evaluated live against the values bag exactly like a
@@ -290,7 +333,7 @@ interface SettingsRowSwatch {
290
333
  interface SettingsRowWidth {
291
334
  key: string;
292
335
  /** Names the control for its tooltip (`'Line width'`). */
293
- label: string;
336
+ label: MessageLike;
294
337
  defval: number;
295
338
  }
296
339
  /**
@@ -302,7 +345,7 @@ interface SettingsRowWidth {
302
345
  interface SettingsRowInlineNumber {
303
346
  key: string;
304
347
  /** Names the input for its tooltip (`'Value area (%)'`). */
305
- label: string;
348
+ label: MessageLike;
306
349
  defval: number;
307
350
  min?: number;
308
351
  max?: number;
@@ -312,7 +355,7 @@ interface SettingsRowInlineNumber {
312
355
  * A select option: a bare string (value = label) or a `[value, label]` pair when the
313
356
  * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
314
357
  */
315
- type SettingsSelectOption = string | readonly [value: string, label: string];
358
+ type SettingsSelectOption = string | readonly [value: string, label: MessageLike];
316
359
  /**
317
360
  * One INLINE CONTROL on a composite `row` — the composable unit every value row is
318
361
  * made of. Each keyed control stores under its own bag key; `label` names it for the
@@ -334,35 +377,35 @@ type SettingsSelectOption = string | readonly [value: string, label: string];
334
377
  type SettingsInlineControl = {
335
378
  kind: 'number';
336
379
  key: string;
337
- label: string;
380
+ label: MessageLike;
338
381
  defval: number;
339
382
  min?: number;
340
383
  max?: number;
341
384
  step?: number;
342
- placeholder?: string;
385
+ placeholder?: MessageLike;
343
386
  when?: SettingsRowWhen;
344
387
  } | {
345
388
  kind: 'color';
346
389
  key: string;
347
- label: string;
390
+ label: MessageLike;
348
391
  defval: string;
349
392
  when?: SettingsRowWhen;
350
393
  } | {
351
394
  kind: 'width';
352
395
  key: string;
353
- label: string;
396
+ label: MessageLike;
354
397
  defval: number;
355
398
  when?: SettingsRowWhen;
356
399
  } | {
357
400
  kind: 'select';
358
401
  key: string;
359
- label: string;
402
+ label: MessageLike;
360
403
  options: readonly SettingsSelectOption[];
361
404
  defval: string;
362
405
  when?: SettingsRowWhen;
363
406
  } | {
364
407
  kind: 'hint';
365
- text: string;
408
+ text: MessageLike;
366
409
  };
367
410
  /**
368
411
  * One declarative settings row. To add a NEW inline control kind, see
@@ -394,15 +437,15 @@ type SettingsInlineControl = {
394
437
  */
395
438
  type SettingsRowDescriptor = {
396
439
  kind: 'heading';
397
- label: string;
440
+ label: MessageLike;
398
441
  when?: SettingsRowWhen;
399
442
  } | {
400
443
  kind: 'header';
401
- label: string;
444
+ label: MessageLike;
402
445
  when?: SettingsRowWhen;
403
446
  } | {
404
447
  kind: 'row';
405
- label: string;
448
+ label: MessageLike;
406
449
  toggle?: {
407
450
  key: string;
408
451
  defval: boolean;
@@ -412,7 +455,7 @@ type SettingsRowDescriptor = {
412
455
  } | {
413
456
  kind: 'toggle';
414
457
  key: string;
415
- label: string;
458
+ label: MessageLike;
416
459
  defval: boolean;
417
460
  number?: SettingsRowInlineNumber;
418
461
  colors?: readonly SettingsRowSwatch[];
@@ -421,7 +464,7 @@ type SettingsRowDescriptor = {
421
464
  } | {
422
465
  kind: 'number';
423
466
  key: string;
424
- label: string;
467
+ label: MessageLike;
425
468
  defval: number;
426
469
  min?: number;
427
470
  max?: number;
@@ -430,26 +473,26 @@ type SettingsRowDescriptor = {
430
473
  } | {
431
474
  kind: 'color';
432
475
  key: string;
433
- label: string;
476
+ label: MessageLike;
434
477
  defval: string;
435
478
  when?: SettingsRowWhen;
436
479
  } | {
437
480
  kind: 'select';
438
481
  key: string;
439
- label: string;
482
+ label: MessageLike;
440
483
  options: readonly SettingsSelectOption[];
441
484
  defval: string;
442
485
  when?: SettingsRowWhen;
443
486
  } | {
444
487
  kind: 'range';
445
- label: string;
488
+ label: MessageLike;
446
489
  minKey: string;
447
490
  maxKey: string;
448
491
  defval: number;
449
492
  min?: number;
450
493
  max?: number;
451
494
  step?: number;
452
- placeholder?: string;
495
+ placeholder?: MessageLike;
453
496
  when?: SettingsRowWhen;
454
497
  };
455
498
  /** A value-carrying row (everything except the key-less `heading`/`header` titles). */
@@ -458,7 +501,7 @@ type SettingsValueRow = Exclude<SettingsRowDescriptor, {
458
501
  }>;
459
502
  /** The canonical row shape every {@link SettingsValueRow} reduces to (the `row` kind's fields). */
460
503
  interface NormalizedSettingsRow {
461
- label: string;
504
+ label: MessageLike;
462
505
  toggle?: {
463
506
  key: string;
464
507
  defval: boolean;
@@ -494,14 +537,14 @@ declare function settingsRowValueKeys(r: SettingsRowDescriptor): SettingsRowValu
494
537
  * present and not removable — the base instance.
495
538
  */
496
539
  interface ChartTypeSettingsInstance {
497
- label: string;
540
+ label: MessageLike;
498
541
  /** Boolean bag key controlling presence; omitted = always present, not removable. */
499
542
  enableKey?: string;
500
543
  rows: readonly SettingsRowDescriptor[];
501
544
  }
502
545
  /** An indented sub-entry under the section's rail tab, with its own pane of rows. */
503
546
  interface ChartTypeSettingsSubsection {
504
- title: string;
547
+ title: MessageLike;
505
548
  rows: readonly SettingsRowDescriptor[];
506
549
  /**
507
550
  * Boolean bag key that masters this pane. While it is false, every row EXCEPT the
@@ -530,7 +573,7 @@ interface ChartTypeSettingsSubsection {
530
573
  */
531
574
  interface ChartTypeSettingsSection {
532
575
  /** Section heading in the settings dialog. */
533
- title: string;
576
+ title: MessageLike;
534
577
  /** Flat form. Ignored when `instances` is declared. */
535
578
  rows?: readonly SettingsRowDescriptor[];
536
579
  /** How `rows` are presented: `'flat'` (default) renders headings as inline group
@@ -624,6 +667,9 @@ interface RendererLayerArgs {
624
667
  x: number;
625
668
  y: number;
626
669
  } | null;
670
+ /** The chart's translator: `i18n.t(msg(...))` for text a layer paints, and
671
+ * `i18n.format` for its numbers and dates, in the chart's locale. */
672
+ i18n: Translator;
627
673
  }
628
674
  /** How a layer dims/slims the BASE painting under it (see
629
675
  * {@link RendererLayerInstance.modulateBase}). Omitted fields keep their defaults. */
@@ -734,4 +780,4 @@ declare const CATEGORICAL: readonly string[];
734
780
  /** Pick a stable categorical color for a string key (same key ⇒ same color). */
735
781
  declare function categoricalColor(key: string): string;
736
782
 
737
- export { getDrawingType as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowInlineNumber as E, type SettingsRowSwatch as F, type SettingsRowValueKey as G, HIGHLIGHT as H, INFO as I, type SettingsRowWhen as J, type SettingsRowWidth as K, type SettingsValueRow as L, MARKER as M, NEUTRAL as N, TRADE_LONG as O, TRADE_SHORT as P, categoricalColor as Q, type RendererLayerArgs as R, type SettingsSelectOption as S, TRADE_EXIT as T, chartType as U, VALID as V, WARNING as W, chartTypes as X, createDrawing as Y, deserializeDrawing as Z, drawingTypes as _, ACCENT_BRIGHT as a, normalizeSettingsRow as a0, registerChartType as a1, registerDrawingType as a2, registerRendererDefaults as a3, registerRendererLayer as a4, rendererDefaults as a5, rendererLayers as a6, settingsRowValueKeys as a7, stableSeriesId as a8, tickerModifierIds as a9, unregisterChartType as aa, unregisterRendererDefaults as ab, unregisterRendererLayer as ac, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CHIP_PLATE as e, CROSSHAIR as f, type ChartTypeDefinition as g, type ChartTypeSettingsInstance as h, type ChartTypeSettingsSection as i, type ChartTypeSettingsSubsection as j, INVALID as k, type IdentifiableKind as l, type NormalizedSettingsRow as m, type RendererLayerDefinition as n, type RendererLayerInstance as o, SERIES_LINE as p, SESSION_OFF as q, SESSION_POST as r, SESSION_PRE as s, SLATE as t, SLATE_DEEP as u, type SeriesDataEngine as v, type SeriesDataEngineHost as w, type SettingsInlineControl as x, type SettingsRowCondition as y, type SettingsRowDescriptor as z };
783
+ export { deserializeDrawing as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowDescriptor as E, type SettingsRowInlineNumber as F, type SettingsRowSwatch as G, HIGHLIGHT as H, INFO as I, type SettingsRowValueKey as J, type SettingsRowWhen as K, type SettingsRowWidth as L, MARKER as M, NEUTRAL as N, type SettingsValueRow as O, TRADE_LONG as P, TRADE_SHORT as Q, type RendererLayerArgs as R, type SettingsSelectOption as S, TRADE_EXIT as T, categoricalColor as U, VALID as V, WARNING as W, chartType as X, chartTypes as Y, createDrawing as Z, createTranslator as _, ACCENT_BRIGHT as a, drawingTypes as a0, getDrawingType as a1, msg as a2, normalizeSettingsRow as a3, registerChartType as a4, registerDrawingType as a5, registerLocale as a6, registerRendererDefaults as a7, registerRendererLayer as a8, registeredLocales as a9, rendererDefaults as aa, rendererLayers as ab, settingsRowValueKeys as ac, stableSeriesId as ad, tickerModifierIds as ae, unregisterChartType as af, unregisterRendererDefaults as ag, unregisterRendererLayer as ah, withValues as ai, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CHIP_PLATE as e, CROSSHAIR as f, type ChartTypeDefinition as g, type ChartTypeSettingsInstance as h, type ChartTypeSettingsSection as i, type ChartTypeSettingsSubsection as j, INVALID as k, type IdentifiableKind as l, type MessageValues as m, type NormalizedSettingsRow as n, type RendererLayerDefinition as o, type RendererLayerInstance as p, SERIES_LINE as q, SESSION_OFF as r, SESSION_POST as s, SESSION_PRE as t, SLATE as u, SLATE_DEEP as v, type SeriesDataEngine as w, type SeriesDataEngineHost as x, type SettingsInlineControl as y, type SettingsRowCondition as z };
@@ -1,16 +1,51 @@
1
- import { z as DrawingTypeKey, af as DrawingStyle, S as SerializedDrawing, D as Drawing, O as OHLCV, aY as SeriesKind, c as VelaTheme } from './options-BI5Tp32b.js';
2
- import { f as DataControl } from './contributions-P9fBBuY1.js';
3
- import './side-panel-_2UK1gSm.js';
1
+ import { i as MessageDescriptor, a as MessageArgs, L as LocalePack, b as LocalizationOptions, T as Translator, M as MessageLike } from './types-Bwf63xGI.js';
2
+ import { B as DrawingTypeKey, ag as DrawingStyle, S as SerializedDrawing, D as Drawing, O as OHLCV, a_ as SeriesKind, c as VelaTheme } from './options-B7aL1pbf.js';
3
+ import { f as DataControl } from './contributions-BfBaF6eE.js';
4
+ import './side-panel-Ud0SBAnE.js';
4
5
  import './icons-BZYbJXSV.js';
5
- import './keymap-CGOz5F5f.js';
6
- import './DataProvider-BUdlkx9I.js';
6
+ import './keymap-C48ughm6.js';
7
+ import './DataProvider-CPFgSyAm.js';
8
+
9
+ /** Values a message interpolates. */
10
+ type MessageValues = Readonly<Record<string, string | number>>;
11
+
12
+ /**
13
+ * Declare a translatable message: a stable, dotted id and its English text in ICU message
14
+ * syntax (`'{count, plural, one {# bar} other {# bars}}'`). The descriptor is inert data;
15
+ * a translator's `t()` resolves it. The build extracts every `msg()` call with literal
16
+ * arguments into the English catalog, so keep both arguments string literals.
17
+ */
18
+ declare function msg(id: string, defaultMessage: string): MessageDescriptor;
19
+ /**
20
+ * A message with values bound to its arguments, for display text declared before its
21
+ * values are known to the code that renders it (`withValues(BAND, { n: 2 })` reads
22
+ * "Band #2"). A translator formats the bound values; values passed to `t()` win.
23
+ */
24
+ declare function withValues(message: MessageDescriptor, values: MessageArgs): MessageDescriptor;
25
+
26
+ /**
27
+ * Register a locale pack: a locale tag and its messages (id → ICU message). Several packs
28
+ * may share a tag (the core's, a plugin's, the host's); for the same id the pack
29
+ * registered last wins. Registration is a call, never an import side effect. Returns the
30
+ * disposer that removes this pack again.
31
+ */
32
+ declare function registerLocale(pack: LocalePack): () => void;
33
+ /** The tags of every registered pack, in registration order (duplicates collapsed). */
34
+ declare function registeredLocales(): string[];
35
+
36
+ /**
37
+ * A standalone translator for UI built outside a chart (a kit component, a host panel).
38
+ * Charts, workspaces and widgets carry their own as `i18n`.
39
+ */
40
+ declare function createTranslator(options?: LocalizationOptions): Translator;
7
41
 
8
42
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
43
  interface DrawingTypeMeta {
10
44
  type: DrawingTypeKey;
11
45
  /** Toolbar group id (e.g. `'lines'`, `'shapes'`, `'annotations'`). */
12
46
  group: string;
13
- label: string;
47
+ /** The tool's name (toolbar, settings, object tree); a message reads in the chart's language. */
48
+ label: MessageLike;
14
49
  /** Inline SVG markup for the toolbar button — no DOM, renderer paints it. */
15
50
  icon: string;
16
51
  defaultStyle: DrawingStyle;
@@ -20,7 +55,7 @@ interface DrawingTypeMeta {
20
55
  coversSeries?: boolean;
21
56
  /** One short sentence prompting the placement gesture, shown by the renderer at the
22
57
  * bottom of the chart while the tool is armed and no placement has started yet. */
23
- placementHint?: string;
58
+ placementHint?: MessageLike;
24
59
  /** Build an instance from a (partial) serialized record. Serves create + deserialize. */
25
60
  create(init: Partial<SerializedDrawing> & {
26
61
  paneId: string;
@@ -29,8 +64,15 @@ interface DrawingTypeMeta {
29
64
  /** Register (or replace) a drawing type. Built-ins register at module load; new
30
65
  * types (fibs/patterns) call this — no base/port/facade change. */
31
66
  declare function registerDrawingType(meta: DrawingTypeMeta): void;
32
- declare function getDrawingType(type: string): DrawingTypeMeta | undefined;
33
- declare function drawingTypes(): DrawingTypeMeta[];
67
+ /** A registered type as the read APIs hand it out: its label and hint as plain text. */
68
+ type ResolvedDrawingTypeMeta = DrawingTypeMeta & {
69
+ label: string;
70
+ placementHint?: string;
71
+ };
72
+ /** A registered drawing type, its label and hint in `i18n`'s language (English without one). */
73
+ declare function getDrawingType(type: string, i18n?: Translator): ResolvedDrawingTypeMeta | undefined;
74
+ /** Every registered drawing type, labels in `i18n`'s language (English without one). */
75
+ declare function drawingTypes(i18n?: Translator): ResolvedDrawingTypeMeta[];
34
76
  /** Build a fresh drawing of `type` on `paneId`, seeding the type's default style. */
35
77
  declare function createDrawing(type: DrawingTypeKey, init: Partial<SerializedDrawing> & {
36
78
  paneId: string;
@@ -222,8 +264,9 @@ interface SeriesDataEngine {
222
264
  interface ChartTypeDefinition {
223
265
  /** The price-style id (`'heikinashi'`; a plugin might register `'footprint'`, `'renko'`…). */
224
266
  id: string;
225
- /** Human-readable label for style pickers. Defaults to the id. */
226
- label?: string;
267
+ /** Human-readable label for style pickers. Defaults to the id. A message (`msg()`)
268
+ * reads in the chart's language. */
269
+ label?: MessageLike;
227
270
  /** Raw `<svg>` markup for style pickers (surfaced as icon id `style-<id>`). */
228
271
  icon?: string;
229
272
  /** Optional SETTINGS SECTION rendered inside the chart-settings dialog — declarative
@@ -270,7 +313,7 @@ type SettingsRowWhen = SettingsRowCondition | readonly SettingsRowCondition[];
270
313
  interface SettingsRowSwatch {
271
314
  key: string;
272
315
  /** Names the color for the swatch's tooltip (`'Highlight color'`). */
273
- label: string;
316
+ label: MessageLike;
274
317
  defval: string;
275
318
  /**
276
319
  * Optional visibility gate, evaluated live against the values bag exactly like a
@@ -290,7 +333,7 @@ interface SettingsRowSwatch {
290
333
  interface SettingsRowWidth {
291
334
  key: string;
292
335
  /** Names the control for its tooltip (`'Line width'`). */
293
- label: string;
336
+ label: MessageLike;
294
337
  defval: number;
295
338
  }
296
339
  /**
@@ -302,7 +345,7 @@ interface SettingsRowWidth {
302
345
  interface SettingsRowInlineNumber {
303
346
  key: string;
304
347
  /** Names the input for its tooltip (`'Value area (%)'`). */
305
- label: string;
348
+ label: MessageLike;
306
349
  defval: number;
307
350
  min?: number;
308
351
  max?: number;
@@ -312,7 +355,7 @@ interface SettingsRowInlineNumber {
312
355
  * A select option: a bare string (value = label) or a `[value, label]` pair when the
313
356
  * stored id differs from the human-readable text (`['bidAskProfile', 'Bid × Ask Profile']`).
314
357
  */
315
- type SettingsSelectOption = string | readonly [value: string, label: string];
358
+ type SettingsSelectOption = string | readonly [value: string, label: MessageLike];
316
359
  /**
317
360
  * One INLINE CONTROL on a composite `row` — the composable unit every value row is
318
361
  * made of. Each keyed control stores under its own bag key; `label` names it for the
@@ -334,35 +377,35 @@ type SettingsSelectOption = string | readonly [value: string, label: string];
334
377
  type SettingsInlineControl = {
335
378
  kind: 'number';
336
379
  key: string;
337
- label: string;
380
+ label: MessageLike;
338
381
  defval: number;
339
382
  min?: number;
340
383
  max?: number;
341
384
  step?: number;
342
- placeholder?: string;
385
+ placeholder?: MessageLike;
343
386
  when?: SettingsRowWhen;
344
387
  } | {
345
388
  kind: 'color';
346
389
  key: string;
347
- label: string;
390
+ label: MessageLike;
348
391
  defval: string;
349
392
  when?: SettingsRowWhen;
350
393
  } | {
351
394
  kind: 'width';
352
395
  key: string;
353
- label: string;
396
+ label: MessageLike;
354
397
  defval: number;
355
398
  when?: SettingsRowWhen;
356
399
  } | {
357
400
  kind: 'select';
358
401
  key: string;
359
- label: string;
402
+ label: MessageLike;
360
403
  options: readonly SettingsSelectOption[];
361
404
  defval: string;
362
405
  when?: SettingsRowWhen;
363
406
  } | {
364
407
  kind: 'hint';
365
- text: string;
408
+ text: MessageLike;
366
409
  };
367
410
  /**
368
411
  * One declarative settings row. To add a NEW inline control kind, see
@@ -394,15 +437,15 @@ type SettingsInlineControl = {
394
437
  */
395
438
  type SettingsRowDescriptor = {
396
439
  kind: 'heading';
397
- label: string;
440
+ label: MessageLike;
398
441
  when?: SettingsRowWhen;
399
442
  } | {
400
443
  kind: 'header';
401
- label: string;
444
+ label: MessageLike;
402
445
  when?: SettingsRowWhen;
403
446
  } | {
404
447
  kind: 'row';
405
- label: string;
448
+ label: MessageLike;
406
449
  toggle?: {
407
450
  key: string;
408
451
  defval: boolean;
@@ -412,7 +455,7 @@ type SettingsRowDescriptor = {
412
455
  } | {
413
456
  kind: 'toggle';
414
457
  key: string;
415
- label: string;
458
+ label: MessageLike;
416
459
  defval: boolean;
417
460
  number?: SettingsRowInlineNumber;
418
461
  colors?: readonly SettingsRowSwatch[];
@@ -421,7 +464,7 @@ type SettingsRowDescriptor = {
421
464
  } | {
422
465
  kind: 'number';
423
466
  key: string;
424
- label: string;
467
+ label: MessageLike;
425
468
  defval: number;
426
469
  min?: number;
427
470
  max?: number;
@@ -430,26 +473,26 @@ type SettingsRowDescriptor = {
430
473
  } | {
431
474
  kind: 'color';
432
475
  key: string;
433
- label: string;
476
+ label: MessageLike;
434
477
  defval: string;
435
478
  when?: SettingsRowWhen;
436
479
  } | {
437
480
  kind: 'select';
438
481
  key: string;
439
- label: string;
482
+ label: MessageLike;
440
483
  options: readonly SettingsSelectOption[];
441
484
  defval: string;
442
485
  when?: SettingsRowWhen;
443
486
  } | {
444
487
  kind: 'range';
445
- label: string;
488
+ label: MessageLike;
446
489
  minKey: string;
447
490
  maxKey: string;
448
491
  defval: number;
449
492
  min?: number;
450
493
  max?: number;
451
494
  step?: number;
452
- placeholder?: string;
495
+ placeholder?: MessageLike;
453
496
  when?: SettingsRowWhen;
454
497
  };
455
498
  /** A value-carrying row (everything except the key-less `heading`/`header` titles). */
@@ -458,7 +501,7 @@ type SettingsValueRow = Exclude<SettingsRowDescriptor, {
458
501
  }>;
459
502
  /** The canonical row shape every {@link SettingsValueRow} reduces to (the `row` kind's fields). */
460
503
  interface NormalizedSettingsRow {
461
- label: string;
504
+ label: MessageLike;
462
505
  toggle?: {
463
506
  key: string;
464
507
  defval: boolean;
@@ -494,14 +537,14 @@ declare function settingsRowValueKeys(r: SettingsRowDescriptor): SettingsRowValu
494
537
  * present and not removable — the base instance.
495
538
  */
496
539
  interface ChartTypeSettingsInstance {
497
- label: string;
540
+ label: MessageLike;
498
541
  /** Boolean bag key controlling presence; omitted = always present, not removable. */
499
542
  enableKey?: string;
500
543
  rows: readonly SettingsRowDescriptor[];
501
544
  }
502
545
  /** An indented sub-entry under the section's rail tab, with its own pane of rows. */
503
546
  interface ChartTypeSettingsSubsection {
504
- title: string;
547
+ title: MessageLike;
505
548
  rows: readonly SettingsRowDescriptor[];
506
549
  /**
507
550
  * Boolean bag key that masters this pane. While it is false, every row EXCEPT the
@@ -530,7 +573,7 @@ interface ChartTypeSettingsSubsection {
530
573
  */
531
574
  interface ChartTypeSettingsSection {
532
575
  /** Section heading in the settings dialog. */
533
- title: string;
576
+ title: MessageLike;
534
577
  /** Flat form. Ignored when `instances` is declared. */
535
578
  rows?: readonly SettingsRowDescriptor[];
536
579
  /** How `rows` are presented: `'flat'` (default) renders headings as inline group
@@ -624,6 +667,9 @@ interface RendererLayerArgs {
624
667
  x: number;
625
668
  y: number;
626
669
  } | null;
670
+ /** The chart's translator: `i18n.t(msg(...))` for text a layer paints, and
671
+ * `i18n.format` for its numbers and dates, in the chart's locale. */
672
+ i18n: Translator;
627
673
  }
628
674
  /** How a layer dims/slims the BASE painting under it (see
629
675
  * {@link RendererLayerInstance.modulateBase}). Omitted fields keep their defaults. */
@@ -734,4 +780,4 @@ declare const CATEGORICAL: readonly string[];
734
780
  /** Pick a stable categorical color for a string key (same key ⇒ same color). */
735
781
  declare function categoricalColor(key: string): string;
736
782
 
737
- export { getDrawingType as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowInlineNumber as E, type SettingsRowSwatch as F, type SettingsRowValueKey as G, HIGHLIGHT as H, INFO as I, type SettingsRowWhen as J, type SettingsRowWidth as K, type SettingsValueRow as L, MARKER as M, NEUTRAL as N, TRADE_LONG as O, TRADE_SHORT as P, categoricalColor as Q, type RendererLayerArgs as R, type SettingsSelectOption as S, TRADE_EXIT as T, chartType as U, VALID as V, WARNING as W, chartTypes as X, createDrawing as Y, deserializeDrawing as Z, drawingTypes as _, ACCENT_BRIGHT as a, normalizeSettingsRow as a0, registerChartType as a1, registerDrawingType as a2, registerRendererDefaults as a3, registerRendererLayer as a4, rendererDefaults as a5, rendererLayers as a6, settingsRowValueKeys as a7, stableSeriesId as a8, tickerModifierIds as a9, unregisterChartType as aa, unregisterRendererDefaults as ab, unregisterRendererLayer as ac, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CHIP_PLATE as e, CROSSHAIR as f, type ChartTypeDefinition as g, type ChartTypeSettingsInstance as h, type ChartTypeSettingsSection as i, type ChartTypeSettingsSubsection as j, INVALID as k, type IdentifiableKind as l, type NormalizedSettingsRow as m, type RendererLayerDefinition as n, type RendererLayerInstance as o, SERIES_LINE as p, SESSION_OFF as q, SESSION_POST as r, SESSION_PRE as s, SLATE as t, SLATE_DEEP as u, type SeriesDataEngine as v, type SeriesDataEngineHost as w, type SettingsInlineControl as x, type SettingsRowCondition as y, type SettingsRowDescriptor as z };
783
+ export { deserializeDrawing as $, ACCENT as A, BEARISH as B, CATEGORICAL as C, type DrawingTypeMeta as D, type SettingsRowDescriptor as E, type SettingsRowInlineNumber as F, type SettingsRowSwatch as G, HIGHLIGHT as H, INFO as I, type SettingsRowValueKey as J, type SettingsRowWhen as K, type SettingsRowWidth as L, MARKER as M, NEUTRAL as N, type SettingsValueRow as O, TRADE_LONG as P, TRADE_SHORT as Q, type RendererLayerArgs as R, type SettingsSelectOption as S, TRADE_EXIT as T, categoricalColor as U, VALID as V, WARNING as W, chartType as X, chartTypes as Y, createDrawing as Z, createTranslator as _, ACCENT_BRIGHT as a, drawingTypes as a0, getDrawingType as a1, msg as a2, normalizeSettingsRow as a3, registerChartType as a4, registerDrawingType as a5, registerLocale as a6, registerRendererDefaults as a7, registerRendererLayer as a8, registeredLocales as a9, rendererDefaults as aa, rendererLayers as ab, settingsRowValueKeys as ac, stableSeriesId as ad, tickerModifierIds as ae, unregisterChartType as af, unregisterRendererDefaults as ag, unregisterRendererLayer as ah, withValues as ai, BULLISH as b, type BarTransform as c, type BasePaintingModulation as d, CHIP_PLATE as e, CROSSHAIR as f, type ChartTypeDefinition as g, type ChartTypeSettingsInstance as h, type ChartTypeSettingsSection as i, type ChartTypeSettingsSubsection as j, INVALID as k, type IdentifiableKind as l, type MessageValues as m, type NormalizedSettingsRow as n, type RendererLayerDefinition as o, type RendererLayerInstance as p, SERIES_LINE as q, SESSION_OFF as r, SESSION_POST as s, SESSION_PRE as t, SLATE as u, SLATE_DEEP as v, type SeriesDataEngine as w, type SeriesDataEngineHost as x, type SettingsInlineControl as y, type SettingsRowCondition as z };