@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.
- package/dist/{DataProvider-Byo8pEv0.d.ts → DataProvider-BGlB1zSc.d.ts} +1 -1
- package/dist/{DataProvider-Bw58CjYy.d.cts → DataProvider-zJGp58kb.d.cts} +1 -1
- package/dist/{chunk-MOJ4T26N.js → chunk-4WAHYL7Y.js} +1151 -474
- package/dist/chunk-O6L27KRB.js +1331 -0
- package/dist/{chunk-WY5H4S4I.js → chunk-PZN4RS4T.js} +91 -36
- package/dist/{chunk-AUOB7A5Y.js → chunk-WHPQQYH7.js} +29 -13
- package/dist/{chunk-UNUVPQFW.js → chunk-XIRSR3D6.js} +2837 -1604
- package/dist/{chunk-ALTGHKIM.js → chunk-YRCL3WMD.js} +510 -406
- package/dist/{contributions-BY3zSYiZ.d.ts → contributions-BjefWpxQ.d.ts} +106 -25
- package/dist/{contributions-DOm40g5-.d.cts → contributions-CpCJisTC.d.cts} +106 -25
- package/dist/index.cjs +4485 -2163
- package/dist/index.d.cts +67 -25
- package/dist/index.d.ts +67 -25
- package/dist/index.js +5 -5
- package/dist/{keymap-CGOz5F5f.d.ts → keymap-B9_FLhfJ.d.cts} +9 -6
- package/dist/{keymap-CGOz5F5f.d.cts → keymap-UolhuXH1.d.ts} +9 -6
- package/dist/locales/ar.cjs +2260 -0
- package/dist/locales/ar.d.cts +5 -0
- package/dist/locales/ar.d.ts +5 -0
- package/dist/locales/ar.js +2258 -0
- package/dist/locales/de.cjs +2260 -0
- package/dist/locales/de.d.cts +5 -0
- package/dist/locales/de.d.ts +5 -0
- package/dist/locales/de.js +2258 -0
- package/dist/locales/en.cjs +2260 -0
- package/dist/locales/en.d.cts +5 -0
- package/dist/locales/en.d.ts +5 -0
- package/dist/locales/en.js +2258 -0
- package/dist/locales/es.cjs +2260 -0
- package/dist/locales/es.d.cts +5 -0
- package/dist/locales/es.d.ts +5 -0
- package/dist/locales/es.js +2258 -0
- package/dist/locales/fr.cjs +2260 -0
- package/dist/locales/fr.d.cts +5 -0
- package/dist/locales/fr.d.ts +5 -0
- package/dist/locales/fr.js +2258 -0
- package/dist/locales/he.cjs +2260 -0
- package/dist/locales/he.d.cts +5 -0
- package/dist/locales/he.d.ts +5 -0
- package/dist/locales/he.js +2258 -0
- package/dist/locales/hi.cjs +2260 -0
- package/dist/locales/hi.d.cts +5 -0
- package/dist/locales/hi.d.ts +5 -0
- package/dist/locales/hi.js +2258 -0
- package/dist/locales/id.cjs +2260 -0
- package/dist/locales/id.d.cts +5 -0
- package/dist/locales/id.d.ts +5 -0
- package/dist/locales/id.js +2258 -0
- package/dist/locales/it.cjs +2260 -0
- package/dist/locales/it.d.cts +5 -0
- package/dist/locales/it.d.ts +5 -0
- package/dist/locales/it.js +2258 -0
- package/dist/locales/ja.cjs +2260 -0
- package/dist/locales/ja.d.cts +5 -0
- package/dist/locales/ja.d.ts +5 -0
- package/dist/locales/ja.js +2258 -0
- package/dist/locales/ko.cjs +2260 -0
- package/dist/locales/ko.d.cts +5 -0
- package/dist/locales/ko.d.ts +5 -0
- package/dist/locales/ko.js +2258 -0
- package/dist/locales/ms.cjs +2260 -0
- package/dist/locales/ms.d.cts +5 -0
- package/dist/locales/ms.d.ts +5 -0
- package/dist/locales/ms.js +2258 -0
- package/dist/locales/pl.cjs +2260 -0
- package/dist/locales/pl.d.cts +5 -0
- package/dist/locales/pl.d.ts +5 -0
- package/dist/locales/pl.js +2258 -0
- package/dist/locales/pt-BR.cjs +2260 -0
- package/dist/locales/pt-BR.d.cts +5 -0
- package/dist/locales/pt-BR.d.ts +5 -0
- package/dist/locales/pt-BR.js +2258 -0
- package/dist/locales/ru.cjs +2260 -0
- package/dist/locales/ru.d.cts +5 -0
- package/dist/locales/ru.d.ts +5 -0
- package/dist/locales/ru.js +2258 -0
- package/dist/locales/th.cjs +2260 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/locales/th.js +2258 -0
- package/dist/locales/tr.cjs +2260 -0
- package/dist/locales/tr.d.cts +5 -0
- package/dist/locales/tr.d.ts +5 -0
- package/dist/locales/tr.js +2258 -0
- package/dist/locales/vi.cjs +2260 -0
- package/dist/locales/vi.d.cts +5 -0
- package/dist/locales/vi.d.ts +5 -0
- package/dist/locales/vi.js +2258 -0
- package/dist/locales/zh-Hans.cjs +2260 -0
- package/dist/locales/zh-Hans.d.cts +5 -0
- package/dist/locales/zh-Hans.d.ts +5 -0
- package/dist/locales/zh-Hans.js +2258 -0
- package/dist/locales/zh-Hant.cjs +2260 -0
- package/dist/locales/zh-Hant.d.cts +5 -0
- package/dist/locales/zh-Hant.d.ts +5 -0
- package/dist/locales/zh-Hant.js +2258 -0
- package/dist/{options-CSXbjMM5.d.cts → options-CpegHml_.d.cts} +110 -10
- package/dist/{options-CSXbjMM5.d.ts → options-D4L3_hv_.d.ts} +110 -10
- package/dist/{plugin-BDxUhGO3.d.ts → plugin-DTmulpKM.d.ts} +92 -40
- package/dist/{plugin-CiQVyETg.d.cts → plugin-DpNp4aBi.d.cts} +92 -40
- package/dist/plugin.cjs +1267 -319
- package/dist/plugin.d.cts +7 -6
- package/dist/plugin.d.ts +7 -6
- package/dist/plugin.js +3 -3
- package/dist/providers/binance.cjs +1 -1
- package/dist/providers/binance.d.cts +3 -2
- package/dist/providers/binance.d.ts +3 -2
- package/dist/providers/binance.js +1 -1
- package/dist/providers/coinbase.cjs +1 -1
- package/dist/providers/coinbase.d.cts +3 -2
- package/dist/providers/coinbase.d.ts +3 -2
- package/dist/providers/coinbase.js +1 -1
- package/dist/providers/hyperliquid.cjs +1 -1
- package/dist/providers/hyperliquid.d.cts +3 -2
- package/dist/providers/hyperliquid.d.ts +3 -2
- package/dist/providers/hyperliquid.js +1 -1
- package/dist/{side-panel-_2UK1gSm.d.ts → side-panel-BqUnpfev.d.cts} +13 -2
- package/dist/{side-panel-_2UK1gSm.d.cts → side-panel-CYmH1Opm.d.ts} +13 -2
- package/dist/{statusline-model-C9tYXuux.d.ts → statusline-model-C3yIY9WE.d.ts} +11 -3
- package/dist/{statusline-model-DUBX6Fib.d.cts → statusline-model-pGs3Xvp-.d.cts} +11 -3
- package/dist/types-BlrXRLIR.d.cts +2515 -0
- package/dist/types-BlrXRLIR.d.ts +2515 -0
- package/dist/ui.cjs +1008 -56
- package/dist/ui.d.cts +21 -2
- package/dist/ui.d.ts +21 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +4451 -2131
- package/dist/vela.global.min.js +57 -57
- package/dist/widget.cjs +5819 -2780
- package/dist/widget.d.cts +100 -26
- package/dist/widget.d.ts +100 -26
- package/dist/widget.js +19 -11
- package/dist/workspace.cjs +5808 -2787
- package/dist/workspace.d.cts +63 -15
- package/dist/workspace.d.ts +63 -15
- package/dist/workspace.js +6 -6
- package/package.json +9 -2
- package/dist/chunk-I2U4NZD2.js +0 -340
- /package/dist/{chunk-W5YPYZ2P.js → chunk-3EYCX2L4.js} +0 -0
package/dist/workspace.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-
|
|
3
|
-
export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
4
|
-
import { K as KeymapManager } from './keymap-
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-
|
|
6
|
-
import { M as
|
|
1
|
+
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-CpegHml_.cjs';
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-pGs3Xvp-.cjs';
|
|
3
|
+
export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-pGs3Xvp-.cjs';
|
|
4
|
+
import { K as KeymapManager } from './keymap-B9_FLhfJ.cjs';
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-CpCJisTC.cjs';
|
|
6
|
+
import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-BlrXRLIR.cjs';
|
|
7
|
+
import { M as MarketDataFeed } from './DataProvider-zJGp58kb.cjs';
|
|
7
8
|
|
|
8
9
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
10
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -81,6 +82,9 @@ interface CellDeps {
|
|
|
81
82
|
engines: Record<string, () => ScriptingEngine>;
|
|
82
83
|
/** The workspace's top-level chart options every cell's chart starts from. */
|
|
83
84
|
chartDefaults: CellChartDefaults;
|
|
85
|
+
/** The workspace's CURRENT localization — a cell built after a `setLocale` starts in it
|
|
86
|
+
* (absent = the chart defaults: English). */
|
|
87
|
+
localization?(): LocalizationOptions;
|
|
84
88
|
theme: VelaTheme;
|
|
85
89
|
live: boolean;
|
|
86
90
|
volume: boolean;
|
|
@@ -297,6 +301,9 @@ declare class ChartCell {
|
|
|
297
301
|
/** The LIVE chart of this cell — never cache it across a layout change (the cell's
|
|
298
302
|
* identity is what endures; the chart dies with the cell). */
|
|
299
303
|
get chart(): Vela;
|
|
304
|
+
/** Re-read the cell's own chrome (status line, watermark, view controls, settings rows,
|
|
305
|
+
* native indicator names) in the chart's language, after `chart.setLocale`. */
|
|
306
|
+
relocalize(): void;
|
|
300
307
|
get symbol(): string;
|
|
301
308
|
get timeframe(): string;
|
|
302
309
|
get priceStyle(): string;
|
|
@@ -362,6 +369,7 @@ declare class ChartCell {
|
|
|
362
369
|
* then the manifest in the host's own order. */
|
|
363
370
|
libraryRows(): Array<{
|
|
364
371
|
name: string;
|
|
372
|
+
aliases?: string[];
|
|
365
373
|
language?: string;
|
|
366
374
|
category?: string;
|
|
367
375
|
native?: boolean;
|
|
@@ -371,6 +379,7 @@ declare class ChartCell {
|
|
|
371
379
|
/** The picker's on-chart rows: native instances first, then live script instances. */
|
|
372
380
|
onChartRows(): Array<{
|
|
373
381
|
name: string;
|
|
382
|
+
aliases?: string[];
|
|
374
383
|
language?: string;
|
|
375
384
|
native?: boolean;
|
|
376
385
|
nativeType?: string;
|
|
@@ -583,7 +592,7 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
583
592
|
interface LayoutDefinition {
|
|
584
593
|
/** Stable id (`'4'`, `'2h'`, a plugin's `'6-tall'`, …) — re-registering replaces. */
|
|
585
594
|
id: string;
|
|
586
|
-
/** Human-readable label for layout pickers. */
|
|
595
|
+
/** Human-readable label for layout pickers, in the language it was read in. */
|
|
587
596
|
label: string;
|
|
588
597
|
/** Column track weights (`fr` units), left to right. */
|
|
589
598
|
cols: number[];
|
|
@@ -606,13 +615,20 @@ interface LayoutDefinition {
|
|
|
606
615
|
}>;
|
|
607
616
|
}
|
|
608
617
|
|
|
618
|
+
/** What {@link registerLayout} takes: a definition whose label may be a message
|
|
619
|
+
* (`msg()`), read in each picker's language. */
|
|
620
|
+
type LayoutRegistration = Omit<LayoutDefinition, 'label'> & {
|
|
621
|
+
label: MessageLike;
|
|
622
|
+
};
|
|
609
623
|
/** Register (or replace) a workspace layout. Pickers read the registry live. */
|
|
610
|
-
declare function registerLayout(def:
|
|
624
|
+
declare function registerLayout(def: LayoutRegistration): void;
|
|
611
625
|
declare function unregisterLayout(id: string): void;
|
|
612
|
-
/** The definition behind a layout id (undefined for unknown ids)
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
626
|
+
/** The definition behind a layout id (undefined for unknown ids), labelled in `i18n`'s
|
|
627
|
+
* language (English without one). Read it again after `locale:changed`. */
|
|
628
|
+
declare function layoutDefinition(id: string, i18n?: Translator | null): LayoutDefinition | undefined;
|
|
629
|
+
/** Every registered layout (registration order), labelled in `i18n`'s language (English
|
|
630
|
+
* without one) — drives layout pickers. Read it again after `locale:changed`. */
|
|
631
|
+
declare function layouts(i18n?: Translator | null): LayoutDefinition[];
|
|
616
632
|
/** Register the built-in presets (idempotent — called by the workspace entry point). */
|
|
617
633
|
declare function registerBuiltinLayouts(): void;
|
|
618
634
|
/** Picker canvas bound — dynamic layouts stay within a 4×4 grid (16 cells, the
|
|
@@ -623,7 +639,7 @@ declare const GRID_PICKER_MAX = 4;
|
|
|
623
639
|
* picker canvas. Geometry matching a registered classic preset returns that preset
|
|
624
640
|
* (id `'4'`, `'2h'`, …); anything else synthesizes a `g<rows>x<cols>` definition.
|
|
625
641
|
*/
|
|
626
|
-
declare function layoutForGrid(rows: number, cols: number): LayoutDefinition;
|
|
642
|
+
declare function layoutForGrid(rows: number, cols: number, i18n?: Translator | null): LayoutDefinition;
|
|
627
643
|
/**
|
|
628
644
|
* Resolve a layout id to its definition, synthesizing the picker's dynamic ids
|
|
629
645
|
* (`g<rows>x<cols>`) when they are not registered — the boot path for persisted
|
|
@@ -745,6 +761,9 @@ interface WorkspaceEventMap extends Record<string, unknown> {
|
|
|
745
761
|
/** The persistable state changed (debounced ~500ms) — re-pull `getState()` if you
|
|
746
762
|
* consume it. The signal custom persistence flows build on. */
|
|
747
763
|
'state:changed': undefined;
|
|
764
|
+
/** The workspace's localization changed (`setLocale`), after every cell and the shared
|
|
765
|
+
* chrome have re-rendered. */
|
|
766
|
+
'locale:changed': LocaleChangedEvent;
|
|
748
767
|
}
|
|
749
768
|
declare class VelaWorkspace {
|
|
750
769
|
readonly root: HTMLElement;
|
|
@@ -765,6 +784,8 @@ declare class VelaWorkspace {
|
|
|
765
784
|
private readonly splitters;
|
|
766
785
|
private readonly resizeObserver;
|
|
767
786
|
private readonly opts;
|
|
787
|
+
/** The workspace's ONE localization — every cell's chart and the shared chrome follow it. */
|
|
788
|
+
private readonly localeState;
|
|
768
789
|
private def;
|
|
769
790
|
/** Cell identities by SLOT POSITION — `order[i]` lives in the layout's i-th slot.
|
|
770
791
|
* Names come from the `cells` declaration order (then the persisted document);
|
|
@@ -782,7 +803,8 @@ declare class VelaWorkspace {
|
|
|
782
803
|
* mobile drawings stop, no pill (the headless `chart.drawings` API stays). */
|
|
783
804
|
private readonly drawingsEnabled;
|
|
784
805
|
/** The shared bar's content — `drawings: { tools | groups }` picks it. */
|
|
785
|
-
|
|
806
|
+
/** The shared toolbar, labelled in the workspace's language (rebuilt when it changes). */
|
|
807
|
+
private toolbarDef;
|
|
786
808
|
private destroyed;
|
|
787
809
|
private readonly topbar;
|
|
788
810
|
private readonly bottombar;
|
|
@@ -914,6 +936,28 @@ declare class VelaWorkspace {
|
|
|
914
936
|
private compositeLayoutShot;
|
|
915
937
|
setActiveCell(id: string | null): void;
|
|
916
938
|
on<K extends keyof WorkspaceEventMap>(event: K, handler: (payload: WorkspaceEventMap[K]) => void): () => void;
|
|
939
|
+
/**
|
|
940
|
+
* The workspace's translator: its resolved locale and direction, `t()` for messages and
|
|
941
|
+
* `format` for numbers and dates. Every cell's chart carries the same settings
|
|
942
|
+
* (`cell.chart.i18n`), and contributed actions read it as `ctx.i18n`. The same object
|
|
943
|
+
* for the workspace's lifetime; it reads the new settings after {@link setLocale}.
|
|
944
|
+
*/
|
|
945
|
+
get i18n(): Translator;
|
|
946
|
+
/**
|
|
947
|
+
* Change the language, direction or formatting of the whole workspace at runtime — a
|
|
948
|
+
* locale tag (`ws.setLocale('de')`) or any {@link LocalizationOptions} fields. Fields
|
|
949
|
+
* you pass replace their current value (an explicit `undefined` restores the default);
|
|
950
|
+
* the others are kept. Every cell re-renders in place, the shared chrome follows, and
|
|
951
|
+
* `locale:changed` fires. Register the locale's pack (`registerLocale`) first for
|
|
952
|
+
* translated text.
|
|
953
|
+
*/
|
|
954
|
+
setLocale(next: string | LocalizationOptions): void;
|
|
955
|
+
/** Re-read the shared chrome in the current language. Dialogs, menus and drawers read
|
|
956
|
+
* it on their next open; what stays on screen is relabeled here. */
|
|
957
|
+
private relocalizeChrome;
|
|
958
|
+
/** `lang` once the host set a locale, `dir` once it set a direction; otherwise the
|
|
959
|
+
* attributes stay off and the host page decides. */
|
|
960
|
+
private applyRootAttributes;
|
|
917
961
|
/** The context handed to contributed actions/attachments (rebuilt per invocation). */
|
|
918
962
|
context(): WorkspaceWidgetContext;
|
|
919
963
|
/** Re-project contributed topbar actions + side panels, and mount late-registered attachments. */
|
|
@@ -1197,6 +1241,10 @@ declare class VelaWorkspace {
|
|
|
1197
1241
|
private openMoreDrawer;
|
|
1198
1242
|
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1199
1243
|
private drawerActions;
|
|
1244
|
+
/** Display text in the workspace's language. */
|
|
1245
|
+
private t;
|
|
1246
|
+
/** The layout SYNC switches (the topbar dropdown and the mobile drawer list the same). */
|
|
1247
|
+
private syncRows;
|
|
1200
1248
|
private openTimezoneDrawer;
|
|
1201
1249
|
private openPriceScaleDrawer;
|
|
1202
1250
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1236,4 +1284,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1236
1284
|
*/
|
|
1237
1285
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1238
1286
|
|
|
1239
|
-
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1287
|
+
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutRegistration, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
package/dist/workspace.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-
|
|
3
|
-
export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
4
|
-
import { K as KeymapManager } from './keymap-
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-
|
|
6
|
-
import { M as
|
|
1
|
+
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, I as InputValue, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-D4L3_hv_.js';
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as StatuslinePart, b as RangePreset, T as TrackSizes, c as VelaShellOptions, d as SyncOptions, e as SyncKind, f as WorkspaceState } from './statusline-model-C3yIY9WE.js';
|
|
3
|
+
export { g as ChartState, D as DrawingToolsState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-C3yIY9WE.js';
|
|
4
|
+
import { K as KeymapManager } from './keymap-UolhuXH1.js';
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, R as ReplayState, a as ReplayBounds, b as VelaEventMap, c as ScriptRun } from './contributions-BjefWpxQ.js';
|
|
6
|
+
import { b as LocalizationOptions, M as MessageLike, T as Translator, c as LocaleChangedEvent } from './types-BlrXRLIR.js';
|
|
7
|
+
import { M as MarketDataFeed } from './DataProvider-BGlB1zSc.js';
|
|
7
8
|
|
|
8
9
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
10
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -81,6 +82,9 @@ interface CellDeps {
|
|
|
81
82
|
engines: Record<string, () => ScriptingEngine>;
|
|
82
83
|
/** The workspace's top-level chart options every cell's chart starts from. */
|
|
83
84
|
chartDefaults: CellChartDefaults;
|
|
85
|
+
/** The workspace's CURRENT localization — a cell built after a `setLocale` starts in it
|
|
86
|
+
* (absent = the chart defaults: English). */
|
|
87
|
+
localization?(): LocalizationOptions;
|
|
84
88
|
theme: VelaTheme;
|
|
85
89
|
live: boolean;
|
|
86
90
|
volume: boolean;
|
|
@@ -297,6 +301,9 @@ declare class ChartCell {
|
|
|
297
301
|
/** The LIVE chart of this cell — never cache it across a layout change (the cell's
|
|
298
302
|
* identity is what endures; the chart dies with the cell). */
|
|
299
303
|
get chart(): Vela;
|
|
304
|
+
/** Re-read the cell's own chrome (status line, watermark, view controls, settings rows,
|
|
305
|
+
* native indicator names) in the chart's language, after `chart.setLocale`. */
|
|
306
|
+
relocalize(): void;
|
|
300
307
|
get symbol(): string;
|
|
301
308
|
get timeframe(): string;
|
|
302
309
|
get priceStyle(): string;
|
|
@@ -362,6 +369,7 @@ declare class ChartCell {
|
|
|
362
369
|
* then the manifest in the host's own order. */
|
|
363
370
|
libraryRows(): Array<{
|
|
364
371
|
name: string;
|
|
372
|
+
aliases?: string[];
|
|
365
373
|
language?: string;
|
|
366
374
|
category?: string;
|
|
367
375
|
native?: boolean;
|
|
@@ -371,6 +379,7 @@ declare class ChartCell {
|
|
|
371
379
|
/** The picker's on-chart rows: native instances first, then live script instances. */
|
|
372
380
|
onChartRows(): Array<{
|
|
373
381
|
name: string;
|
|
382
|
+
aliases?: string[];
|
|
374
383
|
language?: string;
|
|
375
384
|
native?: boolean;
|
|
376
385
|
nativeType?: string;
|
|
@@ -583,7 +592,7 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
583
592
|
interface LayoutDefinition {
|
|
584
593
|
/** Stable id (`'4'`, `'2h'`, a plugin's `'6-tall'`, …) — re-registering replaces. */
|
|
585
594
|
id: string;
|
|
586
|
-
/** Human-readable label for layout pickers. */
|
|
595
|
+
/** Human-readable label for layout pickers, in the language it was read in. */
|
|
587
596
|
label: string;
|
|
588
597
|
/** Column track weights (`fr` units), left to right. */
|
|
589
598
|
cols: number[];
|
|
@@ -606,13 +615,20 @@ interface LayoutDefinition {
|
|
|
606
615
|
}>;
|
|
607
616
|
}
|
|
608
617
|
|
|
618
|
+
/** What {@link registerLayout} takes: a definition whose label may be a message
|
|
619
|
+
* (`msg()`), read in each picker's language. */
|
|
620
|
+
type LayoutRegistration = Omit<LayoutDefinition, 'label'> & {
|
|
621
|
+
label: MessageLike;
|
|
622
|
+
};
|
|
609
623
|
/** Register (or replace) a workspace layout. Pickers read the registry live. */
|
|
610
|
-
declare function registerLayout(def:
|
|
624
|
+
declare function registerLayout(def: LayoutRegistration): void;
|
|
611
625
|
declare function unregisterLayout(id: string): void;
|
|
612
|
-
/** The definition behind a layout id (undefined for unknown ids)
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
626
|
+
/** The definition behind a layout id (undefined for unknown ids), labelled in `i18n`'s
|
|
627
|
+
* language (English without one). Read it again after `locale:changed`. */
|
|
628
|
+
declare function layoutDefinition(id: string, i18n?: Translator | null): LayoutDefinition | undefined;
|
|
629
|
+
/** Every registered layout (registration order), labelled in `i18n`'s language (English
|
|
630
|
+
* without one) — drives layout pickers. Read it again after `locale:changed`. */
|
|
631
|
+
declare function layouts(i18n?: Translator | null): LayoutDefinition[];
|
|
616
632
|
/** Register the built-in presets (idempotent — called by the workspace entry point). */
|
|
617
633
|
declare function registerBuiltinLayouts(): void;
|
|
618
634
|
/** Picker canvas bound — dynamic layouts stay within a 4×4 grid (16 cells, the
|
|
@@ -623,7 +639,7 @@ declare const GRID_PICKER_MAX = 4;
|
|
|
623
639
|
* picker canvas. Geometry matching a registered classic preset returns that preset
|
|
624
640
|
* (id `'4'`, `'2h'`, …); anything else synthesizes a `g<rows>x<cols>` definition.
|
|
625
641
|
*/
|
|
626
|
-
declare function layoutForGrid(rows: number, cols: number): LayoutDefinition;
|
|
642
|
+
declare function layoutForGrid(rows: number, cols: number, i18n?: Translator | null): LayoutDefinition;
|
|
627
643
|
/**
|
|
628
644
|
* Resolve a layout id to its definition, synthesizing the picker's dynamic ids
|
|
629
645
|
* (`g<rows>x<cols>`) when they are not registered — the boot path for persisted
|
|
@@ -745,6 +761,9 @@ interface WorkspaceEventMap extends Record<string, unknown> {
|
|
|
745
761
|
/** The persistable state changed (debounced ~500ms) — re-pull `getState()` if you
|
|
746
762
|
* consume it. The signal custom persistence flows build on. */
|
|
747
763
|
'state:changed': undefined;
|
|
764
|
+
/** The workspace's localization changed (`setLocale`), after every cell and the shared
|
|
765
|
+
* chrome have re-rendered. */
|
|
766
|
+
'locale:changed': LocaleChangedEvent;
|
|
748
767
|
}
|
|
749
768
|
declare class VelaWorkspace {
|
|
750
769
|
readonly root: HTMLElement;
|
|
@@ -765,6 +784,8 @@ declare class VelaWorkspace {
|
|
|
765
784
|
private readonly splitters;
|
|
766
785
|
private readonly resizeObserver;
|
|
767
786
|
private readonly opts;
|
|
787
|
+
/** The workspace's ONE localization — every cell's chart and the shared chrome follow it. */
|
|
788
|
+
private readonly localeState;
|
|
768
789
|
private def;
|
|
769
790
|
/** Cell identities by SLOT POSITION — `order[i]` lives in the layout's i-th slot.
|
|
770
791
|
* Names come from the `cells` declaration order (then the persisted document);
|
|
@@ -782,7 +803,8 @@ declare class VelaWorkspace {
|
|
|
782
803
|
* mobile drawings stop, no pill (the headless `chart.drawings` API stays). */
|
|
783
804
|
private readonly drawingsEnabled;
|
|
784
805
|
/** The shared bar's content — `drawings: { tools | groups }` picks it. */
|
|
785
|
-
|
|
806
|
+
/** The shared toolbar, labelled in the workspace's language (rebuilt when it changes). */
|
|
807
|
+
private toolbarDef;
|
|
786
808
|
private destroyed;
|
|
787
809
|
private readonly topbar;
|
|
788
810
|
private readonly bottombar;
|
|
@@ -914,6 +936,28 @@ declare class VelaWorkspace {
|
|
|
914
936
|
private compositeLayoutShot;
|
|
915
937
|
setActiveCell(id: string | null): void;
|
|
916
938
|
on<K extends keyof WorkspaceEventMap>(event: K, handler: (payload: WorkspaceEventMap[K]) => void): () => void;
|
|
939
|
+
/**
|
|
940
|
+
* The workspace's translator: its resolved locale and direction, `t()` for messages and
|
|
941
|
+
* `format` for numbers and dates. Every cell's chart carries the same settings
|
|
942
|
+
* (`cell.chart.i18n`), and contributed actions read it as `ctx.i18n`. The same object
|
|
943
|
+
* for the workspace's lifetime; it reads the new settings after {@link setLocale}.
|
|
944
|
+
*/
|
|
945
|
+
get i18n(): Translator;
|
|
946
|
+
/**
|
|
947
|
+
* Change the language, direction or formatting of the whole workspace at runtime — a
|
|
948
|
+
* locale tag (`ws.setLocale('de')`) or any {@link LocalizationOptions} fields. Fields
|
|
949
|
+
* you pass replace their current value (an explicit `undefined` restores the default);
|
|
950
|
+
* the others are kept. Every cell re-renders in place, the shared chrome follows, and
|
|
951
|
+
* `locale:changed` fires. Register the locale's pack (`registerLocale`) first for
|
|
952
|
+
* translated text.
|
|
953
|
+
*/
|
|
954
|
+
setLocale(next: string | LocalizationOptions): void;
|
|
955
|
+
/** Re-read the shared chrome in the current language. Dialogs, menus and drawers read
|
|
956
|
+
* it on their next open; what stays on screen is relabeled here. */
|
|
957
|
+
private relocalizeChrome;
|
|
958
|
+
/** `lang` once the host set a locale, `dir` once it set a direction; otherwise the
|
|
959
|
+
* attributes stay off and the host page decides. */
|
|
960
|
+
private applyRootAttributes;
|
|
917
961
|
/** The context handed to contributed actions/attachments (rebuilt per invocation). */
|
|
918
962
|
context(): WorkspaceWidgetContext;
|
|
919
963
|
/** Re-project contributed topbar actions + side panels, and mount late-registered attachments. */
|
|
@@ -1197,6 +1241,10 @@ declare class VelaWorkspace {
|
|
|
1197
1241
|
private openMoreDrawer;
|
|
1198
1242
|
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1199
1243
|
private drawerActions;
|
|
1244
|
+
/** Display text in the workspace's language. */
|
|
1245
|
+
private t;
|
|
1246
|
+
/** The layout SYNC switches (the topbar dropdown and the mobile drawer list the same). */
|
|
1247
|
+
private syncRows;
|
|
1200
1248
|
private openTimezoneDrawer;
|
|
1201
1249
|
private openPriceScaleDrawer;
|
|
1202
1250
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1236,4 +1284,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1236
1284
|
*/
|
|
1237
1285
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1238
1286
|
|
|
1239
|
-
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1287
|
+
export { type CellBoot, type CellChartDefaults, type CellNativeInfo, type CellSeed, CellState, ChartCell, GRID_PICKER_MAX, type LayoutDefinition, type LayoutRegistration, type LayoutShape, type PooledCellState, SyncKind, SyncOptions, SyncSetting, TrackSizes, VelaWorkspace, type VelaWorkspaceOptions, type WorkspaceEventMap, WorkspaceReplay, type WorkspaceReplayEventMap, type WorkspaceReplayHost, type WorkspaceReplayStartOptions, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, barClose, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
package/dist/workspace.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, WorkspaceReplay, activeAfterLayout, barClose, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, WorkspaceReplay, activeAfterLayout, barClose, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, lastOpenClosedBy, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, sanitizeState, syncTargets, trackOffsets, unregisterLayout } from './chunk-4WAHYL7Y.js';
|
|
2
|
+
import './chunk-XIRSR3D6.js';
|
|
3
|
+
import './chunk-YRCL3WMD.js';
|
|
4
|
+
import './chunk-WHPQQYH7.js';
|
|
5
|
+
import './chunk-PZN4RS4T.js';
|
|
6
|
+
import './chunk-O6L27KRB.js';
|
|
7
7
|
import './chunk-W4EJWLEO.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxalgo/vela",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The open-source core of Vela by LuxAlgo: a charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charting library",
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"types": "./dist/workspace.d.ts",
|
|
76
76
|
"import": "./dist/workspace.js",
|
|
77
77
|
"require": "./dist/workspace.cjs"
|
|
78
|
+
},
|
|
79
|
+
"./locales/*": {
|
|
80
|
+
"types": "./dist/locales/*.d.ts",
|
|
81
|
+
"import": "./dist/locales/*.js",
|
|
82
|
+
"require": "./dist/locales/*.cjs"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"files": [
|
|
@@ -93,7 +98,9 @@
|
|
|
93
98
|
"test": "vitest run",
|
|
94
99
|
"test:watch": "vitest",
|
|
95
100
|
"lint": "eslint .",
|
|
96
|
-
"playground": "vite"
|
|
101
|
+
"playground": "vite",
|
|
102
|
+
"i18n:extract": "node scripts/i18n-extract.mjs",
|
|
103
|
+
"i18n:check": "node scripts/i18n-extract.mjs --check"
|
|
97
104
|
},
|
|
98
105
|
"devDependencies": {
|
|
99
106
|
"eslint": "^9.0.0",
|