@msb235/blits-panel 0.3.1 → 0.4.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/CHANGELOG.md +14 -0
- package/dist/index.js +94 -88
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ This package follows [semver](https://semver.org). Below 1.0.0, a breaking chang
|
|
|
4
4
|
version and everything else the patch. The release workflow refuses a `panel-v*` tag with no
|
|
5
5
|
section here.
|
|
6
6
|
|
|
7
|
+
## 0.4.1
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- A panel that subscribes late, such as one reloaded, gets the picked mix's subject list and
|
|
12
|
+
voices at once. It used to wait for the list to change and for frames to run.
|
|
13
|
+
|
|
14
|
+
## 0.4.0
|
|
15
|
+
|
|
16
|
+
### Breaking
|
|
17
|
+
|
|
18
|
+
- `@msb235/blits` is a peer at `^0.16.0`, where it was `^0.15.0`. Built and tested against engine
|
|
19
|
+
0.16.0; nothing here uses what that release changed.
|
|
20
|
+
|
|
7
21
|
## 0.3.1
|
|
8
22
|
|
|
9
23
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -276,20 +276,20 @@ function P(t = {}) {
|
|
|
276
276
|
kind: "marks",
|
|
277
277
|
marks: t
|
|
278
278
|
}));
|
|
279
|
-
}, I = () => {
|
|
279
|
+
}, I = (e) => e.subjects().map((t) => ({
|
|
280
|
+
id: r.of(t),
|
|
281
|
+
label: e.label(t)
|
|
282
|
+
})), L = () => {
|
|
280
283
|
let e = /* @__PURE__ */ new Map(), t = S();
|
|
281
284
|
for (let t of b()) for (let n of t.subjects()) e.has(n) || e.set(n, t.id);
|
|
282
285
|
if (t !== null) for (let n of t.subjects()) e.set(n, t.id);
|
|
283
286
|
if (p = e, r.prune(), t === null) return;
|
|
284
|
-
let n = t
|
|
285
|
-
id: r.of(e),
|
|
286
|
-
label: t.label(e)
|
|
287
|
-
})), i = JSON.stringify(n);
|
|
287
|
+
let n = I(t), i = JSON.stringify(n);
|
|
288
288
|
i !== u && (u = i, _({
|
|
289
289
|
kind: "subjects",
|
|
290
290
|
subjects: n
|
|
291
291
|
}));
|
|
292
|
-
},
|
|
292
|
+
}, R = (e, t) => {
|
|
293
293
|
let n;
|
|
294
294
|
for (let e of t.probed) e.subject === o && (n = e.pose);
|
|
295
295
|
let r = n === void 0;
|
|
@@ -308,7 +308,7 @@ function P(t = {}) {
|
|
|
308
308
|
weights: i,
|
|
309
309
|
read: r
|
|
310
310
|
};
|
|
311
|
-
},
|
|
311
|
+
}, ie = (e) => {
|
|
312
312
|
let t = e.history, n = e.mix.now;
|
|
313
313
|
if (t === void 0 || !Number.isFinite(n)) return [];
|
|
314
314
|
let r = [], i = Math.max(e.reach, n - Math.min(j, t.ms));
|
|
@@ -321,11 +321,11 @@ function P(t = {}) {
|
|
|
321
321
|
});
|
|
322
322
|
} catch {}
|
|
323
323
|
return r;
|
|
324
|
-
},
|
|
324
|
+
}, ae = (e) => {
|
|
325
325
|
let t = S();
|
|
326
326
|
if (t !== null) {
|
|
327
327
|
if (o !== void 0) {
|
|
328
|
-
let n =
|
|
328
|
+
let n = R(t, e);
|
|
329
329
|
n !== null && _({
|
|
330
330
|
kind: "samples",
|
|
331
331
|
samples: [n],
|
|
@@ -334,11 +334,11 @@ function P(t = {}) {
|
|
|
334
334
|
}
|
|
335
335
|
Date.now() - d >= re && A(), M(), D();
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, z = () => {
|
|
338
338
|
c?.free(), c = null;
|
|
339
|
-
},
|
|
339
|
+
}, B = (e) => {
|
|
340
340
|
let t = e === null ? void 0 : x(e);
|
|
341
|
-
c !== null && (t === void 0 || !c.mixes.includes(t.mix)) &&
|
|
341
|
+
c !== null && (t === void 0 || !c.mixes.includes(t.mix)) && z(), s?.(), s = null, a = t?.id ?? null, o = void 0, u = "", f = "", l = !1, m.clear(), t !== void 0 && (s = t.watch(ae)), _({
|
|
342
342
|
kind: "picked",
|
|
343
343
|
mix: a,
|
|
344
344
|
subject: null
|
|
@@ -346,8 +346,8 @@ function P(t = {}) {
|
|
|
346
346
|
kind: "samples",
|
|
347
347
|
samples: [],
|
|
348
348
|
reset: !0
|
|
349
|
-
}),
|
|
350
|
-
},
|
|
349
|
+
}), L(), A(), M(), D();
|
|
350
|
+
}, V = (e) => {
|
|
351
351
|
o = e === null ? void 0 : r.get(e);
|
|
352
352
|
let t = S();
|
|
353
353
|
_({
|
|
@@ -356,30 +356,30 @@ function P(t = {}) {
|
|
|
356
356
|
subject: o === void 0 ? null : e
|
|
357
357
|
}), _({
|
|
358
358
|
kind: "samples",
|
|
359
|
-
samples: t !== null && o !== void 0 ?
|
|
359
|
+
samples: t !== null && o !== void 0 ? ie(t) : [],
|
|
360
360
|
reset: !0
|
|
361
361
|
}), A();
|
|
362
|
-
}, { arm:
|
|
362
|
+
}, { arm: H, outline: U } = ee(t, {
|
|
363
363
|
owner: (e) => p.get(e),
|
|
364
364
|
arming: (e) => {
|
|
365
|
-
e &&
|
|
365
|
+
e && L(), _({
|
|
366
366
|
kind: "arming",
|
|
367
367
|
on: e
|
|
368
368
|
});
|
|
369
369
|
},
|
|
370
370
|
picked: (e, t) => {
|
|
371
|
-
a !== t &&
|
|
371
|
+
a !== t && B(t), L(), V(r.of(e));
|
|
372
372
|
}
|
|
373
|
-
}),
|
|
373
|
+
}), W = (e) => {
|
|
374
374
|
switch (e.kind) {
|
|
375
375
|
case "mix":
|
|
376
|
-
|
|
376
|
+
B(e.id);
|
|
377
377
|
return;
|
|
378
378
|
case "subject":
|
|
379
|
-
|
|
379
|
+
V(e.id);
|
|
380
380
|
return;
|
|
381
381
|
case "hold":
|
|
382
|
-
if (!e.on)
|
|
382
|
+
if (!e.on) z();
|
|
383
383
|
else if (c === null && S() !== null) try {
|
|
384
384
|
c = S().hold(), l = !1;
|
|
385
385
|
} catch {
|
|
@@ -403,23 +403,23 @@ function P(t = {}) {
|
|
|
403
403
|
D();
|
|
404
404
|
return;
|
|
405
405
|
case "arm":
|
|
406
|
-
|
|
406
|
+
H(e.on);
|
|
407
407
|
return;
|
|
408
408
|
case "circles":
|
|
409
409
|
P(e.on);
|
|
410
410
|
return;
|
|
411
411
|
case "outline":
|
|
412
|
-
|
|
412
|
+
U(e.subject === null ? void 0 : r.get(e.subject));
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
|
-
},
|
|
415
|
+
}, G = () => {
|
|
416
416
|
let [e, ...t] = b();
|
|
417
|
-
a === null && e !== void 0 && t.length === 0 &&
|
|
418
|
-
},
|
|
419
|
-
w(), e.kind === "gone" && a === e.id &&
|
|
417
|
+
a === null && e !== void 0 && t.length === 0 && B(e.id);
|
|
418
|
+
}, K = i.on((e) => {
|
|
419
|
+
w(), e.kind === "gone" && a === e.id && B(null), G();
|
|
420
420
|
});
|
|
421
|
-
|
|
422
|
-
let
|
|
421
|
+
G();
|
|
422
|
+
let q = setInterval(L, ne);
|
|
423
423
|
return {
|
|
424
424
|
subscribe(e) {
|
|
425
425
|
n.add(e), e({
|
|
@@ -437,16 +437,22 @@ function P(t = {}) {
|
|
|
437
437
|
on: g
|
|
438
438
|
});
|
|
439
439
|
let t = S();
|
|
440
|
-
return e({
|
|
440
|
+
return t !== null && e({
|
|
441
|
+
kind: "subjects",
|
|
442
|
+
subjects: I(t)
|
|
443
|
+
}), e({
|
|
444
|
+
kind: "voices",
|
|
445
|
+
voices: O()
|
|
446
|
+
}), e({
|
|
441
447
|
kind: "marks",
|
|
442
448
|
marks: t === null ? [] : T(t, j)
|
|
443
449
|
}), () => {
|
|
444
450
|
n.delete(e);
|
|
445
451
|
};
|
|
446
452
|
},
|
|
447
|
-
send:
|
|
453
|
+
send: W,
|
|
448
454
|
dispose() {
|
|
449
|
-
|
|
455
|
+
H(!1), z(), s?.(), s = null, clearInterval(q), K(), U(void 0), h.clear(), n.clear();
|
|
450
456
|
}
|
|
451
457
|
};
|
|
452
458
|
}
|
|
@@ -480,9 +486,9 @@ function R(e, t, n, r) {
|
|
|
480
486
|
}
|
|
481
487
|
//#endregion
|
|
482
488
|
//#region src/ui/ChannelPlot.tsx
|
|
483
|
-
var
|
|
484
|
-
function
|
|
485
|
-
let [s, c] = L(I(n),
|
|
489
|
+
var ie = 8, ae = "\n.bp-plot { margin: 0; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }\n.bp-plot-surface { margin-block-end: calc(var(--wzl-font-size-xs) + 6px); }\n.bp-plot-label { font-family: var(--wzl-font-ui); font-size: var(--wzl-font-size-xs); color: var(--wzl-fg-muted); }\n.bp-plot-thin, .bp-plot-thick { fill: none; stroke-linejoin: round; }\n.bp-plot-thin { stroke-width: 1; opacity: 0.65; }\n.bp-plot-thick { stroke-width: 2.5; }\n.bp-plot-playhead { stroke: var(--wzl-danger); stroke-width: 1; }\n";
|
|
490
|
+
function z({ label: e, times: t, series: n, playhead: r, range: i, width: a = 320, height: o = 90 }) {
|
|
491
|
+
let [s, c] = L(I(n), ie, o), d = i?.[0] ?? t[0] ?? 0, h = Math.max(d + 1e-9, i?.[1] ?? t[t.length - 1] ?? 1), g = {
|
|
486
492
|
xMin: d,
|
|
487
493
|
xMax: h,
|
|
488
494
|
yMin: s,
|
|
@@ -500,7 +506,7 @@ function V({ label: e, times: t, series: n, playhead: r, range: i, width: a = 32
|
|
|
500
506
|
return /* @__PURE__ */ p("figure", {
|
|
501
507
|
className: "bp-plot",
|
|
502
508
|
children: [
|
|
503
|
-
/* @__PURE__ */ f("style", { children:
|
|
509
|
+
/* @__PURE__ */ f("style", { children: ae }),
|
|
504
510
|
/* @__PURE__ */ f("figcaption", {
|
|
505
511
|
className: "bp-plot-label",
|
|
506
512
|
children: e
|
|
@@ -532,12 +538,12 @@ function V({ label: e, times: t, series: n, playhead: r, range: i, width: a = 32
|
|
|
532
538
|
}
|
|
533
539
|
//#endregion
|
|
534
540
|
//#region src/ui/lanes.ts
|
|
535
|
-
var
|
|
541
|
+
var B = /* @__PURE__ */ new Set([
|
|
536
542
|
"live",
|
|
537
543
|
"frozen",
|
|
538
544
|
"fading"
|
|
539
545
|
]);
|
|
540
|
-
function
|
|
546
|
+
function V(e, t) {
|
|
541
547
|
let n = new Map(t.map((e) => [e.id, e.name])), r = /* @__PURE__ */ new Map(), i = (e, t) => {
|
|
542
548
|
let i = r.get(e);
|
|
543
549
|
return i === void 0 && (i = {
|
|
@@ -557,13 +563,13 @@ function U(e, t) {
|
|
|
557
563
|
let e = i(t.voice, t.name);
|
|
558
564
|
e.marks.push(t), t.mark === "start" && (e.from = t.at), t.mark === "end" && (e.to = t.at);
|
|
559
565
|
}
|
|
560
|
-
for (let e of t)
|
|
566
|
+
for (let e of t) B.has(e.state) && i(e.id, e.name);
|
|
561
567
|
return {
|
|
562
568
|
lanes: [...r.values()].sort((e, t) => e.from - t.from || e.voice - t.voice),
|
|
563
569
|
announced: a
|
|
564
570
|
};
|
|
565
571
|
}
|
|
566
|
-
function
|
|
572
|
+
function H(e, t, n) {
|
|
567
573
|
let r = t[0], i = t[t.length - 1];
|
|
568
574
|
if (!Number.isFinite(e)) return [r ?? 0, Math.max((r ?? 0) + 1, i ?? 1)];
|
|
569
575
|
let a = e - S, o = e + S;
|
|
@@ -573,29 +579,29 @@ function W(e, t, n) {
|
|
|
573
579
|
}
|
|
574
580
|
//#endregion
|
|
575
581
|
//#region src/ui/time.ts
|
|
576
|
-
var
|
|
577
|
-
function
|
|
582
|
+
var U = (e) => String(e).padStart(2, "0");
|
|
583
|
+
function W(e) {
|
|
578
584
|
if (!Number.isFinite(e)) return "—";
|
|
579
585
|
let t = e < 0 ? "-" : "", n = Math.floor(Math.abs(e) / 10), r = n % 6e3 / 100, i = Math.floor(n / 6e3) % 60, a = Math.floor(n / 36e4);
|
|
580
586
|
if (a === 0 && i === 0) return `${t}${r.toFixed(2)}s`;
|
|
581
587
|
let o = r.toFixed(2).padStart(5, "0");
|
|
582
|
-
return a === 0 ? `${t}${i}:${o}` : `${t}${a}:${
|
|
588
|
+
return a === 0 ? `${t}${i}:${o}` : `${t}${a}:${U(i)}:${o}`;
|
|
583
589
|
}
|
|
584
590
|
//#endregion
|
|
585
591
|
//#region src/ui/Plan.tsx
|
|
586
|
-
var
|
|
587
|
-
function
|
|
588
|
-
let [a, o] = n, { lanes: s, announced: c } =
|
|
592
|
+
var G = 30, K = 12, q = 5.2, oe = "\n.bp-plan { margin: 0 0 8px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }\n.bp-plan svg { display: block; overflow: visible; }\n.bp-plan-text { font-family: var(--wzl-font-ui); font-size: 9px; fill: var(--wzl-fg-muted); }\n.bp-plan-name { font-family: var(--wzl-font-ui); font-size: 10px; fill: var(--wzl-fg); }\n.bp-plan-ahead { fill: var(--wzl-fg); opacity: 0.05; }\n.bp-plan-bar { opacity: 0.4; }\n.bp-plan-tick { stroke-width: 1.5; }\n.bp-plan-said { stroke: var(--wzl-fg-muted); stroke-dasharray: 3 3; stroke-width: 1; }\n.bp-plan-playhead { stroke: var(--wzl-danger); stroke-width: 1; }\n";
|
|
593
|
+
function se({ marks: e, voices: t, range: n, playhead: r, width: i = 320 }) {
|
|
594
|
+
let [a, o] = n, { lanes: s, announced: c } = V(e, t), l = c.filter((e) => e.at >= a && e.at <= o), u = s.slice(0, K), d = (e) => (Math.min(o, Math.max(a, e)) - a) / (o - a) * i, m = u.length + +(l.length > 0), h = Math.max(1, m) * G, g = Number.isFinite(r) ? d(r) : null, _ = Number.isFinite(r) ? o - r : 0;
|
|
589
595
|
return /* @__PURE__ */ p("figure", {
|
|
590
596
|
className: "bp-plan",
|
|
591
597
|
"aria-label": "plan",
|
|
592
598
|
children: [
|
|
593
|
-
/* @__PURE__ */ f("style", { children:
|
|
599
|
+
/* @__PURE__ */ f("style", { children: oe }),
|
|
594
600
|
/* @__PURE__ */ p("figcaption", {
|
|
595
601
|
className: "bp-plot-label",
|
|
596
602
|
children: [
|
|
597
603
|
"plan",
|
|
598
|
-
_ > 0 ? `, ${
|
|
604
|
+
_ > 0 ? `, ${W(_)} ahead` : "",
|
|
599
605
|
s.length > u.length && ` · ${s.length - u.length} more voices`
|
|
600
606
|
]
|
|
601
607
|
}),
|
|
@@ -618,9 +624,9 @@ function oe({ marks: e, voices: t, range: n, playhead: r, width: i = 320 }) {
|
|
|
618
624
|
y: 18,
|
|
619
625
|
children: "nothing planned"
|
|
620
626
|
}),
|
|
621
|
-
u.map((e, t) => /* @__PURE__ */ f(
|
|
627
|
+
u.map((e, t) => /* @__PURE__ */ f(ce, {
|
|
622
628
|
lane: e,
|
|
623
|
-
y: t *
|
|
629
|
+
y: t * G,
|
|
624
630
|
x: d,
|
|
625
631
|
xMin: a,
|
|
626
632
|
xMax: o
|
|
@@ -631,20 +637,20 @@ function oe({ marks: e, voices: t, range: n, playhead: r, width: i = 320 }) {
|
|
|
631
637
|
x2: d(e.at),
|
|
632
638
|
y1: 0,
|
|
633
639
|
y2: h,
|
|
634
|
-
children: /* @__PURE__ */ f("title", { children:
|
|
640
|
+
children: /* @__PURE__ */ f("title", { children: Y(e) })
|
|
635
641
|
}, `said-${e.name}-${e.at}`)),
|
|
636
642
|
l.length > 0 && /* @__PURE__ */ p("g", {
|
|
637
|
-
transform: `translate(0 ${u.length *
|
|
643
|
+
transform: `translate(0 ${u.length * G})`,
|
|
638
644
|
children: [/* @__PURE__ */ f("text", {
|
|
639
645
|
className: "bp-plan-name",
|
|
640
646
|
x: 2,
|
|
641
647
|
y: 10,
|
|
642
648
|
children: "announced"
|
|
643
|
-
}),
|
|
649
|
+
}), J(l, d).map(({ m: e, show: t }) => /* @__PURE__ */ p("g", { children: [/* @__PURE__ */ f("path", {
|
|
644
650
|
d: `M${d(e.at)} 12l4 4l-4 4l-4 -4z`,
|
|
645
651
|
fill: "var(--wzl-fg)",
|
|
646
|
-
"aria-label":
|
|
647
|
-
children: /* @__PURE__ */ f("title", { children:
|
|
652
|
+
"aria-label": Y(e),
|
|
653
|
+
children: /* @__PURE__ */ f("title", { children: Y(e) })
|
|
648
654
|
}), t && /* @__PURE__ */ f("text", {
|
|
649
655
|
className: "bp-plan-text",
|
|
650
656
|
x: d(e.at) + 6,
|
|
@@ -664,8 +670,8 @@ function oe({ marks: e, voices: t, range: n, playhead: r, width: i = 320 }) {
|
|
|
664
670
|
]
|
|
665
671
|
});
|
|
666
672
|
}
|
|
667
|
-
function
|
|
668
|
-
let a = m(e.hue), o = n(e.from), s = !(e.to <= i), c = s ? n(i) - 6 : n(e.to), l = e.to === Infinity ? "no end known: plays on" : `gone at ${
|
|
673
|
+
function ce({ lane: e, y: t, x: n, xMin: r, xMax: i }) {
|
|
674
|
+
let a = m(e.hue), o = n(e.from), s = !(e.to <= i), c = s ? n(i) - 6 : n(e.to), l = e.to === Infinity ? "no end known: plays on" : `gone at ${W(e.to)}`;
|
|
669
675
|
return /* @__PURE__ */ p("g", {
|
|
670
676
|
transform: `translate(0 ${t})`,
|
|
671
677
|
"aria-label": `${e.label}: ${l}`,
|
|
@@ -689,14 +695,14 @@ function se({ lane: e, y: t, x: n, xMin: r, xMax: i }) {
|
|
|
689
695
|
fill: a,
|
|
690
696
|
children: /* @__PURE__ */ f("title", { children: l })
|
|
691
697
|
}),
|
|
692
|
-
|
|
698
|
+
J(e.marks.filter((e) => e.at >= r && e.at <= i), n).map(({ m: e, show: t }) => /* @__PURE__ */ p("g", { children: [/* @__PURE__ */ f("line", {
|
|
693
699
|
className: "bp-plan-tick",
|
|
694
700
|
x1: n(e.at),
|
|
695
701
|
x2: n(e.at),
|
|
696
702
|
y1: 10,
|
|
697
703
|
y2: 21,
|
|
698
704
|
stroke: a,
|
|
699
|
-
children: /* @__PURE__ */ f("title", { children:
|
|
705
|
+
children: /* @__PURE__ */ f("title", { children: Y(e) })
|
|
700
706
|
}), t && /* @__PURE__ */ f("text", {
|
|
701
707
|
className: "bp-plan-text",
|
|
702
708
|
x: n(e.at) + 2,
|
|
@@ -706,23 +712,23 @@ function se({ lane: e, y: t, x: n, xMin: r, xMax: i }) {
|
|
|
706
712
|
]
|
|
707
713
|
});
|
|
708
714
|
}
|
|
709
|
-
function
|
|
715
|
+
function J(e, t) {
|
|
710
716
|
let n = -Infinity;
|
|
711
717
|
return e.map((e) => {
|
|
712
718
|
let r = t(e.at), i = (e.voice === null ? e.name : e.mark) ?? "", a = r >= n;
|
|
713
|
-
return a && (n = r + 4 + i.length *
|
|
719
|
+
return a && (n = r + 4 + i.length * q), {
|
|
714
720
|
m: e,
|
|
715
721
|
show: a
|
|
716
722
|
};
|
|
717
723
|
});
|
|
718
724
|
}
|
|
719
|
-
function
|
|
720
|
-
return `${e.voice === null ? `announced ${e.name ?? ""}` : `${e.name ?? `#${e.voice}`} ${e.mark}`} at ${
|
|
725
|
+
function Y(e) {
|
|
726
|
+
return `${e.voice === null ? `announced ${e.name ?? ""}` : `${e.name ?? `#${e.voice}`} ${e.mark}`} at ${W(e.at)}`;
|
|
721
727
|
}
|
|
722
728
|
//#endregion
|
|
723
729
|
//#region src/ui/Plots.tsx
|
|
724
|
-
function
|
|
725
|
-
let { times: c, values: l, weights: u, read: d } = a(() => e.series(), [e, t]), m = Number.isFinite(i) ? i : c[c.length - 1] ?? NaN, g =
|
|
730
|
+
function le({ samples: e, drawn: t, voices: n, marks: r, playhead: i, picked: o, mix: s }) {
|
|
731
|
+
let { times: c, values: l, weights: u, read: d } = a(() => e.series(), [e, t]), m = Number.isFinite(i) ? i : c[c.length - 1] ?? NaN, g = H(m, o ? c : [], r), _ = s && /* @__PURE__ */ f(se, {
|
|
726
732
|
marks: r,
|
|
727
733
|
voices: n,
|
|
728
734
|
range: g,
|
|
@@ -744,7 +750,7 @@ function ce({ samples: e, drawn: t, voices: n, marks: r, playhead: i, picked: o,
|
|
|
744
750
|
className: "bp-plots",
|
|
745
751
|
children: [
|
|
746
752
|
_,
|
|
747
|
-
[...l].map(([e, t]) => /* @__PURE__ */ f(
|
|
753
|
+
[...l].map(([e, t]) => /* @__PURE__ */ f(z, {
|
|
748
754
|
label: `${e}${v}`,
|
|
749
755
|
times: c,
|
|
750
756
|
range: g,
|
|
@@ -757,7 +763,7 @@ function ce({ samples: e, drawn: t, voices: n, marks: r, playhead: i, picked: o,
|
|
|
757
763
|
thick: !0
|
|
758
764
|
}]
|
|
759
765
|
}, e)),
|
|
760
|
-
b.length > 0 && /* @__PURE__ */ f(
|
|
766
|
+
b.length > 0 && /* @__PURE__ */ f(z, {
|
|
761
767
|
label: "weightOf",
|
|
762
768
|
times: c,
|
|
763
769
|
range: g,
|
|
@@ -769,7 +775,7 @@ function ce({ samples: e, drawn: t, voices: n, marks: r, playhead: i, picked: o,
|
|
|
769
775
|
}
|
|
770
776
|
//#endregion
|
|
771
777
|
//#region src/ui/Panel.tsx
|
|
772
|
-
var
|
|
778
|
+
var ue = {
|
|
773
779
|
mixes: [],
|
|
774
780
|
mix: null,
|
|
775
781
|
subject: null,
|
|
@@ -786,7 +792,7 @@ var le = {
|
|
|
786
792
|
circles: !1,
|
|
787
793
|
drawn: 0
|
|
788
794
|
};
|
|
789
|
-
function
|
|
795
|
+
function de(e, t) {
|
|
790
796
|
switch (t.kind) {
|
|
791
797
|
case "mixes": return {
|
|
792
798
|
...e,
|
|
@@ -829,17 +835,17 @@ function ue(e, t) {
|
|
|
829
835
|
default: return e;
|
|
830
836
|
}
|
|
831
837
|
}
|
|
832
|
-
var
|
|
838
|
+
var fe = [
|
|
833
839
|
0,
|
|
834
840
|
.1,
|
|
835
841
|
.25,
|
|
836
842
|
.5,
|
|
837
843
|
1,
|
|
838
844
|
2
|
|
839
|
-
],
|
|
840
|
-
function
|
|
845
|
+
], pe = 1e3 / 60, X = "blits-panel:place";
|
|
846
|
+
function me() {
|
|
841
847
|
try {
|
|
842
|
-
let e = JSON.parse(localStorage.getItem(
|
|
848
|
+
let e = JSON.parse(localStorage.getItem(X) ?? "null");
|
|
843
849
|
if (e && typeof e.x == "number" && typeof e.y == "number") return e;
|
|
844
850
|
} catch {}
|
|
845
851
|
return {
|
|
@@ -848,12 +854,12 @@ function pe() {
|
|
|
848
854
|
open: !1
|
|
849
855
|
};
|
|
850
856
|
}
|
|
851
|
-
function
|
|
857
|
+
function he(e) {
|
|
852
858
|
try {
|
|
853
|
-
localStorage.setItem(
|
|
859
|
+
localStorage.setItem(X, JSON.stringify(e));
|
|
854
860
|
} catch {}
|
|
855
861
|
}
|
|
856
|
-
function
|
|
862
|
+
function Z(e, t) {
|
|
857
863
|
let n = typeof innerWidth == "number" ? innerWidth : 1024, r = typeof innerHeight == "number" ? innerHeight : 768;
|
|
858
864
|
return {
|
|
859
865
|
x: Math.min(Math.max(0, e), Math.max(0, n - 120)),
|
|
@@ -861,11 +867,11 @@ function he(e, t) {
|
|
|
861
867
|
};
|
|
862
868
|
}
|
|
863
869
|
function ge({ source: e, docked: t = !1, bar: n }) {
|
|
864
|
-
let [r, a] = o(
|
|
865
|
-
let e =
|
|
870
|
+
let [r, a] = o(de, ue), l = s(new w()), [u, m] = c(() => {
|
|
871
|
+
let e = me();
|
|
866
872
|
return {
|
|
867
873
|
...e,
|
|
868
|
-
...
|
|
874
|
+
...Z(e.x, e.y)
|
|
869
875
|
};
|
|
870
876
|
}), [h, g] = c(""), [_, v] = c(null);
|
|
871
877
|
i(() => {
|
|
@@ -902,10 +908,10 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
902
908
|
S && r.hold.now > y.current && (y.current = r.hold.now), S || (y.current = -Infinity);
|
|
903
909
|
let C = (e, t = u.x, n = u.y) => {
|
|
904
910
|
let r = {
|
|
905
|
-
...
|
|
911
|
+
...Z(t, n),
|
|
906
912
|
open: e
|
|
907
913
|
};
|
|
908
|
-
m(r),
|
|
914
|
+
m(r), he(r);
|
|
909
915
|
}, T = (e) => {
|
|
910
916
|
if (e.target.closest("button, select, input")) return;
|
|
911
917
|
let t = {
|
|
@@ -935,7 +941,7 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
935
941
|
title: "step one frame",
|
|
936
942
|
onClick: () => b({
|
|
937
943
|
kind: "step",
|
|
938
|
-
ms:
|
|
944
|
+
ms: pe
|
|
939
945
|
}),
|
|
940
946
|
children: "⏭"
|
|
941
947
|
}),
|
|
@@ -975,7 +981,7 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
975
981
|
}),
|
|
976
982
|
/* @__PURE__ */ f("span", {
|
|
977
983
|
className: "bp-time",
|
|
978
|
-
children:
|
|
984
|
+
children: W(r.hold.now)
|
|
979
985
|
})
|
|
980
986
|
]
|
|
981
987
|
});
|
|
@@ -1015,7 +1021,7 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
1015
1021
|
kind: "rate",
|
|
1016
1022
|
rate: Number(e.currentTarget.value)
|
|
1017
1023
|
}),
|
|
1018
|
-
children:
|
|
1024
|
+
children: fe.map((e) => /* @__PURE__ */ p("option", {
|
|
1019
1025
|
value: e,
|
|
1020
1026
|
children: ["×", e]
|
|
1021
1027
|
}, e))
|
|
@@ -1029,7 +1035,7 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
1029
1035
|
}),
|
|
1030
1036
|
/* @__PURE__ */ f("span", {
|
|
1031
1037
|
className: "bp-time",
|
|
1032
|
-
children:
|
|
1038
|
+
children: W(r.hold.now)
|
|
1033
1039
|
})
|
|
1034
1040
|
]
|
|
1035
1041
|
}),
|
|
@@ -1127,7 +1133,7 @@ function ge({ source: e, docked: t = !1, bar: n }) {
|
|
|
1127
1133
|
}, e.id))
|
|
1128
1134
|
})
|
|
1129
1135
|
]
|
|
1130
|
-
}), /* @__PURE__ */ f(
|
|
1136
|
+
}), /* @__PURE__ */ f(le, {
|
|
1131
1137
|
samples: l.current,
|
|
1132
1138
|
drawn: r.drawn,
|
|
1133
1139
|
voices: r.voices,
|
|
@@ -1224,6 +1230,6 @@ function be(e, t) {
|
|
|
1224
1230
|
};
|
|
1225
1231
|
}
|
|
1226
1232
|
//#endregion
|
|
1227
|
-
export { C as AHEAD_CAP_MS, S as AHEAD_MS, x as CAP,
|
|
1233
|
+
export { C as AHEAD_CAP_MS, S as AHEAD_MS, x as CAP, z as ChannelPlot, ge as Panel, w as Samples, b as WINDOW_MS, P as agent, $ as decode, Q as encode, N as flatten, m as hueColor, ve as mount, O as offer, F as panelStyles, be as serve, ye as wireSource };
|
|
1228
1234
|
|
|
1229
1235
|
//# sourceMappingURL=index.js.map
|