@luxalgo/vela 0.6.14 → 0.6.16

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 (51) hide show
  1. package/NOTICE +28 -28
  2. package/README.md +9 -2
  3. package/dist/{DataProvider-DhzstpQb.d.ts → DataProvider-XLdJB86x.d.ts} +1 -1
  4. package/dist/{DataProvider-DlMtrwqM.d.cts → DataProvider-xH2VBcFT.d.cts} +1 -1
  5. package/dist/{chunk-KG4YT3TI.js → chunk-6DPAYEGO.js} +8 -1
  6. package/dist/chunk-FE6V2YAQ.js +1 -0
  7. package/dist/{chunk-N2Q5EEFH.js → chunk-GIJYO4LO.js} +2596 -242
  8. package/dist/{chunk-F4M24ANM.js → chunk-I77F2SVE.js} +80 -4
  9. package/dist/{chunk-MHY7MVXH.js → chunk-MGU3USTP.js} +29 -16
  10. package/dist/{chunk-G77Y7LK2.js → chunk-Q3TFJNJW.js} +2 -2
  11. package/dist/{chunk-64TF7JAJ.js → chunk-SEOO6YG7.js} +408 -184
  12. package/dist/{contributions-lPojhTxI.d.cts → contributions-BEkxwA5F.d.cts} +40 -13
  13. package/dist/{contributions-37nni40G.d.ts → contributions-CoAX7_SF.d.ts} +40 -13
  14. package/dist/index.cjs +2755 -380
  15. package/dist/index.d.cts +20 -12
  16. package/dist/index.d.ts +20 -12
  17. package/dist/index.js +5 -5
  18. package/dist/{options-CYS5Wmlx.d.ts → options-bdSAtp7y.d.cts} +5 -0
  19. package/dist/{options-CYS5Wmlx.d.cts → options-bdSAtp7y.d.ts} +5 -0
  20. package/dist/{plugin-DHyaoMjW.d.ts → plugin-CNUgbRNq.d.ts} +11 -8
  21. package/dist/{plugin-Cwikpz1m.d.cts → plugin-Dxyq35Zf.d.cts} +11 -8
  22. package/dist/plugin.cjs +8 -0
  23. package/dist/plugin.d.cts +5 -5
  24. package/dist/plugin.d.ts +5 -5
  25. package/dist/plugin.js +3 -3
  26. package/dist/providers/binance.d.cts +2 -2
  27. package/dist/providers/binance.d.ts +2 -2
  28. package/dist/providers/coinbase.d.cts +2 -2
  29. package/dist/providers/coinbase.d.ts +2 -2
  30. package/dist/providers/hyperliquid.d.cts +2 -2
  31. package/dist/providers/hyperliquid.d.ts +2 -2
  32. package/dist/{side-panel-CT9ZwIGz.d.cts → side-panel-HF0IAzwf.d.cts} +17 -0
  33. package/dist/{side-panel-CT9ZwIGz.d.ts → side-panel-HF0IAzwf.d.ts} +17 -0
  34. package/dist/{statusline-model-D-q_OOx9.d.ts → statusline-model-CbPza-Wc.d.cts} +6 -4
  35. package/dist/{statusline-model-CiJm-riV.d.cts → statusline-model-D7cWkw8A.d.ts} +6 -4
  36. package/dist/ui.cjs +34 -15
  37. package/dist/ui.d.cts +1 -1
  38. package/dist/ui.d.ts +1 -1
  39. package/dist/ui.js +3 -3
  40. package/dist/vela.global.js +2675 -300
  41. package/dist/vela.global.min.js +58 -52
  42. package/dist/widget.cjs +3296 -622
  43. package/dist/widget.d.cts +15 -11
  44. package/dist/widget.d.ts +15 -11
  45. package/dist/widget.js +7 -7
  46. package/dist/workspace.cjs +3296 -622
  47. package/dist/workspace.d.cts +49 -19
  48. package/dist/workspace.d.ts +49 -19
  49. package/dist/workspace.js +6 -6
  50. package/package.json +1 -1
  51. package/dist/chunk-H26BEHF4.js +0 -7
@@ -1,5 +1,5 @@
1
- import { u as Millis, ai as InputSchema, ag as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, au as PaneAxis, aH as SeriesSpec, ae as Fill, B as Background, az as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, aa as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aW as PaneInfo, ad as DrawingsOption, a7 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, at as MarketSwitch, as as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CYS5Wmlx.cjs';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-DlMtrwqM.cjs';
1
+ import { u as Millis, ai as InputSchema, ag as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, au as PaneAxis, aH as SeriesSpec, ae as Fill, B as Background, az as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, aa as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aW as PaneInfo, ad as DrawingsOption, a7 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, at as MarketSwitch, as as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-bdSAtp7y.cjs';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-xH2VBcFT.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -286,6 +286,9 @@ interface IndicatorHandle {
286
286
  * (core-computed) indicator — there is no script to show. What a host editor
287
287
  * opens when a legend action asks for "the code behind this row". */
288
288
  readonly source?: string;
289
+ /** The registered type of a NATIVE (core-computed) indicator — `undefined` for a
290
+ * script indicator. The two are exclusive: a handle has a `source` or a `nativeType`. */
291
+ readonly nativeType?: string;
289
292
  /** Inputs parsed from the Pine source (populated once the script is prepared). */
290
293
  readonly inputs: readonly InputSchema[];
291
294
  /** Declaration-props schema (a strategy's `initial_capital`, an indicator's
@@ -499,6 +502,13 @@ interface NativeIndicatorDescriptor {
499
502
  readonly reactsToViewport?: boolean;
500
503
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
501
504
  readonly beta?: boolean;
505
+ /**
506
+ * Allow several instances of this type on one chart — every add creates a new one (a study
507
+ * like a moving average is typically stacked at different lengths). Absent ⇒ SINGLE instance
508
+ * per type: a second add returns the existing handle. A type that pushes a bespoke layer
509
+ * payload through `pushData` must stay single-instance (the layer is keyed by type).
510
+ */
511
+ readonly multiInstance?: boolean;
502
512
  inputsSchema(): InputSchema[];
503
513
  defaultInputs(): Record<string, InputValue>;
504
514
  create(): NativeIndicator;
@@ -510,8 +520,8 @@ interface NativeIndicatorDescriptor {
510
520
  }
511
521
  /**
512
522
  * One entry in the "add native indicator" catalog: the type's static metadata plus its live state
513
- * on a specific chart — whether it applies to the current symbol (`supported`) and whether an
514
- * instance is already present (`present`, since natives are single-instance per type). Produced by
523
+ * on a specific chart — whether it applies to the current symbol (`supported`) and whether at
524
+ * least one instance is already present (`present`). Produced by
515
525
  * `chart.availableNativeIndicators()`.
516
526
  */
517
527
  interface NativeIndicatorInfo {
@@ -519,8 +529,11 @@ interface NativeIndicatorInfo {
519
529
  readonly title: string;
520
530
  /** Applies to the current symbol (a type may need data the provider lacks). */
521
531
  readonly supported: boolean;
522
- /** An instance is already on the chart (a second add is a no-op). */
532
+ /** At least one instance is on the chart. For a single-instance type a second add is a no-op;
533
+ * a `multiInstance` type adds another instance regardless. */
523
534
  readonly present: boolean;
535
+ /** The type allows several instances per chart (see `NativeIndicatorDescriptor.multiInstance`). */
536
+ readonly multiInstance?: boolean;
524
537
  /** The type is flagged beta (for a badge in the picker). */
525
538
  readonly beta?: boolean;
526
539
  }
@@ -916,6 +929,12 @@ declare class RendererControl {
916
929
  * doesn't support it (warns). DOM overlays (tables, legend) are not included.
917
930
  */
918
931
  screenshot(): string | null;
932
+ /**
933
+ * Raster of the current chart onto a canvas (same pixels as {@link screenshot}),
934
+ * or null if the renderer has no canvas export. Silent — a host compositing
935
+ * several charts skips a renderer that cannot contribute.
936
+ */
937
+ screenshotCanvas(): HTMLCanvasElement | null;
919
938
  /**
920
939
  * The active renderer's full cosmetic config as a serializable, versioned JSON
921
940
  * document — persist it (templates, saved settings) and feed it back to
@@ -1338,23 +1357,26 @@ declare class Vela {
1338
1357
  addIndicator(source: string, options?: AddIndicatorOptions): IndicatorHandle;
1339
1358
  /**
1340
1359
  * Add a built-in NATIVE indicator (core-computed, no scripting engine) by registered `type` —
1341
- * e.g. `'vpvr'`. It becomes a first-class indicator (legend row, settings, hide, remove,
1342
- * events) and is single-instance per type (a second call returns the existing handle). Returns
1343
- * a fail-soft handle for an unregistered type. Native renderer only.
1360
+ * e.g. `'vpvr'` or `'sma'`. It becomes a first-class indicator (legend row, settings, hide,
1361
+ * remove, events). Layer-backed types (`'volume'`, `'vpvr'`) are single-instance — a second
1362
+ * call returns the existing handle; the classic studies allow several instances, so each call
1363
+ * adds one more. Returns a fail-soft handle for an unregistered type. Native renderer only.
1344
1364
  */
1345
1365
  addNativeIndicator(type: string, options?: {
1346
1366
  inputs?: Record<string, InputValue>;
1347
1367
  }): IndicatorHandle;
1348
1368
  /**
1349
1369
  * The catalog of built-in native indicators with their live state on this chart — each entry's
1350
- * `type`, `title`, whether it `supported`s the current symbol, and whether it's already `present`
1351
- * (native indicators are single-instance per type, so a second `addNativeIndicator` is a no-op).
1352
- * Lets a host "add indicator" UI list them, gate unsupported ones, and avoid duplicates. Async
1353
- * because support may probe the provider (a type may need data the symbol lacks).
1370
+ * `type`, `title`, whether it `supported`s the current symbol, whether it's already `present`,
1371
+ * and whether it allows several instances (`multiInstance`; otherwise a second
1372
+ * `addNativeIndicator` is a no-op). Lets a host "add indicator" UI list them, gate unsupported
1373
+ * ones, and de-duplicate the single-instance ones. Async because support may probe the
1374
+ * provider (a type may need data the symbol lacks).
1354
1375
  */
1355
1376
  availableNativeIndicators(): Promise<NativeIndicatorInfo[]>;
1356
1377
  /**
1357
- * The native-indicator types PRESENT on the chart right now — the synchronous slice of
1378
+ * The native-indicator types PRESENT on the chart right now, one entry per instance (a
1379
+ * multi-instance type repeats) — the synchronous slice of
1358
1380
  * {@link availableNativeIndicators} (only support probing is async; presence never is).
1359
1381
  * Persistence snapshots read this: an unload-time flush must see an add/remove that
1360
1382
  * happened microseconds ago, which an async catalog mirror cannot guarantee.
@@ -1624,6 +1646,11 @@ interface SidePanelDescriptor {
1624
1646
  resizable?: boolean;
1625
1647
  minWidth?: number;
1626
1648
  maxWidth?: number;
1649
+ /** Float over the chart's right edge instead of docking beside it: the chart keeps its
1650
+ * width and layout, and the panel covers its right-hand part (default false — a docked
1651
+ * column that shrinks the chart). For panels wide enough that a column would crush
1652
+ * the plot. The dock stays exclusive either way. */
1653
+ overlay?: boolean;
1627
1654
  mount(ctx: WidgetContext, body: HTMLElement, header: SidePanelHeader): SidePanelHandle | void;
1628
1655
  }
1629
1656
  /** One panel toggle, as the shell's chrome consumes it (data, never DOM). */
@@ -1,5 +1,5 @@
1
- import { u as Millis, ai as InputSchema, ag as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, au as PaneAxis, aH as SeriesSpec, ae as Fill, B as Background, az as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, aa as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aW as PaneInfo, ad as DrawingsOption, a7 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, at as MarketSwitch, as as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CYS5Wmlx.js';
2
- import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-DhzstpQb.js';
1
+ import { u as Millis, ai as InputSchema, ag as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, au as PaneAxis, aH as SeriesSpec, ae as Fill, B as Background, az as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, aa as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aW as PaneInfo, ad as DrawingsOption, a7 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, at as MarketSwitch, as as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-bdSAtp7y.js';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-XLdJB86x.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -286,6 +286,9 @@ interface IndicatorHandle {
286
286
  * (core-computed) indicator — there is no script to show. What a host editor
287
287
  * opens when a legend action asks for "the code behind this row". */
288
288
  readonly source?: string;
289
+ /** The registered type of a NATIVE (core-computed) indicator — `undefined` for a
290
+ * script indicator. The two are exclusive: a handle has a `source` or a `nativeType`. */
291
+ readonly nativeType?: string;
289
292
  /** Inputs parsed from the Pine source (populated once the script is prepared). */
290
293
  readonly inputs: readonly InputSchema[];
291
294
  /** Declaration-props schema (a strategy's `initial_capital`, an indicator's
@@ -499,6 +502,13 @@ interface NativeIndicatorDescriptor {
499
502
  readonly reactsToViewport?: boolean;
500
503
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
501
504
  readonly beta?: boolean;
505
+ /**
506
+ * Allow several instances of this type on one chart — every add creates a new one (a study
507
+ * like a moving average is typically stacked at different lengths). Absent ⇒ SINGLE instance
508
+ * per type: a second add returns the existing handle. A type that pushes a bespoke layer
509
+ * payload through `pushData` must stay single-instance (the layer is keyed by type).
510
+ */
511
+ readonly multiInstance?: boolean;
502
512
  inputsSchema(): InputSchema[];
503
513
  defaultInputs(): Record<string, InputValue>;
504
514
  create(): NativeIndicator;
@@ -510,8 +520,8 @@ interface NativeIndicatorDescriptor {
510
520
  }
511
521
  /**
512
522
  * One entry in the "add native indicator" catalog: the type's static metadata plus its live state
513
- * on a specific chart — whether it applies to the current symbol (`supported`) and whether an
514
- * instance is already present (`present`, since natives are single-instance per type). Produced by
523
+ * on a specific chart — whether it applies to the current symbol (`supported`) and whether at
524
+ * least one instance is already present (`present`). Produced by
515
525
  * `chart.availableNativeIndicators()`.
516
526
  */
517
527
  interface NativeIndicatorInfo {
@@ -519,8 +529,11 @@ interface NativeIndicatorInfo {
519
529
  readonly title: string;
520
530
  /** Applies to the current symbol (a type may need data the provider lacks). */
521
531
  readonly supported: boolean;
522
- /** An instance is already on the chart (a second add is a no-op). */
532
+ /** At least one instance is on the chart. For a single-instance type a second add is a no-op;
533
+ * a `multiInstance` type adds another instance regardless. */
523
534
  readonly present: boolean;
535
+ /** The type allows several instances per chart (see `NativeIndicatorDescriptor.multiInstance`). */
536
+ readonly multiInstance?: boolean;
524
537
  /** The type is flagged beta (for a badge in the picker). */
525
538
  readonly beta?: boolean;
526
539
  }
@@ -916,6 +929,12 @@ declare class RendererControl {
916
929
  * doesn't support it (warns). DOM overlays (tables, legend) are not included.
917
930
  */
918
931
  screenshot(): string | null;
932
+ /**
933
+ * Raster of the current chart onto a canvas (same pixels as {@link screenshot}),
934
+ * or null if the renderer has no canvas export. Silent — a host compositing
935
+ * several charts skips a renderer that cannot contribute.
936
+ */
937
+ screenshotCanvas(): HTMLCanvasElement | null;
919
938
  /**
920
939
  * The active renderer's full cosmetic config as a serializable, versioned JSON
921
940
  * document — persist it (templates, saved settings) and feed it back to
@@ -1338,23 +1357,26 @@ declare class Vela {
1338
1357
  addIndicator(source: string, options?: AddIndicatorOptions): IndicatorHandle;
1339
1358
  /**
1340
1359
  * Add a built-in NATIVE indicator (core-computed, no scripting engine) by registered `type` —
1341
- * e.g. `'vpvr'`. It becomes a first-class indicator (legend row, settings, hide, remove,
1342
- * events) and is single-instance per type (a second call returns the existing handle). Returns
1343
- * a fail-soft handle for an unregistered type. Native renderer only.
1360
+ * e.g. `'vpvr'` or `'sma'`. It becomes a first-class indicator (legend row, settings, hide,
1361
+ * remove, events). Layer-backed types (`'volume'`, `'vpvr'`) are single-instance — a second
1362
+ * call returns the existing handle; the classic studies allow several instances, so each call
1363
+ * adds one more. Returns a fail-soft handle for an unregistered type. Native renderer only.
1344
1364
  */
1345
1365
  addNativeIndicator(type: string, options?: {
1346
1366
  inputs?: Record<string, InputValue>;
1347
1367
  }): IndicatorHandle;
1348
1368
  /**
1349
1369
  * The catalog of built-in native indicators with their live state on this chart — each entry's
1350
- * `type`, `title`, whether it `supported`s the current symbol, and whether it's already `present`
1351
- * (native indicators are single-instance per type, so a second `addNativeIndicator` is a no-op).
1352
- * Lets a host "add indicator" UI list them, gate unsupported ones, and avoid duplicates. Async
1353
- * because support may probe the provider (a type may need data the symbol lacks).
1370
+ * `type`, `title`, whether it `supported`s the current symbol, whether it's already `present`,
1371
+ * and whether it allows several instances (`multiInstance`; otherwise a second
1372
+ * `addNativeIndicator` is a no-op). Lets a host "add indicator" UI list them, gate unsupported
1373
+ * ones, and de-duplicate the single-instance ones. Async because support may probe the
1374
+ * provider (a type may need data the symbol lacks).
1354
1375
  */
1355
1376
  availableNativeIndicators(): Promise<NativeIndicatorInfo[]>;
1356
1377
  /**
1357
- * The native-indicator types PRESENT on the chart right now — the synchronous slice of
1378
+ * The native-indicator types PRESENT on the chart right now, one entry per instance (a
1379
+ * multi-instance type repeats) — the synchronous slice of
1358
1380
  * {@link availableNativeIndicators} (only support probing is async; presence never is).
1359
1381
  * Persistence snapshots read this: an unload-time flush must see an add/remove that
1360
1382
  * happened microseconds ago, which an async catalog mirror cannot guarantee.
@@ -1624,6 +1646,11 @@ interface SidePanelDescriptor {
1624
1646
  resizable?: boolean;
1625
1647
  minWidth?: number;
1626
1648
  maxWidth?: number;
1649
+ /** Float over the chart's right edge instead of docking beside it: the chart keeps its
1650
+ * width and layout, and the panel covers its right-hand part (default false — a docked
1651
+ * column that shrinks the chart). For panels wide enough that a column would crush
1652
+ * the plot. The dock stays exclusive either way. */
1653
+ overlay?: boolean;
1627
1654
  mount(ctx: WidgetContext, body: HTMLElement, header: SidePanelHeader): SidePanelHandle | void;
1628
1655
  }
1629
1656
  /** One panel toggle, as the shell's chrome consumes it (data, never DOM). */