@luxalgo/vela 0.7.7 → 0.8.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-CGa4KHRa.d.cts → DataProvider-BrlxntPN.d.cts} +1 -1
- package/dist/{DataProvider-CmWUtDVL.d.ts → DataProvider-DwFIoV4r.d.ts} +1 -1
- package/dist/{chunk-WTWGEB7K.js → chunk-2IAETM2I.js} +260 -2
- package/dist/{chunk-CAFCLMPF.js → chunk-BZQM2XO7.js} +1 -0
- package/dist/{chunk-ZA2XWTGH.js → chunk-E3GU6AUI.js} +499 -43
- package/dist/{chunk-BFA32GOU.js → chunk-EZ5FWVLA.js} +5 -2
- package/dist/{chunk-PVGWNF7V.js → chunk-KA77UTRF.js} +2 -2
- package/dist/{chunk-RVQWJOEE.js → chunk-QBPUT5SU.js} +2862 -1034
- package/dist/{contributions-DF_Ea07m.d.cts → contributions-CtlptxR8.d.cts} +187 -5
- package/dist/{contributions-nKOSeLy8.d.ts → contributions-tjNExo1o.d.ts} +187 -5
- package/dist/index.cjs +3142 -1030
- package/dist/index.d.cts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +28 -4
- package/dist/{options-D1AJKsn_.d.ts → options-BnEPUuVV.d.cts} +1 -1
- package/dist/{options-D1AJKsn_.d.cts → options-BnEPUuVV.d.ts} +1 -1
- package/dist/{plugin-DPyVJFoA.d.cts → plugin-BWxJRKzS.d.cts} +31 -25
- package/dist/{plugin-0oFDnexb.d.ts → plugin-e2WUEtiI.d.ts} +31 -25
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/{statusline-model-DAFyqVmR.d.ts → statusline-model-DFY7tuHj.d.cts} +5 -3
- package/dist/{statusline-model-BoWJ3cWQ.d.cts → statusline-model-zKXtGIjj.d.ts} +5 -3
- package/dist/ui.cjs +263 -0
- package/dist/ui.d.cts +75 -2
- package/dist/ui.d.ts +75 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +3144 -1032
- package/dist/vela.global.min.js +78 -76
- package/dist/widget.cjs +3627 -1081
- package/dist/widget.d.cts +26 -7
- package/dist/widget.d.ts +26 -7
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +3630 -1081
- package/dist/workspace.d.cts +126 -6
- package/dist/workspace.d.ts +126 -6
- package/dist/workspace.js +6 -6
- package/package.json +1 -1
package/dist/workspace.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
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-BnEPUuVV.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-DFY7tuHj.cjs';
|
|
3
|
+
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-DFY7tuHj.cjs';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
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-CtlptxR8.cjs';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-BrlxntPN.cjs';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -166,6 +166,8 @@ declare class ChartCell {
|
|
|
166
166
|
activeRangeId: string | null;
|
|
167
167
|
/** Latched verdict of {@link sessionAvailable} (async metadata, sticky per symbol). */
|
|
168
168
|
private sessionAvailableFlag;
|
|
169
|
+
/** The symbol of the most recent metadata probe — an older one landing late is dropped. */
|
|
170
|
+
private metadataProbeSymbol;
|
|
169
171
|
/** Latched: the symbol's extended tape wraps midnight (an overnight roll market) —
|
|
170
172
|
* one extended-hours shading phase instead of the pre/post split. */
|
|
171
173
|
private sessionOvernightFlag;
|
|
@@ -213,6 +215,7 @@ declare class ChartCell {
|
|
|
213
215
|
* verbatim, so a document never loses a plugin's state in the plugin's absence. */
|
|
214
216
|
private extState;
|
|
215
217
|
private watermarkOn;
|
|
218
|
+
private replayWatermarkOn;
|
|
216
219
|
/** Indicator titles (this cell's in-chart legend rows) shown. */
|
|
217
220
|
private indicatorTitlesOn;
|
|
218
221
|
/** Plot values beside this cell's legend titles shown. */
|
|
@@ -274,6 +277,8 @@ declare class ChartCell {
|
|
|
274
277
|
private pushSettingsSections;
|
|
275
278
|
/** Show/hide this cell's symbol watermark (persisted per cell). */
|
|
276
279
|
setWatermarkVisible(visible: boolean): void;
|
|
280
|
+
/** Show/hide the "Replay" line under this cell's watermark while it replays (persisted per cell). */
|
|
281
|
+
setReplayWatermarkVisible(visible: boolean): void;
|
|
277
282
|
/** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
|
|
278
283
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
279
284
|
/** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
|
|
@@ -446,6 +451,113 @@ declare class ChartCell {
|
|
|
446
451
|
destroy(): void;
|
|
447
452
|
}
|
|
448
453
|
|
|
454
|
+
/** The workspace replay's events — the chart `replay:*` events, reported for the ACTIVE cell. */
|
|
455
|
+
interface WorkspaceReplayEventMap extends Record<string, unknown> {
|
|
456
|
+
'replay:start': VelaEventMap['replay:start'];
|
|
457
|
+
'replay:step': VelaEventMap['replay:step'];
|
|
458
|
+
'replay:tick': VelaEventMap['replay:tick'];
|
|
459
|
+
'replay:play': VelaEventMap['replay:play'];
|
|
460
|
+
'replay:pause': undefined;
|
|
461
|
+
'replay:end': VelaEventMap['replay:end'];
|
|
462
|
+
}
|
|
463
|
+
/** Options for {@link WorkspaceReplay.start}. */
|
|
464
|
+
interface WorkspaceReplayStartOptions {
|
|
465
|
+
/** Epoch ms, read on `cell`'s chart as `chart.replay.start({ from })` reads it: that chart
|
|
466
|
+
* keeps every bar opened at or before it. The close of its last kept bar becomes the
|
|
467
|
+
* shared replay time, and every other chart keeps the bars closed by then. */
|
|
468
|
+
from: number;
|
|
469
|
+
/** The cell `from` is read on (default: the active cell). */
|
|
470
|
+
cell?: string;
|
|
471
|
+
}
|
|
472
|
+
/** What the controller reads from its workspace. */
|
|
473
|
+
interface WorkspaceReplayHost {
|
|
474
|
+
cells(): ReadonlyArray<{
|
|
475
|
+
readonly id: string;
|
|
476
|
+
readonly chart: Vela;
|
|
477
|
+
}>;
|
|
478
|
+
activeId(): string | null;
|
|
479
|
+
onCells(handler: (e: {
|
|
480
|
+
kind: 'created' | 'destroyed' | 'active';
|
|
481
|
+
id: string;
|
|
482
|
+
}) => void): () => void;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The workspace's bar-replay control surface (`workspace.replay`, `ctx.replay` for
|
|
486
|
+
* contributions): the same verbs as `chart.replay`, applied to every cell on a shared
|
|
487
|
+
* clock. A step moves the clock to the next bar close on ANY chart, and each chart reveals
|
|
488
|
+
* the bars closed by then — so the finest timeframe sets the pace and a coarser chart
|
|
489
|
+
* shows its bar when it completes. Cells added while replaying join at the shared time; a
|
|
490
|
+
* cell switching symbol rejoins once its new bars load; a timeframe switch keeps the
|
|
491
|
+
* cell's place. The replay ends on every chart together: `stop()`, or any chart reaching
|
|
492
|
+
* its last bar. In a multi-chart layout bars are revealed whole (tick replay needs a
|
|
493
|
+
* single-chart layout).
|
|
494
|
+
*/
|
|
495
|
+
declare class WorkspaceReplay {
|
|
496
|
+
private readonly host;
|
|
497
|
+
private readonly bus;
|
|
498
|
+
/** The running session: the shared replay time (every chart shows the bars closed by it). */
|
|
499
|
+
private session;
|
|
500
|
+
private playing;
|
|
501
|
+
private intervalMs;
|
|
502
|
+
private timer;
|
|
503
|
+
/** Cells whose replay a symbol switch ended — restarted at the shared time once their bars land. */
|
|
504
|
+
private readonly rejoining;
|
|
505
|
+
private readonly cellSubs;
|
|
506
|
+
private readonly offHost;
|
|
507
|
+
/** Inside a group step: chart events are the controller's own doing. */
|
|
508
|
+
private stepping;
|
|
509
|
+
/** Inside `finish`: the charts' `replay:end` events are the controller's own doing. */
|
|
510
|
+
private stopping;
|
|
511
|
+
/** Driving a chart's own timer: its play/pause events are not the user's. */
|
|
512
|
+
private muted;
|
|
513
|
+
/** A chart finished during a group step — the session ends right after it. */
|
|
514
|
+
private finishedDuringStep;
|
|
515
|
+
constructor(host: WorkspaceReplayHost);
|
|
516
|
+
/**
|
|
517
|
+
* Enter replay on every cell (or seek, when already replaying) — paused. Resolves once
|
|
518
|
+
* every chart shows its rewound history (a chart whose history does not reach that far
|
|
519
|
+
* loads older bars first). A chart with nothing to replay after the shared time stays
|
|
520
|
+
* as it is.
|
|
521
|
+
*/
|
|
522
|
+
start(opts: WorkspaceReplayStartOptions): Promise<void>;
|
|
523
|
+
/** Reveal the next bar(s): the clock moves to the next bar close on any chart. Returns false when nothing is left. */
|
|
524
|
+
step(): boolean;
|
|
525
|
+
/** Reveal the next update — in a single-chart layout, the chart's `stepUpdate()` (tick replay); otherwise {@link step}. */
|
|
526
|
+
stepUpdate(): boolean;
|
|
527
|
+
/** Advance one update every `intervalMs` (default: the last pace, initially 1000). Calling it again while playing changes the pace. */
|
|
528
|
+
play(intervalMs?: number): this;
|
|
529
|
+
pause(): this;
|
|
530
|
+
/** Leave replay on every chart: full history back, live updates resumed. */
|
|
531
|
+
stop(): this;
|
|
532
|
+
/** `active`/`playing`/`intervalMs` for the whole workspace; the cursor fields read the ACTIVE cell's chart. */
|
|
533
|
+
get state(): ReplayState;
|
|
534
|
+
/** The active cell's replayable history (`chart.replay.bounds`). */
|
|
535
|
+
get bounds(): ReplayBounds | null;
|
|
536
|
+
on<K extends keyof WorkspaceReplayEventMap>(event: K, handler: (payload: WorkspaceReplayEventMap[K]) => void): () => void;
|
|
537
|
+
destroy(): void;
|
|
538
|
+
/** The one chart of a single-chart layout — it replays on its own, tick replay included. */
|
|
539
|
+
private solo;
|
|
540
|
+
private activeChart;
|
|
541
|
+
/** Rewind one chart to the shared time: every bar that closed by `clock`, none after. */
|
|
542
|
+
private startCell;
|
|
543
|
+
/** Move the clock to the next bar close on any chart; each chart reveals what closed by then. */
|
|
544
|
+
private stepGroup;
|
|
545
|
+
/** Put the timers in the state `playing` asks for: a single chart runs its own (it paces
|
|
546
|
+
* ticks), several run on the controller's clock. */
|
|
547
|
+
private syncPlayback;
|
|
548
|
+
private schedule;
|
|
549
|
+
private clearTimer;
|
|
550
|
+
/** End the session on every chart (idempotent). */
|
|
551
|
+
private finish;
|
|
552
|
+
private watch;
|
|
553
|
+
private onCellCreated;
|
|
554
|
+
private onCellDestroyed;
|
|
555
|
+
}
|
|
556
|
+
/** When a bar opened at `open` closes on `timeframe` — calendar months for month-based ones. */
|
|
557
|
+
declare function barClose(open: number, timeframe: string | undefined): number;
|
|
558
|
+
/** The latest open whose bar has closed by `time` on `timeframe` (the inverse of {@link barClose}). */
|
|
559
|
+
declare function lastOpenClosedBy(time: number, timeframe: string | undefined): number;
|
|
560
|
+
|
|
449
561
|
/** The extended context a workspace hands to contributed actions/attachments. */
|
|
450
562
|
interface WorkspaceWidgetContext extends WidgetContext {
|
|
451
563
|
/** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
|
|
@@ -459,6 +571,9 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
459
571
|
/** LIVE getter — follows every active-cell switch. */
|
|
460
572
|
activeCellId: string;
|
|
461
573
|
setActiveCell(id: string): void;
|
|
574
|
+
/** Bar replay across every cell on one clock (`workspace.replay`) — drive this rather
|
|
575
|
+
* than one cell's `chart.replay`, so every chart replays together. */
|
|
576
|
+
replay: WorkspaceReplay;
|
|
462
577
|
}
|
|
463
578
|
|
|
464
579
|
/** One registered workspace layout. */
|
|
@@ -619,7 +734,10 @@ declare class VelaWorkspace {
|
|
|
619
734
|
readonly root: HTMLElement;
|
|
620
735
|
/** The shortcut system — one manager for the whole workspace, routed to the active cell. */
|
|
621
736
|
readonly keymap: KeymapManager;
|
|
737
|
+
/** Bar replay across every cell on one clock (see {@link WorkspaceReplay}). */
|
|
738
|
+
readonly replay: WorkspaceReplay;
|
|
622
739
|
private readonly gridEl;
|
|
740
|
+
private readonly stripsEl;
|
|
623
741
|
private readonly events;
|
|
624
742
|
private readonly feed;
|
|
625
743
|
private readonly cellsById;
|
|
@@ -1036,6 +1154,8 @@ declare class VelaWorkspace {
|
|
|
1036
1154
|
private openTimeframeDrawer;
|
|
1037
1155
|
private openDrawingsDrawer;
|
|
1038
1156
|
private openMoreDrawer;
|
|
1157
|
+
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1158
|
+
private drawerActions;
|
|
1039
1159
|
private openTimezoneDrawer;
|
|
1040
1160
|
private openPriceScaleDrawer;
|
|
1041
1161
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1075,4 +1195,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1075
1195
|
*/
|
|
1076
1196
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1077
1197
|
|
|
1078
|
-
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, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, ensureLayout, evenTracks, gridStyles, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1198
|
+
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 };
|
package/dist/workspace.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-
|
|
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-BnEPUuVV.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-zKXtGIjj.js';
|
|
3
|
+
export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-zKXtGIjj.js';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.js';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
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-tjNExo1o.js';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-DwFIoV4r.js';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
|
@@ -166,6 +166,8 @@ declare class ChartCell {
|
|
|
166
166
|
activeRangeId: string | null;
|
|
167
167
|
/** Latched verdict of {@link sessionAvailable} (async metadata, sticky per symbol). */
|
|
168
168
|
private sessionAvailableFlag;
|
|
169
|
+
/** The symbol of the most recent metadata probe — an older one landing late is dropped. */
|
|
170
|
+
private metadataProbeSymbol;
|
|
169
171
|
/** Latched: the symbol's extended tape wraps midnight (an overnight roll market) —
|
|
170
172
|
* one extended-hours shading phase instead of the pre/post split. */
|
|
171
173
|
private sessionOvernightFlag;
|
|
@@ -213,6 +215,7 @@ declare class ChartCell {
|
|
|
213
215
|
* verbatim, so a document never loses a plugin's state in the plugin's absence. */
|
|
214
216
|
private extState;
|
|
215
217
|
private watermarkOn;
|
|
218
|
+
private replayWatermarkOn;
|
|
216
219
|
/** Indicator titles (this cell's in-chart legend rows) shown. */
|
|
217
220
|
private indicatorTitlesOn;
|
|
218
221
|
/** Plot values beside this cell's legend titles shown. */
|
|
@@ -274,6 +277,8 @@ declare class ChartCell {
|
|
|
274
277
|
private pushSettingsSections;
|
|
275
278
|
/** Show/hide this cell's symbol watermark (persisted per cell). */
|
|
276
279
|
setWatermarkVisible(visible: boolean): void;
|
|
280
|
+
/** Show/hide the "Replay" line under this cell's watermark while it replays (persisted per cell). */
|
|
281
|
+
setReplayWatermarkVisible(visible: boolean): void;
|
|
277
282
|
/** Show/hide this cell's indicator titles — the in-chart legend rows (persisted per cell). */
|
|
278
283
|
setIndicatorTitlesVisible(visible: boolean): void;
|
|
279
284
|
/** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
|
|
@@ -446,6 +451,113 @@ declare class ChartCell {
|
|
|
446
451
|
destroy(): void;
|
|
447
452
|
}
|
|
448
453
|
|
|
454
|
+
/** The workspace replay's events — the chart `replay:*` events, reported for the ACTIVE cell. */
|
|
455
|
+
interface WorkspaceReplayEventMap extends Record<string, unknown> {
|
|
456
|
+
'replay:start': VelaEventMap['replay:start'];
|
|
457
|
+
'replay:step': VelaEventMap['replay:step'];
|
|
458
|
+
'replay:tick': VelaEventMap['replay:tick'];
|
|
459
|
+
'replay:play': VelaEventMap['replay:play'];
|
|
460
|
+
'replay:pause': undefined;
|
|
461
|
+
'replay:end': VelaEventMap['replay:end'];
|
|
462
|
+
}
|
|
463
|
+
/** Options for {@link WorkspaceReplay.start}. */
|
|
464
|
+
interface WorkspaceReplayStartOptions {
|
|
465
|
+
/** Epoch ms, read on `cell`'s chart as `chart.replay.start({ from })` reads it: that chart
|
|
466
|
+
* keeps every bar opened at or before it. The close of its last kept bar becomes the
|
|
467
|
+
* shared replay time, and every other chart keeps the bars closed by then. */
|
|
468
|
+
from: number;
|
|
469
|
+
/** The cell `from` is read on (default: the active cell). */
|
|
470
|
+
cell?: string;
|
|
471
|
+
}
|
|
472
|
+
/** What the controller reads from its workspace. */
|
|
473
|
+
interface WorkspaceReplayHost {
|
|
474
|
+
cells(): ReadonlyArray<{
|
|
475
|
+
readonly id: string;
|
|
476
|
+
readonly chart: Vela;
|
|
477
|
+
}>;
|
|
478
|
+
activeId(): string | null;
|
|
479
|
+
onCells(handler: (e: {
|
|
480
|
+
kind: 'created' | 'destroyed' | 'active';
|
|
481
|
+
id: string;
|
|
482
|
+
}) => void): () => void;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The workspace's bar-replay control surface (`workspace.replay`, `ctx.replay` for
|
|
486
|
+
* contributions): the same verbs as `chart.replay`, applied to every cell on a shared
|
|
487
|
+
* clock. A step moves the clock to the next bar close on ANY chart, and each chart reveals
|
|
488
|
+
* the bars closed by then — so the finest timeframe sets the pace and a coarser chart
|
|
489
|
+
* shows its bar when it completes. Cells added while replaying join at the shared time; a
|
|
490
|
+
* cell switching symbol rejoins once its new bars load; a timeframe switch keeps the
|
|
491
|
+
* cell's place. The replay ends on every chart together: `stop()`, or any chart reaching
|
|
492
|
+
* its last bar. In a multi-chart layout bars are revealed whole (tick replay needs a
|
|
493
|
+
* single-chart layout).
|
|
494
|
+
*/
|
|
495
|
+
declare class WorkspaceReplay {
|
|
496
|
+
private readonly host;
|
|
497
|
+
private readonly bus;
|
|
498
|
+
/** The running session: the shared replay time (every chart shows the bars closed by it). */
|
|
499
|
+
private session;
|
|
500
|
+
private playing;
|
|
501
|
+
private intervalMs;
|
|
502
|
+
private timer;
|
|
503
|
+
/** Cells whose replay a symbol switch ended — restarted at the shared time once their bars land. */
|
|
504
|
+
private readonly rejoining;
|
|
505
|
+
private readonly cellSubs;
|
|
506
|
+
private readonly offHost;
|
|
507
|
+
/** Inside a group step: chart events are the controller's own doing. */
|
|
508
|
+
private stepping;
|
|
509
|
+
/** Inside `finish`: the charts' `replay:end` events are the controller's own doing. */
|
|
510
|
+
private stopping;
|
|
511
|
+
/** Driving a chart's own timer: its play/pause events are not the user's. */
|
|
512
|
+
private muted;
|
|
513
|
+
/** A chart finished during a group step — the session ends right after it. */
|
|
514
|
+
private finishedDuringStep;
|
|
515
|
+
constructor(host: WorkspaceReplayHost);
|
|
516
|
+
/**
|
|
517
|
+
* Enter replay on every cell (or seek, when already replaying) — paused. Resolves once
|
|
518
|
+
* every chart shows its rewound history (a chart whose history does not reach that far
|
|
519
|
+
* loads older bars first). A chart with nothing to replay after the shared time stays
|
|
520
|
+
* as it is.
|
|
521
|
+
*/
|
|
522
|
+
start(opts: WorkspaceReplayStartOptions): Promise<void>;
|
|
523
|
+
/** Reveal the next bar(s): the clock moves to the next bar close on any chart. Returns false when nothing is left. */
|
|
524
|
+
step(): boolean;
|
|
525
|
+
/** Reveal the next update — in a single-chart layout, the chart's `stepUpdate()` (tick replay); otherwise {@link step}. */
|
|
526
|
+
stepUpdate(): boolean;
|
|
527
|
+
/** Advance one update every `intervalMs` (default: the last pace, initially 1000). Calling it again while playing changes the pace. */
|
|
528
|
+
play(intervalMs?: number): this;
|
|
529
|
+
pause(): this;
|
|
530
|
+
/** Leave replay on every chart: full history back, live updates resumed. */
|
|
531
|
+
stop(): this;
|
|
532
|
+
/** `active`/`playing`/`intervalMs` for the whole workspace; the cursor fields read the ACTIVE cell's chart. */
|
|
533
|
+
get state(): ReplayState;
|
|
534
|
+
/** The active cell's replayable history (`chart.replay.bounds`). */
|
|
535
|
+
get bounds(): ReplayBounds | null;
|
|
536
|
+
on<K extends keyof WorkspaceReplayEventMap>(event: K, handler: (payload: WorkspaceReplayEventMap[K]) => void): () => void;
|
|
537
|
+
destroy(): void;
|
|
538
|
+
/** The one chart of a single-chart layout — it replays on its own, tick replay included. */
|
|
539
|
+
private solo;
|
|
540
|
+
private activeChart;
|
|
541
|
+
/** Rewind one chart to the shared time: every bar that closed by `clock`, none after. */
|
|
542
|
+
private startCell;
|
|
543
|
+
/** Move the clock to the next bar close on any chart; each chart reveals what closed by then. */
|
|
544
|
+
private stepGroup;
|
|
545
|
+
/** Put the timers in the state `playing` asks for: a single chart runs its own (it paces
|
|
546
|
+
* ticks), several run on the controller's clock. */
|
|
547
|
+
private syncPlayback;
|
|
548
|
+
private schedule;
|
|
549
|
+
private clearTimer;
|
|
550
|
+
/** End the session on every chart (idempotent). */
|
|
551
|
+
private finish;
|
|
552
|
+
private watch;
|
|
553
|
+
private onCellCreated;
|
|
554
|
+
private onCellDestroyed;
|
|
555
|
+
}
|
|
556
|
+
/** When a bar opened at `open` closes on `timeframe` — calendar months for month-based ones. */
|
|
557
|
+
declare function barClose(open: number, timeframe: string | undefined): number;
|
|
558
|
+
/** The latest open whose bar has closed by `time` on `timeframe` (the inverse of {@link barClose}). */
|
|
559
|
+
declare function lastOpenClosedBy(time: number, timeframe: string | undefined): number;
|
|
560
|
+
|
|
449
561
|
/** The extended context a workspace hands to contributed actions/attachments. */
|
|
450
562
|
interface WorkspaceWidgetContext extends WidgetContext {
|
|
451
563
|
/** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
|
|
@@ -459,6 +571,9 @@ interface WorkspaceWidgetContext extends WidgetContext {
|
|
|
459
571
|
/** LIVE getter — follows every active-cell switch. */
|
|
460
572
|
activeCellId: string;
|
|
461
573
|
setActiveCell(id: string): void;
|
|
574
|
+
/** Bar replay across every cell on one clock (`workspace.replay`) — drive this rather
|
|
575
|
+
* than one cell's `chart.replay`, so every chart replays together. */
|
|
576
|
+
replay: WorkspaceReplay;
|
|
462
577
|
}
|
|
463
578
|
|
|
464
579
|
/** One registered workspace layout. */
|
|
@@ -619,7 +734,10 @@ declare class VelaWorkspace {
|
|
|
619
734
|
readonly root: HTMLElement;
|
|
620
735
|
/** The shortcut system — one manager for the whole workspace, routed to the active cell. */
|
|
621
736
|
readonly keymap: KeymapManager;
|
|
737
|
+
/** Bar replay across every cell on one clock (see {@link WorkspaceReplay}). */
|
|
738
|
+
readonly replay: WorkspaceReplay;
|
|
622
739
|
private readonly gridEl;
|
|
740
|
+
private readonly stripsEl;
|
|
623
741
|
private readonly events;
|
|
624
742
|
private readonly feed;
|
|
625
743
|
private readonly cellsById;
|
|
@@ -1036,6 +1154,8 @@ declare class VelaWorkspace {
|
|
|
1036
1154
|
private openTimeframeDrawer;
|
|
1037
1155
|
private openDrawingsDrawer;
|
|
1038
1156
|
private openMoreDrawer;
|
|
1157
|
+
/** The contributed topbar actions the mobile menu lists, from one cluster. */
|
|
1158
|
+
private drawerActions;
|
|
1039
1159
|
private openTimezoneDrawer;
|
|
1040
1160
|
private openPriceScaleDrawer;
|
|
1041
1161
|
/** The aggregated alerts bell — entries carry their cell; selecting one activates it. */
|
|
@@ -1075,4 +1195,4 @@ declare function resizeTracks(weights: readonly number[], index: number, deltaPx
|
|
|
1075
1195
|
*/
|
|
1076
1196
|
declare function trackOffsets(weights: readonly number[], sizePx: number, gapPx: number): number[];
|
|
1077
1197
|
|
|
1078
|
-
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, type WorkspaceScriptRun, WorkspaceState, type WorkspaceStorage, type WorkspaceWidgetContext, activeAfterLayout, ensureLayout, evenTracks, gridStyles, layoutDefinition, layoutForGrid, layoutShape, layouts, memoryStorageAdapter, rangesWithin, registerBuiltinLayouts, registerLayout, resizeTracks, syncTargets, trackOffsets, unregisterLayout };
|
|
1198
|
+
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 };
|
package/dist/workspace.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ChartCell, GRID_PICKER_MAX, VelaWorkspace, activeAfterLayout, decodeState, encodeState, ensureLayout, evenTracks, gridStyles, 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-E3GU6AUI.js';
|
|
2
|
+
import './chunk-QBPUT5SU.js';
|
|
3
|
+
import './chunk-EZ5FWVLA.js';
|
|
4
|
+
import './chunk-KA77UTRF.js';
|
|
5
|
+
import './chunk-2IAETM2I.js';
|
|
6
|
+
import './chunk-BZQM2XO7.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.8.0",
|
|
4
4
|
"description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charting library",
|