@luxalgo/vela 0.8.0 → 0.8.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.
- package/NOTICE +1 -1
- package/README.md +15 -7
- package/dist/{chunk-QBPUT5SU.js → chunk-ATGTCWHJ.js} +41 -23
- package/dist/{chunk-E3GU6AUI.js → chunk-DBDXKZUF.js} +18 -13
- package/dist/{chunk-KA77UTRF.js → chunk-LMBYEGUR.js} +1 -1
- package/dist/{chunk-2IAETM2I.js → chunk-NELQJCGK.js} +38 -3
- package/dist/index.cjs +78 -25
- package/dist/index.js +2 -2
- package/dist/ui.cjs +38 -3
- package/dist/ui.js +2 -2
- package/dist/vela.global.js +78 -25
- package/dist/vela.global.min.js +51 -58
- package/dist/widget.cjs +93 -35
- package/dist/widget.js +5 -5
- package/dist/workspace.cjs +93 -35
- package/dist/workspace.d.cts +1 -1
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.js +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -14047,14 +14047,49 @@ function buildColorPicker(color, theme, onChange, options = {}) {
|
|
|
14047
14047
|
const knob = document.createElement("div");
|
|
14048
14048
|
knob.style.cssText = "position:absolute;top:50%;width:15px;height:15px;border-radius:50%;background:var(--vela-selected-bg);box-shadow:0 1px 3px rgba(0,0,0,0.55);transform:translate(-50%,-50%);pointer-events:none;";
|
|
14049
14049
|
track.appendChild(knob);
|
|
14050
|
-
const pctBox = document.createElement("
|
|
14051
|
-
pctBox.
|
|
14050
|
+
const pctBox = document.createElement("input");
|
|
14051
|
+
pctBox.type = "text";
|
|
14052
|
+
pctBox.inputMode = "numeric";
|
|
14053
|
+
pctBox.title = "Opacity (%)";
|
|
14054
|
+
pctBox.style.cssText = `width:46px;box-sizing:border-box;text-align:center;font:var(--vela-font-size-md) ${theme.fontFamily};color:var(--vela-fg);background:transparent;border:1px solid var(--vela-border);border-radius:5px;padding:3px 4px;outline:none;`;
|
|
14055
|
+
pctBox.addEventListener("focus", () => {
|
|
14056
|
+
pctBox.style.borderColor = "var(--vela-border-strong)";
|
|
14057
|
+
pctBox.select();
|
|
14058
|
+
});
|
|
14052
14059
|
opRow.append(track, pctBox);
|
|
14053
14060
|
const paintOpacity = () => {
|
|
14054
14061
|
track.style.background = `linear-gradient(to right, ${curHex}00, ${curHex}ff), ${CHECKER}`;
|
|
14055
14062
|
knob.style.left = `${curAlpha * 100}%`;
|
|
14056
|
-
pctBox.
|
|
14063
|
+
pctBox.value = `${Math.round(curAlpha * 100)}%`;
|
|
14064
|
+
};
|
|
14065
|
+
const commitTyped = () => {
|
|
14066
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
14067
|
+
const n = parseFloat(pctBox.value.replace("%", ""));
|
|
14068
|
+
if (Number.isFinite(n)) {
|
|
14069
|
+
const next = Math.max(0, Math.min(100, n)) / 100;
|
|
14070
|
+
if (Math.round(next * 100) !== Math.round(curAlpha * 100)) {
|
|
14071
|
+
curAlpha = next;
|
|
14072
|
+
paintOpacity();
|
|
14073
|
+
emit();
|
|
14074
|
+
return;
|
|
14075
|
+
}
|
|
14076
|
+
}
|
|
14077
|
+
paintOpacity();
|
|
14057
14078
|
};
|
|
14079
|
+
pctBox.addEventListener("change", commitTyped);
|
|
14080
|
+
pctBox.addEventListener("blur", () => {
|
|
14081
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
14082
|
+
paintOpacity();
|
|
14083
|
+
});
|
|
14084
|
+
pctBox.addEventListener("keydown", (e) => {
|
|
14085
|
+
if (e.key === "Escape") return;
|
|
14086
|
+
e.stopPropagation();
|
|
14087
|
+
if (e.key === "Enter") {
|
|
14088
|
+
e.preventDefault();
|
|
14089
|
+
commitTyped();
|
|
14090
|
+
pctBox.blur();
|
|
14091
|
+
}
|
|
14092
|
+
});
|
|
14058
14093
|
let dragging = false;
|
|
14059
14094
|
const onDrag = (clientX) => {
|
|
14060
14095
|
const r = track.getBoundingClientRect();
|
|
@@ -18645,6 +18680,12 @@ var InputController = class {
|
|
|
18645
18680
|
this.lastTapT = 0;
|
|
18646
18681
|
this.lastTapX = 0;
|
|
18647
18682
|
this.lastTapY = 0;
|
|
18683
|
+
// Whether the last two primary presses were claimed by the drawings layer. A double-click
|
|
18684
|
+
// is the last press plus the one before it; a tool-driven click pair must never fall through
|
|
18685
|
+
// to the pane maximize toggle, even when the tool disarmed itself between the two clicks
|
|
18686
|
+
// (a finished placement leaves plain cursor mode for the second click).
|
|
18687
|
+
this.lastPressDrawing = false;
|
|
18688
|
+
this.prevPressDrawing = false;
|
|
18648
18689
|
this.onTouchContextMenu = (e) => {
|
|
18649
18690
|
if (this.touches.size === 0) return;
|
|
18650
18691
|
if (!(e.target instanceof Node) || !this.el?.contains(e.target)) return;
|
|
@@ -18699,19 +18740,24 @@ var InputController = class {
|
|
|
18699
18740
|
this.moved = false;
|
|
18700
18741
|
this.startX = x;
|
|
18701
18742
|
this.startY = y;
|
|
18743
|
+
this.prevPressDrawing = this.lastPressDrawing;
|
|
18744
|
+
this.lastPressDrawing = false;
|
|
18702
18745
|
if (this.deps.drawingsClaim?.(x, y)) {
|
|
18703
18746
|
this.region = "drawing";
|
|
18747
|
+
this.lastPressDrawing = true;
|
|
18704
18748
|
this.deps.drawingsPointerDown?.(x, y, this.snapMode(e), e.shiftKey, e.ctrlKey || e.metaKey);
|
|
18705
18749
|
this.capture(e.pointerId);
|
|
18706
18750
|
return;
|
|
18707
18751
|
}
|
|
18708
18752
|
if (e.shiftKey && this.regionAt(x, y) === "data" && this.deps.drawingsMeasureStart?.(x, y, this.snapMode(e))) {
|
|
18709
18753
|
this.region = "drawing";
|
|
18754
|
+
this.lastPressDrawing = true;
|
|
18710
18755
|
this.capture(e.pointerId);
|
|
18711
18756
|
return;
|
|
18712
18757
|
}
|
|
18713
18758
|
if ((e.ctrlKey || e.metaKey) && this.regionAt(x, y) === "data" && this.deps.drawingsMarqueeStart?.(x, y)) {
|
|
18714
18759
|
this.region = "drawing";
|
|
18760
|
+
this.lastPressDrawing = true;
|
|
18715
18761
|
this.capture(e.pointerId);
|
|
18716
18762
|
return;
|
|
18717
18763
|
}
|
|
@@ -19033,6 +19079,7 @@ var InputController = class {
|
|
|
19033
19079
|
if (region === "price") this.deps.resetPriceScale(x, y);
|
|
19034
19080
|
else if (region === "separator") this.deps.resetPaneSize(y);
|
|
19035
19081
|
else if (region === "time") this.deps.resetView();
|
|
19082
|
+
else if (this.lastPressDrawing || this.prevPressDrawing) return;
|
|
19036
19083
|
else this.deps.dataDblClick(x, y);
|
|
19037
19084
|
}
|
|
19038
19085
|
};
|
|
@@ -21198,6 +21245,7 @@ function timeTicks(fromMs, toMs, target = 8, offsetMs = 0) {
|
|
|
21198
21245
|
const step = pickStep(span / Math.max(1, target));
|
|
21199
21246
|
const zFrom = fromMs + offsetMs;
|
|
21200
21247
|
const zTo = toMs + offsetMs;
|
|
21248
|
+
if (step >= MONTH) return calendarTicks(zFrom, zTo, step >= YEAR ? 12 : step >= 3 * MONTH ? 3 : 1, offsetMs);
|
|
21201
21249
|
const first = Math.ceil(zFrom / step) * step;
|
|
21202
21250
|
const out = [];
|
|
21203
21251
|
for (let zt = first; zt <= zTo; zt += step) {
|
|
@@ -21228,6 +21276,18 @@ function timeTicks(fromMs, toMs, target = 8, offsetMs = 0) {
|
|
|
21228
21276
|
}
|
|
21229
21277
|
return out;
|
|
21230
21278
|
}
|
|
21279
|
+
function calendarTicks(zFrom, zTo, months, offsetMs) {
|
|
21280
|
+
const d0 = new Date(zFrom);
|
|
21281
|
+
let idx = d0.getUTCFullYear() * 12 + d0.getUTCMonth();
|
|
21282
|
+
if (Date.UTC(Math.floor(idx / 12), idx % 12, 1) < zFrom) idx += 1;
|
|
21283
|
+
idx = Math.ceil(idx / months) * months;
|
|
21284
|
+
const out = [];
|
|
21285
|
+
for (let zt = Date.UTC(Math.floor(idx / 12), idx % 12, 1); zt <= zTo; idx += months, zt = Date.UTC(Math.floor(idx / 12), idx % 12, 1)) {
|
|
21286
|
+
const label = months === 12 ? String(Math.floor(idx / 12)) : MONTHS[idx % 12];
|
|
21287
|
+
out.push({ time: zt - offsetMs, label, major: true });
|
|
21288
|
+
}
|
|
21289
|
+
return out;
|
|
21290
|
+
}
|
|
21231
21291
|
|
|
21232
21292
|
// src/renderers/native/chrome/countdown.ts
|
|
21233
21293
|
function countdownText(barOpen, barMs, now2) {
|
|
@@ -29773,23 +29833,21 @@ function stackLayers(entries, candleZ) {
|
|
|
29773
29833
|
return { below, above };
|
|
29774
29834
|
}
|
|
29775
29835
|
|
|
29776
|
-
// src/renderers/native/chrome/
|
|
29777
|
-
var
|
|
29778
|
-
var
|
|
29836
|
+
// src/renderers/native/chrome/vela-logos.ts
|
|
29837
|
+
var VELA_MARK_SVG = '<svg viewBox="0 -142 161.66 148" aria-hidden="true"><g fill="currentColor"><path d="M0 -140L32.91 -140L77.52 -62.73L61.06 -34.24Z"/><path d="M161.66 -140L128.75 -140L84.14 -62.73L100.59 -34.24Z"/><path d="M80.83 -52.04L95.85 -26.02L80.83 0L65.81 -26.02Z"/></g></svg>';
|
|
29838
|
+
var VELA_LETTERS_SVG = '<svg viewBox="161.66 -142 310.57 148" aria-hidden="true"><g fill="currentColor"><path d="M226.3 1.17Q200.81 1.17 186.12 -12.99Q171.42 -27.15 171.42 -51.17Q171.42 -75.2 185.87 -89.6Q200.33 -104 224.25 -104Q247.4 -104 261.7 -90.58Q276.01 -77.15 276.3 -54.59Q276.3 -49.9 275.42 -45.02H200.81V-43.55Q201.2 -32.62 207.75 -26.42Q214.29 -20.21 225.03 -20.21Q233.72 -20.21 239.34 -23.93Q244.95 -27.64 246.81 -34.77H274.64Q272.1 -19.14 259.16 -8.98Q246.22 1.17 226.3 1.17ZM201.5 -63.38H247.88Q246.42 -72.75 240.27 -77.88Q234.12 -83.01 224.45 -83.01Q215.17 -83.01 208.92 -77.73Q202.67 -72.46 201.5 -63.38ZM287.54 0V-140.04H315.76V0ZM429.34 -23.83H432.56V0H418.11Q407.76 0 403.36 -4.44Q398.97 -8.89 399.16 -16.8Q387.83 1.17 365.57 1.17Q348.48 1.17 337.88 -6.74Q327.29 -14.65 327.29 -29Q327.29 -45.41 339.45 -54.3Q351.6 -63.18 374.55 -63.18H394.96V-68.16Q394.96 -75.2 390.08 -79.3Q385.2 -83.4 376.51 -83.4Q368.3 -83.4 363.03 -79.98Q357.76 -76.56 356.88 -70.8H329.73Q331.19 -85.84 344.08 -94.92Q356.97 -104 377.29 -104Q399.06 -104 410.88 -94.43Q422.7 -84.86 422.7 -66.6V-30.18Q422.7 -26.37 424.26 -25.1Q425.82 -23.83 429.34 -23.83ZM394.96 -42.38V-44.43H374.36Q365.47 -44.43 360.59 -40.92Q355.7 -37.4 355.7 -30.96Q355.7 -25.59 359.81 -22.41Q363.91 -19.24 370.94 -19.24Q381.97 -19.24 388.37 -25.54Q394.77 -31.84 394.96 -42.38Z"/><path fill-opacity="0.55" d="M437.44 -124.28H441.96V-113.41H445.34V-124.28H449.87V-127.4H437.44ZM451.43 -113.41H454.7V-123.29L458.97 -113.41H461.62L465.99 -123.29V-113.41H469.21V-127.4H464.53L460.42 -117.68L456.16 -127.4H451.43Z"/></g></svg>';
|
|
29779
29839
|
|
|
29780
29840
|
// src/renderers/native/chrome/AttributionMark.ts
|
|
29781
|
-
var ATTRIBUTION_URL = "https://
|
|
29841
|
+
var ATTRIBUTION_URL = "https://velacharts.dev/?utm_source=vela&utm_medium=attribution";
|
|
29782
29842
|
var STYLE_ID5 = "vela-attribution-styles";
|
|
29783
29843
|
var CSS2 = `
|
|
29784
29844
|
.vela-attribution {
|
|
29785
29845
|
text-decoration: none;
|
|
29786
29846
|
display: flex;
|
|
29787
29847
|
align-items: center;
|
|
29788
|
-
/*
|
|
29789
|
-
|
|
29790
|
-
|
|
29791
|
-
reads wrong because the symbol's ink hangs low and the wordmark descends. */
|
|
29792
|
-
gap: 4px;
|
|
29848
|
+
/* No gutter: the V is the wordmark's first letter, and the letters' viewBox starts
|
|
29849
|
+
where the V's ends, so the kit's own letter spacing comes with them. */
|
|
29850
|
+
gap: 0;
|
|
29793
29851
|
}
|
|
29794
29852
|
.vela-attribution .vela-attr-symbol {
|
|
29795
29853
|
flex: none;
|
|
@@ -29797,7 +29855,7 @@ var CSS2 = `
|
|
|
29797
29855
|
line-height: 0;
|
|
29798
29856
|
}
|
|
29799
29857
|
.vela-attribution .vela-attr-symbol svg {
|
|
29800
|
-
height:
|
|
29858
|
+
height: 24px;
|
|
29801
29859
|
width: auto;
|
|
29802
29860
|
display: block;
|
|
29803
29861
|
filter: drop-shadow(0 1px 2px var(--vela-attr-shadow, rgba(0,0,0,0.45)));
|
|
@@ -29808,15 +29866,13 @@ var CSS2 = `
|
|
|
29808
29866
|
opacity: 0;
|
|
29809
29867
|
display: flex;
|
|
29810
29868
|
align-items: center;
|
|
29811
|
-
/*
|
|
29812
|
-
position: relative;
|
|
29813
|
-
top: 3px;
|
|
29869
|
+
/* Same height and baseline as the V (one viewBox height), so no vertical offset. */
|
|
29814
29870
|
transform: translateX(-8px);
|
|
29815
29871
|
transition: max-width 0.3s ease, opacity 0.25s ease, transform 0.3s ease;
|
|
29816
29872
|
flex: none;
|
|
29817
29873
|
}
|
|
29818
29874
|
.vela-attribution .vela-attr-wordmark svg {
|
|
29819
|
-
height:
|
|
29875
|
+
height: 24px;
|
|
29820
29876
|
width: auto;
|
|
29821
29877
|
display: block;
|
|
29822
29878
|
filter: drop-shadow(0 1px 2px var(--vela-attr-shadow, rgba(0,0,0,0.45)));
|
|
@@ -29831,14 +29887,11 @@ var CSS2 = `
|
|
|
29831
29887
|
(data-layout): the workspace's single grid-wide mark lives OUTSIDE any renderer
|
|
29832
29888
|
container, so only the shell attribute reaches it. */
|
|
29833
29889
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-symbol svg,
|
|
29834
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-symbol svg { height:
|
|
29890
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-symbol svg { height: 20px; }
|
|
29835
29891
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-wordmark,
|
|
29836
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark {
|
|
29837
|
-
top: 2px;
|
|
29838
|
-
transform: translateX(-6px);
|
|
29839
|
-
}
|
|
29892
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark { transform: translateX(-6px); }
|
|
29840
29893
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-wordmark svg,
|
|
29841
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark svg { height:
|
|
29894
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark svg { height: 20px; }
|
|
29842
29895
|
[data-vela-layout='mobile'] .vela-attribution:hover .vela-attr-wordmark,
|
|
29843
29896
|
[data-layout='mobile'] .vela-attribution:hover .vela-attr-wordmark { transform: translateX(0); }
|
|
29844
29897
|
`;
|
|
@@ -29895,10 +29948,10 @@ function createAttributionMark(doc, background) {
|
|
|
29895
29948
|
const symbol = doc.createElement("span");
|
|
29896
29949
|
symbol.className = "vela-attr-symbol";
|
|
29897
29950
|
symbol.setAttribute("aria-hidden", "true");
|
|
29898
|
-
symbol.innerHTML =
|
|
29951
|
+
symbol.innerHTML = VELA_MARK_SVG;
|
|
29899
29952
|
const wordmark = doc.createElement("span");
|
|
29900
29953
|
wordmark.className = "vela-attr-wordmark";
|
|
29901
|
-
wordmark.innerHTML =
|
|
29954
|
+
wordmark.innerHTML = VELA_LETTERS_SVG;
|
|
29902
29955
|
a.append(symbol, wordmark);
|
|
29903
29956
|
return a;
|
|
29904
29957
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './chunk-JU4CWEBF.js';
|
|
2
|
-
export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, ReplayControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-
|
|
2
|
+
export { BarStore, CachingDataFeed, DARK_THEME, DataControl, DrawingStore, DrawingToolbar, DrawingsControl, LIGHT_THEME, MarksControl, MultiProviderFeed, NativeRenderer, RendererControl, ReplayControl, SecondClock, TypedEventBus, Vela, buildToolbar, defaultToolbar, resolveTheme, sharedBarStore, timeframeToMs } from './chunk-ATGTCWHJ.js';
|
|
3
3
|
export { DEFAULT_PANEL_MAX_WIDTH, DEFAULT_PANEL_MIN_WIDTH, DEFAULT_PANEL_WIDTH, Drawing, OVERRIDABLE_TOPBAR_IDS, chartType, chartTypes, clampPanelWidth, createDrawing, deserializeDrawing, drawingTypes, getDrawingType, getNativeIndicator, inputDeltas, inputVisible, legendActions, legendCallouts, nativeIndicatorDescriptors, nativeIndicatorTypes, normalizeSettingsRow, registerChartType, registerDefaultEngine, registerDrawingType, registerLegendAction, registerLegendCallout, registerNativeIndicator, registerRendererDefaults, registerRendererLayer, registerSidePanel, registerStatePersistence, registerSymbolRanking, registerWidgetAction, registerWidgetAttachment, rendererDefaults, rendererLayers, resolveEngines, seriesInScale, seriesShownOn, settingsRowValueKeys, sidePanels, stableSeriesId, statePersistenceHandlers, symbolRanking, tickerModifierIds, topbarActionOverride, unregisterChartType, unregisterDefaultEngine, unregisterLegendAction, unregisterLegendCallout, unregisterNativeIndicator, unregisterRendererDefaults, unregisterRendererLayer, unregisterSidePanel, unregisterStatePersistence, unregisterWidgetAction, unregisterWidgetAttachment, widgetActions, widgetAttachments } from './chunk-EZ5FWVLA.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-NELQJCGK.js';
|
|
5
5
|
export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CHIP_PLATE, CROSSHAIR, HIGHLIGHT, INFO, INVALID, MARKER, NEUTRAL, SERIES_LINE, SESSION_OFF, SESSION_POST, SESSION_PRE, SLATE, SLATE_DEEP, TRADE_EXIT, TRADE_LONG, TRADE_SHORT, VALID, WARNING, categoricalColor, iconMarkup, registerIcon } from './chunk-BZQM2XO7.js';
|
|
6
6
|
|
|
7
7
|
// src/core/replayTicks.ts
|
package/dist/ui.cjs
CHANGED
|
@@ -2718,14 +2718,49 @@ function buildColorPicker(color, theme, onChange, options = {}) {
|
|
|
2718
2718
|
const knob = document.createElement("div");
|
|
2719
2719
|
knob.style.cssText = "position:absolute;top:50%;width:15px;height:15px;border-radius:50%;background:var(--vela-selected-bg);box-shadow:0 1px 3px rgba(0,0,0,0.55);transform:translate(-50%,-50%);pointer-events:none;";
|
|
2720
2720
|
track.appendChild(knob);
|
|
2721
|
-
const pctBox = document.createElement("
|
|
2722
|
-
pctBox.
|
|
2721
|
+
const pctBox = document.createElement("input");
|
|
2722
|
+
pctBox.type = "text";
|
|
2723
|
+
pctBox.inputMode = "numeric";
|
|
2724
|
+
pctBox.title = "Opacity (%)";
|
|
2725
|
+
pctBox.style.cssText = `width:46px;box-sizing:border-box;text-align:center;font:var(--vela-font-size-md) ${theme.fontFamily};color:var(--vela-fg);background:transparent;border:1px solid var(--vela-border);border-radius:5px;padding:3px 4px;outline:none;`;
|
|
2726
|
+
pctBox.addEventListener("focus", () => {
|
|
2727
|
+
pctBox.style.borderColor = "var(--vela-border-strong)";
|
|
2728
|
+
pctBox.select();
|
|
2729
|
+
});
|
|
2723
2730
|
opRow.append(track, pctBox);
|
|
2724
2731
|
const paintOpacity = () => {
|
|
2725
2732
|
track.style.background = `linear-gradient(to right, ${curHex}00, ${curHex}ff), ${CHECKER}`;
|
|
2726
2733
|
knob.style.left = `${curAlpha * 100}%`;
|
|
2727
|
-
pctBox.
|
|
2734
|
+
pctBox.value = `${Math.round(curAlpha * 100)}%`;
|
|
2735
|
+
};
|
|
2736
|
+
const commitTyped = () => {
|
|
2737
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
2738
|
+
const n = parseFloat(pctBox.value.replace("%", ""));
|
|
2739
|
+
if (Number.isFinite(n)) {
|
|
2740
|
+
const next = Math.max(0, Math.min(100, n)) / 100;
|
|
2741
|
+
if (Math.round(next * 100) !== Math.round(curAlpha * 100)) {
|
|
2742
|
+
curAlpha = next;
|
|
2743
|
+
paintOpacity();
|
|
2744
|
+
emit();
|
|
2745
|
+
return;
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
paintOpacity();
|
|
2728
2749
|
};
|
|
2750
|
+
pctBox.addEventListener("change", commitTyped);
|
|
2751
|
+
pctBox.addEventListener("blur", () => {
|
|
2752
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
2753
|
+
paintOpacity();
|
|
2754
|
+
});
|
|
2755
|
+
pctBox.addEventListener("keydown", (e) => {
|
|
2756
|
+
if (e.key === "Escape") return;
|
|
2757
|
+
e.stopPropagation();
|
|
2758
|
+
if (e.key === "Enter") {
|
|
2759
|
+
e.preventDefault();
|
|
2760
|
+
commitTyped();
|
|
2761
|
+
pctBox.blur();
|
|
2762
|
+
}
|
|
2763
|
+
});
|
|
2729
2764
|
let dragging = false;
|
|
2730
2765
|
const onDrag = (clientX) => {
|
|
2731
2766
|
const r = track.getBoundingClientRect();
|
package/dist/ui.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Drawer, KeymapManager, Tooltip, drawerController, tooltipController } from './chunk-
|
|
2
|
-
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, DatePicker, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, datePickerController, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, normalizeProps, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, spreadProps, switchController, textAreaController, textFieldController, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions } from './chunk-
|
|
1
|
+
export { Drawer, KeymapManager, Tooltip, drawerController, tooltipController } from './chunk-LMBYEGUR.js';
|
|
2
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, DatePicker, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, datePickerController, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, normalizeProps, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, spreadProps, switchController, textAreaController, textFieldController, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions } from './chunk-NELQJCGK.js';
|
|
3
3
|
export { FIELD_FOCUS_CSS, FIELD_FOCUS_RING, iconEl, iconMarkup, injectStyles, overlayScrollbarCss, registerIcon, svg16, svg24, withAlpha } from './chunk-BZQM2XO7.js';
|
package/dist/vela.global.js
CHANGED
|
@@ -21463,14 +21463,49 @@ ${overlayScrollbarCss(".vela-dialog *")}
|
|
|
21463
21463
|
const knob = document.createElement("div");
|
|
21464
21464
|
knob.style.cssText = "position:absolute;top:50%;width:15px;height:15px;border-radius:50%;background:var(--vela-selected-bg);box-shadow:0 1px 3px rgba(0,0,0,0.55);transform:translate(-50%,-50%);pointer-events:none;";
|
|
21465
21465
|
track.appendChild(knob);
|
|
21466
|
-
const pctBox = document.createElement("
|
|
21467
|
-
pctBox.
|
|
21466
|
+
const pctBox = document.createElement("input");
|
|
21467
|
+
pctBox.type = "text";
|
|
21468
|
+
pctBox.inputMode = "numeric";
|
|
21469
|
+
pctBox.title = "Opacity (%)";
|
|
21470
|
+
pctBox.style.cssText = `width:46px;box-sizing:border-box;text-align:center;font:var(--vela-font-size-md) ${theme.fontFamily};color:var(--vela-fg);background:transparent;border:1px solid var(--vela-border);border-radius:5px;padding:3px 4px;outline:none;`;
|
|
21471
|
+
pctBox.addEventListener("focus", () => {
|
|
21472
|
+
pctBox.style.borderColor = "var(--vela-border-strong)";
|
|
21473
|
+
pctBox.select();
|
|
21474
|
+
});
|
|
21468
21475
|
opRow.append(track, pctBox);
|
|
21469
21476
|
const paintOpacity = () => {
|
|
21470
21477
|
track.style.background = `linear-gradient(to right, ${curHex}00, ${curHex}ff), ${CHECKER}`;
|
|
21471
21478
|
knob.style.left = `${curAlpha * 100}%`;
|
|
21472
|
-
pctBox.
|
|
21479
|
+
pctBox.value = `${Math.round(curAlpha * 100)}%`;
|
|
21473
21480
|
};
|
|
21481
|
+
const commitTyped = () => {
|
|
21482
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
21483
|
+
const n = parseFloat(pctBox.value.replace("%", ""));
|
|
21484
|
+
if (Number.isFinite(n)) {
|
|
21485
|
+
const next2 = Math.max(0, Math.min(100, n)) / 100;
|
|
21486
|
+
if (Math.round(next2 * 100) !== Math.round(curAlpha * 100)) {
|
|
21487
|
+
curAlpha = next2;
|
|
21488
|
+
paintOpacity();
|
|
21489
|
+
emit();
|
|
21490
|
+
return;
|
|
21491
|
+
}
|
|
21492
|
+
}
|
|
21493
|
+
paintOpacity();
|
|
21494
|
+
};
|
|
21495
|
+
pctBox.addEventListener("change", commitTyped);
|
|
21496
|
+
pctBox.addEventListener("blur", () => {
|
|
21497
|
+
pctBox.style.borderColor = "var(--vela-border)";
|
|
21498
|
+
paintOpacity();
|
|
21499
|
+
});
|
|
21500
|
+
pctBox.addEventListener("keydown", (e) => {
|
|
21501
|
+
if (e.key === "Escape") return;
|
|
21502
|
+
e.stopPropagation();
|
|
21503
|
+
if (e.key === "Enter") {
|
|
21504
|
+
e.preventDefault();
|
|
21505
|
+
commitTyped();
|
|
21506
|
+
pctBox.blur();
|
|
21507
|
+
}
|
|
21508
|
+
});
|
|
21474
21509
|
let dragging = false;
|
|
21475
21510
|
const onDrag = (clientX) => {
|
|
21476
21511
|
const r = track.getBoundingClientRect();
|
|
@@ -26061,6 +26096,12 @@ void main() {
|
|
|
26061
26096
|
this.lastTapT = 0;
|
|
26062
26097
|
this.lastTapX = 0;
|
|
26063
26098
|
this.lastTapY = 0;
|
|
26099
|
+
// Whether the last two primary presses were claimed by the drawings layer. A double-click
|
|
26100
|
+
// is the last press plus the one before it; a tool-driven click pair must never fall through
|
|
26101
|
+
// to the pane maximize toggle, even when the tool disarmed itself between the two clicks
|
|
26102
|
+
// (a finished placement leaves plain cursor mode for the second click).
|
|
26103
|
+
this.lastPressDrawing = false;
|
|
26104
|
+
this.prevPressDrawing = false;
|
|
26064
26105
|
this.onTouchContextMenu = (e) => {
|
|
26065
26106
|
if (this.touches.size === 0) return;
|
|
26066
26107
|
if (!(e.target instanceof Node) || !this.el?.contains(e.target)) return;
|
|
@@ -26115,19 +26156,24 @@ void main() {
|
|
|
26115
26156
|
this.moved = false;
|
|
26116
26157
|
this.startX = x;
|
|
26117
26158
|
this.startY = y;
|
|
26159
|
+
this.prevPressDrawing = this.lastPressDrawing;
|
|
26160
|
+
this.lastPressDrawing = false;
|
|
26118
26161
|
if (this.deps.drawingsClaim?.(x, y)) {
|
|
26119
26162
|
this.region = "drawing";
|
|
26163
|
+
this.lastPressDrawing = true;
|
|
26120
26164
|
this.deps.drawingsPointerDown?.(x, y, this.snapMode(e), e.shiftKey, e.ctrlKey || e.metaKey);
|
|
26121
26165
|
this.capture(e.pointerId);
|
|
26122
26166
|
return;
|
|
26123
26167
|
}
|
|
26124
26168
|
if (e.shiftKey && this.regionAt(x, y) === "data" && this.deps.drawingsMeasureStart?.(x, y, this.snapMode(e))) {
|
|
26125
26169
|
this.region = "drawing";
|
|
26170
|
+
this.lastPressDrawing = true;
|
|
26126
26171
|
this.capture(e.pointerId);
|
|
26127
26172
|
return;
|
|
26128
26173
|
}
|
|
26129
26174
|
if ((e.ctrlKey || e.metaKey) && this.regionAt(x, y) === "data" && this.deps.drawingsMarqueeStart?.(x, y)) {
|
|
26130
26175
|
this.region = "drawing";
|
|
26176
|
+
this.lastPressDrawing = true;
|
|
26131
26177
|
this.capture(e.pointerId);
|
|
26132
26178
|
return;
|
|
26133
26179
|
}
|
|
@@ -26449,6 +26495,7 @@ void main() {
|
|
|
26449
26495
|
if (region === "price") this.deps.resetPriceScale(x, y);
|
|
26450
26496
|
else if (region === "separator") this.deps.resetPaneSize(y);
|
|
26451
26497
|
else if (region === "time") this.deps.resetView();
|
|
26498
|
+
else if (this.lastPressDrawing || this.prevPressDrawing) return;
|
|
26452
26499
|
else this.deps.dataDblClick(x, y);
|
|
26453
26500
|
}
|
|
26454
26501
|
};
|
|
@@ -28614,6 +28661,7 @@ void main() {
|
|
|
28614
28661
|
const step = pickStep(span / Math.max(1, target));
|
|
28615
28662
|
const zFrom = fromMs + offsetMs;
|
|
28616
28663
|
const zTo = toMs + offsetMs;
|
|
28664
|
+
if (step >= MONTH) return calendarTicks(zFrom, zTo, step >= YEAR ? 12 : step >= 3 * MONTH ? 3 : 1, offsetMs);
|
|
28617
28665
|
const first2 = Math.ceil(zFrom / step) * step;
|
|
28618
28666
|
const out = [];
|
|
28619
28667
|
for (let zt = first2; zt <= zTo; zt += step) {
|
|
@@ -28644,6 +28692,18 @@ void main() {
|
|
|
28644
28692
|
}
|
|
28645
28693
|
return out;
|
|
28646
28694
|
}
|
|
28695
|
+
function calendarTicks(zFrom, zTo, months, offsetMs) {
|
|
28696
|
+
const d0 = new Date(zFrom);
|
|
28697
|
+
let idx = d0.getUTCFullYear() * 12 + d0.getUTCMonth();
|
|
28698
|
+
if (Date.UTC(Math.floor(idx / 12), idx % 12, 1) < zFrom) idx += 1;
|
|
28699
|
+
idx = Math.ceil(idx / months) * months;
|
|
28700
|
+
const out = [];
|
|
28701
|
+
for (let zt = Date.UTC(Math.floor(idx / 12), idx % 12, 1); zt <= zTo; idx += months, zt = Date.UTC(Math.floor(idx / 12), idx % 12, 1)) {
|
|
28702
|
+
const label = months === 12 ? String(Math.floor(idx / 12)) : MONTHS[idx % 12];
|
|
28703
|
+
out.push({ time: zt - offsetMs, label, major: true });
|
|
28704
|
+
}
|
|
28705
|
+
return out;
|
|
28706
|
+
}
|
|
28647
28707
|
|
|
28648
28708
|
// src/renderers/native/chrome/countdown.ts
|
|
28649
28709
|
function countdownText(barOpen, barMs, now2) {
|
|
@@ -37189,23 +37249,21 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
37189
37249
|
return { below, above };
|
|
37190
37250
|
}
|
|
37191
37251
|
|
|
37192
|
-
// src/renderers/native/chrome/
|
|
37193
|
-
var
|
|
37194
|
-
var
|
|
37252
|
+
// src/renderers/native/chrome/vela-logos.ts
|
|
37253
|
+
var VELA_MARK_SVG = '<svg viewBox="0 -142 161.66 148" aria-hidden="true"><g fill="currentColor"><path d="M0 -140L32.91 -140L77.52 -62.73L61.06 -34.24Z"/><path d="M161.66 -140L128.75 -140L84.14 -62.73L100.59 -34.24Z"/><path d="M80.83 -52.04L95.85 -26.02L80.83 0L65.81 -26.02Z"/></g></svg>';
|
|
37254
|
+
var VELA_LETTERS_SVG = '<svg viewBox="161.66 -142 310.57 148" aria-hidden="true"><g fill="currentColor"><path d="M226.3 1.17Q200.81 1.17 186.12 -12.99Q171.42 -27.15 171.42 -51.17Q171.42 -75.2 185.87 -89.6Q200.33 -104 224.25 -104Q247.4 -104 261.7 -90.58Q276.01 -77.15 276.3 -54.59Q276.3 -49.9 275.42 -45.02H200.81V-43.55Q201.2 -32.62 207.75 -26.42Q214.29 -20.21 225.03 -20.21Q233.72 -20.21 239.34 -23.93Q244.95 -27.64 246.81 -34.77H274.64Q272.1 -19.14 259.16 -8.98Q246.22 1.17 226.3 1.17ZM201.5 -63.38H247.88Q246.42 -72.75 240.27 -77.88Q234.12 -83.01 224.45 -83.01Q215.17 -83.01 208.92 -77.73Q202.67 -72.46 201.5 -63.38ZM287.54 0V-140.04H315.76V0ZM429.34 -23.83H432.56V0H418.11Q407.76 0 403.36 -4.44Q398.97 -8.89 399.16 -16.8Q387.83 1.17 365.57 1.17Q348.48 1.17 337.88 -6.74Q327.29 -14.65 327.29 -29Q327.29 -45.41 339.45 -54.3Q351.6 -63.18 374.55 -63.18H394.96V-68.16Q394.96 -75.2 390.08 -79.3Q385.2 -83.4 376.51 -83.4Q368.3 -83.4 363.03 -79.98Q357.76 -76.56 356.88 -70.8H329.73Q331.19 -85.84 344.08 -94.92Q356.97 -104 377.29 -104Q399.06 -104 410.88 -94.43Q422.7 -84.86 422.7 -66.6V-30.18Q422.7 -26.37 424.26 -25.1Q425.82 -23.83 429.34 -23.83ZM394.96 -42.38V-44.43H374.36Q365.47 -44.43 360.59 -40.92Q355.7 -37.4 355.7 -30.96Q355.7 -25.59 359.81 -22.41Q363.91 -19.24 370.94 -19.24Q381.97 -19.24 388.37 -25.54Q394.77 -31.84 394.96 -42.38Z"/><path fill-opacity="0.55" d="M437.44 -124.28H441.96V-113.41H445.34V-124.28H449.87V-127.4H437.44ZM451.43 -113.41H454.7V-123.29L458.97 -113.41H461.62L465.99 -123.29V-113.41H469.21V-127.4H464.53L460.42 -117.68L456.16 -127.4H451.43Z"/></g></svg>';
|
|
37195
37255
|
|
|
37196
37256
|
// src/renderers/native/chrome/AttributionMark.ts
|
|
37197
|
-
var ATTRIBUTION_URL = "https://
|
|
37257
|
+
var ATTRIBUTION_URL = "https://velacharts.dev/?utm_source=vela&utm_medium=attribution";
|
|
37198
37258
|
var STYLE_ID5 = "vela-attribution-styles";
|
|
37199
37259
|
var CSS2 = `
|
|
37200
37260
|
.vela-attribution {
|
|
37201
37261
|
text-decoration: none;
|
|
37202
37262
|
display: flex;
|
|
37203
37263
|
align-items: center;
|
|
37204
|
-
/*
|
|
37205
|
-
|
|
37206
|
-
|
|
37207
|
-
reads wrong because the symbol's ink hangs low and the wordmark descends. */
|
|
37208
|
-
gap: 4px;
|
|
37264
|
+
/* No gutter: the V is the wordmark's first letter, and the letters' viewBox starts
|
|
37265
|
+
where the V's ends, so the kit's own letter spacing comes with them. */
|
|
37266
|
+
gap: 0;
|
|
37209
37267
|
}
|
|
37210
37268
|
.vela-attribution .vela-attr-symbol {
|
|
37211
37269
|
flex: none;
|
|
@@ -37213,7 +37271,7 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
37213
37271
|
line-height: 0;
|
|
37214
37272
|
}
|
|
37215
37273
|
.vela-attribution .vela-attr-symbol svg {
|
|
37216
|
-
height:
|
|
37274
|
+
height: 24px;
|
|
37217
37275
|
width: auto;
|
|
37218
37276
|
display: block;
|
|
37219
37277
|
filter: drop-shadow(0 1px 2px var(--vela-attr-shadow, rgba(0,0,0,0.45)));
|
|
@@ -37224,15 +37282,13 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
37224
37282
|
opacity: 0;
|
|
37225
37283
|
display: flex;
|
|
37226
37284
|
align-items: center;
|
|
37227
|
-
/*
|
|
37228
|
-
position: relative;
|
|
37229
|
-
top: 3px;
|
|
37285
|
+
/* Same height and baseline as the V (one viewBox height), so no vertical offset. */
|
|
37230
37286
|
transform: translateX(-8px);
|
|
37231
37287
|
transition: max-width 0.3s ease, opacity 0.25s ease, transform 0.3s ease;
|
|
37232
37288
|
flex: none;
|
|
37233
37289
|
}
|
|
37234
37290
|
.vela-attribution .vela-attr-wordmark svg {
|
|
37235
|
-
height:
|
|
37291
|
+
height: 24px;
|
|
37236
37292
|
width: auto;
|
|
37237
37293
|
display: block;
|
|
37238
37294
|
filter: drop-shadow(0 1px 2px var(--vela-attr-shadow, rgba(0,0,0,0.45)));
|
|
@@ -37247,14 +37303,11 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
37247
37303
|
(data-layout): the workspace's single grid-wide mark lives OUTSIDE any renderer
|
|
37248
37304
|
container, so only the shell attribute reaches it. */
|
|
37249
37305
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-symbol svg,
|
|
37250
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-symbol svg { height:
|
|
37306
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-symbol svg { height: 20px; }
|
|
37251
37307
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-wordmark,
|
|
37252
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark {
|
|
37253
|
-
top: 2px;
|
|
37254
|
-
transform: translateX(-6px);
|
|
37255
|
-
}
|
|
37308
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark { transform: translateX(-6px); }
|
|
37256
37309
|
[data-vela-layout='mobile'] .vela-attribution .vela-attr-wordmark svg,
|
|
37257
|
-
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark svg { height:
|
|
37310
|
+
[data-layout='mobile'] .vela-attribution .vela-attr-wordmark svg { height: 20px; }
|
|
37258
37311
|
[data-vela-layout='mobile'] .vela-attribution:hover .vela-attr-wordmark,
|
|
37259
37312
|
[data-layout='mobile'] .vela-attribution:hover .vela-attr-wordmark { transform: translateX(0); }
|
|
37260
37313
|
`;
|
|
@@ -37311,10 +37364,10 @@ ${overlayScrollbarCss(".vela-sd-pane")}
|
|
|
37311
37364
|
const symbol = doc.createElement("span");
|
|
37312
37365
|
symbol.className = "vela-attr-symbol";
|
|
37313
37366
|
symbol.setAttribute("aria-hidden", "true");
|
|
37314
|
-
symbol.innerHTML =
|
|
37367
|
+
symbol.innerHTML = VELA_MARK_SVG;
|
|
37315
37368
|
const wordmark = doc.createElement("span");
|
|
37316
37369
|
wordmark.className = "vela-attr-wordmark";
|
|
37317
|
-
wordmark.innerHTML =
|
|
37370
|
+
wordmark.innerHTML = VELA_LETTERS_SVG;
|
|
37318
37371
|
a.append(symbol, wordmark);
|
|
37319
37372
|
return a;
|
|
37320
37373
|
}
|