@luxalgo/vela 0.7.0 → 0.7.1
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-Bu9E5Zh5.d.ts → DataProvider-BALR0qPq.d.ts} +1 -1
- package/dist/{DataProvider-Ck2qyS_9.d.cts → DataProvider-D5uMiJYz.d.cts} +1 -1
- package/dist/{chunk-A4G64KVF.js → chunk-5RQGCZTX.js} +299 -110
- package/dist/{chunk-IFJJPXSV.js → chunk-BFA32GOU.js} +44 -16
- package/dist/{chunk-CZRNTHD6.js → chunk-BKHSQ4YM.js} +129 -125
- package/dist/{chunk-A347YL2P.js → chunk-QGVSNAX7.js} +67 -9
- package/dist/{chunk-UHXG5J7C.js → chunk-ZADTVRUO.js} +1 -1
- package/dist/{contributions-BjQ7hyIx.d.ts → contributions-BbhbZd3c.d.ts} +31 -9
- package/dist/{contributions-Cv2Mutvn.d.cts → contributions-CcBFe-91.d.cts} +31 -9
- package/dist/index.cjs +379 -156
- package/dist/index.d.cts +44 -17
- package/dist/index.d.ts +44 -17
- package/dist/index.js +4 -4
- package/dist/{options-ex2_gtKp.d.ts → options-C7b_Qssu.d.cts} +42 -1
- package/dist/{options-ex2_gtKp.d.cts → options-C7b_Qssu.d.ts} +42 -1
- package/dist/{plugin-CiyhU7pi.d.ts → plugin-Cnix5ZBh.d.ts} +6 -4
- package/dist/{plugin-absNH7Yn.d.cts → plugin-D6MlX4--.d.cts} +6 -4
- package/dist/plugin.cjs +39 -15
- 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-BXoU4Kua.d.ts → statusline-model-D8NL7o4L.d.ts} +3 -3
- package/dist/{statusline-model-cRhPBLPO.d.cts → statusline-model-DUKt7_TQ.d.cts} +3 -3
- package/dist/ui.cjs +8 -4
- package/dist/ui.d.cts +10 -7
- package/dist/ui.d.ts +10 -7
- package/dist/ui.js +2 -2
- package/dist/vela.global.js +379 -156
- package/dist/vela.global.min.js +70 -70
- package/dist/widget.cjs +406 -127
- package/dist/widget.d.cts +6 -6
- package/dist/widget.d.ts +6 -6
- package/dist/widget.js +6 -6
- package/dist/workspace.cjs +406 -127
- package/dist/workspace.d.cts +39 -6
- package/dist/workspace.d.ts +39 -6
- package/dist/workspace.js +5 -5
- package/package.json +1 -1
- /package/dist/{chunk-FE6V2YAQ.js → chunk-JU4CWEBF.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as Millis, an as InputSchema, al as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis,
|
|
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-
|
|
1
|
+
import { x as Millis, an as InputSchema, al as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, aW as SeriesSpec, aj as Fill, G as Background, aM as PriceLine, a6 as DrawingLine, a2 as DrawingBox, a5 as DrawingLabel, aa as DrawingPolyline, a7 as DrawingLinefill, af as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a8 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bc as PaneInfo, ai as DrawingsOption, ac as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, E as AddIndicatorOptions, aG as MarketSwitch, aF as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-C7b_Qssu.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-D5uMiJYz.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -282,9 +282,10 @@ interface IndicatorEventMap extends Record<string, unknown> {
|
|
|
282
282
|
interface IndicatorHandle {
|
|
283
283
|
readonly id: string;
|
|
284
284
|
readonly title: string;
|
|
285
|
-
/** The script source this indicator
|
|
286
|
-
*
|
|
287
|
-
*
|
|
285
|
+
/** The script source this indicator currently runs (the one it was added with,
|
|
286
|
+
* until {@link updateCode} replaces it). `undefined` for a NATIVE (core-computed)
|
|
287
|
+
* indicator — there is no script to show. What a host editor opens when a legend
|
|
288
|
+
* action asks for "the code behind this row". */
|
|
288
289
|
readonly source?: string;
|
|
289
290
|
/** The registered type of a NATIVE (core-computed) indicator — `undefined` for a
|
|
290
291
|
* script indicator. The two are exclusive: a handle has a `source` or a `nativeType`. */
|
|
@@ -309,6 +310,17 @@ interface IndicatorHandle {
|
|
|
309
310
|
setProp(key: string, value: InputValue): void;
|
|
310
311
|
/** Override several declaration props at once and re-run. */
|
|
311
312
|
setProps(values: Record<string, InputValue>): void;
|
|
313
|
+
/**
|
|
314
|
+
* Replace the script and re-run it **in place** — same `id`, same legend row, same
|
|
315
|
+
* pane placement, same handle; the seam for a host editor's "run my edit" and for a
|
|
316
|
+
* library's "update to the new version". The new source is prepared first: only once
|
|
317
|
+
* it compiles is the running script stopped and the new one started, so a broken edit
|
|
318
|
+
* leaves the current indicator computing and painting and reports through `error`.
|
|
319
|
+
* Input and prop values survive where the new script still declares their key;
|
|
320
|
+
* anything else takes the new declaration default. No-op for a native indicator and
|
|
321
|
+
* for an unchanged source.
|
|
322
|
+
*/
|
|
323
|
+
updateCode(source: string): void;
|
|
312
324
|
/**
|
|
313
325
|
* Hide or show the indicator. Hiding **suspends** it — its visuals are dropped (the legend
|
|
314
326
|
* row stays, marked hidden) and its computation stops (the engine session is torn down), so a
|
|
@@ -439,6 +451,10 @@ interface NativeIndicatorOutput {
|
|
|
439
451
|
}
|
|
440
452
|
/** Services the host gives a running native indicator. */
|
|
441
453
|
interface NativeIndicatorContext {
|
|
454
|
+
/** This instance's indicator id — the same id its `IndicatorHandle`, `inspect()` and
|
|
455
|
+
* the pane listing report. Lets an instance name itself to host code (a picker, a
|
|
456
|
+
* hit-test) and tell itself apart from siblings of a `multiInstance` type. */
|
|
457
|
+
readonly id: string;
|
|
442
458
|
readonly symbol: string;
|
|
443
459
|
readonly timeframe: string;
|
|
444
460
|
readonly live: boolean;
|
|
@@ -475,11 +491,13 @@ interface NativeIndicator {
|
|
|
475
491
|
onViewport(range: VisibleRange): void;
|
|
476
492
|
/** Settings changed — recompute + emit. */
|
|
477
493
|
setInputs(inputs: Record<string, InputValue>): void;
|
|
478
|
-
/** Hidden — stop timers/fetches (free resources); the instance + its state are kept for resume.
|
|
494
|
+
/** Hidden — stop timers/fetches (free resources); the instance + its state are kept for resume.
|
|
495
|
+
* Only ever called after `start` (an instance added hidden is not suspended — it is
|
|
496
|
+
* started when first shown). */
|
|
479
497
|
suspend(): void;
|
|
480
498
|
/** Shown again — resume + re-emit. */
|
|
481
499
|
resume(): void;
|
|
482
|
-
/** Removed — full teardown (clear caches, stop timers). */
|
|
500
|
+
/** Removed — full teardown (clear caches, stop timers). Only ever called after `start`. */
|
|
483
501
|
stop(): void;
|
|
484
502
|
}
|
|
485
503
|
/**
|
|
@@ -515,8 +533,10 @@ interface NativeIndicatorDescriptor {
|
|
|
515
533
|
/**
|
|
516
534
|
* Allow several instances of this type on one chart — every add creates a new one (a study
|
|
517
535
|
* like a moving average is typically stacked at different lengths). Absent ⇒ SINGLE instance
|
|
518
|
-
* per type: a second add returns the existing handle. A type that
|
|
519
|
-
*
|
|
536
|
+
* per type: a second add returns the existing handle. A type that paints through a renderer
|
|
537
|
+
* layer (`pushData`) gets ONE layer instance per indicator instance, each fed by that
|
|
538
|
+
* instance's own channel and painting on that instance's pane — so instances never
|
|
539
|
+
* overwrite each other (see `IndicatorModel.native.channel`).
|
|
520
540
|
*/
|
|
521
541
|
readonly multiInstance?: boolean;
|
|
522
542
|
inputsSchema(): InputSchema[];
|
|
@@ -574,6 +594,8 @@ type ScriptRunCause =
|
|
|
574
594
|
| 'bar'
|
|
575
595
|
/** An input was edited. */
|
|
576
596
|
| 'inputs'
|
|
597
|
+
/** The script's source was replaced in place (`handle.updateCode`). */
|
|
598
|
+
| 'code'
|
|
577
599
|
/** The visible range moved (viewport-aware scripts only). */
|
|
578
600
|
| 'viewport'
|
|
579
601
|
/** The chart's market changed and the script re-executed over the new bars. */
|