@luxalgo/vela 0.7.5 → 0.7.6

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 (37) hide show
  1. package/dist/{DataProvider-Dut6lXGM.d.cts → DataProvider-CGa4KHRa.d.cts} +1 -1
  2. package/dist/{DataProvider-DLeFs1gE.d.ts → DataProvider-CmWUtDVL.d.ts} +1 -1
  3. package/dist/{chunk-MNG5XPLV.js → chunk-EMB53WNQ.js} +11 -7
  4. package/dist/{chunk-MCLI6B3S.js → chunk-JSVCWYBF.js} +45 -8
  5. package/dist/{contributions-CEkgJKTU.d.ts → contributions-C7Wsm_S9.d.ts} +8 -2
  6. package/dist/{contributions-DYtiRtES.d.cts → contributions-D6p1RB38.d.cts} +8 -2
  7. package/dist/index.cjs +45 -8
  8. package/dist/index.d.cts +6 -6
  9. package/dist/index.d.ts +6 -6
  10. package/dist/index.js +1 -1
  11. package/dist/{options-DNBoMKkX.d.cts → options-D1AJKsn_.d.cts} +10 -0
  12. package/dist/{options-DNBoMKkX.d.ts → options-D1AJKsn_.d.ts} +10 -0
  13. package/dist/{plugin-DtkeQVAO.d.cts → plugin-CxWfg6vK.d.cts} +3 -3
  14. package/dist/{plugin-CLn--oP6.d.ts → plugin-SodaQhjQ.d.ts} +3 -3
  15. package/dist/plugin.d.cts +4 -4
  16. package/dist/plugin.d.ts +4 -4
  17. package/dist/providers/binance.d.cts +2 -2
  18. package/dist/providers/binance.d.ts +2 -2
  19. package/dist/providers/coinbase.d.cts +2 -2
  20. package/dist/providers/coinbase.d.ts +2 -2
  21. package/dist/providers/hyperliquid.d.cts +2 -2
  22. package/dist/providers/hyperliquid.d.ts +2 -2
  23. package/dist/{statusline-model-gA__yaog.d.cts → statusline-model-gWHrsOy3.d.cts} +3 -3
  24. package/dist/{statusline-model-DypGXjtr.d.ts → statusline-model-xBiVsKoE.d.ts} +3 -3
  25. package/dist/ui.d.cts +1 -1
  26. package/dist/ui.d.ts +1 -1
  27. package/dist/vela.global.js +45 -8
  28. package/dist/vela.global.min.js +32 -32
  29. package/dist/widget.cjs +55 -14
  30. package/dist/widget.d.cts +6 -6
  31. package/dist/widget.d.ts +6 -6
  32. package/dist/widget.js +3 -3
  33. package/dist/workspace.cjs +55 -14
  34. package/dist/workspace.d.cts +10 -5
  35. package/dist/workspace.d.ts +10 -5
  36. package/dist/workspace.js +2 -2
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-DNBoMKkX.cjs';
1
+ import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-D1AJKsn_.cjs';
2
2
 
3
3
  /**
4
4
  * Symbol metadata an engine may need (e.g. Pine `syminfo.*`). Free-form beyond
@@ -1,4 +1,4 @@
1
- import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-DNBoMKkX.js';
1
+ import { M as MarketConfig, O as OHLCV, U as Unsubscribe } from './options-D1AJKsn_.js';
2
2
 
3
3
  /**
4
4
  * Symbol metadata an engine may need (e.g. Pine `syminfo.*`). Free-form beyond
@@ -1,4 +1,4 @@
1
- import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, SecondClock, TIMEZONES, normalizeTimezone, tzMenuLabel, isGroupRow, defaultMemberOf, groupKeyOf, groupMembers, LEGEND_AT_TOP_ATTR, normalizeSession, Vela, TypedEventBus, MultiProviderFeed, registerBuiltinChartTypes, resolveTheme, buildToolbar, createCustomMark, createAttributionMark, DrawingToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs } from './chunk-MCLI6B3S.js';
1
+ import { parseSymbol, priceStyleIds, BUILTIN_PRICE_STYLES, tzButtonLabel, SecondClock, TIMEZONES, normalizeTimezone, tzMenuLabel, isGroupRow, defaultMemberOf, groupKeyOf, groupMembers, LEGEND_AT_TOP_ATTR, normalizeSession, Vela, TypedEventBus, MultiProviderFeed, registerBuiltinChartTypes, resolveTheme, buildToolbar, createCustomMark, createAttributionMark, DrawingToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs } from './chunk-JSVCWYBF.js';
2
2
  import { chartType, resolveTopbarComposition, topbarActionOverride, TOPBAR_BUILTIN_IDS, widgetActions, SidePanel, sidePanels, DEFAULT_PANEL_ORDER, symbolRanking, resolveEngines, legendActionsProviderFor, legendCalloutsProviderFor, statePersistenceHandlers, topbarHas, rendererDefaults, widgetAttachments, getDrawingType, inputDeltas } from './chunk-BFA32GOU.js';
3
3
  import { Tooltip, KeymapManager, isEditableTarget, Drawer } from './chunk-ZADTVRUO.js';
4
4
  import { Menu, Dialog, CalloutBubble, applyPlotOverlayTokens, ensureUIHost } from './chunk-BKHSQ4YM.js';
@@ -6288,16 +6288,19 @@ var ChartCell = class {
6288
6288
  * a persistence handler's `restore` runs silently, a user-driven call records.
6289
6289
  */
6290
6290
  addExternalIndicator(entry) {
6291
+ const { id, inputs, props, hidden, ...script } = entry;
6291
6292
  this.addManifestInstance(
6292
- { ...entry, enabled: true },
6293
- { external: true, ...entry.inputs ? { inputs: entry.inputs } : {}, ...entry.props ? { props: entry.props } : {}, ...entry.hidden ? { hidden: true } : {} }
6293
+ { ...script, enabled: true },
6294
+ { external: true, ...id !== void 0 ? { id } : {}, ...inputs ? { inputs } : {}, ...props ? { props } : {}, ...hidden ? { hidden: true } : {} }
6294
6295
  );
6295
6296
  }
6296
6297
  /** Add ONE instance of a manifest entry (repeatable — duplicates are legitimate). */
6297
6298
  addManifestInstance(entry, opts = {}) {
6298
6299
  if (this.destroyed) return;
6299
6300
  const values = opts.inputs || opts.props ? { inputs: opts.inputs, props: opts.props } : void 0;
6300
- const it = { entry, handle: this.addToChart(entry, values), ...opts.external ? { external: true } : {}, ...values ? { values } : {} };
6301
+ const handle = this.addToChart(entry, values, opts.id);
6302
+ if (!handle) return;
6303
+ const it = { entry, handle, id: handle.id, ...opts.external ? { external: true } : {}, ...values ? { values } : {} };
6301
6304
  if (opts.hidden) it.handle?.setVisible(false);
6302
6305
  this.instances.push(it);
6303
6306
  this.deps.onIndicatorsChanged(this.id);
@@ -6306,7 +6309,7 @@ var ChartCell = class {
6306
6309
  this.history.push({
6307
6310
  undo: () => this.dropInstance(snapshot),
6308
6311
  redo: () => {
6309
- snapshot.handle = this.addToChart(snapshot.entry, snapshot.values);
6312
+ snapshot.handle = this.addToChart(snapshot.entry, snapshot.values, snapshot.id);
6310
6313
  this.instances.push(snapshot);
6311
6314
  this.deps.onIndicatorsChanged(this.id);
6312
6315
  }
@@ -6319,7 +6322,7 @@ var ChartCell = class {
6319
6322
  const snapshot = it;
6320
6323
  this.history.push({
6321
6324
  undo: () => {
6322
- snapshot.handle = this.addToChart(snapshot.entry, snapshot.values);
6325
+ snapshot.handle = this.addToChart(snapshot.entry, snapshot.values, snapshot.id);
6323
6326
  this.instances.push(snapshot);
6324
6327
  this.deps.onIndicatorsChanged(this.id);
6325
6328
  },
@@ -6409,9 +6412,10 @@ var ChartCell = class {
6409
6412
  this.deps.onIndicatorsChanged(this.id);
6410
6413
  });
6411
6414
  }
6412
- addToChart(entry, values) {
6415
+ addToChart(entry, values, id) {
6413
6416
  try {
6414
6417
  return this.inner?.addIndicator(entry.script, {
6418
+ ...id !== void 0 ? { id } : {},
6415
6419
  ...entry.language !== void 0 ? { language: entry.language } : {},
6416
6420
  ...values?.inputs ? { inputs: values.inputs } : {},
6417
6421
  ...values?.props ? { props: values.props } : {}
@@ -21707,10 +21707,18 @@ var IndicatorRegistry = class {
21707
21707
  this.records = /* @__PURE__ */ new Map();
21708
21708
  this.counter = 0;
21709
21709
  }
21710
- /** Allocate a unique, stable per-instance id. */
21711
- nextId(prefix = "ind") {
21712
- this.counter += 1;
21713
- return `${prefix}-${this.counter}`;
21710
+ /**
21711
+ * Mint a unique per-instance id. Host-supplied ids share the namespace, so a minted
21712
+ * id skips anything already recorded — and anything `taken` reports live elsewhere
21713
+ * (a handle the orchestrator holds outside the records, e.g. a fail-soft native).
21714
+ */
21715
+ nextId(prefix = "ind", taken = () => false) {
21716
+ let id;
21717
+ do {
21718
+ this.counter += 1;
21719
+ id = `${prefix}-${this.counter}`;
21720
+ } while (this.records.has(id) || taken(id));
21721
+ return id;
21714
21722
  }
21715
21723
  add(record) {
21716
21724
  this.records.set(record.id, record);
@@ -23030,7 +23038,7 @@ var EngineOrchestrator = class _EngineOrchestrator {
23030
23038
  this.engines.set(language, engine);
23031
23039
  }
23032
23040
  addIndicator(source, options = {}) {
23033
- const id = this.registry.nextId();
23041
+ const id = this.claimIndicatorId(options.id);
23034
23042
  const title = options.title ?? "Indicator";
23035
23043
  const handle = new IndicatorHandleImpl(id, title, this, source);
23036
23044
  this.handles.set(id, handle);
@@ -23052,7 +23060,7 @@ var EngineOrchestrator = class _EngineOrchestrator {
23052
23060
  const existing = this.registry.all().find((r) => r.native?.type === type);
23053
23061
  if (existing) return this.handles.get(existing.id) ?? new IndicatorHandleImpl(existing.id, existing.title, this, void 0, type);
23054
23062
  }
23055
- const id = this.registry.nextId("native");
23063
+ const id = this.registry.nextId("native", (candidate) => this.handles.has(candidate));
23056
23064
  const title = descriptor?.title ?? type;
23057
23065
  const handle = new IndicatorHandleImpl(id, title, this, void 0, type);
23058
23066
  this.handles.set(id, handle);
@@ -23330,6 +23338,24 @@ var EngineOrchestrator = class _EngineOrchestrator {
23330
23338
  this.events.clear();
23331
23339
  }
23332
23340
  // ── internals ───────────────────────────────────────────────
23341
+ /**
23342
+ * The id a new script indicator runs under: the host's when supplied, else a minted
23343
+ * one. A host id is opaque but must be a non-empty string, and it must not be live
23344
+ * on this chart — a duplicate is a programming error surfaced synchronously, never
23345
+ * renamed behind the caller's back (the whole point of supplying one is that
23346
+ * `handle.id` equals what was passed). "Live" reads both the records and the handle
23347
+ * map: a fail-soft handle never enters the registry but still owns its id.
23348
+ */
23349
+ claimIndicatorId(requested) {
23350
+ if (requested === void 0) return this.registry.nextId("ind", (candidate) => this.handles.has(candidate));
23351
+ if (typeof requested !== "string" || requested.length === 0) {
23352
+ throw new TypeError("[vela] addIndicator: `id` must be a non-empty string");
23353
+ }
23354
+ if (this.handles.has(requested) || this.registry.get(requested)) {
23355
+ throw new Error(`[vela] addIndicator: indicator id "${requested}" is already live on this chart`);
23356
+ }
23357
+ return requested;
23358
+ }
23333
23359
  async startIndicator(id, source, options, handle) {
23334
23360
  try {
23335
23361
  await this.readyPromise;
@@ -26535,6 +26561,7 @@ function registerClassicIndicators() {
26535
26561
  }
26536
26562
 
26537
26563
  // src/Vela.ts
26564
+ var asError = (err) => err instanceof Error ? err : new Error(String(err));
26538
26565
  var Vela = class {
26539
26566
  constructor(container, options = {}, deps = {}) {
26540
26567
  registerBuiltinChartTypes();
@@ -26658,7 +26685,12 @@ var Vela = class {
26658
26685
  * fetch from — the same relationship `script:run` has to `context:changed`.
26659
26686
  */
26660
26687
  runScript(source, options) {
26661
- const handle = this.addIndicator(source, options);
26688
+ let handle;
26689
+ try {
26690
+ handle = this.addIndicator(source, options);
26691
+ } catch (err) {
26692
+ return Promise.resolve({ ok: false, run: null, error: asError(err), onUpdate: () => () => void 0, remove: () => void 0 });
26693
+ }
26662
26694
  const updates = /* @__PURE__ */ new Set();
26663
26695
  const drop = () => {
26664
26696
  try {
@@ -26702,7 +26734,12 @@ var Vela = class {
26702
26734
  });
26703
26735
  }
26704
26736
  runIndicator(source, options) {
26705
- const handle = this.addIndicator(source, options);
26737
+ let handle;
26738
+ try {
26739
+ handle = this.addIndicator(source, options);
26740
+ } catch (err) {
26741
+ return Promise.resolve({ ok: false, handle: null, error: asError(err), context: null });
26742
+ }
26706
26743
  return new Promise((resolve) => {
26707
26744
  const offReady = handle.on("ready", () => {
26708
26745
  offReady();
@@ -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, 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-DNBoMKkX.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-DLeFs1gE.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, 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-D1AJKsn_.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-CmWUtDVL.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -1684,6 +1684,12 @@ interface ExternalIndicatorEntry {
1684
1684
  name: string;
1685
1685
  /** The script source (the recorded undo/redo action re-adds from it). */
1686
1686
  script: string;
1687
+ /** The indicator's id on the chart (see `AddIndicatorOptions.id`) — what a persistence
1688
+ * handler stores and hands back on restore so the indicator comes back under the id
1689
+ * its document knows. Omitted: the chart mints one. Either way undo/redo re-add the
1690
+ * indicator under the id it first ran with. An id already live on the cell's chart
1691
+ * is rejected (a warning; nothing is added). */
1692
+ id?: string;
1687
1693
  /** Engine language (default: the chart's default engine). */
1688
1694
  language?: string;
1689
1695
  /** Input-value overrides applied at add time (what a persistence handler restores). */
@@ -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, 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-DNBoMKkX.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-Dut6lXGM.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, 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-D1AJKsn_.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-CGa4KHRa.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -1684,6 +1684,12 @@ interface ExternalIndicatorEntry {
1684
1684
  name: string;
1685
1685
  /** The script source (the recorded undo/redo action re-adds from it). */
1686
1686
  script: string;
1687
+ /** The indicator's id on the chart (see `AddIndicatorOptions.id`) — what a persistence
1688
+ * handler stores and hands back on restore so the indicator comes back under the id
1689
+ * its document knows. Omitted: the chart mints one. Either way undo/redo re-add the
1690
+ * indicator under the id it first ran with. An id already live on the cell's chart
1691
+ * is rejected (a warning; nothing is added). */
1692
+ id?: string;
1687
1693
  /** Engine language (default: the chart's default engine). */
1688
1694
  language?: string;
1689
1695
  /** Input-value overrides applied at add time (what a persistence handler restores). */
package/dist/index.cjs CHANGED
@@ -129,10 +129,18 @@ var IndicatorRegistry = class {
129
129
  this.records = /* @__PURE__ */ new Map();
130
130
  this.counter = 0;
131
131
  }
132
- /** Allocate a unique, stable per-instance id. */
133
- nextId(prefix = "ind") {
134
- this.counter += 1;
135
- return `${prefix}-${this.counter}`;
132
+ /**
133
+ * Mint a unique per-instance id. Host-supplied ids share the namespace, so a minted
134
+ * id skips anything already recorded — and anything `taken` reports live elsewhere
135
+ * (a handle the orchestrator holds outside the records, e.g. a fail-soft native).
136
+ */
137
+ nextId(prefix = "ind", taken = () => false) {
138
+ let id;
139
+ do {
140
+ this.counter += 1;
141
+ id = `${prefix}-${this.counter}`;
142
+ } while (this.records.has(id) || taken(id));
143
+ return id;
136
144
  }
137
145
  add(record) {
138
146
  this.records.set(record.id, record);
@@ -8677,7 +8685,7 @@ var EngineOrchestrator = class _EngineOrchestrator {
8677
8685
  this.engines.set(language, engine);
8678
8686
  }
8679
8687
  addIndicator(source, options = {}) {
8680
- const id = this.registry.nextId();
8688
+ const id = this.claimIndicatorId(options.id);
8681
8689
  const title = options.title ?? "Indicator";
8682
8690
  const handle = new IndicatorHandleImpl(id, title, this, source);
8683
8691
  this.handles.set(id, handle);
@@ -8699,7 +8707,7 @@ var EngineOrchestrator = class _EngineOrchestrator {
8699
8707
  const existing = this.registry.all().find((r) => r.native?.type === type);
8700
8708
  if (existing) return this.handles.get(existing.id) ?? new IndicatorHandleImpl(existing.id, existing.title, this, void 0, type);
8701
8709
  }
8702
- const id = this.registry.nextId("native");
8710
+ const id = this.registry.nextId("native", (candidate) => this.handles.has(candidate));
8703
8711
  const title = descriptor?.title ?? type;
8704
8712
  const handle = new IndicatorHandleImpl(id, title, this, void 0, type);
8705
8713
  this.handles.set(id, handle);
@@ -8977,6 +8985,24 @@ var EngineOrchestrator = class _EngineOrchestrator {
8977
8985
  this.events.clear();
8978
8986
  }
8979
8987
  // ── internals ───────────────────────────────────────────────
8988
+ /**
8989
+ * The id a new script indicator runs under: the host's when supplied, else a minted
8990
+ * one. A host id is opaque but must be a non-empty string, and it must not be live
8991
+ * on this chart — a duplicate is a programming error surfaced synchronously, never
8992
+ * renamed behind the caller's back (the whole point of supplying one is that
8993
+ * `handle.id` equals what was passed). "Live" reads both the records and the handle
8994
+ * map: a fail-soft handle never enters the registry but still owns its id.
8995
+ */
8996
+ claimIndicatorId(requested) {
8997
+ if (requested === void 0) return this.registry.nextId("ind", (candidate) => this.handles.has(candidate));
8998
+ if (typeof requested !== "string" || requested.length === 0) {
8999
+ throw new TypeError("[vela] addIndicator: `id` must be a non-empty string");
9000
+ }
9001
+ if (this.handles.has(requested) || this.registry.get(requested)) {
9002
+ throw new Error(`[vela] addIndicator: indicator id "${requested}" is already live on this chart`);
9003
+ }
9004
+ return requested;
9005
+ }
8980
9006
  async startIndicator(id, source, options, handle) {
8981
9007
  try {
8982
9008
  await this.readyPromise;
@@ -35587,6 +35613,7 @@ function registerClassicIndicators() {
35587
35613
  }
35588
35614
 
35589
35615
  // src/Vela.ts
35616
+ var asError = (err) => err instanceof Error ? err : new Error(String(err));
35590
35617
  var Vela = class {
35591
35618
  constructor(container, options = {}, deps = {}) {
35592
35619
  registerBuiltinChartTypes();
@@ -35710,7 +35737,12 @@ var Vela = class {
35710
35737
  * fetch from — the same relationship `script:run` has to `context:changed`.
35711
35738
  */
35712
35739
  runScript(source, options) {
35713
- const handle = this.addIndicator(source, options);
35740
+ let handle;
35741
+ try {
35742
+ handle = this.addIndicator(source, options);
35743
+ } catch (err) {
35744
+ return Promise.resolve({ ok: false, run: null, error: asError(err), onUpdate: () => () => void 0, remove: () => void 0 });
35745
+ }
35714
35746
  const updates = /* @__PURE__ */ new Set();
35715
35747
  const drop = () => {
35716
35748
  try {
@@ -35754,7 +35786,12 @@ var Vela = class {
35754
35786
  });
35755
35787
  }
35756
35788
  runIndicator(source, options) {
35757
- const handle = this.addIndicator(source, options);
35789
+ let handle;
35790
+ try {
35791
+ handle = this.addIndicator(source, options);
35792
+ } catch (err) {
35793
+ return Promise.resolve({ ok: false, handle: null, error: asError(err), context: null });
35794
+ }
35758
35795
  return new Promise((resolve) => {
35759
35796
  const offReady = handle.on("ready", () => {
35760
35797
  offReady();
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { D as DrawingsDocument, R as Resolved } from './contributions-DYtiRtES.cjs';
2
- export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, c as DataControl, d as DrawingsControl, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, n as IndicatorEventMap, I as IndicatorHandle, o as IndicatorSummary, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, M as MarksControl, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, P as ParsedSymbol, y as PreparedScript, z as RendererControl, A as RunIndicatorResult, G as SceneInspection, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a0 as TypedEventBus, V as Vela, a1 as VelaDeps, a2 as VelaEventMap, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, aa as nativeIndicatorDescriptors, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-DYtiRtES.cjs';
3
- import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, e as IChartRenderer, R as RendererCapabilities, f as RendererDisplayOptions, g as IndicatorRenderHandle, h as IndicatorStatus, c as VelaTheme, W as WallClock, O as OHLCV, i as Pane, j as PaneAction, k as MoveTarget, l as IndicatorModel, m as ScenePatch, I as InputValue, n as SymbolPickerFn, o as LegendActionView, p as LegendCalloutView, q as InputChangeEvent, T as ThemeName, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, s as TimelineMark, t as MarkGroup, u as MarkClickEvent, a as VisibleRange, v as DataWindowReadout, w as IDrawingsRendererPort, x as Millis, y as SnapMode, z as DrawingTypeKey, B as ToolbarDefinition, M as MarketConfig } from './options-DNBoMKkX.cjs';
4
- export { E as AddIndicatorOptions, F as AnimationConfig, G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, _ as DataWindowGroup, $ as DataWindowOHLC, a0 as DataWindowRow, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a4 as DrawingIntent, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, a8 as DrawingMode, a9 as DrawingPoint, aa as DrawingPolyline, ab as DrawingSeriesBar, ac as DrawingSeriesGateway, ad as DrawingSeriesState, ae as DrawingStyle, af as DrawingTable, ag as DrawingText, ah as DrawingXLoc, ai as DrawingsOption, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, am as InputCondition, an as InputSchema, ao as InputType, ap as InputWhen, aq as IntroAnimation, ar as IntroConfig, as as IntroStyle, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, ay as MarkContent, az as MarkContentSource, aA as MarkGlyph, aB as MarkPanelItem, aC as MarkShape, aD as MarkerPoint, aE as MarkerSeries, aF as MarketSnapshot, aG as MarketSwitch, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, aN as Projector, aO as ProviderName, aP as RendererConstructor, aQ as Scene, aR as SchemaPatch, aS as SecondClock, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, aZ as SettingsField, a_ as SettingsSchema, a$ as SettingsVisibilityPolicy, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b3 as ToolbarGroupConfig, b4 as TradeExecution, b5 as ValuePatch, b as VelaOptions, V as VisibleRangePreset, b6 as buildToolbar, b7 as defaultToolbar, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-DNBoMKkX.cjs';
5
- import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-Dut6lXGM.cjs';
6
- export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, Y as createDrawing, Z as deserializeDrawing, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a2 as registerDrawingType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-DtkeQVAO.cjs';
1
+ import { D as DrawingsDocument, R as Resolved } from './contributions-D6p1RB38.cjs';
2
+ export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, c as DataControl, d as DrawingsControl, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, n as IndicatorEventMap, I as IndicatorHandle, o as IndicatorSummary, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, M as MarksControl, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, P as ParsedSymbol, y as PreparedScript, z as RendererControl, A as RunIndicatorResult, G as SceneInspection, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a0 as TypedEventBus, V as Vela, a1 as VelaDeps, a2 as VelaEventMap, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, aa as nativeIndicatorDescriptors, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-D6p1RB38.cjs';
3
+ import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, e as IChartRenderer, R as RendererCapabilities, f as RendererDisplayOptions, g as IndicatorRenderHandle, h as IndicatorStatus, c as VelaTheme, W as WallClock, O as OHLCV, i as Pane, j as PaneAction, k as MoveTarget, l as IndicatorModel, m as ScenePatch, I as InputValue, n as SymbolPickerFn, o as LegendActionView, p as LegendCalloutView, q as InputChangeEvent, T as ThemeName, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, s as TimelineMark, t as MarkGroup, u as MarkClickEvent, a as VisibleRange, v as DataWindowReadout, w as IDrawingsRendererPort, x as Millis, y as SnapMode, z as DrawingTypeKey, B as ToolbarDefinition, M as MarketConfig } from './options-D1AJKsn_.cjs';
4
+ export { E as AddIndicatorOptions, F as AnimationConfig, G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, _ as DataWindowGroup, $ as DataWindowOHLC, a0 as DataWindowRow, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a4 as DrawingIntent, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, a8 as DrawingMode, a9 as DrawingPoint, aa as DrawingPolyline, ab as DrawingSeriesBar, ac as DrawingSeriesGateway, ad as DrawingSeriesState, ae as DrawingStyle, af as DrawingTable, ag as DrawingText, ah as DrawingXLoc, ai as DrawingsOption, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, am as InputCondition, an as InputSchema, ao as InputType, ap as InputWhen, aq as IntroAnimation, ar as IntroConfig, as as IntroStyle, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, ay as MarkContent, az as MarkContentSource, aA as MarkGlyph, aB as MarkPanelItem, aC as MarkShape, aD as MarkerPoint, aE as MarkerSeries, aF as MarketSnapshot, aG as MarketSwitch, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, aN as Projector, aO as ProviderName, aP as RendererConstructor, aQ as Scene, aR as SchemaPatch, aS as SecondClock, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, aZ as SettingsField, a_ as SettingsSchema, a$ as SettingsVisibilityPolicy, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b3 as ToolbarGroupConfig, b4 as TradeExecution, b5 as ValuePatch, b as VelaOptions, V as VisibleRangePreset, b6 as buildToolbar, b7 as defaultToolbar, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-D1AJKsn_.cjs';
5
+ import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-CGa4KHRa.cjs';
6
+ export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, Y as createDrawing, Z as deserializeDrawing, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a2 as registerDrawingType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-CxWfg6vK.cjs';
7
7
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-HF0IAzwf.cjs';
8
8
  export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.cjs';
9
9
  export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.cjs';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { D as DrawingsDocument, R as Resolved } from './contributions-CEkgJKTU.js';
2
- export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, c as DataControl, d as DrawingsControl, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, n as IndicatorEventMap, I as IndicatorHandle, o as IndicatorSummary, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, M as MarksControl, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, P as ParsedSymbol, y as PreparedScript, z as RendererControl, A as RunIndicatorResult, G as SceneInspection, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a0 as TypedEventBus, V as Vela, a1 as VelaDeps, a2 as VelaEventMap, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, aa as nativeIndicatorDescriptors, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-CEkgJKTU.js';
3
- import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, e as IChartRenderer, R as RendererCapabilities, f as RendererDisplayOptions, g as IndicatorRenderHandle, h as IndicatorStatus, c as VelaTheme, W as WallClock, O as OHLCV, i as Pane, j as PaneAction, k as MoveTarget, l as IndicatorModel, m as ScenePatch, I as InputValue, n as SymbolPickerFn, o as LegendActionView, p as LegendCalloutView, q as InputChangeEvent, T as ThemeName, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, s as TimelineMark, t as MarkGroup, u as MarkClickEvent, a as VisibleRange, v as DataWindowReadout, w as IDrawingsRendererPort, x as Millis, y as SnapMode, z as DrawingTypeKey, B as ToolbarDefinition, M as MarketConfig } from './options-DNBoMKkX.js';
4
- export { E as AddIndicatorOptions, F as AnimationConfig, G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, _ as DataWindowGroup, $ as DataWindowOHLC, a0 as DataWindowRow, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a4 as DrawingIntent, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, a8 as DrawingMode, a9 as DrawingPoint, aa as DrawingPolyline, ab as DrawingSeriesBar, ac as DrawingSeriesGateway, ad as DrawingSeriesState, ae as DrawingStyle, af as DrawingTable, ag as DrawingText, ah as DrawingXLoc, ai as DrawingsOption, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, am as InputCondition, an as InputSchema, ao as InputType, ap as InputWhen, aq as IntroAnimation, ar as IntroConfig, as as IntroStyle, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, ay as MarkContent, az as MarkContentSource, aA as MarkGlyph, aB as MarkPanelItem, aC as MarkShape, aD as MarkerPoint, aE as MarkerSeries, aF as MarketSnapshot, aG as MarketSwitch, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, aN as Projector, aO as ProviderName, aP as RendererConstructor, aQ as Scene, aR as SchemaPatch, aS as SecondClock, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, aZ as SettingsField, a_ as SettingsSchema, a$ as SettingsVisibilityPolicy, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b3 as ToolbarGroupConfig, b4 as TradeExecution, b5 as ValuePatch, b as VelaOptions, V as VisibleRangePreset, b6 as buildToolbar, b7 as defaultToolbar, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-DNBoMKkX.js';
5
- import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-DLeFs1gE.js';
6
- export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, Y as createDrawing, Z as deserializeDrawing, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a2 as registerDrawingType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-CLn--oP6.js';
1
+ import { D as DrawingsDocument, R as Resolved } from './contributions-C7Wsm_S9.js';
2
+ export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, c as DataControl, d as DrawingsControl, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, n as IndicatorEventMap, I as IndicatorHandle, o as IndicatorSummary, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, M as MarksControl, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, P as ParsedSymbol, y as PreparedScript, z as RendererControl, A as RunIndicatorResult, G as SceneInspection, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a0 as TypedEventBus, V as Vela, a1 as VelaDeps, a2 as VelaEventMap, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, aa as nativeIndicatorDescriptors, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-C7Wsm_S9.js';
3
+ import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, e as IChartRenderer, R as RendererCapabilities, f as RendererDisplayOptions, g as IndicatorRenderHandle, h as IndicatorStatus, c as VelaTheme, W as WallClock, O as OHLCV, i as Pane, j as PaneAction, k as MoveTarget, l as IndicatorModel, m as ScenePatch, I as InputValue, n as SymbolPickerFn, o as LegendActionView, p as LegendCalloutView, q as InputChangeEvent, T as ThemeName, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, s as TimelineMark, t as MarkGroup, u as MarkClickEvent, a as VisibleRange, v as DataWindowReadout, w as IDrawingsRendererPort, x as Millis, y as SnapMode, z as DrawingTypeKey, B as ToolbarDefinition, M as MarketConfig } from './options-D1AJKsn_.js';
4
+ export { E as AddIndicatorOptions, F as AnimationConfig, G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, _ as DataWindowGroup, $ as DataWindowOHLC, a0 as DataWindowRow, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a4 as DrawingIntent, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, a8 as DrawingMode, a9 as DrawingPoint, aa as DrawingPolyline, ab as DrawingSeriesBar, ac as DrawingSeriesGateway, ad as DrawingSeriesState, ae as DrawingStyle, af as DrawingTable, ag as DrawingText, ah as DrawingXLoc, ai as DrawingsOption, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, am as InputCondition, an as InputSchema, ao as InputType, ap as InputWhen, aq as IntroAnimation, ar as IntroConfig, as as IntroStyle, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, ay as MarkContent, az as MarkContentSource, aA as MarkGlyph, aB as MarkPanelItem, aC as MarkShape, aD as MarkerPoint, aE as MarkerSeries, aF as MarketSnapshot, aG as MarketSwitch, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, aN as Projector, aO as ProviderName, aP as RendererConstructor, aQ as Scene, aR as SchemaPatch, aS as SecondClock, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, aZ as SettingsField, a_ as SettingsSchema, a$ as SettingsVisibilityPolicy, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b3 as ToolbarGroupConfig, b4 as TradeExecution, b5 as ValuePatch, b as VelaOptions, V as VisibleRangePreset, b6 as buildToolbar, b7 as defaultToolbar, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-D1AJKsn_.js';
5
+ import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-CmWUtDVL.js';
6
+ export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, Y as createDrawing, Z as deserializeDrawing, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a2 as registerDrawingType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-SodaQhjQ.js';
7
7
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-HF0IAzwf.js';
8
8
  export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.js';
9
9
  export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-JU4CWEBF.js';
2
- export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-MCLI6B3S.js';
2
+ export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-JSVCWYBF.js';
3
3
  export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_WIDTH, Drawing, OVERRIDABLE_TOPBAR_IDS, chartType, chartTypes, clampPanelWidth, createDrawing, deserializeDrawing, drawingTypes, getDrawingType, getNativeIndicator, inputDeltas, inputVisible, legendActions, legendCallouts, nativeIndicatorDescriptors, nativeIndicatorTypes, normalizeSettingsRow, registerChartType, registerDefaultEngine, registerDrawingType, registerLegendAction, registerLegendCallout, registerNativeIndicator, registerRendererDefaults, registerRendererLayer, registerSidePanel, registerStatePersistence, registerSymbolRanking, registerWidgetAction, registerWidgetAttachment, rendererDefaults, rendererLayers, resolveEngines, seriesInScale, seriesShownOn, settingsRowValueKeys, sidePanels, stableSeriesId, statePersistenceHandlers, symbolRanking, tickerModifierIds, topbarActionOverride, unregisterChartType, unregisterDefaultEngine, unregisterLegendAction, unregisterLegendCallout, unregisterNativeIndicator, unregisterRendererDefaults, unregisterRendererLayer, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-BFA32GOU.js';
4
4
  import './chunk-BKHSQ4YM.js';
5
5
  export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CHIP_PLATE, CROSSHAIR, HIGHLIGHT, INFO, INVALID, MARKER, NEUTRAL, SERIES_LINE, SESSION_OFF, SESSION_POST, SESSION_PRE, SLATE, SLATE_DEEP, TRADE_EXIT, TRADE_LONG, TRADE_SHORT, VALID, WARNING, categoricalColor, iconMarkup, registerIcon } from './chunk-CAFCLMPF.js';
@@ -2082,6 +2082,16 @@ interface PaneInfo {
2082
2082
  }
2083
2083
  /** Options for `chart.addIndicator(source, options?)`. */
2084
2084
  interface AddIndicatorOptions {
2085
+ /**
2086
+ * The indicator's id — an opaque, non-empty string the host owns (a document key, an
2087
+ * editor tab, a UUID). It is what `handle.id`, `chart.indicators()`, the `indicator:*`
2088
+ * events, `script:run`, and the legend/pane surfaces carry, so a host that supplies
2089
+ * it can address the indicator without keeping a side map. Omit it and the chart
2090
+ * mints one (stable for the chart's lifetime, not across reloads). An id already live
2091
+ * on this chart is rejected: `addIndicator` throws, `runIndicator`/`runScript`
2092
+ * resolve `{ ok: false }` — never renamed silently.
2093
+ */
2094
+ id?: string;
2085
2095
  /** Which registered engine runs this script (by language id). Default: the chart's `defaultLanguage`. */
2086
2096
  language?: string;
2087
2097
  /** Input overrides, keyed by input title or varId. */
@@ -2082,6 +2082,16 @@ interface PaneInfo {
2082
2082
  }
2083
2083
  /** Options for `chart.addIndicator(source, options?)`. */
2084
2084
  interface AddIndicatorOptions {
2085
+ /**
2086
+ * The indicator's id — an opaque, non-empty string the host owns (a document key, an
2087
+ * editor tab, a UUID). It is what `handle.id`, `chart.indicators()`, the `indicator:*`
2088
+ * events, `script:run`, and the legend/pane surfaces carry, so a host that supplies
2089
+ * it can address the indicator without keeping a side map. Omit it and the chart
2090
+ * mints one (stable for the chart's lifetime, not across reloads). An id already live
2091
+ * on this chart is rejected: `addIndicator` throws, `runIndicator`/`runScript`
2092
+ * resolve `{ ok: false }` — never renamed silently.
2093
+ */
2094
+ id?: string;
2085
2095
  /** Which registered engine runs this script (by language id). Default: the chart's `defaultLanguage`. */
2086
2096
  language?: string;
2087
2097
  /** Input overrides, keyed by input title or varId. */
@@ -1,9 +1,9 @@
1
- import { z as DrawingTypeKey, ae as DrawingStyle, S as SerializedDrawing, D as Drawing, aU as SeriesKind, O as OHLCV, c as VelaTheme } from './options-DNBoMKkX.cjs';
2
- import { c as DataControl } from './contributions-DYtiRtES.cjs';
1
+ import { z as DrawingTypeKey, ae as DrawingStyle, S as SerializedDrawing, D as Drawing, aU as SeriesKind, O as OHLCV, c as VelaTheme } from './options-D1AJKsn_.cjs';
2
+ import { c as DataControl } from './contributions-D6p1RB38.cjs';
3
3
  import './side-panel-HF0IAzwf.cjs';
4
4
  import './icons-BZYbJXSV.cjs';
5
5
  import './keymap-CGOz5F5f.cjs';
6
- import './DataProvider-Dut6lXGM.cjs';
6
+ import './DataProvider-CGa4KHRa.cjs';
7
7
 
8
8
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
9
  interface DrawingTypeMeta {
@@ -1,9 +1,9 @@
1
- import { z as DrawingTypeKey, ae as DrawingStyle, S as SerializedDrawing, D as Drawing, aU as SeriesKind, O as OHLCV, c as VelaTheme } from './options-DNBoMKkX.js';
2
- import { c as DataControl } from './contributions-CEkgJKTU.js';
1
+ import { z as DrawingTypeKey, ae as DrawingStyle, S as SerializedDrawing, D as Drawing, aU as SeriesKind, O as OHLCV, c as VelaTheme } from './options-D1AJKsn_.js';
2
+ import { c as DataControl } from './contributions-C7Wsm_S9.js';
3
3
  import './side-panel-HF0IAzwf.js';
4
4
  import './icons-BZYbJXSV.js';
5
5
  import './keymap-CGOz5F5f.js';
6
- import './DataProvider-DLeFs1gE.js';
6
+ import './DataProvider-CmWUtDVL.js';
7
7
 
8
8
  /** What a drawing type contributes to the toolbar + factory (renderer-neutral). */
9
9
  interface DrawingTypeMeta {
package/dist/plugin.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-DtkeQVAO.cjs';
2
- export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, y as PreparedScript, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-DYtiRtES.cjs';
1
+ export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-CxWfg6vK.cjs';
2
+ export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, y as PreparedScript, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-D6p1RB38.cjs';
3
3
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-HF0IAzwf.cjs';
4
- export { G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, aa as DrawingPolyline, af as DrawingTable, z as DrawingTypeKey, ah as DrawingXLoc, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, l as IndicatorModel, am as InputCondition, an as InputSchema, ao as InputType, I as InputValue, ap as InputWhen, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, L as LineStyle, aD as MarkerPoint, aE as MarkerSeries, x as Millis, O as OHLCV, i as Pane, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, P as PriceStyle, aQ as Scene, m as ScenePatch, aR as SchemaPatch, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b4 as TradeExecution, b5 as ValuePatch, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-DNBoMKkX.cjs';
4
+ export { G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, aa as DrawingPolyline, af as DrawingTable, z as DrawingTypeKey, ah as DrawingXLoc, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, l as IndicatorModel, am as InputCondition, an as InputSchema, ao as InputType, I as InputValue, ap as InputWhen, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, L as LineStyle, aD as MarkerPoint, aE as MarkerSeries, x as Millis, O as OHLCV, i as Pane, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, P as PriceStyle, aQ as Scene, m as ScenePatch, aR as SchemaPatch, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b4 as TradeExecution, b5 as ValuePatch, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-D1AJKsn_.cjs';
5
5
  export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.cjs';
6
6
  export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.cjs';
7
- export { B as BarRange, D as DataProvider, M as MarketDataFeed, b as ProviderCapabilities, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo } from './DataProvider-Dut6lXGM.cjs';
7
+ export { B as BarRange, D as DataProvider, M as MarketDataFeed, b as ProviderCapabilities, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo } from './DataProvider-CGa4KHRa.cjs';
package/dist/plugin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-CLn--oP6.js';
2
- export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, y as PreparedScript, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-CEkgJKTU.js';
1
+ export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, d as BasePaintingModulation, C as CATEGORICAL, e as CHIP_PLATE, f as CROSSHAIR, g as ChartTypeDefinition, h as ChartTypeSettingsInstance, i as ChartTypeSettingsSection, j as ChartTypeSettingsSubsection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, k as INVALID, l as IdentifiableKind, M as MARKER, N as NEUTRAL, m as NormalizedSettingsRow, R as RendererLayerArgs, n as RendererLayerDefinition, o as RendererLayerInstance, S as SERIES_LINE, p as SESSION_OFF, q as SESSION_POST, r as SESSION_PRE, s as SLATE, t as SLATE_DEEP, u as SeriesDataEngine, v as SeriesDataEngineHost, w as SettingsInlineControl, x as SettingsRowCondition, y as SettingsRowDescriptor, z as SettingsRowInlineNumber, E as SettingsRowSwatch, F as SettingsRowValueKey, G as SettingsRowWhen, J as SettingsRowWidth, K as SettingsSelectOption, L as SettingsValueRow, T as TRADE_EXIT, O as TRADE_LONG, P as TRADE_SHORT, V as VALID, W as WARNING, Q as categoricalColor, U as chartType, X as chartTypes, _ as drawingTypes, $ as getDrawingType, a0 as normalizeSettingsRow, a1 as registerChartType, a3 as registerRendererDefaults, a4 as registerRendererLayer, a5 as rendererDefaults, a6 as rendererLayers, a7 as settingsRowValueKeys, a8 as stableSeriesId, a9 as tickerModifierIds, aa as unregisterChartType, ab as unregisterRendererDefaults, ac as unregisterRendererLayer } from './plugin-SodaQhjQ.js';
2
+ export { B as BarsChangeReason, C as CellStateContext, b as ContextSelect, e as EngineAlert, f as EngineCapabilities, g as EngineContextSnapshot, h as EngineFactory, i as EngineWarning, j as ExecutionHandlers, k as ExecutionMarket, l as ExecutionRequest, m as ExecutionSession, E as ExternalIndicatorEntry, F as FetchSeries, L as LegendActionDescriptor, p as LegendCalloutContent, q as LegendCalloutDescriptor, r as LegendCalloutItem, s as LegendCalloutSpec, t as LegendIndicatorInfo, N as NativeIndicator, u as NativeIndicatorContext, v as NativeIndicatorDescriptor, w as NativeIndicatorInfo, x as NativeIndicatorOutput, O as OVERRIDABLE_TOPBAR_IDS, y as PreparedScript, a as ScriptRun, H as ScriptRunCause, J as ScriptRunResult, S as ScriptingEngine, K as SidePanelButton, Q as SidePanelDescriptor, T as SidePanelHandle, U as SidePanelHeader, X as StatePersistenceHandler, Y as StrategyFill, Z as StrategyState, _ as StrategyTrade, $ as SymbolRankingHook, a3 as VisibleBarRange, a4 as WidgetActionDescriptor, a5 as WidgetActionTarget, a6 as WidgetAttachment, W as WidgetContext, a7 as getNativeIndicator, a8 as legendActions, a9 as legendCallouts, ab as nativeIndicatorTypes, ac as registerDefaultEngine, ad as registerLegendAction, ae as registerLegendCallout, af as registerNativeIndicator, ag as registerSidePanel, ah as registerStatePersistence, ai as registerSymbolRanking, aj as registerWidgetAction, ak as registerWidgetAttachment, al as resolveEngines, am as sidePanels, an as statePersistenceHandlers, ao as symbolRanking, ap as topbarActionOverride, aq as unregisterDefaultEngine, ar as unregisterLegendAction, as as unregisterLegendCallout, at as unregisterNativeIndicator, au as unregisterSidePanel, av as unregisterStatePersistence, aw as unregisterWidgetAction, ax as unregisterWidgetAttachment, ay as widgetActions, az as widgetAttachments } from './contributions-C7Wsm_S9.js';
3
3
  export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-HF0IAzwf.js';
4
- export { G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, aa as DrawingPolyline, af as DrawingTable, z as DrawingTypeKey, ah as DrawingXLoc, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, l as IndicatorModel, am as InputCondition, an as InputSchema, ao as InputType, I as InputValue, ap as InputWhen, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, L as LineStyle, aD as MarkerPoint, aE as MarkerSeries, x as Millis, O as OHLCV, i as Pane, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, P as PriceStyle, aQ as Scene, m as ScenePatch, aR as SchemaPatch, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b4 as TradeExecution, b5 as ValuePatch, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-DNBoMKkX.js';
4
+ export { G as Background, H as BoxFontFamily, J as BoxHAlign, K as BoxTextSize, Q as BoxVAlign, X as CandleBarColor, Y as CandleSeries, Z as CandleStyle, a1 as DirtyRange, a2 as DrawingBox, a3 as DrawingExtend, a5 as DrawingLabel, a6 as DrawingLine, a7 as DrawingLinefill, aa as DrawingPolyline, af as DrawingTable, z as DrawingTypeKey, ah as DrawingXLoc, aj as Fill, ak as FillGradientStop, al as IndicatorMeta, l as IndicatorModel, am as InputCondition, an as InputSchema, ao as InputType, I as InputValue, ap as InputWhen, at as LabelStyle, au as LabelYLoc, av as LineLikeKind, aw as LineLikeSeries, ax as LineLikeStyle, L as LineStyle, aD as MarkerPoint, aE as MarkerSeries, x as Millis, O as OHLCV, i as Pane, aH as PaneAxis, aI as PaneAxisBand, aJ as PaneHint, aK as PaneKind, aL as PolylinePoint, aM as PriceLine, P as PriceStyle, aQ as Scene, m as ScenePatch, aR as SchemaPatch, aT as SeriesDisplay, aU as SeriesKind, aV as SeriesPoint, aW as SeriesSpec, aX as SeriesSurface, aY as SeriesValueDelta, b0 as TableCell, b1 as TableMerge, b2 as TablePosition, b4 as TradeExecution, b5 as ValuePatch, b8 as inputDeltas, b9 as inputVisible, ba as seriesInScale, bb as seriesShownOn } from './options-D1AJKsn_.js';
5
5
  export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.js';
6
6
  export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
7
- export { B as BarRange, D as DataProvider, M as MarketDataFeed, b as ProviderCapabilities, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo } from './DataProvider-DLeFs1gE.js';
7
+ export { B as BarRange, D as DataProvider, M as MarketDataFeed, b as ProviderCapabilities, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo } from './DataProvider-CmWUtDVL.js';
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.cjs';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-Dut6lXGM.cjs';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.cjs';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CGa4KHRa.cjs';
3
3
 
4
4
  /**
5
5
  * Binance market-data provider, built from scratch on the public REST + WebSocket
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.js';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-DLeFs1gE.js';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.js';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CmWUtDVL.js';
3
3
 
4
4
  /**
5
5
  * Binance market-data provider, built from scratch on the public REST + WebSocket
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.cjs';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-Dut6lXGM.cjs';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.cjs';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CGa4KHRa.cjs';
3
3
 
4
4
  /**
5
5
  * Coinbase market-data provider, built from scratch on the public Exchange REST + WebSocket APIs
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.js';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-DLeFs1gE.js';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.js';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CmWUtDVL.js';
3
3
 
4
4
  /**
5
5
  * Coinbase market-data provider, built from scratch on the public Exchange REST + WebSocket APIs
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.cjs';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-Dut6lXGM.cjs';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.cjs';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CGa4KHRa.cjs';
3
3
 
4
4
  /**
5
5
  * Hyperliquid market-data provider, built from scratch on the public info API — no
@@ -1,5 +1,5 @@
1
- import { O as OHLCV, U as Unsubscribe } from '../options-DNBoMKkX.js';
2
- import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-DLeFs1gE.js';
1
+ import { O as OHLCV, U as Unsubscribe } from '../options-D1AJKsn_.js';
2
+ import { D as DataProvider, P as ProviderInfo, B as BarRange, S as SymbolInfo, a as SymbolDescriptor } from '../DataProvider-CmWUtDVL.js';
3
3
 
4
4
  /**
5
5
  * Hyperliquid market-data provider, built from scratch on the public info API — no