@luxalgo/vela 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{DataProvider-wbtJ3-Sa.d.cts → DataProvider-Bw58CjYy.d.cts} +1 -1
  2. package/dist/{DataProvider-oH78tYXL.d.ts → DataProvider-Byo8pEv0.d.ts} +1 -1
  3. package/dist/{chunk-KWI3YDBW.js → chunk-ALTGHKIM.js} +584 -25
  4. package/dist/{chunk-TO3GIK7Z.js → chunk-AUOB7A5Y.js} +2 -2
  5. package/dist/{chunk-VHGACEHO.js → chunk-I2U4NZD2.js} +7 -1
  6. package/dist/{chunk-2IPXYM4B.js → chunk-MOJ4T26N.js} +88 -5
  7. package/dist/{chunk-HMHA733L.js → chunk-UNUVPQFW.js} +1924 -734
  8. package/dist/{chunk-G7B7ZCBF.js → chunk-WY5H4S4I.js} +1 -1
  9. package/dist/{contributions-BhOBRenr.d.cts → contributions-BY3zSYiZ.d.ts} +56 -5
  10. package/dist/{contributions-HGqnNb_P.d.ts → contributions-DOm40g5-.d.cts} +56 -5
  11. package/dist/index.cjs +2583 -828
  12. package/dist/index.d.cts +9 -15
  13. package/dist/index.d.ts +9 -15
  14. package/dist/index.js +4 -4
  15. package/dist/{options-lMUwmRwh.d.cts → options-CSXbjMM5.d.cts} +64 -4
  16. package/dist/{options-lMUwmRwh.d.ts → options-CSXbjMM5.d.ts} +64 -4
  17. package/dist/{plugin-Cr2Pj8q8.d.ts → plugin-BDxUhGO3.d.ts} +3 -3
  18. package/dist/{plugin-Do5J5xuF.d.cts → plugin-CiQVyETg.d.cts} +3 -3
  19. package/dist/plugin.cjs +555 -17
  20. package/dist/plugin.d.cts +4 -4
  21. package/dist/plugin.d.ts +4 -4
  22. package/dist/plugin.js +2 -2
  23. package/dist/providers/binance.d.cts +2 -2
  24. package/dist/providers/binance.d.ts +2 -2
  25. package/dist/providers/coinbase.d.cts +2 -2
  26. package/dist/providers/coinbase.d.ts +2 -2
  27. package/dist/providers/hyperliquid.d.cts +2 -2
  28. package/dist/providers/hyperliquid.d.ts +2 -2
  29. package/dist/{statusline-model-B-2xGlB_.d.cts → statusline-model-C9tYXuux.d.ts} +19 -4
  30. package/dist/{statusline-model-CY1wzxHg.d.ts → statusline-model-DUBX6Fib.d.cts} +19 -4
  31. package/dist/ui.d.cts +1 -1
  32. package/dist/ui.d.ts +1 -1
  33. package/dist/ui.js +3 -3
  34. package/dist/vela.global.js +2590 -835
  35. package/dist/vela.global.min.js +124 -54
  36. package/dist/widget.cjs +2807 -969
  37. package/dist/widget.d.cts +6 -6
  38. package/dist/widget.d.ts +6 -6
  39. package/dist/widget.js +7 -7
  40. package/dist/workspace.cjs +2807 -969
  41. package/dist/workspace.d.cts +19 -5
  42. package/dist/workspace.d.ts +19 -5
  43. package/dist/workspace.js +6 -6
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { overlayScrollbarCss, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, injectStyles, announceSurface, holdForExit, iconAt, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-VHGACEHO.js';
1
+ import { overlayScrollbarCss, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, injectStyles, announceSurface, holdForExit, iconAt, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-I2U4NZD2.js';
2
2
  import { VanillaMachine, normalizeProps, spreadProps } from '@zag-js/vanilla';
3
3
  export { normalizeProps, spreadProps } from '@zag-js/vanilla';
4
4
  import * as menu from '@zag-js/menu';
@@ -1,5 +1,5 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-lMUwmRwh.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-wbtJ3-Sa.cjs';
1
+ import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.js';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-Byo8pEv0.js';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -950,6 +950,17 @@ interface VelaEventMap extends Record<string, unknown> {
950
950
  "drawing:favorites": {
951
951
  favorites: string[];
952
952
  };
953
+ /** A tool's remembered settings changed — the ones its next drawing starts from (the last
954
+ * drawing of that type the user styled, a bulk restore, or a reset). Read them back with
955
+ * `drawings.toolDefaults()`. */
956
+ "drawing:defaults": {
957
+ type: DrawingTypeKey;
958
+ };
959
+ /** A tool's saved looks changed (saved, deleted, or a bulk restore) — read them back with
960
+ * `drawings.toolTemplates()`. */
961
+ "drawing:templates": {
962
+ type: DrawingTypeKey;
963
+ };
953
964
  /** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
954
965
  * the pointer, `null`), or a programmatic `drawings.setTool`. */
955
966
  "drawing:tool": {
@@ -1376,7 +1387,10 @@ declare class DrawingController {
1376
1387
  private favs;
1377
1388
  private selectedIds;
1378
1389
  private clipboard;
1379
- private readonly lastStyle;
1390
+ /** Per-tool remembered settings — the last drawing of each type the user styled seeds the next. */
1391
+ private readonly defaults;
1392
+ /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
+ private templates;
1380
1394
  private readonly subs;
1381
1395
  constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1382
1396
  /** Whether the active renderer supports interactive drawings. */
@@ -1398,6 +1412,24 @@ declare class DrawingController {
1398
1412
  /** Replace the whole favorite set (bulk restore) — unknown types are dropped. */
1399
1413
  setFavorites(types: readonly DrawingTypeKey[]): void;
1400
1414
  private pushFavorites;
1415
+ /** Every tool's remembered settings, by type (plain JSON — persist it as-is). */
1416
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1417
+ /** Replace every tool's remembered settings (restoring persisted prefs). Unknown types and
1418
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1419
+ setToolDefaults(map: Readonly<Record<string, unknown>> | null | undefined): void;
1420
+ /** Forget a tool's remembered settings (every tool's when `type` is omitted) — new drawings
1421
+ * start from the factory defaults again. */
1422
+ resetToolDefaults(type?: DrawingTypeKey): void;
1423
+ /** Every tool's saved looks, by type (plain JSON — persist it as-is). */
1424
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1425
+ /** Replace every tool's saved looks (restoring persisted prefs). Unknown types and
1426
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1427
+ setToolTemplates(map: Readonly<Record<string, unknown>> | null | undefined): void;
1428
+ /** Save the given settings as a named look for a tool (a same-named one is replaced). */
1429
+ saveToolTemplate(type: DrawingTypeKey, name: string, settings: DrawingToolDefaults): void;
1430
+ /** Delete a tool's saved look by name. */
1431
+ removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
+ private pushTemplates;
1401
1433
  setToolbar(option: DrawingsOption): void;
1402
1434
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1403
1435
  * inert on a renderer without the optional `setExternalGhost` seam. */
@@ -1462,8 +1494,12 @@ declare class DrawingController {
1462
1494
  /** Add clones (fresh ids, fresh mount-order z) as one undo step + select them. */
1463
1495
  private insertClones;
1464
1496
  private resolve;
1465
- /** Remember a drawing's style as the "last used" for its type (seeds the next one). */
1466
- private captureStyle;
1497
+ /** `store.update` that remembers the drawing's settings only when the patch changed them:
1498
+ * moving an older drawing must not hand its look back to the tool. */
1499
+ private updateDrawing;
1500
+ /** Remember a drawing's settings as its tool's defaults (they seed the next one), and
1501
+ * announce a real change so a host can save it. */
1502
+ private captureDefaults;
1467
1503
  private sync;
1468
1504
  /** Renderer gesture → authoritative store mutation + event. */
1469
1505
  private onIntent;
@@ -1562,6 +1598,21 @@ declare class DrawingsControl {
1562
1598
  setFavorite(type: DrawingTypeKey, on: boolean): this;
1563
1599
  /** Replace the whole favorite set (e.g. restoring persisted prefs). */
1564
1600
  setFavorites(types: readonly DrawingTypeKey[]): this;
1601
+ /** Every tool's remembered settings, by type — what the next drawing of each type starts
1602
+ * from (its style, text styling and per-type settings such as fib levels). Plain JSON:
1603
+ * persist it and hand it back to {@link setToolDefaults} on the next load. */
1604
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1605
+ /** Replace every tool's remembered settings (e.g. restoring persisted prefs). Malformed
1606
+ * entries and unknown types are dropped. Follow changes on `drawing:defaults`. */
1607
+ setToolDefaults(map: Readonly<Record<string, unknown>>): this;
1608
+ /** Forget one tool's remembered settings (every tool's without an argument). */
1609
+ resetToolDefaults(type?: DrawingTypeKey): this;
1610
+ /** Every tool's saved looks ("styles" in the settings panel), by type. Plain JSON —
1611
+ * persist it and hand it back to {@link setToolTemplates}. */
1612
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1613
+ /** Replace every tool's saved looks (e.g. restoring persisted prefs). Follow changes on
1614
+ * `drawing:templates`. */
1615
+ setToolTemplates(map: Readonly<Record<string, unknown>>): this;
1565
1616
  /** Aliases mirroring `renderer.getConfig()/applyConfig()` for symmetry. */
1566
1617
  getConfig(): DrawingsDocument;
1567
1618
  applyConfig(doc: unknown): this;
@@ -1,5 +1,5 @@
1
- import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-lMUwmRwh.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-oH78tYXL.js';
1
+ import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, bh as DrawingToolDefaults, bi as DrawingToolTemplate, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-CSXbjMM5.cjs';
2
+ import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-Bw58CjYy.cjs';
3
3
 
4
4
  /**
5
5
  * A strategy's broker state at ONE bar — the flat summary a host reads while a script
@@ -950,6 +950,17 @@ interface VelaEventMap extends Record<string, unknown> {
950
950
  "drawing:favorites": {
951
951
  favorites: string[];
952
952
  };
953
+ /** A tool's remembered settings changed — the ones its next drawing starts from (the last
954
+ * drawing of that type the user styled, a bulk restore, or a reset). Read them back with
955
+ * `drawings.toolDefaults()`. */
956
+ "drawing:defaults": {
957
+ type: DrawingTypeKey;
958
+ };
959
+ /** A tool's saved looks changed (saved, deleted, or a bulk restore) — read them back with
960
+ * `drawings.toolTemplates()`. */
961
+ "drawing:templates": {
962
+ type: DrawingTypeKey;
963
+ };
953
964
  /** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
954
965
  * the pointer, `null`), or a programmatic `drawings.setTool`. */
955
966
  "drawing:tool": {
@@ -1376,7 +1387,10 @@ declare class DrawingController {
1376
1387
  private favs;
1377
1388
  private selectedIds;
1378
1389
  private clipboard;
1379
- private readonly lastStyle;
1390
+ /** Per-tool remembered settings — the last drawing of each type the user styled seeds the next. */
1391
+ private readonly defaults;
1392
+ /** Per-tool saved looks ("styles"), in the order they were saved. */
1393
+ private templates;
1380
1394
  private readonly subs;
1381
1395
  constructor(renderer: IChartRenderer, events: TypedEventBus<VelaEventMap>, option: DrawingsOption | undefined, seriesGateway?: DrawingSeriesGateway);
1382
1396
  /** Whether the active renderer supports interactive drawings. */
@@ -1398,6 +1412,24 @@ declare class DrawingController {
1398
1412
  /** Replace the whole favorite set (bulk restore) — unknown types are dropped. */
1399
1413
  setFavorites(types: readonly DrawingTypeKey[]): void;
1400
1414
  private pushFavorites;
1415
+ /** Every tool's remembered settings, by type (plain JSON — persist it as-is). */
1416
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1417
+ /** Replace every tool's remembered settings (restoring persisted prefs). Unknown types and
1418
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1419
+ setToolDefaults(map: Readonly<Record<string, unknown>> | null | undefined): void;
1420
+ /** Forget a tool's remembered settings (every tool's when `type` is omitted) — new drawings
1421
+ * start from the factory defaults again. */
1422
+ resetToolDefaults(type?: DrawingTypeKey): void;
1423
+ /** Every tool's saved looks, by type (plain JSON — persist it as-is). */
1424
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1425
+ /** Replace every tool's saved looks (restoring persisted prefs). Unknown types and
1426
+ * malformed entries are dropped; an unchanged set is a no-op and emits nothing. */
1427
+ setToolTemplates(map: Readonly<Record<string, unknown>> | null | undefined): void;
1428
+ /** Save the given settings as a named look for a tool (a same-named one is replaced). */
1429
+ saveToolTemplate(type: DrawingTypeKey, name: string, settings: DrawingToolDefaults): void;
1430
+ /** Delete a tool's saved look by name. */
1431
+ removeToolTemplate(type: DrawingTypeKey, name: string): void;
1432
+ private pushTemplates;
1401
1433
  setToolbar(option: DrawingsOption): void;
1402
1434
  /** Display (or clear) another chart's in-progress placement as a ghost — silently
1403
1435
  * inert on a renderer without the optional `setExternalGhost` seam. */
@@ -1462,8 +1494,12 @@ declare class DrawingController {
1462
1494
  /** Add clones (fresh ids, fresh mount-order z) as one undo step + select them. */
1463
1495
  private insertClones;
1464
1496
  private resolve;
1465
- /** Remember a drawing's style as the "last used" for its type (seeds the next one). */
1466
- private captureStyle;
1497
+ /** `store.update` that remembers the drawing's settings only when the patch changed them:
1498
+ * moving an older drawing must not hand its look back to the tool. */
1499
+ private updateDrawing;
1500
+ /** Remember a drawing's settings as its tool's defaults (they seed the next one), and
1501
+ * announce a real change so a host can save it. */
1502
+ private captureDefaults;
1467
1503
  private sync;
1468
1504
  /** Renderer gesture → authoritative store mutation + event. */
1469
1505
  private onIntent;
@@ -1562,6 +1598,21 @@ declare class DrawingsControl {
1562
1598
  setFavorite(type: DrawingTypeKey, on: boolean): this;
1563
1599
  /** Replace the whole favorite set (e.g. restoring persisted prefs). */
1564
1600
  setFavorites(types: readonly DrawingTypeKey[]): this;
1601
+ /** Every tool's remembered settings, by type — what the next drawing of each type starts
1602
+ * from (its style, text styling and per-type settings such as fib levels). Plain JSON:
1603
+ * persist it and hand it back to {@link setToolDefaults} on the next load. */
1604
+ toolDefaults(): Partial<Record<DrawingTypeKey, DrawingToolDefaults>>;
1605
+ /** Replace every tool's remembered settings (e.g. restoring persisted prefs). Malformed
1606
+ * entries and unknown types are dropped. Follow changes on `drawing:defaults`. */
1607
+ setToolDefaults(map: Readonly<Record<string, unknown>>): this;
1608
+ /** Forget one tool's remembered settings (every tool's without an argument). */
1609
+ resetToolDefaults(type?: DrawingTypeKey): this;
1610
+ /** Every tool's saved looks ("styles" in the settings panel), by type. Plain JSON —
1611
+ * persist it and hand it back to {@link setToolTemplates}. */
1612
+ toolTemplates(): Partial<Record<DrawingTypeKey, DrawingToolTemplate[]>>;
1613
+ /** Replace every tool's saved looks (e.g. restoring persisted prefs). Follow changes on
1614
+ * `drawing:templates`. */
1615
+ setToolTemplates(map: Readonly<Record<string, unknown>>): this;
1565
1616
  /** Aliases mirroring `renderer.getConfig()/applyConfig()` for symmetry. */
1566
1617
  getConfig(): DrawingsDocument;
1567
1618
  applyConfig(doc: unknown): this;