@luxalgo/vela 0.6.1 → 0.6.2

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-BNKtYU5V.d.cts → DataProvider-CNmk84SH.d.cts} +14 -0
  2. package/dist/{DataProvider-gJjN_0eh.d.ts → DataProvider-DHX4x6-r.d.ts} +14 -0
  3. package/dist/{chunk-4MQEG67Z.js → chunk-7D6YIF34.js} +2135 -2452
  4. package/dist/{chunk-ZNL2X6U2.js → chunk-7Y7CJ7EN.js} +1 -1
  5. package/dist/{chunk-EMS6PO2T.js → chunk-PN5KWFZ4.js} +6 -1
  6. package/dist/chunk-QHZ7IXFL.js +2598 -0
  7. package/dist/chunk-TP56QRMK.js +503 -0
  8. package/dist/{chunk-6LZJRO2S.js → chunk-U5KCQHAC.js} +108 -5
  9. package/dist/{contributions-D64UA74H.d.cts → contributions-DDpv7hEL.d.cts} +5 -1
  10. package/dist/{contributions-lPAgo9Cu.d.ts → contributions-ciV6Neyd.d.ts} +5 -1
  11. package/dist/{history-CVoFDJ2D.d.ts → history-CFqZm5re.d.ts} +2 -2
  12. package/dist/{history-fSMXVLt1.d.cts → history-ChoT34nz.d.cts} +2 -2
  13. package/dist/index.cjs +3708 -2730
  14. package/dist/index.d.cts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +4 -4
  17. package/dist/{plugin-o5HJH46Z.d.ts → plugin-C97gUCVf.d.ts} +6 -2
  18. package/dist/{plugin-D5ni4WEJ.d.cts → plugin-CSb_sTiN.d.cts} +6 -2
  19. package/dist/plugin.d.cts +3 -3
  20. package/dist/plugin.d.ts +3 -3
  21. package/dist/plugin.js +2 -2
  22. package/dist/providers/binance.d.cts +1 -1
  23. package/dist/providers/binance.d.ts +1 -1
  24. package/dist/providers/coinbase.d.cts +1 -1
  25. package/dist/providers/coinbase.d.ts +1 -1
  26. package/dist/providers/hyperliquid.d.cts +1 -1
  27. package/dist/providers/hyperliquid.d.ts +1 -1
  28. package/dist/ui.cjs +1001 -247
  29. package/dist/ui.d.cts +257 -10
  30. package/dist/ui.d.ts +257 -10
  31. package/dist/ui.js +3 -3
  32. package/dist/vela.global.js +12345 -3952
  33. package/dist/vela.global.min.js +479 -124
  34. package/dist/widget.cjs +3388 -2865
  35. package/dist/widget.d.cts +7 -5
  36. package/dist/widget.d.ts +7 -5
  37. package/dist/widget.js +13 -9
  38. package/dist/workspace.cjs +3051 -2528
  39. package/dist/workspace.d.cts +6 -4
  40. package/dist/workspace.d.ts +6 -4
  41. package/dist/workspace.js +11 -7
  42. package/package.json +1 -1
  43. package/dist/chunk-OGRQW3M6.js +0 -1328
  44. package/dist/chunk-QWIEKZRE.js +0 -1042
package/dist/ui.d.cts CHANGED
@@ -14,6 +14,11 @@ declare function withAlpha(color: string, alpha: number): string;
14
14
  /** A ready-to-insert element rendering the icon (empty span when unknown). */
15
15
  declare function iconEl(id: string, doc?: Document): HTMLElement;
16
16
 
17
+ /** Overlay scrollbar used by settings panes, dialog bodies, and similar chrome. */
18
+ declare function overlayScrollbarCss(selector: string, width?: number): string;
19
+ /** Focus ring shared by typeable fields (combo inputs, textareas). */
20
+ declare const FIELD_FOCUS_CSS = "outline:none;transition:border-color .12s ease,box-shadow .12s ease;";
21
+ declare const FIELD_FOCUS_RING = "border-color:var(--vela-focus);box-shadow:0 0 0 3px var(--vela-focus-soft);";
17
22
  /** Inject a stylesheet once per root (document or shadow root). Idempotent by id. */
18
23
  declare function injectStyles(id: string, css: string, root?: Document | ShadowRoot): void;
19
24
 
@@ -189,19 +194,36 @@ interface DialogOptions extends DialogControllerOptions {
189
194
  * dialogs edit live content). Pass true for a dimming scrim; the backdrop still
190
195
  * catches interact-outside dismissal either way. */
191
196
  dimBackdrop?: boolean;
197
+ /** Vertical placement of the card. Default `top` (current 10vh pad). */
198
+ align?: 'top' | 'center';
199
+ /** Pin the overlay to `host` (absolute) instead of the viewport (fixed). */
200
+ contained?: boolean;
201
+ /** Footer pinned below the scrollable body. */
202
+ footer?: Node | ((el: HTMLElement) => void);
203
+ /** Extra nodes before the title (e.g. a mobile section burger). */
204
+ headerStart?: Node;
205
+ /** Skip default body padding — the caller owns the body layout. */
206
+ flush?: boolean;
207
+ /** Extra class on the panel. */
208
+ className?: string;
209
+ /** Close when the backdrop itself is pressed (not when a portaled popover is). */
210
+ closeOnBackdrop?: boolean;
192
211
  }
193
212
  declare class Dialog {
194
213
  /** Caller-owned content area — append your form/panel here. */
195
214
  readonly body: HTMLElement;
196
- private readonly backdrop;
197
- private readonly positioner;
198
- private readonly panel;
215
+ readonly panel: HTMLElement;
216
+ readonly titleEl: HTMLElement;
217
+ readonly positioner: HTMLElement;
218
+ readonly backdrop: HTMLElement;
219
+ readonly footer: HTMLElement | null;
199
220
  private readonly handle;
200
221
  private readonly ctrl;
201
222
  constructor(opts?: DialogOptions);
202
223
  get open(): boolean;
203
224
  show(): void;
204
225
  hide(): void;
226
+ contains(node: Node | null): boolean;
205
227
  destroy(): void;
206
228
  }
207
229
 
@@ -296,7 +318,7 @@ interface PlaceResult {
296
318
  }
297
319
  /** Inset a rectangle uniformly (positive inset shrinks). */
298
320
  declare function insetRect(r: Rect, inset: number): Rect;
299
- /** Viewport rect with a uniform inset (the 6px air ColorField/WidthField used). */
321
+ /** Viewport rect with a uniform inset (the 6px air ColorField / glyph-select used). */
300
322
  declare function viewportRect(width: number, height: number, inset: number): Rect;
301
323
  /** Intersection of two rects. Empty (non-positive size) if they don't overlap. */
302
324
  declare function intersectRects(a: Rect, b: Rect): Rect;
@@ -342,6 +364,13 @@ interface PopoverOptions extends PopoverControllerOptions {
342
364
  declare function closeOpenPopovers(): void;
343
365
  declare function isPopoverOpen(): boolean;
344
366
  declare function openPopoverTrigger(): HTMLElement | null;
367
+ /**
368
+ * True when this event already dismissed a popover on its way down — a dialog's
369
+ * outside-click close must swallow it instead of closing the dialog too (the popover
370
+ * hides itself on document CAPTURE, so by the time a backdrop listener runs,
371
+ * {@link isPopoverOpen} is already false).
372
+ */
373
+ declare function eventDismissedPopover(e: Event): boolean;
345
374
  declare class Popover {
346
375
  readonly el: HTMLElement;
347
376
  readonly trigger: HTMLElement;
@@ -369,7 +398,7 @@ declare class Popover {
369
398
  }
370
399
 
371
400
  type SwitchSize = 'sm' | 'md';
372
- /** `bright` = indicator-dialog fill (`--vela-fg-bright`); `selected` = chart-settings fill. */
401
+ /** `bright` = settings-dialog fill (`--vela-fg-bright`); `selected` = `--vela-selected-bg`. */
373
402
  type SwitchTone = 'bright' | 'selected';
374
403
  interface SwitchControllerOptions {
375
404
  checked?: boolean;
@@ -409,7 +438,7 @@ interface SelectControllerOptions {
409
438
  options: readonly SelectOption[];
410
439
  value?: string;
411
440
  size?: SelectSize;
412
- /** Stretch the trigger to its parent (indicator dialog). Chart settings hug content. */
441
+ /** Stretch the trigger to its parent. Off: the shared 100px kit column (ellipsis). */
413
442
  fill?: boolean;
414
443
  disabled?: boolean;
415
444
  onChange?: (value: string, label: string) => void;
@@ -478,7 +507,9 @@ interface NumberInputControllerOptions {
478
507
  step?: number;
479
508
  integer?: boolean;
480
509
  size?: NumberSize;
481
- /** `blur` (indicator dialog: clamp + steppers) vs `live` (chart settings: no clamp). */
510
+ /** `blur` clamps on commit (indicator dialog). `live` emits on every keystroke
511
+ * (chart settings). Steppers default on for `blur`; pass `steppers: true` to
512
+ * keep them with live commit. */
482
513
  commit?: NumberCommit;
483
514
  steppers?: boolean;
484
515
  clamp?: boolean;
@@ -518,6 +549,9 @@ interface NumberInputOptions extends NumberInputControllerOptions {
518
549
  placeholder?: string;
519
550
  emptyValue?: number;
520
551
  compact?: boolean;
552
+ /** Stretch to the parent. Defaults to on for `md`, off for `sm`. Chart settings
553
+ * passes `false` so the field stays a 100px kit column instead of filling the pane. */
554
+ fill?: boolean;
521
555
  }
522
556
  declare class NumberInput {
523
557
  readonly el: HTMLElement;
@@ -607,8 +641,8 @@ interface ColorFieldOpts {
607
641
  id?: string;
608
642
  popover?: Pick<PopoverOptions, 'host' | 'position' | 'boundary' | 'zIndex' | 'gap' | 'align'>;
609
643
  }
610
- /** Closed-state swatch shape. `square` is the chart-settings field; `circle` is the
611
- * indicator-dialog preview a square chip inset from a matching square field border. */
644
+ /** Closed-state swatch shape. `circle` is the settings-dialog preview (a square chip
645
+ * inset from a matching field border); `square` is the compact drawing-chrome swatch. */
612
646
  declare function colorField(theme: VelaTheme, getVal: () => string, onVal: (v: string) => void, opts?: {
613
647
  shape?: ColorFieldShape;
614
648
  id?: string;
@@ -628,4 +662,217 @@ declare class ColorField {
628
662
  /** Close any open color (or other kit) popover — dialog teardown. */
629
663
  declare function closeColorPopover(): void;
630
664
 
631
- export { ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, Drawer, type DrawerApi, type DrawerControllerOptions, type DrawerOptions, type DrawerService, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, type NumberCommit, NumberInput, type NumberInputController, type NumberInputControllerOptions, type NumberInputOptions, type NumberSize, type PlaceArgs, type PlaceResult, Popover, type PopoverAlign, type PopoverBoundary, type PopoverController, type PopoverControllerOptions, type PopoverOptions, type PopoverPosition, type Rect, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, Switch, type SwitchController, type SwitchControllerOptions, type SwitchOptions, type SwitchSize, type SwitchTone, TextField, type TextFieldController, type TextFieldControllerOptions, type TextFieldOptions, type TextFieldSize, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildPalette, clampNumber, closeColorPopover, closeOpenPopovers, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, drawerController, ensureUIHost, fillSelectList, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, withAlpha };
665
+ type FieldGridVariant = 'settings' | 'inputs';
666
+ type FieldLabelSize = 'sm' | 'md';
667
+ /** Label↔control and between-row rhythm shared by the settings surfaces. */
668
+ declare const FIELD_GAP_PX = 16;
669
+ /** Grid tracks for a field grid. Settings hugs both columns; inputs give leftover
670
+ * space to the control column. Mobile flips the label to a flexible track. */
671
+ declare function fieldGridColumns(variant: FieldGridVariant, mobile: boolean): string;
672
+
673
+ interface FieldGridOptions {
674
+ variant?: FieldGridVariant;
675
+ mobile?: boolean;
676
+ }
677
+ /** Shared label/control grid. Rows with `display:contents` participate in these tracks. */
678
+ declare function fieldGrid(opts?: FieldGridOptions): HTMLElement;
679
+ interface FieldSectionOptions {
680
+ variant?: FieldGridVariant;
681
+ first?: boolean;
682
+ }
683
+ /** Uppercase group heading that spans the field grid. */
684
+ declare function fieldSection(title: string, opts?: FieldSectionOptions): HTMLElement;
685
+ /** Vertical breathing space between row clusters. */
686
+ declare function fieldSeparator(): HTMLElement;
687
+ interface FieldToggleOpts {
688
+ checked: boolean;
689
+ onChange: (v: boolean) => void;
690
+ get?: () => boolean;
691
+ id?: string;
692
+ }
693
+ interface FieldInlineItem {
694
+ label?: string;
695
+ id?: string;
696
+ control: HTMLElement;
697
+ /** Toggle sits left of its label (bool companion on an inline row). */
698
+ toggleFirst?: boolean;
699
+ fit?: boolean;
700
+ }
701
+ interface FieldRowOptions {
702
+ label: string;
703
+ id?: string;
704
+ control?: HTMLElement | HTMLElement[];
705
+ info?: HTMLElement;
706
+ toggle?: FieldToggleOpts;
707
+ /** Full-width toggle + label (no control column). */
708
+ bool?: boolean;
709
+ /** Full-width stacked: centered label above a full-width control (textarea). */
710
+ stacked?: boolean;
711
+ /** Full-width wrap of several labeled controls. */
712
+ inline?: FieldInlineItem[];
713
+ /** Skip the 100px control wrap (color / session / time). */
714
+ fit?: boolean;
715
+ /** Wrap a single control at this width (indicator dialog number/select column). */
716
+ controlWidth?: number;
717
+ labelSize?: FieldLabelSize;
718
+ className?: string;
719
+ }
720
+ /** Label + control slot, optional master toggle, optional ⓘ. Grid-aware. */
721
+ declare function fieldRow(opts: FieldRowOptions): HTMLElement;
722
+ interface FieldControlHandle {
723
+ el: HTMLElement;
724
+ setValue?: (v: unknown) => void;
725
+ }
726
+ type FieldControlDesc = {
727
+ kind: 'number';
728
+ id?: string;
729
+ value: number;
730
+ min?: number;
731
+ max?: number;
732
+ step?: number;
733
+ integer?: boolean;
734
+ commit?: 'blur' | 'live';
735
+ steppers?: boolean;
736
+ fill?: boolean;
737
+ compact?: boolean;
738
+ clamp?: boolean;
739
+ placeholder?: string;
740
+ emptyValue?: number;
741
+ title?: string;
742
+ onChange: (v: number) => void;
743
+ sync?: () => number;
744
+ } | {
745
+ kind: 'select';
746
+ id?: string;
747
+ options: readonly SelectOption[];
748
+ value: string;
749
+ fill?: boolean;
750
+ theme?: VelaTheme;
751
+ list?: SelectListPopoverOpts;
752
+ title?: string;
753
+ onChange: (v: string) => void;
754
+ sync?: () => string;
755
+ } | {
756
+ kind: 'switch';
757
+ id?: string;
758
+ checked: boolean;
759
+ onChange: (v: boolean) => void;
760
+ sync?: () => boolean;
761
+ } | {
762
+ kind: 'color';
763
+ id?: string;
764
+ theme: VelaTheme;
765
+ get: () => string;
766
+ onChange: (v: string) => void;
767
+ popover?: ColorFieldOpts['popover'];
768
+ title?: string;
769
+ } | {
770
+ kind: 'text';
771
+ id?: string;
772
+ value: string;
773
+ fill?: boolean;
774
+ placeholder?: string;
775
+ onChange: (v: string) => void;
776
+ sync?: () => string;
777
+ } | {
778
+ kind: 'textarea';
779
+ id?: string;
780
+ value: string;
781
+ rows?: number;
782
+ autoGrow?: boolean;
783
+ maxLines?: number;
784
+ placeholder?: string;
785
+ onChange: (v: string) => void;
786
+ sync?: () => string;
787
+ } | {
788
+ kind: 'width';
789
+ theme: VelaTheme;
790
+ get: () => number;
791
+ onChange: (v: number) => void;
792
+ title?: string;
793
+ };
794
+ /** One kit control from a neutral descriptor. `sync` re-reads on `vela-sync`. */
795
+ declare function buildFieldControl(desc: FieldControlDesc): FieldControlHandle;
796
+
797
+ type TextAreaSize = 'sm' | 'md';
798
+ interface TextAreaControllerOptions {
799
+ value?: string;
800
+ size?: TextAreaSize;
801
+ rows?: number;
802
+ disabled?: boolean;
803
+ onChange?: (value: string) => void;
804
+ }
805
+ interface TextAreaController {
806
+ value: string;
807
+ size: TextAreaSize;
808
+ rows: number;
809
+ disabled: boolean;
810
+ commit(next: string): string | null;
811
+ sync(next: string): void;
812
+ }
813
+ declare function textAreaController(opts?: TextAreaControllerOptions): TextAreaController;
814
+
815
+ interface TextAreaOptions extends TextAreaControllerOptions {
816
+ id?: string;
817
+ placeholder?: string;
818
+ /** Grow with content up to `maxLines`, then scroll. */
819
+ autoGrow?: boolean;
820
+ maxLines?: number;
821
+ }
822
+ declare class TextArea {
823
+ readonly el: HTMLElement;
824
+ readonly input: HTMLTextAreaElement;
825
+ private readonly ctrl;
826
+ private readonly autoGrow;
827
+ private readonly maxLines;
828
+ constructor(opts?: TextAreaOptions);
829
+ get value(): string;
830
+ setValue(v: string): void;
831
+ private grow;
832
+ }
833
+
834
+ interface GlyphOption<T extends string | number = string | number> {
835
+ value: T;
836
+ label: string;
837
+ /** Inner HTML of the preview glyph (currentColor stroke). */
838
+ glyph: string;
839
+ }
840
+ interface GlyphSelectControllerOptions<T extends string | number = string | number> {
841
+ options: readonly GlyphOption<T>[];
842
+ value: T;
843
+ onChange?: (value: T) => void;
844
+ }
845
+ interface GlyphSelectController<T extends string | number = string | number> {
846
+ options: readonly GlyphOption<T>[];
847
+ value: T;
848
+ setValue(v: T): void;
849
+ optionOf(value: T): GlyphOption<T> | undefined;
850
+ pick(value: T): T;
851
+ }
852
+ declare function glyphSelectController<T extends string | number>(opts: GlyphSelectControllerOptions<T>): GlyphSelectController<T>;
853
+ /** The classic 1–5 px line-width ladder. */
854
+ declare const WIDTH_FIELD_OPTIONS: readonly number[];
855
+ /** A horizontal line glyph whose stroke IS the previewed weight. */
856
+ declare function lineWidthGlyph(width: number): string;
857
+ declare function widthFieldOptions(): readonly GlyphOption<number>[];
858
+
859
+ interface GlyphSelectOptions<T extends string | number = string | number> extends GlyphSelectControllerOptions<T> {
860
+ theme: VelaTheme;
861
+ title?: string;
862
+ get?: () => T;
863
+ }
864
+ declare class GlyphSelect<T extends string | number = string | number> {
865
+ readonly el: HTMLButtonElement;
866
+ private readonly ctrl;
867
+ private readonly theme;
868
+ private readonly get;
869
+ constructor(opts: GlyphSelectOptions<T>);
870
+ setValue(v: T): void;
871
+ private paint;
872
+ private toggle;
873
+ }
874
+ /** Settings-dialog line-width field (1–5 px glyphs). */
875
+ declare function widthField(theme: VelaTheme, getVal: () => number, onVal: (v: number) => void): HTMLElement;
876
+ declare function closeWidthPopover(): void;
877
+
878
+ export { ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, Drawer, type DrawerApi, type DrawerControllerOptions, type DrawerOptions, type DrawerService, FIELD_FOCUS_CSS, FIELD_FOCUS_RING, FIELD_GAP_PX, type FieldControlDesc, type FieldControlHandle, type FieldGridOptions, type FieldGridVariant, type FieldInlineItem, type FieldLabelSize, type FieldRowOptions, type FieldSectionOptions, type FieldToggleOpts, type GlyphOption, GlyphSelect, type GlyphSelectController, type GlyphSelectControllerOptions, type GlyphSelectOptions, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, type NumberCommit, NumberInput, type NumberInputController, type NumberInputControllerOptions, type NumberInputOptions, type NumberSize, type PlaceArgs, type PlaceResult, Popover, type PopoverAlign, type PopoverBoundary, type PopoverController, type PopoverControllerOptions, type PopoverOptions, type PopoverPosition, type Rect, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, Switch, type SwitchController, type SwitchControllerOptions, type SwitchOptions, type SwitchSize, type SwitchTone, TextArea, type TextAreaController, type TextAreaControllerOptions, type TextAreaOptions, type TextAreaSize, TextField, type TextFieldController, type TextFieldControllerOptions, type TextFieldOptions, type TextFieldSize, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, overlayScrollbarCss, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, widthField, widthFieldOptions, withAlpha };