@luxalgo/vela 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataProvider-DgS2UyMc.d.cts → DataProvider-Ce6PuCzQ.d.cts} +9 -0
- package/dist/{DataProvider-Cqc_BaJ9.d.ts → DataProvider-DNx9ntBD.d.ts} +9 -0
- package/dist/{chunk-JBQUY2RI.js → chunk-7ROONW6H.js} +14 -12
- package/dist/{chunk-D6WM5IUE.js → chunk-CA3N3PYT.js} +61 -6
- package/dist/{contributions-DuIxJWeH.d.ts → contributions-DToMhiw3.d.ts} +8 -1
- package/dist/{contributions-4Nh1jbvb.d.cts → contributions-Dlc7ZWZz.d.cts} +8 -1
- package/dist/{history-HofqYEh2.d.cts → history-BZADxpKx.d.cts} +2 -2
- package/dist/{history-FsmvCIo4.d.ts → history-BuHXJZJ2.d.ts} +2 -2
- package/dist/index.cjs +61 -6
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +1 -1
- package/dist/{plugin-DJR6z3e0.d.cts → plugin-BNPLOQO1.d.cts} +2 -2
- package/dist/{plugin-N_EaXN4-.d.ts → plugin-BqjEa5r3.d.ts} +2 -2
- package/dist/plugin.d.cts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/providers/binance.d.cts +1 -1
- package/dist/providers/binance.d.ts +1 -1
- package/dist/providers/coinbase.d.cts +1 -1
- package/dist/providers/coinbase.d.ts +1 -1
- package/dist/providers/hyperliquid.d.cts +1 -1
- package/dist/providers/hyperliquid.d.ts +1 -1
- package/dist/vela.global.js +61 -6
- package/dist/vela.global.min.js +29 -29
- package/dist/widget.cjs +84 -22
- package/dist/widget.d.cts +10 -14
- package/dist/widget.d.ts +10 -14
- package/dist/widget.js +14 -9
- package/dist/workspace.cjs +78 -18
- package/dist/workspace.d.cts +4 -4
- package/dist/workspace.d.ts +4 -4
- package/dist/workspace.js +7 -4
- package/package.json +1 -1
package/dist/widget.cjs
CHANGED
|
@@ -6936,7 +6936,7 @@ var ProviderRegistry = class {
|
|
|
6936
6936
|
/** Register (or replace) a provider; returns a promise that settles when its index is built. */
|
|
6937
6937
|
register(rawName, provider) {
|
|
6938
6938
|
const name = normName(rawName);
|
|
6939
|
-
const entry = { name, provider, index: null, descriptors: [], settled: false, settle: Promise.resolve() };
|
|
6939
|
+
const entry = { name, provider, index: null, prefixIndex: null, byTicker: null, descriptors: [], settled: false, settle: Promise.resolve() };
|
|
6940
6940
|
this.entries.set(name, entry);
|
|
6941
6941
|
entry.settle = this.buildIndex(entry);
|
|
6942
6942
|
queueMicrotask(() => this.notify(false));
|
|
@@ -6949,6 +6949,9 @@ var ProviderRegistry = class {
|
|
|
6949
6949
|
const symbols = await entry.provider.listSymbols();
|
|
6950
6950
|
entry.descriptors = symbols;
|
|
6951
6951
|
entry.index = new Set(symbols.map((s) => normTicker(s.ticker)));
|
|
6952
|
+
entry.byTicker = new Map(symbols.map((s) => [normTicker(s.ticker), s]));
|
|
6953
|
+
entry.prefixIndex = /* @__PURE__ */ new Map();
|
|
6954
|
+
for (const s of symbols) if (s.prefix) entry.prefixIndex.set(`${normName(s.prefix)}:${normTicker(s.ticker)}`, s);
|
|
6952
6955
|
}
|
|
6953
6956
|
} catch {
|
|
6954
6957
|
entry.index = null;
|
|
@@ -6984,14 +6987,25 @@ var ProviderRegistry = class {
|
|
|
6984
6987
|
}
|
|
6985
6988
|
/**
|
|
6986
6989
|
* Resolve a symbol to `{ provider, ticker }`, or null when nothing can serve it
|
|
6987
|
-
* yet. Explicit prefix → that provider (must be registered)
|
|
6988
|
-
*
|
|
6989
|
-
*
|
|
6990
|
-
*
|
|
6990
|
+
* yet. Explicit prefix → that provider (must be registered), else a provider whose
|
|
6991
|
+
* index declares that LISTING prefix for that ticker (`NASDAQ:AAPL` routes to the
|
|
6992
|
+
* provider serving Nasdaq-listed AAPL — TradingView-strict, so `NYSE:AAPL` resolves
|
|
6993
|
+
* to nothing rather than auto-correcting). Bare → first indexed provider
|
|
6994
|
+
* (registration order, `opts.default` first) that contains the ticker;
|
|
6995
|
+
* `opts.lenient` additionally allows a sole registered provider before its index
|
|
6996
|
+
* exists.
|
|
6991
6997
|
*/
|
|
6992
6998
|
resolve(raw, opts = {}) {
|
|
6993
6999
|
const { provider, ticker } = this.parse(raw);
|
|
6994
|
-
if (provider)
|
|
7000
|
+
if (provider) {
|
|
7001
|
+
if (this.entries.has(provider)) return { provider, ticker };
|
|
7002
|
+
const key = `${provider}:${normTicker(ticker)}`;
|
|
7003
|
+
for (const name of this.candidateOrder(opts.default)) {
|
|
7004
|
+
const d = this.entries.get(name).prefixIndex?.get(key);
|
|
7005
|
+
if (d) return { provider: name, ticker: d.ticker };
|
|
7006
|
+
}
|
|
7007
|
+
return null;
|
|
7008
|
+
}
|
|
6995
7009
|
const norm = normTicker(ticker);
|
|
6996
7010
|
for (const name of this.candidateOrder(opts.default)) {
|
|
6997
7011
|
if (this.entries.get(name).index?.has(norm)) return { provider: name, ticker };
|
|
@@ -7057,6 +7071,22 @@ var ProviderRegistry = class {
|
|
|
7057
7071
|
}
|
|
7058
7072
|
return names;
|
|
7059
7073
|
}
|
|
7074
|
+
/**
|
|
7075
|
+
* The DISPLAY prefix for a resolved symbol — the descriptor's LISTING prefix when the
|
|
7076
|
+
* data declares one, else the provider name. This is the single seam every label
|
|
7077
|
+
* (legend chip, committed/persisted `PREFIX:TICKER` strings) derives from, which is
|
|
7078
|
+
* what makes a non-canonical spelling impossible to display: the form always comes
|
|
7079
|
+
* from the data, never from what was typed.
|
|
7080
|
+
*/
|
|
7081
|
+
displayPrefixOf(resolved) {
|
|
7082
|
+
const d = this.entries.get(resolved.provider)?.byTicker?.get(normTicker(resolved.ticker));
|
|
7083
|
+
return d?.prefix ?? resolved.provider;
|
|
7084
|
+
}
|
|
7085
|
+
/** The canonical `PREFIX:TICKER` string for a resolved symbol (descriptor spellings). */
|
|
7086
|
+
canonicalSymbol(resolved) {
|
|
7087
|
+
const d = this.entries.get(resolved.provider)?.byTicker?.get(normTicker(resolved.ticker));
|
|
7088
|
+
return `${d?.prefix ?? resolved.provider}:${d?.ticker ?? resolved.ticker}`;
|
|
7089
|
+
}
|
|
7060
7090
|
/** Indexed symbols for one provider (or all, concatenated) — for autocomplete. */
|
|
7061
7091
|
symbolsOf(rawName) {
|
|
7062
7092
|
if (rawName != null) return this.entries.get(normName(rawName))?.descriptors ?? [];
|
|
@@ -9195,6 +9225,20 @@ var MultiProviderFeed = class {
|
|
|
9195
9225
|
resolveSymbol(raw) {
|
|
9196
9226
|
return this.registry.resolve(raw, { default: this.primaryProvider });
|
|
9197
9227
|
}
|
|
9228
|
+
/**
|
|
9229
|
+
* The DISPLAY prefix for `raw` — the descriptor's LISTING prefix when the data
|
|
9230
|
+
* declares one (`NASDAQ` for AAPL), else the resolved provider name. Null while
|
|
9231
|
+
* nothing resolves the symbol.
|
|
9232
|
+
*/
|
|
9233
|
+
displayPrefix(raw) {
|
|
9234
|
+
const resolved = this.resolveSymbol(raw);
|
|
9235
|
+
return resolved ? this.registry.displayPrefixOf(resolved) : null;
|
|
9236
|
+
}
|
|
9237
|
+
/** The canonical `PREFIX:TICKER` form of `raw`, or null while unresolvable. */
|
|
9238
|
+
canonicalSymbol(raw) {
|
|
9239
|
+
const resolved = this.resolveSymbol(raw);
|
|
9240
|
+
return resolved ? this.registry.canonicalSymbol(resolved) : null;
|
|
9241
|
+
}
|
|
9198
9242
|
/** The registered provider INSTANCE under `name` (undefined if unknown). */
|
|
9199
9243
|
providerInstance(name) {
|
|
9200
9244
|
return this.registry.get(name);
|
|
@@ -9400,6 +9444,17 @@ var DataControl = class {
|
|
|
9400
9444
|
resolve(symbol) {
|
|
9401
9445
|
return this.registry?.resolveSymbol(symbol) ?? null;
|
|
9402
9446
|
}
|
|
9447
|
+
/**
|
|
9448
|
+
* The DISPLAY prefix for `symbol` — the listing venue its descriptor declares
|
|
9449
|
+
* (`NASDAQ` for AAPL) or the resolved provider name. Null while unresolvable.
|
|
9450
|
+
*/
|
|
9451
|
+
displayPrefix(symbol) {
|
|
9452
|
+
return this.registry?.displayPrefix(symbol) ?? null;
|
|
9453
|
+
}
|
|
9454
|
+
/** The canonical `PREFIX:TICKER` form of `symbol`, or null while unresolvable. */
|
|
9455
|
+
canonicalSymbol(symbol) {
|
|
9456
|
+
return this.registry?.canonicalSymbol(symbol) ?? null;
|
|
9457
|
+
}
|
|
9403
9458
|
/**
|
|
9404
9459
|
* The registered provider INSTANCE under `name` — the seam for EXTENDED provider
|
|
9405
9460
|
* surfaces: a provider may implement interfaces beyond the `DataProvider` port
|
|
@@ -30608,10 +30663,11 @@ function parseQuery(raw, venues) {
|
|
|
30608
30663
|
function onlyOne(matches) {
|
|
30609
30664
|
return matches.length === 1 ? matches[0] : null;
|
|
30610
30665
|
}
|
|
30666
|
+
var venueOf = (s) => s.prefix ?? s.provider;
|
|
30611
30667
|
function filterSymbols(list, query, limit = 100) {
|
|
30612
|
-
const venues = [...new Set(list.
|
|
30668
|
+
const venues = [...new Set(list.flatMap((s) => [venueOf(s)?.toLowerCase(), s.provider?.toLowerCase()]).filter((p) => !!p))];
|
|
30613
30669
|
const { scope, term } = parseQuery(query, venues);
|
|
30614
|
-
const pool = scope ? list.filter((s) => s.provider?.toLowerCase() === scope) : list;
|
|
30670
|
+
const pool = scope ? list.filter((s) => venueOf(s)?.toLowerCase() === scope || s.provider?.toLowerCase() === scope) : list;
|
|
30615
30671
|
const q = term.toUpperCase();
|
|
30616
30672
|
if (!q) {
|
|
30617
30673
|
if (scope) return [...pool].sort((a, b) => a.ticker.localeCompare(b.ticker)).slice(0, limit);
|
|
@@ -30630,7 +30686,7 @@ function filterSymbols(list, query, limit = 100) {
|
|
|
30630
30686
|
if (t.startsWith(q)) prefix.push(s);
|
|
30631
30687
|
else if (t.includes(q)) substr.push(s);
|
|
30632
30688
|
else if ((s.description ?? "").toUpperCase().includes(q)) desc.push(s);
|
|
30633
|
-
else if (!scope && s.provider?.toLowerCase().includes(qLower)) venue.push(s);
|
|
30689
|
+
else if (!scope && (venueOf(s)?.toLowerCase().includes(qLower) || s.provider?.toLowerCase().includes(qLower))) venue.push(s);
|
|
30634
30690
|
if (prefix.length >= limit) break;
|
|
30635
30691
|
}
|
|
30636
30692
|
return [...prefix, ...substr, ...desc, ...venue].slice(0, limit);
|
|
@@ -30782,14 +30838,14 @@ var SymbolPicker = class {
|
|
|
30782
30838
|
else if (e.key === "ArrowUp") this.moveHighlight(-1);
|
|
30783
30839
|
else if (e.key === "Enter") {
|
|
30784
30840
|
const pick = this.rows[this.highlighted];
|
|
30785
|
-
if (pick) this.select(pick.ticker, pick.provider, opts.onSelect);
|
|
30841
|
+
if (pick) this.select(pick.ticker, pick.prefix ?? pick.provider, opts.onSelect);
|
|
30786
30842
|
return;
|
|
30787
30843
|
} else return;
|
|
30788
30844
|
e.preventDefault();
|
|
30789
30845
|
});
|
|
30790
30846
|
this.list.addEventListener("click", (e) => {
|
|
30791
30847
|
const row = e.target.closest(".vela-sp-row");
|
|
30792
|
-
if (row?.dataset.ticker) this.select(row.dataset.ticker, row.dataset.
|
|
30848
|
+
if (row?.dataset.ticker) this.select(row.dataset.ticker, row.dataset.venue, opts.onSelect);
|
|
30793
30849
|
});
|
|
30794
30850
|
}
|
|
30795
30851
|
/** Wire where symbols come from (re-called on every widget rebuild). */
|
|
@@ -30806,9 +30862,9 @@ var SymbolPicker = class {
|
|
|
30806
30862
|
destroy() {
|
|
30807
30863
|
this.dialog.destroy();
|
|
30808
30864
|
}
|
|
30809
|
-
select(ticker,
|
|
30865
|
+
select(ticker, venue, onSelect) {
|
|
30810
30866
|
this.close();
|
|
30811
|
-
onSelect(
|
|
30867
|
+
onSelect(venue ? `${venue}:${ticker}` : ticker);
|
|
30812
30868
|
}
|
|
30813
30869
|
moveHighlight(delta) {
|
|
30814
30870
|
if (!this.rows.length) return;
|
|
@@ -30841,7 +30897,8 @@ var SymbolPicker = class {
|
|
|
30841
30897
|
const row = doc.createElement("div");
|
|
30842
30898
|
row.className = "vela-sp-row";
|
|
30843
30899
|
row.dataset.ticker = s.ticker;
|
|
30844
|
-
|
|
30900
|
+
const venue = s.prefix ?? s.provider;
|
|
30901
|
+
if (venue) row.dataset.venue = venue;
|
|
30845
30902
|
const av = tickerIconEl(doc, baseOf(s), s.ticker, "vela-sp-avatar");
|
|
30846
30903
|
const main = doc.createElement("span");
|
|
30847
30904
|
main.className = "vela-sp-main";
|
|
@@ -30853,11 +30910,11 @@ var SymbolPicker = class {
|
|
|
30853
30910
|
d.textContent = s.description ?? (s.type ?? "");
|
|
30854
30911
|
main.append(t, d);
|
|
30855
30912
|
row.append(av, main);
|
|
30856
|
-
if (
|
|
30913
|
+
if (venue) {
|
|
30857
30914
|
const badge = doc.createElement("span");
|
|
30858
30915
|
badge.className = "vela-sp-badge";
|
|
30859
|
-
badge.dataset.p = s.provider;
|
|
30860
|
-
badge.textContent =
|
|
30916
|
+
badge.dataset.p = s.provider ?? venue;
|
|
30917
|
+
badge.textContent = venue;
|
|
30861
30918
|
row.appendChild(badge);
|
|
30862
30919
|
}
|
|
30863
30920
|
this.list.appendChild(row);
|
|
@@ -35428,13 +35485,15 @@ var VelaWidget = class {
|
|
|
35428
35485
|
this.statusline?.setMeta(tf, this.providerLabel());
|
|
35429
35486
|
}
|
|
35430
35487
|
/**
|
|
35431
|
-
* The
|
|
35432
|
-
*
|
|
35433
|
-
*
|
|
35488
|
+
* The venue label to show: the LISTING prefix the resolved symbol's data declares
|
|
35489
|
+
* (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol — never the one
|
|
35490
|
+
* configured or typed. They differ whenever the `provider` option is just a default,
|
|
35491
|
+
* the prefix was a listing venue, or the spelling isn't registered — the status line
|
|
35492
|
+
* must not claim a venue that served nothing.
|
|
35434
35493
|
*/
|
|
35435
35494
|
providerLabel() {
|
|
35436
|
-
const
|
|
35437
|
-
return
|
|
35495
|
+
const display = this.inner?.data.displayPrefix(this.symbol);
|
|
35496
|
+
return display ?? parseSymbol(this.symbol).provider ?? "";
|
|
35438
35497
|
}
|
|
35439
35498
|
setTimeframe(tf) {
|
|
35440
35499
|
if (tf === this.timeframe || this.destroyed) return;
|
|
@@ -35794,6 +35853,9 @@ var VelaWidget = class {
|
|
|
35794
35853
|
for (const [language, make] of Object.entries(resolveEngines(engines))) chart.registerEngine(language, make());
|
|
35795
35854
|
this.inner = chart;
|
|
35796
35855
|
this.symbolPicker.setSource(() => chart.data.symbols());
|
|
35856
|
+
void chart.data.ready().then(() => {
|
|
35857
|
+
if (this.inner === chart) this.statusline?.setMeta(this.timeframe, this.providerLabel());
|
|
35858
|
+
});
|
|
35797
35859
|
if (this.layoutCtl !== void 0) chart.renderer.setLayoutMode(this.layoutCtl.current);
|
|
35798
35860
|
this.objectTree.setSymbol(this.symbol);
|
|
35799
35861
|
chart.renderer.setLegendActions(legendActionsProviderFor(chart, () => this.context()));
|
package/dist/widget.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-
|
|
2
|
-
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-
|
|
1
|
+
import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-Dlc7ZWZz.cjs';
|
|
2
|
+
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-Dlc7ZWZz.cjs';
|
|
3
3
|
import { b as VelaOptions, q as DataWindowReadout } from './options-BlQ00Fju.cjs';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
|
|
5
|
-
import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-
|
|
6
|
-
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
5
|
+
import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-BZADxpKx.cjs';
|
|
6
|
+
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-BZADxpKx.cjs';
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-Ce6PuCzQ.cjs';
|
|
8
8
|
import { d as SidePanel } from './side-panel-CT9ZwIGz.cjs';
|
|
9
9
|
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-CT9ZwIGz.cjs';
|
|
10
10
|
|
|
@@ -141,9 +141,11 @@ declare class VelaWidget {
|
|
|
141
141
|
* drifting out of sync with the topbar. */
|
|
142
142
|
private syncTimeframeChrome;
|
|
143
143
|
/**
|
|
144
|
-
* The
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* The venue label to show: the LISTING prefix the resolved symbol's data declares
|
|
145
|
+
* (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol — never the one
|
|
146
|
+
* configured or typed. They differ whenever the `provider` option is just a default,
|
|
147
|
+
* the prefix was a listing venue, or the spelling isn't registered — the status line
|
|
148
|
+
* must not claim a venue that served nothing.
|
|
147
149
|
*/
|
|
148
150
|
private providerLabel;
|
|
149
151
|
setTimeframe(tf: string): void;
|
|
@@ -465,12 +467,6 @@ declare class Watermark {
|
|
|
465
467
|
destroy(): void;
|
|
466
468
|
}
|
|
467
469
|
|
|
468
|
-
/**
|
|
469
|
-
* Rank: ticker prefix > ticker substring > description substring > venue-name substring (typing
|
|
470
|
-
* `binance` surfaces that venue's symbols after any literal matches). An optional venue prefix
|
|
471
|
-
* (see {@link parseQuery}) scopes the pool first — venue alone browses it whole, alphabetically.
|
|
472
|
-
* Pure — unit-tested.
|
|
473
|
-
*/
|
|
474
470
|
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
|
|
475
471
|
interface SymbolPickerOptions {
|
|
476
472
|
/** `provider` is the venue of the chosen row — absent only for a source that has none. */
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-
|
|
2
|
-
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-
|
|
1
|
+
import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-DToMhiw3.js';
|
|
2
|
+
export { ah as DEFAULT_PANEL_ORDER, z as SidePanelDescriptor, A as SidePanelHandle, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a8 as sidePanels, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-DToMhiw3.js';
|
|
3
3
|
import { b as VelaOptions, q as DataWindowReadout } from './options-BlQ00Fju.js';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.js';
|
|
5
|
-
import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-
|
|
6
|
-
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-
|
|
7
|
-
import { a as SymbolDescriptor } from './DataProvider-
|
|
5
|
+
import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-BuHXJZJ2.js';
|
|
6
|
+
export { B as Bottombar, j as BottombarOptions, C as CellState, f as ChartState, I as IndicatorLoader, k as IndicatorManifest, l as IndicatorManifestEntry, m as RANGE_PRESETS, R as ResolvedIndicator, V as VelaStorage, n as WidgetStorage, g as decodeState, h as encodeState, o as legacyWidgetState, p as loadPersisted, q as localStorageAdapter, r as parsePersisted, t as resolveIndicators, s as sanitizeState, u as savePersisted } from './history-BuHXJZJ2.js';
|
|
7
|
+
import { a as SymbolDescriptor } from './DataProvider-DNx9ntBD.js';
|
|
8
8
|
import { d as SidePanel } from './side-panel-CT9ZwIGz.js';
|
|
9
9
|
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-CT9ZwIGz.js';
|
|
10
10
|
|
|
@@ -141,9 +141,11 @@ declare class VelaWidget {
|
|
|
141
141
|
* drifting out of sync with the topbar. */
|
|
142
142
|
private syncTimeframeChrome;
|
|
143
143
|
/**
|
|
144
|
-
* The
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* The venue label to show: the LISTING prefix the resolved symbol's data declares
|
|
145
|
+
* (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol — never the one
|
|
146
|
+
* configured or typed. They differ whenever the `provider` option is just a default,
|
|
147
|
+
* the prefix was a listing venue, or the spelling isn't registered — the status line
|
|
148
|
+
* must not claim a venue that served nothing.
|
|
147
149
|
*/
|
|
148
150
|
private providerLabel;
|
|
149
151
|
setTimeframe(tf: string): void;
|
|
@@ -465,12 +467,6 @@ declare class Watermark {
|
|
|
465
467
|
destroy(): void;
|
|
466
468
|
}
|
|
467
469
|
|
|
468
|
-
/**
|
|
469
|
-
* Rank: ticker prefix > ticker substring > description substring > venue-name substring (typing
|
|
470
|
-
* `binance` surfaces that venue's symbols after any literal matches). An optional venue prefix
|
|
471
|
-
* (see {@link parseQuery}) scopes the pool first — venue alone browses it whole, alphabetically.
|
|
472
|
-
* Pure — unit-tested.
|
|
473
|
-
*/
|
|
474
470
|
declare function filterSymbols(list: readonly SymbolDescriptor[], query: string, limit?: number): SymbolDescriptor[];
|
|
475
471
|
interface SymbolPickerOptions {
|
|
476
472
|
/** `provider` is the venue of the chosen row — absent only for a source that has none. */
|
package/dist/widget.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, MobileBar, DrawingPill, LayoutModeController, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-
|
|
2
|
-
export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, legacyWidgetState, loadPersisted, localStorageAdapter, parsePersisted, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, timeframeLabel, timeframeMs } from './chunk-
|
|
3
|
-
import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-
|
|
4
|
-
export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-
|
|
1
|
+
import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, MobileBar, DrawingPill, LayoutModeController, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-7ROONW6H.js';
|
|
2
|
+
export { Bottombar, ChartContextMenu, DataWindow, IndicatorPicker, ObjectTree, PanelDock, RANGE_PRESETS, ShortcutsHelp, Statusline, SymbolPicker, TimeframeQuick, Topbar, Watermark, dataWindowSections, decimalsFor, decodeState, encodeState, filterSymbols, fmtChange, fmtPrice, legacyWidgetState, loadPersisted, localStorageAdapter, parsePersisted, parseTimeframe, priceStyleLabel, resolveIndicators, sanitizeState, savePersisted, timeframeLabel, timeframeMs } from './chunk-7ROONW6H.js';
|
|
3
|
+
import { registerBuiltinChartTypes, resolveTheme, parseSymbol, buildToolbar, priceStyleIds, Vela, normalizeTimezone } from './chunk-CA3N3PYT.js';
|
|
4
|
+
export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-CA3N3PYT.js';
|
|
5
5
|
import { widgetActions, widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-ZNL2X6U2.js';
|
|
6
6
|
export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_ORDER, DEFAULT_PANEL_WIDTH, SidePanel, clampPanelWidth, registerSidePanel, registerWidgetAction, registerWidgetAttachment, sidePanels, unregisterSidePanel, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-ZNL2X6U2.js';
|
|
7
7
|
import { KeymapManager, Menu, isEditableTarget } from './chunk-QWIEKZRE.js';
|
|
@@ -481,13 +481,15 @@ var VelaWidget = class {
|
|
|
481
481
|
this.statusline?.setMeta(tf, this.providerLabel());
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
|
-
* The
|
|
485
|
-
*
|
|
486
|
-
*
|
|
484
|
+
* The venue label to show: the LISTING prefix the resolved symbol's data declares
|
|
485
|
+
* (`NASDAQ` for AAPL), else the provider that RESOLVED the symbol — never the one
|
|
486
|
+
* configured or typed. They differ whenever the `provider` option is just a default,
|
|
487
|
+
* the prefix was a listing venue, or the spelling isn't registered — the status line
|
|
488
|
+
* must not claim a venue that served nothing.
|
|
487
489
|
*/
|
|
488
490
|
providerLabel() {
|
|
489
|
-
const
|
|
490
|
-
return
|
|
491
|
+
const display = this.inner?.data.displayPrefix(this.symbol);
|
|
492
|
+
return display ?? parseSymbol(this.symbol).provider ?? "";
|
|
491
493
|
}
|
|
492
494
|
setTimeframe(tf) {
|
|
493
495
|
if (tf === this.timeframe || this.destroyed) return;
|
|
@@ -847,6 +849,9 @@ var VelaWidget = class {
|
|
|
847
849
|
for (const [language, make] of Object.entries(resolveEngines(engines))) chart.registerEngine(language, make());
|
|
848
850
|
this.inner = chart;
|
|
849
851
|
this.symbolPicker.setSource(() => chart.data.symbols());
|
|
852
|
+
void chart.data.ready().then(() => {
|
|
853
|
+
if (this.inner === chart) this.statusline?.setMeta(this.timeframe, this.providerLabel());
|
|
854
|
+
});
|
|
850
855
|
if (this.layoutCtl !== void 0) chart.renderer.setLayoutMode(this.layoutCtl.current);
|
|
851
856
|
this.objectTree.setSymbol(this.symbol);
|
|
852
857
|
chart.renderer.setLegendActions(legendActionsProviderFor(chart, () => this.context()));
|
package/dist/workspace.cjs
CHANGED
|
@@ -152,7 +152,7 @@ var ProviderRegistry = class {
|
|
|
152
152
|
/** Register (or replace) a provider; returns a promise that settles when its index is built. */
|
|
153
153
|
register(rawName, provider) {
|
|
154
154
|
const name = normName(rawName);
|
|
155
|
-
const entry = { name, provider, index: null, descriptors: [], settled: false, settle: Promise.resolve() };
|
|
155
|
+
const entry = { name, provider, index: null, prefixIndex: null, byTicker: null, descriptors: [], settled: false, settle: Promise.resolve() };
|
|
156
156
|
this.entries.set(name, entry);
|
|
157
157
|
entry.settle = this.buildIndex(entry);
|
|
158
158
|
queueMicrotask(() => this.notify(false));
|
|
@@ -165,6 +165,9 @@ var ProviderRegistry = class {
|
|
|
165
165
|
const symbols = await entry.provider.listSymbols();
|
|
166
166
|
entry.descriptors = symbols;
|
|
167
167
|
entry.index = new Set(symbols.map((s) => normTicker(s.ticker)));
|
|
168
|
+
entry.byTicker = new Map(symbols.map((s) => [normTicker(s.ticker), s]));
|
|
169
|
+
entry.prefixIndex = /* @__PURE__ */ new Map();
|
|
170
|
+
for (const s of symbols) if (s.prefix) entry.prefixIndex.set(`${normName(s.prefix)}:${normTicker(s.ticker)}`, s);
|
|
168
171
|
}
|
|
169
172
|
} catch {
|
|
170
173
|
entry.index = null;
|
|
@@ -200,14 +203,25 @@ var ProviderRegistry = class {
|
|
|
200
203
|
}
|
|
201
204
|
/**
|
|
202
205
|
* Resolve a symbol to `{ provider, ticker }`, or null when nothing can serve it
|
|
203
|
-
* yet. Explicit prefix → that provider (must be registered)
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
206
|
+
* yet. Explicit prefix → that provider (must be registered), else a provider whose
|
|
207
|
+
* index declares that LISTING prefix for that ticker (`NASDAQ:AAPL` routes to the
|
|
208
|
+
* provider serving Nasdaq-listed AAPL — TradingView-strict, so `NYSE:AAPL` resolves
|
|
209
|
+
* to nothing rather than auto-correcting). Bare → first indexed provider
|
|
210
|
+
* (registration order, `opts.default` first) that contains the ticker;
|
|
211
|
+
* `opts.lenient` additionally allows a sole registered provider before its index
|
|
212
|
+
* exists.
|
|
207
213
|
*/
|
|
208
214
|
resolve(raw, opts = {}) {
|
|
209
215
|
const { provider, ticker } = this.parse(raw);
|
|
210
|
-
if (provider)
|
|
216
|
+
if (provider) {
|
|
217
|
+
if (this.entries.has(provider)) return { provider, ticker };
|
|
218
|
+
const key = `${provider}:${normTicker(ticker)}`;
|
|
219
|
+
for (const name of this.candidateOrder(opts.default)) {
|
|
220
|
+
const d = this.entries.get(name).prefixIndex?.get(key);
|
|
221
|
+
if (d) return { provider: name, ticker: d.ticker };
|
|
222
|
+
}
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
211
225
|
const norm = normTicker(ticker);
|
|
212
226
|
for (const name of this.candidateOrder(opts.default)) {
|
|
213
227
|
if (this.entries.get(name).index?.has(norm)) return { provider: name, ticker };
|
|
@@ -273,6 +287,22 @@ var ProviderRegistry = class {
|
|
|
273
287
|
}
|
|
274
288
|
return names;
|
|
275
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* The DISPLAY prefix for a resolved symbol — the descriptor's LISTING prefix when the
|
|
292
|
+
* data declares one, else the provider name. This is the single seam every label
|
|
293
|
+
* (legend chip, committed/persisted `PREFIX:TICKER` strings) derives from, which is
|
|
294
|
+
* what makes a non-canonical spelling impossible to display: the form always comes
|
|
295
|
+
* from the data, never from what was typed.
|
|
296
|
+
*/
|
|
297
|
+
displayPrefixOf(resolved) {
|
|
298
|
+
const d = this.entries.get(resolved.provider)?.byTicker?.get(normTicker(resolved.ticker));
|
|
299
|
+
return d?.prefix ?? resolved.provider;
|
|
300
|
+
}
|
|
301
|
+
/** The canonical `PREFIX:TICKER` string for a resolved symbol (descriptor spellings). */
|
|
302
|
+
canonicalSymbol(resolved) {
|
|
303
|
+
const d = this.entries.get(resolved.provider)?.byTicker?.get(normTicker(resolved.ticker));
|
|
304
|
+
return `${d?.prefix ?? resolved.provider}:${d?.ticker ?? resolved.ticker}`;
|
|
305
|
+
}
|
|
276
306
|
/** Indexed symbols for one provider (or all, concatenated) — for autocomplete. */
|
|
277
307
|
symbolsOf(rawName) {
|
|
278
308
|
if (rawName != null) return this.entries.get(normName(rawName))?.descriptors ?? [];
|
|
@@ -596,6 +626,20 @@ var MultiProviderFeed = class {
|
|
|
596
626
|
resolveSymbol(raw) {
|
|
597
627
|
return this.registry.resolve(raw, { default: this.primaryProvider });
|
|
598
628
|
}
|
|
629
|
+
/**
|
|
630
|
+
* The DISPLAY prefix for `raw` — the descriptor's LISTING prefix when the data
|
|
631
|
+
* declares one (`NASDAQ` for AAPL), else the resolved provider name. Null while
|
|
632
|
+
* nothing resolves the symbol.
|
|
633
|
+
*/
|
|
634
|
+
displayPrefix(raw) {
|
|
635
|
+
const resolved = this.resolveSymbol(raw);
|
|
636
|
+
return resolved ? this.registry.displayPrefixOf(resolved) : null;
|
|
637
|
+
}
|
|
638
|
+
/** The canonical `PREFIX:TICKER` form of `raw`, or null while unresolvable. */
|
|
639
|
+
canonicalSymbol(raw) {
|
|
640
|
+
const resolved = this.resolveSymbol(raw);
|
|
641
|
+
return resolved ? this.registry.canonicalSymbol(resolved) : null;
|
|
642
|
+
}
|
|
599
643
|
/** The registered provider INSTANCE under `name` (undefined if unknown). */
|
|
600
644
|
providerInstance(name) {
|
|
601
645
|
return this.registry.get(name);
|
|
@@ -12423,10 +12467,11 @@ function parseQuery(raw, venues) {
|
|
|
12423
12467
|
function onlyOne(matches) {
|
|
12424
12468
|
return matches.length === 1 ? matches[0] : null;
|
|
12425
12469
|
}
|
|
12470
|
+
var venueOf = (s) => s.prefix ?? s.provider;
|
|
12426
12471
|
function filterSymbols(list, query, limit = 100) {
|
|
12427
|
-
const venues = [...new Set(list.
|
|
12472
|
+
const venues = [...new Set(list.flatMap((s) => [venueOf(s)?.toLowerCase(), s.provider?.toLowerCase()]).filter((p) => !!p))];
|
|
12428
12473
|
const { scope, term } = parseQuery(query, venues);
|
|
12429
|
-
const pool = scope ? list.filter((s) => s.provider?.toLowerCase() === scope) : list;
|
|
12474
|
+
const pool = scope ? list.filter((s) => venueOf(s)?.toLowerCase() === scope || s.provider?.toLowerCase() === scope) : list;
|
|
12430
12475
|
const q = term.toUpperCase();
|
|
12431
12476
|
if (!q) {
|
|
12432
12477
|
if (scope) return [...pool].sort((a, b) => a.ticker.localeCompare(b.ticker)).slice(0, limit);
|
|
@@ -12445,7 +12490,7 @@ function filterSymbols(list, query, limit = 100) {
|
|
|
12445
12490
|
if (t.startsWith(q)) prefix.push(s);
|
|
12446
12491
|
else if (t.includes(q)) substr.push(s);
|
|
12447
12492
|
else if ((s.description ?? "").toUpperCase().includes(q)) desc.push(s);
|
|
12448
|
-
else if (!scope && s.provider?.toLowerCase().includes(qLower)) venue.push(s);
|
|
12493
|
+
else if (!scope && (venueOf(s)?.toLowerCase().includes(qLower) || s.provider?.toLowerCase().includes(qLower))) venue.push(s);
|
|
12449
12494
|
if (prefix.length >= limit) break;
|
|
12450
12495
|
}
|
|
12451
12496
|
return [...prefix, ...substr, ...desc, ...venue].slice(0, limit);
|
|
@@ -12597,14 +12642,14 @@ var SymbolPicker = class {
|
|
|
12597
12642
|
else if (e.key === "ArrowUp") this.moveHighlight(-1);
|
|
12598
12643
|
else if (e.key === "Enter") {
|
|
12599
12644
|
const pick = this.rows[this.highlighted];
|
|
12600
|
-
if (pick) this.select(pick.ticker, pick.provider, opts.onSelect);
|
|
12645
|
+
if (pick) this.select(pick.ticker, pick.prefix ?? pick.provider, opts.onSelect);
|
|
12601
12646
|
return;
|
|
12602
12647
|
} else return;
|
|
12603
12648
|
e.preventDefault();
|
|
12604
12649
|
});
|
|
12605
12650
|
this.list.addEventListener("click", (e) => {
|
|
12606
12651
|
const row = e.target.closest(".vela-sp-row");
|
|
12607
|
-
if (row?.dataset.ticker) this.select(row.dataset.ticker, row.dataset.
|
|
12652
|
+
if (row?.dataset.ticker) this.select(row.dataset.ticker, row.dataset.venue, opts.onSelect);
|
|
12608
12653
|
});
|
|
12609
12654
|
}
|
|
12610
12655
|
/** Wire where symbols come from (re-called on every widget rebuild). */
|
|
@@ -12621,9 +12666,9 @@ var SymbolPicker = class {
|
|
|
12621
12666
|
destroy() {
|
|
12622
12667
|
this.dialog.destroy();
|
|
12623
12668
|
}
|
|
12624
|
-
select(ticker,
|
|
12669
|
+
select(ticker, venue, onSelect) {
|
|
12625
12670
|
this.close();
|
|
12626
|
-
onSelect(
|
|
12671
|
+
onSelect(venue ? `${venue}:${ticker}` : ticker);
|
|
12627
12672
|
}
|
|
12628
12673
|
moveHighlight(delta) {
|
|
12629
12674
|
if (!this.rows.length) return;
|
|
@@ -12656,7 +12701,8 @@ var SymbolPicker = class {
|
|
|
12656
12701
|
const row = doc.createElement("div");
|
|
12657
12702
|
row.className = "vela-sp-row";
|
|
12658
12703
|
row.dataset.ticker = s.ticker;
|
|
12659
|
-
|
|
12704
|
+
const venue = s.prefix ?? s.provider;
|
|
12705
|
+
if (venue) row.dataset.venue = venue;
|
|
12660
12706
|
const av = tickerIconEl(doc, baseOf(s), s.ticker, "vela-sp-avatar");
|
|
12661
12707
|
const main = doc.createElement("span");
|
|
12662
12708
|
main.className = "vela-sp-main";
|
|
@@ -12668,11 +12714,11 @@ var SymbolPicker = class {
|
|
|
12668
12714
|
d.textContent = s.description ?? (s.type ?? "");
|
|
12669
12715
|
main.append(t, d);
|
|
12670
12716
|
row.append(av, main);
|
|
12671
|
-
if (
|
|
12717
|
+
if (venue) {
|
|
12672
12718
|
const badge = doc.createElement("span");
|
|
12673
12719
|
badge.className = "vela-sp-badge";
|
|
12674
|
-
badge.dataset.p = s.provider;
|
|
12675
|
-
badge.textContent =
|
|
12720
|
+
badge.dataset.p = s.provider ?? venue;
|
|
12721
|
+
badge.textContent = venue;
|
|
12676
12722
|
row.appendChild(badge);
|
|
12677
12723
|
}
|
|
12678
12724
|
this.list.appendChild(row);
|
|
@@ -18267,6 +18313,17 @@ var DataControl = class {
|
|
|
18267
18313
|
resolve(symbol) {
|
|
18268
18314
|
return this.registry?.resolveSymbol(symbol) ?? null;
|
|
18269
18315
|
}
|
|
18316
|
+
/**
|
|
18317
|
+
* The DISPLAY prefix for `symbol` — the listing venue its descriptor declares
|
|
18318
|
+
* (`NASDAQ` for AAPL) or the resolved provider name. Null while unresolvable.
|
|
18319
|
+
*/
|
|
18320
|
+
displayPrefix(symbol) {
|
|
18321
|
+
return this.registry?.displayPrefix(symbol) ?? null;
|
|
18322
|
+
}
|
|
18323
|
+
/** The canonical `PREFIX:TICKER` form of `symbol`, or null while unresolvable. */
|
|
18324
|
+
canonicalSymbol(symbol) {
|
|
18325
|
+
return this.registry?.canonicalSymbol(symbol) ?? null;
|
|
18326
|
+
}
|
|
18270
18327
|
/**
|
|
18271
18328
|
* The registered provider INSTANCE under `name` — the seam for EXTENDED provider
|
|
18272
18329
|
* surfaces: a provider may implement interfaces beyond the `DataProvider` port
|
|
@@ -35036,6 +35093,9 @@ var ChartCell = class {
|
|
|
35036
35093
|
this.statusline = deps.statusline ? new Statusline(this.host, symbol ?? "") : null;
|
|
35037
35094
|
this.statusline?.setMeta(seed.timeframe ?? "60", this.state.provider ?? "");
|
|
35038
35095
|
this.statusline?.onChart(this.inner);
|
|
35096
|
+
void this.inner.data.ready().then(() => {
|
|
35097
|
+
if (this.inner && this.state.symbol) this.statusline?.setMeta(this.state.timeframe ?? "60", this.inner.data.displayPrefix(this.state.symbol) ?? this.state.provider ?? "");
|
|
35098
|
+
});
|
|
35039
35099
|
this.syncStatuslineColors();
|
|
35040
35100
|
this.contextMenu = new ChartContextMenu(this.host, {
|
|
35041
35101
|
resetView: () => {
|
|
@@ -35158,7 +35218,7 @@ var ChartCell = class {
|
|
|
35158
35218
|
this.state.timeframe = timeframe;
|
|
35159
35219
|
this.watermark?.update(symbol2, timeframe);
|
|
35160
35220
|
this.statusline?.setSymbol(symbol2);
|
|
35161
|
-
this.statusline?.setMeta(timeframe, this.inner?.data.
|
|
35221
|
+
this.statusline?.setMeta(timeframe, this.inner?.data.displayPrefix(symbol2) ?? this.state.provider ?? "");
|
|
35162
35222
|
if (this.inner) this.statusline?.onChart(this.inner);
|
|
35163
35223
|
this.refreshNativeCatalog();
|
|
35164
35224
|
this.deps.onMarketChanged(this.id);
|
package/dist/workspace.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend } from './options-BlQ00Fju.cjs';
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-
|
|
3
|
-
export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-BZADxpKx.cjs';
|
|
3
|
+
export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-BZADxpKx.cjs';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.cjs';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-Dlc7ZWZz.cjs';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-Ce6PuCzQ.cjs';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
package/dist/workspace.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { O as OHLCV, V as VisibleRangePreset, a as VisibleRange, b as VelaOptions, c as VelaTheme, N as NativeBackend } from './options-BlQ00Fju.js';
|
|
2
|
-
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-
|
|
3
|
-
export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-
|
|
2
|
+
import { S as SyncSetting, V as VelaStorage, C as CellState, W as WidgetHistory, R as ResolvedIndicator, a as RangePreset, T as TrackSizes, b as VelaShellOptions, c as SyncOptions, d as SyncKind, e as WorkspaceState } from './history-BuHXJZJ2.js';
|
|
3
|
+
export { f as ChartState, P as PanelsState, g as decodeState, h as encodeState, s as sanitizeState } from './history-BuHXJZJ2.js';
|
|
4
4
|
import { K as KeymapManager } from './keymap-CGOz5F5f.js';
|
|
5
|
-
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-
|
|
6
|
-
import { M as MarketDataFeed } from './DataProvider-
|
|
5
|
+
import { I as IndicatorHandle, S as ScriptingEngine, W as WidgetContext, V as Vela, a as ScriptRun } from './contributions-DToMhiw3.js';
|
|
6
|
+
import { M as MarketDataFeed } from './DataProvider-DNx9ntBD.js';
|
|
7
7
|
|
|
8
8
|
/** The cells that follow `originId` under `setting` — PURE (never includes the origin). */
|
|
9
9
|
declare function syncTargets(originId: string, setting: SyncSetting | undefined, cellIds: readonly string[]): string[];
|
package/dist/workspace.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WidgetHistory, prefixedSymbol, Watermark, Statusline, ChartContextMenu, statuslineInkOf, indicatorLedger, Glider, localStorageAdapter, decodeState, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, Toast, Bottombar, MobileBar, DrawingPill, LayoutModeController, toolShortcutHints, resolveIndicators, sanitizeState, encodeState, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp } from './chunk-
|
|
2
|
-
export { decodeState, encodeState, sanitizeState } from './chunk-
|
|
3
|
-
import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-
|
|
1
|
+
import { WidgetHistory, prefixedSymbol, Watermark, Statusline, ChartContextMenu, statuslineInkOf, indicatorLedger, Glider, localStorageAdapter, decodeState, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, Toast, Bottombar, MobileBar, DrawingPill, LayoutModeController, toolShortcutHints, resolveIndicators, sanitizeState, encodeState, TimeframeDrawer, RANGE_PRESETS, DrawingsDrawer, MoreDrawer, priceStyleIcon, priceStyleLabel, TimezoneDrawer, PriceScaleDrawer, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp } from './chunk-7ROONW6H.js';
|
|
2
|
+
export { decodeState, encodeState, sanitizeState } from './chunk-7ROONW6H.js';
|
|
3
|
+
import { parseSymbol, Vela, normalizeTimezone, TypedEventBus, MultiProviderFeed, resolveTheme, createCustomMark, createAttributionMark, DrawingToolbar, defaultToolbar, applyAttributionMarkTheme, sharedBarStore, timeframeToMs, priceStyleIds } from './chunk-CA3N3PYT.js';
|
|
4
4
|
import { resolveEngines, legendActionsProviderFor, rendererDefaults, widgetActions, widgetAttachments } from './chunk-ZNL2X6U2.js';
|
|
5
5
|
import { KeymapManager, Menu, isEditableTarget } from './chunk-QWIEKZRE.js';
|
|
6
6
|
import { applyPlotOverlayTokens, ensureUIHost } from './chunk-OGRQW3M6.js';
|
|
@@ -161,6 +161,9 @@ var ChartCell = class {
|
|
|
161
161
|
this.statusline = deps.statusline ? new Statusline(this.host, symbol ?? "") : null;
|
|
162
162
|
this.statusline?.setMeta(seed.timeframe ?? "60", this.state.provider ?? "");
|
|
163
163
|
this.statusline?.onChart(this.inner);
|
|
164
|
+
void this.inner.data.ready().then(() => {
|
|
165
|
+
if (this.inner && this.state.symbol) this.statusline?.setMeta(this.state.timeframe ?? "60", this.inner.data.displayPrefix(this.state.symbol) ?? this.state.provider ?? "");
|
|
166
|
+
});
|
|
164
167
|
this.syncStatuslineColors();
|
|
165
168
|
this.contextMenu = new ChartContextMenu(this.host, {
|
|
166
169
|
resetView: () => {
|
|
@@ -283,7 +286,7 @@ var ChartCell = class {
|
|
|
283
286
|
this.state.timeframe = timeframe;
|
|
284
287
|
this.watermark?.update(symbol2, timeframe);
|
|
285
288
|
this.statusline?.setSymbol(symbol2);
|
|
286
|
-
this.statusline?.setMeta(timeframe, this.inner?.data.
|
|
289
|
+
this.statusline?.setMeta(timeframe, this.inner?.data.displayPrefix(symbol2) ?? this.state.provider ?? "");
|
|
287
290
|
if (this.inner) this.statusline?.onChart(this.inner);
|
|
288
291
|
this.refreshNativeCatalog();
|
|
289
292
|
this.deps.onMarketChanged(this.id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxalgo/vela",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Open-source charting library with a native high-performance renderer, drawing tools, pluggable chart types and pluggable scripting engines.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://luxalgo.com/vela",
|