@luxalgo/vela 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{DataProvider-DKNDHpNv.d.cts → DataProvider-BBQ3Hr21.d.cts} +1 -1
  2. package/dist/{DataProvider-Dzd-Erlk.d.ts → DataProvider-DGesjOJT.d.ts} +1 -1
  3. package/dist/{chunk-OVQKKXLZ.js → chunk-5SE4PL3H.js} +402 -60
  4. package/dist/{chunk-RHIDOUFL.js → chunk-AIW3EJUE.js} +2 -2
  5. package/dist/{chunk-GYD2THPV.js → chunk-EP6NDJYK.js} +5 -0
  6. package/dist/{chunk-KCCZNKH7.js → chunk-FNOMKHEZ.js} +668 -78
  7. package/dist/{chunk-7UFX5ZIG.js → chunk-S6F6SQ2L.js} +7 -2
  8. package/dist/{chunk-KM6LHB3Y.js → chunk-ULIX6AE2.js} +6 -1
  9. package/dist/{contributions-hX3EUyjG.d.ts → contributions-6N0rbrPC.d.ts} +46 -31
  10. package/dist/{contributions-o1GRKPI_.d.cts → contributions-BlV3kb0O.d.cts} +46 -31
  11. package/dist/{history-Dzxz-MQj.d.ts → history-BTd52YMA.d.ts} +10 -5
  12. package/dist/{history-LJkz4-sS.d.cts → history-DX3Zne3a.d.cts} +10 -5
  13. package/dist/index.cjs +680 -75
  14. package/dist/index.d.cts +37 -12
  15. package/dist/index.d.ts +37 -12
  16. package/dist/index.js +4 -4
  17. package/dist/{options-Q-576hIi.d.cts → options-DbQholFV.d.cts} +14 -0
  18. package/dist/{options-Q-576hIi.d.ts → options-DbQholFV.d.ts} +14 -0
  19. package/dist/{plugin-D94muTV-.d.cts → plugin-O34MbXf-.d.cts} +157 -7
  20. package/dist/{plugin-aGUD1epn.d.ts → plugin-TN3n-9YN.d.ts} +157 -7
  21. package/dist/plugin.cjs +5 -0
  22. package/dist/plugin.d.cts +4 -4
  23. package/dist/plugin.d.ts +4 -4
  24. package/dist/plugin.js +2 -2
  25. package/dist/providers/binance.d.cts +2 -2
  26. package/dist/providers/binance.d.ts +2 -2
  27. package/dist/providers/coinbase.d.cts +2 -2
  28. package/dist/providers/coinbase.d.ts +2 -2
  29. package/dist/providers/hyperliquid.d.cts +2 -2
  30. package/dist/providers/hyperliquid.d.ts +2 -2
  31. package/dist/ui.cjs +10 -0
  32. package/dist/ui.d.cts +1 -1
  33. package/dist/ui.d.ts +1 -1
  34. package/dist/ui.js +3 -3
  35. package/dist/vela.global.js +680 -75
  36. package/dist/vela.global.min.js +59 -28
  37. package/dist/widget.cjs +1081 -134
  38. package/dist/widget.d.cts +30 -16
  39. package/dist/widget.d.ts +30 -16
  40. package/dist/widget.js +9 -9
  41. package/dist/workspace.cjs +1372 -183
  42. package/dist/workspace.d.cts +66 -8
  43. package/dist/workspace.d.ts +66 -8
  44. package/dist/workspace.js +275 -37
  45. package/package.json +1 -1
package/dist/widget.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-o1GRKPI_.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-o1GRKPI_.cjs';
3
- import { b as VelaOptions, q as DataWindowReadout } from './options-Q-576hIi.cjs';
1
+ import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-BlV3kb0O.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-BlV3kb0O.cjs';
3
+ import { b as VelaOptions, q as DataWindowReadout } from './options-DbQholFV.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-LJkz4-sS.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-LJkz4-sS.cjs';
7
- import { a as SymbolDescriptor } from './DataProvider-DKNDHpNv.cjs';
5
+ import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-DX3Zne3a.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-DX3Zne3a.cjs';
7
+ import { a as SymbolDescriptor } from './DataProvider-BBQ3Hr21.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
 
@@ -215,6 +215,12 @@ declare class VelaWidget {
215
215
  private persistNow;
216
216
  }
217
217
 
218
+ /** The current layout's footprint on the canvas (mirrors the workspace's LayoutShape). */
219
+ type LayoutPickerShape = {
220
+ rows: number;
221
+ cols: number;
222
+ };
223
+
218
224
  declare function priceStyleLabel(id: string): string;
219
225
  interface TopbarOptions {
220
226
  symbol: string;
@@ -224,23 +230,28 @@ interface TopbarOptions {
224
230
  priceStyle: string;
225
231
  onTimeframe: (tf: string) => void;
226
232
  onPriceStyle: (style: string) => void;
227
- /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when given).
228
- * `options` is read live, so plugin-registered layouts appear automatically. */
233
+ /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
234
+ * given) the grid-canvas picker composing uniform grids, with the workspace
235
+ * SYNC switches beside it. Everything is read live, so plugin-registered
236
+ * layouts and setting flips appear automatically. */
229
237
  layout?: {
230
238
  current: string;
231
- options: () => Array<{
239
+ /** Current layout's picker-canvas shape (null = not canvas-expressible). */
240
+ shape: () => LayoutPickerShape | null;
241
+ /** Registered layouts the canvas cannot express — rendered as labeled rows. */
242
+ presets: () => Array<{
232
243
  id: string;
233
244
  label: string;
234
245
  }>;
235
- onSelect: (id: string) => void;
236
- /** Optional TOGGLE rows appended under the layout presets (e.g. the workspace's
237
- * "Sync crosshair"). Re-read on every open/refresh; `onToggle` flips one. */
238
- toggles?: () => Array<{
246
+ onSelectGrid: (rows: number, cols: number) => void;
247
+ onSelectPreset: (id: string) => void;
248
+ /** SYNC switch rows (re-read on every open and after each toggle). */
249
+ syncs: () => Array<{
239
250
  id: string;
240
251
  label: string;
241
252
  checked: boolean;
242
253
  }>;
243
- onToggle?: (id: string) => void;
254
+ onToggleSync: (id: string) => void;
244
255
  };
245
256
  onIndicatorsClick?: () => void;
246
257
  /** Unified undo/redo (same stack as Ctrl+Z / Ctrl+Y). Enabled state is pushed with
@@ -258,7 +269,7 @@ declare class Topbar {
258
269
  private readonly tfButton;
259
270
  private readonly styleButton;
260
271
  private layoutButton;
261
- private layoutMenu;
272
+ private layoutPicker;
262
273
  private layoutId;
263
274
  private readonly tfMenu;
264
275
  private readonly styleMenu;
@@ -286,7 +297,6 @@ declare class Topbar {
286
297
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
287
298
  setLayout(id: string): void;
288
299
  private renderLayoutButton;
289
- private layoutItems;
290
300
  private renderStyleButton;
291
301
  /** Re-project the contributed topbar actions (call after registrations change). */
292
302
  renderActions(): void;
@@ -372,9 +382,13 @@ declare class Statusline {
372
382
 
373
383
  declare class Watermark {
374
384
  readonly el: HTMLElement;
385
+ private readonly text;
386
+ private readonly resizeObserver;
375
387
  constructor(host: HTMLElement, symbol: string, timeframe: string);
376
388
  setVisible(visible: boolean): void;
377
389
  update(symbol: string, timeframe: string): void;
390
+ /** Measure the text at the cap and shrink it to the chart's own width. */
391
+ private fit;
378
392
  destroy(): void;
379
393
  }
380
394
 
package/dist/widget.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-hX3EUyjG.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-hX3EUyjG.js';
3
- import { b as VelaOptions, q as DataWindowReadout } from './options-Q-576hIi.js';
1
+ import { W as WidgetContext, V as Vela, y as SidePanelButton } from './contributions-6N0rbrPC.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-6N0rbrPC.js';
3
+ import { b as VelaOptions, q as DataWindowReadout } from './options-DbQholFV.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-Dzxz-MQj.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-Dzxz-MQj.js';
7
- import { a as SymbolDescriptor } from './DataProvider-Dzd-Erlk.js';
5
+ import { W as WidgetHistory, b as VelaShellOptions, e as WorkspaceState, a as RangePreset, i as PersistedState, P as PanelsState } from './history-BTd52YMA.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-BTd52YMA.js';
7
+ import { a as SymbolDescriptor } from './DataProvider-DGesjOJT.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
 
@@ -215,6 +215,12 @@ declare class VelaWidget {
215
215
  private persistNow;
216
216
  }
217
217
 
218
+ /** The current layout's footprint on the canvas (mirrors the workspace's LayoutShape). */
219
+ type LayoutPickerShape = {
220
+ rows: number;
221
+ cols: number;
222
+ };
223
+
218
224
  declare function priceStyleLabel(id: string): string;
219
225
  interface TopbarOptions {
220
226
  symbol: string;
@@ -224,23 +230,28 @@ interface TopbarOptions {
224
230
  priceStyle: string;
225
231
  onTimeframe: (tf: string) => void;
226
232
  onPriceStyle: (style: string) => void;
227
- /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when given).
228
- * `options` is read live, so plugin-registered layouts appear automatically. */
233
+ /** Optional workspace LAYOUT dropdown (rendered after the style dropdown when
234
+ * given) the grid-canvas picker composing uniform grids, with the workspace
235
+ * SYNC switches beside it. Everything is read live, so plugin-registered
236
+ * layouts and setting flips appear automatically. */
229
237
  layout?: {
230
238
  current: string;
231
- options: () => Array<{
239
+ /** Current layout's picker-canvas shape (null = not canvas-expressible). */
240
+ shape: () => LayoutPickerShape | null;
241
+ /** Registered layouts the canvas cannot express — rendered as labeled rows. */
242
+ presets: () => Array<{
232
243
  id: string;
233
244
  label: string;
234
245
  }>;
235
- onSelect: (id: string) => void;
236
- /** Optional TOGGLE rows appended under the layout presets (e.g. the workspace's
237
- * "Sync crosshair"). Re-read on every open/refresh; `onToggle` flips one. */
238
- toggles?: () => Array<{
246
+ onSelectGrid: (rows: number, cols: number) => void;
247
+ onSelectPreset: (id: string) => void;
248
+ /** SYNC switch rows (re-read on every open and after each toggle). */
249
+ syncs: () => Array<{
239
250
  id: string;
240
251
  label: string;
241
252
  checked: boolean;
242
253
  }>;
243
- onToggle?: (id: string) => void;
254
+ onToggleSync: (id: string) => void;
244
255
  };
245
256
  onIndicatorsClick?: () => void;
246
257
  /** Unified undo/redo (same stack as Ctrl+Z / Ctrl+Y). Enabled state is pushed with
@@ -258,7 +269,7 @@ declare class Topbar {
258
269
  private readonly tfButton;
259
270
  private readonly styleButton;
260
271
  private layoutButton;
261
- private layoutMenu;
272
+ private layoutPicker;
262
273
  private layoutId;
263
274
  private readonly tfMenu;
264
275
  private readonly styleMenu;
@@ -286,7 +297,6 @@ declare class Topbar {
286
297
  /** Reflect the current workspace layout (no-op without the layout dropdown). */
287
298
  setLayout(id: string): void;
288
299
  private renderLayoutButton;
289
- private layoutItems;
290
300
  private renderStyleButton;
291
301
  /** Re-project the contributed topbar actions (call after registrations change). */
292
302
  renderActions(): void;
@@ -372,9 +382,13 @@ declare class Statusline {
372
382
 
373
383
  declare class Watermark {
374
384
  readonly el: HTMLElement;
385
+ private readonly text;
386
+ private readonly resizeObserver;
375
387
  constructor(host: HTMLElement, symbol: string, timeframe: string);
376
388
  setVisible(visible: boolean): void;
377
389
  update(symbol: string, timeframe: string): void;
390
+ /** Measure the text at the cap and shrink it to the chart's own width. */
391
+ private fit;
378
392
  destroy(): void;
379
393
  }
380
394
 
package/dist/widget.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-OVQKKXLZ.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-OVQKKXLZ.js';
3
- import { registerBuiltinChartTypes, resolveTheme, parseSymbol, Vela, normalizeTimezone } from './chunk-KCCZNKH7.js';
4
- export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-KCCZNKH7.js';
5
- import { widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-7UFX5ZIG.js';
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-7UFX5ZIG.js';
7
- import { ensureUIHost, KeymapManager, Menu, applyPlotOverlayTokens, isEditableTarget } from './chunk-RHIDOUFL.js';
8
- import './chunk-KM6LHB3Y.js';
9
- import { injectStyles } from './chunk-GYD2THPV.js';
1
+ import { Glider, WidgetHistory, localStorageAdapter, decodeState, prefixedSymbol, SymbolPicker, IndicatorPicker, TimeframeQuick, Topbar, PanelDock, ObjectTree, DataWindow, ChartContextMenu, Toast, Watermark, Statusline, Bottombar, ZOOM_IN, ZOOM_OUT, PAN_FAST, ShortcutsHelp, indicatorLedger, sanitizeState, legacyWidgetState, parsePersisted, statuslineInkOf, toolShortcutHints, resolveIndicators, encodeState } from './chunk-5SE4PL3H.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-5SE4PL3H.js';
3
+ import { registerBuiltinChartTypes, resolveTheme, parseSymbol, Vela, normalizeTimezone } from './chunk-FNOMKHEZ.js';
4
+ export { TIMEZONES, normalizeTimezone, tzButtonLabel, tzMenuLabel, tzOffset } from './chunk-FNOMKHEZ.js';
5
+ import { widgetAttachments, legendActionsProviderFor, resolveEngines } from './chunk-S6F6SQ2L.js';
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-S6F6SQ2L.js';
7
+ import { ensureUIHost, KeymapManager, Menu, applyPlotOverlayTokens, isEditableTarget } from './chunk-AIW3EJUE.js';
8
+ import './chunk-ULIX6AE2.js';
9
+ import { injectStyles } from './chunk-EP6NDJYK.js';
10
10
 
11
11
  // src/widget/url-state.ts
12
12
  var PARAMS = [