@luxalgo/vela 0.8.2 → 0.8.4

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 (48) hide show
  1. package/dist/{DataProvider-COGDs9Xg.d.cts → DataProvider-Bw58CjYy.d.cts} +1 -1
  2. package/dist/{DataProvider-DpOWZD8F.d.ts → DataProvider-Byo8pEv0.d.ts} +1 -1
  3. package/dist/{chunk-DPAA3SRT.js → chunk-ALTGHKIM.js} +836 -32
  4. package/dist/{chunk-27UTYE7T.js → chunk-AUOB7A5Y.js} +49 -7
  5. package/dist/{chunk-HKNO24GD.js → chunk-I2U4NZD2.js} +56 -1
  6. package/dist/{chunk-R2JMNIHY.js → chunk-MOJ4T26N.js} +341 -169
  7. package/dist/{chunk-T3DZIR5Y.js → chunk-UNUVPQFW.js} +2214 -886
  8. package/dist/{chunk-NLDTVFOI.js → chunk-WY5H4S4I.js} +129 -10
  9. package/dist/{contributions-Cgm9RJYP.d.cts → contributions-BY3zSYiZ.d.ts} +98 -7
  10. package/dist/{contributions-bWgwyiVi.d.ts → contributions-DOm40g5-.d.cts} +98 -7
  11. package/dist/index.cjs +3066 -893
  12. package/dist/index.d.cts +36 -22
  13. package/dist/index.d.ts +36 -22
  14. package/dist/index.js +5 -5
  15. package/dist/{options-NAUHiQEC.d.ts → options-CSXbjMM5.d.cts} +129 -4
  16. package/dist/{options-NAUHiQEC.d.cts → options-CSXbjMM5.d.ts} +129 -4
  17. package/dist/{plugin-CqxWoDKS.d.ts → plugin-BDxUhGO3.d.ts} +4 -4
  18. package/dist/{plugin-CjjzZX2F.d.cts → plugin-CiQVyETg.d.cts} +4 -4
  19. package/dist/plugin.cjs +573 -17
  20. package/dist/plugin.d.cts +5 -5
  21. package/dist/plugin.d.ts +5 -5
  22. package/dist/plugin.js +3 -3
  23. package/dist/providers/binance.d.cts +2 -2
  24. package/dist/providers/binance.d.ts +2 -2
  25. package/dist/providers/coinbase.d.cts +2 -2
  26. package/dist/providers/coinbase.d.ts +2 -2
  27. package/dist/providers/hyperliquid.d.cts +2 -2
  28. package/dist/providers/hyperliquid.d.ts +2 -2
  29. package/dist/{side-panel-wMNfgyZb.d.cts → side-panel-_2UK1gSm.d.cts} +45 -3
  30. package/dist/{side-panel-wMNfgyZb.d.ts → side-panel-_2UK1gSm.d.ts} +45 -3
  31. package/dist/{statusline-model-Dih6FGWP.d.ts → statusline-model-C9tYXuux.d.ts} +19 -4
  32. package/dist/{statusline-model-Dpfpq54A.d.cts → statusline-model-DUBX6Fib.d.cts} +19 -4
  33. package/dist/ui.cjs +224 -14
  34. package/dist/ui.d.cts +119 -87
  35. package/dist/ui.d.ts +119 -87
  36. package/dist/ui.js +3 -3
  37. package/dist/vela.global.js +3073 -900
  38. package/dist/vela.global.min.js +158 -54
  39. package/dist/widget.cjs +3640 -1119
  40. package/dist/widget.d.cts +24 -10
  41. package/dist/widget.d.ts +24 -10
  42. package/dist/widget.js +7 -7
  43. package/dist/workspace.cjs +3639 -1119
  44. package/dist/workspace.d.cts +61 -20
  45. package/dist/workspace.d.ts +61 -20
  46. package/dist/workspace.js +6 -6
  47. package/package.json +1 -1
  48. /package/dist/{chunk-JU4CWEBF.js → chunk-W5YPYZ2P.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { overlayScrollbarCss, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, injectStyles, announceSurface, iconAt, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-HKNO24GD.js';
1
+ import { overlayScrollbarCss, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, injectStyles, announceSurface, holdForExit, iconAt, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-I2U4NZD2.js';
2
2
  import { VanillaMachine, normalizeProps, spreadProps } from '@zag-js/vanilla';
3
3
  export { normalizeProps, spreadProps } from '@zag-js/vanilla';
4
4
  import * as menu from '@zag-js/menu';
@@ -226,6 +226,35 @@ var MENU_CSS = `
226
226
  color: var(--vela-fg-bright);
227
227
  }
228
228
  .vela-menu-item[data-checkmark] { color: var(--vela-fg-bright); }
229
+ /* Badge mode (iconBadges): the row icon sits in a rounded tile and the row grows to fit
230
+ it. An icon-less row of the same level keeps an invisible slot, so labels align. */
231
+ .vela-menu[data-badges] > .vela-menu-item { padding: 5px 10px 5px 6px; }
232
+ .vela-menu-item .vela-menu-badge {
233
+ width: 24px;
234
+ height: 24px;
235
+ padding: 3px;
236
+ flex: none;
237
+ box-sizing: border-box;
238
+ display: inline-flex;
239
+ align-items: center;
240
+ justify-content: center;
241
+ border-radius: var(--vela-radius-md);
242
+ background: var(--vela-hover);
243
+ border: 1px solid var(--vela-border);
244
+ color: var(--vela-fg-muted);
245
+ transition: background var(--vela-dur-fast) var(--vela-ease), border-color var(--vela-dur-fast) var(--vela-ease), color var(--vela-dur-fast) var(--vela-ease);
246
+ }
247
+ .vela-menu-item .vela-menu-badge:empty { background: transparent; border-color: transparent; }
248
+ .vela-menu-item .vela-menu-badge .vela-icon { color: inherit; }
249
+ .vela-menu-item[data-highlighted] .vela-menu-badge:not(:empty) { color: var(--vela-fg-bright); }
250
+ /* The selected tile inverts: a bright fill under the surface-colored glyph. After the
251
+ hover rule, so a selected row keeps its tile while highlighted. */
252
+ .vela-menu-item[data-checked] .vela-menu-badge:not(:empty),
253
+ .vela-menu-item[data-checkmark] .vela-menu-badge:not(:empty) {
254
+ background: color-mix(in srgb, var(--vela-fg-bright) 83%, var(--vela-surface));
255
+ border-color: color-mix(in srgb, var(--vela-fg-bright) 40%, transparent);
256
+ color: var(--vela-surface);
257
+ }
229
258
  /* Switch rows (boolean settings in a dropdown): a right-aligned toggle pill \u2014 the
230
259
  same control language as the settings dialog's toggles. */
231
260
  .vela-menu-switch {
@@ -292,11 +321,14 @@ var Surface = class _Surface {
292
321
  this.pinnedAnchor = null;
293
322
  /** The open state last announced — see {@link announce}. */
294
323
  this.shown = false;
324
+ /** The list's exit animation after a close; a reopen cancels it. */
325
+ this.exit = null;
295
326
  this.doc = doc;
296
327
  this.host = opts.host;
297
328
  this.onSelect = opts.onSelect;
298
329
  this.onFavorite = opts.onFavorite;
299
330
  this.checkmarks = opts.checkmarks === true;
331
+ this.iconBadges = opts.iconBadges === true;
300
332
  this.positioner = doc.createElement("div");
301
333
  this.positioner.className = "vela-ui-layer";
302
334
  this.list = doc.createElement("ul");
@@ -327,14 +359,30 @@ var Surface = class _Surface {
327
359
  if (opts.triggerId && trigger) trigger.id = opts.triggerId;
328
360
  this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
329
361
  const api = this.ctrl.connect(service);
330
- if (this.shown && !api.open) this.announce(false);
362
+ const closing = this.shown && !api.open;
363
+ if (closing) this.announce(false);
364
+ if (api.open && this.exit) {
365
+ this.exit.cancel();
366
+ this.exit = null;
367
+ }
331
368
  if (trigger) spreadProps(trigger, api.getTriggerProps(), this.mid);
332
369
  spreadProps(this.positioner, api.getPositionerProps(), this.mid);
333
370
  spreadProps(this.list, api.getContentProps(), this.mid);
334
371
  this.project(api);
372
+ if (closing) this.holdExit();
335
373
  if (api.open && !this.shown) this.announce(true);
336
374
  });
337
375
  }
376
+ /** Keep the just-closed list up through its exit animation. `spreadProps` re-applies
377
+ * `hidden` only when the machine's value for it changes, so the list stays shown until
378
+ * the exit ends — or until a reopen, which projects `hidden: false` itself. */
379
+ holdExit() {
380
+ this.list.hidden = false;
381
+ this.exit = holdForExit(this.list, () => {
382
+ this.exit = null;
383
+ if (!this.shown) this.list.hidden = true;
384
+ });
385
+ }
338
386
  get api() {
339
387
  return this.ctrl.connect(this.handle.service);
340
388
  }
@@ -358,6 +406,7 @@ var Surface = class _Surface {
358
406
  destroy() {
359
407
  for (const sub of this.subs.values()) sub.destroy();
360
408
  this.subs.clear();
409
+ this.exit?.finish();
361
410
  this.handle.stop();
362
411
  if (this.shown) this.announce(false);
363
412
  this.positioner.remove();
@@ -384,6 +433,10 @@ var Surface = class _Surface {
384
433
  const doc = this.doc;
385
434
  this.list.replaceChildren();
386
435
  const markable = this.checkmarks && this.items.some((i) => !(i.submenu && i.submenu.length > 0) && !i.toggle && i.checked !== void 0);
436
+ const iconic = this.items.some((i) => !!i.icon);
437
+ const badged = this.iconBadges && iconic;
438
+ if (badged) this.list.dataset.badges = "1";
439
+ else delete this.list.dataset.badges;
387
440
  for (const item of this.items) {
388
441
  if (item.separatorBefore) {
389
442
  const sep = doc.createElement("li");
@@ -409,7 +462,16 @@ var Surface = class _Surface {
409
462
  } else if (!branch && !item.toggle && item.checked) {
410
463
  li.dataset.checked = "1";
411
464
  }
412
- if (item.icon) li.appendChild(iconEl(item.icon, doc));
465
+ if (badged) {
466
+ const badge = doc.createElement("span");
467
+ badge.className = "vela-menu-badge";
468
+ if (item.icon) badge.appendChild(iconEl(item.icon, doc));
469
+ li.appendChild(badge);
470
+ } else if (item.icon) {
471
+ li.appendChild(iconEl(item.icon, doc));
472
+ } else if (iconic) {
473
+ li.appendChild(iconEl("", doc));
474
+ }
413
475
  const label = doc.createElement("span");
414
476
  label.className = "vela-menu-label";
415
477
  label.textContent = item.label;
@@ -457,6 +519,7 @@ var Surface = class _Surface {
457
519
  onSelect: this.onSelect,
458
520
  onFavorite: this.onFavorite,
459
521
  checkmarks: this.checkmarks,
522
+ iconBadges: this.iconBadges,
460
523
  id: `${this.mid}--${item.id}`
461
524
  });
462
525
  sub.setItems(item.submenu ?? []);
@@ -482,7 +545,8 @@ var Menu = class {
482
545
  id: opts.id,
483
546
  minWidth: opts.minWidth,
484
547
  onFavorite: opts.onFavorite,
485
- checkmarks: opts.checkmarks
548
+ checkmarks: opts.checkmarks,
549
+ iconBadges: opts.iconBadges
486
550
  });
487
551
  this.root.setItems(opts.items);
488
552
  }
@@ -586,6 +650,7 @@ var POPOVER_CSS = `
586
650
 
587
651
  // src/ui/components/popover/view.ts
588
652
  var open = null;
653
+ var leaving = /* @__PURE__ */ new Set();
589
654
  function closeOpenPopovers() {
590
655
  open?.hide();
591
656
  }
@@ -613,6 +678,8 @@ var Popover = class {
613
678
  this.shown = false;
614
679
  /** The pending removal of a fading-out shell; a show() that reuses the shell cancels it. */
615
680
  this.leaveTimer = null;
681
+ /** The shell's exit animation before it leaves the DOM; a show() that reuses the shell cancels it. */
682
+ this.exit = null;
616
683
  const doc = opts.trigger.ownerDocument;
617
684
  injectStyles(POPOVER_STYLE_ID, POPOVER_CSS, doc);
618
685
  this.trigger = opts.trigger;
@@ -649,6 +716,10 @@ var Popover = class {
649
716
  clearTimeout(this.leaveTimer);
650
717
  this.leaveTimer = null;
651
718
  }
719
+ this.exit?.cancel();
720
+ this.exit = null;
721
+ leaving.delete(this);
722
+ for (const p of [...leaving]) if (p.trigger === this.trigger) p.exit?.finish();
652
723
  ensureUIHost(this.el, this.inheritsTokens ? void 0 : this.theme);
653
724
  if (this.fadeMs > 0) {
654
725
  this.el.style.transition = `opacity ${this.fadeMs}ms ease`;
@@ -705,7 +776,12 @@ var Popover = class {
705
776
  this.el.remove();
706
777
  }, this.fadeMs);
707
778
  } else {
708
- this.el.remove();
779
+ this.exit = holdForExit(this.el, () => {
780
+ this.exit = null;
781
+ leaving.delete(this);
782
+ this.el.remove();
783
+ });
784
+ if (this.exit) leaving.add(this);
709
785
  }
710
786
  if (open === this) open = null;
711
787
  this.ctrl.onClose?.();
@@ -717,6 +793,7 @@ var Popover = class {
717
793
  }
718
794
  destroy() {
719
795
  this.hide();
796
+ this.exit?.finish();
720
797
  }
721
798
  reposition() {
722
799
  if (this.shown) this.place();
@@ -1394,6 +1471,9 @@ var Dialog = class {
1394
1471
  constructor(opts = {}) {
1395
1472
  this.opener = null;
1396
1473
  this.wasOpen = false;
1474
+ /** The panel and scrim's exit animation after a close; a reopen cancels it. */
1475
+ this.exit = null;
1476
+ this.destroyed = false;
1397
1477
  const doc = (opts.host ?? document.body).ownerDocument;
1398
1478
  injectStyles(DIALOG_STYLE_ID, DIALOG_CSS, doc);
1399
1479
  const host = opts.host ?? doc.body;
@@ -1490,19 +1570,57 @@ var Dialog = class {
1490
1570
  const mid = String(this.ctrl.props.id);
1491
1571
  this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
1492
1572
  const api = this.ctrl.connect(service);
1493
- if (this.wasOpen && !api.open) this.announce(false);
1573
+ const closing = this.wasOpen && !api.open;
1574
+ if (closing) this.announce(false);
1494
1575
  spreadProps(this.backdrop, api.getBackdropProps(), mid);
1495
1576
  spreadProps(this.positioner, api.getPositionerProps(), mid);
1496
1577
  spreadProps(this.panel, api.getContentProps(), mid);
1497
1578
  spreadProps(title, api.getTitleProps(), mid);
1498
1579
  spreadProps(close, api.getCloseTriggerProps(), mid);
1499
- this.backdrop.style.display = api.open ? "" : "none";
1500
- this.positioner.style.display = api.open ? "" : "none";
1580
+ if (api.open) {
1581
+ this.exit?.cancel();
1582
+ this.exit = null;
1583
+ this.setShown(true);
1584
+ } else if (closing) {
1585
+ this.holdExit();
1586
+ } else if (!this.exit) {
1587
+ this.setShown(false);
1588
+ }
1501
1589
  if (api.open && !this.wasOpen) this.announce(true);
1502
1590
  if (this.wasOpen && !api.open) this.restoreOpener();
1503
1591
  this.wasOpen = api.open;
1504
1592
  });
1505
1593
  }
1594
+ setShown(shown) {
1595
+ this.backdrop.style.display = shown ? "" : "none";
1596
+ this.positioner.style.display = shown ? "" : "none";
1597
+ }
1598
+ /** Keep the just-closed dialog up through its exit animation, then hide it — or
1599
+ * remove it, when it was destroyed meanwhile. `spreadProps` re-applies the close
1600
+ * props' `hidden` only when its value changes, so lifting it keeps the panel and
1601
+ * scrim up until the exit ends. The positioner spans the viewport: inert, it lets
1602
+ * clicks through to the page while the panel animates out. */
1603
+ holdExit() {
1604
+ const held = [this.panel, this.backdrop];
1605
+ for (const el of held) el.hidden = false;
1606
+ this.exit = holdForExit(
1607
+ held,
1608
+ () => {
1609
+ this.exit = null;
1610
+ if (this.destroyed) {
1611
+ this.detach();
1612
+ } else if (!this.open) {
1613
+ for (const el of held) el.hidden = true;
1614
+ this.setShown(false);
1615
+ }
1616
+ },
1617
+ { inert: [this.positioner] }
1618
+ );
1619
+ }
1620
+ detach() {
1621
+ this.backdrop.remove();
1622
+ this.positioner.remove();
1623
+ }
1506
1624
  /** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
1507
1625
  * teardown that outruns the machine's close notification). */
1508
1626
  restoreOpener() {
@@ -1531,15 +1649,16 @@ var Dialog = class {
1531
1649
  return el?.closest(".vela-popover, .vela-menu") != null;
1532
1650
  }
1533
1651
  destroy() {
1652
+ if (this.wasOpen && !this.open) this.handle.flush();
1534
1653
  if (this.open) this.hide();
1535
1654
  this.handle.stop();
1655
+ this.destroyed = true;
1536
1656
  if (this.wasOpen) {
1537
1657
  this.wasOpen = false;
1538
1658
  this.announce(false);
1539
1659
  }
1540
1660
  this.restoreOpener();
1541
- this.backdrop.remove();
1542
- this.positioner.remove();
1661
+ if (!this.exit) this.detach();
1543
1662
  }
1544
1663
  };
1545
1664
 
@@ -1,5 +1,5 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, aW as SeriesSpec, ak as Fill, H as Background, aM as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bc as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-NAUHiQEC.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-COGDs9Xg.cjs';
1
+ import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.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-Byo8pEv0.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -905,6 +905,21 @@ interface VelaEventMap extends Record<string, unknown> {
905
905
  * leave the app theme alone.
906
906
  */
907
907
  "theme:changed": VelaTheme;
908
+ /**
909
+ * The base price style is switching `from` → `to` (candles, line, area, a chart-type
910
+ * id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
911
+ * the path: the topbar style menu, `ctx.setPriceStyle`,
912
+ * `chart.renderer.set('priceStyle', …)`, the settings dialog, `applyConfig` and
913
+ * config templates, or a state restore. Never fires for the style the chart was
914
+ * created with, nor for a set to the style already shown. While it runs the chart
915
+ * still shows `from`, so a listener can capture the outgoing frame
916
+ * (`chart.renderer.screenshotCanvas()`) to animate the switch. Listeners must not
917
+ * change the price style again from inside it.
918
+ */
919
+ "priceStyle:change": {
920
+ from: string;
921
+ to: string;
922
+ };
908
923
  /** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
909
924
  "pane:moved": {
910
925
  paneId: string;
@@ -935,6 +950,17 @@ interface VelaEventMap extends Record<string, unknown> {
935
950
  "drawing:favorites": {
936
951
  favorites: string[];
937
952
  };
953
+ /** A tool's remembered settings changed — the ones its next drawing starts from (the last
954
+ * drawing of that type the user styled, a bulk restore, or a reset). Read them back with
955
+ * `drawings.toolDefaults()`. */
956
+ "drawing:defaults": {
957
+ type: DrawingTypeKey;
958
+ };
959
+ /** A tool's saved looks changed (saved, deleted, or a bulk restore) — read them back with
960
+ * `drawings.toolTemplates()`. */
961
+ "drawing:templates": {
962
+ type: DrawingTypeKey;
963
+ };
938
964
  /** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
939
965
  * the pointer, `null`), or a programmatic `drawings.setTool`. */
940
966
  "drawing:tool": {
@@ -1361,7 +1387,10 @@ declare class DrawingController {
1361
1387
  private favs;
1362
1388
  private selectedIds;
1363
1389
  private clipboard;
1364
- private readonly lastStyle;
1390
+ /** Per-tool remembered settings — the last drawing of each type the user styled seeds the next. */
1391
+ private readonly defaults;
1392
+ /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
+ private templates;
1365
1394
  private readonly subs;
1366
1395
  constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1367
1396
  /** Whether the active renderer supports interactive drawings. */
@@ -1383,6 +1412,24 @@ declare class DrawingController {
1383
1412
  /** Replace the whole favorite set (bulk restore) — unknown types are dropped. */
1384
1413
  setFavorites(types: readonly DrawingTypeKey[]): void;
1385
1414
  private pushFavorites;
1415
+ /** Every tool's remembered settings, by type (plain JSON — persist it as-is). */
1416
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1417
+ /** Replace every tool's remembered settings (restoring persisted prefs). Unknown types and
1418
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1419
+ setToolDefaults(map: Readonly<Record<string, unknown>> | null | undefined): void;
1420
+ /** Forget a tool's remembered settings (every tool's when `type` is omitted) — new drawings
1421
+ * start from the factory defaults again. */
1422
+ resetToolDefaults(type?: DrawingTypeKey): void;
1423
+ /** Every tool's saved looks, by type (plain JSON — persist it as-is). */
1424
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1425
+ /** Replace every tool's saved looks (restoring persisted prefs). Unknown types and
1426
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1427
+ setToolTemplates(map: Readonly<Record<string, unknown>> | null | undefined): void;
1428
+ /** Save the given settings as a named look for a tool (a same-named one is replaced). */
1429
+ saveToolTemplate(type: DrawingTypeKey, name: string, settings: DrawingToolDefaults): void;
1430
+ /** Delete a tool's saved look by name. */
1431
+ removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
+ private pushTemplates;
1386
1433
  setToolbar(option: DrawingsOption): void;
1387
1434
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1388
1435
  * inert on a renderer without the optional `setExternalGhost` seam. */
@@ -1447,8 +1494,12 @@ declare class DrawingController {
1447
1494
  /** Add clones (fresh ids, fresh mount-order z) as one undo step + select them. */
1448
1495
  private insertClones;
1449
1496
  private resolve;
1450
- /** Remember a drawing's style as the "last used" for its type (seeds the next one). */
1451
- private captureStyle;
1497
+ /** `store.update` that remembers the drawing's settings only when the patch changed them:
1498
+ * moving an older drawing must not hand its look back to the tool. */
1499
+ private updateDrawing;
1500
+ /** Remember a drawing's settings as its tool's defaults (they seed the next one), and
1501
+ * announce a real change so a host can save it. */
1502
+ private captureDefaults;
1452
1503
  private sync;
1453
1504
  /** Renderer gesture → authoritative store mutation + event. */
1454
1505
  private onIntent;
@@ -1547,6 +1598,21 @@ declare class DrawingsControl {
1547
1598
  setFavorite(type: DrawingTypeKey, on: boolean): this;
1548
1599
  /** Replace the whole favorite set (e.g. restoring persisted prefs). */
1549
1600
  setFavorites(types: readonly DrawingTypeKey[]): this;
1601
+ /** Every tool's remembered settings, by type — what the next drawing of each type starts
1602
+ * from (its style, text styling and per-type settings such as fib levels). Plain JSON:
1603
+ * persist it and hand it back to {@link setToolDefaults} on the next load. */
1604
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1605
+ /** Replace every tool's remembered settings (e.g. restoring persisted prefs). Malformed
1606
+ * entries and unknown types are dropped. Follow changes on `drawing:defaults`. */
1607
+ setToolDefaults(map: Readonly<Record<string, unknown>>): this;
1608
+ /** Forget one tool's remembered settings (every tool's without an argument). */
1609
+ resetToolDefaults(type?: DrawingTypeKey): this;
1610
+ /** Every tool's saved looks ("styles" in the settings panel), by type. Plain JSON —
1611
+ * persist it and hand it back to {@link setToolTemplates}. */
1612
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1613
+ /** Replace every tool's saved looks (e.g. restoring persisted prefs). Follow changes on
1614
+ * `drawing:templates`. */
1615
+ setToolTemplates(map: Readonly<Record<string, unknown>>): this;
1550
1616
  /** Aliases mirroring `renderer.getConfig()/applyConfig()` for symmetry. */
1551
1617
  getConfig(): DrawingsDocument;
1552
1618
  applyConfig(doc: unknown): this;
@@ -1889,6 +1955,26 @@ interface WidgetContext {
1889
1955
  * `state:changed` + storage write follows). Only needed for state with no shell
1890
1956
  * event of its own — indicator adds/removals already trigger the save cycle. */
1891
1957
  stateChanged(): void;
1958
+ /** Where the right-click that opened a context menu landed. Set on the context handed
1959
+ * to `context:*` actions (`when` and `run`); absent everywhere else. */
1960
+ pointer?: ContextMenuPointer;
1961
+ }
1962
+ /**
1963
+ * What the chart's crosshair reported when a context menu opened ({@link WidgetContext.pointer}),
1964
+ * on the chart that received the right-click — in a workspace, the cell under the pointer.
1965
+ * Captured once at open: moving through the menu before picking a row does not change it.
1966
+ * The axis menus get what the crosshair reports over the axis: off the plot, `price` and
1967
+ * `paneKind` are null, while `time` still names the bar column under the pointer (on the
1968
+ * time axis, the bar above the click; null past the last bar).
1969
+ */
1970
+ interface ContextMenuPointer {
1971
+ /** The value under the pointer on the pane it landed on: a price on the price pane, an
1972
+ * indicator value on a study pane (see `paneKind`). Null off the plot. */
1973
+ price: number | null;
1974
+ /** Open time of the bar under the pointer; null off the bars. */
1975
+ time: number | null;
1976
+ /** The kind of pane the pointer is on; null off the plot. */
1977
+ paneKind: 'price' | 'study' | null;
1892
1978
  }
1893
1979
  /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1894
1980
  interface ExternalIndicatorEntry {
@@ -1930,7 +2016,12 @@ interface WidgetActionDescriptor {
1930
2016
  * one the flag is ignored (with a console warning) and the label renders. The piece
1931
2017
  * that makes a `'screenshot'` slot override pixel-faithful to the native button. */
1932
2018
  iconOnly?: boolean;
1933
- /** Sort key within the contributed group (ascending; default 0). */
2019
+ /** Sort key (ascending; default 0; ties keep registration order). On the topbar it orders
2020
+ * the contributed group. In a context menu (`context:*`) contributed rows sort TOGETHER
2021
+ * with the menu's built-in rows, which sit at the ranks of `CONTEXT_MENU_BUILTIN_ORDER`:
2022
+ * the built-in actions below 0 and the settings row at 1000. So an action without
2023
+ * `order` lands after the built-in actions and before the settings row, `order: -100`
2024
+ * leads the menu, and on a tie the built-in row comes first. */
1934
2025
  order?: number;
1935
2026
  /** Topbar only: which cluster the button joins. `'right'` (default) is the
1936
2027
  * right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
@@ -2249,4 +2340,4 @@ declare function unregisterDefaultEngine(language: string): void;
2249
2340
  * language. The shell layers (widget, workspace cell) register exactly this result. */
2250
2341
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
2251
2342
 
2252
- export { type ScriptRunResult as $, type NativeIndicatorContext as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorDescriptor as G, type NativeIndicatorInfo as H, type IndicatorHandle as I, type NativeIndicatorOutput as J, type PreparedScript as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, RendererControl as Q, type ReplayState as R, type ScriptingEngine as S, ReplayControl as T, type ReplayEndReason as U, Vela as V, type WidgetContext as W, type ReplayStartOptions as X, type RunIndicatorResult as Y, type SceneInspection as Z, type ScriptRunCause as _, type ReplayBounds as a, type SidePanelButton as a0, type SidePanelDescriptor as a1, type SidePanelHandle as a2, type SidePanelHeader as a3, type StatePersistenceHandler as a4, type StrategyFill as a5, type StrategyState as a6, type StrategyTrade as a7, type SymbolRankingHook as a8, TypedEventBus as a9, unregisterLegendCallout as aA, unregisterNativeIndicator as aB, unregisterSidePanel as aC, unregisterStatePersistence as aD, unregisterWidgetAction as aE, unregisterWidgetAttachment as aF, widgetActions as aG, widgetAttachments as aH, DEFAULT_PANEL_ORDER as aI, type VelaDeps as aa, type VisibleBarRange as ab, type WidgetActionDescriptor as ac, type WidgetActionTarget as ad, type WidgetAttachment as ae, getNativeIndicator as af, legendActions as ag, legendCallouts as ah, nativeIndicatorDescriptors as ai, nativeIndicatorTypes as aj, registerDefaultEngine as ak, registerLegendAction as al, registerLegendCallout as am, registerNativeIndicator as an, registerSidePanel as ao, registerStatePersistence as ap, registerSymbolRanking as aq, registerWidgetAction as ar, registerWidgetAttachment as as, resolveEngines as at, sidePanels as au, statePersistenceHandlers as av, symbolRanking as aw, topbarActionOverride as ax, unregisterDefaultEngine as ay, unregisterLegendAction as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextSelect as i, DrawingsControl as j, type EngineAlert as k, type EngineCapabilities as l, type EngineContextSnapshot as m, type EngineFactory as n, type EngineWarning as o, type ExecutionHandlers as p, type ExecutionMarket as q, type ExecutionRequest as r, type ExecutionSession as s, type IndicatorEventMap as t, type IndicatorSummary as u, type LegendCalloutContent as v, type LegendCalloutDescriptor as w, type LegendCalloutItem as x, type LegendCalloutSpec as y, type LegendIndicatorInfo as z };
2343
+ export { type ScriptRunCause as $, type LegendIndicatorInfo as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorContext as G, type NativeIndicatorDescriptor as H, type IndicatorHandle as I, type NativeIndicatorInfo as J, type NativeIndicatorOutput as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type PreparedScript as Q, type ReplayState as R, type ScriptingEngine as S, RendererControl as T, ReplayControl as U, Vela as V, type WidgetContext as W, type ReplayEndReason as X, type ReplayStartOptions as Y, type RunIndicatorResult as Z, type SceneInspection as _, type ReplayBounds as a, type ScriptRunResult as a0, type SidePanelButton as a1, type SidePanelDescriptor as a2, type SidePanelHandle as a3, type SidePanelHeader as a4, type StatePersistenceHandler as a5, type StrategyFill as a6, type StrategyState as a7, type StrategyTrade as a8, type SymbolRankingHook as a9, unregisterLegendAction as aA, unregisterLegendCallout as aB, unregisterNativeIndicator as aC, unregisterSidePanel as aD, unregisterStatePersistence as aE, unregisterWidgetAction as aF, unregisterWidgetAttachment as aG, widgetActions as aH, widgetAttachments as aI, DEFAULT_PANEL_ORDER as aJ, TypedEventBus as aa, type VelaDeps as ab, type VisibleBarRange as ac, type WidgetActionDescriptor as ad, type WidgetActionTarget as ae, type WidgetAttachment as af, getNativeIndicator as ag, legendActions as ah, legendCallouts as ai, nativeIndicatorDescriptors as aj, nativeIndicatorTypes as ak, registerDefaultEngine as al, registerLegendAction as am, registerLegendCallout as an, registerNativeIndicator as ao, registerSidePanel as ap, registerStatePersistence as aq, registerSymbolRanking as ar, registerWidgetAction as as, registerWidgetAttachment as at, resolveEngines as au, sidePanels as av, statePersistenceHandlers as aw, symbolRanking as ax, topbarActionOverride as ay, unregisterDefaultEngine as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextMenuPointer as i, type ContextSelect as j, DrawingsControl as k, type EngineAlert as l, type EngineCapabilities as m, type EngineContextSnapshot as n, type EngineFactory as o, type EngineWarning as p, type ExecutionHandlers as q, type ExecutionMarket as r, type ExecutionRequest as s, type ExecutionSession as t, type IndicatorEventMap as u, type IndicatorSummary as v, type LegendCalloutContent as w, type LegendCalloutDescriptor as x, type LegendCalloutItem as y, type LegendCalloutSpec as z };
@@ -1,5 +1,5 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, aW as SeriesSpec, ak as Fill, H as Background, aM as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bc as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-NAUHiQEC.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-DpOWZD8F.js';
1
+ import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.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-Bw58CjYy.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -905,6 +905,21 @@ interface VelaEventMap extends Record<string, unknown> {
905
905
  * leave the app theme alone.
906
906
  */
907
907
  "theme:changed": VelaTheme;
908
+ /**
909
+ * The base price style is switching `from` → `to` (candles, line, area, a chart-type
910
+ * id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
911
+ * the path: the topbar style menu, `ctx.setPriceStyle`,
912
+ * `chart.renderer.set('priceStyle', …)`, the settings dialog, `applyConfig` and
913
+ * config templates, or a state restore. Never fires for the style the chart was
914
+ * created with, nor for a set to the style already shown. While it runs the chart
915
+ * still shows `from`, so a listener can capture the outgoing frame
916
+ * (`chart.renderer.screenshotCanvas()`) to animate the switch. Listeners must not
917
+ * change the price style again from inside it.
918
+ */
919
+ "priceStyle:change": {
920
+ from: string;
921
+ to: string;
922
+ };
908
923
  /** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
909
924
  "pane:moved": {
910
925
  paneId: string;
@@ -935,6 +950,17 @@ interface VelaEventMap extends Record<string, unknown> {
935
950
  "drawing:favorites": {
936
951
  favorites: string[];
937
952
  };
953
+ /** A tool's remembered settings changed — the ones its next drawing starts from (the last
954
+ * drawing of that type the user styled, a bulk restore, or a reset). Read them back with
955
+ * `drawings.toolDefaults()`. */
956
+ "drawing:defaults": {
957
+ type: DrawingTypeKey;
958
+ };
959
+ /** A tool's saved looks changed (saved, deleted, or a bulk restore) — read them back with
960
+ * `drawings.toolTemplates()`. */
961
+ "drawing:templates": {
962
+ type: DrawingTypeKey;
963
+ };
938
964
  /** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
939
965
  * the pointer, `null`), or a programmatic `drawings.setTool`. */
940
966
  "drawing:tool": {
@@ -1361,7 +1387,10 @@ declare class DrawingController {
1361
1387
  private favs;
1362
1388
  private selectedIds;
1363
1389
  private clipboard;
1364
- private readonly lastStyle;
1390
+ /** Per-tool remembered settings — the last drawing of each type the user styled seeds the next. */
1391
+ private readonly defaults;
1392
+ /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
+ private templates;
1365
1394
  private readonly subs;
1366
1395
  constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1367
1396
  /** Whether the active renderer supports interactive drawings. */
@@ -1383,6 +1412,24 @@ declare class DrawingController {
1383
1412
  /** Replace the whole favorite set (bulk restore) — unknown types are dropped. */
1384
1413
  setFavorites(types: readonly DrawingTypeKey[]): void;
1385
1414
  private pushFavorites;
1415
+ /** Every tool's remembered settings, by type (plain JSON — persist it as-is). */
1416
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1417
+ /** Replace every tool's remembered settings (restoring persisted prefs). Unknown types and
1418
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1419
+ setToolDefaults(map: Readonly<Record<string, unknown>> | null | undefined): void;
1420
+ /** Forget a tool's remembered settings (every tool's when `type` is omitted) — new drawings
1421
+ * start from the factory defaults again. */
1422
+ resetToolDefaults(type?: DrawingTypeKey): void;
1423
+ /** Every tool's saved looks, by type (plain JSON — persist it as-is). */
1424
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1425
+ /** Replace every tool's saved looks (restoring persisted prefs). Unknown types and
1426
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1427
+ setToolTemplates(map: Readonly<Record<string, unknown>> | null | undefined): void;
1428
+ /** Save the given settings as a named look for a tool (a same-named one is replaced). */
1429
+ saveToolTemplate(type: DrawingTypeKey, name: string, settings: DrawingToolDefaults): void;
1430
+ /** Delete a tool's saved look by name. */
1431
+ removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
+ private pushTemplates;
1386
1433
  setToolbar(option: DrawingsOption): void;
1387
1434
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1388
1435
  * inert on a renderer without the optional `setExternalGhost` seam. */
@@ -1447,8 +1494,12 @@ declare class DrawingController {
1447
1494
  /** Add clones (fresh ids, fresh mount-order z) as one undo step + select them. */
1448
1495
  private insertClones;
1449
1496
  private resolve;
1450
- /** Remember a drawing's style as the "last used" for its type (seeds the next one). */
1451
- private captureStyle;
1497
+ /** `store.update` that remembers the drawing's settings only when the patch changed them:
1498
+ * moving an older drawing must not hand its look back to the tool. */
1499
+ private updateDrawing;
1500
+ /** Remember a drawing's settings as its tool's defaults (they seed the next one), and
1501
+ * announce a real change so a host can save it. */
1502
+ private captureDefaults;
1452
1503
  private sync;
1453
1504
  /** Renderer gesture → authoritative store mutation + event. */
1454
1505
  private onIntent;
@@ -1547,6 +1598,21 @@ declare class DrawingsControl {
1547
1598
  setFavorite(type: DrawingTypeKey, on: boolean): this;
1548
1599
  /** Replace the whole favorite set (e.g. restoring persisted prefs). */
1549
1600
  setFavorites(types: readonly DrawingTypeKey[]): this;
1601
+ /** Every tool's remembered settings, by type — what the next drawing of each type starts
1602
+ * from (its style, text styling and per-type settings such as fib levels). Plain JSON:
1603
+ * persist it and hand it back to {@link setToolDefaults} on the next load. */
1604
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1605
+ /** Replace every tool's remembered settings (e.g. restoring persisted prefs). Malformed
1606
+ * entries and unknown types are dropped. Follow changes on `drawing:defaults`. */
1607
+ setToolDefaults(map: Readonly<Record<string, unknown>>): this;
1608
+ /** Forget one tool's remembered settings (every tool's without an argument). */
1609
+ resetToolDefaults(type?: DrawingTypeKey): this;
1610
+ /** Every tool's saved looks ("styles" in the settings panel), by type. Plain JSON —
1611
+ * persist it and hand it back to {@link setToolTemplates}. */
1612
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1613
+ /** Replace every tool's saved looks (e.g. restoring persisted prefs). Follow changes on
1614
+ * `drawing:templates`. */
1615
+ setToolTemplates(map: Readonly<Record<string, unknown>>): this;
1550
1616
  /** Aliases mirroring `renderer.getConfig()/applyConfig()` for symmetry. */
1551
1617
  getConfig(): DrawingsDocument;
1552
1618
  applyConfig(doc: unknown): this;
@@ -1889,6 +1955,26 @@ interface WidgetContext {
1889
1955
  * `state:changed` + storage write follows). Only needed for state with no shell
1890
1956
  * event of its own — indicator adds/removals already trigger the save cycle. */
1891
1957
  stateChanged(): void;
1958
+ /** Where the right-click that opened a context menu landed. Set on the context handed
1959
+ * to `context:*` actions (`when` and `run`); absent everywhere else. */
1960
+ pointer?: ContextMenuPointer;
1961
+ }
1962
+ /**
1963
+ * What the chart's crosshair reported when a context menu opened ({@link WidgetContext.pointer}),
1964
+ * on the chart that received the right-click — in a workspace, the cell under the pointer.
1965
+ * Captured once at open: moving through the menu before picking a row does not change it.
1966
+ * The axis menus get what the crosshair reports over the axis: off the plot, `price` and
1967
+ * `paneKind` are null, while `time` still names the bar column under the pointer (on the
1968
+ * time axis, the bar above the click; null past the last bar).
1969
+ */
1970
+ interface ContextMenuPointer {
1971
+ /** The value under the pointer on the pane it landed on: a price on the price pane, an
1972
+ * indicator value on a study pane (see `paneKind`). Null off the plot. */
1973
+ price: number | null;
1974
+ /** Open time of the bar under the pointer; null off the bars. */
1975
+ time: number | null;
1976
+ /** The kind of pane the pointer is on; null off the plot. */
1977
+ paneKind: 'price' | 'study' | null;
1892
1978
  }
1893
1979
  /** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
1894
1980
  interface ExternalIndicatorEntry {
@@ -1930,7 +2016,12 @@ interface WidgetActionDescriptor {
1930
2016
  * one the flag is ignored (with a console warning) and the label renders. The piece
1931
2017
  * that makes a `'screenshot'` slot override pixel-faithful to the native button. */
1932
2018
  iconOnly?: boolean;
1933
- /** Sort key within the contributed group (ascending; default 0). */
2019
+ /** Sort key (ascending; default 0; ties keep registration order). On the topbar it orders
2020
+ * the contributed group. In a context menu (`context:*`) contributed rows sort TOGETHER
2021
+ * with the menu's built-in rows, which sit at the ranks of `CONTEXT_MENU_BUILTIN_ORDER`:
2022
+ * the built-in actions below 0 and the settings row at 1000. So an action without
2023
+ * `order` lands after the built-in actions and before the settings row, `order: -100`
2024
+ * leads the menu, and on a tie the built-in row comes first. */
1934
2025
  order?: number;
1935
2026
  /** Topbar only: which cluster the button joins. `'right'` (default) is the
1936
2027
  * right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
@@ -2249,4 +2340,4 @@ declare function unregisterDefaultEngine(language: string): void;
2249
2340
  * language. The shell layers (widget, workspace cell) register exactly this result. */
2250
2341
  declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
2251
2342
 
2252
- export { type ScriptRunResult as $, type NativeIndicatorContext as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorDescriptor as G, type NativeIndicatorInfo as H, type IndicatorHandle as I, type NativeIndicatorOutput as J, type PreparedScript as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, RendererControl as Q, type ReplayState as R, type ScriptingEngine as S, ReplayControl as T, type ReplayEndReason as U, Vela as V, type WidgetContext as W, type ReplayStartOptions as X, type RunIndicatorResult as Y, type SceneInspection as Z, type ScriptRunCause as _, type ReplayBounds as a, type SidePanelButton as a0, type SidePanelDescriptor as a1, type SidePanelHandle as a2, type SidePanelHeader as a3, type StatePersistenceHandler as a4, type StrategyFill as a5, type StrategyState as a6, type StrategyTrade as a7, type SymbolRankingHook as a8, TypedEventBus as a9, unregisterLegendCallout as aA, unregisterNativeIndicator as aB, unregisterSidePanel as aC, unregisterStatePersistence as aD, unregisterWidgetAction as aE, unregisterWidgetAttachment as aF, widgetActions as aG, widgetAttachments as aH, DEFAULT_PANEL_ORDER as aI, type VelaDeps as aa, type VisibleBarRange as ab, type WidgetActionDescriptor as ac, type WidgetActionTarget as ad, type WidgetAttachment as ae, getNativeIndicator as af, legendActions as ag, legendCallouts as ah, nativeIndicatorDescriptors as ai, nativeIndicatorTypes as aj, registerDefaultEngine as ak, registerLegendAction as al, registerLegendCallout as am, registerNativeIndicator as an, registerSidePanel as ao, registerStatePersistence as ap, registerSymbolRanking as aq, registerWidgetAction as ar, registerWidgetAttachment as as, resolveEngines as at, sidePanels as au, statePersistenceHandlers as av, symbolRanking as aw, topbarActionOverride as ax, unregisterDefaultEngine as ay, unregisterLegendAction as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextSelect as i, DrawingsControl as j, type EngineAlert as k, type EngineCapabilities as l, type EngineContextSnapshot as m, type EngineFactory as n, type EngineWarning as o, type ExecutionHandlers as p, type ExecutionMarket as q, type ExecutionRequest as r, type ExecutionSession as s, type IndicatorEventMap as t, type IndicatorSummary as u, type LegendCalloutContent as v, type LegendCalloutDescriptor as w, type LegendCalloutItem as x, type LegendCalloutSpec as y, type LegendIndicatorInfo as z };
2343
+ export { type ScriptRunCause as $, type LegendIndicatorInfo as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorContext as G, type NativeIndicatorDescriptor as H, type IndicatorHandle as I, type NativeIndicatorInfo as J, type NativeIndicatorOutput as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type PreparedScript as Q, type ReplayState as R, type ScriptingEngine as S, RendererControl as T, ReplayControl as U, Vela as V, type WidgetContext as W, type ReplayEndReason as X, type ReplayStartOptions as Y, type RunIndicatorResult as Z, type SceneInspection as _, type ReplayBounds as a, type ScriptRunResult as a0, type SidePanelButton as a1, type SidePanelDescriptor as a2, type SidePanelHandle as a3, type SidePanelHeader as a4, type StatePersistenceHandler as a5, type StrategyFill as a6, type StrategyState as a7, type StrategyTrade as a8, type SymbolRankingHook as a9, unregisterLegendAction as aA, unregisterLegendCallout as aB, unregisterNativeIndicator as aC, unregisterSidePanel as aD, unregisterStatePersistence as aE, unregisterWidgetAction as aF, unregisterWidgetAttachment as aG, widgetActions as aH, widgetAttachments as aI, DEFAULT_PANEL_ORDER as aJ, TypedEventBus as aa, type VelaDeps as ab, type VisibleBarRange as ac, type WidgetActionDescriptor as ad, type WidgetActionTarget as ae, type WidgetAttachment as af, getNativeIndicator as ag, legendActions as ah, legendCallouts as ai, nativeIndicatorDescriptors as aj, nativeIndicatorTypes as ak, registerDefaultEngine as al, registerLegendAction as am, registerLegendCallout as an, registerNativeIndicator as ao, registerSidePanel as ap, registerStatePersistence as aq, registerSymbolRanking as ar, registerWidgetAction as as, registerWidgetAttachment as at, resolveEngines as au, sidePanels as av, statePersistenceHandlers as aw, symbolRanking as ax, topbarActionOverride as ay, unregisterDefaultEngine as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextMenuPointer as i, type ContextSelect as j, DrawingsControl as k, type EngineAlert as l, type EngineCapabilities as m, type EngineContextSnapshot as n, type EngineFactory as o, type EngineWarning as p, type ExecutionHandlers as q, type ExecutionMarket as r, type ExecutionRequest as s, type ExecutionSession as t, type IndicatorEventMap as u, type IndicatorSummary as v, type LegendCalloutContent as w, type LegendCalloutDescriptor as x, type LegendCalloutItem as y, type LegendCalloutSpec as z };