@luxalgo/vela 0.6.21 → 0.7.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.
Files changed (41) hide show
  1. package/dist/{DataProvider-Cb-2lC5O.d.ts → DataProvider-Bu9E5Zh5.d.ts} +1 -1
  2. package/dist/{DataProvider-UtWw2CgJ.d.cts → DataProvider-Ck2qyS_9.d.cts} +1 -1
  3. package/dist/{chunk-BRPFYKTT.js → chunk-A347YL2P.js} +30 -7
  4. package/dist/{chunk-TRZQQUTR.js → chunk-A4G64KVF.js} +1442 -126
  5. package/dist/{chunk-T5Z5YUCF.js → chunk-CZRNTHD6.js} +24 -2
  6. package/dist/{chunk-XCBJU674.js → chunk-UHXG5J7C.js} +1 -1
  7. package/dist/{contributions-D8HdlKmp.d.cts → contributions-BjQ7hyIx.d.ts} +108 -3
  8. package/dist/{contributions-FqIWhN4p.d.ts → contributions-Cv2Mutvn.d.cts} +108 -3
  9. package/dist/index.cjs +1465 -125
  10. package/dist/index.d.cts +76 -20
  11. package/dist/index.d.ts +76 -20
  12. package/dist/index.js +2 -2
  13. package/dist/{options-BCRmYALw.d.cts → options-ex2_gtKp.d.cts} +200 -12
  14. package/dist/{options-BCRmYALw.d.ts → options-ex2_gtKp.d.ts} +200 -12
  15. package/dist/{plugin-B4mnNAeh.d.ts → plugin-CiyhU7pi.d.ts} +3 -3
  16. package/dist/{plugin-Ccupy_BV.d.cts → plugin-absNH7Yn.d.cts} +3 -3
  17. package/dist/plugin.d.cts +4 -4
  18. package/dist/plugin.d.ts +4 -4
  19. package/dist/providers/binance.d.cts +2 -2
  20. package/dist/providers/binance.d.ts +2 -2
  21. package/dist/providers/coinbase.d.cts +2 -2
  22. package/dist/providers/coinbase.d.ts +2 -2
  23. package/dist/providers/hyperliquid.d.cts +2 -2
  24. package/dist/providers/hyperliquid.d.ts +2 -2
  25. package/dist/{statusline-model-CCP1zm_Z.d.ts → statusline-model-BXoU4Kua.d.ts} +8 -4
  26. package/dist/{statusline-model-E7CMw5pQ.d.cts → statusline-model-cRhPBLPO.d.cts} +8 -4
  27. package/dist/ui.cjs +24 -2
  28. package/dist/ui.d.cts +9 -3
  29. package/dist/ui.d.ts +9 -3
  30. package/dist/ui.js +2 -2
  31. package/dist/vela.global.js +1465 -125
  32. package/dist/vela.global.min.js +77 -53
  33. package/dist/widget.cjs +1490 -129
  34. package/dist/widget.d.cts +6 -6
  35. package/dist/widget.d.ts +6 -6
  36. package/dist/widget.js +5 -5
  37. package/dist/workspace.cjs +1490 -129
  38. package/dist/workspace.d.cts +8 -5
  39. package/dist/workspace.d.ts +8 -5
  40. package/dist/workspace.js +4 -4
  41. package/package.json +1 -1
@@ -525,7 +525,7 @@ function intersectRects(a, b) {
525
525
  return { left, top, right, bottom, width: right - left, height: bottom - top };
526
526
  }
527
527
  function placePopover(a) {
528
- let left = a.align === "end" ? a.trigger.right - a.pop.width : a.trigger.left;
528
+ let left = a.align === "end" ? a.trigger.right - a.pop.width : a.align === "center" ? a.trigger.left + a.trigger.width / 2 - a.pop.width / 2 : a.trigger.left;
529
529
  const below = a.trigger.bottom + a.gap;
530
530
  const above = a.trigger.top - a.pop.height - a.gap;
531
531
  const fitsBelow = below + a.pop.height <= a.clamp.bottom;
@@ -597,6 +597,8 @@ var Popover = class {
597
597
  this.onKey = null;
598
598
  this.onReflow = null;
599
599
  this.shown = false;
600
+ /** The pending removal of a fading-out shell; a show() that reuses the shell cancels it. */
601
+ this.leaveTimer = null;
600
602
  const doc = opts.trigger.ownerDocument;
601
603
  injectStyles(POPOVER_STYLE_ID, POPOVER_CSS, doc);
602
604
  this.trigger = opts.trigger;
@@ -604,6 +606,7 @@ var Popover = class {
604
606
  this.ctrl = popoverController(opts);
605
607
  this.boundary = opts.boundary ?? "viewport";
606
608
  this.theme = opts.theme;
609
+ this.fadeMs = Math.max(0, opts.fadeMs ?? 0);
607
610
  this.el = doc.createElement("div");
608
611
  this.el.className = "vela-popover vela-ui-layer" + (opts.className ? ` ${opts.className}` : "");
609
612
  this.el.dataset.position = this.ctrl.position;
@@ -627,11 +630,21 @@ var Popover = class {
627
630
  return;
628
631
  }
629
632
  if (open && open !== this) open.hide();
633
+ if (this.leaveTimer !== null) {
634
+ clearTimeout(this.leaveTimer);
635
+ this.leaveTimer = null;
636
+ }
630
637
  ensureUIHost(this.el, this.theme);
638
+ if (this.fadeMs > 0) {
639
+ this.el.style.transition = `opacity ${this.fadeMs}ms ease`;
640
+ this.el.style.opacity = "0";
641
+ this.el.style.pointerEvents = "";
642
+ }
631
643
  this.host.appendChild(this.el);
632
644
  this.shown = true;
633
645
  open = this;
634
646
  this.place();
647
+ if (this.fadeMs > 0) this.el.style.opacity = "1";
635
648
  const onOutside = (ev) => {
636
649
  const t = ev.target;
637
650
  if (this.el.contains(t) || this.trigger.contains(t)) return;
@@ -664,7 +677,16 @@ var Popover = class {
664
677
  this.onOutside = null;
665
678
  this.onKey = null;
666
679
  this.onReflow = null;
667
- this.el.remove();
680
+ if (this.fadeMs > 0) {
681
+ this.el.style.opacity = "0";
682
+ this.el.style.pointerEvents = "none";
683
+ this.leaveTimer = setTimeout(() => {
684
+ this.leaveTimer = null;
685
+ this.el.remove();
686
+ }, this.fadeMs);
687
+ } else {
688
+ this.el.remove();
689
+ }
668
690
  this.shown = false;
669
691
  if (open === this) open = null;
670
692
  this.ctrl.onClose?.();
@@ -1,4 +1,4 @@
1
- import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-T5Z5YUCF.js';
1
+ import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-CZRNTHD6.js';
2
2
  import { injectStyles } from './chunk-CAFCLMPF.js';
3
3
  import * as tooltip from '@zag-js/tooltip';
4
4
  import * as dialog from '@zag-js/dialog';
@@ -1,5 +1,5 @@
1
- import { u as Millis, aj as InputSchema, ah as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, av as PaneAxis, aI as SeriesSpec, af as Fill, B as Background, aA as PriceLine, a2 as DrawingLine, _ as DrawingBox, a1 as DrawingLabel, a6 as DrawingPolyline, a3 as DrawingLinefill, ab as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a4 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, aX as PaneInfo, ae as DrawingsOption, a8 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, au as MarketSwitch, at as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BCRmYALw.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-UtWw2CgJ.cjs';
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, aV 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, b8 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-ex2_gtKp.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-Bu9E5Zh5.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -503,6 +503,15 @@ interface NativeIndicatorDescriptor {
503
503
  readonly reactsToViewport?: boolean;
504
504
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
505
505
  readonly beta?: boolean;
506
+ /**
507
+ * Whether instances get in-chart chrome. Absent ⇒ a legend row like any indicator.
508
+ * `false` ⇒ the output paints, but there is NO legend row (no title chip, no eye/gear/✕,
509
+ * uncounted by the fold chip) and `panes.list()` does not report it — for host-owned
510
+ * overlays (trade markers, event flags) whose on/off lives in the host's own UI. Distinct
511
+ * from hidden: a legend-less indicator still computes and paints; the host controls it
512
+ * through its handle.
513
+ */
514
+ readonly legend?: boolean;
506
515
  /**
507
516
  * Allow several instances of this type on one chart — every add creates a new one (a study
508
517
  * like a moving average is typically stacked at different lengths). Absent ⇒ SINGLE instance
@@ -772,6 +781,9 @@ interface VelaEventMap extends Record<string, unknown> {
772
781
  "drawing:settings": {
773
782
  id: string;
774
783
  };
784
+ /** A timeline-mark glyph was clicked — `ids` lists every mark under it (a cluster). Fires
785
+ * before the popup opens; a mark without content opens none, so this is the host's hook. */
786
+ "mark:click": MarkClickEvent;
775
787
  /**
776
788
  * A SCRIPT computed — the first run over the history, a live tick, a new bar, an input
777
789
  * edit, a viewport move, a market switch. The payload carries the run itself (title,
@@ -1030,6 +1042,13 @@ declare class RendererControl {
1030
1042
  * `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
1031
1043
  * Silent no-op on a renderer without adaptive chrome. */
1032
1044
  setLayoutMode(mode: 'mobile' | 'desktop'): this;
1045
+ /**
1046
+ * Drive the renderer's time-of-day chrome (the countdown-to-bar-close chip) from the
1047
+ * host's own second pulse, so it ticks in step with a host clock display instead of
1048
+ * on a separate timer that can read a different second. `null` hands the pulse back
1049
+ * to the renderer. Silent no-op on a renderer without time-of-day chrome.
1050
+ */
1051
+ setWallClock(clock: WallClock | null): this;
1033
1052
  }
1034
1053
 
1035
1054
  /** Callback surface `PanesControl` uses to drive the orchestrator. */
@@ -1315,6 +1334,82 @@ declare class DrawingsControl {
1315
1334
  private ok;
1316
1335
  }
1317
1336
 
1337
+ /**
1338
+ * Renderer-agnostic owner of the timeline-mark model (backs `chart.marks`). Holds the
1339
+ * marks + group definitions (the source of truth), pushes snapshots to the renderer
1340
+ * through its optional `setTimelineMarks` seam, and re-emits the renderer's glyph
1341
+ * clicks as `mark:click`. Inert on a renderer without the `timelineMarks` capability —
1342
+ * the model still fills, so `all()` and a later host UI see it.
1343
+ */
1344
+ declare class MarksController {
1345
+ private readonly renderer;
1346
+ /** Insertion-ordered — the order a cluster falls back to for equal times. */
1347
+ private readonly marks;
1348
+ private readonly groups;
1349
+ private readonly enabled;
1350
+ private readonly subs;
1351
+ constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>);
1352
+ /** Whether the active renderer paints timeline marks. */
1353
+ get supported(): boolean;
1354
+ /** Add (or replace, by id) one mark. */
1355
+ add(mark: TimelineMark): void;
1356
+ /** Replace the whole set — a market switch. */
1357
+ set(marks: readonly TimelineMark[]): void;
1358
+ remove(id: string): boolean;
1359
+ clear(): void;
1360
+ /** Every mark, in insertion order (shallow copies — mutating one changes nothing). */
1361
+ all(): TimelineMark[];
1362
+ /** Define (or replace) a group's presentation — its settings label and default visibility. */
1363
+ defineGroup(group: MarkGroup): void;
1364
+ /** The defined groups, in definition order. */
1365
+ groupDefinitions(): MarkGroup[];
1366
+ /**
1367
+ * Show or hide one group's marks. The choice lives in the renderer's cosmetic config
1368
+ * (the `marks` feature) — what the settings dialog's Events checkboxes edit and what
1369
+ * a persisted chart restores — so it warns + no-ops on a renderer without it.
1370
+ */
1371
+ setGroupVisible(id: string, visible: boolean): void;
1372
+ /** A group's effective visibility: the user's (persisted) choice, else the group's declared default, else visible. */
1373
+ isGroupVisible(id: string): boolean;
1374
+ destroy(): void;
1375
+ private sync;
1376
+ }
1377
+
1378
+ /**
1379
+ * The chart's timeline-marks control surface (`chart.marks`) — sibling of
1380
+ * `chart.drawings` / `chart.panes`. Marks are DATA, not user state: the chart never
1381
+ * persists them; re-supply them when the market changes (`market:changed`). The model
1382
+ * is core-owned, so every method works on any renderer; on one without the
1383
+ * `timelineMarks` capability nothing paints (`supported` reports it) and the group
1384
+ * visibility setter warns + no-ops.
1385
+ */
1386
+ declare class MarksControl {
1387
+ private readonly ctrl;
1388
+ constructor(ctrl: MarksController);
1389
+ /** Whether the active renderer paints timeline marks. */
1390
+ get supported(): boolean;
1391
+ /** Add one mark; an existing id is replaced in place. */
1392
+ add(mark: TimelineMark): this;
1393
+ /** Replace the whole set (a market switch). */
1394
+ set(marks: readonly TimelineMark[]): this;
1395
+ remove(id: string): this;
1396
+ clear(): this;
1397
+ /** Every mark, in insertion order. */
1398
+ all(): TimelineMark[];
1399
+ /**
1400
+ * Define a visibility group's presentation: the label of its checkbox in chart
1401
+ * settings (the Events tab) and its default visibility. Marks may name a group
1402
+ * that was never defined — it then shows its capitalized id.
1403
+ */
1404
+ defineGroup(group: MarkGroup): this;
1405
+ /** The defined groups, in definition order. */
1406
+ groups(): MarkGroup[];
1407
+ /** Show or hide one group's marks — the same switch as the settings checkbox, persisted with the chart's config. */
1408
+ setGroupVisible(id: string, visible?: boolean): this;
1409
+ /** A group's effective visibility (the user's choice, else the group's declared default). */
1410
+ isGroupVisible(id: string): boolean;
1411
+ }
1412
+
1318
1413
  /** Outcome of {@link Vela.runIndicator}: success carries the live handle, failure the error. */
1319
1414
  interface RunIndicatorResult {
1320
1415
  ok: boolean;
@@ -1348,6 +1443,7 @@ declare class Vela {
1348
1443
  private readonly panesControl;
1349
1444
  private readonly dataControl;
1350
1445
  private readonly drawingsControl;
1446
+ private readonly marksControl;
1351
1447
  constructor(container: HTMLElement | string, options?: VelaOptions, deps?: VelaDeps);
1352
1448
  /**
1353
1449
  * Register a scripting engine so `addIndicator({ language })` can run that
@@ -1474,6 +1570,15 @@ declare class Vela {
1474
1570
  * `new Vela(el, { drawings: true })` or `chart.drawings.showToolbar()`.
1475
1571
  */
1476
1572
  get drawings(): DrawingsControl;
1573
+ /**
1574
+ * The chart's timeline-marks control surface: host events pinned to a bar and shown
1575
+ * as glyphs on a lane above the time axis, each opening a popup on click —
1576
+ * `chart.marks.add({ id, time, glyph, title, content })`, `chart.marks.set(list)`,
1577
+ * `chart.marks.defineGroup({ id, label })`. Marks are data, not user state: re-supply
1578
+ * them on `market:changed`. On a renderer without the `timelineMarks` capability the
1579
+ * model still fills but nothing paints (`chart.marks.supported`).
1580
+ */
1581
+ get marks(): MarksControl;
1477
1582
  on<K extends keyof VelaEventMap>(event: K, handler: (payload: VelaEventMap[K]) => void): () => void;
1478
1583
  /** The current visible time range (`from`/`to` in epoch-ms), or null before data loads. */
1479
1584
  getVisibleRange(): VisibleRange | null;
@@ -1886,4 +1991,4 @@ declare function unregisterDefaultEngine(language: string): void;
1886
1991
  * language. The shell layers (widget, workspace cell) register exactly this result. */
1887
1992
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
1888
1993
 
1889
- export { TypedEventBus as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, type SidePanelDescriptor as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelHandle as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHeader as T, type StatePersistenceHandler as U, Vela as V, type WidgetContext as W, type StrategyFill as X, type StrategyState as Y, type StrategyTrade as Z, type SymbolRankingHook as _, type ScriptRun as a, type VelaDeps as a0, type VelaEventMap as a1, type VisibleBarRange as a2, type WidgetActionDescriptor as a3, type WidgetActionTarget as a4, type WidgetAttachment as a5, getNativeIndicator as a6, legendActions as a7, legendCallouts as a8, nativeIndicatorDescriptors as a9, nativeIndicatorTypes as aa, registerDefaultEngine as ab, registerLegendAction as ac, registerLegendCallout as ad, registerNativeIndicator as ae, registerSidePanel as af, registerStatePersistence as ag, registerSymbolRanking as ah, registerWidgetAction as ai, registerWidgetAttachment as aj, resolveEngines as ak, sidePanels as al, statePersistenceHandlers as am, symbolRanking as an, topbarActionOverride as ao, unregisterDefaultEngine as ap, unregisterLegendAction as aq, unregisterLegendCallout as ar, unregisterNativeIndicator as as, unregisterSidePanel as at, unregisterStatePersistence as au, unregisterWidgetAction as av, unregisterWidgetAttachment as aw, widgetActions as ax, widgetAttachments as ay, DEFAULT_PANEL_ORDER as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };
1994
+ export { type SymbolRankingHook as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelDescriptor as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHandle as T, type SidePanelHeader as U, Vela as V, type WidgetContext as W, type StatePersistenceHandler as X, type StrategyFill as Y, type StrategyState as Z, type StrategyTrade as _, type ScriptRun as a, TypedEventBus as a0, type VelaDeps as a1, type VelaEventMap as a2, type VisibleBarRange as a3, type WidgetActionDescriptor as a4, type WidgetActionTarget as a5, type WidgetAttachment as a6, getNativeIndicator as a7, legendActions as a8, legendCallouts as a9, DEFAULT_PANEL_ORDER as aA, nativeIndicatorDescriptors as aa, nativeIndicatorTypes as ab, registerDefaultEngine as ac, registerLegendAction as ad, registerLegendCallout as ae, registerNativeIndicator as af, registerSidePanel as ag, registerStatePersistence as ah, registerSymbolRanking as ai, registerWidgetAction as aj, registerWidgetAttachment as ak, resolveEngines as al, sidePanels as am, statePersistenceHandlers as an, symbolRanking as ao, topbarActionOverride as ap, unregisterDefaultEngine as aq, unregisterLegendAction as ar, unregisterLegendCallout as as, unregisterNativeIndicator as at, unregisterSidePanel as au, unregisterStatePersistence as av, unregisterWidgetAction as aw, unregisterWidgetAttachment as ax, widgetActions as ay, widgetAttachments as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };
@@ -1,5 +1,5 @@
1
- import { u as Millis, aj as InputSchema, ah as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, av as PaneAxis, aI as SeriesSpec, af as Fill, B as Background, aA as PriceLine, a2 as DrawingLine, _ as DrawingBox, a1 as DrawingLabel, a6 as DrawingPolyline, a3 as DrawingLinefill, ab as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a4 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, aX as PaneInfo, ae as DrawingsOption, a8 as DrawingSeriesGateway, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, au as MarketSwitch, at as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-BCRmYALw.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-Cb-2lC5O.js';
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, aV 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, b8 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-ex2_gtKp.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-Ck2qyS_9.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -503,6 +503,15 @@ interface NativeIndicatorDescriptor {
503
503
  readonly reactsToViewport?: boolean;
504
504
  /** Marks the type as beta — surfaced in the catalog so a host "add indicator" UI can badge it. */
505
505
  readonly beta?: boolean;
506
+ /**
507
+ * Whether instances get in-chart chrome. Absent ⇒ a legend row like any indicator.
508
+ * `false` ⇒ the output paints, but there is NO legend row (no title chip, no eye/gear/✕,
509
+ * uncounted by the fold chip) and `panes.list()` does not report it — for host-owned
510
+ * overlays (trade markers, event flags) whose on/off lives in the host's own UI. Distinct
511
+ * from hidden: a legend-less indicator still computes and paints; the host controls it
512
+ * through its handle.
513
+ */
514
+ readonly legend?: boolean;
506
515
  /**
507
516
  * Allow several instances of this type on one chart — every add creates a new one (a study
508
517
  * like a moving average is typically stacked at different lengths). Absent ⇒ SINGLE instance
@@ -772,6 +781,9 @@ interface VelaEventMap extends Record<string, unknown> {
772
781
  "drawing:settings": {
773
782
  id: string;
774
783
  };
784
+ /** A timeline-mark glyph was clicked — `ids` lists every mark under it (a cluster). Fires
785
+ * before the popup opens; a mark without content opens none, so this is the host's hook. */
786
+ "mark:click": MarkClickEvent;
775
787
  /**
776
788
  * A SCRIPT computed — the first run over the history, a live tick, a new bar, an input
777
789
  * edit, a viewport move, a market switch. The payload carries the run itself (title,
@@ -1030,6 +1042,13 @@ declare class RendererControl {
1030
1042
  * `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
1031
1043
  * Silent no-op on a renderer without adaptive chrome. */
1032
1044
  setLayoutMode(mode: 'mobile' | 'desktop'): this;
1045
+ /**
1046
+ * Drive the renderer's time-of-day chrome (the countdown-to-bar-close chip) from the
1047
+ * host's own second pulse, so it ticks in step with a host clock display instead of
1048
+ * on a separate timer that can read a different second. `null` hands the pulse back
1049
+ * to the renderer. Silent no-op on a renderer without time-of-day chrome.
1050
+ */
1051
+ setWallClock(clock: WallClock | null): this;
1033
1052
  }
1034
1053
 
1035
1054
  /** Callback surface `PanesControl` uses to drive the orchestrator. */
@@ -1315,6 +1334,82 @@ declare class DrawingsControl {
1315
1334
  private ok;
1316
1335
  }
1317
1336
 
1337
+ /**
1338
+ * Renderer-agnostic owner of the timeline-mark model (backs `chart.marks`). Holds the
1339
+ * marks + group definitions (the source of truth), pushes snapshots to the renderer
1340
+ * through its optional `setTimelineMarks` seam, and re-emits the renderer's glyph
1341
+ * clicks as `mark:click`. Inert on a renderer without the `timelineMarks` capability —
1342
+ * the model still fills, so `all()` and a later host UI see it.
1343
+ */
1344
+ declare class MarksController {
1345
+ private readonly renderer;
1346
+ /** Insertion-ordered — the order a cluster falls back to for equal times. */
1347
+ private readonly marks;
1348
+ private readonly groups;
1349
+ private readonly enabled;
1350
+ private readonly subs;
1351
+ constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>);
1352
+ /** Whether the active renderer paints timeline marks. */
1353
+ get supported(): boolean;
1354
+ /** Add (or replace, by id) one mark. */
1355
+ add(mark: TimelineMark): void;
1356
+ /** Replace the whole set — a market switch. */
1357
+ set(marks: readonly TimelineMark[]): void;
1358
+ remove(id: string): boolean;
1359
+ clear(): void;
1360
+ /** Every mark, in insertion order (shallow copies — mutating one changes nothing). */
1361
+ all(): TimelineMark[];
1362
+ /** Define (or replace) a group's presentation — its settings label and default visibility. */
1363
+ defineGroup(group: MarkGroup): void;
1364
+ /** The defined groups, in definition order. */
1365
+ groupDefinitions(): MarkGroup[];
1366
+ /**
1367
+ * Show or hide one group's marks. The choice lives in the renderer's cosmetic config
1368
+ * (the `marks` feature) — what the settings dialog's Events checkboxes edit and what
1369
+ * a persisted chart restores — so it warns + no-ops on a renderer without it.
1370
+ */
1371
+ setGroupVisible(id: string, visible: boolean): void;
1372
+ /** A group's effective visibility: the user's (persisted) choice, else the group's declared default, else visible. */
1373
+ isGroupVisible(id: string): boolean;
1374
+ destroy(): void;
1375
+ private sync;
1376
+ }
1377
+
1378
+ /**
1379
+ * The chart's timeline-marks control surface (`chart.marks`) — sibling of
1380
+ * `chart.drawings` / `chart.panes`. Marks are DATA, not user state: the chart never
1381
+ * persists them; re-supply them when the market changes (`market:changed`). The model
1382
+ * is core-owned, so every method works on any renderer; on one without the
1383
+ * `timelineMarks` capability nothing paints (`supported` reports it) and the group
1384
+ * visibility setter warns + no-ops.
1385
+ */
1386
+ declare class MarksControl {
1387
+ private readonly ctrl;
1388
+ constructor(ctrl: MarksController);
1389
+ /** Whether the active renderer paints timeline marks. */
1390
+ get supported(): boolean;
1391
+ /** Add one mark; an existing id is replaced in place. */
1392
+ add(mark: TimelineMark): this;
1393
+ /** Replace the whole set (a market switch). */
1394
+ set(marks: readonly TimelineMark[]): this;
1395
+ remove(id: string): this;
1396
+ clear(): this;
1397
+ /** Every mark, in insertion order. */
1398
+ all(): TimelineMark[];
1399
+ /**
1400
+ * Define a visibility group's presentation: the label of its checkbox in chart
1401
+ * settings (the Events tab) and its default visibility. Marks may name a group
1402
+ * that was never defined — it then shows its capitalized id.
1403
+ */
1404
+ defineGroup(group: MarkGroup): this;
1405
+ /** The defined groups, in definition order. */
1406
+ groups(): MarkGroup[];
1407
+ /** Show or hide one group's marks — the same switch as the settings checkbox, persisted with the chart's config. */
1408
+ setGroupVisible(id: string, visible?: boolean): this;
1409
+ /** A group's effective visibility (the user's choice, else the group's declared default). */
1410
+ isGroupVisible(id: string): boolean;
1411
+ }
1412
+
1318
1413
  /** Outcome of {@link Vela.runIndicator}: success carries the live handle, failure the error. */
1319
1414
  interface RunIndicatorResult {
1320
1415
  ok: boolean;
@@ -1348,6 +1443,7 @@ declare class Vela {
1348
1443
  private readonly panesControl;
1349
1444
  private readonly dataControl;
1350
1445
  private readonly drawingsControl;
1446
+ private readonly marksControl;
1351
1447
  constructor(container: HTMLElement | string, options?: VelaOptions, deps?: VelaDeps);
1352
1448
  /**
1353
1449
  * Register a scripting engine so `addIndicator({ language })` can run that
@@ -1474,6 +1570,15 @@ declare class Vela {
1474
1570
  * `new Vela(el, { drawings: true })` or `chart.drawings.showToolbar()`.
1475
1571
  */
1476
1572
  get drawings(): DrawingsControl;
1573
+ /**
1574
+ * The chart's timeline-marks control surface: host events pinned to a bar and shown
1575
+ * as glyphs on a lane above the time axis, each opening a popup on click —
1576
+ * `chart.marks.add({ id, time, glyph, title, content })`, `chart.marks.set(list)`,
1577
+ * `chart.marks.defineGroup({ id, label })`. Marks are data, not user state: re-supply
1578
+ * them on `market:changed`. On a renderer without the `timelineMarks` capability the
1579
+ * model still fills but nothing paints (`chart.marks.supported`).
1580
+ */
1581
+ get marks(): MarksControl;
1477
1582
  on<K extends keyof VelaEventMap>(event: K, handler: (payload: VelaEventMap[K]) => void): () => void;
1478
1583
  /** The current visible time range (`from`/`to` in epoch-ms), or null before data loads. */
1479
1584
  getVisibleRange(): VisibleRange | null;
@@ -1886,4 +1991,4 @@ declare function unregisterDefaultEngine(language: string): void;
1886
1991
  * language. The shell layers (widget, workspace cell) register exactly this result. */
1887
1992
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
1888
1993
 
1889
- export { TypedEventBus as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, type SidePanelDescriptor as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelHandle as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHeader as T, type StatePersistenceHandler as U, Vela as V, type WidgetContext as W, type StrategyFill as X, type StrategyState as Y, type StrategyTrade as Z, type SymbolRankingHook as _, type ScriptRun as a, type VelaDeps as a0, type VelaEventMap as a1, type VisibleBarRange as a2, type WidgetActionDescriptor as a3, type WidgetActionTarget as a4, type WidgetAttachment as a5, getNativeIndicator as a6, legendActions as a7, legendCallouts as a8, nativeIndicatorDescriptors as a9, nativeIndicatorTypes as aa, registerDefaultEngine as ab, registerLegendAction as ac, registerLegendCallout as ad, registerNativeIndicator as ae, registerSidePanel as af, registerStatePersistence as ag, registerSymbolRanking as ah, registerWidgetAction as ai, registerWidgetAttachment as aj, resolveEngines as ak, sidePanels as al, statePersistenceHandlers as am, symbolRanking as an, topbarActionOverride as ao, unregisterDefaultEngine as ap, unregisterLegendAction as aq, unregisterLegendCallout as ar, unregisterNativeIndicator as as, unregisterSidePanel as at, unregisterStatePersistence as au, unregisterWidgetAction as av, unregisterWidgetAttachment as aw, widgetActions as ax, widgetAttachments as ay, DEFAULT_PANEL_ORDER as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };
1994
+ export { type SymbolRankingHook as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelDescriptor as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHandle as T, type SidePanelHeader as U, Vela as V, type WidgetContext as W, type StatePersistenceHandler as X, type StrategyFill as Y, type StrategyState as Z, type StrategyTrade as _, type ScriptRun as a, TypedEventBus as a0, type VelaDeps as a1, type VelaEventMap as a2, type VisibleBarRange as a3, type WidgetActionDescriptor as a4, type WidgetActionTarget as a5, type WidgetAttachment as a6, getNativeIndicator as a7, legendActions as a8, legendCallouts as a9, DEFAULT_PANEL_ORDER as aA, nativeIndicatorDescriptors as aa, nativeIndicatorTypes as ab, registerDefaultEngine as ac, registerLegendAction as ad, registerLegendCallout as ae, registerNativeIndicator as af, registerSidePanel as ag, registerStatePersistence as ah, registerSymbolRanking as ai, registerWidgetAction as aj, registerWidgetAttachment as ak, resolveEngines as al, sidePanels as am, statePersistenceHandlers as an, symbolRanking as ao, topbarActionOverride as ap, unregisterDefaultEngine as aq, unregisterLegendAction as ar, unregisterLegendCallout as as, unregisterNativeIndicator as at, unregisterSidePanel as au, unregisterStatePersistence as av, unregisterWidgetAction as aw, unregisterWidgetAttachment as ax, widgetActions as ay, widgetAttachments as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };