@luxalgo/vela 0.6.8 → 0.6.10
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-BSLlBpB9.d.ts → DataProvider-CWmp31dA.d.ts} +49 -1
- package/dist/{DataProvider-BsQM2WNH.d.cts → DataProvider-l_eLMly_.d.cts} +49 -1
- package/dist/{chunk-L3I2CCYO.js → chunk-4KZVZ7QQ.js} +49 -2
- package/dist/{chunk-SQETIBFU.js → chunk-FFOP37FQ.js} +996 -377
- package/dist/{chunk-2R7BANEM.js → chunk-G77Y7LK2.js} +2 -2
- package/dist/{chunk-PN5KWFZ4.js → chunk-KG4YT3TI.js} +5 -3
- package/dist/{chunk-OICPLNU7.js → chunk-MHY7MVXH.js} +192 -2
- package/dist/{chunk-N7LGMKCE.js → chunk-NMTQXNT4.js} +637 -164
- package/dist/{contributions-DLLdV9jD.d.ts → contributions-BCz6Dr6a.d.ts} +99 -7
- package/dist/{contributions-Vw-Hm58R.d.cts → contributions-D9vTzm5p.d.cts} +99 -7
- package/dist/index.cjs +1210 -383
- package/dist/index.d.cts +37 -11
- package/dist/index.d.ts +37 -11
- package/dist/index.js +4 -4
- package/dist/{options-BaVTMXaO.d.ts → options-DSqHsQyN.d.cts} +84 -7
- package/dist/{options-BaVTMXaO.d.cts → options-DSqHsQyN.d.ts} +84 -7
- package/dist/{plugin-BnJgjLAy.d.cts → plugin-Bt8hLR8Z.d.cts} +3 -3
- package/dist/{plugin-CC7rBrOY.d.ts → plugin-CH7pfMrE.d.ts} +3 -3
- package/dist/plugin.cjs +21 -3
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/{statusline-CGkB2EOo.d.ts → statusline-5K7y4Ya2.d.ts} +5 -3
- package/dist/{statusline-DqzBqy42.d.cts → statusline-TYLQmoeh.d.cts} +5 -3
- package/dist/ui.cjs +208 -5
- package/dist/ui.d.cts +91 -2
- package/dist/ui.d.ts +91 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +1210 -383
- package/dist/vela.global.min.js +99 -48
- package/dist/widget.cjs +1771 -449
- package/dist/widget.d.cts +17 -6
- package/dist/widget.d.ts +17 -6
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +1771 -449
- package/dist/workspace.d.cts +100 -6
- package/dist/workspace.d.ts +100 -6
- package/dist/workspace.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-
|
|
2
|
-
import { injectStyles } from './chunk-
|
|
1
|
+
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-MHY7MVXH.js';
|
|
2
|
+
import { injectStyles } from './chunk-KG4YT3TI.js';
|
|
3
3
|
import * as tooltip from '@zag-js/tooltip';
|
|
4
4
|
import * as dialog from '@zag-js/dialog';
|
|
5
5
|
|
|
@@ -98,11 +98,11 @@ registerIcon(
|
|
|
98
98
|
);
|
|
99
99
|
registerIcon(
|
|
100
100
|
"market-pre",
|
|
101
|
-
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="
|
|
101
|
+
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m8 6 4-4 4 4"/><path d="M16 18a4 4 0 0 0-8 0"/>')
|
|
102
102
|
);
|
|
103
103
|
registerIcon(
|
|
104
104
|
"market-post",
|
|
105
|
-
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16
|
|
105
|
+
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16 14-4 4-4-4"/><path d="M16 6a4 4 0 0 0-8 0"/>')
|
|
106
106
|
);
|
|
107
107
|
registerIcon("market-closed", svg24('<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>'));
|
|
108
108
|
registerIcon(
|
|
@@ -135,6 +135,8 @@ registerIcon("folder-plus", S('<path d="M1.6 4.4a1 1 0 0 1 1-1h2.7l1.3 1.7h6.8a1
|
|
|
135
135
|
registerIcon("folder-minus", S('<path d="M1.6 4.4a1 1 0 0 1 1-1h2.7l1.3 1.7h6.8a1 1 0 0 1 1 1v6.5a1 1 0 0 1-1 1h-10.8a1 1 0 0 1-1-1z"/><path d="M6.2 9.4h3.6"/>'));
|
|
136
136
|
registerIcon("collapse", S('<path d="M3 8h10"/>'));
|
|
137
137
|
registerIcon("expand", S('<rect x="2.2" y="2.2" width="11.6" height="11.6" rx="1.4"/><path d="M8 5.4v5.2M5.4 8h5.2"/>'));
|
|
138
|
+
registerIcon("plus", S('<path d="M8 2.8v10.4M2.8 8h10.4"/>'));
|
|
139
|
+
registerIcon("minus", S('<path d="M2.8 8h10.4"/>'));
|
|
138
140
|
registerIcon("maximize", S('<path d="M2.5 6V3a.5.5 0 0 1 .5-.5h3M10 2.5h3a.5.5 0 0 1 .5.5v3M13.5 10v3a.5.5 0 0 1-.5.5h-3M6 13.5H3a.5.5 0 0 1-.5-.5v-3"/>'));
|
|
139
141
|
registerIcon("restore", S('<path d="M6.2 2.5v3.7H2.5M9.8 13.5V9.8h3.7M13.5 6.2H9.8V2.5M2.5 9.8h3.7v3.7"/>'));
|
|
140
142
|
registerIcon("star", S('<path d="M8 2.2l1.75 3.55 3.9.55-2.8 2.75.65 3.9L8 11.1l-3.5 1.85.65-3.9-2.8-2.75 3.9-.55z"/>'));
|
|
@@ -142,7 +144,7 @@ registerIcon("star-filled", S('<path d="M8 2.2l1.75 3.55 3.9.55-2.8 2.75.65 3.9L
|
|
|
142
144
|
registerIcon("grip", S('<circle cx="6" cy="3.5" r="1"/><circle cx="10" cy="3.5" r="1"/><circle cx="6" cy="8" r="1"/><circle cx="10" cy="8" r="1"/><circle cx="6" cy="12.5" r="1"/><circle cx="10" cy="12.5" r="1"/>', 'fill="currentColor" stroke="none"'));
|
|
143
145
|
registerIcon("kebab", S('<circle cx="8" cy="3.2" r="1.2"/><circle cx="8" cy="8" r="1.2"/><circle cx="8" cy="12.8" r="1.2"/>', 'fill="currentColor" stroke="none"'));
|
|
144
146
|
registerIcon("burger", S('<path d="M2.5 4.5h11M2.5 8h11M2.5 11.5h11"/>'));
|
|
145
|
-
registerIcon("reset", S('<
|
|
147
|
+
registerIcon("reset", S('<path d="M2 8a6 6 0 1 0 6-6 6.5 6.5 0 0 0-4.5 1.83L2 5.33"/><path d="M2 2v3.33h3.33"/>'));
|
|
146
148
|
registerIcon("pane-collapse", S('<path d="M2.6 9.4h4v4M13.4 6.6h-4v-4"/><path d="m9.4 6.6 4.2-4.2M2.4 13.6l4.2-4.2"/>'));
|
|
147
149
|
registerIcon("pane-expand", S('<path d="M9.8 2.4h3.8v3.8M6.2 13.6H2.4V9.8"/><path d="m13.6 2.4-4.4 4.4M2.4 13.6l4.4-4.4"/>'));
|
|
148
150
|
registerIcon("cursor", svg24('<path d="M5 3l6 16 2-6 6-2z"/>', 'fill="currentColor" stroke="none"'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { overlayScrollbarCss, injectStyles, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-
|
|
1
|
+
import { overlayScrollbarCss, injectStyles, isDarkColor, mix, HIGHLIGHT, ACCENT_BRIGHT, ACCENT, withAlpha, iconAt, iconEl, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-KG4YT3TI.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';
|
|
@@ -707,6 +707,196 @@ var Popover = class {
|
|
|
707
707
|
}
|
|
708
708
|
};
|
|
709
709
|
|
|
710
|
+
// src/ui/components/callout-bubble/controller.ts
|
|
711
|
+
function closesPanel(item) {
|
|
712
|
+
return item.close !== false;
|
|
713
|
+
}
|
|
714
|
+
function calloutPanelRows(items) {
|
|
715
|
+
const rows = [];
|
|
716
|
+
for (const item of items) {
|
|
717
|
+
if (item.type === "text") {
|
|
718
|
+
rows.push({ type: "text", text: item.text });
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
const last = rows[rows.length - 1];
|
|
722
|
+
if (last && last.type === "buttons") last.buttons.push(item);
|
|
723
|
+
else rows.push({ type: "buttons", buttons: [item] });
|
|
724
|
+
}
|
|
725
|
+
return rows;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// src/ui/components/callout-bubble/styles.ts
|
|
729
|
+
var CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
730
|
+
var CALLOUT_CSS = `
|
|
731
|
+
.vela-callout {
|
|
732
|
+
display: inline-grid;
|
|
733
|
+
place-items: center;
|
|
734
|
+
border-radius: 50%;
|
|
735
|
+
flex: none;
|
|
736
|
+
line-height: 0;
|
|
737
|
+
box-sizing: border-box;
|
|
738
|
+
cursor: default;
|
|
739
|
+
user-select: none;
|
|
740
|
+
-webkit-user-select: none;
|
|
741
|
+
}
|
|
742
|
+
.vela-callout[role='button'] { cursor: pointer; }
|
|
743
|
+
.vela-callout svg { display: block; }
|
|
744
|
+
/* The deployed panel \u2014 carries the kit's elevated-card look itself (the popover
|
|
745
|
+
shell is bare positioning chrome). */
|
|
746
|
+
.vela-callout-panel {
|
|
747
|
+
display: flex;
|
|
748
|
+
flex-direction: column;
|
|
749
|
+
gap: 8px;
|
|
750
|
+
padding: 10px 12px;
|
|
751
|
+
max-width: 280px;
|
|
752
|
+
box-sizing: border-box;
|
|
753
|
+
background: var(--vela-surface-elev);
|
|
754
|
+
border: 1px solid var(--vela-border-strong);
|
|
755
|
+
border-radius: 6px;
|
|
756
|
+
box-shadow: var(--vela-shadow);
|
|
757
|
+
color: var(--vela-fg);
|
|
758
|
+
font: var(--vela-font-size-md) var(--vela-font);
|
|
759
|
+
}
|
|
760
|
+
.vela-callout-title { font-weight: 600; color: var(--vela-fg-bright); }
|
|
761
|
+
.vela-callout-text { color: var(--vela-fg-muted); line-height: 1.45; white-space: pre-line; }
|
|
762
|
+
.vela-callout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
763
|
+
.vela-callout-btn {
|
|
764
|
+
cursor: pointer;
|
|
765
|
+
height: 26px;
|
|
766
|
+
padding: 0 10px;
|
|
767
|
+
border-radius: 5px;
|
|
768
|
+
border: 1px solid var(--vela-border);
|
|
769
|
+
background: transparent;
|
|
770
|
+
color: var(--vela-fg);
|
|
771
|
+
font-size: var(--vela-font-size-md);
|
|
772
|
+
font-family: inherit;
|
|
773
|
+
transition: background var(--vela-dur-fast) ease, color var(--vela-dur-fast) ease, opacity var(--vela-dur-fast) ease, border-color var(--vela-dur-fast) ease;
|
|
774
|
+
}
|
|
775
|
+
.vela-callout-btn:hover { background: var(--vela-hover); color: var(--vela-fg-bright); border-color: var(--vela-fg-muted); }
|
|
776
|
+
.vela-callout-btn-primary { border-color: var(--vela-selected-bg); background: var(--vela-selected-bg); color: var(--vela-selected-fg); }
|
|
777
|
+
.vela-callout-btn-primary:hover { background: var(--vela-selected-bg); color: var(--vela-selected-fg); opacity: 0.85; border-color: var(--vela-selected-bg); }
|
|
778
|
+
`;
|
|
779
|
+
|
|
780
|
+
// src/ui/components/callout-bubble/view.ts
|
|
781
|
+
var CalloutBubble = class {
|
|
782
|
+
constructor(opts) {
|
|
783
|
+
this.pop = null;
|
|
784
|
+
this.spec = { icon: opts.icon, background: opts.background, label: opts.label };
|
|
785
|
+
if (opts.color !== void 0) this.spec.color = opts.color;
|
|
786
|
+
if (opts.panel !== void 0) this.spec.panel = opts.panel;
|
|
787
|
+
this.size = opts.size ?? 16;
|
|
788
|
+
this.host = opts.host;
|
|
789
|
+
this.theme = opts.theme;
|
|
790
|
+
this.boundary = opts.boundary;
|
|
791
|
+
const doc = (opts.host ?? document.body).ownerDocument;
|
|
792
|
+
injectStyles(CALLOUT_STYLE_ID, CALLOUT_CSS, doc);
|
|
793
|
+
this.el = doc.createElement("span");
|
|
794
|
+
this.el.className = "vela-callout";
|
|
795
|
+
this.el.style.width = `${this.size}px`;
|
|
796
|
+
this.el.style.height = `${this.size}px`;
|
|
797
|
+
this.el.addEventListener("click", (e) => {
|
|
798
|
+
if (!this.spec.panel) return;
|
|
799
|
+
e.stopPropagation();
|
|
800
|
+
this.toggle();
|
|
801
|
+
});
|
|
802
|
+
this.el.addEventListener("dblclick", (e) => {
|
|
803
|
+
if (this.spec.panel) e.stopPropagation();
|
|
804
|
+
});
|
|
805
|
+
this.el.addEventListener("keydown", (e) => {
|
|
806
|
+
if (!this.spec.panel || e.key !== "Enter" && e.key !== " ") return;
|
|
807
|
+
e.preventDefault();
|
|
808
|
+
this.toggle();
|
|
809
|
+
});
|
|
810
|
+
this.dress();
|
|
811
|
+
}
|
|
812
|
+
/** Re-dress the bubble (a status change: new icon, tint, label, panel). */
|
|
813
|
+
set(spec) {
|
|
814
|
+
this.spec = { ...this.spec, ...spec };
|
|
815
|
+
if ("panel" in spec) this.pop?.hide();
|
|
816
|
+
this.dress();
|
|
817
|
+
}
|
|
818
|
+
/** Whether the deployed panel is currently open. */
|
|
819
|
+
get open() {
|
|
820
|
+
return this.pop?.open ?? false;
|
|
821
|
+
}
|
|
822
|
+
/** Close the deployed panel, if any. The bubble itself stays. */
|
|
823
|
+
hidePanel() {
|
|
824
|
+
this.pop?.hide();
|
|
825
|
+
}
|
|
826
|
+
destroy() {
|
|
827
|
+
this.pop?.destroy();
|
|
828
|
+
this.pop = null;
|
|
829
|
+
this.el.remove();
|
|
830
|
+
}
|
|
831
|
+
dress() {
|
|
832
|
+
const clickable = this.spec.panel !== void 0;
|
|
833
|
+
this.el.style.background = this.spec.background;
|
|
834
|
+
this.el.style.color = this.spec.color ?? "";
|
|
835
|
+
this.el.innerHTML = iconAt(this.spec.icon, this.size - 4);
|
|
836
|
+
this.el.setAttribute("aria-label", this.spec.label);
|
|
837
|
+
if (clickable) {
|
|
838
|
+
this.el.setAttribute("role", "button");
|
|
839
|
+
this.el.tabIndex = 0;
|
|
840
|
+
} else {
|
|
841
|
+
this.el.removeAttribute("role");
|
|
842
|
+
this.el.removeAttribute("tabindex");
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
toggle() {
|
|
846
|
+
if (this.pop?.open) {
|
|
847
|
+
this.pop.hide();
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
const panel = this.spec.panel;
|
|
851
|
+
if (!panel) return;
|
|
852
|
+
this.pop?.destroy();
|
|
853
|
+
this.pop = new Popover({
|
|
854
|
+
trigger: this.el,
|
|
855
|
+
gap: 6,
|
|
856
|
+
content: (body) => this.buildPanel(body, panel),
|
|
857
|
+
...this.host ? { host: this.host } : {},
|
|
858
|
+
...this.theme ? { theme: this.theme() } : {},
|
|
859
|
+
...this.boundary ? { boundary: this.boundary } : {}
|
|
860
|
+
});
|
|
861
|
+
this.pop.show();
|
|
862
|
+
}
|
|
863
|
+
buildPanel(body, panel) {
|
|
864
|
+
const doc = body.ownerDocument;
|
|
865
|
+
const root = doc.createElement("div");
|
|
866
|
+
root.className = "vela-callout-panel";
|
|
867
|
+
if (panel.title) {
|
|
868
|
+
const title = doc.createElement("div");
|
|
869
|
+
title.className = "vela-callout-title";
|
|
870
|
+
title.textContent = panel.title;
|
|
871
|
+
root.appendChild(title);
|
|
872
|
+
}
|
|
873
|
+
for (const row of calloutPanelRows(panel.items)) {
|
|
874
|
+
if (row.type === "text") {
|
|
875
|
+
const text = doc.createElement("div");
|
|
876
|
+
text.className = "vela-callout-text";
|
|
877
|
+
text.textContent = row.text;
|
|
878
|
+
root.appendChild(text);
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
const actions = doc.createElement("div");
|
|
882
|
+
actions.className = "vela-callout-actions";
|
|
883
|
+
for (const item of row.buttons) {
|
|
884
|
+
const btn = doc.createElement("button");
|
|
885
|
+
btn.type = "button";
|
|
886
|
+
btn.className = "vela-callout-btn" + (item.primary ? " vela-callout-btn-primary" : "");
|
|
887
|
+
btn.textContent = item.label;
|
|
888
|
+
btn.addEventListener("click", () => {
|
|
889
|
+
item.run();
|
|
890
|
+
if (closesPanel(item)) this.pop?.hide();
|
|
891
|
+
});
|
|
892
|
+
actions.appendChild(btn);
|
|
893
|
+
}
|
|
894
|
+
root.appendChild(actions);
|
|
895
|
+
}
|
|
896
|
+
body.appendChild(root);
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
|
|
710
900
|
// src/ui/components/select/controller.ts
|
|
711
901
|
function selectController(opts) {
|
|
712
902
|
const options = opts.options;
|
|
@@ -2645,4 +2835,4 @@ function buildFieldControl(desc) {
|
|
|
2645
2835
|
return { el };
|
|
2646
2836
|
}
|
|
2647
2837
|
|
|
2648
|
-
export { ColorField, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, STATIC_TOKENS, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, themeTokens, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions };
|
|
2838
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, STATIC_TOKENS, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, themeTokens, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions };
|