relly-ui 1.0.0 → 1.0.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/dist/relly-ui.es.js +36 -34
- package/dist/relly-ui.es.js.map +1 -1
- package/dist/relly-ui.iife.js +5 -5
- package/dist/relly-ui.iife.js.map +1 -1
- package/dist/relly-ui.umd.js +5 -5
- package/dist/relly-ui.umd.js.map +1 -1
- package/package.json +2 -1
package/dist/relly-ui.es.js
CHANGED
|
@@ -475,8 +475,8 @@ class N extends C {
|
|
|
475
475
|
const e = this.ctx, t = this.cssWidth, n = this.cssHeight;
|
|
476
476
|
e.clearRect(0, 0, t, n), e.save(), e.setLineDash([2, 4]), e.strokeStyle = "rgba(255, 255, 255, 0.08)", e.lineWidth = 1;
|
|
477
477
|
for (let d of [0.25, 0.5, 0.75]) {
|
|
478
|
-
const
|
|
479
|
-
e.beginPath(), e.moveTo(0,
|
|
478
|
+
const f = Math.round(n * d);
|
|
479
|
+
e.beginPath(), e.moveTo(0, f), e.lineTo(t, f), e.stroke();
|
|
480
480
|
}
|
|
481
481
|
e.restore();
|
|
482
482
|
let s = [];
|
|
@@ -491,29 +491,29 @@ class N extends C {
|
|
|
491
491
|
const u = h - o || 1, p = t / Math.max(1, this.bufferSize - 1);
|
|
492
492
|
for (const d of this.seriesList) {
|
|
493
493
|
if (d.buffer.length === 0) continue;
|
|
494
|
-
const
|
|
495
|
-
for (let
|
|
496
|
-
const x = (b +
|
|
494
|
+
const f = d.buffer.length === 1 ? [d.buffer[0], d.buffer[0]] : d.buffer, b = this.bufferSize - f.length, m = [];
|
|
495
|
+
for (let g = 0; g < f.length; g++) {
|
|
496
|
+
const x = (b + g) * p, w = Math.max(0, Math.min(1, (f[g] - o) / u)), M = Math.max(4, Math.min(n - 4, n - 6 - w * (n - 12)));
|
|
497
497
|
m.push({ x, y: M });
|
|
498
498
|
}
|
|
499
499
|
if (e.beginPath(), e.moveTo(m[0].x, n), e.lineTo(m[0].x, m[0].y), this.smoothCurves && m.length > 2)
|
|
500
|
-
for (let
|
|
501
|
-
const x = m[
|
|
500
|
+
for (let g = 0; g < m.length - 1; g++) {
|
|
501
|
+
const x = m[g], w = m[g + 1], M = (x.x + w.x) / 2;
|
|
502
502
|
e.bezierCurveTo(M, x.y, M, w.y, w.x, w.y);
|
|
503
503
|
}
|
|
504
504
|
else
|
|
505
|
-
for (let
|
|
506
|
-
e.lineTo(m[
|
|
505
|
+
for (let g = 1; g < m.length; g++)
|
|
506
|
+
e.lineTo(m[g].x, m[g].y);
|
|
507
507
|
e.lineTo(m[m.length - 1].x, n), e.closePath();
|
|
508
508
|
const v = e.createLinearGradient(0, 0, 0, n);
|
|
509
509
|
if (v.addColorStop(0, d.fillColor || `${d.color}40`), v.addColorStop(1, "rgba(0, 0, 0, 0)"), e.fillStyle = v, e.fill(), e.beginPath(), e.moveTo(m[0].x, m[0].y), this.smoothCurves && m.length > 2)
|
|
510
|
-
for (let
|
|
511
|
-
const x = m[
|
|
510
|
+
for (let g = 0; g < m.length - 1; g++) {
|
|
511
|
+
const x = m[g], w = m[g + 1], M = (x.x + w.x) / 2;
|
|
512
512
|
e.bezierCurveTo(M, x.y, M, w.y, w.x, w.y);
|
|
513
513
|
}
|
|
514
514
|
else
|
|
515
|
-
for (let
|
|
516
|
-
e.lineTo(m[
|
|
515
|
+
for (let g = 1; g < m.length; g++)
|
|
516
|
+
e.lineTo(m[g].x, m[g].y);
|
|
517
517
|
e.save(), e.strokeStyle = d.color, e.lineWidth = 2, e.shadowColor = d.color, e.shadowBlur = 5, e.stroke(), e.restore();
|
|
518
518
|
const E = m[m.length - 1];
|
|
519
519
|
E && (e.beginPath(), e.arc(E.x, E.y, 4, 0, Math.PI * 2), e.fillStyle = d.color, e.globalAlpha = 0.35, e.fill(), e.globalAlpha = 1, e.beginPath(), e.arc(E.x, E.y, 2, 0, Math.PI * 2), e.fillStyle = "#ffffff", e.fill());
|
|
@@ -521,11 +521,11 @@ class N extends C {
|
|
|
521
521
|
if (this.hoverIndex !== null) {
|
|
522
522
|
const d = Math.round(this.hoverIndex * p);
|
|
523
523
|
e.save(), e.setLineDash([3, 3]), e.strokeStyle = "rgba(255, 255, 255, 0.45)", e.lineWidth = 1, e.beginPath(), e.moveTo(d, 0), e.lineTo(d, n), e.stroke(), e.restore();
|
|
524
|
-
for (const
|
|
525
|
-
const b = this.bufferSize -
|
|
526
|
-
if (m >= 0 && m <
|
|
527
|
-
const v =
|
|
528
|
-
e.beginPath(), e.arc(d,
|
|
524
|
+
for (const f of this.seriesList) {
|
|
525
|
+
const b = this.bufferSize - f.buffer.length, m = this.hoverIndex - b;
|
|
526
|
+
if (m >= 0 && m < f.buffer.length) {
|
|
527
|
+
const v = f.buffer[m], E = Math.max(0, Math.min(1, (v - o) / u)), g = Math.max(4, Math.min(n - 4, n - 6 - E * (n - 12)));
|
|
528
|
+
e.beginPath(), e.arc(d, g, 4.5, 0, Math.PI * 2), e.fillStyle = f.color, e.fill(), e.beginPath(), e.arc(d, g, 2, 0, Math.PI * 2), e.fillStyle = "#ffffff", e.fill();
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
}
|
|
@@ -617,8 +617,8 @@ class P extends C {
|
|
|
617
617
|
const u = h.shiftKey ? 10 : h.altKey ? 0.1 : 1, p = this.step * u;
|
|
618
618
|
let d = r + c * p;
|
|
619
619
|
this.min !== void 0 && (d = Math.max(this.min, d)), this.max !== void 0 && (d = Math.min(this.max, d));
|
|
620
|
-
const
|
|
621
|
-
d = parseFloat(d.toFixed(Math.max(
|
|
620
|
+
const f = (this.step.toString().split(".")[1] || "").length;
|
|
621
|
+
d = parseFloat(d.toFixed(Math.max(f, 2)));
|
|
622
622
|
const b = this.getValue();
|
|
623
623
|
if (Array.isArray(b)) {
|
|
624
624
|
const m = [b[0], b[1]];
|
|
@@ -695,8 +695,8 @@ class D extends C {
|
|
|
695
695
|
const u = h.shiftKey ? 10 : h.altKey ? 0.1 : 1, p = this.step * u;
|
|
696
696
|
let d = r + c * p;
|
|
697
697
|
this.min !== void 0 && (d = Math.max(this.min, d)), this.max !== void 0 && (d = Math.min(this.max, d));
|
|
698
|
-
const
|
|
699
|
-
d = parseFloat(d.toFixed(Math.max(
|
|
698
|
+
const f = (this.step.toString().split(".")[1] || "").length;
|
|
699
|
+
d = parseFloat(d.toFixed(Math.max(f, 2)));
|
|
700
700
|
const b = this.getValue();
|
|
701
701
|
if (Array.isArray(b)) {
|
|
702
702
|
const m = [
|
|
@@ -770,12 +770,12 @@ class H extends C {
|
|
|
770
770
|
setupThumbDrag(e, t) {
|
|
771
771
|
let n = !1;
|
|
772
772
|
const s = (l) => {
|
|
773
|
-
var
|
|
773
|
+
var f, b;
|
|
774
774
|
if (!n) return;
|
|
775
775
|
const o = this.trackEl.getBoundingClientRect(), h = Math.max(0, Math.min(1, (l.clientX - o.left) / o.width)), c = this.min + h * (this.max - this.min), u = this.applyStep(c), [p, d] = this.getCurrentRange();
|
|
776
776
|
if (t === "min") {
|
|
777
777
|
const m = Math.min(u, d);
|
|
778
|
-
m !== p && ((
|
|
778
|
+
m !== p && ((f = this.soundEngine) == null || f.playTick(), this.setRangeValue(m, d));
|
|
779
779
|
} else {
|
|
780
780
|
const m = Math.max(u, p);
|
|
781
781
|
m !== d && ((b = this.soundEngine) == null || b.playTick(), this.setRangeValue(p, m));
|
|
@@ -795,8 +795,8 @@ class H extends C {
|
|
|
795
795
|
const h = this.trackEl.getBoundingClientRect(), u = (o.clientX - t) / h.width * (this.max - this.min), p = s - n;
|
|
796
796
|
let d = Math.max(this.min, Math.min(this.max - p, n + u));
|
|
797
797
|
d = this.applyStep(d);
|
|
798
|
-
const
|
|
799
|
-
(d !== b ||
|
|
798
|
+
const f = this.applyStep(d + p), [b, m] = this.getCurrentRange();
|
|
799
|
+
(d !== b || f !== m) && ((v = this.soundEngine) == null || v.playTick(), this.setRangeValue(d, f));
|
|
800
800
|
}, l = () => {
|
|
801
801
|
e && (e = !1, window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", l));
|
|
802
802
|
};
|
|
@@ -2123,8 +2123,10 @@ class he {
|
|
|
2123
2123
|
c.type = "button", c.className = "relly-context-item", h.danger && c.classList.add("relly-context-item--danger"), h.disabled && (c.disabled = !0);
|
|
2124
2124
|
let u = "";
|
|
2125
2125
|
h.icon && (u = `<span class="relly-context-icon">${h.icon}</span>`), c.innerHTML = `${u}<span class="relly-context-label">${h.label}</span>`, c.addEventListener("click", (p) => {
|
|
2126
|
-
var
|
|
2127
|
-
p.stopPropagation(), (
|
|
2126
|
+
var f;
|
|
2127
|
+
p.stopPropagation(), (f = this.soundEngine) == null || f.playClick();
|
|
2128
|
+
const d = this.currentComponent;
|
|
2129
|
+
this.hide(), h.action(d);
|
|
2128
2130
|
}), this.menuEl.appendChild(c);
|
|
2129
2131
|
}
|
|
2130
2132
|
this.menuEl.style.display = "flex";
|
|
@@ -2226,14 +2228,14 @@ const S = class S extends T {
|
|
|
2226
2228
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
2227
2229
|
</svg>
|
|
2228
2230
|
`, p.appendChild(d);
|
|
2229
|
-
const
|
|
2230
|
-
|
|
2231
|
+
const f = document.createElement("button");
|
|
2232
|
+
f.className = "relly-header-btn", f.title = "Import settings from JSON", f.innerHTML = `
|
|
2231
2233
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
2232
2234
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
2233
2235
|
<polyline points="7 10 12 15 17 10"></polyline>
|
|
2234
2236
|
<line x1="12" y1="15" x2="12" y2="3"></line>
|
|
2235
2237
|
</svg>
|
|
2236
|
-
`, p.appendChild(
|
|
2238
|
+
`, p.appendChild(f);
|
|
2237
2239
|
const b = document.createElement("button");
|
|
2238
2240
|
b.className = "relly-header-btn relly-minihud-btn", b.title = "Toggle Mini-HUD pill (or double-click header)", b.textContent = "⤢", p.appendChild(b);
|
|
2239
2241
|
const m = document.createElement("button");
|
|
@@ -2275,8 +2277,8 @@ const S = class S extends T {
|
|
|
2275
2277
|
this.panelEl = l, this.headerEl = h, this.titleEl = u, this.collapseBtn = m, this.copyToastEl = v, this.soundEngine = r, this.onResizeBound = () => this.clampToViewport(), e.searchBar && (this.searchBarInstance = new se(E, e.searchOptions), h.insertAdjacentElement("afterend", this.searchBarInstance.element)), this.themeManager = new ee(this.panelEl, e.theme), this.mount(e, t), e.autoInjectStyles !== !1 && (this.shadowRoot ? $(this.shadowRoot) : $()), e.draggable !== !1 && (this.draggableInstance = new te(this.headerEl, this.panelEl, this.soundEngine)), e.resizable !== !1 && (this.resizableInstance = new ie(this.panelEl)), this.toastManager = new oe(this.panelEl, this.soundEngine), this.contextMenuManager = new he(this.panelEl, this.soundEngine), this.importModalInstance = new ae(this.panelEl, (x) => {
|
|
2276
2278
|
this.importJSON(x);
|
|
2277
2279
|
});
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
+
const g = e.hotkey === void 0 ? "KeyH" : e.hotkey;
|
|
2281
|
+
g && (this.hotkeyInstance = new ne(g, () => {
|
|
2280
2282
|
this.toggle();
|
|
2281
2283
|
})), b.addEventListener("click", (x) => {
|
|
2282
2284
|
x.stopPropagation(), this.toggleMiniHud();
|
|
@@ -2286,7 +2288,7 @@ const S = class S extends T {
|
|
|
2286
2288
|
x.stopPropagation(), this.soundEngine.playClick(), this.toggleCollapse();
|
|
2287
2289
|
}), d.addEventListener("click", (x) => {
|
|
2288
2290
|
x.stopPropagation(), this.soundEngine.playClick(), this.copyJSON();
|
|
2289
|
-
}),
|
|
2291
|
+
}), f.addEventListener("click", (x) => {
|
|
2290
2292
|
var w;
|
|
2291
2293
|
x.stopPropagation(), this.soundEngine.playClick(), (w = this.importModalInstance) == null || w.show();
|
|
2292
2294
|
}), e.soundVolume !== void 0 && this.soundEngine.setVolume(e.soundVolume), e.accordion && this.setAccordion(!0), e.ghostOnIdle && this.setGhostMode(!0, e.idleOpacity), this.initSparkline(c), this.panelEl.addEventListener("mouseenter", () => {
|