@luxalgo/vela 0.6.7 → 0.6.8

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.
@@ -1,8 +1,8 @@
1
1
  import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BaVTMXaO.cjs';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './bottombar-Div5zibZ.cjs';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './bottombar-Div5zibZ.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-DqzBqy42.cjs';
3
+ export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-DqzBqy42.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-Hv4_cOJo.cjs';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-Vw-Hm58R.cjs';
6
6
  import { M as MarketDataFeed } from './DataProvider-BsQM2WNH.cjs';
7
7
 
8
8
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
@@ -54,6 +54,14 @@ type CellBoot = PooledCellState & Pick<CellSeed, 'data' | 'visibleRange'>;
54
54
  * market/view seeds (those flow through {@link CellSeed}), and `drawings`' toolbar
55
55
  * sub-key (see {@link cellDrawings}). */
56
56
  type CellChartDefaults = Pick<VelaOptions, 'renderer' | 'defaultLanguage' | 'currentPriceLine' | 'logScale' | 'animations' | 'glow' | 'upColor' | 'downColor' | 'drawings' | 'settings'>;
57
+ /** A cell's Status line tab prefs as one bundle — the segment toggles (null when the
58
+ * shell runs without status lines) plus the indicator legend's titles/values. What
59
+ * the workspace's STYLE link mirrors across same-group cells. */
60
+ interface CellStatusPrefs {
61
+ parts: Record<StatuslinePart, boolean> | null;
62
+ indicatorTitles: boolean;
63
+ indicatorValues: boolean;
64
+ }
57
65
  /** One entry of the shared indicator picker's native catalog, per cell. */
58
66
  interface CellNativeInfo {
59
67
  type: string;
@@ -99,6 +107,8 @@ interface CellDeps {
99
107
  onPriceStyleChanged(id: string): void;
100
108
  /** The cell's indicator ledger changed (count/picker refresh upstream). */
101
109
  onIndicatorsChanged(id: string): void;
110
+ /** A Status line tab pref changed on this cell (the style link mirrors upstream). */
111
+ onStatusPrefsChanged(id: string): void;
102
112
  /** Persistable per-cell state changed outside the market/indicator channels
103
113
  * (bars budget, watermark/titles toggles) — the workspace debounces a save. */
104
114
  onStateDirty(): void;
@@ -187,8 +197,9 @@ declare class ChartCell {
187
197
  /** Switch this cell's shown session in place (a reload — RTH and ETH are different bars). */
188
198
  setSession(session: MarketSession): void;
189
199
  private refreshSessionAvailable;
190
- /** (Re)derive the pre/post-market shading bands for this cell's market. The loaded
191
- * depth (bars × timeframe) bounds the calendar fetch; the tracker clamps it. */
200
+ /** (Re)derive the pre/post-market shading bands for this cell's market. The bands
201
+ * expand locally from the symbol's session vocabulary, so they paint as soon as
202
+ * metadata is known and follow any pan depth without provider round trips. */
192
203
  private refreshSessionShading;
193
204
  /** The session-shade colors live in the renderer CONFIG (persisted with it, edited
194
205
  * live by the dialog swatch) — the cell only proxies them into its settings rows. */
@@ -209,6 +220,14 @@ declare class ChartCell {
209
220
  setIndicatorTitlesVisible(visible: boolean): void;
210
221
  /** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
211
222
  setIndicatorValuesVisible(visible: boolean): void;
223
+ /** Show/hide one status-line segment (the settings dialog's Status line tab). */
224
+ private setStatuslinePart;
225
+ /** This cell's Status line tab prefs as one bundle (see {@link CellStatusPrefs}). */
226
+ statusPrefs(): CellStatusPrefs;
227
+ /** Converge this cell's Status line tab prefs to `prefs` — the follower half of
228
+ * the workspace's style link. Idempotent: matching values change nothing, so a
229
+ * propagated echo dies on its own. */
230
+ applyStatusPrefs(prefs: CellStatusPrefs): void;
212
231
  /** The LIVE chart of this cell — never cache it across a layout change (the cell's
213
232
  * identity is what endures; the chart dies with the cell). */
214
233
  get chart(): Vela;
@@ -336,13 +355,15 @@ declare class ChartCell {
336
355
 
337
356
  /** The extended context a workspace hands to contributed actions/attachments. */
338
357
  interface WorkspaceWidgetContext extends WidgetContext {
339
- /** Every live cell (layout order) — id + LIVE chart + market snapshot. */
358
+ /** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
359
+ * (fresh array per read): read it at the point of use, never keep the array. */
340
360
  cells: ReadonlyArray<{
341
361
  id: string;
342
362
  chart: Vela;
343
363
  symbol: string;
344
364
  timeframe: string;
345
365
  }>;
366
+ /** LIVE getter — follows every active-cell switch. */
346
367
  activeCellId: string;
347
368
  setActiveCell(id: string): void;
348
369
  }
@@ -454,8 +475,9 @@ interface VelaWorkspaceOptions extends Omit<VelaOptions, 'height'>, VelaShellOpt
454
475
  /** Sync links between cells: per kind, `true` = all cells, or a `{cellId: group}`
455
476
  * record (only same-group cells follow each other). `crosshair` mirrors the
456
477
  * pointer time as ghost crosshairs on the followers (also toggleable from the
457
- * layout dropdown); `drawings` copies each newly created drawing onto the
458
- * followers and keeps the set linked edits and removals follow (also
478
+ * layout dropdown); `style` mirrors Canvas, Scales-and-lines, and Status line
479
+ * settings (same dropdown); `drawings` copies each newly created drawing onto
480
+ * the followers and keeps the set linked — edits and removals follow (also
459
481
  * toggleable from the shared drawing toolbar). Default: everything off.
460
482
  * Change at runtime via `ws.sync.set(kind, setting)`. */
461
483
  sync?: SyncOptions;
@@ -563,6 +585,10 @@ declare class VelaWorkspace {
563
585
  /** Same guard for the drawings link: the propagated mutations' own `drawing:*`
564
586
  * events fire synchronously inside the propagation loop and must not fan out again. */
565
587
  private drawingSyncBusy;
588
+ /** Same guard for the style link: a follower's `applyConfig` re-fires its
589
+ * `onConfigChanged` in the same tick, and a state restore applies per-cell
590
+ * configs that legitimately differ — neither must propagate. */
591
+ private styleSyncBusy;
566
592
  /** LINKED drawings (the drawings sync): one map per synced set (cellId → that
567
593
  * cell's drawing id), reachable from every member under its `cellId\0drawingId`
568
594
  * key — any member finds its peers to push edits/removals onto. Survives a
@@ -710,6 +736,24 @@ declare class VelaWorkspace {
710
736
  * cell's whole life, so these live and die with the cell). */
711
737
  private wireCell;
712
738
  private applySyncSetting;
739
+ /**
740
+ * Align cells minted by a layout change to their style group: with the link on, a
741
+ * NEW cell (fresh slot or one returning from the pool, which missed edits while
742
+ * dormant) inherits the presentation of a pre-existing group peer — the active
743
+ * cell when it is one — instead of sitting on its own state beside a styled
744
+ * group. Propagation runs FROM the peer, so a newborn's defaults never overwrite
745
+ * the group, and the equality short-circuits keep converged peers untouched.
746
+ */
747
+ private alignNewCellStyles;
748
+ /**
749
+ * Mirror an origin cell's presentation — the Canvas + Scales-and-lines slice of
750
+ * its renderer config plus its Status line tab prefs — onto its same-group
751
+ * followers (the style link). Loop-safe two ways: the busy guard eats the
752
+ * followers' SYNCHRONOUS echoes (their `applyConfig` re-fires `onConfigChanged`
753
+ * in the same tick), and the equality short-circuits leave already-converged
754
+ * followers untouched, so nothing re-emits once the group agrees.
755
+ */
756
+ private propagateStylePrefs;
713
757
  /**
714
758
  * Mirror an origin cell's pointer time onto its same-group followers as GHOST
715
759
  * crosshairs (`renderer.setExternalCrosshair`). The horizontal price level rides
@@ -1,8 +1,8 @@
1
1
  import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend, d as MarketSession } from './options-BaVTMXaO.js';
2
- import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './bottombar-Br4rzx_R.js';
3
- export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './bottombar-Br4rzx_R.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-CGkB2EOo.js';
3
+ export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-CGkB2EOo.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-Z12BrWCy.js';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-DLLdV9jD.js';
6
6
  import { M as MarketDataFeed } from './DataProvider-BSLlBpB9.js';
7
7
 
8
8
  /** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
@@ -54,6 +54,14 @@ type CellBoot = PooledCellState & Pick<CellSeed, 'data' | 'visibleRange'>;
54
54
  * market/view seeds (those flow through {@link CellSeed}), and `drawings`' toolbar
55
55
  * sub-key (see {@link cellDrawings}). */
56
56
  type CellChartDefaults = Pick<VelaOptions, 'renderer' | 'defaultLanguage' | 'currentPriceLine' | 'logScale' | 'animations' | 'glow' | 'upColor' | 'downColor' | 'drawings' | 'settings'>;
57
+ /** A cell's Status line tab prefs as one bundle — the segment toggles (null when the
58
+ * shell runs without status lines) plus the indicator legend's titles/values. What
59
+ * the workspace's STYLE link mirrors across same-group cells. */
60
+ interface CellStatusPrefs {
61
+ parts: Record<StatuslinePart, boolean> | null;
62
+ indicatorTitles: boolean;
63
+ indicatorValues: boolean;
64
+ }
57
65
  /** One entry of the shared indicator picker's native catalog, per cell. */
58
66
  interface CellNativeInfo {
59
67
  type: string;
@@ -99,6 +107,8 @@ interface CellDeps {
99
107
  onPriceStyleChanged(id: string): void;
100
108
  /** The cell's indicator ledger changed (count/picker refresh upstream). */
101
109
  onIndicatorsChanged(id: string): void;
110
+ /** A Status line tab pref changed on this cell (the style link mirrors upstream). */
111
+ onStatusPrefsChanged(id: string): void;
102
112
  /** Persistable per-cell state changed outside the market/indicator channels
103
113
  * (bars budget, watermark/titles toggles) — the workspace debounces a save. */
104
114
  onStateDirty(): void;
@@ -187,8 +197,9 @@ declare class ChartCell {
187
197
  /** Switch this cell's shown session in place (a reload — RTH and ETH are different bars). */
188
198
  setSession(session: MarketSession): void;
189
199
  private refreshSessionAvailable;
190
- /** (Re)derive the pre/post-market shading bands for this cell's market. The loaded
191
- * depth (bars × timeframe) bounds the calendar fetch; the tracker clamps it. */
200
+ /** (Re)derive the pre/post-market shading bands for this cell's market. The bands
201
+ * expand locally from the symbol's session vocabulary, so they paint as soon as
202
+ * metadata is known and follow any pan depth without provider round trips. */
192
203
  private refreshSessionShading;
193
204
  /** The session-shade colors live in the renderer CONFIG (persisted with it, edited
194
205
  * live by the dialog swatch) — the cell only proxies them into its settings rows. */
@@ -209,6 +220,14 @@ declare class ChartCell {
209
220
  setIndicatorTitlesVisible(visible: boolean): void;
210
221
  /** Show/hide the plot values beside this cell's legend titles (persisted per cell). */
211
222
  setIndicatorValuesVisible(visible: boolean): void;
223
+ /** Show/hide one status-line segment (the settings dialog's Status line tab). */
224
+ private setStatuslinePart;
225
+ /** This cell's Status line tab prefs as one bundle (see {@link CellStatusPrefs}). */
226
+ statusPrefs(): CellStatusPrefs;
227
+ /** Converge this cell's Status line tab prefs to `prefs` — the follower half of
228
+ * the workspace's style link. Idempotent: matching values change nothing, so a
229
+ * propagated echo dies on its own. */
230
+ applyStatusPrefs(prefs: CellStatusPrefs): void;
212
231
  /** The LIVE chart of this cell — never cache it across a layout change (the cell's
213
232
  * identity is what endures; the chart dies with the cell). */
214
233
  get chart(): Vela;
@@ -336,13 +355,15 @@ declare class ChartCell {
336
355
 
337
356
  /** The extended context a workspace hands to contributed actions/attachments. */
338
357
  interface WorkspaceWidgetContext extends WidgetContext {
339
- /** Every live cell (layout order) — id + LIVE chart + market snapshot. */
358
+ /** Every live cell (layout order) — id + LIVE chart + its market. A LIVE getter
359
+ * (fresh array per read): read it at the point of use, never keep the array. */
340
360
  cells: ReadonlyArray<{
341
361
  id: string;
342
362
  chart: Vela;
343
363
  symbol: string;
344
364
  timeframe: string;
345
365
  }>;
366
+ /** LIVE getter — follows every active-cell switch. */
346
367
  activeCellId: string;
347
368
  setActiveCell(id: string): void;
348
369
  }
@@ -454,8 +475,9 @@ interface VelaWorkspaceOptions extends Omit<VelaOptions, 'height'>, VelaShellOpt
454
475
  /** Sync links between cells: per kind, `true` = all cells, or a `{cellId: group}`
455
476
  * record (only same-group cells follow each other). `crosshair` mirrors the
456
477
  * pointer time as ghost crosshairs on the followers (also toggleable from the
457
- * layout dropdown); `drawings` copies each newly created drawing onto the
458
- * followers and keeps the set linked edits and removals follow (also
478
+ * layout dropdown); `style` mirrors Canvas, Scales-and-lines, and Status line
479
+ * settings (same dropdown); `drawings` copies each newly created drawing onto
480
+ * the followers and keeps the set linked — edits and removals follow (also
459
481
  * toggleable from the shared drawing toolbar). Default: everything off.
460
482
  * Change at runtime via `ws.sync.set(kind, setting)`. */
461
483
  sync?: SyncOptions;
@@ -563,6 +585,10 @@ declare class VelaWorkspace {
563
585
  /** Same guard for the drawings link: the propagated mutations' own `drawing:*`
564
586
  * events fire synchronously inside the propagation loop and must not fan out again. */
565
587
  private drawingSyncBusy;
588
+ /** Same guard for the style link: a follower's `applyConfig` re-fires its
589
+ * `onConfigChanged` in the same tick, and a state restore applies per-cell
590
+ * configs that legitimately differ — neither must propagate. */
591
+ private styleSyncBusy;
566
592
  /** LINKED drawings (the drawings sync): one map per synced set (cellId → that
567
593
  * cell's drawing id), reachable from every member under its `cellId\0drawingId`
568
594
  * key — any member finds its peers to push edits/removals onto. Survives a
@@ -710,6 +736,24 @@ declare class VelaWorkspace {
710
736
  * cell's whole life, so these live and die with the cell). */
711
737
  private wireCell;
712
738
  private applySyncSetting;
739
+ /**
740
+ * Align cells minted by a layout change to their style group: with the link on, a
741
+ * NEW cell (fresh slot or one returning from the pool, which missed edits while
742
+ * dormant) inherits the presentation of a pre-existing group peer — the active
743
+ * cell when it is one — instead of sitting on its own state beside a styled
744
+ * group. Propagation runs FROM the peer, so a newborn's defaults never overwrite
745
+ * the group, and the equality short-circuits keep converged peers untouched.
746
+ */
747
+ private alignNewCellStyles;
748
+ /**
749
+ * Mirror an origin cell's presentation — the Canvas + Scales-and-lines slice of
750
+ * its renderer config plus its Status line tab prefs — onto its same-group
751
+ * followers (the style link). Loop-safe two ways: the busy guard eats the
752
+ * followers' SYNCHRONOUS echoes (their `applyConfig` re-fires `onConfigChanged`
753
+ * in the same tick), and the equality short-circuits leave already-converged
754
+ * followers untouched, so nothing re-emits once the group agrees.
755
+ */
756
+ private propagateStylePrefs;
713
757
  /**
714
758
  * Mirror an origin cell's pointer time onto its same-group followers as GHOST
715
759
  * crosshairs (`renderer.setExternalCrosshair`). The horizontal price level rides
package/dist/workspace.js CHANGED
@@ -1,5 +1,5 @@
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-WVP4XV5A.js';
2
- import './chunk-6WFKTAT4.js';
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-N7LGMKCE.js';
2
+ import './chunk-SQETIBFU.js';
3
3
  import './chunk-L3I2CCYO.js';
4
4
  import './chunk-2R7BANEM.js';
5
5
  import './chunk-OICPLNU7.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxalgo/vela",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://luxalgo.com/vela",