@luxalgo/vela 0.7.0 → 0.7.2

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 (45) hide show
  1. package/dist/{DataProvider-Bu9E5Zh5.d.ts → DataProvider-BALR0qPq.d.ts} +1 -1
  2. package/dist/{DataProvider-Ck2qyS_9.d.cts → DataProvider-D5uMiJYz.d.cts} +1 -1
  3. package/dist/{chunk-IFJJPXSV.js → chunk-BFA32GOU.js} +44 -16
  4. package/dist/{chunk-CZRNTHD6.js → chunk-BKHSQ4YM.js} +129 -125
  5. package/dist/{chunk-A4G64KVF.js → chunk-PTNO3YK2.js} +311 -111
  6. package/dist/{chunk-A347YL2P.js → chunk-QBWLINWL.js} +67 -9
  7. package/dist/{chunk-UHXG5J7C.js → chunk-ZADTVRUO.js} +1 -1
  8. package/dist/{contributions-BjQ7hyIx.d.ts → contributions-BbhbZd3c.d.ts} +31 -9
  9. package/dist/{contributions-Cv2Mutvn.d.cts → contributions-CcBFe-91.d.cts} +31 -9
  10. package/dist/index.cjs +391 -157
  11. package/dist/index.d.cts +52 -17
  12. package/dist/index.d.ts +52 -17
  13. package/dist/index.js +4 -4
  14. package/dist/{options-ex2_gtKp.d.ts → options-C7b_Qssu.d.cts} +42 -1
  15. package/dist/{options-ex2_gtKp.d.cts → options-C7b_Qssu.d.ts} +42 -1
  16. package/dist/{plugin-CiyhU7pi.d.ts → plugin-Cnix5ZBh.d.ts} +6 -4
  17. package/dist/{plugin-absNH7Yn.d.cts → plugin-D6MlX4--.d.cts} +6 -4
  18. package/dist/plugin.cjs +39 -15
  19. package/dist/plugin.d.cts +4 -4
  20. package/dist/plugin.d.ts +4 -4
  21. package/dist/plugin.js +2 -2
  22. package/dist/providers/binance.d.cts +2 -2
  23. package/dist/providers/binance.d.ts +2 -2
  24. package/dist/providers/coinbase.d.cts +2 -2
  25. package/dist/providers/coinbase.d.ts +2 -2
  26. package/dist/providers/hyperliquid.d.cts +2 -2
  27. package/dist/providers/hyperliquid.d.ts +2 -2
  28. package/dist/{statusline-model-BXoU4Kua.d.ts → statusline-model-D8NL7o4L.d.ts} +3 -3
  29. package/dist/{statusline-model-cRhPBLPO.d.cts → statusline-model-DUKt7_TQ.d.cts} +3 -3
  30. package/dist/ui.cjs +8 -4
  31. package/dist/ui.d.cts +10 -7
  32. package/dist/ui.d.ts +10 -7
  33. package/dist/ui.js +2 -2
  34. package/dist/vela.global.js +391 -157
  35. package/dist/vela.global.min.js +70 -70
  36. package/dist/widget.cjs +418 -128
  37. package/dist/widget.d.cts +6 -6
  38. package/dist/widget.d.ts +6 -6
  39. package/dist/widget.js +6 -6
  40. package/dist/workspace.cjs +418 -128
  41. package/dist/workspace.d.cts +39 -6
  42. package/dist/workspace.d.ts +39 -6
  43. package/dist/workspace.js +5 -5
  44. package/package.json +1 -1
  45. /package/dist/{chunk-FE6V2YAQ.js → chunk-JU4CWEBF.js} +0 -0
@@ -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-ex2_gtKp.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-cRhPBLPO.cjs';
3
- export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-cRhPBLPO.cjs';
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-C7b_Qssu.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-DUKt7_TQ.cjs';
3
+ export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-DUKt7_TQ.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-Cv2Mutvn.cjs';
6
- import { M as MarketDataFeed } from './DataProvider-Ck2qyS_9.cjs';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-CcBFe-91.cjs';
6
+ import { M as MarketDataFeed } from './DataProvider-D5uMiJYz.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[];
@@ -285,7 +285,8 @@ declare class ChartCell {
285
285
  * the workspace flips this with the layout (see Statusline.setFitMode). */
286
286
  setStatuslineFit(on: boolean): void;
287
287
  /** The workspace shell keeps the app theme; the cell host's tokens re-derive from
288
- * the LIVE plot surface (see {@link applyPlotOverlayTokens}). */
288
+ * the LIVE plot surface for overlay ink (statusline, watermark). Menus portal to
289
+ * `.vela-ui` and keep the app-theme surface (see {@link applyPlotOverlayTokens}). */
289
290
  private syncPlotOverlayTokens;
290
291
  /**
291
292
  * Frame a bottombar range chip: switch to its timeframe, fetch the depth its window
@@ -655,6 +656,17 @@ declare class VelaWorkspace {
655
656
  private readonly persistKey;
656
657
  private readonly storage;
657
658
  private stateTimer;
659
+ /** Re-entrance guard for {@link flushPendingState}: a `state:changed` subscriber that
660
+ * calls back into the workspace (`destroy()` on save is the obvious one) must not
661
+ * re-enter the flush and recurse. */
662
+ private emitting;
663
+ /** False until the constructor finishes. Boot is not an edit: seeding the sync
664
+ * settings marks state dirty, so without this a workspace mounted and torn down
665
+ * inside the debounce window would flush and tell the host the user had changed
666
+ * something — a save of the default document over whatever was stored. */
667
+ private booted;
668
+ /** A page unload gets the same flush as a teardown — the pending edit reaches the
669
+ * host, the timer is cleared, and a `destroy()` that follows adds no second write. */
658
670
  private readonly onUnload;
659
671
  /** Re-entrance guard around one propagation tick: followers' synchronous echoes
660
672
  * (their setVisibleRange re-emits viewport:changed) must not re-propagate. */
@@ -834,6 +846,27 @@ declare class VelaWorkspace {
834
846
  /** Debounced dirty mark: one `state:changed` (+ one storage write in persist mode)
835
847
  * per burst of edits, flushed hard on unload/destroy. */
836
848
  private markStateDirty;
849
+ /**
850
+ * Push a pending debounced change out NOW, for a teardown or a page unload — the
851
+ * two moments the 500ms timer would otherwise never reach.
852
+ *
853
+ * Dropping it was a silent data loss: the timer carries BOTH halves of the dirty
854
+ * signal — the `state:changed` event and the storage write — so a host that saves
855
+ * from that event (a server-backed host, where `persistNow` is a no-op for want of
856
+ * a `persistKey`) simply never heard about the user's last edit.
857
+ *
858
+ * Idempotent and re-entrancy safe, which the ordering here buys:
859
+ * - a no-op unless a timer is actually pending, so a teardown with nothing
860
+ * outstanding stays silent and never invents an edit;
861
+ * - the timer is cleared FIRST, so nothing survives this call and a second call
862
+ * does nothing — `destroy()` after an unload flush adds no second write;
863
+ * - the state is snapshotted BEFORE the handlers run, and that snapshot is what
864
+ * gets persisted, so storage and the host are told the same thing even if a
865
+ * handler mutates state while it runs;
866
+ * - `emitting` is held across the emit, so a handler calling back in (a host that
867
+ * tears down on save is the obvious one) cannot re-enter this and recurse.
868
+ */
869
+ private flushPendingState;
837
870
  /** Write the current state through the storage adapter now (fire-and-forget). */
838
871
  private persistNow;
839
872
  private resolveLayout;
@@ -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-ex2_gtKp.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-BXoU4Kua.js';
3
- export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-BXoU4Kua.js';
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-C7b_Qssu.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-D8NL7o4L.js';
3
+ export { g as ChartState, P as PanelsState, h as decodeState, i as encodeState, s as sanitizeState } from './statusline-model-D8NL7o4L.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-BjQ7hyIx.js';
6
- import { M as MarketDataFeed } from './DataProvider-Bu9E5Zh5.js';
5
+ import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, E as ExternalIndicatorEntry, a as ScriptRun } from './contributions-BbhbZd3c.js';
6
+ import { M as MarketDataFeed } from './DataProvider-BALR0qPq.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[];
@@ -285,7 +285,8 @@ declare class ChartCell {
285
285
  * the workspace flips this with the layout (see Statusline.setFitMode). */
286
286
  setStatuslineFit(on: boolean): void;
287
287
  /** The workspace shell keeps the app theme; the cell host's tokens re-derive from
288
- * the LIVE plot surface (see {@link applyPlotOverlayTokens}). */
288
+ * the LIVE plot surface for overlay ink (statusline, watermark). Menus portal to
289
+ * `.vela-ui` and keep the app-theme surface (see {@link applyPlotOverlayTokens}). */
289
290
  private syncPlotOverlayTokens;
290
291
  /**
291
292
  * Frame a bottombar range chip: switch to its timeframe, fetch the depth its window
@@ -655,6 +656,17 @@ declare class VelaWorkspace {
655
656
  private readonly persistKey;
656
657
  private readonly storage;
657
658
  private stateTimer;
659
+ /** Re-entrance guard for {@link flushPendingState}: a `state:changed` subscriber that
660
+ * calls back into the workspace (`destroy()` on save is the obvious one) must not
661
+ * re-enter the flush and recurse. */
662
+ private emitting;
663
+ /** False until the constructor finishes. Boot is not an edit: seeding the sync
664
+ * settings marks state dirty, so without this a workspace mounted and torn down
665
+ * inside the debounce window would flush and tell the host the user had changed
666
+ * something — a save of the default document over whatever was stored. */
667
+ private booted;
668
+ /** A page unload gets the same flush as a teardown — the pending edit reaches the
669
+ * host, the timer is cleared, and a `destroy()` that follows adds no second write. */
658
670
  private readonly onUnload;
659
671
  /** Re-entrance guard around one propagation tick: followers' synchronous echoes
660
672
  * (their setVisibleRange re-emits viewport:changed) must not re-propagate. */
@@ -834,6 +846,27 @@ declare class VelaWorkspace {
834
846
  /** Debounced dirty mark: one `state:changed` (+ one storage write in persist mode)
835
847
  * per burst of edits, flushed hard on unload/destroy. */
836
848
  private markStateDirty;
849
+ /**
850
+ * Push a pending debounced change out NOW, for a teardown or a page unload — the
851
+ * two moments the 500ms timer would otherwise never reach.
852
+ *
853
+ * Dropping it was a silent data loss: the timer carries BOTH halves of the dirty
854
+ * signal — the `state:changed` event and the storage write — so a host that saves
855
+ * from that event (a server-backed host, where `persistNow` is a no-op for want of
856
+ * a `persistKey`) simply never heard about the user's last edit.
857
+ *
858
+ * Idempotent and re-entrancy safe, which the ordering here buys:
859
+ * - a no-op unless a timer is actually pending, so a teardown with nothing
860
+ * outstanding stays silent and never invents an edit;
861
+ * - the timer is cleared FIRST, so nothing survives this call and a second call
862
+ * does nothing — `destroy()` after an unload flush adds no second write;
863
+ * - the state is snapshotted BEFORE the handlers run, and that snapshot is what
864
+ * gets persisted, so storage and the host are told the same thing even if a
865
+ * handler mutates state while it runs;
866
+ * - `emitting` is held across the emit, so a handler calling back in (a host that
867
+ * tears down on save is the obvious one) cannot re-enter this and recurse.
868
+ */
869
+ private flushPendingState;
837
870
  /** Write the current state through the storage adapter now (fire-and-forget). */
838
871
  private persistNow;
839
872
  private resolveLayout;
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-A347YL2P.js';
2
- import './chunk-A4G64KVF.js';
3
- import './chunk-IFJJPXSV.js';
4
- import './chunk-UHXG5J7C.js';
5
- import './chunk-CZRNTHD6.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-QBWLINWL.js';
2
+ import './chunk-PTNO3YK2.js';
3
+ import './chunk-BFA32GOU.js';
4
+ import './chunk-ZADTVRUO.js';
5
+ import './chunk-BKHSQ4YM.js';
6
6
  import './chunk-CAFCLMPF.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.7.0",
3
+ "version": "0.7.2",
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",
File without changes