@useonsite/vite 0.1.0 → 0.1.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/README.md +13 -0
- package/dist/index.mjs +104 -15
- package/dist/overlay.js +712 -662
- package/package.json +1 -1
package/dist/overlay.js
CHANGED
|
@@ -325,7 +325,7 @@ var ke = /* @__PURE__ */ new Set([
|
|
|
325
325
|
"tablist",
|
|
326
326
|
"menu",
|
|
327
327
|
"group"
|
|
328
|
-
]), Ne = 80, Pe = 400,
|
|
328
|
+
]), Ne = 80, Pe = 400, Fe = 6, x = (e) => (e ?? "").replace(/\s+/g, " ").trim(), S = (e) => e.length > Ne ? `${e.slice(0, 79)}…` : e, Ie = class {
|
|
329
329
|
doc;
|
|
330
330
|
host;
|
|
331
331
|
seen = /* @__PURE__ */ new Map();
|
|
@@ -355,7 +355,7 @@ var ke = /* @__PURE__ */ new Set([
|
|
|
355
355
|
return [...e.children].filter((e) => this.visible(e));
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
-
function
|
|
358
|
+
function C(e) {
|
|
359
359
|
let t = e.getAttribute("role");
|
|
360
360
|
if (t) return t.split(/\s+/)[0] ?? "";
|
|
361
361
|
let n = e.tagName;
|
|
@@ -377,35 +377,35 @@ function w(e) {
|
|
|
377
377
|
}
|
|
378
378
|
return "";
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
let t =
|
|
382
|
-
if (t) return
|
|
380
|
+
function w(e) {
|
|
381
|
+
let t = x(e.getAttribute("aria-label"));
|
|
382
|
+
if (t) return S(t);
|
|
383
383
|
let n = e.getAttribute("aria-labelledby");
|
|
384
384
|
if (n) {
|
|
385
|
-
let t =
|
|
386
|
-
if (t) return
|
|
385
|
+
let t = x(n.split(/\s+/).map((t) => e.ownerDocument.getElementById(t)?.textContent ?? "").join(" "));
|
|
386
|
+
if (t) return S(t);
|
|
387
387
|
}
|
|
388
388
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) {
|
|
389
|
-
let t =
|
|
390
|
-
if (t) return
|
|
391
|
-
let n =
|
|
392
|
-
return n ?
|
|
389
|
+
let t = x(e.labels?.[0]?.textContent);
|
|
390
|
+
if (t) return S(t);
|
|
391
|
+
let n = x(e.getAttribute("placeholder"));
|
|
392
|
+
return n ? S(n) : e instanceof HTMLInputElement && [
|
|
393
393
|
"button",
|
|
394
394
|
"submit",
|
|
395
395
|
"reset"
|
|
396
|
-
].includes(e.type) ?
|
|
396
|
+
].includes(e.type) ? S(x(e.value)) : S(x(e.getAttribute("name")));
|
|
397
397
|
}
|
|
398
|
-
return e.tagName === "IMG" ?
|
|
398
|
+
return e.tagName === "IMG" ? S(x(e.getAttribute("alt"))) : S(x(e.textContent) || x(e.getAttribute("title")));
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
let n = je[e.tagName], r =
|
|
402
|
-
return t && Me.has(t) ? r ? `${t} "${
|
|
400
|
+
function Le(e, t) {
|
|
401
|
+
let n = je[e.tagName], r = x(e.getAttribute("aria-label"));
|
|
402
|
+
return t && Me.has(t) ? r ? `${t} "${S(r)}"` : t : n ? r ? `${n} "${S(r)}"` : n : e.tagName === "SECTION" && r ? `region "${S(r)}"` : "";
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Re(e) {
|
|
405
405
|
let t = [...e.classList].slice(0, 2).join(".");
|
|
406
406
|
return e.tagName.toLowerCase() + (t ? `.${t}` : "");
|
|
407
407
|
}
|
|
408
|
-
var
|
|
408
|
+
var ze = class {
|
|
409
409
|
page;
|
|
410
410
|
lines = [];
|
|
411
411
|
full = !1;
|
|
@@ -418,34 +418,34 @@ var Re = class {
|
|
|
418
418
|
children(e, t) {
|
|
419
419
|
let n = this.page.kids(e), r = /* @__PURE__ */ new Map();
|
|
420
420
|
for (let e of n) {
|
|
421
|
-
let t =
|
|
421
|
+
let t = Re(e), n = r.get(t);
|
|
422
422
|
n ? n.push(e) : r.set(t, [e]);
|
|
423
423
|
}
|
|
424
424
|
let i = /* @__PURE__ */ new Set();
|
|
425
425
|
for (let e of n) {
|
|
426
|
-
let n =
|
|
426
|
+
let n = Re(e), a = r.get(n) ?? [e];
|
|
427
427
|
a.length < 3 || !this.repeatable(e) ? this.element(e, t) : i.has(n) || (i.add(n), this.repeated(a, n, t));
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
repeatable(e) {
|
|
431
|
-
let t =
|
|
432
|
-
return t !== "heading" && !
|
|
431
|
+
let t = C(e);
|
|
432
|
+
return t !== "heading" && !Le(e, t);
|
|
433
433
|
}
|
|
434
434
|
repeated(e, t, n) {
|
|
435
|
-
let r =
|
|
435
|
+
let r = C(e[0]);
|
|
436
436
|
if (r === "button" || r === "link") {
|
|
437
|
-
let t = e.slice(0,
|
|
438
|
-
e.length >
|
|
437
|
+
let t = e.slice(0, Fe).map((e) => `"${w(e)}"`);
|
|
438
|
+
e.length > Fe && t.push("…"), this.add(n, `${r}s: ${e.length} (${t.join(", ")})`);
|
|
439
439
|
} else this.add(n, `repeated ${t}: ${e.length} items, the first:`), this.element(e[0], n + 1);
|
|
440
440
|
}
|
|
441
441
|
element(e, t) {
|
|
442
|
-
let n =
|
|
442
|
+
let n = C(e), r = Le(e, n);
|
|
443
443
|
if (r) this.add(t, r), this.children(e, t + 1);
|
|
444
444
|
else {
|
|
445
445
|
switch (n) {
|
|
446
446
|
case "heading": {
|
|
447
447
|
let n = /^H([1-6])$/.exec(e.tagName)?.[1] ?? e.getAttribute("aria-level") ?? "2";
|
|
448
|
-
this.add(t, `h${n}: ${
|
|
448
|
+
this.add(t, `h${n}: ${w(e)}`);
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
451
|
case "button":
|
|
@@ -454,26 +454,26 @@ var Re = class {
|
|
|
454
454
|
case "radio":
|
|
455
455
|
case "combobox":
|
|
456
456
|
case "img":
|
|
457
|
-
this.add(t, `${n === "img" ? "image" : n}: ${
|
|
457
|
+
this.add(t, `${n === "img" ? "image" : n}: ${w(e)}`);
|
|
458
458
|
return;
|
|
459
459
|
case "textbox":
|
|
460
460
|
case "searchbox":
|
|
461
|
-
this.add(t, `${n === "searchbox" ? "search field" : "field"}: ${
|
|
461
|
+
this.add(t, `${n === "searchbox" ? "search field" : "field"}: ${w(e)}`);
|
|
462
462
|
return;
|
|
463
463
|
case "table":
|
|
464
464
|
case "grid": {
|
|
465
|
-
let n = e.querySelectorAll("tbody tr, [role=row]").length || e.querySelectorAll("tr").length, r = [...e.querySelectorAll("th, [role=columnheader]")].slice(0, 8).map((e) =>
|
|
465
|
+
let n = e.querySelectorAll("tbody tr, [role=row]").length || e.querySelectorAll("tr").length, r = [...e.querySelectorAll("th, [role=columnheader]")].slice(0, 8).map((e) => x(e.textContent));
|
|
466
466
|
this.add(t, `table: ${n} rows${r.length ? ` (${r.filter(Boolean).join(" · ")})` : ""}`);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
case "list": {
|
|
470
470
|
let n = [...e.children].filter((e) => e.tagName === "LI" || e.getAttribute("role") === "listitem"), r = n.map((e) => {
|
|
471
471
|
let t = this.page.kids(e);
|
|
472
|
-
return t.length === 1 && ["link", "button"].includes(
|
|
472
|
+
return t.length === 1 && ["link", "button"].includes(C(t[0])) ? t[0] : null;
|
|
473
473
|
});
|
|
474
474
|
if (n.length && r.every(Boolean)) {
|
|
475
|
-
let e = r.slice(0,
|
|
476
|
-
n.length >
|
|
475
|
+
let e = r.slice(0, Fe).map((e) => `"${w(e)}"`);
|
|
476
|
+
n.length > Fe && e.push("…"), this.add(t, `list: ${n.length} items (${e.join(", ")})`);
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
479
|
this.add(t, `list: ${n.length} items${n.length > 1 ? ", the first:" : ""}`), n[0] && this.page.visible(n[0]) && this.children(n[0], t + 1);
|
|
@@ -484,12 +484,12 @@ var Re = class {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
};
|
|
487
|
-
function
|
|
487
|
+
function Be(e) {
|
|
488
488
|
let t = e.doc, n = t.body;
|
|
489
489
|
if (!n) return "";
|
|
490
490
|
let r = t.createTreeWalker(n, NodeFilter.SHOW_TEXT), i = [], a = null;
|
|
491
491
|
for (let t = r.nextNode(); t; t = r.nextNode()) {
|
|
492
|
-
let n =
|
|
492
|
+
let n = x(t.nodeValue), r = t.parentElement;
|
|
493
493
|
if (!n || !r || !e.visible(r)) continue;
|
|
494
494
|
let o = r;
|
|
495
495
|
for (; o && !Ae.has(o.tagName);) o = o.parentElement;
|
|
@@ -501,10 +501,10 @@ function ze(e) {
|
|
|
501
501
|
}
|
|
502
502
|
return i.join("").replace(/ *\n */g, "\n").replace(/\n{2,}/g, "\n");
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
let t = e.doc ?? document, r = t.defaultView ?? window, i = new
|
|
504
|
+
function Ve(e = {}) {
|
|
505
|
+
let t = e.doc ?? document, r = t.defaultView ?? window, i = new Ie(t, e.host ?? null), a = new ze(i);
|
|
506
506
|
t.body && a.children(t.body, 0);
|
|
507
|
-
let o = ye(a.lines.join("\n"), n), s = ye(
|
|
507
|
+
let o = ye(a.lines.join("\n"), n), s = ye(Be(i), n), c = r.location;
|
|
508
508
|
return {
|
|
509
509
|
route: c.pathname + c.search + c.hash,
|
|
510
510
|
title: t.title,
|
|
@@ -519,64 +519,64 @@ function Be(e = {}) {
|
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
521
|
// src/context/index.ts
|
|
522
|
-
var
|
|
523
|
-
function
|
|
522
|
+
var He = RegExp(` (?:${e}|${t})="[^"]*"`, "g");
|
|
523
|
+
function Ue(e) {
|
|
524
524
|
let n = { src: e.getAttribute("data-onsite-src") ?? "" }, r = e.getAttribute(t);
|
|
525
|
-
r && (n.comp = r), n.tag = e.tagName.toLowerCase(), n.html = e.outerHTML.replace(
|
|
525
|
+
r && (n.comp = r), n.tag = e.tagName.toLowerCase(), n.html = e.outerHTML.replace(He, "").slice(0, 1500);
|
|
526
526
|
let i = e.getBoundingClientRect();
|
|
527
527
|
n.w = Math.round(i.width), n.h = Math.round(i.height);
|
|
528
528
|
let a = Oe(e);
|
|
529
529
|
return a.length && (n.props = a), n;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function We(e, t = {}) {
|
|
532
532
|
return {
|
|
533
|
-
selection: e.filter((e) => e.isConnected).map(
|
|
534
|
-
page:
|
|
533
|
+
selection: e.filter((e) => e.isConnected).map(Ue),
|
|
534
|
+
page: Ve(t)
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
// src/dock.ts
|
|
538
|
-
var
|
|
538
|
+
var Ge = [
|
|
539
539
|
"top-left",
|
|
540
540
|
"top-center",
|
|
541
541
|
"top-right",
|
|
542
542
|
"bottom-left",
|
|
543
543
|
"bottom-center",
|
|
544
544
|
"bottom-right"
|
|
545
|
-
],
|
|
546
|
-
function Ke(e) {
|
|
547
|
-
return typeof e == "string" && We.includes(e);
|
|
548
|
-
}
|
|
545
|
+
], Ke = "bottom-right";
|
|
549
546
|
function qe(e) {
|
|
550
|
-
return
|
|
547
|
+
return typeof e == "string" && Ge.includes(e);
|
|
548
|
+
}
|
|
549
|
+
function Je(e) {
|
|
550
|
+
return qe(e) ? e : Ke;
|
|
551
551
|
}
|
|
552
|
-
var
|
|
552
|
+
var T = (e) => e.startsWith("top") ? "top" : "bottom", E = (e) => e.endsWith("left") ? "left" : e.endsWith("right") ? "right" : "center", D = [
|
|
553
553
|
"left",
|
|
554
554
|
"center",
|
|
555
555
|
"right"
|
|
556
|
-
],
|
|
557
|
-
function
|
|
556
|
+
], O = (e, t) => `${e}-${t}`;
|
|
557
|
+
function Ye(e, t, n) {
|
|
558
558
|
let r = e === "left" ? 24 : e === "right" ? n.w - 24 - t : (n.w - t) / 2;
|
|
559
559
|
return Math.max(0, r);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
let n =
|
|
561
|
+
function k(e, t) {
|
|
562
|
+
let n = T(e) === "top" ? 24 : t.h - 24 - 48;
|
|
563
563
|
return {
|
|
564
|
-
left:
|
|
564
|
+
left: Ye(E(e), 48, t),
|
|
565
565
|
top: Math.max(0, n),
|
|
566
566
|
width: 48,
|
|
567
567
|
height: 48
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
let n =
|
|
570
|
+
function Xe(e, t) {
|
|
571
|
+
let n = k(e, t);
|
|
572
572
|
return {
|
|
573
573
|
x: n.left + n.width / 2,
|
|
574
574
|
y: n.top + n.height / 2
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
let i = Math.max(0, Math.min(n, t.w - 48)), a =
|
|
579
|
-
return
|
|
577
|
+
function Ze(e, t, n, r = 12) {
|
|
578
|
+
let i = Math.max(0, Math.min(n, t.w - 48)), a = Ye(E(e), i, t), o = 72 + r, s = Math.max(0, t.h - o - 24);
|
|
579
|
+
return T(e) === "top" ? {
|
|
580
580
|
left: a,
|
|
581
581
|
width: i,
|
|
582
582
|
top: o,
|
|
@@ -588,8 +588,8 @@ function Xe(e, t, n, r = 12) {
|
|
|
588
588
|
maxHeight: s
|
|
589
589
|
};
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
let a =
|
|
591
|
+
function Qe(e, t, n, r, i = 12) {
|
|
592
|
+
let a = Ze(e, t, n, i), o = Math.min(r, a.maxHeight), s = a.top ?? t.h - (a.bottom ?? 0) - o;
|
|
593
593
|
return {
|
|
594
594
|
left: a.left,
|
|
595
595
|
top: s,
|
|
@@ -597,19 +597,19 @@ function Ze(e, t, n, r, i = 12) {
|
|
|
597
597
|
height: o
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
let r =
|
|
602
|
-
for (let a of
|
|
603
|
-
let o =
|
|
600
|
+
function $e(e, t, n) {
|
|
601
|
+
let r = Ke, i = 1e400;
|
|
602
|
+
for (let a of Ge) {
|
|
603
|
+
let o = Xe(a, n), s = (o.x - e) ** 2 + (o.y - t) ** 2;
|
|
604
604
|
s < i && (r = a, i = s);
|
|
605
605
|
}
|
|
606
606
|
return r;
|
|
607
607
|
}
|
|
608
|
-
function $e(e, t) {
|
|
609
|
-
let n = O.indexOf(D(e));
|
|
610
|
-
return t === "ArrowLeft" ? k(E(e), O[Math.max(0, n - 1)] ?? "left") : t === "ArrowRight" ? k(E(e), O[Math.min(2, n + 1)] ?? "right") : t === "ArrowUp" ? k("top", D(e)) : t === "ArrowDown" ? k("bottom", D(e)) : e;
|
|
611
|
-
}
|
|
612
608
|
function et(e, t) {
|
|
609
|
+
let n = D.indexOf(E(e));
|
|
610
|
+
return t === "ArrowLeft" ? O(T(e), D[Math.max(0, n - 1)] ?? "left") : t === "ArrowRight" ? O(T(e), D[Math.min(2, n + 1)] ?? "right") : t === "ArrowUp" ? O("top", E(e)) : t === "ArrowDown" ? O("bottom", E(e)) : e;
|
|
611
|
+
}
|
|
612
|
+
function tt(e, t) {
|
|
613
613
|
let n = Math.max(0, e.left), r = Math.max(0, e.top), i = Math.min(t.w, e.left + e.width), a = Math.min(t.h, e.top + e.height);
|
|
614
614
|
return i > n && a > r ? {
|
|
615
615
|
left: n,
|
|
@@ -618,26 +618,26 @@ function et(e, t) {
|
|
|
618
618
|
height: a - r
|
|
619
619
|
} : null;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function nt(e, t) {
|
|
622
622
|
let n = Math.min(e.left + e.width, t.left + t.width) - Math.max(e.left, t.left), r = Math.min(e.top + e.height, t.top + t.height) - Math.max(e.top, t.top);
|
|
623
623
|
return n > 0 && r > 0 ? n * r : 0;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
return Math.abs(
|
|
625
|
+
function rt(e, t) {
|
|
626
|
+
return Math.abs(D.indexOf(E(e)) - D.indexOf(E(t))) + (T(e) === T(t) ? 0 : 1);
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function it(e, t, n) {
|
|
629
629
|
let r = (e) => {
|
|
630
630
|
let r = 0;
|
|
631
|
-
for (let i of t(e)) for (let e of n) r +=
|
|
631
|
+
for (let i of t(e)) for (let e of n) r += nt(i, e);
|
|
632
632
|
return r;
|
|
633
633
|
};
|
|
634
634
|
if (r(e) === 0) return e;
|
|
635
|
-
let i =
|
|
635
|
+
let i = Ge.map((t, n) => ({
|
|
636
636
|
a: t,
|
|
637
637
|
key: [
|
|
638
638
|
r(t),
|
|
639
|
-
|
|
640
|
-
|
|
639
|
+
T(t) === T(e) ? 0 : 1,
|
|
640
|
+
rt(t, e),
|
|
641
641
|
t === "bottom-right" ? 0 : 1,
|
|
642
642
|
n
|
|
643
643
|
]
|
|
@@ -651,42 +651,42 @@ function rt(e, t, n) {
|
|
|
651
651
|
}), i[0]?.a ?? e;
|
|
652
652
|
}
|
|
653
653
|
// src/dom.ts
|
|
654
|
-
function
|
|
655
|
-
for (let n of t) n != null && n !== !1 && (Array.isArray(n) ?
|
|
654
|
+
function at(e, t) {
|
|
655
|
+
for (let n of t) n != null && n !== !1 && (Array.isArray(n) ? at(e, n) : e.appendChild(typeof n == "string" || typeof n == "number" ? document.createTextNode(String(n)) : n));
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function A(e, t, ...n) {
|
|
658
658
|
let r = document.createElement(e);
|
|
659
659
|
for (let [e, n] of Object.entries(t ?? {})) if (e === "on") for (let [e, t] of Object.entries(n)) r.addEventListener(e, t);
|
|
660
660
|
else n === !0 ? r.setAttribute(e, "") : n !== !1 && n != null && r.setAttribute(e, String(n));
|
|
661
|
-
return
|
|
661
|
+
return at(r, n), r;
|
|
662
662
|
}
|
|
663
|
-
var
|
|
664
|
-
function
|
|
665
|
-
let t =
|
|
663
|
+
var ot = /* @__PURE__ */ new Map();
|
|
664
|
+
function j(e) {
|
|
665
|
+
let t = ot.get(e);
|
|
666
666
|
if (!t) {
|
|
667
667
|
let n = document.createElement("template");
|
|
668
|
-
n.innerHTML = e.trim(), t = n.content.firstElementChild ?? document.createElement("span"),
|
|
668
|
+
n.innerHTML = e.trim(), t = n.content.firstElementChild ?? document.createElement("span"), ot.set(e, t);
|
|
669
669
|
}
|
|
670
670
|
return t.cloneNode(!0);
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function st(e, t, n = 0) {
|
|
673
673
|
e.style.left = `${t.left - n}px`, e.style.top = `${t.top - n}px`, e.style.width = `${t.width + n * 2}px`, e.style.height = `${t.height + n * 2}px`;
|
|
674
674
|
}
|
|
675
|
-
var
|
|
676
|
-
function
|
|
675
|
+
var M = () => new Promise((e) => requestAnimationFrame(() => e())), ct = (e) => new Promise((t) => setTimeout(t, e));
|
|
676
|
+
function N() {
|
|
677
677
|
try {
|
|
678
678
|
return matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
679
679
|
} catch {
|
|
680
680
|
return !1;
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function lt() {
|
|
684
684
|
return /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
return
|
|
686
|
+
function P() {
|
|
687
|
+
return lt() ? "⌥" : "Alt";
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function ut(e) {
|
|
690
690
|
return e ? e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement ? !0 : e instanceof HTMLInputElement ? ![
|
|
691
691
|
"button",
|
|
692
692
|
"submit",
|
|
@@ -696,50 +696,50 @@ function lt(e) {
|
|
|
696
696
|
].includes(e.type) : e.isContentEditable === !0 : !1;
|
|
697
697
|
}
|
|
698
698
|
// src/icons.ts
|
|
699
|
-
var
|
|
700
|
-
function
|
|
701
|
-
return `<svg width="${e}" height="${e}" viewBox="0 0 32 32" aria-hidden="true" style="overflow:visible"><g fill="none" stroke="var(--os-ink)" stroke-width="${t}" stroke-linecap="round" stroke-linejoin="round">${
|
|
702
|
-
}
|
|
703
|
-
var
|
|
704
|
-
select:
|
|
705
|
-
alt:
|
|
706
|
-
scheme:
|
|
707
|
-
close:
|
|
708
|
-
read:
|
|
709
|
-
list:
|
|
710
|
-
write:
|
|
711
|
-
done:
|
|
712
|
-
error:
|
|
713
|
-
keep:
|
|
714
|
-
undo:
|
|
715
|
-
more:
|
|
716
|
-
dots:
|
|
717
|
-
back:
|
|
718
|
-
next:
|
|
719
|
-
export:
|
|
720
|
-
skills:
|
|
721
|
-
preset:
|
|
722
|
-
settings:
|
|
723
|
-
hide:
|
|
724
|
-
show:
|
|
725
|
-
edit:
|
|
726
|
-
trash:
|
|
727
|
-
plus:
|
|
728
|
-
layers:
|
|
729
|
-
original:
|
|
730
|
-
send:
|
|
731
|
-
queue:
|
|
732
|
-
pinComment:
|
|
733
|
-
takes:
|
|
734
|
-
stop:
|
|
735
|
-
x:
|
|
736
|
-
element:
|
|
737
|
-
commentChip:
|
|
738
|
-
comment:
|
|
739
|
-
mouse:
|
|
699
|
+
var dt = "<path d=\"M5 11V5h6\"/><path d=\"M21 5h6v6\"/><path d=\"M27 21v6h-6\"/><path d=\"M11 27H5v-6\"/>";
|
|
700
|
+
function F(e, t, n = !1) {
|
|
701
|
+
return `<svg width="${e}" height="${e}" viewBox="0 0 32 32" aria-hidden="true" style="overflow:visible"><g fill="none" stroke="var(--os-ink)" stroke-width="${t}" stroke-linecap="round" stroke-linejoin="round">${dt}</g>${n ? "<circle class=\"dotpulse\" cx=\"16\" cy=\"16\" r=\"4.5\" fill=\"var(--os-mark)\"/>" : ""}<circle cx="16" cy="16" r="4.5" fill="var(--os-mark)"/></svg>`;
|
|
702
|
+
}
|
|
703
|
+
var I = (e, t = 14, n = "") => `<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"${n}>${e}</svg>`, L = {
|
|
704
|
+
select: I("<path d=\"M4 4l7 17 2.5-7.5L21 11z\"/>"),
|
|
705
|
+
alt: I("<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" stroke-dasharray=\"3 3\"/>"),
|
|
706
|
+
scheme: I("<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 3.5v17\"/><path d=\"M12 3.5a8.5 8.5 0 0 1 0 17z\" fill=\"currentColor\" stroke=\"none\"/>", 15),
|
|
707
|
+
close: I("<path d=\"M6 9l6 6 6-6\"/>", 16),
|
|
708
|
+
read: I("<path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>"),
|
|
709
|
+
list: I("<path d=\"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01\"/>"),
|
|
710
|
+
write: I("<path d=\"M4 20h4L19 9l-4-4L4 16z\"/>", 14, " style=\"color:var(--os-accent-text)\""),
|
|
711
|
+
done: I("<path d=\"M5 12l5 5 9-10\"/>", 14, " style=\"color:var(--os-add)\" stroke-width=\"2.4\""),
|
|
712
|
+
error: I("<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v6M12 16.5v.5\"/>", 14),
|
|
713
|
+
keep: I("<path d=\"M12 4v12M6 10l6 6 6-6M5 20h14\"/>", 14),
|
|
714
|
+
undo: I("<path d=\"M9 14L4 9l5-5\"/><path d=\"M4 9h10a6 6 0 0 1 0 12h-3\"/>", 14),
|
|
715
|
+
more: I("<path d=\"M6 9l6 6 6-6\"/>", 12),
|
|
716
|
+
dots: I("<circle cx=\"5\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"19\" cy=\"12\" r=\"1.6\" fill=\"currentColor\" stroke=\"none\"/>", 14),
|
|
717
|
+
back: I("<path d=\"M15 6l-6 6 6 6\"/>", 16),
|
|
718
|
+
next: I("<path d=\"M9 6l6 6-6 6\"/>", 14),
|
|
719
|
+
export: I("<path d=\"M12 15V4M7 9l5-5 5 5M5 14v5h14v-5\"/>", 14),
|
|
720
|
+
skills: I("<path d=\"M4 5a2 2 0 0 1 2-2h13v15H6a2 2 0 0 0-2 2z\"/><path d=\"M4 20a2 2 0 0 0 2 2h13v-4\"/>", 14),
|
|
721
|
+
preset: I("<path d=\"M13 3L5 14h6l-1 7 8-11h-6z\"/>", 14),
|
|
722
|
+
settings: I("<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z\"/>", 14),
|
|
723
|
+
hide: I("<path d=\"M3 3l18 18\"/><path d=\"M10.6 5.1A10 10 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4.1M6.6 6.6C3.9 8.4 2 12 2 12s3.5 7 10 7a9.7 9.7 0 0 0 5.4-1.6\"/><path d=\"M9.9 9.9a3 3 0 0 0 4.2 4.2\"/>", 14),
|
|
724
|
+
show: I("<path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>", 14),
|
|
725
|
+
edit: I("<path d=\"M4 20h4L19 9l-4-4L4 16z\"/>", 14),
|
|
726
|
+
trash: I("<path d=\"M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3\"/>", 14),
|
|
727
|
+
plus: I("<path d=\"M12 5v14M5 12h14\"/>", 14),
|
|
728
|
+
layers: I("<path d=\"M12 3l9 5-9 5-9-5z\"/><path d=\"M3 13l9 5 9-5\"/>", 12),
|
|
729
|
+
original: I("<path d=\"M14 3H6v18h12V7z\"/><path d=\"M14 3v4h4\"/>", 14),
|
|
730
|
+
send: I("<path d=\"m5 12 7-7 7 7\"/><path d=\"M12 19V5\"/>", 18),
|
|
731
|
+
queue: I("<path d=\"M11 12H3\"/><path d=\"M16 6H3\"/><path d=\"M16 18H3\"/><path d=\"M18 9v6\"/><path d=\"M21 12h-6\"/>", 17),
|
|
732
|
+
pinComment: I("<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/><path d=\"M12 7v6\"/><path d=\"M9 10h6\"/>", 16),
|
|
733
|
+
takes: I("<path d=\"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z\"/><path d=\"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65\"/><path d=\"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65\"/>", 16),
|
|
734
|
+
stop: I("<rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" fill=\"currentColor\"/>", 16),
|
|
735
|
+
x: I("<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>", 12),
|
|
736
|
+
element: I("<path d=\"M3 7V5a2 2 0 0 1 2-2h2\"/><path d=\"M17 3h2a2 2 0 0 1 2 2v2\"/><path d=\"M21 17v2a2 2 0 0 1-2 2h-2\"/><path d=\"M7 21H5a2 2 0 0 1-2-2v-2\"/>", 12),
|
|
737
|
+
commentChip: I("<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/>", 12),
|
|
738
|
+
comment: I("<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/>", 14),
|
|
739
|
+
mouse: I("<rect x=\"6\" y=\"3\" width=\"12\" height=\"18\" rx=\"6\"/><path d=\"M12 3v6\"/><path d=\"M12 3a6 6 0 0 0-6 6h6z\" fill=\"currentColor\" stroke=\"none\"/>", 14)
|
|
740
740
|
};
|
|
741
741
|
// src/frames.ts
|
|
742
|
-
function
|
|
742
|
+
function ft(e, t) {
|
|
743
743
|
let n = [];
|
|
744
744
|
for (let r of e.entries) {
|
|
745
745
|
if (r.who !== "person" || t.has(r.id)) continue;
|
|
@@ -750,12 +750,12 @@ function dt(e, t) {
|
|
|
750
750
|
queued: a,
|
|
751
751
|
takes: o,
|
|
752
752
|
selected: (r.selection ?? []).map((e) => e.src).filter(Boolean),
|
|
753
|
-
step:
|
|
753
|
+
step: pt(r.steps, r.kind === "takes")
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
return n;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function pt(e, t) {
|
|
759
759
|
let n = e?.at(-1);
|
|
760
760
|
if (!n) return "Working…";
|
|
761
761
|
if (n.tool === "src_read") return `Reading ${i(n.path)}`;
|
|
@@ -763,41 +763,41 @@ function ft(e, t) {
|
|
|
763
763
|
let r = t && n.take ? ` · ${u(n.take)}` : "";
|
|
764
764
|
return `Editing ${i(n.path)}${r}`;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function mt(e, t, n) {
|
|
767
767
|
let r = t.find((e) => e.id === n);
|
|
768
768
|
return r ? r.of === e : n.startsWith(`${e}-`);
|
|
769
769
|
}
|
|
770
|
-
var
|
|
771
|
-
function
|
|
772
|
-
return n.find((n) =>
|
|
770
|
+
var R = (e) => e.showing ?? (e.shown ? [e.shown] : []);
|
|
771
|
+
function ht(e, t, n) {
|
|
772
|
+
return n.find((n) => mt(e, t, n)) ?? "";
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function gt(e, t, n, r) {
|
|
775
775
|
let i = {
|
|
776
776
|
stamps: [],
|
|
777
777
|
selectors: []
|
|
778
778
|
}, a = {
|
|
779
779
|
stamps: [],
|
|
780
780
|
selectors: []
|
|
781
|
-
}, o =
|
|
781
|
+
}, o = ht(e, t, r);
|
|
782
782
|
for (let r of n?.groups ?? []) {
|
|
783
|
-
let n = r.takes.filter((n) =>
|
|
784
|
-
n.length !== 0 && (
|
|
783
|
+
let n = r.takes.filter((n) => mt(e, t, n));
|
|
784
|
+
n.length !== 0 && (z(i, r), o && n.includes(o) && z(a, r));
|
|
785
785
|
}
|
|
786
786
|
return {
|
|
787
787
|
all: i,
|
|
788
788
|
strong: a
|
|
789
789
|
};
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function z(e, t) {
|
|
792
792
|
for (let n of t.stamps ?? []) e.stamps.includes(n) || e.stamps.push(n);
|
|
793
793
|
for (let n of t.selectors ?? []) e.selectors.includes(n) || e.selectors.push(n);
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function _t(e, t) {
|
|
796
796
|
if (t === "") return "";
|
|
797
797
|
let n = e.filter((e) => !e.running && !e.queued);
|
|
798
798
|
return t && n.some((e) => e.run === t) ? t : e.findLast((e) => !e.queued)?.running ? "" : n.at(-1)?.run ?? "";
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function vt(e, t, n) {
|
|
801
801
|
let r = Math.max(8, Math.min(e.left, n.w - t.w - 8)), i = e.top - 8 - t.h;
|
|
802
802
|
if (i >= 8) return {
|
|
803
803
|
left: r,
|
|
@@ -827,7 +827,7 @@ function _t(e, t, n) {
|
|
|
827
827
|
side: "inside"
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function yt(e, t, n) {
|
|
831
831
|
let r = { ...e }, i = (e) => r.left < e.left + e.width && r.left + r.width > e.left && r.top < e.top + e.height && r.top + r.height > e.top;
|
|
832
832
|
for (let a = 0; a < 12; a++) {
|
|
833
833
|
let a = t.find(i);
|
|
@@ -836,11 +836,11 @@ function vt(e, t, n) {
|
|
|
836
836
|
}
|
|
837
837
|
return r;
|
|
838
838
|
}
|
|
839
|
-
var
|
|
840
|
-
function
|
|
839
|
+
var B = (e, t) => e.left < t.left + t.width && e.left + e.width > t.left && e.top < t.top + t.height && e.top + e.height > t.top, bt = (e, t) => e.left <= t.left && e.top <= t.top && e.left + e.width >= t.left + t.width && e.top + e.height >= t.top + t.height, xt = (e, t) => Math.max(0, t.left - (e.left + e.width), e.left - (t.left + t.width)) + Math.max(0, t.top - (e.top + e.height), e.top - (t.top + t.height));
|
|
840
|
+
function St(e, t) {
|
|
841
841
|
let n = [];
|
|
842
842
|
return e.map((r, i) => {
|
|
843
|
-
let { anchor: a, size: o } = r, s = e.flatMap((e, t) => t === i ? [] : e.own), c = s.filter((e) =>
|
|
843
|
+
let { anchor: a, size: o } = r, s = e.flatMap((e, t) => t === i ? [] : e.own), c = s.filter((e) => bt(e, a)), l = s.filter((e) => !bt(e, a)), u = (e, n) => ({
|
|
844
844
|
left: Math.max(4, Math.min(e, t.w - o.w - 4)),
|
|
845
845
|
top: Math.max(4, Math.min(n, t.h - o.h - 4)),
|
|
846
846
|
width: o.w,
|
|
@@ -856,33 +856,33 @@ function xt(e, t) {
|
|
|
856
856
|
d.push(u(a.left + a.width - 4 - o.w, a.top + a.height - 4 - o.h));
|
|
857
857
|
let m = null, h = 1e400;
|
|
858
858
|
for (let [e, t] of d.entries()) {
|
|
859
|
-
if (n.some((e) =>
|
|
860
|
-
let i = (r.own.some((e) =>
|
|
859
|
+
if (n.some((e) => B(t, e))) continue;
|
|
860
|
+
let i = (r.own.some((e) => B(t, e)) ? 1e3 : 0) + 100 * l.filter((e) => B(t, e)).length + 20 * c.filter((e) => B(t, e)).length + xt(t, a) + e / 1e3;
|
|
861
861
|
i < h && (m = t, h = i);
|
|
862
862
|
}
|
|
863
|
-
let g = m ??
|
|
863
|
+
let g = m ?? yt(d[0], n, t);
|
|
864
864
|
return n.push(g), g;
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function V(e, t, n, r) {
|
|
868
868
|
return t.find((e) => n.includes(e.id)) ?? t.find((t) => t.id === r.get(e)) ?? t[0];
|
|
869
869
|
}
|
|
870
|
-
var
|
|
871
|
-
function
|
|
872
|
-
return
|
|
870
|
+
var Ct = (e, t) => !e.some((e) => t.includes(e.id));
|
|
871
|
+
function wt(e) {
|
|
872
|
+
return A("div", {
|
|
873
873
|
class: "frametag",
|
|
874
874
|
"data-frametag": e.run,
|
|
875
875
|
role: "status"
|
|
876
|
-
},
|
|
876
|
+
}, A("span", {
|
|
877
877
|
class: "spin",
|
|
878
878
|
"aria-hidden": "true"
|
|
879
|
-
}),
|
|
879
|
+
}), A("span", null, e.step));
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
return
|
|
881
|
+
function Tt(e, t) {
|
|
882
|
+
return A("div", {
|
|
883
883
|
class: "framequeue",
|
|
884
884
|
"data-framequeue": e.run
|
|
885
|
-
},
|
|
885
|
+
}, A("span", null, d(e.queued - 1)), A("button", {
|
|
886
886
|
type: "button",
|
|
887
887
|
"aria-label": "Cancel this ask. It has not started.",
|
|
888
888
|
title: "Cancel this ask. It has not started.",
|
|
@@ -893,9 +893,9 @@ function wt(e, t) {
|
|
|
893
893
|
} }
|
|
894
894
|
}, "×"));
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function Et(e, t) {
|
|
897
897
|
let n = f(e.takes.map((e) => e.no));
|
|
898
|
-
return
|
|
898
|
+
return A("button", {
|
|
899
899
|
class: "framefold",
|
|
900
900
|
type: "button",
|
|
901
901
|
"aria-label": `Open the bar of ${n}`,
|
|
@@ -905,10 +905,10 @@ function Tt(e, t) {
|
|
|
905
905
|
on: { click: (n) => {
|
|
906
906
|
n.stopPropagation(), t.openFrame(e.run);
|
|
907
907
|
} }
|
|
908
|
-
}, n,
|
|
908
|
+
}, n, j(L.more));
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
910
|
+
function Dt(e, t, n, r) {
|
|
911
|
+
return A("div", {
|
|
912
912
|
class: "framebar",
|
|
913
913
|
role: "toolbar",
|
|
914
914
|
tabindex: 0,
|
|
@@ -916,10 +916,10 @@ function Et(e, t, n, r) {
|
|
|
916
916
|
"data-framebar": e.run,
|
|
917
917
|
"aria-busy": n ? "true" : null,
|
|
918
918
|
"data-fkey": `bar:${e.run}`
|
|
919
|
-
},
|
|
919
|
+
}, A("span", {
|
|
920
920
|
class: "framemark",
|
|
921
921
|
"aria-hidden": "true"
|
|
922
|
-
},
|
|
922
|
+
}, j(F(14, 3.2))), Ot(e.run, e.takes, t, r, `f:${e.run}`), A("button", {
|
|
923
923
|
class: "btn ghost icon",
|
|
924
924
|
type: "button",
|
|
925
925
|
"aria-label": "Hide this frame. The takes stay open.",
|
|
@@ -929,9 +929,9 @@ function Et(e, t, n, r) {
|
|
|
929
929
|
on: { click: () => r.hideFrame(e.run) }
|
|
930
930
|
}, "×"));
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
let a =
|
|
934
|
-
return c.append(
|
|
932
|
+
function Ot(e, t, n, r, i) {
|
|
933
|
+
let a = V(e, t, n.showing, n.picked), o = Ct(t, n.showing), s = !o && a ? ee(a, n.all, n.asks) : null, c = document.createDocumentFragment();
|
|
934
|
+
return c.append(A("button", {
|
|
935
935
|
class: "btn origin",
|
|
936
936
|
type: "button",
|
|
937
937
|
"aria-pressed": String(o),
|
|
@@ -939,11 +939,11 @@ function Dt(e, t, n, r, i) {
|
|
|
939
939
|
"data-fkey": `orig:${i}`,
|
|
940
940
|
"data-original": "",
|
|
941
941
|
on: { click: () => r.toggleOriginal(e) }
|
|
942
|
-
}, "Original"),
|
|
942
|
+
}, "Original"), A("div", {
|
|
943
943
|
class: `seg${o ? " dim" : ""}`,
|
|
944
944
|
role: "group",
|
|
945
945
|
"aria-label": "Takes"
|
|
946
|
-
}, t.map((e) =>
|
|
946
|
+
}, t.map((e) => A("button", {
|
|
947
947
|
type: "button",
|
|
948
948
|
...e.stale?.length ? { class: "stale" } : {},
|
|
949
949
|
"aria-pressed": String(e.id === a?.id),
|
|
@@ -956,18 +956,18 @@ function Dt(e, t, n, r, i) {
|
|
|
956
956
|
"data-fkey": `seg:${i}:${e.id}`,
|
|
957
957
|
"data-take": e.id,
|
|
958
958
|
on: { click: () => r.show(e.id) }
|
|
959
|
-
}, String(e.no)))), ...s ? [
|
|
959
|
+
}, String(e.no)))), ...s ? [A("span", {
|
|
960
960
|
class: "covered",
|
|
961
961
|
title: s.title,
|
|
962
962
|
"data-covered": ""
|
|
963
|
-
},
|
|
963
|
+
}, j(L.layers), s.text)] : [], ...a?.stale?.length ? [A("button", {
|
|
964
964
|
class: "btn ghost",
|
|
965
965
|
type: "button",
|
|
966
966
|
title: `Ask again on the new code. ${u(a.no)} was made on an older version of ${_(a.stale)}.`,
|
|
967
967
|
"data-fkey": `again:${i}`,
|
|
968
968
|
"data-frame-again": "",
|
|
969
969
|
on: { click: () => r.again(a) }
|
|
970
|
-
}, "Ask again")] : [],
|
|
970
|
+
}, "Ask again")] : [], A("button", {
|
|
971
971
|
class: "btn ghost",
|
|
972
972
|
type: "button",
|
|
973
973
|
"aria-disabled": a ? null : "true",
|
|
@@ -975,7 +975,7 @@ function Dt(e, t, n, r, i) {
|
|
|
975
975
|
"data-fkey": `skip:${i}`,
|
|
976
976
|
"data-frame-skip": "",
|
|
977
977
|
on: { click: () => a && r.skip(a) }
|
|
978
|
-
}, "Skip"),
|
|
978
|
+
}, "Skip"), A("button", {
|
|
979
979
|
class: "btn primary",
|
|
980
980
|
type: "button",
|
|
981
981
|
"aria-disabled": a ? null : "true",
|
|
@@ -985,14 +985,14 @@ function Dt(e, t, n, r, i) {
|
|
|
985
985
|
on: { click: () => a && r.keep(a) }
|
|
986
986
|
}, a && t.length > 1 ? `Keep ${a.no}` : "Keep")), c;
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function kt(e, t, n) {
|
|
989
989
|
if (e.queued) return;
|
|
990
|
-
let r =
|
|
990
|
+
let r = V(e.run, e.takes, t, n);
|
|
991
991
|
return r?.note ? r : void 0;
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function At(e, t, n, r) {
|
|
994
994
|
let i = u(t.no);
|
|
995
|
-
return
|
|
995
|
+
return A("button", {
|
|
996
996
|
class: `notepin${n ? " on" : ""}`,
|
|
997
997
|
type: "button",
|
|
998
998
|
"aria-label": `Note on ${i}`,
|
|
@@ -1003,17 +1003,17 @@ function kt(e, t, n, r) {
|
|
|
1003
1003
|
on: { click: (e) => {
|
|
1004
1004
|
e.stopPropagation(), r();
|
|
1005
1005
|
} }
|
|
1006
|
-
},
|
|
1006
|
+
}, j(L.comment));
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return
|
|
1008
|
+
function jt(e, t) {
|
|
1009
|
+
return A("div", {
|
|
1010
1010
|
class: "popover notecard",
|
|
1011
1011
|
role: "dialog",
|
|
1012
1012
|
"aria-label": `Note on ${u(t.no)}`,
|
|
1013
1013
|
"data-notecard": e.run
|
|
1014
|
-
},
|
|
1014
|
+
}, A("div", { class: "notehead" }, p(t, !0)), A("div", { class: "text" }, t.note ?? ""));
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1016
|
+
function Mt(e, t, n, r = 24) {
|
|
1017
1017
|
let i = r / 2, a = (e, t) => ({
|
|
1018
1018
|
left: Math.max(4, Math.min(e, n.w - r - 4)),
|
|
1019
1019
|
top: Math.max(4, Math.min(t, n.h - r - 4)),
|
|
@@ -1025,9 +1025,9 @@ function jt(e, t, n, r = 24) {
|
|
|
1025
1025
|
a(o - i, s - i),
|
|
1026
1026
|
a(o - i, e.top - i)
|
|
1027
1027
|
];
|
|
1028
|
-
return c.find((e) => !t.some((t) =>
|
|
1028
|
+
return c.find((e) => !t.some((t) => B(e, t))) ?? yt(c[0], t, n);
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function Nt(e, t, n, r) {
|
|
1031
1031
|
let i = Math.max(8, Math.min(e.left, n.w - t.w - 8));
|
|
1032
1032
|
r && i + t.w > r.left && i < r.left + r.width && (i = Math.max(8, r.left - t.w - 8));
|
|
1033
1033
|
let a = e.top + e.height + 4, o = e.top - 4 - t.h, s = a + t.h <= n.h - 8 || o < 8 ? a : o;
|
|
@@ -1037,7 +1037,7 @@ function Mt(e, t, n, r) {
|
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
1039
|
// src/styles.ts
|
|
1040
|
-
var
|
|
1040
|
+
var Pt = {
|
|
1041
1041
|
panel: "#17181b",
|
|
1042
1042
|
surface: "#1f2024",
|
|
1043
1043
|
soft: "#1b1c20",
|
|
@@ -1062,7 +1062,7 @@ var Nt = {
|
|
|
1062
1062
|
shadow: "0 24px 60px rgba(0,0,0,.6)",
|
|
1063
1063
|
"shadow-sm": "0 1px 2px rgba(0,0,0,.4)",
|
|
1064
1064
|
"shadow-md": "0 8px 24px rgba(0,0,0,.45)"
|
|
1065
|
-
},
|
|
1065
|
+
}, Ft = {
|
|
1066
1066
|
panel: "#f7f7f6",
|
|
1067
1067
|
surface: "#ffffff",
|
|
1068
1068
|
soft: "#f1f1ef",
|
|
@@ -1087,7 +1087,7 @@ var Nt = {
|
|
|
1087
1087
|
shadow: "0 24px 60px rgba(17,18,20,.18)",
|
|
1088
1088
|
"shadow-sm": "0 1px 2px rgba(17,18,20,.14)",
|
|
1089
1089
|
"shadow-md": "0 8px 24px rgba(17,18,20,.16)"
|
|
1090
|
-
},
|
|
1090
|
+
}, It = (e) => Object.entries(e).map(([e, t]) => `--os-${e}:${t};`).join(""), H = "cubic-bezier(.2,.8,.2,1)", U = {
|
|
1091
1091
|
panel: 180,
|
|
1092
1092
|
step: 140,
|
|
1093
1093
|
flash: 720,
|
|
@@ -1098,33 +1098,33 @@ var Nt = {
|
|
|
1098
1098
|
tip: 140,
|
|
1099
1099
|
stillFlash: 900,
|
|
1100
1100
|
ants: 900
|
|
1101
|
-
},
|
|
1101
|
+
}, W = "Inter, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif", G = "\"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", Lt = `
|
|
1102
1102
|
:host { all: initial; }
|
|
1103
|
-
:host([data-scheme="dark"]), .page[data-scheme="dark"] { ${
|
|
1104
|
-
:host([data-scheme="light"]), .page[data-scheme="light"] { ${Ft
|
|
1103
|
+
:host([data-scheme="dark"]), .page[data-scheme="dark"] { ${It(Pt)} }
|
|
1104
|
+
:host([data-scheme="light"]), .page[data-scheme="light"] { ${It(Ft)} }
|
|
1105
1105
|
*, *::before, *::after { box-sizing: border-box; }
|
|
1106
|
-
.ui, .page { font-family: ${
|
|
1107
|
-
.mono { font-family: ${
|
|
1106
|
+
.ui, .page { font-family: ${W}; color: var(--os-ink); -webkit-font-smoothing: antialiased; font-size: 13px; line-height: 1.4; }
|
|
1107
|
+
.mono { font-family: ${G}; }
|
|
1108
1108
|
button { font: inherit; color: inherit; }
|
|
1109
1109
|
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
1110
1110
|
[hidden] { display: none !important; }
|
|
1111
1111
|
|
|
1112
1112
|
/* Buttons */
|
|
1113
1113
|
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 8px;
|
|
1114
|
-
border: 1px solid var(--os-line); background: var(--os-surface); color: var(--os-ink); font: 500 13px/1 ${
|
|
1114
|
+
border: 1px solid var(--os-line); background: var(--os-surface); color: var(--os-ink); font: 500 13px/1 ${W}; cursor: pointer;
|
|
1115
1115
|
white-space: nowrap; flex: 0 0 auto;
|
|
1116
|
-
transition: background-color .12s ${
|
|
1116
|
+
transition: background-color .12s ${H}, border-color .12s ${H}, color .12s ${H}, transform ${U.press}ms ${H}; }
|
|
1117
1117
|
.btn:hover { background: var(--os-hover); }
|
|
1118
1118
|
.btn:active { transform: scale(.96); }
|
|
1119
1119
|
.btn:disabled { opacity: .5; cursor: default; transform: none; }
|
|
1120
1120
|
.btn[aria-pressed="true"] { background: var(--os-ink); border-color: var(--os-ink); color: var(--os-panel); }
|
|
1121
|
-
.btn .key { font-family: ${
|
|
1121
|
+
.btn .key { font-family: ${G}; opacity: .65; font-size: 11px; }
|
|
1122
1122
|
.primary { background: var(--os-accent); border-color: var(--os-accent); color: var(--os-on-accent); font-weight: 600; }
|
|
1123
1123
|
.primary:hover { background: var(--os-accent-hover); border-color: var(--os-accent-hover); }
|
|
1124
1124
|
.ghost { border-color: transparent; background: transparent; }
|
|
1125
1125
|
.ghost:hover { background: var(--os-hover); }
|
|
1126
1126
|
.icon { width: 36px; padding: 0; }
|
|
1127
|
-
.link { border: 0; background: none; padding: 0; color: var(--os-accent-text); font: 500 12px/1.4 ${
|
|
1127
|
+
.link { border: 0; background: none; padding: 0; color: var(--os-accent-text); font: 500 12px/1.4 ${W}; cursor: pointer; }
|
|
1128
1128
|
.link:hover { text-decoration: underline; }
|
|
1129
1129
|
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible, .link:focus-visible, .altlabel:focus-visible,
|
|
1130
1130
|
.menu button:focus-visible, .cpin:focus-visible, .row:focus-visible, textarea:focus-visible, .check input:focus-visible, .grip:focus-visible {
|
|
@@ -1133,13 +1133,13 @@ button { font: inherit; color: inherit; }
|
|
|
1133
1133
|
/* Tabs and segmented controls */
|
|
1134
1134
|
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--os-seg); }
|
|
1135
1135
|
.tab { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--os-muted);
|
|
1136
|
-
font: 500 13px/1 ${
|
|
1136
|
+
font: 500 13px/1 ${W}; cursor: pointer; white-space: nowrap; transition: background-color .12s ${H}, color .12s ${H}; }
|
|
1137
1137
|
.tab:hover { color: var(--os-ink); }
|
|
1138
1138
|
.tab[aria-selected="true"] { background: var(--os-surface); color: var(--os-ink); box-shadow: var(--os-shadow-sm); }
|
|
1139
1139
|
.tab .count { color: var(--os-accent-text); margin-left: 4px; }
|
|
1140
1140
|
.seg { display: flex; flex-wrap: nowrap; padding: 3px; gap: 2px; border-radius: 9px; background: var(--os-seg); min-width: 0; }
|
|
1141
1141
|
.seg button { flex: 1 0 auto; min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--os-muted);
|
|
1142
|
-
font: 500 12.5px/1 ${
|
|
1142
|
+
font: 500 12.5px/1 ${W}; cursor: pointer; white-space: nowrap; transition: background-color .14s ${H}, color .14s ${H}; }
|
|
1143
1143
|
.seg button:hover { color: var(--os-ink); }
|
|
1144
1144
|
.seg button[aria-pressed="true"] { background: var(--os-surface); color: var(--os-ink); box-shadow: var(--os-shadow-sm); }
|
|
1145
1145
|
.seg button:disabled { cursor: default; opacity: .6; }
|
|
@@ -1147,39 +1147,39 @@ button { font: inherit; color: inherit; }
|
|
|
1147
1147
|
|
|
1148
1148
|
/* Chips */
|
|
1149
1149
|
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 5px; background: var(--os-chip-bg);
|
|
1150
|
-
color: var(--os-chip-ink); font: 500 11.5px/1 ${
|
|
1150
|
+
color: var(--os-chip-ink); font: 500 11.5px/1 ${G}; white-space: nowrap; max-width: 100%; }
|
|
1151
1151
|
.chip > span { overflow: hidden; text-overflow: ellipsis; }
|
|
1152
|
-
.chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font: 600 13px/1 ${
|
|
1152
|
+
.chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font: 600 13px/1 ${W}; cursor: pointer; opacity: .7; }
|
|
1153
1153
|
.chip button:hover { opacity: 1; }
|
|
1154
1154
|
.chip-dark { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 5px; background: rgba(255,255,255,.12);
|
|
1155
|
-
color: var(--os-on-bubble); font: 500 11px/1 ${
|
|
1155
|
+
color: var(--os-on-bubble); font: 500 11px/1 ${G}; }
|
|
1156
1156
|
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
1157
1157
|
|
|
1158
1158
|
/* The mover holds the dock and the panel. A drag moves it with a transform;
|
|
1159
1159
|
the code sets each box's place for the anchor (dock.ts). */
|
|
1160
1160
|
.mover { position: fixed; inset: 0; pointer-events: none; }
|
|
1161
1161
|
.mover.dragging, .mover.dragging * { cursor: grabbing !important; }
|
|
1162
|
-
.snapping { transition: transform ${
|
|
1162
|
+
.snapping { transition: transform ${U.snap}ms ${H} !important; }
|
|
1163
1163
|
.snaphint { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 1.5px dashed var(--os-accent); background: var(--os-mark-tint);
|
|
1164
|
-
pointer-events: none; opacity: .8; animation: os-fade ${
|
|
1164
|
+
pointer-events: none; opacity: .8; animation: os-fade ${U.alt}ms ${H}; }
|
|
1165
1165
|
|
|
1166
1166
|
/* Dock */
|
|
1167
1167
|
.dock { position: fixed; display: inline-flex; touch-action: none; user-select: none; -webkit-user-select: none; align-items: center; justify-content: center; width: 48px; height: 48px;
|
|
1168
1168
|
padding: 0; border-radius: 50%; border: 1px solid var(--os-line); background: var(--os-panel); cursor: pointer; box-shadow: var(--os-shadow);
|
|
1169
|
-
transition: transform .12s ${
|
|
1169
|
+
transition: transform .12s ${H}, background-color .2s ${H}, border-color .2s ${H}; pointer-events: auto; }
|
|
1170
1170
|
.dock:hover { transform: scale(1.06); }
|
|
1171
1171
|
.dock:active { transform: scale(.96); }
|
|
1172
1172
|
.dock:focus-visible { outline: 2px solid var(--os-accent); outline-offset: 3px; }
|
|
1173
1173
|
.dock .badge { position: absolute; top: -4px; right: -4px; display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
|
|
1174
1174
|
height: 20px; padding: 0 5px; border-radius: 10px; background: var(--os-accent); color: var(--os-on-accent); border: 2px solid var(--os-panel);
|
|
1175
|
-
font: 700 11px/1 ${
|
|
1176
|
-
.dotpulse { transform-origin: center; transform-box: fill-box; animation: os-dotpulse 1.4s ${
|
|
1175
|
+
font: 700 11px/1 ${W}; }
|
|
1176
|
+
.dotpulse { transform-origin: center; transform-box: fill-box; animation: os-dotpulse 1.4s ${H} infinite; }
|
|
1177
1177
|
|
|
1178
1178
|
/* The menu button on the dock's corner: it shows on hover or focus, and stays a moment so the pointer can reach it */
|
|
1179
1179
|
.dockmore { position: fixed; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
|
|
1180
1180
|
border-radius: 50%; border: 1px solid var(--os-line); background: var(--os-panel); color: var(--os-ink); cursor: pointer;
|
|
1181
1181
|
box-shadow: var(--os-shadow-sm); pointer-events: auto; opacity: 0; visibility: hidden;
|
|
1182
|
-
transition: opacity ${
|
|
1182
|
+
transition: opacity ${U.tip}ms ${H}, visibility 0s linear 400ms; }
|
|
1183
1183
|
.dock:hover + .dockmore, .dock:focus-visible + .dockmore, .dockmore:hover, .dockmore:focus-visible, .dockmore[aria-expanded="true"] {
|
|
1184
1184
|
opacity: 1; visibility: visible; transition-delay: 0s; }
|
|
1185
1185
|
.dockmore:hover { background: var(--os-surface); }
|
|
@@ -1188,20 +1188,20 @@ button { font: inherit; color: inherit; }
|
|
|
1188
1188
|
/* The menu on the Onsite button (menu.ts): a root list, and Skills, Presets and Settings as sections */
|
|
1189
1189
|
.smenu { position: fixed; display: flex; flex-direction: column; border-radius: 12px; background: var(--os-panel); border: 1px solid var(--os-line);
|
|
1190
1190
|
box-shadow: var(--os-shadow); color: var(--os-ink); overflow: hidden; pointer-events: auto; }
|
|
1191
|
-
.smenu.opening { animation: os-pop ${
|
|
1191
|
+
.smenu.opening { animation: os-pop ${U.panel}ms ${H}; }
|
|
1192
1192
|
.mover[data-row="top"] ~ .smenu.opening { animation-name: os-drop; }
|
|
1193
|
-
.mbrand { display: flex; align-items: center; gap: 7px; padding: 12px 14px 6px; font: 700 13px/1 ${
|
|
1193
|
+
.mbrand { display: flex; align-items: center; gap: 7px; padding: 12px 14px 6px; font: 700 13px/1 ${W}; letter-spacing: -.01em; }
|
|
1194
1194
|
.mbrand .mhint { margin-left: auto; font-weight: 500; }
|
|
1195
1195
|
.mlist { display: flex; flex-direction: column; padding: 4px 6px 6px; }
|
|
1196
1196
|
.mitem { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
|
|
1197
|
-
color: var(--os-ink); font: 500 13px/1 ${
|
|
1197
|
+
color: var(--os-ink); font: 500 13px/1 ${W}; cursor: pointer; text-align: left; }
|
|
1198
1198
|
.mitem:hover, .mitem:focus-visible { background: var(--os-hover); }
|
|
1199
1199
|
.mitem svg { flex: 0 0 auto; color: var(--os-muted); }
|
|
1200
1200
|
.mitem .grow { flex-grow: 1; }
|
|
1201
|
-
.mhint { font: 500 11.5px/1.3 ${
|
|
1201
|
+
.mhint { font: 500 11.5px/1.3 ${W}; color: var(--os-muted); }
|
|
1202
1202
|
.msep { height: 1px; margin: 4px 8px; background: var(--os-line); }
|
|
1203
1203
|
.mhead { display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 6px; border-bottom: 1px solid var(--os-line); }
|
|
1204
|
-
.mhead h2 { margin: 0; font: 600 13.5px/1 ${
|
|
1204
|
+
.mhead h2 { margin: 0; font: 600 13.5px/1 ${W}; }
|
|
1205
1205
|
.mhead .icon { width: 32px; min-height: 32px; }
|
|
1206
1206
|
.sbody { display: flex; flex-direction: column; gap: 14px; padding: 12px 14px 14px; overflow-y: auto; min-height: 0; }
|
|
1207
1207
|
.mnote { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--os-muted); }
|
|
@@ -1214,24 +1214,24 @@ button { font: inherit; color: inherit; }
|
|
|
1214
1214
|
.mrow .grow { flex-grow: 1; min-width: 0; }
|
|
1215
1215
|
.mrow .icon { width: 30px; min-height: 30px; color: var(--os-muted); }
|
|
1216
1216
|
.mrow .danger { min-height: 30px; padding: 0 8px; color: var(--os-del); font-size: 12px; }
|
|
1217
|
-
.mname { display: block; font: 600 12.5px/1.3 ${
|
|
1217
|
+
.mname { display: block; font: 600 12.5px/1.3 ${W}; color: var(--os-ink); }
|
|
1218
1218
|
.mname .mhint { margin-left: 6px; white-space: nowrap; }
|
|
1219
|
-
.mname.mono { font: 600 12px/1.3 ${
|
|
1219
|
+
.mname.mono { font: 600 12px/1.3 ${G}; }
|
|
1220
1220
|
.mdesc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 12px; line-height: 17px;
|
|
1221
1221
|
color: var(--os-muted); }
|
|
1222
1222
|
.mrun { display: flex; flex-direction: column; align-items: stretch; flex-grow: 1; min-width: 0; padding: 2px; border: 0; border-radius: 6px; background: none;
|
|
1223
1223
|
color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
1224
1224
|
.mrun:hover .mname { color: var(--os-accent-text); }
|
|
1225
1225
|
.switch { position: relative; flex: 0 0 auto; width: 32px; height: 18px; padding: 0; border: 0; border-radius: 9px; background: var(--os-seg); cursor: pointer;
|
|
1226
|
-
box-shadow: inset 0 0 0 1px var(--os-line); transition: background-color .14s ${
|
|
1226
|
+
box-shadow: inset 0 0 0 1px var(--os-line); transition: background-color .14s ${H}; }
|
|
1227
1227
|
.switch .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--os-surface);
|
|
1228
|
-
box-shadow: var(--os-shadow-sm); transition: transform .14s ${
|
|
1228
|
+
box-shadow: var(--os-shadow-sm); transition: transform .14s ${H}; }
|
|
1229
1229
|
.switch[aria-checked="true"] { background: var(--os-accent); box-shadow: none; }
|
|
1230
1230
|
.switch[aria-checked="true"] .knob { transform: translateX(14px); background: #fff; }
|
|
1231
1231
|
.mform { display: flex; flex-direction: column; gap: 10px; }
|
|
1232
1232
|
.mform label, .mfield { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--os-muted); }
|
|
1233
1233
|
.mform input, .mform textarea, .mset select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--os-line); background: var(--os-surface);
|
|
1234
|
-
color: var(--os-ink); font: 400 13px/1.4 ${
|
|
1234
|
+
color: var(--os-ink); font: 400 13px/1.4 ${W}; outline: none; resize: vertical; }
|
|
1235
1235
|
.mform input:focus-visible, .mform textarea:focus-visible, .mset select:focus-visible { border-color: var(--os-accent); box-shadow: 0 0 0 2px var(--os-mark-tint); }
|
|
1236
1236
|
.mfield .seg { align-self: flex-start; }
|
|
1237
1237
|
.mset { display: flex; flex-direction: column; gap: 6px; }
|
|
@@ -1259,20 +1259,20 @@ button { font: inherit; color: inherit; }
|
|
|
1259
1259
|
/* The dock's tooltip: the shortcuts */
|
|
1260
1260
|
.tip { position: fixed; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 11px; border-radius: 10px; background: var(--os-panel);
|
|
1261
1261
|
border: 1px solid var(--os-line); box-shadow: var(--os-shadow); color: var(--os-ink); pointer-events: none;
|
|
1262
|
-
animation: os-tip ${
|
|
1262
|
+
animation: os-tip ${U.tip}ms ${H}; }
|
|
1263
1263
|
.mover[data-row="top"] .tip { animation-name: os-tip-down; }
|
|
1264
|
-
.tip .brand { display: flex; align-items: center; gap: 7px; font: 700 13px/1 ${
|
|
1264
|
+
.tip .brand { display: flex; align-items: center; gap: 7px; font: 700 13px/1 ${W}; letter-spacing: -.01em; }
|
|
1265
1265
|
.tip dl { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; margin: 0; }
|
|
1266
1266
|
.tip dt { font-size: 12px; color: var(--os-muted); }
|
|
1267
1267
|
.tip dd { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 0; font-size: 11.5px; color: var(--os-muted); white-space: nowrap; }
|
|
1268
1268
|
.tip dd svg { color: var(--os-ink); }
|
|
1269
1269
|
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
|
|
1270
|
-
border: 1px solid var(--os-line); border-bottom-width: 2px; background: var(--os-surface); color: var(--os-ink); font: 500 12px/1 ${
|
|
1270
|
+
border: 1px solid var(--os-line); border-bottom-width: 2px; background: var(--os-surface); color: var(--os-ink); font: 500 12px/1 ${W}; }
|
|
1271
1271
|
|
|
1272
1272
|
/* Panel */
|
|
1273
1273
|
.panel { position: fixed; display: flex; flex-direction: column; border-radius: 14px; background: var(--os-panel); border: 1px solid var(--os-line);
|
|
1274
|
-
box-shadow: var(--os-shadow); overflow: hidden; pointer-events: auto; transition: background-color .2s ${
|
|
1275
|
-
.panel.opening { animation: os-pop ${
|
|
1274
|
+
box-shadow: var(--os-shadow); overflow: hidden; pointer-events: auto; transition: background-color .2s ${H}, border-color .2s ${H}; }
|
|
1275
|
+
.panel.opening { animation: os-pop ${U.panel}ms ${H}; }
|
|
1276
1276
|
.mover[data-row="top"] .panel.opening { animation-name: os-drop; }
|
|
1277
1277
|
.head { display: flex; align-items: center; gap: 6px; padding: 10px 6px 10px 10px; border-bottom: 1px solid var(--os-line); min-width: 0;
|
|
1278
1278
|
cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
|
|
@@ -1300,16 +1300,16 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1300
1300
|
color: var(--os-on-bubble); font-size: 13px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
1301
1301
|
.ask .chips { margin-top: 8px; }
|
|
1302
1302
|
.steps { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
|
|
1303
|
-
.step { display: flex; align-items: center; gap: 8px; min-height: 24px; font: 12px/1.3 ${
|
|
1303
|
+
.step { display: flex; align-items: center; gap: 8px; min-height: 24px; font: 12px/1.3 ${G}; color: var(--os-muted); min-width: 0; }
|
|
1304
1304
|
.step > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1305
1305
|
.step.write { color: var(--os-ink); }
|
|
1306
1306
|
.step svg { flex: 0 0 auto; }
|
|
1307
1307
|
.reply { margin: 0; font-size: 13.5px; line-height: 21px; color: var(--os-ink); overflow-wrap: anywhere; }
|
|
1308
1308
|
.reply p { margin: 0 0 8px; white-space: pre-wrap; }
|
|
1309
1309
|
.reply p:last-child { margin-bottom: 0; }
|
|
1310
|
-
.reply code { font: 12px/1 ${
|
|
1310
|
+
.reply code { font: 12px/1 ${G}; padding: 2px 4px; border-radius: 4px; background: var(--os-seg); }
|
|
1311
1311
|
.reply pre { margin: 0 0 8px; padding: 10px; border-radius: 8px; background: var(--os-soft); border: 1px solid var(--os-line);
|
|
1312
|
-
font: 11.5px/17px ${
|
|
1312
|
+
font: 11.5px/17px ${G}; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
1313
1313
|
.reply pre code { padding: 0; background: none; font: inherit; }
|
|
1314
1314
|
.status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--os-muted); }
|
|
1315
1315
|
.status .qdot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px dashed var(--os-mark); }
|
|
@@ -1320,7 +1320,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1320
1320
|
animation: os-blink 1s steps(1) infinite; }
|
|
1321
1321
|
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--os-line); border-top-color: var(--os-accent);
|
|
1322
1322
|
animation: os-rot .7s linear infinite; }
|
|
1323
|
-
.in { animation: os-in ${
|
|
1323
|
+
.in { animation: os-in ${U.step}ms ${H}; }
|
|
1324
1324
|
|
|
1325
1325
|
/* Changes */
|
|
1326
1326
|
.view { display: flex; flex-direction: column; gap: 16px; }
|
|
@@ -1331,14 +1331,14 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1331
1331
|
.row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
|
|
1332
1332
|
.line { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
1333
1333
|
.line .grow { flex-grow: 1; }
|
|
1334
|
-
.fname { font: 500 12.5px/1.3 ${
|
|
1335
|
-
.fdir { font: 12px/1.3 ${
|
|
1334
|
+
.fname { font: 500 12.5px/1.3 ${G}; color: var(--os-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1335
|
+
.fdir { font: 12px/1.3 ${G}; color: var(--os-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1336
1336
|
.new { font-size: 11px; font-weight: 600; color: var(--os-add); }
|
|
1337
|
-
.add { font: 12px/1 ${
|
|
1338
|
-
.del { font: 12px/1 ${
|
|
1337
|
+
.add { font: 12px/1 ${G}; color: var(--os-add); }
|
|
1338
|
+
.del { font: 12px/1 ${G}; color: var(--os-del); }
|
|
1339
1339
|
.meta { font-size: 12px; color: var(--os-muted); }
|
|
1340
1340
|
.diff { margin: 0; max-height: 220px; overflow: auto; padding: 8px 0; border-radius: 8px; background: var(--os-soft); border: 1px solid var(--os-line);
|
|
1341
|
-
font: 11.5px/17px ${
|
|
1341
|
+
font: 11.5px/17px ${G}; color: var(--os-ink); }
|
|
1342
1342
|
.diff span { display: block; padding: 0 10px; white-space: pre; }
|
|
1343
1343
|
.diff .plus { color: var(--os-add); }
|
|
1344
1344
|
.diff .minus { color: var(--os-del); }
|
|
@@ -1347,7 +1347,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1347
1347
|
background: var(--os-bubble); color: var(--os-on-bubble); font-size: 11px; font-weight: 700; }
|
|
1348
1348
|
.comment { display: flex; gap: 10px; }
|
|
1349
1349
|
.comment .text { font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
|
|
1350
|
-
.comment .where { font: 11.5px/1.3 ${
|
|
1350
|
+
.comment .where { font: 11.5px/1.3 ${G}; color: var(--os-muted); overflow-wrap: anywhere; }
|
|
1351
1351
|
.comment.resolved .text { text-decoration: line-through; color: var(--os-muted); }
|
|
1352
1352
|
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
|
1353
1353
|
|
|
@@ -1357,7 +1357,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1357
1357
|
.check input { margin: 2px 0 0; accent-color: var(--os-accent); }
|
|
1358
1358
|
.check span { overflow-wrap: anywhere; }
|
|
1359
1359
|
.prompt { margin: 0; max-height: 210px; overflow: auto; padding: 12px; border-radius: 8px; background: var(--os-soft); border: 1px solid var(--os-line);
|
|
1360
|
-
color: var(--os-ink); font: 11.5px/17px ${
|
|
1360
|
+
color: var(--os-ink); font: 11.5px/17px ${G}; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
1361
1361
|
.buttons { display: flex; gap: 8px; }
|
|
1362
1362
|
.buttons .grow { flex-grow: 1; }
|
|
1363
1363
|
|
|
@@ -1400,13 +1400,13 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1400
1400
|
.prow { display: flex; align-items: flex-end; gap: 2px; min-width: 0; }
|
|
1401
1401
|
.prow .field { display: flex; flex: 1 1 auto; align-self: center; min-width: 0; }
|
|
1402
1402
|
.pill textarea { display: block; width: 100%; min-height: 32px; max-height: 120px; padding: 6px 0; border: 0; outline: none; resize: none;
|
|
1403
|
-
background: transparent; color: var(--os-ink); font: 400 14px/20px ${
|
|
1403
|
+
background: transparent; color: var(--os-ink); font: 400 14px/20px ${W}; overflow-y: auto; scrollbar-width: thin; }
|
|
1404
1404
|
.pill textarea::placeholder { color: var(--os-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1405
1405
|
.pill textarea:focus-visible { outline: none; }
|
|
1406
1406
|
.tools { display: flex; align-items: center; flex: 0 0 auto; }
|
|
1407
1407
|
.ib { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0;
|
|
1408
1408
|
border-radius: 8px; background: none; color: var(--os-muted); cursor: pointer; flex: 0 0 auto;
|
|
1409
|
-
transition: color .12s ${
|
|
1409
|
+
transition: color .12s ${H}, opacity .12s ${H}, transform ${U.press}ms ${H}; }
|
|
1410
1410
|
.ib:hover { color: var(--os-ink); }
|
|
1411
1411
|
.ib:active { transform: scale(.9); }
|
|
1412
1412
|
.ib:focus-visible { outline: 2px solid var(--os-accent); outline-offset: -1px; color: var(--os-ink); }
|
|
@@ -1416,9 +1416,9 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1416
1416
|
.ib.go[aria-disabled="true"] { color: var(--os-muted); opacity: .55; }
|
|
1417
1417
|
.ib.stop { color: var(--os-ink); }
|
|
1418
1418
|
.ib .tbadge { position: absolute; top: 1px; right: -3px; min-width: 20px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--os-seg);
|
|
1419
|
-
color: var(--os-muted); font: 700 10.5px/16px ${
|
|
1419
|
+
color: var(--os-muted); font: 700 10.5px/16px ${W}; text-align: center; box-shadow: 0 0 0 2px var(--os-surface); pointer-events: none; }
|
|
1420
1420
|
.ib.takes[data-n="2"] .tbadge, .ib.takes[data-n="3"] .tbadge { background: var(--os-accent); color: var(--os-on-accent); }
|
|
1421
|
-
.ib.takes.bump .tbadge { animation: os-bump 220ms ${
|
|
1421
|
+
.ib.takes.bump .tbadge { animation: os-bump 220ms ${H}; }
|
|
1422
1422
|
.pill .chips { gap: 4px; }
|
|
1423
1423
|
.pill .chip { gap: 5px; padding: 0 2px 0 7px; border-radius: 6px; }
|
|
1424
1424
|
.pill .chip > svg { flex: 0 0 auto; opacity: .8; }
|
|
@@ -1437,7 +1437,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1437
1437
|
.quick { position: fixed; pointer-events: none; }
|
|
1438
1438
|
.quick .composer { padding: 0; border: 0; background: none; }
|
|
1439
1439
|
.quick .pbox, .quick .ptab { pointer-events: auto; }
|
|
1440
|
-
.quick.opening { animation: os-dock-down ${
|
|
1440
|
+
.quick.opening { animation: os-dock-down ${U.step}ms ${H}; }
|
|
1441
1441
|
.quick[data-side="above"].opening { animation-name: os-dock-up; }
|
|
1442
1442
|
/* Above the element, the tab sits on the box's bottom edge and touches the frame's top edge. */
|
|
1443
1443
|
.quick[data-side="above"] .pill { flex-direction: column-reverse; }
|
|
@@ -1448,11 +1448,11 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1448
1448
|
|
|
1449
1449
|
/* The tooltip of the composer's icon buttons (tooltip.ts): the label, the keys, and a line with more words */
|
|
1450
1450
|
.icontip { position: fixed; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 260px; padding: 6px 8px;
|
|
1451
|
-
border-radius: 7px; background: var(--os-bubble); color: var(--os-on-bubble); font: 500 12.5px/1.3 ${
|
|
1452
|
-
pointer-events: none; animation: os-in ${
|
|
1451
|
+
border-radius: 7px; background: var(--os-bubble); color: var(--os-on-bubble); font: 500 12.5px/1.3 ${W}; box-shadow: var(--os-shadow-md);
|
|
1452
|
+
pointer-events: none; animation: os-in ${U.tip}ms ${H}; }
|
|
1453
1453
|
.icontip .tl { margin-right: 2px; }
|
|
1454
1454
|
.icontip kbd { min-width: 18px; height: 18px; padding: 0 4px; border: 0; border-radius: 4px; background: rgba(255,255,255,.14); color: inherit;
|
|
1455
|
-
font: 600 11.5px/1 ${
|
|
1455
|
+
font: 600 11.5px/1 ${W}; }
|
|
1456
1456
|
.icontip .tm { flex-basis: 100%; color: color-mix(in srgb, var(--os-on-bubble) 72%, transparent); font-weight: 400; }
|
|
1457
1457
|
@keyframes os-bump { 50% { transform: scale(1.25); } }
|
|
1458
1458
|
@keyframes os-dock-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
|
|
@@ -1460,16 +1460,16 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1460
1460
|
|
|
1461
1461
|
/* Menus and toasts */
|
|
1462
1462
|
.menu { position: fixed; z-index: 3; width: 220px; padding: 6px; border-radius: 10px; background: var(--os-panel); border: 1px solid var(--os-line);
|
|
1463
|
-
box-shadow: var(--os-shadow); pointer-events: auto; animation: os-pop 140ms ${
|
|
1463
|
+
box-shadow: var(--os-shadow); pointer-events: auto; animation: os-pop 140ms ${H}; }
|
|
1464
1464
|
.menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 34px; padding: 0 10px;
|
|
1465
|
-
border: 0; border-radius: 6px; background: transparent; color: var(--os-ink); font: 500 13px/1 ${
|
|
1465
|
+
border: 0; border-radius: 6px; background: transparent; color: var(--os-ink); font: 500 13px/1 ${W}; cursor: pointer; text-align: left; }
|
|
1466
1466
|
.menu button:hover, .menu button[aria-checked="true"] { background: var(--os-hover); }
|
|
1467
1467
|
.menu button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1468
1468
|
.menu .on { color: var(--os-accent-text); flex: 0 0 auto; }
|
|
1469
1469
|
.menu .hint { padding: 6px 10px 2px; font-size: 11px; color: var(--os-muted); }
|
|
1470
1470
|
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
|
|
1471
1471
|
padding: 10px 10px 10px 16px; border-radius: 10px; background: var(--os-panel); border: 1px solid var(--os-line); color: var(--os-ink);
|
|
1472
|
-
font-size: 13px; box-shadow: var(--os-shadow); pointer-events: auto; animation: os-toast 200ms ${
|
|
1472
|
+
font-size: 13px; box-shadow: var(--os-shadow); pointer-events: auto; animation: os-toast 200ms ${H}; }
|
|
1473
1473
|
[data-toast="top"] > .toast { top: 28px; bottom: auto; }
|
|
1474
1474
|
.toast.plain { padding-right: 16px; }
|
|
1475
1475
|
.toast .btn { min-height: 30px; color: var(--os-accent-text); }
|
|
@@ -1479,60 +1479,63 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1479
1479
|
.box { position: fixed; pointer-events: none; border-radius: 8px; }
|
|
1480
1480
|
.hover { background: var(--os-mark-tint); box-shadow: inset 0 0 0 2px var(--os-mark); }
|
|
1481
1481
|
.tag { position: absolute; left: 0; bottom: calc(100% + 6px); padding: 6px 8px; border-radius: 5px; background: var(--os-panel);
|
|
1482
|
-
border: 1px solid var(--os-mark); color: var(--os-ink); font: 500 11px/1 ${
|
|
1483
|
-
|
|
1482
|
+
border: 1px solid var(--os-mark); color: var(--os-ink); font: 500 11px/1 ${G}; white-space: nowrap;
|
|
1483
|
+
display: inline-flex; align-items: center; }
|
|
1484
|
+
.tag .walk { display: inline-flex; gap: 2px; margin-left: 8px; }
|
|
1485
|
+
.tag kbd { min-width: 15px; height: 15px; padding: 0 3px; border-radius: 4px; border-bottom-width: 1px; color: var(--os-muted); font: 600 10px/1 ${W}; }
|
|
1486
|
+
.pinned { box-shadow: inset 0 0 0 2px var(--os-mark); animation: os-fade 100ms ${H}; }
|
|
1484
1487
|
.pinno { position: absolute; top: -11px; left: -11px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
|
|
1485
|
-
border-radius: 50%; background: var(--os-mark); color: var(--os-on-mark); font: 700 11px/1 ${
|
|
1486
|
-
.flash { animation: os-flash ${
|
|
1488
|
+
border-radius: 50%; background: var(--os-mark); color: var(--os-on-mark); font: 700 11px/1 ${W}; }
|
|
1489
|
+
.flash { animation: os-flash ${U.flash}ms ${H} forwards; }
|
|
1487
1490
|
.flash .updated { position: absolute; left: 0; bottom: calc(100% + 4px); padding: 4px 6px; border-radius: 5px; background: var(--os-mark);
|
|
1488
|
-
color: var(--os-on-mark); font: 600 11px/1 ${
|
|
1489
|
-
.swap { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: os-swap ${
|
|
1490
|
-
.alt { border: 1.5px dashed var(--os-mark); animation: os-fade ${
|
|
1491
|
+
color: var(--os-on-mark); font: 600 11px/1 ${G}; white-space: nowrap; }
|
|
1492
|
+
.swap { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: os-swap ${U.swap}ms ${H} forwards; }
|
|
1493
|
+
.alt { border: 1.5px dashed var(--os-mark); animation: os-fade ${U.alt}ms ${H}; }
|
|
1491
1494
|
.altlabel { position: fixed; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 5px; border: 0;
|
|
1492
|
-
background: var(--os-mark); color: var(--os-on-mark); font: 600 11px/1 ${
|
|
1493
|
-
animation: os-in ${
|
|
1495
|
+
background: var(--os-mark); color: var(--os-on-mark); font: 600 11px/1 ${G}; cursor: pointer; pointer-events: auto; white-space: nowrap;
|
|
1496
|
+
animation: os-in ${U.alt}ms ${H}; }
|
|
1494
1497
|
.cpin { position: fixed; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
|
|
1495
|
-
border-radius: 12px 12px 12px 3px; background: var(--os-panel); border: 1px solid var(--os-line); color: var(--os-ink); font: 700 11px/1 ${
|
|
1498
|
+
border-radius: 12px 12px 12px 3px; background: var(--os-panel); border: 1px solid var(--os-line); color: var(--os-ink); font: 700 11px/1 ${W};
|
|
1496
1499
|
box-shadow: var(--os-shadow-sm); cursor: pointer; pointer-events: auto; }
|
|
1497
1500
|
.cpin.on { background: var(--os-mark); border-color: var(--os-mark); color: var(--os-on-mark); }
|
|
1498
1501
|
.popover { position: fixed; width: 260px; padding: 12px; border-radius: 10px; background: var(--os-panel); border: 1px solid var(--os-line);
|
|
1499
|
-
box-shadow: var(--os-shadow); pointer-events: auto; display: flex; flex-direction: column; gap: 8px; animation: os-pop 140ms ${
|
|
1502
|
+
box-shadow: var(--os-shadow); pointer-events: auto; display: flex; flex-direction: column; gap: 8px; animation: os-pop 140ms ${H}; }
|
|
1500
1503
|
/* The frame of a run (frames.ts): a moving dashed border while it works, a still outline after it */
|
|
1501
1504
|
.frame { border-radius: 4px; }
|
|
1502
|
-
.frame.fresh { animation: os-fade ${
|
|
1505
|
+
.frame.fresh { animation: os-fade ${U.alt}ms ${H}; }
|
|
1503
1506
|
.frame.working {
|
|
1504
1507
|
background:
|
|
1505
1508
|
linear-gradient(90deg, var(--os-mark) 60%, transparent 0) 0 0 / 10px 1.5px repeat-x,
|
|
1506
1509
|
linear-gradient(90deg, var(--os-mark) 60%, transparent 0) 0 100% / 10px 1.5px repeat-x,
|
|
1507
1510
|
linear-gradient(0deg, var(--os-mark) 60%, transparent 0) 0 0 / 1.5px 10px repeat-y,
|
|
1508
1511
|
linear-gradient(0deg, var(--os-mark) 60%, transparent 0) 100% 0 / 1.5px 10px repeat-y;
|
|
1509
|
-
animation: os-ants ${
|
|
1512
|
+
animation: os-ants ${U.ants}ms linear infinite; }
|
|
1510
1513
|
.frame.done { box-shadow: inset 0 0 0 1.5px var(--os-mark); }
|
|
1511
1514
|
/* An ask that waits in the queue (T-016): a still, faint dashed border, and a tag with × to cancel. */
|
|
1512
1515
|
.frame.queued { border: 1.5px dashed color-mix(in srgb, var(--os-mark) 55%, transparent); }
|
|
1513
1516
|
.framequeue { position: fixed; display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 2px 0 8px; border-radius: 5px;
|
|
1514
|
-
border: 1px solid var(--os-mark); background: var(--os-panel); color: var(--os-ink); font: 600 11px/1 ${
|
|
1515
|
-
pointer-events: auto; box-shadow: var(--os-shadow-sm); animation: os-in ${
|
|
1517
|
+
border: 1px solid var(--os-mark); background: var(--os-panel); color: var(--os-ink); font: 600 11px/1 ${G}; white-space: nowrap;
|
|
1518
|
+
pointer-events: auto; box-shadow: var(--os-shadow-sm); animation: os-in ${U.alt}ms ${H}; }
|
|
1516
1519
|
.framequeue button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--os-muted);
|
|
1517
1520
|
font-size: 14px; line-height: 1; cursor: pointer; }
|
|
1518
1521
|
.framequeue button:hover { background: var(--os-hover); color: var(--os-ink); }
|
|
1519
1522
|
.framequeue button:focus-visible { outline: 2px solid var(--os-accent); outline-offset: 1px; }
|
|
1520
1523
|
/* A write inside a frame: the frame glows once, with no tint over the change. */
|
|
1521
1524
|
.framepulse { border-radius: 4px; box-shadow: 0 0 0 1.5px var(--os-mark), 0 0 14px 2px var(--os-mark-tint);
|
|
1522
|
-
animation: os-framepulse ${
|
|
1525
|
+
animation: os-framepulse ${U.flash}ms ${H} forwards; }
|
|
1523
1526
|
@keyframes os-framepulse { from { opacity: 1; } to { opacity: 0; } }
|
|
1524
1527
|
.frametag { position: fixed; display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 320px; padding: 0 8px; border-radius: 5px;
|
|
1525
|
-
background: var(--os-mark); color: var(--os-on-mark); font: 600 11px/1 ${
|
|
1526
|
-
animation: os-in ${
|
|
1528
|
+
background: var(--os-mark); color: var(--os-on-mark); font: 600 11px/1 ${G}; white-space: nowrap; pointer-events: none;
|
|
1529
|
+
animation: os-in ${U.alt}ms ${H}; }
|
|
1527
1530
|
.frametag > span:last-child { overflow: hidden; text-overflow: ellipsis; }
|
|
1528
1531
|
.frametag .spin { width: 10px; height: 10px; border-width: 1.5px; border-color: rgba(0,0,0,.18); border-top-color: var(--os-on-mark); flex: 0 0 auto; }
|
|
1529
1532
|
.framefold { position: fixed; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 8px; border-radius: 5px;
|
|
1530
|
-
border: 1px solid var(--os-mark); background: var(--os-panel); color: var(--os-ink); font: 600 11px/1 ${
|
|
1531
|
-
pointer-events: auto; white-space: nowrap; box-shadow: var(--os-shadow-sm); animation: os-in ${
|
|
1533
|
+
border: 1px solid var(--os-mark); background: var(--os-panel); color: var(--os-ink); font: 600 11px/1 ${G}; cursor: pointer;
|
|
1534
|
+
pointer-events: auto; white-space: nowrap; box-shadow: var(--os-shadow-sm); animation: os-in ${U.alt}ms ${H}; }
|
|
1532
1535
|
.framefold:hover { background: var(--os-surface); }
|
|
1533
1536
|
.framebar { position: fixed; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: var(--os-panel);
|
|
1534
1537
|
border: 1px solid var(--os-line); box-shadow: var(--os-shadow-md); pointer-events: auto; white-space: nowrap;
|
|
1535
|
-
animation: os-in ${
|
|
1538
|
+
animation: os-in ${U.step}ms ${H}; }
|
|
1536
1539
|
.framebar .framemark { display: inline-flex; padding: 0 4px 0 5px; }
|
|
1537
1540
|
.framebar .seg { padding: 2px; border-radius: 7px; }
|
|
1538
1541
|
.framebar .seg button { flex: 0 0 auto; min-width: 28px; min-height: 26px; padding: 0 9px; border-radius: 5px; font-size: 12px; }
|
|
@@ -1554,12 +1557,12 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1554
1557
|
/* The question card (question.ts): asks before a stale take shows */
|
|
1555
1558
|
.question { position: fixed; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 10px; background: var(--os-panel);
|
|
1556
1559
|
border: 1px solid var(--os-line); box-shadow: var(--os-shadow); color: var(--os-ink); pointer-events: auto; z-index: 1;
|
|
1557
|
-
animation: os-pop ${
|
|
1560
|
+
animation: os-pop ${U.step}ms ${H}; }
|
|
1558
1561
|
.question[data-side="below"] { animation-name: os-drop; }
|
|
1559
1562
|
.question .text { margin: 0; font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
|
|
1560
1563
|
.question .btn { min-height: 32px; }
|
|
1561
1564
|
.popover .text { font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
|
|
1562
|
-
.popover .where { font: 11.5px/1.3 ${
|
|
1565
|
+
.popover .where { font: 11.5px/1.3 ${G}; color: var(--os-muted); overflow-wrap: anywhere; }
|
|
1563
1566
|
|
|
1564
1567
|
@keyframes os-dotpulse { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.6); } }
|
|
1565
1568
|
@keyframes os-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
|
|
@@ -1585,7 +1588,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1585
1588
|
/* No fade, but the menu button still stays a moment so the pointer can reach it. */
|
|
1586
1589
|
.dockmore { transition: visibility 0s linear 400ms; }
|
|
1587
1590
|
.dotpulse, .swap { display: none; }
|
|
1588
|
-
.flash { animation: os-still ${
|
|
1591
|
+
.flash { animation: os-still ${U.stillFlash}ms steps(1) forwards; }
|
|
1589
1592
|
.spin { animation-duration: 2s; }
|
|
1590
1593
|
.btn, .tab, .seg button, .dock, .panel { transition: none; }
|
|
1591
1594
|
.snapping { transition: none !important; }
|
|
@@ -1596,7 +1599,7 @@ kbd { display: inline-flex; align-items: center; justify-content: center; min-wi
|
|
|
1596
1599
|
.ib:active { transform: none; }
|
|
1597
1600
|
}
|
|
1598
1601
|
`;
|
|
1599
|
-
function
|
|
1602
|
+
function K(t, n, r = 30) {
|
|
1600
1603
|
let i = /* @__PURE__ */ new Set(), a = (e) => {
|
|
1601
1604
|
let t = 0;
|
|
1602
1605
|
for (let a of e) {
|
|
@@ -1610,10 +1613,41 @@ function q(t, n, r = 30) {
|
|
|
1610
1613
|
} catch {}
|
|
1611
1614
|
return [...i];
|
|
1612
1615
|
}
|
|
1613
|
-
function
|
|
1616
|
+
function q(t) {
|
|
1614
1617
|
return t instanceof Element ? t.closest(`[${e}]`) : null;
|
|
1615
1618
|
}
|
|
1616
|
-
|
|
1619
|
+
function Rt(e, t, n, r) {
|
|
1620
|
+
let i = Math.max(4, Math.min(e.left, n.w - t.w - 4)), a = e.top - r - t.h, o = e.top + e.height + r, s = a >= 4 ? a : o + t.h <= n.h - 4 ? o : Math.max(4, Math.min(e.top + r, n.h - t.h - 4));
|
|
1621
|
+
return {
|
|
1622
|
+
left: i - e.left,
|
|
1623
|
+
top: s - e.top
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
function zt(e, t, n) {
|
|
1627
|
+
let r = e.box.querySelector(":scope > .tag, :scope > .updated");
|
|
1628
|
+
if (!r) return;
|
|
1629
|
+
let i = r.classList.contains("updated") ? 4 : 6, a = Rt({
|
|
1630
|
+
left: t.left - n,
|
|
1631
|
+
top: t.top - n,
|
|
1632
|
+
width: t.width + n * 2,
|
|
1633
|
+
height: t.height + n * 2
|
|
1634
|
+
}, {
|
|
1635
|
+
w: r.offsetWidth,
|
|
1636
|
+
h: r.offsetHeight
|
|
1637
|
+
}, {
|
|
1638
|
+
w: innerWidth,
|
|
1639
|
+
h: innerHeight
|
|
1640
|
+
}, i);
|
|
1641
|
+
r.style.left = `${a.left}px`, r.style.top = `${a.top}px`, r.style.bottom = "auto";
|
|
1642
|
+
}
|
|
1643
|
+
function Bt(e) {
|
|
1644
|
+
let t = e.getRootNode();
|
|
1645
|
+
return q(e.parentElement ?? (t instanceof ShadowRoot ? t.host : null));
|
|
1646
|
+
}
|
|
1647
|
+
function Vt(t) {
|
|
1648
|
+
return t.querySelector(`[${e}]`);
|
|
1649
|
+
}
|
|
1650
|
+
var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.top < innerHeight && e.left < innerWidth, Ht = class {
|
|
1617
1651
|
host;
|
|
1618
1652
|
read;
|
|
1619
1653
|
act;
|
|
@@ -1638,7 +1672,7 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1638
1672
|
this.openNote = e, e ? window.addEventListener("pointerdown", this.outside, !0) : window.removeEventListener("pointerdown", this.outside, !0), this.draw();
|
|
1639
1673
|
}
|
|
1640
1674
|
constructor(e, t, n) {
|
|
1641
|
-
this.host = e, this.read = t, this.act = n, this.root =
|
|
1675
|
+
this.host = e, this.read = t, this.act = n, this.root = A("div", {
|
|
1642
1676
|
class: "page",
|
|
1643
1677
|
"data-layer": "page",
|
|
1644
1678
|
"aria-live": "off"
|
|
@@ -1652,17 +1686,21 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1652
1686
|
for (let e of this.altGroups) e.label.remove();
|
|
1653
1687
|
for (let e of this.frames) e.note?.remove(), e.noteCard?.remove();
|
|
1654
1688
|
if (this.menu?.remove(), this.card?.box.remove(), this.drawn = [], this.altGroups = [], this.frames = [], this.menu = null, this.card = null, e.alt === "off" ? this.drawFrames(e) : (this.dropCtls(/* @__PURE__ */ new Set()), e.altMarks && this.drawAlt(e)), e.pins.forEach((e, t) => {
|
|
1655
|
-
let n =
|
|
1689
|
+
let n = A("div", { class: "box pinned" }, A("span", { class: "pinno" }, String(t + 1)));
|
|
1656
1690
|
this.keep({
|
|
1657
1691
|
el: e,
|
|
1658
1692
|
box: n,
|
|
1659
1693
|
pad: 4
|
|
1660
1694
|
});
|
|
1661
1695
|
}), e.hover && !e.pins.includes(e.hover)) {
|
|
1662
|
-
let n = e.hover.getAttribute("data-onsite-src") ?? "", r = e.hover.getAttribute(t), i =
|
|
1696
|
+
let n = e.hover.getAttribute("data-onsite-src") ?? "", r = e.hover.getAttribute(t), i = [Bt(e.hover) && "↑", Vt(e.hover) && "↓"].filter((e) => !!e), a = A("div", { class: "box hover" }, A("span", { class: "tag" }, `${r ? `${r} · ` : ""}${c(n)}`, ...i.length ? [A("span", {
|
|
1697
|
+
class: "walk",
|
|
1698
|
+
"data-walk": i.join(""),
|
|
1699
|
+
"aria-hidden": "true"
|
|
1700
|
+
}, ...i.map((e) => A("kbd", null, e)))] : []));
|
|
1663
1701
|
this.keep({
|
|
1664
1702
|
el: e.hover,
|
|
1665
|
-
box:
|
|
1703
|
+
box: a,
|
|
1666
1704
|
pad: 4
|
|
1667
1705
|
});
|
|
1668
1706
|
}
|
|
@@ -1671,12 +1709,12 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1671
1709
|
i !== this.framesKey && (this.framesKey = i, this.act.framesChanged());
|
|
1672
1710
|
}
|
|
1673
1711
|
drawFrames(e) {
|
|
1674
|
-
let t = `-${Math.round(performance.now() %
|
|
1712
|
+
let t = `-${Math.round(performance.now() % U.ants)}ms`;
|
|
1675
1713
|
for (let n of e.frames) {
|
|
1676
|
-
let r =
|
|
1714
|
+
let r = K({ stamps: n.selected }, this.host);
|
|
1677
1715
|
if (r.length === 0) {
|
|
1678
|
-
let t =
|
|
1679
|
-
i &&
|
|
1716
|
+
let t = gt(n.run, n.takes, e.frameMarks, e.showing), i = e.liveMarks.get(n.run);
|
|
1717
|
+
i && z(t.all, i), r = K(t.all, this.host).slice(0, 1);
|
|
1680
1718
|
}
|
|
1681
1719
|
let i = r[0];
|
|
1682
1720
|
if (!i) {
|
|
@@ -1687,7 +1725,7 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1687
1725
|
let a = this.seen.get(n.run);
|
|
1688
1726
|
a || (a = /* @__PURE__ */ new WeakSet(), this.seen.set(n.run, a));
|
|
1689
1727
|
for (let e of r) {
|
|
1690
|
-
let r =
|
|
1728
|
+
let r = A("div", {
|
|
1691
1729
|
class: `box frame ${n.running ? "working" : n.queued ? "queued" : "done"}${a.has(e) ? "" : " fresh"}`,
|
|
1692
1730
|
"data-frame": n.run
|
|
1693
1731
|
});
|
|
@@ -1697,27 +1735,27 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1697
1735
|
pad: 4
|
|
1698
1736
|
});
|
|
1699
1737
|
}
|
|
1700
|
-
let o = this.keepCtl(n.run, n.running ?
|
|
1738
|
+
let o = this.keepCtl(n.run, n.running ? wt(n) : n.queued ? Tt(n, this.act) : n.run === e.barRun ? Dt(n, {
|
|
1701
1739
|
showing: e.showing,
|
|
1702
1740
|
picked: e.picked,
|
|
1703
1741
|
all: e.takes,
|
|
1704
1742
|
asks: e.asks
|
|
1705
|
-
}, e.busy, this.act) :
|
|
1743
|
+
}, e.busy, this.act) : Et(n, this.act)), s = {
|
|
1706
1744
|
run: n.run,
|
|
1707
1745
|
els: r,
|
|
1708
1746
|
main: i,
|
|
1709
1747
|
ctl: o
|
|
1710
|
-
}, c =
|
|
1748
|
+
}, c = kt(n, e.showing, e.picked);
|
|
1711
1749
|
if (c) {
|
|
1712
1750
|
let e = this.openNote === n.run;
|
|
1713
|
-
s.note =
|
|
1751
|
+
s.note = At(n, c, e, () => this.toggleNote(e ? "" : n.run)), this.root.append(s.note), e && (s.noteCard = this.root.appendChild(jt(n, c)));
|
|
1714
1752
|
}
|
|
1715
1753
|
this.frames.push(s);
|
|
1716
1754
|
}
|
|
1717
1755
|
this.dropCtls(new Set(e.frames.map((e) => e.run))), this.openNote && !this.frames.some((e) => e.run === this.openNote && e.note) && (this.openNote = "", window.removeEventListener("pointerdown", this.outside, !0));
|
|
1718
1756
|
}
|
|
1719
1757
|
keepCtl(e, t) {
|
|
1720
|
-
let n =
|
|
1758
|
+
let n = N() ? 2e3 : 700;
|
|
1721
1759
|
for (let e of t.querySelectorAll(".spin")) e.style.animationDelay = `-${Math.round(performance.now() % n)}ms`;
|
|
1722
1760
|
let r = this.ctls.get(e);
|
|
1723
1761
|
if (!r || r.tagName !== t.tagName || r.className !== t.className) return r?.remove(), this.root.append(t), this.ctls.set(e, t), t;
|
|
@@ -1738,7 +1776,7 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1738
1776
|
if (!t) return !1;
|
|
1739
1777
|
let n = this.read(), r = n.frames.find((e) => e.run === t.getAttribute("data-framebar"));
|
|
1740
1778
|
if (!r) return !1;
|
|
1741
|
-
let i =
|
|
1779
|
+
let i = V(r.run, r.takes, n.showing, n.picked);
|
|
1742
1780
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
1743
1781
|
let t = Math.max(0, r.takes.findIndex((e) => e.id === i?.id)), a = r.takes[Math.max(0, Math.min(r.takes.length - 1, t + (e.key === "ArrowLeft" ? -1 : 1)))];
|
|
1744
1782
|
return a && !n.showing.includes(a.id) && !n.busy && this.act.show(a.id), !0;
|
|
@@ -1757,11 +1795,11 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1757
1795
|
let t = /* @__PURE__ */ new Map();
|
|
1758
1796
|
e.comments.forEach((n, r) => {
|
|
1759
1797
|
if (n.resolved) return;
|
|
1760
|
-
let i =
|
|
1798
|
+
let i = K({ stamps: [n.stamp.src] }, this.host, 1)[0];
|
|
1761
1799
|
if (!i) return;
|
|
1762
1800
|
let a = t.get(i) ?? 0;
|
|
1763
1801
|
t.set(i, a + 1);
|
|
1764
|
-
let o = r + 1, s =
|
|
1802
|
+
let o = r + 1, s = A("button", {
|
|
1765
1803
|
class: `cpin${e.chosen.includes(n.id) || e.openComment === n.id ? " on" : ""}`,
|
|
1766
1804
|
type: "button",
|
|
1767
1805
|
"aria-label": `Comment ${o}: ${n.text}`,
|
|
@@ -1782,15 +1820,15 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1782
1820
|
});
|
|
1783
1821
|
}
|
|
1784
1822
|
drawCard(e, t, n, r) {
|
|
1785
|
-
let i = r.chosen.includes(t.id), a = r.takes.find((e) => e.id === t.take), o = r.takes.filter((e) => e.state === "open" || e.state === "kept"), s = t.take ? `on ${a ? m(a, o, r.asks) : u(t.takeNo ?? 0)}` : "on the original", c =
|
|
1823
|
+
let i = r.chosen.includes(t.id), a = r.takes.find((e) => e.id === t.take), o = r.takes.filter((e) => e.state === "open" || e.state === "kept"), s = t.take ? `on ${a ? m(a, o, r.asks) : u(t.takeNo ?? 0)}` : "on the original", c = A("div", {
|
|
1786
1824
|
class: "popover",
|
|
1787
1825
|
role: "dialog",
|
|
1788
1826
|
"aria-label": `Comment ${n}`
|
|
1789
|
-
},
|
|
1827
|
+
}, A("div", { class: "text" }, t.text), A("div", { class: "where" }, `${l(t.stamp)} · ${s}`), A("div", { class: "actions" }, A("button", {
|
|
1790
1828
|
class: "btn",
|
|
1791
1829
|
type: "button",
|
|
1792
1830
|
on: { click: () => this.act.chooseComment(t.id) }
|
|
1793
|
-
}, i ? "Leave out of the ask" : "Add to the ask"),
|
|
1831
|
+
}, i ? "Leave out of the ask" : "Add to the ask"), A("button", {
|
|
1794
1832
|
class: "btn ghost",
|
|
1795
1833
|
type: "button",
|
|
1796
1834
|
on: { click: () => this.act.resolve(t.id) }
|
|
@@ -1803,14 +1841,14 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1803
1841
|
drawAlt(e) {
|
|
1804
1842
|
let t = e.altMarks, n = /* @__PURE__ */ new Set();
|
|
1805
1843
|
for (let r of t.groups) {
|
|
1806
|
-
let t =
|
|
1844
|
+
let t = K(r, this.host);
|
|
1807
1845
|
if (!t.length) continue;
|
|
1808
1846
|
for (let e of t) n.has(e) || (n.add(e), this.keep({
|
|
1809
1847
|
el: e,
|
|
1810
|
-
box:
|
|
1848
|
+
box: A("div", { class: "box alt" }),
|
|
1811
1849
|
pad: 4
|
|
1812
1850
|
}));
|
|
1813
|
-
let a = [...r.takes].sort().join(" "), s = r.stamps[0], c = s ? i(o(s)) : r.selectors[0] ?? "Styles", l =
|
|
1851
|
+
let a = [...r.takes].sort().join(" "), s = r.stamps[0], c = s ? i(o(s)) : r.selectors[0] ?? "Styles", l = A("button", {
|
|
1814
1852
|
class: "altlabel",
|
|
1815
1853
|
type: "button",
|
|
1816
1854
|
"aria-haspopup": "menu",
|
|
@@ -1831,19 +1869,19 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1831
1869
|
r && (this.menu = this.root.appendChild(this.versionMenu(r.takes, e)));
|
|
1832
1870
|
}
|
|
1833
1871
|
versionMenu(e, t) {
|
|
1834
|
-
let n = e.map((e) => t.takes.find((t) => t.id === e)).filter((e) => !!e).sort((e, t) => e.no - t.no), r = t.showing.findLast((t) => e.includes(t)) ?? "", i = (t, n) =>
|
|
1872
|
+
let n = e.map((e) => t.takes.find((t) => t.id === e)).filter((e) => !!e).sort((e, t) => e.no - t.no), r = t.showing.findLast((t) => e.includes(t)) ?? "", i = (t, n) => A("button", {
|
|
1835
1873
|
type: "button",
|
|
1836
1874
|
role: "menuitemradio",
|
|
1837
1875
|
"aria-checked": String(t === r),
|
|
1838
1876
|
on: { click: (n) => {
|
|
1839
1877
|
n.stopPropagation(), t === "" ? r && this.act.hideTakes(e) : this.act.show(t);
|
|
1840
1878
|
} }
|
|
1841
|
-
},
|
|
1842
|
-
return
|
|
1879
|
+
}, A("span", null, n), A("span", { class: "on" }, t === r ? "Shown" : ""));
|
|
1880
|
+
return A("div", {
|
|
1843
1881
|
class: "menu",
|
|
1844
1882
|
role: "menu",
|
|
1845
1883
|
"aria-label": "Versions"
|
|
1846
|
-
}, i("", "Original"), n.map((e) => i(e.id, [m(e, n, t.asks), e.label].filter(Boolean).join(" · "))), t.alt === "held" ?
|
|
1884
|
+
}, i("", "Original"), n.map((e) => i(e.id, [m(e, n, t.asks), e.label].filter(Boolean).join(" · "))), t.alt === "held" ? A("div", { class: "hint" }, `Release ${this.act.altKeyName()} to close`) : null);
|
|
1847
1885
|
}
|
|
1848
1886
|
position() {
|
|
1849
1887
|
let e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
@@ -1860,7 +1898,7 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1860
1898
|
continue;
|
|
1861
1899
|
}
|
|
1862
1900
|
e.box.style.left = `${Math.max(2, Math.min(t.left, innerWidth - 28))}px`, e.box.style.top = `${Math.max(2, t.top)}px`;
|
|
1863
|
-
} else
|
|
1901
|
+
} else st(e.box, n, e.pad), zt(e, n, e.pad);
|
|
1864
1902
|
}
|
|
1865
1903
|
}
|
|
1866
1904
|
if (this.positionAlt(t), this.positionFrames(t), this.card) {
|
|
@@ -1893,7 +1931,7 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1893
1931
|
}
|
|
1894
1932
|
}), a.push(t));
|
|
1895
1933
|
}
|
|
1896
|
-
let o =
|
|
1934
|
+
let o = St(i, {
|
|
1897
1935
|
w: document.documentElement.clientWidth || innerWidth,
|
|
1898
1936
|
h: document.documentElement.clientHeight || innerHeight
|
|
1899
1937
|
});
|
|
@@ -1921,12 +1959,12 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1921
1959
|
let o = e(a), s = {
|
|
1922
1960
|
w: i.ctl.offsetWidth || 120,
|
|
1923
1961
|
h: i.ctl.offsetHeight || 32
|
|
1924
|
-
}, c =
|
|
1962
|
+
}, c = vt({
|
|
1925
1963
|
left: o.left - 4,
|
|
1926
1964
|
top: o.top - 4,
|
|
1927
1965
|
width: o.width + 8,
|
|
1928
1966
|
height: o.height + 8
|
|
1929
|
-
}, s, t), l =
|
|
1967
|
+
}, s, t), l = yt({
|
|
1930
1968
|
left: c.left,
|
|
1931
1969
|
top: c.top,
|
|
1932
1970
|
width: s.w,
|
|
@@ -1949,14 +1987,14 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1949
1987
|
if (!t.note) continue;
|
|
1950
1988
|
let r = t.ctl.hidden ? void 0 : [t.main, ...t.els].find((t) => t.isConnected && J(e(t)));
|
|
1951
1989
|
if (t.note.hidden = !r, t.noteCard && (t.noteCard.hidden = !r), !r) continue;
|
|
1952
|
-
let o = e(r), s =
|
|
1990
|
+
let o = e(r), s = Mt({
|
|
1953
1991
|
left: o.left - 4,
|
|
1954
1992
|
top: o.top - 4,
|
|
1955
1993
|
width: o.width + 8,
|
|
1956
1994
|
height: o.height + 8
|
|
1957
1995
|
}, i, n);
|
|
1958
1996
|
if (i.push(s), t.note.style.left = `${s.left}px`, t.note.style.top = `${s.top}px`, t.noteCard) {
|
|
1959
|
-
let e =
|
|
1997
|
+
let e = Nt(s, {
|
|
1960
1998
|
w: t.noteCard.offsetWidth || 260,
|
|
1961
1999
|
h: t.noteCard.offsetHeight || 120
|
|
1962
2000
|
}, n, a ? {
|
|
@@ -1982,37 +2020,37 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
1982
2020
|
return this.drawn.length > 0 || this.temp.length > 0;
|
|
1983
2021
|
}
|
|
1984
2022
|
flash(e) {
|
|
1985
|
-
let t =
|
|
2023
|
+
let t = N(), n = K(e, this.host).filter((e) => J(e.getBoundingClientRect()) || !Ut()), r = this.frames.flatMap((e) => e.els), i = /* @__PURE__ */ new Set(), a = n.filter((e) => {
|
|
1986
2024
|
let t = r.find((t) => t === e || t.contains(e) || e.contains(t));
|
|
1987
2025
|
return t && i.add(t), !t;
|
|
1988
2026
|
});
|
|
1989
2027
|
for (let e of i) this.addTemp({
|
|
1990
2028
|
el: e,
|
|
1991
|
-
box:
|
|
2029
|
+
box: A("div", {
|
|
1992
2030
|
class: "box framepulse",
|
|
1993
2031
|
"data-pulse": ""
|
|
1994
2032
|
}),
|
|
1995
2033
|
pad: 4
|
|
1996
|
-
}, t ?
|
|
2034
|
+
}, t ? U.stillFlash : U.flash);
|
|
1997
2035
|
return a.forEach((e, n) => {
|
|
1998
|
-
let r =
|
|
2036
|
+
let r = A("div", {
|
|
1999
2037
|
class: "box flash",
|
|
2000
2038
|
"data-flash": ""
|
|
2001
|
-
}, n === 0 ?
|
|
2039
|
+
}, n === 0 ? A("span", { class: "updated" }, "updated") : null);
|
|
2002
2040
|
this.addTemp({
|
|
2003
2041
|
el: e,
|
|
2004
2042
|
box: r,
|
|
2005
2043
|
pad: 6
|
|
2006
|
-
}, t ?
|
|
2044
|
+
}, t ? U.stillFlash : U.flash);
|
|
2007
2045
|
}), this.position(), a.length + i.size;
|
|
2008
2046
|
}
|
|
2009
2047
|
swap(e) {
|
|
2010
|
-
if (!
|
|
2048
|
+
if (!N()) {
|
|
2011
2049
|
for (let t of e.slice(0, 30)) this.addTemp({
|
|
2012
2050
|
el: t,
|
|
2013
|
-
box:
|
|
2051
|
+
box: A("div", { class: "box swap" }),
|
|
2014
2052
|
pad: 4
|
|
2015
|
-
},
|
|
2053
|
+
}, U.swap);
|
|
2016
2054
|
this.position();
|
|
2017
2055
|
}
|
|
2018
2056
|
}
|
|
@@ -2022,27 +2060,27 @@ var J = (e) => e.width > 0 && e.height > 0 && e.bottom > 0 && e.right > 0 && e.t
|
|
|
2022
2060
|
}, t + 40);
|
|
2023
2061
|
}
|
|
2024
2062
|
};
|
|
2025
|
-
function
|
|
2063
|
+
function Ut() {
|
|
2026
2064
|
let e = document.documentElement.getBoundingClientRect();
|
|
2027
2065
|
return e.width > 0 || e.height > 0;
|
|
2028
2066
|
}
|
|
2029
2067
|
// src/menu.ts
|
|
2030
|
-
var
|
|
2068
|
+
var Wt = [
|
|
2031
2069
|
"claude-haiku-4-5",
|
|
2032
2070
|
"claude-sonnet-5-5",
|
|
2033
2071
|
"claude-opus-5-5"
|
|
2034
|
-
],
|
|
2072
|
+
], Gt = {
|
|
2035
2073
|
skills: "Skills",
|
|
2036
2074
|
presets: "Presets",
|
|
2037
2075
|
settings: "Settings"
|
|
2038
|
-
},
|
|
2076
|
+
}, Kt = {
|
|
2039
2077
|
"top-left": "Top left",
|
|
2040
2078
|
"top-center": "Top middle",
|
|
2041
2079
|
"top-right": "Top right",
|
|
2042
2080
|
"bottom-left": "Bottom left",
|
|
2043
2081
|
"bottom-center": "Bottom middle",
|
|
2044
2082
|
"bottom-right": "Bottom right"
|
|
2045
|
-
},
|
|
2083
|
+
}, qt = class {
|
|
2046
2084
|
o;
|
|
2047
2085
|
el;
|
|
2048
2086
|
open = !1;
|
|
@@ -2055,7 +2093,7 @@ var Bt = [
|
|
|
2055
2093
|
confirmDelete = "";
|
|
2056
2094
|
confirmTimer = 0;
|
|
2057
2095
|
constructor(e) {
|
|
2058
|
-
this.o = e, this.el =
|
|
2096
|
+
this.o = e, this.el = A("div", {
|
|
2059
2097
|
class: "smenu",
|
|
2060
2098
|
hidden: !0,
|
|
2061
2099
|
"data-menu": ""
|
|
@@ -2086,14 +2124,14 @@ var Bt = [
|
|
|
2086
2124
|
if (!this.open) return;
|
|
2087
2125
|
this.readDraft();
|
|
2088
2126
|
let e = this.o.shadow.activeElement, t = e && this.el.contains(e) ? e.getAttribute("data-mkey") : null, n = this.el.querySelector(".sbody")?.scrollTop ?? 0, r = this.el.dataset.view === this.view;
|
|
2089
|
-
if (this.el.dataset.view = this.view, this.el.setAttribute("role", this.view === "root" ? "menu" : "dialog"), this.el.setAttribute("aria-label", this.view === "root" ? "Onsite menu" :
|
|
2127
|
+
if (this.el.dataset.view = this.view, this.el.setAttribute("role", this.view === "root" ? "menu" : "dialog"), this.el.setAttribute("aria-label", this.view === "root" ? "Onsite menu" : Gt[this.view]), this.el.replaceChildren(...this.view === "root" ? this.root() : this.section(this.view)), r) {
|
|
2090
2128
|
let e = this.el.querySelector(".sbody");
|
|
2091
2129
|
e && (e.scrollTop = n);
|
|
2092
2130
|
}
|
|
2093
2131
|
t && this.focus(`[data-mkey="${CSS.escape(t)}"]`), setTimeout(() => this.el.classList.remove("opening"), 200);
|
|
2094
2132
|
}
|
|
2095
2133
|
root() {
|
|
2096
|
-
let e = this.skills?.filter((e) => e.enabled).length, t = this.presets?.length, n = (e, t, n, r) =>
|
|
2134
|
+
let e = this.skills?.filter((e) => e.enabled).length, t = this.presets?.length, n = (e, t, n, r) => A("button", {
|
|
2097
2135
|
class: "mitem",
|
|
2098
2136
|
type: "button",
|
|
2099
2137
|
role: "menuitem",
|
|
@@ -2102,39 +2140,39 @@ var Bt = [
|
|
|
2102
2140
|
"data-mkey": `item:${e}`,
|
|
2103
2141
|
...r.sub ? { "data-sub": e } : {},
|
|
2104
2142
|
on: { click: r.click }
|
|
2105
|
-
},
|
|
2106
|
-
return [
|
|
2143
|
+
}, j(t), A("span", { class: "grow" }, n), r.hint ? A("span", { class: "mhint" }, r.hint) : null, r.sub ? j(L.next) : null), r = this.o.hidden, i = this.o.everywhere();
|
|
2144
|
+
return [A("div", {
|
|
2107
2145
|
class: "mbrand",
|
|
2108
2146
|
"aria-hidden": "true"
|
|
2109
|
-
},
|
|
2147
|
+
}, j(F(14, 3.2)), A("span", null, "onsite"), this.info ? A("span", { class: "mhint" }, `v${this.info.version}`) : null), A("div", { class: "mlist" }, n("changes", L.alt, "Changes", { click: () => this.openTab("changes") }), n("export", L.export, "Export", { click: () => this.openTab("export") }), i ? n("original", i === "original" ? L.original : L.undo, i === "original" ? "Show the original everywhere" : "Show the takes again", {
|
|
2110
2148
|
hint: this.everywhereHint(i),
|
|
2111
2149
|
click: () => void this.toggleEverywhere()
|
|
2112
|
-
}) : null,
|
|
2150
|
+
}) : null, A("div", {
|
|
2113
2151
|
class: "msep",
|
|
2114
2152
|
role: "separator"
|
|
2115
|
-
}), n("skills",
|
|
2153
|
+
}), n("skills", L.skills, "Skills", {
|
|
2116
2154
|
sub: !0,
|
|
2117
2155
|
hint: e === void 0 ? "" : `${e} on`,
|
|
2118
2156
|
click: () => this.go("skills")
|
|
2119
|
-
}), n("presets",
|
|
2157
|
+
}), n("presets", L.preset, "Presets", {
|
|
2120
2158
|
sub: !0,
|
|
2121
2159
|
hint: t === void 0 ? "" : String(t),
|
|
2122
2160
|
click: () => this.go("presets")
|
|
2123
|
-
}), n("settings",
|
|
2161
|
+
}), n("settings", L.settings, "Settings", {
|
|
2124
2162
|
sub: !0,
|
|
2125
2163
|
click: () => this.go("settings")
|
|
2126
|
-
}),
|
|
2164
|
+
}), A("div", {
|
|
2127
2165
|
class: "msep",
|
|
2128
2166
|
role: "separator"
|
|
2129
|
-
}), n("hide", r ?
|
|
2130
|
-
hint: r ? "" : `2× ${
|
|
2167
|
+
}), n("hide", r ? L.show : L.hide, r ? "Show icon" : "Hide icon", {
|
|
2168
|
+
hint: r ? "" : `2× ${P()} opens`,
|
|
2131
2169
|
click: () => {
|
|
2132
2170
|
this.close(), this.o.setHidden(!r);
|
|
2133
2171
|
}
|
|
2134
2172
|
}))];
|
|
2135
2173
|
}
|
|
2136
2174
|
everywhereHint(e) {
|
|
2137
|
-
let t = this.o, n = e === "original" ?
|
|
2175
|
+
let t = this.o, n = e === "original" ? R(t.thread) : t.beforeOriginal?.showing ?? [];
|
|
2138
2176
|
return r(new Set(n.map((e) => t.thread.takes.find((t) => t.id === e)?.of ?? e)).size, "ask");
|
|
2139
2177
|
}
|
|
2140
2178
|
async toggleEverywhere() {
|
|
@@ -2144,35 +2182,35 @@ var Bt = [
|
|
|
2144
2182
|
this.close(), this.o.setOpen(!0), this.o.setTab(e);
|
|
2145
2183
|
}
|
|
2146
2184
|
section(e) {
|
|
2147
|
-
let t =
|
|
2185
|
+
let t = A("div", { class: "mhead" }, A("button", {
|
|
2148
2186
|
class: "btn ghost icon",
|
|
2149
2187
|
type: "button",
|
|
2150
2188
|
"aria-label": "Back to the menu",
|
|
2151
2189
|
"data-mnav": "",
|
|
2152
2190
|
"data-mkey": "back",
|
|
2153
2191
|
on: { click: () => this.go("root") }
|
|
2154
|
-
},
|
|
2192
|
+
}, j(L.back)), A("h2", null, Gt[e])), n = A("div", { class: "sbody scroll" });
|
|
2155
2193
|
return e === "skills" ? n.append(...this.skillsView()) : e === "presets" ? n.append(...this.presetsView()) : n.append(...this.settingsView()), [t, n];
|
|
2156
2194
|
}
|
|
2157
2195
|
skillsView() {
|
|
2158
2196
|
if (!this.skills) return [this.waiting("skills")];
|
|
2159
|
-
let e =
|
|
2160
|
-
if (this.skills.length === 0) return [e,
|
|
2197
|
+
let e = A("p", { class: "mnote" }, "The agent sees the name and description of each skill that is on, and reads it when your ask matches. Onsite never runs a skill's scripts.");
|
|
2198
|
+
if (this.skills.length === 0) return [e, A("p", { class: "mnote" }, "No skills found. Add a folder with a SKILL.md to .claude/skills/ in your project, or to ~/.claude/skills/.")];
|
|
2161
2199
|
let t = (e, t, n) => {
|
|
2162
2200
|
let r = this.skills.filter((t) => t.source === e);
|
|
2163
|
-
return r.length ?
|
|
2201
|
+
return r.length ? A("section", { class: "mgroup" }, A("h3", null, t, A("span", { class: "mhint" }, n)), r.map((e) => this.skillRow(e))) : null;
|
|
2164
2202
|
};
|
|
2165
2203
|
return [e, ...[t("project", "This project", ".claude/skills"), t("user", "Your own", "~/.claude/skills · off by default")].filter((e) => e !== null)];
|
|
2166
2204
|
}
|
|
2167
2205
|
skillRow(e) {
|
|
2168
2206
|
let t = `os-skill-${e.id.replace(/[^A-Za-z0-9_-]/g, "-")}`;
|
|
2169
|
-
return
|
|
2207
|
+
return A("div", { class: "mrow" }, A("div", { class: "grow" }, A("div", {
|
|
2170
2208
|
class: "mname mono",
|
|
2171
2209
|
id: t
|
|
2172
|
-
}, e.name),
|
|
2210
|
+
}, e.name), A("div", {
|
|
2173
2211
|
class: "mdesc",
|
|
2174
2212
|
title: e.path
|
|
2175
|
-
}, e.description)),
|
|
2213
|
+
}, e.description)), A("button", {
|
|
2176
2214
|
class: "switch",
|
|
2177
2215
|
type: "button",
|
|
2178
2216
|
role: "switch",
|
|
@@ -2181,7 +2219,7 @@ var Bt = [
|
|
|
2181
2219
|
"data-mnav": "",
|
|
2182
2220
|
"data-mkey": `skill:${e.id}`,
|
|
2183
2221
|
on: { click: () => void this.toggleSkill(e) }
|
|
2184
|
-
},
|
|
2222
|
+
}, A("span", {
|
|
2185
2223
|
class: "knob",
|
|
2186
2224
|
"aria-hidden": "true"
|
|
2187
2225
|
})));
|
|
@@ -2198,11 +2236,11 @@ var Bt = [
|
|
|
2198
2236
|
presetsView() {
|
|
2199
2237
|
if (!this.presets) return [this.waiting("presets")];
|
|
2200
2238
|
if (this.draft) return [this.presetForm(this.draft)];
|
|
2201
|
-
let e = this.o.pins.length, t =
|
|
2239
|
+
let e = this.o.pins.length, t = A("p", { class: "mnote" }, e ? `A preset runs as an ask on the ${r(e, "selected element")}.` : `A preset runs as an ask. Select elements first (${P()}-click) to aim it.`), n = this.presets.filter((e) => e.source === "builtin"), i = this.presets.filter((e) => e.source === "project");
|
|
2202
2240
|
return [
|
|
2203
2241
|
t,
|
|
2204
|
-
|
|
2205
|
-
|
|
2242
|
+
A("section", { class: "mgroup" }, A("h3", null, "Onsite"), n.map((e) => this.presetRow(e))),
|
|
2243
|
+
A("section", { class: "mgroup" }, A("h3", null, "This project", A("span", { class: "mhint" }, ".onsite/presets.json")), i.length ? i.map((e) => this.presetRow(e)) : A("p", { class: "mnote" }, "None yet."), A("button", {
|
|
2206
2244
|
class: "btn",
|
|
2207
2245
|
type: "button",
|
|
2208
2246
|
"data-mnav": "",
|
|
@@ -2211,21 +2249,21 @@ var Bt = [
|
|
|
2211
2249
|
name: "",
|
|
2212
2250
|
message: ""
|
|
2213
2251
|
}) }
|
|
2214
|
-
},
|
|
2252
|
+
}, j(L.plus), "New preset"))
|
|
2215
2253
|
];
|
|
2216
2254
|
}
|
|
2217
2255
|
presetRow(e) {
|
|
2218
|
-
let t = e.count ?? this.o.takes, n =
|
|
2256
|
+
let t = e.count ?? this.o.takes, n = A("button", {
|
|
2219
2257
|
class: "mrun",
|
|
2220
2258
|
type: "button",
|
|
2221
2259
|
title: e.message,
|
|
2222
2260
|
"data-mnav": "",
|
|
2223
2261
|
"data-mkey": `preset:${e.id}`,
|
|
2224
2262
|
on: { click: () => void this.runPreset(e) }
|
|
2225
|
-
},
|
|
2226
|
-
if (e.source !== "project") return
|
|
2263
|
+
}, A("span", { class: "mname" }, e.name, A("span", { class: "mhint" }, r(t, "take"))), A("span", { class: "mdesc" }, e.message));
|
|
2264
|
+
if (e.source !== "project") return A("div", { class: "mrow" }, n);
|
|
2227
2265
|
let i = this.confirmDelete === e.id;
|
|
2228
|
-
return
|
|
2266
|
+
return A("div", { class: "mrow" }, n, A("button", {
|
|
2229
2267
|
class: "btn ghost icon",
|
|
2230
2268
|
type: "button",
|
|
2231
2269
|
"aria-label": `Edit ${e.name}`,
|
|
@@ -2237,17 +2275,17 @@ var Bt = [
|
|
|
2237
2275
|
message: e.message,
|
|
2238
2276
|
...e.count ? { count: e.count } : {}
|
|
2239
2277
|
}) }
|
|
2240
|
-
},
|
|
2278
|
+
}, j(L.edit)), A("button", {
|
|
2241
2279
|
class: `btn ghost${i ? " danger" : " icon"}`,
|
|
2242
2280
|
type: "button",
|
|
2243
2281
|
"aria-label": i ? `Delete ${e.name}: press again to delete` : `Delete ${e.name}`,
|
|
2244
2282
|
title: i ? "Press again to delete" : "Delete",
|
|
2245
2283
|
"data-mkey": `delete:${e.id}`,
|
|
2246
2284
|
on: { click: () => void this.deletePreset(e) }
|
|
2247
|
-
}, i ? "Delete?" :
|
|
2285
|
+
}, i ? "Delete?" : j(L.trash)));
|
|
2248
2286
|
}
|
|
2249
2287
|
presetForm(e) {
|
|
2250
|
-
let t = (t, n) =>
|
|
2288
|
+
let t = (t, n) => A("button", {
|
|
2251
2289
|
type: "button",
|
|
2252
2290
|
"aria-pressed": String(e.count === t),
|
|
2253
2291
|
"data-mkey": `count:${t ?? "default"}`,
|
|
@@ -2255,35 +2293,35 @@ var Bt = [
|
|
|
2255
2293
|
e.count = t, this.draw();
|
|
2256
2294
|
} }
|
|
2257
2295
|
}, n);
|
|
2258
|
-
return
|
|
2296
|
+
return A("form", {
|
|
2259
2297
|
class: "mform",
|
|
2260
2298
|
"aria-label": e.id ? "Edit the preset" : "New preset",
|
|
2261
2299
|
on: { submit: (e) => {
|
|
2262
2300
|
e.preventDefault(), this.savePreset();
|
|
2263
2301
|
} }
|
|
2264
|
-
},
|
|
2302
|
+
}, A("label", null, A("span", null, "Name"), A("input", {
|
|
2265
2303
|
type: "text",
|
|
2266
2304
|
name: "name",
|
|
2267
2305
|
maxlength: 60,
|
|
2268
2306
|
required: !0,
|
|
2269
2307
|
value: e.name,
|
|
2270
2308
|
"data-mkey": "f:name"
|
|
2271
|
-
})),
|
|
2309
|
+
})), A("label", null, A("span", null, "Ask"), A("textarea", {
|
|
2272
2310
|
name: "message",
|
|
2273
2311
|
rows: 4,
|
|
2274
2312
|
maxlength: 4e3,
|
|
2275
2313
|
required: !0,
|
|
2276
2314
|
"data-mkey": "f:message"
|
|
2277
|
-
}, e.message)),
|
|
2315
|
+
}, e.message)), A("div", { class: "mfield" }, A("span", null, "Takes"), A("div", {
|
|
2278
2316
|
class: "seg small",
|
|
2279
2317
|
role: "group",
|
|
2280
2318
|
"aria-label": "Takes"
|
|
2281
|
-
}, t(void 0, `Default (${this.o.takes})`), Array.from({ length: 3 }, (e, n) => t(n + 1, String(n + 1))))),
|
|
2319
|
+
}, t(void 0, `Default (${this.o.takes})`), Array.from({ length: 3 }, (e, n) => t(n + 1, String(n + 1))))), A("div", { class: "buttons" }, A("span", { class: "grow" }), A("button", {
|
|
2282
2320
|
class: "btn ghost",
|
|
2283
2321
|
type: "button",
|
|
2284
2322
|
"data-mkey": "f:cancel",
|
|
2285
2323
|
on: { click: () => this.edit(null) }
|
|
2286
|
-
}, "Cancel"),
|
|
2324
|
+
}, "Cancel"), A("button", {
|
|
2287
2325
|
class: "btn primary",
|
|
2288
2326
|
type: "submit",
|
|
2289
2327
|
"data-mkey": "f:save"
|
|
@@ -2328,35 +2366,35 @@ var Bt = [
|
|
|
2328
2366
|
this.o.thread.running ? this.o.showToast("A change is running. Wait for it, or stop it.") : (this.close(), this.o.setOpen(!0), await this.o.ask(e.message, e.count ?? this.o.takes));
|
|
2329
2367
|
}
|
|
2330
2368
|
settingsView() {
|
|
2331
|
-
let e = this.o, t = this.info, n =
|
|
2369
|
+
let e = this.o, t = this.info, n = A("select", {
|
|
2332
2370
|
id: "os-model",
|
|
2333
2371
|
"data-mkey": "set:model",
|
|
2334
2372
|
on: { change: (e) => void this.setModel(e.target.value) }
|
|
2335
|
-
},
|
|
2336
|
-
e.model && !
|
|
2337
|
-
let r = (e, t, n, r) =>
|
|
2373
|
+
}, A("option", { value: "" }, t?.pluginModel ? `Plugin default · ${t.pluginModel}` : "Plugin default"), Wt.map((e) => A("option", { value: e }, e)));
|
|
2374
|
+
e.model && !Wt.includes(e.model) && n.append(A("option", { value: e.model }, e.model)), n.value = e.model ?? "";
|
|
2375
|
+
let r = (e, t, n, r) => A("div", {
|
|
2338
2376
|
class: "seg small",
|
|
2339
2377
|
role: "group",
|
|
2340
2378
|
"aria-label": e
|
|
2341
|
-
}, n.map(([n, i]) =>
|
|
2379
|
+
}, n.map(([n, i]) => A("button", {
|
|
2342
2380
|
type: "button",
|
|
2343
2381
|
"aria-pressed": String(t === n),
|
|
2344
2382
|
"data-mkey": `set:${e}:${n}`,
|
|
2345
2383
|
on: { click: () => r(n) }
|
|
2346
|
-
}, i))), i = (e, t, n, r) =>
|
|
2384
|
+
}, i))), i = (e, t, n, r) => A("div", { class: "mset" }, r ? A("label", { for: r }, e) : A("span", null, e), t, n ? A("p", { class: "mhint" }, n) : null), a = A("div", {
|
|
2347
2385
|
class: "anchors",
|
|
2348
2386
|
role: "group",
|
|
2349
2387
|
"aria-label": "Dock position"
|
|
2350
|
-
},
|
|
2388
|
+
}, Ge.map((t) => A("button", {
|
|
2351
2389
|
type: "button",
|
|
2352
2390
|
"aria-pressed": String(e.saved === t),
|
|
2353
|
-
"aria-label":
|
|
2354
|
-
title:
|
|
2391
|
+
"aria-label": Kt[t],
|
|
2392
|
+
title: Kt[t],
|
|
2355
2393
|
"data-mkey": `set:dock:${t}`,
|
|
2356
2394
|
on: { click: () => {
|
|
2357
2395
|
e.moveDock(t), this.draw();
|
|
2358
2396
|
} }
|
|
2359
|
-
},
|
|
2397
|
+
}, A("span", {
|
|
2360
2398
|
class: "dot",
|
|
2361
2399
|
"aria-hidden": "true"
|
|
2362
2400
|
})))), o = t ? `Next runs use ${t.model || "the Agent SDK's default"}.` : null;
|
|
@@ -2375,7 +2413,7 @@ var Bt = [
|
|
|
2375
2413
|
e.setScheme(t), this.draw();
|
|
2376
2414
|
}), "Auto follows the page under the icon."),
|
|
2377
2415
|
i("Dock position", a, "Or drag the icon, or press Shift and an arrow key."),
|
|
2378
|
-
|
|
2416
|
+
A("dl", { class: "minfo" }, A("dt", null, "Version"), A("dd", { class: "mono" }, t?.version ?? "…"), A("dt", null, "Source folders"), A("dd", { class: "mono" }, t ? t.src.join(", ") : "…"))
|
|
2379
2417
|
];
|
|
2380
2418
|
}
|
|
2381
2419
|
async setModel(e) {
|
|
@@ -2395,7 +2433,7 @@ var Bt = [
|
|
|
2395
2433
|
this.draw();
|
|
2396
2434
|
}
|
|
2397
2435
|
waiting(e) {
|
|
2398
|
-
return
|
|
2436
|
+
return A("p", { class: "mnote" }, this.failed.has(e) ? `Could not read the ${e}. Close the menu and open it again.` : "Reading…");
|
|
2399
2437
|
}
|
|
2400
2438
|
focus(e) {
|
|
2401
2439
|
this.el.querySelector(e)?.focus({ preventScroll: !0 });
|
|
@@ -2405,7 +2443,7 @@ var Bt = [
|
|
|
2405
2443
|
}
|
|
2406
2444
|
key(e) {
|
|
2407
2445
|
if (!this.open) return !1;
|
|
2408
|
-
let t = e.composedPath()[0], n = t instanceof Element &&
|
|
2446
|
+
let t = e.composedPath()[0], n = t instanceof Element && ut(t);
|
|
2409
2447
|
if (e.key === "Escape") return this.draft ? this.edit(null) : this.view === "root" ? this.close(!0) : this.go("root"), !0;
|
|
2410
2448
|
if (n || !(t instanceof Node && this.el.contains(t))) return !1;
|
|
2411
2449
|
let r = [...this.el.querySelectorAll("[data-mnav]")], i = r.indexOf(t), a = (e) => r[(e + r.length) % r.length]?.focus({ preventScroll: !0 });
|
|
@@ -2418,8 +2456,8 @@ var Bt = [
|
|
|
2418
2456
|
else return !1;
|
|
2419
2457
|
return !0;
|
|
2420
2458
|
}
|
|
2421
|
-
},
|
|
2422
|
-
function
|
|
2459
|
+
}, Jt = (e) => e.w >= 384 ? 12 : 8, Yt = (e) => Math.max(200, Math.min(360, e.w - Jt(e) * 2));
|
|
2460
|
+
function Xt(e, t, n, r = {
|
|
2423
2461
|
edge: 8,
|
|
2424
2462
|
y: 8,
|
|
2425
2463
|
x: 8,
|
|
@@ -2454,9 +2492,9 @@ function Kt(e, t, n, r = {
|
|
|
2454
2492
|
side: "inside"
|
|
2455
2493
|
};
|
|
2456
2494
|
}
|
|
2457
|
-
function
|
|
2458
|
-
let r = t.tab, i =
|
|
2459
|
-
edge:
|
|
2495
|
+
function Zt(e, t, n) {
|
|
2496
|
+
let r = t.tab, i = Xt(e, t, n, {
|
|
2497
|
+
edge: Jt(n),
|
|
2460
2498
|
y: r ? 0 : 6,
|
|
2461
2499
|
x: 6,
|
|
2462
2500
|
left: r ? e.left - 30 : e.left
|
|
@@ -2471,20 +2509,20 @@ function qt(e, t, n) {
|
|
|
2471
2509
|
tabX: a
|
|
2472
2510
|
};
|
|
2473
2511
|
}
|
|
2474
|
-
var
|
|
2475
|
-
function
|
|
2512
|
+
var Qt = ["data-fkey", "data-mkey"];
|
|
2513
|
+
function $t(e, t, n, r) {
|
|
2476
2514
|
let i = (e) => Math.max(8, Math.min(e, r.w - n.w - 8)), a = (e) => Math.max(8, Math.min(e, r.h - n.h - 8));
|
|
2477
2515
|
return t ? {
|
|
2478
2516
|
left: i(t.left + (t.width - n.w) / 2),
|
|
2479
2517
|
top: a(t.top + (t.height - n.h) / 2),
|
|
2480
2518
|
side: "center"
|
|
2481
|
-
} : e ?
|
|
2519
|
+
} : e ? Xt(e, n, r) : {
|
|
2482
2520
|
left: i((r.w - n.w) / 2),
|
|
2483
2521
|
top: a((r.h - n.h) / 2),
|
|
2484
2522
|
side: "center"
|
|
2485
2523
|
};
|
|
2486
2524
|
}
|
|
2487
|
-
var
|
|
2525
|
+
var en = class {
|
|
2488
2526
|
shadow;
|
|
2489
2527
|
viewport;
|
|
2490
2528
|
el;
|
|
@@ -2492,7 +2530,7 @@ var Xt = class {
|
|
|
2492
2530
|
open = null;
|
|
2493
2531
|
back = null;
|
|
2494
2532
|
constructor(e, t) {
|
|
2495
|
-
this.shadow = e, this.viewport = t, this.el =
|
|
2533
|
+
this.shadow = e, this.viewport = t, this.el = A("div", { "data-questionbox": "" });
|
|
2496
2534
|
let n = (e) => {
|
|
2497
2535
|
let t = e.composedPath()[0];
|
|
2498
2536
|
t instanceof Element && !this.el.contains(t) && (this.last = t.closest("button, [tabindex], a, input") ?? t);
|
|
@@ -2504,29 +2542,29 @@ var Xt = class {
|
|
|
2504
2542
|
}
|
|
2505
2543
|
ask(e) {
|
|
2506
2544
|
this.close(!1);
|
|
2507
|
-
let t = this.control(), n =
|
|
2545
|
+
let t = this.control(), n = tn(t);
|
|
2508
2546
|
return new Promise((r) => {
|
|
2509
|
-
let i = "os-question-text", a =
|
|
2547
|
+
let i = "os-question-text", a = A("button", {
|
|
2510
2548
|
class: "btn ghost",
|
|
2511
2549
|
type: "button",
|
|
2512
2550
|
"data-question-no": "",
|
|
2513
2551
|
on: { click: () => this.close(!1) }
|
|
2514
|
-
}, "Cancel"), o =
|
|
2552
|
+
}, "Cancel"), o = A("button", {
|
|
2515
2553
|
class: "btn primary",
|
|
2516
2554
|
type: "button",
|
|
2517
2555
|
"data-question-yes": "",
|
|
2518
2556
|
on: { click: () => this.close(!0) }
|
|
2519
|
-
}, e.yes), s =
|
|
2557
|
+
}, e.yes), s = A("div", {
|
|
2520
2558
|
class: "question",
|
|
2521
2559
|
role: "alertdialog",
|
|
2522
2560
|
"aria-modal": "false",
|
|
2523
2561
|
"aria-label": e.label,
|
|
2524
2562
|
"aria-describedby": i,
|
|
2525
2563
|
"data-question": ""
|
|
2526
|
-
},
|
|
2564
|
+
}, A("p", {
|
|
2527
2565
|
class: "text",
|
|
2528
2566
|
id: i
|
|
2529
|
-
}, e.text),
|
|
2567
|
+
}, e.text), A("div", { class: "buttons" }, A("span", { class: "grow" }), a, o));
|
|
2530
2568
|
this.open = {
|
|
2531
2569
|
card: s,
|
|
2532
2570
|
yes: o,
|
|
@@ -2567,11 +2605,11 @@ var Xt = class {
|
|
|
2567
2605
|
if (e.card.style.width = `${n}px`, e.from?.isConnected) {
|
|
2568
2606
|
let t = e.from.closest(".panel"), n = e.from.getBoundingClientRect();
|
|
2569
2607
|
e.at = {
|
|
2570
|
-
control: n.width > 0 || n.height > 0 ?
|
|
2571
|
-
panel: t ?
|
|
2608
|
+
control: n.width > 0 || n.height > 0 ? nn(n, 4) : null,
|
|
2609
|
+
panel: t ? nn(t.getBoundingClientRect()) : null
|
|
2572
2610
|
};
|
|
2573
2611
|
}
|
|
2574
|
-
let r =
|
|
2612
|
+
let r = $t(e.at.control, e.at.panel, {
|
|
2575
2613
|
w: n,
|
|
2576
2614
|
h: e.card.offsetHeight || 110
|
|
2577
2615
|
}, t);
|
|
@@ -2584,8 +2622,8 @@ var Xt = class {
|
|
|
2584
2622
|
this.open && !e.composedPath().includes(this.open.card) && this.close(!1);
|
|
2585
2623
|
};
|
|
2586
2624
|
};
|
|
2587
|
-
function
|
|
2588
|
-
for (let t of
|
|
2625
|
+
function tn(e) {
|
|
2626
|
+
for (let t of Qt) {
|
|
2589
2627
|
let n = e?.getAttribute(t);
|
|
2590
2628
|
if (n) return {
|
|
2591
2629
|
attr: t,
|
|
@@ -2594,13 +2632,13 @@ function Zt(e) {
|
|
|
2594
2632
|
}
|
|
2595
2633
|
return null;
|
|
2596
2634
|
}
|
|
2597
|
-
var
|
|
2635
|
+
var nn = (e, t = 0) => ({
|
|
2598
2636
|
left: e.left - t,
|
|
2599
2637
|
top: e.top - t,
|
|
2600
2638
|
width: e.width + t * 2,
|
|
2601
2639
|
height: e.height + t * 2
|
|
2602
2640
|
}), Y = (e, t) => e.endsWith("%") ? Number.parseFloat(e) / 100 * t : Number.parseFloat(e);
|
|
2603
|
-
function
|
|
2641
|
+
function rn(e) {
|
|
2604
2642
|
let t = e.trim().toLowerCase();
|
|
2605
2643
|
if (t === "" || t === "transparent" || t === "none") return {
|
|
2606
2644
|
r: 0,
|
|
@@ -2650,7 +2688,7 @@ function $t(e) {
|
|
|
2650
2688
|
}
|
|
2651
2689
|
let l = NaN;
|
|
2652
2690
|
if ((r === "oklch" || r === "oklab") && (l = Y(s[0] ?? "", 1)), (r === "lab" || r === "lch") && (l = Y(s[0] ?? "", 100) / 100), Number.isNaN(l)) return null;
|
|
2653
|
-
let u = Math.round(Math.max(0, Math.min(1, r.startsWith("ok") ? l ** 3 :
|
|
2691
|
+
let u = Math.round(Math.max(0, Math.min(1, r.startsWith("ok") ? l ** 3 : an(l))) ** (1 / 2.2) * 255);
|
|
2654
2692
|
return {
|
|
2655
2693
|
r: u,
|
|
2656
2694
|
g: u,
|
|
@@ -2658,46 +2696,46 @@ function $t(e) {
|
|
|
2658
2696
|
a: c
|
|
2659
2697
|
};
|
|
2660
2698
|
}
|
|
2661
|
-
function
|
|
2699
|
+
function an(e) {
|
|
2662
2700
|
let t = e * 100;
|
|
2663
2701
|
return t > 8 ? ((t + 16) / 116) ** 3 : t / 903.3;
|
|
2664
2702
|
}
|
|
2665
|
-
function
|
|
2703
|
+
function on(e) {
|
|
2666
2704
|
let t = (e) => {
|
|
2667
2705
|
let t = e / 255;
|
|
2668
2706
|
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
2669
2707
|
};
|
|
2670
2708
|
return .2126 * t(e.r) + .7152 * t(e.g) + .0722 * t(e.b);
|
|
2671
2709
|
}
|
|
2672
|
-
function
|
|
2710
|
+
function sn() {
|
|
2673
2711
|
try {
|
|
2674
2712
|
return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
2675
2713
|
} catch {
|
|
2676
2714
|
return "light";
|
|
2677
2715
|
}
|
|
2678
2716
|
}
|
|
2679
|
-
function
|
|
2717
|
+
function cn(e) {
|
|
2680
2718
|
let { x: t, y: n } = e.point(), r = typeof e.doc.elementsFromPoint == "function" ? e.doc.elementsFromPoint(t, n) : [];
|
|
2681
2719
|
for (let t of r) if (t !== e.host && !e.host?.contains(t)) return t;
|
|
2682
2720
|
return e.doc.body ?? e.doc.documentElement;
|
|
2683
2721
|
}
|
|
2684
|
-
function
|
|
2722
|
+
function ln(e) {
|
|
2685
2723
|
let t = e.doc.defaultView ?? window, n = e.doc.documentElement, r = e.doc.body, i = (e) => {
|
|
2686
2724
|
if (!e) return null;
|
|
2687
|
-
let n =
|
|
2725
|
+
let n = rn(t.getComputedStyle(e).backgroundColor);
|
|
2688
2726
|
return n && n.a >= .99 ? n : null;
|
|
2689
|
-
}, a = (e) =>
|
|
2690
|
-
for (let t =
|
|
2727
|
+
}, a = (e) => on(e) < .4 ? "dark" : "light";
|
|
2728
|
+
for (let t = cn(e); t && t !== n; t = t.parentElement) {
|
|
2691
2729
|
let e = i(t);
|
|
2692
2730
|
if (e) return a(e);
|
|
2693
2731
|
}
|
|
2694
2732
|
let o = i(n) ?? i(r);
|
|
2695
|
-
return o ? a(o) :
|
|
2733
|
+
return o ? a(o) : sn();
|
|
2696
2734
|
}
|
|
2697
|
-
function
|
|
2698
|
-
let n = e.doc.defaultView ?? window, r =
|
|
2735
|
+
function un(e, t) {
|
|
2736
|
+
let n = e.doc.defaultView ?? window, r = ln(e), i = 0, a = () => {
|
|
2699
2737
|
i = 0;
|
|
2700
|
-
let n =
|
|
2738
|
+
let n = ln(e);
|
|
2701
2739
|
n !== r && (r = n, d.scheme = n, t(n));
|
|
2702
2740
|
}, o = () => {
|
|
2703
2741
|
i ||= n.setTimeout(a, 0), n.setTimeout(a, 300);
|
|
@@ -2710,7 +2748,7 @@ function on(e, t) {
|
|
|
2710
2748
|
]
|
|
2711
2749
|
});
|
|
2712
2750
|
c(e.doc.documentElement), c(e.doc.body);
|
|
2713
|
-
let l =
|
|
2751
|
+
let l = pn(n, o), u = null;
|
|
2714
2752
|
try {
|
|
2715
2753
|
u = n.matchMedia("(prefers-color-scheme: dark)"), u.addEventListener?.("change", o);
|
|
2716
2754
|
} catch {
|
|
@@ -2725,44 +2763,44 @@ function on(e, t) {
|
|
|
2725
2763
|
};
|
|
2726
2764
|
return d;
|
|
2727
2765
|
}
|
|
2728
|
-
var
|
|
2729
|
-
function
|
|
2766
|
+
var dn = "onsite:route", fn = /* @__PURE__ */ new WeakSet();
|
|
2767
|
+
function pn(e, t) {
|
|
2730
2768
|
let n = e.history;
|
|
2731
|
-
if (n && !
|
|
2732
|
-
|
|
2769
|
+
if (n && !fn.has(n)) {
|
|
2770
|
+
fn.add(n);
|
|
2733
2771
|
for (let t of ["pushState", "replaceState"]) {
|
|
2734
2772
|
let r = n[t];
|
|
2735
2773
|
n[t] = function(...t) {
|
|
2736
2774
|
let n = r.apply(this, t);
|
|
2737
|
-
return e.dispatchEvent(new Event(
|
|
2775
|
+
return e.dispatchEvent(new Event(dn)), n;
|
|
2738
2776
|
};
|
|
2739
2777
|
}
|
|
2740
2778
|
}
|
|
2741
|
-
return e.addEventListener(
|
|
2742
|
-
e.removeEventListener(
|
|
2779
|
+
return e.addEventListener(dn, t), e.addEventListener("popstate", t), () => {
|
|
2780
|
+
e.removeEventListener(dn, t), e.removeEventListener("popstate", t);
|
|
2743
2781
|
};
|
|
2744
2782
|
}
|
|
2745
2783
|
// src/tooltip.ts
|
|
2746
|
-
var
|
|
2784
|
+
var mn = "os-icontip", X = 8, hn = (e) => e instanceof Element ? e.closest("[data-tip]") : null, gn = class {
|
|
2747
2785
|
root;
|
|
2748
2786
|
el;
|
|
2749
2787
|
at = null;
|
|
2750
2788
|
timer = 0;
|
|
2751
2789
|
constructor(e) {
|
|
2752
|
-
this.root = e, this.el =
|
|
2790
|
+
this.root = e, this.el = A("div", {
|
|
2753
2791
|
class: "icontip",
|
|
2754
|
-
id:
|
|
2792
|
+
id: mn,
|
|
2755
2793
|
role: "tooltip",
|
|
2756
2794
|
hidden: !0,
|
|
2757
2795
|
"data-icontip": ""
|
|
2758
2796
|
}), e.addEventListener("pointerover", (e) => {
|
|
2759
|
-
let t =
|
|
2797
|
+
let t = hn(e.target);
|
|
2760
2798
|
if (!t) return this.hide();
|
|
2761
2799
|
t !== this.at && (this.at ? this.show(t) : this.soon(t));
|
|
2762
2800
|
}), e.addEventListener("pointerout", (e) => {
|
|
2763
|
-
|
|
2801
|
+
hn(e.relatedTarget) || this.hide();
|
|
2764
2802
|
}), e.addEventListener("focusin", (e) => {
|
|
2765
|
-
let t =
|
|
2803
|
+
let t = hn(e.target);
|
|
2766
2804
|
t?.matches(":focus-visible") && this.show(t);
|
|
2767
2805
|
}), e.addEventListener("focusout", (e) => {
|
|
2768
2806
|
e.target === this.at && this.hide();
|
|
@@ -2782,7 +2820,7 @@ var un = "os-icontip", X = 8, dn = (e) => e instanceof Element ? e.closest("[dat
|
|
|
2782
2820
|
show(e) {
|
|
2783
2821
|
clearTimeout(this.timer), this.at && this.at !== e && this.at.removeAttribute("aria-describedby"), this.at = e;
|
|
2784
2822
|
let t = (e.dataset.tipKeys ?? "").split(" ").filter(Boolean), n = e.dataset.tipMore;
|
|
2785
|
-
this.el.replaceChildren(
|
|
2823
|
+
this.el.replaceChildren(A("span", { class: "tl" }, e.dataset.tip ?? ""), ...t.map((e) => A("kbd", null, e))), n && this.el.append(A("span", { class: "tm" }, n)), n && e.setAttribute("aria-describedby", mn), this.el.hidden = !1, this.place();
|
|
2786
2824
|
}
|
|
2787
2825
|
place() {
|
|
2788
2826
|
let e = this.at;
|
|
@@ -2801,20 +2839,20 @@ var un = "os-icontip", X = 8, dn = (e) => e instanceof Element ? e.closest("[dat
|
|
|
2801
2839
|
let t = this.current(e);
|
|
2802
2840
|
t ? this.show(t) : this.hide();
|
|
2803
2841
|
}
|
|
2804
|
-
},
|
|
2805
|
-
function
|
|
2806
|
-
t.split(n ?
|
|
2842
|
+
}, _n = /(`[^`\n]+`)/, vn = /(`[^`\n]+`|\*\*(?=\S)(?:`[^`\n]+`|[^`\n])+?(?<=\S)\*\*)/;
|
|
2843
|
+
function yn(e, t, n = !0) {
|
|
2844
|
+
t.split(n ? vn : _n).forEach((t, n) => {
|
|
2807
2845
|
if (n % 2 == 0) t && e.append(document.createTextNode(t));
|
|
2808
2846
|
else if (t.startsWith("`")) {
|
|
2809
2847
|
let n = document.createElement("code");
|
|
2810
2848
|
n.textContent = t.slice(1, -1), e.append(n);
|
|
2811
2849
|
} else {
|
|
2812
2850
|
let n = document.createElement("strong");
|
|
2813
|
-
|
|
2851
|
+
yn(n, t.slice(2, -2), !1), e.append(n);
|
|
2814
2852
|
}
|
|
2815
2853
|
});
|
|
2816
2854
|
}
|
|
2817
|
-
function
|
|
2855
|
+
function bn(e) {
|
|
2818
2856
|
let t = document.createDocumentFragment();
|
|
2819
2857
|
return e.split(/```[^\n`]*\n?([\s\S]*?)(?:```|$)/).forEach((e, n) => {
|
|
2820
2858
|
if (n % 2 == 1) {
|
|
@@ -2823,19 +2861,19 @@ function gn(e) {
|
|
|
2823
2861
|
} else for (let n of e.split(/\n{2,}/)) {
|
|
2824
2862
|
if (!n.trim()) continue;
|
|
2825
2863
|
let e = document.createElement("p");
|
|
2826
|
-
|
|
2864
|
+
yn(e, n.replace(/^\n+|\n+$/g, "")), t.append(e);
|
|
2827
2865
|
}
|
|
2828
2866
|
}), t;
|
|
2829
2867
|
}
|
|
2830
2868
|
// src/views.ts
|
|
2831
|
-
function
|
|
2869
|
+
function xn(e) {
|
|
2832
2870
|
let t = !!e.thread.running, n = e.openTakes().length, i = e.thread.queue?.length ?? 0, a = t ? ` · working${i ? `, ${i} waiting` : ""}` : n ? ` · ${r(n, "take")} to keep or skip` : "";
|
|
2833
|
-
return [
|
|
2871
|
+
return [A("button", {
|
|
2834
2872
|
class: "dock",
|
|
2835
2873
|
type: "button",
|
|
2836
2874
|
"aria-label": e.open ? "Close Onsite · drag to move" : `Open Onsite${a} · drag to move`,
|
|
2837
2875
|
"aria-expanded": String(e.open),
|
|
2838
|
-
"aria-describedby": e.open ? null :
|
|
2876
|
+
"aria-describedby": e.open ? null : Cn,
|
|
2839
2877
|
"data-dock": "",
|
|
2840
2878
|
on: {
|
|
2841
2879
|
click: () => e.dockClick(),
|
|
@@ -2848,17 +2886,17 @@ function _n(e) {
|
|
|
2848
2886
|
focus: () => e.tipFocus(),
|
|
2849
2887
|
blur: () => e.setTip(!1)
|
|
2850
2888
|
}
|
|
2851
|
-
},
|
|
2889
|
+
}, j(F(26, 2.8, t)), t && i ? A("span", {
|
|
2852
2890
|
class: "badge",
|
|
2853
2891
|
"aria-hidden": "true",
|
|
2854
2892
|
title: `1 working, ${i} waiting`
|
|
2855
|
-
}, String(i + 1)) : !t && n ?
|
|
2893
|
+
}, String(i + 1)) : !t && n ? A("span", {
|
|
2856
2894
|
class: "badge",
|
|
2857
2895
|
"aria-hidden": "true"
|
|
2858
|
-
}, String(n)) : null),
|
|
2896
|
+
}, String(n)) : null), Sn(e, "dockmore")];
|
|
2859
2897
|
}
|
|
2860
|
-
function
|
|
2861
|
-
return
|
|
2898
|
+
function Sn(e, t) {
|
|
2899
|
+
return A("button", {
|
|
2862
2900
|
class: t,
|
|
2863
2901
|
type: "button",
|
|
2864
2902
|
"aria-label": "Onsite menu: changes, export, skills, presets, settings",
|
|
@@ -2870,177 +2908,177 @@ function vn(e, t) {
|
|
|
2870
2908
|
on: { click: (t) => {
|
|
2871
2909
|
t.stopPropagation(), e.menu.toggle();
|
|
2872
2910
|
} }
|
|
2873
|
-
},
|
|
2911
|
+
}, j(L.dots));
|
|
2874
2912
|
}
|
|
2875
|
-
var
|
|
2876
|
-
function
|
|
2877
|
-
let e =
|
|
2878
|
-
return
|
|
2913
|
+
var Cn = "os-tip";
|
|
2914
|
+
function wn() {
|
|
2915
|
+
let e = P(), t = (e) => A("kbd", null, e), n = (e, ...t) => [A("dt", null, e), A("dd", null, ...t)];
|
|
2916
|
+
return A("div", {
|
|
2879
2917
|
class: "tip",
|
|
2880
|
-
id:
|
|
2918
|
+
id: Cn,
|
|
2881
2919
|
role: "tooltip",
|
|
2882
2920
|
hidden: !0,
|
|
2883
2921
|
"data-tip": ""
|
|
2884
|
-
},
|
|
2922
|
+
}, A("div", { class: "brand" }, j(F(14, 3.2)), A("span", null, "onsite")), A("dl", null, n("Open", "2×", t(e)), n("Select", j(L.mouse), A("span", { class: "sr" }, "click"), "+", t(e)), n("Changes", "hold", t(e)), n("Comment", "type, then", t(e), "+", t("↵")), n("Menu", "right-click or ⋯"), n("Move", "drag or", t("⇧"), "+", t("arrows"))));
|
|
2885
2923
|
}
|
|
2886
|
-
function
|
|
2924
|
+
function Tn(e) {
|
|
2887
2925
|
let t = e.toast;
|
|
2888
2926
|
if (!t) return null;
|
|
2889
2927
|
let n = t.undo;
|
|
2890
|
-
return
|
|
2928
|
+
return A("div", {
|
|
2891
2929
|
class: `toast${n ? "" : " plain"}`,
|
|
2892
2930
|
role: "status"
|
|
2893
|
-
},
|
|
2931
|
+
}, A("span", null, t.text), n ? A("button", {
|
|
2894
2932
|
class: "btn ghost",
|
|
2895
2933
|
type: "button",
|
|
2896
2934
|
on: { click: () => void e.undo(n) }
|
|
2897
2935
|
}, "Undo") : null);
|
|
2898
2936
|
}
|
|
2899
|
-
function
|
|
2900
|
-
return
|
|
2937
|
+
function En(e, t) {
|
|
2938
|
+
return A("aside", {
|
|
2901
2939
|
class: `panel scroll${t ? " opening" : ""}`,
|
|
2902
2940
|
"aria-label": "Onsite",
|
|
2903
2941
|
"data-panel": ""
|
|
2904
|
-
},
|
|
2942
|
+
}, Dn(e), e.hidden ? A("div", {
|
|
2905
2943
|
class: "hiddenbar",
|
|
2906
2944
|
"data-hiddenbar": ""
|
|
2907
|
-
},
|
|
2945
|
+
}, j(L.hide), A("span", { class: "grow" }, `The icon is hidden. Double-tap ${P()} opens Onsite.`), A("button", {
|
|
2908
2946
|
class: "link",
|
|
2909
2947
|
type: "button",
|
|
2910
2948
|
on: { click: () => void e.setHidden(!1) }
|
|
2911
|
-
}, "Show icon")) : null,
|
|
2949
|
+
}, "Show icon")) : null, On(e), A("div", {
|
|
2912
2950
|
class: "body scroll",
|
|
2913
2951
|
id: "os-view",
|
|
2914
2952
|
role: "tabpanel",
|
|
2915
2953
|
"aria-label": e.tab
|
|
2916
|
-
}, e.tab === "thread" ?
|
|
2954
|
+
}, e.tab === "thread" ? Mn(e) : e.tab === "changes" ? In(e) : Rn(e)), Bn(e), Wn(e));
|
|
2917
2955
|
}
|
|
2918
|
-
function
|
|
2919
|
-
let t = (t, n, r) =>
|
|
2956
|
+
function Dn(e) {
|
|
2957
|
+
let t = (t, n, r) => A("button", {
|
|
2920
2958
|
class: "tab",
|
|
2921
2959
|
type: "button",
|
|
2922
2960
|
role: "tab",
|
|
2923
2961
|
"aria-selected": String(e.tab === t),
|
|
2924
2962
|
"aria-controls": "os-view",
|
|
2925
2963
|
on: { click: () => e.setTab(t) }
|
|
2926
|
-
}, n, r ?
|
|
2964
|
+
}, n, r ? A("span", { class: "count" }, r) : null), n = (e.changes?.groups.reduce((e, t) => e + t.files.length, 0) ?? 0) + kn(e).length, r = {
|
|
2927
2965
|
auto: "Auto",
|
|
2928
2966
|
dark: "Dark",
|
|
2929
2967
|
light: "Light"
|
|
2930
2968
|
}, i = e.pref === "auto" ? `Auto · ${r[e.pageScheme]}` : r[e.pref];
|
|
2931
|
-
return
|
|
2969
|
+
return A("div", {
|
|
2932
2970
|
class: "head",
|
|
2933
2971
|
"data-head": "",
|
|
2934
2972
|
on: { pointerdown: (t) => e.dragStart(t, "head") }
|
|
2935
|
-
},
|
|
2973
|
+
}, A("button", {
|
|
2936
2974
|
class: "grip",
|
|
2937
2975
|
type: "button",
|
|
2938
2976
|
"aria-label": "Move Onsite: drag to move, or press Shift and an arrow key",
|
|
2939
2977
|
"data-grip": ""
|
|
2940
|
-
},
|
|
2978
|
+
}, j(F(18, 3))), A("div", {
|
|
2941
2979
|
class: "tabs",
|
|
2942
2980
|
role: "tablist",
|
|
2943
2981
|
"aria-label": "Onsite views"
|
|
2944
|
-
}, t("thread", "Thread"), t("changes", "Changes", n ? String(n) : ""), t("export", "Export")),
|
|
2982
|
+
}, t("thread", "Thread"), t("changes", "Changes", n ? String(n) : ""), t("export", "Export")), A("span", { class: "grow" }), Sn(e, "btn ghost icon"), A("button", {
|
|
2945
2983
|
class: "btn ghost scheme",
|
|
2946
2984
|
type: "button",
|
|
2947
2985
|
"aria-label": `Onsite's scheme: ${r[e.pref]}. Change it`,
|
|
2948
2986
|
title: "Auto follows the page. Pin Dark or Light here.",
|
|
2949
2987
|
"data-scheme-button": "",
|
|
2950
2988
|
on: { click: () => void e.cycleScheme() }
|
|
2951
|
-
},
|
|
2989
|
+
}, j(L.scheme), i), A("button", {
|
|
2952
2990
|
class: "btn ghost icon",
|
|
2953
2991
|
type: "button",
|
|
2954
2992
|
"aria-label": "Close Onsite",
|
|
2955
2993
|
on: { click: () => e.setOpen(!1) }
|
|
2956
|
-
},
|
|
2994
|
+
}, j(L.close)));
|
|
2957
2995
|
}
|
|
2958
|
-
function
|
|
2959
|
-
let t =
|
|
2996
|
+
function On(e) {
|
|
2997
|
+
let t = P(), n = (e, t, n, r, i, a) => A("button", {
|
|
2960
2998
|
class: "btn",
|
|
2961
2999
|
type: "button",
|
|
2962
3000
|
"aria-pressed": String(e),
|
|
2963
3001
|
title: i,
|
|
2964
3002
|
on: { click: a }
|
|
2965
|
-
},
|
|
3003
|
+
}, j(t), n, A("span", {
|
|
2966
3004
|
class: "key",
|
|
2967
3005
|
"aria-hidden": "true"
|
|
2968
3006
|
}, r));
|
|
2969
|
-
return
|
|
3007
|
+
return A("div", { class: "modes" }, n(e.mode === "select", L.select, "Select", t, `Click elements to mention them. ${t}-click works too.`, () => e.setMode(e.mode === "select" ? "idle" : "select")), n(e.alt !== "off", L.alt, "Changes", `hold ${t}`, `Outline what the takes changed. Hold ${t} to peek.`, () => e.toggleAltView()));
|
|
2970
3008
|
}
|
|
2971
|
-
var
|
|
2972
|
-
function
|
|
3009
|
+
var kn = (e) => e.thread.comments.filter((e) => !e.resolved), An = (e, t) => e.thread.comments.findIndex((e) => e.id === t) + 1;
|
|
3010
|
+
function jn(e, t) {
|
|
2973
3011
|
return e.drawn.has(t) ? "" : (e.drawn.add(t), " in");
|
|
2974
3012
|
}
|
|
2975
|
-
function
|
|
3013
|
+
function Mn(e) {
|
|
2976
3014
|
let { entries: t } = e.thread;
|
|
2977
|
-
if (!t.length) return
|
|
2978
|
-
let n =
|
|
3015
|
+
if (!t.length) return A("div", { class: "empty" }, A("p", { class: "lead" }, "Point at the page, then say what to change."), A("p", null, `Hold ${P()} and click elements to mention them. Every change lands as a take you can switch, keep or skip. Nothing reaches your files until you keep it.`));
|
|
3016
|
+
let n = A("div", {
|
|
2979
3017
|
class: "thread",
|
|
2980
3018
|
role: "log",
|
|
2981
3019
|
"aria-label": "Thread"
|
|
2982
3020
|
}), r = /* @__PURE__ */ new Map();
|
|
2983
3021
|
for (let e of t) e.who !== "person" && r.set(`${e.id}:${e.who}`, e);
|
|
2984
3022
|
let i = new Set(t.filter((e) => e.who === "person").map((e) => e.id)), a = e.lastChange();
|
|
2985
|
-
for (let o of t) if (o.who === "person") n.append(
|
|
3023
|
+
for (let o of t) if (o.who === "person") n.append(Nn(e, o, r.get(`${o.id}:agent`), r.get(`${o.id}:error`)));
|
|
2986
3024
|
else if (i.has(o.id)) continue;
|
|
2987
|
-
else o.who === "error" ? n.append(
|
|
3025
|
+
else o.who === "error" ? n.append(A("div", { class: `system error${jn(e, `x:${o.id}`)}` }, j(L.error), o.text)) : n.append(Fn(e, o, o.id === a));
|
|
2988
3026
|
return n;
|
|
2989
3027
|
}
|
|
2990
|
-
function
|
|
2991
|
-
let a = e.thread.running === t.id, o = t.kind === "takes" || (n?.takes?.length ?? 0) > 1, s = t.steps ?? [], f = [...(t.selection ?? []).map((e) =>
|
|
3028
|
+
function Nn(e, t, n, i) {
|
|
3029
|
+
let a = e.thread.running === t.id, o = t.kind === "takes" || (n?.takes?.length ?? 0) > 1, s = t.steps ?? [], f = [...(t.selection ?? []).map((e) => A("span", {
|
|
2992
3030
|
class: "chip-dark",
|
|
2993
3031
|
title: l(e)
|
|
2994
|
-
}, c(e.src))), ...(t.comments ?? []).map((t) =>
|
|
2995
|
-
class: `turn${
|
|
3032
|
+
}, c(e.src))), ...(t.comments ?? []).map((t) => A("span", { class: "chip-dark" }, `Comment ${An(e, t) || "?"}`))], p = A("div", {
|
|
3033
|
+
class: `turn${jn(e, `t:${t.id}`)}`,
|
|
2996
3034
|
"data-run": t.id
|
|
2997
|
-
},
|
|
3035
|
+
}, A("div", { class: "ask" }, t.text, f.length ? A("div", { class: "chips" }, f) : null)), m = (n) => A("ul", {
|
|
2998
3036
|
class: "steps",
|
|
2999
3037
|
"aria-label": "Steps"
|
|
3000
3038
|
}, (n ? s : []).map((n, r) => {
|
|
3001
3039
|
let i = n.tool === "src_write" || n.tool === "src_edit";
|
|
3002
|
-
return
|
|
3040
|
+
return A("li", { class: `step${i ? " write" : ""}${jn(e, `s:${t.id}:${r}`)}` }, j(i ? L.write : n.tool === "src_list" ? L.list : L.read), A("span", null, v(n, o)));
|
|
3003
3041
|
}));
|
|
3004
3042
|
a && s.length && p.append(m(!0));
|
|
3005
3043
|
let h = a ? e.live?.run === t.id ? e.live.text : "" : n?.text ?? "";
|
|
3006
|
-
if (a) p.append(
|
|
3044
|
+
if (a) p.append(A("p", {
|
|
3007
3045
|
class: "reply",
|
|
3008
3046
|
"data-live": "",
|
|
3009
3047
|
"aria-live": "off"
|
|
3010
|
-
}, h,
|
|
3048
|
+
}, h, A("span", {
|
|
3011
3049
|
class: "caret",
|
|
3012
3050
|
"aria-hidden": "true"
|
|
3013
3051
|
})));
|
|
3014
3052
|
else if (h) {
|
|
3015
|
-
let e =
|
|
3016
|
-
e.append(
|
|
3053
|
+
let e = A("div", { class: "reply" });
|
|
3054
|
+
e.append(bn(h)), p.append(e);
|
|
3017
3055
|
}
|
|
3018
|
-
let g =
|
|
3056
|
+
let g = A("div", {
|
|
3019
3057
|
class: "status",
|
|
3020
3058
|
role: a ? "status" : null
|
|
3021
3059
|
}), _ = e.thread.queue?.indexOf(t.id) ?? -1;
|
|
3022
|
-
if (_ >= 0) g.classList.add("queued"), g.append(
|
|
3060
|
+
if (_ >= 0) g.classList.add("queued"), g.append(A("span", {
|
|
3023
3061
|
class: "qdot",
|
|
3024
3062
|
"aria-hidden": "true"
|
|
3025
|
-
}),
|
|
3063
|
+
}), A("span", null, d(_)), A("button", {
|
|
3026
3064
|
class: "link",
|
|
3027
3065
|
type: "button",
|
|
3028
3066
|
"data-cancel": t.id,
|
|
3029
3067
|
on: { click: () => void e.cancel(t.id) }
|
|
3030
3068
|
}, "Cancel"));
|
|
3031
3069
|
else if (a) {
|
|
3032
|
-
let t = s.filter((e) => e.take).at(-1)?.take ??
|
|
3033
|
-
g.append(
|
|
3070
|
+
let t = s.filter((e) => e.take).at(-1)?.take ?? Pn(e);
|
|
3071
|
+
g.append(A("span", {
|
|
3034
3072
|
class: "spin",
|
|
3035
3073
|
"aria-hidden": "true"
|
|
3036
|
-
}),
|
|
3037
|
-
} else i ? (g.classList.add("error"), g.append(
|
|
3074
|
+
}), A("span", null, `Working on ${u(t)}`));
|
|
3075
|
+
} else i ? (g.classList.add("error"), g.append(j(L.error), A("span", null, i.text))) : n?.stopped ? g.append(A("span", {
|
|
3038
3076
|
class: "square",
|
|
3039
3077
|
"aria-hidden": "true"
|
|
3040
|
-
}),
|
|
3078
|
+
}), A("span", null, se(n, e.thread.takes))) : n && g.append(j(L.done), A("span", null, oe(n, t, e.thread.takes)));
|
|
3041
3079
|
if (!a && s.length) {
|
|
3042
3080
|
let n = e.openSteps.has(t.id);
|
|
3043
|
-
g.append(
|
|
3081
|
+
g.append(A("button", {
|
|
3044
3082
|
class: "link",
|
|
3045
3083
|
type: "button",
|
|
3046
3084
|
"aria-expanded": String(n),
|
|
@@ -3051,70 +3089,70 @@ function kn(e, t, n, i) {
|
|
|
3051
3089
|
}
|
|
3052
3090
|
return g.childNodes.length && p.append(g), !a && e.openSteps.has(t.id) && p.append(m(!0)), p;
|
|
3053
3091
|
}
|
|
3054
|
-
function
|
|
3092
|
+
function Pn(e) {
|
|
3055
3093
|
let t = e.thread.running, n = e.thread.takes.filter((e) => e.of === t);
|
|
3056
3094
|
return n.length ? Math.max(...n.map((e) => e.no)) : 1;
|
|
3057
3095
|
}
|
|
3058
|
-
function
|
|
3059
|
-
let r = t.kind === "undo" ?
|
|
3060
|
-
return
|
|
3096
|
+
function Fn(e, t, n) {
|
|
3097
|
+
let r = t.kind === "undo" ? L.undo : L.keep, i = t.text && !/^(Kept|Skipped|Undone)\.?$/.test(t.text) ? t.text : "";
|
|
3098
|
+
return A("div", { class: `system${jn(e, `c:${t.id}`)}` }, j(r), A("span", null, ce(t)), t.undone ? A("span", null, "· undone") : null, n ? A("button", {
|
|
3061
3099
|
class: "link",
|
|
3062
3100
|
type: "button",
|
|
3063
3101
|
disabled: !!e.busy,
|
|
3064
3102
|
on: { click: () => void e.undo(t.id) }
|
|
3065
|
-
}, "Undo") : null, i ?
|
|
3103
|
+
}, "Undo") : null, i ? A("span", { class: "muted" }, i) : null);
|
|
3066
3104
|
}
|
|
3067
|
-
function
|
|
3068
|
-
let t =
|
|
3069
|
-
if (!n.length && !r.length) return t.append(
|
|
3070
|
-
for (let r of n) t.append(
|
|
3071
|
-
return r.length && t.append(
|
|
3072
|
-
let n =
|
|
3073
|
-
return
|
|
3105
|
+
function In(e) {
|
|
3106
|
+
let t = A("div", { class: "view" }), n = (e.changes?.groups ?? []).filter((e) => e.files.length), r = kn(e);
|
|
3107
|
+
if (!n.length && !r.length) return t.append(A("p", { class: "note" }, "No open takes yet. When a take changes files, they show here by kind, with the takes that touch each one.")), t;
|
|
3108
|
+
for (let r of n) t.append(A("section", { class: "group" }, A("h3", null, le[r.kind]), r.files.map((t) => Ln(e, t))));
|
|
3109
|
+
return r.length && t.append(A("section", { class: "group" }, A("h3", null, "Comments"), r.map((t) => {
|
|
3110
|
+
let n = An(e, t.id), r = e.chosen.includes(t.id), i = t.take ? ` · on ${Z(e, t.take)}` : "";
|
|
3111
|
+
return A("div", { class: "card" }, A("div", { class: "comment" }, A("span", { class: "note-no" }, String(n)), A("div", {
|
|
3074
3112
|
class: "line",
|
|
3075
3113
|
style: "flex-direction:column;align-items:stretch;gap:4px;flex-grow:1"
|
|
3076
|
-
},
|
|
3114
|
+
}, A("span", { class: "text" }, t.text), A("span", { class: "where" }, `${l(t.stamp)}${i}`), A("div", { class: "actions" }, A("button", {
|
|
3077
3115
|
class: "link",
|
|
3078
3116
|
type: "button",
|
|
3079
3117
|
on: { click: () => e.chooseComment(t.id) }
|
|
3080
|
-
}, r ? "Leave out of the ask" : "Add to the ask"),
|
|
3118
|
+
}, r ? "Leave out of the ask" : "Add to the ask"), A("button", {
|
|
3081
3119
|
class: "link",
|
|
3082
3120
|
type: "button",
|
|
3083
3121
|
on: { click: () => void e.resolve(t.id, !0) }
|
|
3084
3122
|
}, "Resolve")))));
|
|
3085
3123
|
}))), t;
|
|
3086
3124
|
}
|
|
3087
|
-
function
|
|
3088
|
-
let n = e.openFile === t.path, o = t.takes.reduce((e, t) => Math.max(e, t.added), 0), s = t.takes.reduce((e, t) => Math.max(e, t.removed), 0), c =
|
|
3125
|
+
function Ln(e, t) {
|
|
3126
|
+
let n = e.openFile === t.path, o = t.takes.reduce((e, t) => Math.max(e, t.added), 0), s = t.takes.reduce((e, t) => Math.max(e, t.removed), 0), c = A("div", { class: "card" }, A("button", {
|
|
3089
3127
|
class: "row",
|
|
3090
3128
|
type: "button",
|
|
3091
3129
|
"aria-expanded": String(n),
|
|
3092
3130
|
title: t.path,
|
|
3093
3131
|
on: { click: () => e.toggleFile(t.path) }
|
|
3094
|
-
},
|
|
3132
|
+
}, A("span", { class: "line" }, A("span", { class: "fname" }, i(t.path)), t.status === "added" ? A("span", { class: "new" }, "new") : null, t.status === "deleted" ? A("span", { class: "del" }, "deleted") : null, A("span", { class: "grow" }), o ? A("span", { class: "add" }, `+${o}`) : null, s ? A("span", { class: "del" }, `−${s}`) : null), A("span", { class: "line" }, A("span", { class: "fdir" }, a(t.path)), A("span", { class: "grow" }), t.takes.map((t) => A("span", { class: "chip" }, Z(e, t.take)))), t.comps.length || t.comments.length ? A("span", { class: "meta" }, [t.comps.length ? t.comps.join(", ") : "", t.comments.length ? r(t.comments.length, "comment") : ""].filter(Boolean).join(" · ")) : null));
|
|
3095
3133
|
if (n) {
|
|
3096
|
-
let n =
|
|
3134
|
+
let n = A("div", { class: "actions" }, t.takes.map((n) => {
|
|
3097
3135
|
let r = e.diff?.path === t.path && e.diff.take === n.take;
|
|
3098
|
-
return
|
|
3136
|
+
return A("button", {
|
|
3099
3137
|
class: "btn",
|
|
3100
3138
|
type: "button",
|
|
3101
3139
|
"aria-pressed": String(r),
|
|
3102
3140
|
on: { click: () => void e.openDiff(t.path, n.take) }
|
|
3103
|
-
}, `${Z(e, n.take)} `,
|
|
3141
|
+
}, `${Z(e, n.take)} `, A("span", { class: "add" }, `+${n.added}`), A("span", { class: "del" }, `−${n.removed}`));
|
|
3104
3142
|
}));
|
|
3105
3143
|
c.append(n);
|
|
3106
3144
|
let r = e.diff?.path === t.path ? e.diff : null;
|
|
3107
3145
|
if (r) {
|
|
3108
|
-
let t =
|
|
3146
|
+
let t = A("pre", {
|
|
3109
3147
|
class: "diff scroll",
|
|
3110
3148
|
"aria-label": `Diff of ${i(r.path)}`
|
|
3111
3149
|
});
|
|
3112
3150
|
for (let e of r.diff.split("\n")) {
|
|
3113
3151
|
let n = e.startsWith("@@") ? "hunk" : e.startsWith("+") && !e.startsWith("+++") ? "plus" : e.startsWith("-") && !e.startsWith("---") ? "minus" : "";
|
|
3114
|
-
t.append(
|
|
3152
|
+
t.append(A("span", n ? { class: n } : null, e || " "));
|
|
3115
3153
|
}
|
|
3116
|
-
let n = e.thread.takes.find((e) => e.id === r.take), a =
|
|
3117
|
-
c.append(t), n && n.state === "open" && c.append(
|
|
3154
|
+
let n = e.thread.takes.find((e) => e.id === r.take), a = R(e.thread).includes(r.take);
|
|
3155
|
+
c.append(t), n && n.state === "open" && c.append(A("div", { class: "actions" }, A("button", {
|
|
3118
3156
|
class: "btn",
|
|
3119
3157
|
type: "button",
|
|
3120
3158
|
disabled: a || !!e.busy,
|
|
@@ -3130,64 +3168,64 @@ function Z(e, t) {
|
|
|
3130
3168
|
let r = e.thread.entries.filter((e) => e.who === "person").map((e) => e.id);
|
|
3131
3169
|
return m(n, e.exportable(), r);
|
|
3132
3170
|
}
|
|
3133
|
-
function
|
|
3134
|
-
let t = e.exportable(), n = e.exportChosen(), r =
|
|
3171
|
+
function Rn(e) {
|
|
3172
|
+
let t = e.exportable(), n = e.exportChosen(), r = kn(e), i = e.exportCommentsChosen(), a = A("div", {
|
|
3135
3173
|
class: "view",
|
|
3136
3174
|
style: "gap:12px"
|
|
3137
|
-
},
|
|
3138
|
-
t.length && a.append(
|
|
3175
|
+
}, A("p", { class: "note" }, "One prompt for your own coding agent: what you asked, the takes as a design reference, your comments, and how to build it properly in this repository."));
|
|
3176
|
+
t.length && a.append(A("div", {
|
|
3139
3177
|
class: "seg",
|
|
3140
3178
|
role: "group",
|
|
3141
3179
|
"aria-label": "Takes to export"
|
|
3142
|
-
}, t.map((t) =>
|
|
3180
|
+
}, t.map((t) => A("button", {
|
|
3143
3181
|
type: "button",
|
|
3144
3182
|
"aria-pressed": String(n.includes(t.id)),
|
|
3145
3183
|
title: [t.label, t.state === "kept" ? "kept" : ""].filter(Boolean).join(" · ") || null,
|
|
3146
3184
|
on: { click: () => e.toggleExportTake(t.id) }
|
|
3147
|
-
}, `${Z(e, t.id)}${t.state === "kept" ? " · kept" : ""}`)))), r.length && a.append(
|
|
3185
|
+
}, `${Z(e, t.id)}${t.state === "kept" ? " · kept" : ""}`)))), r.length && a.append(A("div", {
|
|
3148
3186
|
class: "picks",
|
|
3149
3187
|
role: "group",
|
|
3150
3188
|
"aria-label": "Comments to export"
|
|
3151
|
-
}, r.map((t) =>
|
|
3189
|
+
}, r.map((t) => A("label", { class: "check" }, A("input", {
|
|
3152
3190
|
type: "checkbox",
|
|
3153
3191
|
checked: i.includes(t.id),
|
|
3154
3192
|
on: { change: () => e.toggleExportComment(t.id) }
|
|
3155
|
-
}),
|
|
3193
|
+
}), A("span", null, `${An(e, t.id)}. ${t.text}`)))));
|
|
3156
3194
|
let o = e.exportOut?.markdown ?? "";
|
|
3157
|
-
return a.append(
|
|
3195
|
+
return a.append(A("pre", {
|
|
3158
3196
|
class: "prompt scroll",
|
|
3159
3197
|
"aria-label": "The prompt",
|
|
3160
3198
|
tabindex: 0
|
|
3161
|
-
}, o || "Building the prompt…"),
|
|
3199
|
+
}, o || "Building the prompt…"), A("div", { class: "buttons" }, A("button", {
|
|
3162
3200
|
class: "btn primary grow",
|
|
3163
3201
|
type: "button",
|
|
3164
3202
|
disabled: !o,
|
|
3165
3203
|
on: { click: () => void e.copyExport() }
|
|
3166
|
-
}, e.copied ? "Copied" : "Copy prompt"),
|
|
3204
|
+
}, e.copied ? "Copied" : "Copy prompt"), A("button", {
|
|
3167
3205
|
class: "btn",
|
|
3168
3206
|
type: "button",
|
|
3169
3207
|
disabled: !o,
|
|
3170
3208
|
title: "Download the prompt as a Markdown file",
|
|
3171
3209
|
on: { click: () => e.downloadExport() }
|
|
3172
|
-
}, "Save as .md"),
|
|
3210
|
+
}, "Save as .md"), A("button", {
|
|
3173
3211
|
class: "btn ghost",
|
|
3174
3212
|
type: "button",
|
|
3175
3213
|
title: "Save the prompt in the project, under .onsite/exports/",
|
|
3176
3214
|
on: { click: () => void e.saveExport() }
|
|
3177
3215
|
}, "Save to .onsite"))), a;
|
|
3178
3216
|
}
|
|
3179
|
-
function
|
|
3180
|
-
let r = (t) =>
|
|
3217
|
+
function zn(e, t, n) {
|
|
3218
|
+
let r = (t) => A("button", {
|
|
3181
3219
|
class: "askstep",
|
|
3182
3220
|
type: "button",
|
|
3183
3221
|
"aria-label": t < 0 ? "Takes of the previous ask" : "Takes of the next ask",
|
|
3184
3222
|
title: t < 0 ? "Takes of the previous ask" : "Takes of the next ask",
|
|
3185
3223
|
"data-askstep": String(t),
|
|
3186
3224
|
on: { click: () => e.stepAsk(t) }
|
|
3187
|
-
},
|
|
3188
|
-
return
|
|
3225
|
+
}, j(t < 0 ? L.back : L.next));
|
|
3226
|
+
return A("span", { class: "takeof" }, r(-1), A("span", { title: n }, `Ask ${t}`), r(1));
|
|
3189
3227
|
}
|
|
3190
|
-
function
|
|
3228
|
+
function Bn(e) {
|
|
3191
3229
|
let t = e.takeRun();
|
|
3192
3230
|
if (!t) return null;
|
|
3193
3231
|
let n = e.openTakes(), r = n.filter((e) => e.of === t).sort((e, t) => e.no - t.no), i = new Set(n.map((e) => e.of)).size, a = e.thread.entries.filter((e) => e.who === "person"), o = a.findIndex((e) => e.id === t) + 1, s = {
|
|
@@ -3199,23 +3237,23 @@ function In(e) {
|
|
|
3199
3237
|
openFrame: (t) => e.openFrame(t),
|
|
3200
3238
|
cancel: (t) => void e.cancel(t),
|
|
3201
3239
|
again: (t) => void e.again(t)
|
|
3202
|
-
}, c =
|
|
3240
|
+
}, c = A("div", {
|
|
3203
3241
|
class: "takebar",
|
|
3204
3242
|
role: "group",
|
|
3205
3243
|
"aria-label": i > 1 && o ? `Takes of ask ${o}` : "Takes",
|
|
3206
3244
|
"aria-busy": e.busy ? "true" : null,
|
|
3207
3245
|
"data-takebar": t
|
|
3208
|
-
}, i > 1 && o ?
|
|
3209
|
-
showing:
|
|
3246
|
+
}, i > 1 && o ? zn(e, o, a[o - 1]?.text ?? "") : null), l = {
|
|
3247
|
+
showing: R(e.thread),
|
|
3210
3248
|
picked: e.picked,
|
|
3211
3249
|
all: e.thread.takes,
|
|
3212
3250
|
asks: a.map((e) => e.id)
|
|
3213
3251
|
};
|
|
3214
|
-
if (c.append(
|
|
3252
|
+
if (c.append(Ot(t, r, l, s, `p:${t}`)), t === e.thread.running) for (let e of c.querySelectorAll("[data-frame-skip], [data-frame-keep]")) e.remove();
|
|
3215
3253
|
return c;
|
|
3216
3254
|
}
|
|
3217
|
-
function
|
|
3218
|
-
let t =
|
|
3255
|
+
function Vn(e) {
|
|
3256
|
+
let t = A("button", {
|
|
3219
3257
|
class: `ib${e.cls ? ` ${e.cls}` : ""}`,
|
|
3220
3258
|
type: "button",
|
|
3221
3259
|
"aria-label": e.label,
|
|
@@ -3229,74 +3267,74 @@ function Ln(e) {
|
|
|
3229
3267
|
on: { click: () => {
|
|
3230
3268
|
t.getAttribute("aria-disabled") !== "true" && e.click();
|
|
3231
3269
|
} }
|
|
3232
|
-
},
|
|
3270
|
+
}, j(e.icon), e.extra);
|
|
3233
3271
|
return t;
|
|
3234
3272
|
}
|
|
3235
|
-
function
|
|
3236
|
-
let t = (e, t, n, r, i) =>
|
|
3273
|
+
function Hn(e) {
|
|
3274
|
+
let t = (e, t, n, r, i) => A("span", {
|
|
3237
3275
|
class: "chip",
|
|
3238
3276
|
"data-tip": n || null
|
|
3239
|
-
},
|
|
3277
|
+
}, j(e), A("span", null, t), A("button", {
|
|
3240
3278
|
class: "x",
|
|
3241
3279
|
type: "button",
|
|
3242
3280
|
"aria-label": r,
|
|
3243
3281
|
"data-tip": r,
|
|
3244
3282
|
on: { click: i }
|
|
3245
|
-
},
|
|
3283
|
+
}, j(L.x)));
|
|
3246
3284
|
return [...e.pins.map((n, r) => {
|
|
3247
3285
|
let i = n.getAttribute("data-onsite-src") ?? "", a = n.getAttribute("data-onsite-comp") ?? void 0;
|
|
3248
|
-
return t(
|
|
3286
|
+
return t(L.element, `${r + 1} · ${a ?? c(i)}`, l({
|
|
3249
3287
|
src: i,
|
|
3250
3288
|
comp: a
|
|
3251
3289
|
}), `Leave out element ${r + 1}`, () => e.togglePin(n));
|
|
3252
3290
|
}), ...e.chosen.map((n) => {
|
|
3253
|
-
let r =
|
|
3254
|
-
return t(
|
|
3291
|
+
let r = An(e, n), i = e.thread.comments.find((e) => e.id === n)?.text ?? "";
|
|
3292
|
+
return t(L.commentChip, `Comment ${r}`, i, `Leave out comment ${r}`, () => e.chooseComment(n));
|
|
3255
3293
|
})];
|
|
3256
3294
|
}
|
|
3257
|
-
var
|
|
3258
|
-
function
|
|
3295
|
+
var Un = /* @__PURE__ */ new WeakMap();
|
|
3296
|
+
function Wn(e) {
|
|
3259
3297
|
let t = e.basePick(), n = !!e.thread.running, i = e.thread.entries.filter((e) => e.who === "person").map((e) => e.id), a = t ? Z(e, t.take.id) : "", o = (e) => t ? de(t, a, i, e) : "", s = e.pins[0], l = s ? s.getAttribute("data-onsite-comp") ?? c(s.getAttribute("data-onsite-src") ?? "") : "", u = e.textarea;
|
|
3260
3298
|
u.value !== e.draft && (u.value = e.draft), u.rows = 1, u.placeholder = e.mode === "select" ? "Click elements to mention them" : t ? `Refine ${a}, or ask for something else` : "Say what to change";
|
|
3261
3299
|
let d = e.pins.length > 1 ? ` and ${r(e.pins.length - 1, "more element")}` : "";
|
|
3262
3300
|
u.setAttribute("aria-label", s ? `Message to Onsite about ${l}${d}` : "Message to Onsite");
|
|
3263
|
-
let f =
|
|
3264
|
-
|
|
3265
|
-
let h =
|
|
3301
|
+
let f = lt(), p = e.count, m = Un.has(e) && Un.get(e) !== p;
|
|
3302
|
+
Un.set(e, p);
|
|
3303
|
+
let h = Vn({
|
|
3266
3304
|
label: `Takes to make: ${p}`,
|
|
3267
3305
|
more: `Click for ${p % 3 + 1}`,
|
|
3268
|
-
icon:
|
|
3306
|
+
icon: L.takes,
|
|
3269
3307
|
cls: `takes${m ? " bump" : ""}`,
|
|
3270
3308
|
hook: "data-takes",
|
|
3271
3309
|
click: () => e.setCount(e.count % 3 + 1),
|
|
3272
|
-
extra:
|
|
3310
|
+
extra: A("b", {
|
|
3273
3311
|
class: "tbadge",
|
|
3274
3312
|
"aria-hidden": "true"
|
|
3275
3313
|
}, `×${p}`)
|
|
3276
3314
|
});
|
|
3277
3315
|
h.dataset.n = String(p);
|
|
3278
|
-
let g =
|
|
3316
|
+
let g = Vn({
|
|
3279
3317
|
label: "Pin as comment",
|
|
3280
3318
|
more: s ? e.pins.length > 1 ? `Pins on ${l}, the first selected element. It starts no run.` : `Pins on ${l}. It starts no run.` : "Choose an element to pin a comment on it",
|
|
3281
3319
|
keys: f ? ["⌥", "↵"] : ["Alt", "↵"],
|
|
3282
3320
|
shortcut: "Alt+Enter",
|
|
3283
|
-
icon:
|
|
3321
|
+
icon: L.pinComment,
|
|
3284
3322
|
hook: "data-pin-comment",
|
|
3285
3323
|
off: !e.canPin(),
|
|
3286
3324
|
click: () => void e.pinComment()
|
|
3287
|
-
}), _ = f ? ["⌘", "↵"] : ["Ctrl", "↵"], ee = n ?
|
|
3325
|
+
}), _ = f ? ["⌘", "↵"] : ["Ctrl", "↵"], ee = n ? Vn({
|
|
3288
3326
|
label: "Stop",
|
|
3289
3327
|
more: "The takes keep what the agent wrote.",
|
|
3290
|
-
icon:
|
|
3328
|
+
icon: L.stop,
|
|
3291
3329
|
cls: "stop",
|
|
3292
3330
|
hook: "data-stop",
|
|
3293
3331
|
click: () => void e.stop()
|
|
3294
|
-
}) : null, te =
|
|
3332
|
+
}) : null, te = Vn(n ? {
|
|
3295
3333
|
label: "Queue",
|
|
3296
3334
|
more: e.queueFull() ? "3 asks wait already. Send again when one starts." : t ? `Waits its turn, and ${o(!0)}` : "Waits its turn: it starts when the run before it ends",
|
|
3297
3335
|
keys: _,
|
|
3298
3336
|
shortcut: "Control+Enter Meta+Enter",
|
|
3299
|
-
icon:
|
|
3337
|
+
icon: L.queue,
|
|
3300
3338
|
cls: "go",
|
|
3301
3339
|
hook: "data-send",
|
|
3302
3340
|
off: !e.canSend(),
|
|
@@ -3306,27 +3344,27 @@ function Bn(e) {
|
|
|
3306
3344
|
more: o(!1),
|
|
3307
3345
|
keys: _,
|
|
3308
3346
|
shortcut: "Control+Enter Meta+Enter",
|
|
3309
|
-
icon:
|
|
3347
|
+
icon: L.send,
|
|
3310
3348
|
cls: "go",
|
|
3311
3349
|
hook: "data-send",
|
|
3312
3350
|
off: !e.canSend(),
|
|
3313
3351
|
click: () => void e.send()
|
|
3314
|
-
}), ne =
|
|
3315
|
-
return
|
|
3352
|
+
}), ne = A("div", { class: "prow" }, A("label", { class: "field" }, u), A("div", { class: "tools" }, h, g, ee, te)), v = Hn(e), re = e.quick && (e.pins.length > 1 || e.chosen.length > 0), ie = A("div", { class: "pbox" }, !e.quick && v.length ? A("div", { class: "chips" }, v) : null, ne);
|
|
3353
|
+
return A("div", { class: "composer" }, A("div", { class: `pill${re ? " tabbed" : ""}` }, re ? A("div", {
|
|
3316
3354
|
class: "ptab",
|
|
3317
3355
|
"data-tab": ""
|
|
3318
|
-
},
|
|
3356
|
+
}, A("div", { class: "chips" }, v)) : null, ie));
|
|
3319
3357
|
}
|
|
3320
|
-
function
|
|
3321
|
-
return
|
|
3358
|
+
function Gn(e, t) {
|
|
3359
|
+
return A("div", {
|
|
3322
3360
|
class: `quick${t ? " opening" : ""}`,
|
|
3323
3361
|
role: "dialog",
|
|
3324
3362
|
"aria-label": "Quick chat",
|
|
3325
3363
|
"data-quick": ""
|
|
3326
|
-
},
|
|
3364
|
+
}, Wn(e));
|
|
3327
3365
|
}
|
|
3328
3366
|
// src/overlay.ts
|
|
3329
|
-
var
|
|
3367
|
+
var Kn = "onsite-overlay", qn = 250, Jn = 400, Yn = 150, Xn = 400, Zn = 400, Qn = 200, $n = 560, er = 120;
|
|
3330
3368
|
function Q() {
|
|
3331
3369
|
let e = document.documentElement;
|
|
3332
3370
|
return {
|
|
@@ -3334,7 +3372,7 @@ function Q() {
|
|
|
3334
3372
|
h: e?.clientHeight || innerHeight
|
|
3335
3373
|
};
|
|
3336
3374
|
}
|
|
3337
|
-
var
|
|
3375
|
+
var tr = {
|
|
3338
3376
|
entries: [],
|
|
3339
3377
|
takes: [],
|
|
3340
3378
|
comments: [],
|
|
@@ -3355,7 +3393,7 @@ var Zn = {
|
|
|
3355
3393
|
t === null ? sessionStorage.removeItem(`onsite:${e}`) : sessionStorage.setItem(`onsite:${e}`, t);
|
|
3356
3394
|
} catch {}
|
|
3357
3395
|
}
|
|
3358
|
-
},
|
|
3396
|
+
}, nr = {
|
|
3359
3397
|
get(e) {
|
|
3360
3398
|
try {
|
|
3361
3399
|
return localStorage.getItem(`onsite:${e}`);
|
|
@@ -3368,14 +3406,14 @@ var Zn = {
|
|
|
3368
3406
|
localStorage.setItem(`onsite:${e}`, t);
|
|
3369
3407
|
} catch {}
|
|
3370
3408
|
}
|
|
3371
|
-
},
|
|
3409
|
+
}, rr = class {
|
|
3372
3410
|
host;
|
|
3373
3411
|
shadow;
|
|
3374
3412
|
ui;
|
|
3375
3413
|
layer;
|
|
3376
3414
|
client;
|
|
3377
3415
|
conn = null;
|
|
3378
|
-
thread =
|
|
3416
|
+
thread = tr;
|
|
3379
3417
|
live = null;
|
|
3380
3418
|
pref = "auto";
|
|
3381
3419
|
pageScheme = "light";
|
|
@@ -3401,17 +3439,19 @@ var Zn = {
|
|
|
3401
3439
|
exportOut = null;
|
|
3402
3440
|
copied = !1;
|
|
3403
3441
|
toast = null;
|
|
3404
|
-
saved =
|
|
3442
|
+
saved = Je($.get("dock"));
|
|
3405
3443
|
anchor = this.saved;
|
|
3406
3444
|
tip = !1;
|
|
3407
3445
|
drag = null;
|
|
3408
3446
|
hover = null;
|
|
3447
|
+
hoverBase = null;
|
|
3448
|
+
climbed = [];
|
|
3409
3449
|
alt = "off";
|
|
3410
3450
|
altMarks = null;
|
|
3411
3451
|
altMenu = "";
|
|
3412
3452
|
frameMarks = null;
|
|
3413
3453
|
liveMarks = /* @__PURE__ */ new Map();
|
|
3414
|
-
hiddenFrames = new Set(
|
|
3454
|
+
hiddenFrames = new Set(sr($.get("hidden-frames")));
|
|
3415
3455
|
chosenBar = void 0;
|
|
3416
3456
|
picked = /* @__PURE__ */ new Map();
|
|
3417
3457
|
lastRun = "";
|
|
@@ -3453,7 +3493,7 @@ var Zn = {
|
|
|
3453
3493
|
updateWait;
|
|
3454
3494
|
cleanups = [];
|
|
3455
3495
|
constructor(e = {}) {
|
|
3456
|
-
this.client = e.client ?? pe(), this.updateWait = e.updateWait ?? 1e3, this.host = document.createElement(
|
|
3496
|
+
this.client = e.client ?? pe(), this.updateWait = e.updateWait ?? 1e3, this.host = document.createElement(Kn), this.host.setAttribute("data-onsite-overlay", ""), this.host.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;margin:0;padding:0;border:0;z-index:2147483647;display:block;", this.shadow = this.host.attachShadow({ mode: "open" }), this.shadow.append(A("style", null, Lt)), this.layer = new Ht(this.host, () => this.layerState(), {
|
|
3457
3497
|
show: (e, t) => this.show(e, t),
|
|
3458
3498
|
hideTakes: (e) => void this.hideTakes(e),
|
|
3459
3499
|
toggleAltMenu: (e) => {
|
|
@@ -3464,7 +3504,7 @@ var Zn = {
|
|
|
3464
3504
|
},
|
|
3465
3505
|
resolve: (e) => void this.resolve(e, !0),
|
|
3466
3506
|
chooseComment: (e) => this.chooseComment(e),
|
|
3467
|
-
altKeyName:
|
|
3507
|
+
altKeyName: P,
|
|
3468
3508
|
keep: (e) => void this.keep(e),
|
|
3469
3509
|
skip: (e) => void this.skip(e),
|
|
3470
3510
|
toggleOriginal: (e) => this.toggleOriginal(e),
|
|
@@ -3474,26 +3514,26 @@ var Zn = {
|
|
|
3474
3514
|
openFrame: (e) => this.openFrame(e),
|
|
3475
3515
|
framesChanged: () => queueMicrotask(() => this.avoid()),
|
|
3476
3516
|
positioned: () => this.placeQuick()
|
|
3477
|
-
}), this.ui =
|
|
3517
|
+
}), this.ui = A("div", {
|
|
3478
3518
|
class: "ui",
|
|
3479
3519
|
"data-layer": "ui"
|
|
3480
|
-
}), this.mover =
|
|
3520
|
+
}), this.mover = A("div", {
|
|
3481
3521
|
class: "mover",
|
|
3482
3522
|
"data-mover": ""
|
|
3483
|
-
}), this.quickBox =
|
|
3523
|
+
}), this.quickBox = A("div", { "data-quickbox": "" }), this.hint = A("div", {
|
|
3484
3524
|
class: "snaphint",
|
|
3485
3525
|
hidden: !0,
|
|
3486
3526
|
"aria-hidden": "true",
|
|
3487
3527
|
"data-snaphint": ""
|
|
3488
|
-
}), this.extras =
|
|
3528
|
+
}), this.extras = A("div", null), this.tipEl = wn(), this.menu = new qt(this), this.question = new en(this.shadow, Q), this.iconTip = new gn(this.ui), this.ui.append(this.quickBox, this.mover, this.hint, this.menu.el, this.extras, this.question.el, this.iconTip.el), this.shadow.append(this.layer.root, this.ui), this.textarea = A("textarea", { rows: 1 }), this.textarea.addEventListener("input", () => {
|
|
3489
3529
|
this.draft = this.textarea.value, this.renderComposerState(), this.fitText(), this.quick && this.placeQuick();
|
|
3490
3530
|
}), this.textarea.addEventListener("keydown", (e) => {
|
|
3491
3531
|
e.key === "Enter" && (e.metaKey || e.ctrlKey ? (e.preventDefault(), this.quick && e.shiftKey ? this.expandQuick() : this.send()) : e.altKey && (e.preventDefault(), this.dropAltView(), this.pinComment()));
|
|
3492
3532
|
}), (document.documentElement ?? document.body).append(this.host);
|
|
3493
|
-
let t =
|
|
3533
|
+
let t = un({
|
|
3494
3534
|
doc: document,
|
|
3495
3535
|
host: this.host,
|
|
3496
|
-
point: () =>
|
|
3536
|
+
point: () => Xe(this.anchor, Q())
|
|
3497
3537
|
}, (e) => {
|
|
3498
3538
|
this.pageScheme = e, this.render();
|
|
3499
3539
|
});
|
|
@@ -3515,8 +3555,8 @@ var Zn = {
|
|
|
3515
3555
|
});
|
|
3516
3556
|
try {
|
|
3517
3557
|
let e = await this.client.call("GET prefs", {});
|
|
3518
|
-
this.pref = e.scheme, this.hidden = e.hidden === !0, this.model = e.model || void 0, this.takes =
|
|
3519
|
-
let t =
|
|
3558
|
+
this.pref = e.scheme, this.hidden = e.hidden === !0, this.model = e.model || void 0, this.takes = or(e.takes), this.count === 1 && (this.count = this.takes);
|
|
3559
|
+
let t = Je(e.dock);
|
|
3520
3560
|
if (t !== this.saved && !this.drag) {
|
|
3521
3561
|
let e = this.anchor !== this.saved;
|
|
3522
3562
|
this.saved = t, $.set("dock", t), e || (this.anchor = t);
|
|
@@ -3530,7 +3570,7 @@ var Zn = {
|
|
|
3530
3570
|
onState(e) {
|
|
3531
3571
|
let t = this.thread;
|
|
3532
3572
|
this.thread = e, this.sayStale(t, e);
|
|
3533
|
-
for (let t of
|
|
3573
|
+
for (let t of R(e)) {
|
|
3534
3574
|
let n = e.takes.find((e) => e.id === t);
|
|
3535
3575
|
n && this.picked.set(n.of, n.id);
|
|
3536
3576
|
}
|
|
@@ -3539,29 +3579,29 @@ var Zn = {
|
|
|
3539
3579
|
run: e.running,
|
|
3540
3580
|
text: e.live.text
|
|
3541
3581
|
} : this.live && this.live.run !== e.running && (this.live = null) : this.live = null, this.chosen = this.chosen.filter((t) => e.comments.some((e) => e.id === t && !e.resolved)), this.openComment && !e.comments.some((e) => e.id === this.openComment && !e.resolved) && (this.openComment = "");
|
|
3542
|
-
let r = t.shown !== e.shown ||
|
|
3543
|
-
r && this.alt !== "off" && this.loadMarks(), r && (this.diff = null), e.running && e.running !== t.running && (this.chosenBar = void 0), (r || e.running !== t.running ||
|
|
3582
|
+
let r = t.shown !== e.shown || R(t).join(" ") !== R(e).join(" ") || JSON.stringify(t.takes.map(ir)) !== JSON.stringify(e.takes.map(ir));
|
|
3583
|
+
r && this.alt !== "off" && this.loadMarks(), r && (this.diff = null), e.running && e.running !== t.running && (this.chosenBar = void 0), (r || e.running !== t.running || ar(e) !== ar(t)) && this.loadFrameMarksSoon(), this.render(), this.loadChangesSoon(), this.open && this.tab === "export" && this.loadExportSoon();
|
|
3544
3584
|
}
|
|
3545
3585
|
sayStale(e, t) {
|
|
3546
|
-
let n = this.stateSeen ?
|
|
3586
|
+
let n = this.stateSeen ? R(e) : ($.get("shown") ?? "").split(" ").filter(Boolean);
|
|
3547
3587
|
this.stateSeen = !0;
|
|
3548
|
-
let r =
|
|
3588
|
+
let r = R(t);
|
|
3549
3589
|
if ($.set("shown", r.join(" ") || null), this.busy === "show") return;
|
|
3550
3590
|
let i = n.filter((e) => !r.includes(e)), a = t.takes.find((e) => i.includes(e.id) && e.state === "open" && e.stale?.length);
|
|
3551
3591
|
a && this.showToast(ne(a));
|
|
3552
3592
|
}
|
|
3553
3593
|
onFlash(e) {
|
|
3554
|
-
let t = this.thread.takes.find((t) => t.id === e.take)?.of ?? (this.thread.running &&
|
|
3594
|
+
let t = this.thread.takes.find((t) => t.id === e.take)?.of ?? (this.thread.running && mt(this.thread.running, this.thread.takes, e.take) ? this.thread.running : "");
|
|
3555
3595
|
if (t) {
|
|
3556
3596
|
let n = this.liveMarks.get(t) ?? {
|
|
3557
3597
|
stamps: [],
|
|
3558
3598
|
selectors: []
|
|
3559
3599
|
};
|
|
3560
|
-
|
|
3600
|
+
z(n, e.marks), this.liveMarks.set(t, n);
|
|
3561
3601
|
}
|
|
3562
3602
|
let n = this.waitUpdate();
|
|
3563
3603
|
this.flashes = this.flashes.then(async () => {
|
|
3564
|
-
await n, await
|
|
3604
|
+
await n, await ct(60), await M(), await M(), this.layer.draw(), this.layer.flash(e.marks) === 0 && (await ct(250), this.layer.flash(e.marks));
|
|
3565
3605
|
}).catch(() => void 0);
|
|
3566
3606
|
}
|
|
3567
3607
|
waitUpdate() {
|
|
@@ -3575,7 +3615,7 @@ var Zn = {
|
|
|
3575
3615
|
};
|
|
3576
3616
|
}
|
|
3577
3617
|
let e = this.update.promise;
|
|
3578
|
-
return Promise.race([e,
|
|
3618
|
+
return Promise.race([e, ct(this.updateWait)]);
|
|
3579
3619
|
}
|
|
3580
3620
|
afterUpdate() {
|
|
3581
3621
|
this.update?.done(), this.update = null, this.recheckScheme(), this.layer.draw(), this.alt !== "off" && this.loadMarks(), this.loadFrameMarksSoon();
|
|
@@ -3594,7 +3634,7 @@ var Zn = {
|
|
|
3594
3634
|
capture: !0,
|
|
3595
3635
|
passive: !0
|
|
3596
3636
|
}), e("resize", () => {
|
|
3597
|
-
this.place(), this.layer.schedule(), this.recheckScheme(), clearTimeout(this.resizeTimer), this.resizeTimer = window.setTimeout(() => this.avoid(),
|
|
3637
|
+
this.place(), this.layer.schedule(), this.recheckScheme(), clearTimeout(this.resizeTimer), this.resizeTimer = window.setTimeout(() => this.avoid(), Qn);
|
|
3598
3638
|
});
|
|
3599
3639
|
let t = new MutationObserver(() => this.layer.schedule());
|
|
3600
3640
|
document.body && t.observe(document.body, {
|
|
@@ -3613,18 +3653,27 @@ var Zn = {
|
|
|
3613
3653
|
}
|
|
3614
3654
|
onMove(e) {
|
|
3615
3655
|
if (this.isOurs(e)) return;
|
|
3616
|
-
let t = this.picking(e) ?
|
|
3617
|
-
t !== this.hover && (this.hover = t, this.layer.draw());
|
|
3656
|
+
let t = this.picking(e) ? q(e.target) : null;
|
|
3657
|
+
t && t === this.hoverBase && this.hover || (this.hoverBase = t, this.climbed = [], t !== this.hover && (this.hover = t, this.layer.draw()));
|
|
3658
|
+
}
|
|
3659
|
+
climb(e) {
|
|
3660
|
+
if (e.key !== "ArrowUp" && e.key !== "ArrowDown" || !this.hover?.isConnected || e.metaKey || e.ctrlKey || e.shiftKey || !e.altKey && (this.mode === "idle" || this.typing())) return !1;
|
|
3661
|
+
let t;
|
|
3662
|
+
return e.key === "ArrowUp" ? (t = Bt(this.hover), t && this.climbed.push(this.hover)) : t = this.climbed.pop() ?? Vt(this.hover), t && (this.hover = t, this.layer.draw()), !0;
|
|
3663
|
+
}
|
|
3664
|
+
typing() {
|
|
3665
|
+
let e = this.activeInside();
|
|
3666
|
+
return e instanceof HTMLElement && (e.isContentEditable || e.matches("input, textarea, select"));
|
|
3618
3667
|
}
|
|
3619
3668
|
onDown(e) {
|
|
3620
|
-
this.menu.open && !e.composedPath().some((e) => e === this.menu.el || e instanceof Element && e.matches("[data-dock], [data-menu-button]")) && this.menu.close(), !this.isOurs(e) && this.picking(e) &&
|
|
3669
|
+
this.menu.open && !e.composedPath().some((e) => e === this.menu.el || e instanceof Element && e.matches("[data-dock], [data-menu-button]")) && this.menu.close(), !this.isOurs(e) && this.picking(e) && q(e.target) && (e.preventDefault(), e.stopPropagation());
|
|
3621
3670
|
}
|
|
3622
3671
|
onClick(e) {
|
|
3623
3672
|
if (this.isOurs(e)) return;
|
|
3624
3673
|
if (this.openComment && (this.openComment = "", this.layer.draw()), this.quick && !this.picking(e)) return this.closeQuick();
|
|
3625
3674
|
if (!this.picking(e)) return;
|
|
3626
|
-
let t =
|
|
3627
|
-
|
|
3675
|
+
let t = q(e.target), n = t && t === this.hoverBase && this.hover?.isConnected ? this.hover : t;
|
|
3676
|
+
n && (e.preventDefault(), e.stopPropagation(), this.altAlone = !1, this.togglePin(n));
|
|
3628
3677
|
}
|
|
3629
3678
|
togglePin(e) {
|
|
3630
3679
|
let t = this.pins.indexOf(e);
|
|
@@ -3640,18 +3689,18 @@ var Zn = {
|
|
|
3640
3689
|
let e = this.quickBox.firstElementChild;
|
|
3641
3690
|
if (!e) return;
|
|
3642
3691
|
let t = this.pins[0], n = t?.isConnected ? t.getBoundingClientRect() : null, r = Q();
|
|
3643
|
-
if (e.style.width = `${
|
|
3692
|
+
if (e.style.width = `${Yt(r)}px`, !n || n.width === 0 && n.height === 0 && Ut()) {
|
|
3644
3693
|
e.style.visibility = "hidden";
|
|
3645
3694
|
return;
|
|
3646
3695
|
}
|
|
3647
3696
|
e.style.visibility = "";
|
|
3648
|
-
let i = e.querySelector("[data-tab]"), a =
|
|
3697
|
+
let i = e.querySelector("[data-tab]"), a = Zt({
|
|
3649
3698
|
left: n.left - 4,
|
|
3650
3699
|
top: n.top - 4,
|
|
3651
3700
|
width: n.width + 8,
|
|
3652
3701
|
height: n.height + 8
|
|
3653
3702
|
}, {
|
|
3654
|
-
w: e.offsetWidth ||
|
|
3703
|
+
w: e.offsetWidth || Yt(r),
|
|
3655
3704
|
h: e.offsetHeight || 80,
|
|
3656
3705
|
tab: i ? {
|
|
3657
3706
|
w: i.offsetWidth,
|
|
@@ -3665,7 +3714,7 @@ var Zn = {
|
|
|
3665
3714
|
if (!e.isConnected) return;
|
|
3666
3715
|
e.style.height = "auto";
|
|
3667
3716
|
let t = e.scrollHeight;
|
|
3668
|
-
e.style.height = t > 0 ? `${Math.min(t,
|
|
3717
|
+
e.style.height = t > 0 ? `${Math.min(t, er)}px` : "";
|
|
3669
3718
|
}
|
|
3670
3719
|
activeInside() {
|
|
3671
3720
|
let e = document.activeElement;
|
|
@@ -3679,12 +3728,13 @@ var Zn = {
|
|
|
3679
3728
|
else if (e.key === "Alt") {
|
|
3680
3729
|
if (!e.repeat) {
|
|
3681
3730
|
this.altAlone = !0, this.altDownAt = performance.now(), clearTimeout(this.altTimer);
|
|
3682
|
-
let e = this.activeInside() === this.textarea ?
|
|
3731
|
+
let e = this.activeInside() === this.textarea ? Xn : Yn;
|
|
3683
3732
|
this.altTimer = window.setTimeout(() => this.altDown(), e);
|
|
3684
3733
|
}
|
|
3685
|
-
} else if (e.altKey && (this.altAlone = !1, this.alt !== "held" && (clearTimeout(this.altTimer), this.altTimer = 0)), e
|
|
3734
|
+
} else if (e.altKey && (this.altAlone = !1, this.alt !== "held" && (clearTimeout(this.altTimer), this.altTimer = 0)), (!this.isOurs(e) || e.altKey) && this.climb(e)) e.preventDefault(), e.stopPropagation();
|
|
3735
|
+
else if (e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && e.key.startsWith("Arrow") && this.onHandle()) {
|
|
3686
3736
|
if (e.preventDefault(), this.drag) return;
|
|
3687
|
-
this.setTip(!1), this.snapTo(
|
|
3737
|
+
this.setTip(!1), this.snapTo(et(this.anchor, e.key), "person");
|
|
3688
3738
|
} else if (e.key === "Escape" && this.drag) this.endDrag(!0);
|
|
3689
3739
|
else if (e.key === "Escape" && this.tip) this.setTip(!1);
|
|
3690
3740
|
else if (e.key === "Escape") {
|
|
@@ -3700,13 +3750,13 @@ var Zn = {
|
|
|
3700
3750
|
onKeyUp(e) {
|
|
3701
3751
|
if (e.key !== "Alt") return;
|
|
3702
3752
|
this.altAlone && e.preventDefault();
|
|
3703
|
-
let t = this.altAlone && performance.now() - this.altDownAt <
|
|
3753
|
+
let t = this.altAlone && performance.now() - this.altDownAt < qn;
|
|
3704
3754
|
if (this.altAlone = !1, this.altUp(), !t) {
|
|
3705
3755
|
this.lastTapAt = 0;
|
|
3706
3756
|
return;
|
|
3707
3757
|
}
|
|
3708
3758
|
let n = performance.now();
|
|
3709
|
-
this.lastTapAt && n - this.lastTapAt <
|
|
3759
|
+
this.lastTapAt && n - this.lastTapAt < Jn ? (this.lastTapAt = 0, this.setOpen(!this.open)) : this.lastTapAt = n;
|
|
3710
3760
|
}
|
|
3711
3761
|
altDown() {
|
|
3712
3762
|
this.altTimer = 0, this.alt === "off" && (this.alt = "held", this.altMenu = "", this.loadMarks(), this.render());
|
|
@@ -3724,18 +3774,18 @@ var Zn = {
|
|
|
3724
3774
|
try {
|
|
3725
3775
|
let e = await this.client.call("GET marks", {});
|
|
3726
3776
|
if (this.alt === "off") return;
|
|
3727
|
-
await
|
|
3777
|
+
await M(), this.altMarks = e, this.layer.draw();
|
|
3728
3778
|
} catch {}
|
|
3729
3779
|
}
|
|
3730
3780
|
frames() {
|
|
3731
|
-
return
|
|
3781
|
+
return ft(this.thread, this.hiddenFrames);
|
|
3732
3782
|
}
|
|
3733
3783
|
loadFrameMarksSoon(e = 120) {
|
|
3734
3784
|
clearTimeout(this.frameTimer), this.frameTimer = window.setTimeout(async () => {
|
|
3735
3785
|
if (this.frames().length === 0) this.frameMarks = null;
|
|
3736
3786
|
else try {
|
|
3737
3787
|
let e = await this.client.call("GET marks", {});
|
|
3738
|
-
await
|
|
3788
|
+
await M(), this.frameMarks = e, this.layer.draw();
|
|
3739
3789
|
} catch {}
|
|
3740
3790
|
}, e);
|
|
3741
3791
|
}
|
|
@@ -3747,13 +3797,13 @@ var Zn = {
|
|
|
3747
3797
|
}
|
|
3748
3798
|
async savePrefs(e) {
|
|
3749
3799
|
let t = await this.client.call("POST prefs", e);
|
|
3750
|
-
return this.pref = t.scheme, this.hidden = t.hidden === !0, this.model = t.model || void 0, this.takes =
|
|
3800
|
+
return this.pref = t.scheme, this.hidden = t.hidden === !0, this.model = t.model || void 0, this.takes = or(t.takes), t;
|
|
3751
3801
|
}
|
|
3752
3802
|
async setHidden(e) {
|
|
3753
3803
|
let t = this.hidden;
|
|
3754
3804
|
this.hidden = e, this.setTip(!1), this.render();
|
|
3755
3805
|
try {
|
|
3756
|
-
await this.savePrefs({ hidden: e || null }), e && !
|
|
3806
|
+
await this.savePrefs({ hidden: e || null }), e && !nr.get("hid-once") && (nr.set("hid-once", "1"), this.showToast(`The Onsite icon is hidden. Double-tap ${P()} to open Onsite, then choose Show icon.`));
|
|
3757
3807
|
} catch (n) {
|
|
3758
3808
|
this.hidden = t, this.showToast(`Could not ${e ? "hide" : "show"} the icon: ${n.message}`);
|
|
3759
3809
|
}
|
|
@@ -3809,8 +3859,8 @@ var Zn = {
|
|
|
3809
3859
|
if (!t || e.pointerId !== t.pointer) return;
|
|
3810
3860
|
let n = e.clientX - t.x, r = e.clientY - t.y;
|
|
3811
3861
|
if (!t.moved && Math.hypot(n, r) < 4) return;
|
|
3812
|
-
t.moved || (t.moved = !0, this.setTip(!1), this.menu.close(), this.mover.classList.add("dragging")), e.preventDefault(), this.mover.style.transform = `translate(${n}px, ${r}px)`, t.target =
|
|
3813
|
-
let i =
|
|
3862
|
+
t.moved || (t.moved = !0, this.setTip(!1), this.menu.close(), this.mover.classList.add("dragging")), e.preventDefault(), this.mover.style.transform = `translate(${n}px, ${r}px)`, t.target = $e(e.clientX, e.clientY, Q());
|
|
3863
|
+
let i = k(t.target, Q());
|
|
3814
3864
|
this.hint.style.left = `${i.left}px`, this.hint.style.top = `${i.top}px`, this.hint.hidden = !1;
|
|
3815
3865
|
};
|
|
3816
3866
|
onDragUp = (e) => {
|
|
@@ -3840,11 +3890,11 @@ var Zn = {
|
|
|
3840
3890
|
dy: o
|
|
3841
3891
|
}];
|
|
3842
3892
|
});
|
|
3843
|
-
if (
|
|
3893
|
+
if (N() || i.length === 0) return this.snapDone();
|
|
3844
3894
|
for (let e of i) e.el.style.transition = "none", e.el.style.transform = `translate(${e.dx}px, ${e.dy}px)`;
|
|
3845
3895
|
this.mover.offsetWidth;
|
|
3846
3896
|
for (let e of i) e.el.classList.add("snapping"), e.el.style.transition = "", e.el.style.transform = "";
|
|
3847
|
-
clearTimeout(this.snapTimer), this.snapTimer = window.setTimeout(() => this.snapDone(),
|
|
3897
|
+
clearTimeout(this.snapTimer), this.snapTimer = window.setTimeout(() => this.snapDone(), U.snap + 40);
|
|
3848
3898
|
}
|
|
3849
3899
|
snapDone() {
|
|
3850
3900
|
clearTimeout(this.snapTimer), this.snapTimer = 0;
|
|
@@ -3874,9 +3924,9 @@ var Zn = {
|
|
|
3874
3924
|
this.checkLater = !0;
|
|
3875
3925
|
return;
|
|
3876
3926
|
}
|
|
3877
|
-
let e = Q(), t = this.targets().map((t) =>
|
|
3927
|
+
let e = Q(), t = this.targets().map((t) => tt(t.getBoundingClientRect(), e)).filter((e) => e !== null);
|
|
3878
3928
|
if (!t.length) return;
|
|
3879
|
-
let n = this.mover.querySelector(".panel")?.offsetHeight ||
|
|
3929
|
+
let n = this.mover.querySelector(".panel")?.offsetHeight || $n, r = it(this.saved, (t) => [Qe(t, e, 400, n), k(t, e)], t);
|
|
3880
3930
|
r !== this.anchor && this.snapTo(r, "avoid");
|
|
3881
3931
|
}
|
|
3882
3932
|
goBack() {
|
|
@@ -3886,26 +3936,26 @@ var Zn = {
|
|
|
3886
3936
|
}
|
|
3887
3937
|
place() {
|
|
3888
3938
|
let e = Q(), t = this.anchor;
|
|
3889
|
-
this.mover.dataset.row =
|
|
3939
|
+
this.mover.dataset.row = T(t), this.extras.dataset.toast = t === "bottom-center" ? "top" : "bottom";
|
|
3890
3940
|
let n = this.mover.querySelector(".dock");
|
|
3891
3941
|
if (n) {
|
|
3892
|
-
let r =
|
|
3942
|
+
let r = k(t, e);
|
|
3893
3943
|
n.style.left = `${r.left}px`, n.style.top = `${r.top}px`;
|
|
3894
3944
|
}
|
|
3895
3945
|
let r = this.mover.querySelector("[data-dockmore]");
|
|
3896
3946
|
if (r) {
|
|
3897
|
-
let n =
|
|
3947
|
+
let n = k(t, e);
|
|
3898
3948
|
r.style.left = `${n.left - 6}px`, r.style.top = `${n.top - 6}px`;
|
|
3899
3949
|
}
|
|
3900
3950
|
let i = (n, r, i) => {
|
|
3901
3951
|
if (!n) return;
|
|
3902
|
-
let a =
|
|
3952
|
+
let a = Ze(t, e, r, i);
|
|
3903
3953
|
n.style.left = `${a.left}px`, n.style.width = `${a.width}px`, n.style.top = a.top === void 0 ? "" : `${a.top}px`, n.style.bottom = a.bottom === void 0 ? "" : `${a.bottom}px`, n.style.maxHeight = `${a.maxHeight}px`;
|
|
3904
3954
|
};
|
|
3905
3955
|
i(this.mover.querySelector(".panel"), 400), i(this.tipEl, 220, 8), this.menu.open && i(this.menu.el, 340, 8), this.question.place();
|
|
3906
3956
|
}
|
|
3907
3957
|
tipSoon(e) {
|
|
3908
|
-
e.pointerType && e.pointerType !== "mouse" || (clearTimeout(this.tipTimer), this.tipTimer = window.setTimeout(() => this.setTip(!0),
|
|
3958
|
+
e.pointerType && e.pointerType !== "mouse" || (clearTimeout(this.tipTimer), this.tipTimer = window.setTimeout(() => this.setTip(!0), Zn));
|
|
3909
3959
|
}
|
|
3910
3960
|
tipFocus() {
|
|
3911
3961
|
this.refocusing || this.drag || this.setTip(!0);
|
|
@@ -3965,7 +4015,7 @@ var Zn = {
|
|
|
3965
4015
|
}
|
|
3966
4016
|
async ask(e, t, n = []) {
|
|
3967
4017
|
if (this.busy || this.queueFull()) return !1;
|
|
3968
|
-
let r =
|
|
4018
|
+
let r = We(this.pins, {
|
|
3969
4019
|
host: this.host,
|
|
3970
4020
|
scheme: this.pageScheme
|
|
3971
4021
|
}), i = this.baseTake();
|
|
@@ -4001,9 +4051,9 @@ var Zn = {
|
|
|
4001
4051
|
}
|
|
4002
4052
|
}
|
|
4003
4053
|
toggleOriginal(e) {
|
|
4004
|
-
let t = this.openTakes().filter((t) => t.of === e), n =
|
|
4005
|
-
if (!
|
|
4006
|
-
let r =
|
|
4054
|
+
let t = this.openTakes().filter((t) => t.of === e), n = R(this.thread);
|
|
4055
|
+
if (!Ct(t, n)) return void this.show("", e);
|
|
4056
|
+
let r = V(e, t, n, this.picked);
|
|
4007
4057
|
r && this.show(r.id);
|
|
4008
4058
|
}
|
|
4009
4059
|
takeRun() {
|
|
@@ -4024,7 +4074,7 @@ var Zn = {
|
|
|
4024
4074
|
}
|
|
4025
4075
|
async show(e, t) {
|
|
4026
4076
|
if (this.busy) return;
|
|
4027
|
-
let n =
|
|
4077
|
+
let n = R(this.thread), r = (e) => this.thread.takes.find((t) => t.id === e)?.of ?? e.replace(/-\d+$/, ""), i = e === "" ? t ? n.filter((e) => r(e) === t) : n : n.filter((t) => r(t) === r(e));
|
|
4028
4078
|
if (e === "" ? i.length === 0 : n.includes(e)) return;
|
|
4029
4079
|
let a = this.thread.takes.find((t) => t.id === e), o = !!a?.stale?.length;
|
|
4030
4080
|
if (a && o && (!await this.askFirst(a) || this.busy)) return;
|
|
@@ -4046,9 +4096,9 @@ var Zn = {
|
|
|
4046
4096
|
shown: n.take,
|
|
4047
4097
|
showing: n.showing ?? (n.take ? [n.take] : [])
|
|
4048
4098
|
}, n.files.length) {
|
|
4049
|
-
await c, await
|
|
4099
|
+
await c, await M();
|
|
4050
4100
|
let t = (s?.groups ?? []).filter((t) => t.takes.some((t) => t === e || i.includes(t)));
|
|
4051
|
-
this.layer.swap(t.flatMap((e) =>
|
|
4101
|
+
this.layer.swap(t.flatMap((e) => K(e, this.host)));
|
|
4052
4102
|
}
|
|
4053
4103
|
} catch (e) {
|
|
4054
4104
|
this.showToast(e.message);
|
|
@@ -4064,7 +4114,7 @@ var Zn = {
|
|
|
4064
4114
|
});
|
|
4065
4115
|
}
|
|
4066
4116
|
everywhere() {
|
|
4067
|
-
return
|
|
4117
|
+
return R(this.thread).length > 0 ? "original" : this.takesBefore().length > 0 ? "back" : "";
|
|
4068
4118
|
}
|
|
4069
4119
|
takesBefore() {
|
|
4070
4120
|
let e = this.beforeOriginal;
|
|
@@ -4075,10 +4125,10 @@ var Zn = {
|
|
|
4075
4125
|
let e = this.everywhere();
|
|
4076
4126
|
if (e === "original") {
|
|
4077
4127
|
let e = {
|
|
4078
|
-
showing:
|
|
4128
|
+
showing: R(this.thread),
|
|
4079
4129
|
shown: this.thread.shown
|
|
4080
4130
|
};
|
|
4081
|
-
await this.show(""),
|
|
4131
|
+
await this.show(""), R(this.thread).length === 0 && (this.beforeOriginal = e);
|
|
4082
4132
|
return;
|
|
4083
4133
|
}
|
|
4084
4134
|
if (e !== "back") return;
|
|
@@ -4090,7 +4140,7 @@ var Zn = {
|
|
|
4090
4140
|
}
|
|
4091
4141
|
async hideTakes(e) {
|
|
4092
4142
|
if (this.busy) return;
|
|
4093
|
-
let t =
|
|
4143
|
+
let t = R(this.thread), n = t.filter((t) => e.includes(t));
|
|
4094
4144
|
if (n.length === 0) return;
|
|
4095
4145
|
if (n.length === t.length) return this.show("");
|
|
4096
4146
|
let r = new Set(n.map((e) => this.thread.takes.find((t) => t.id === e)?.of).filter((e) => !!e));
|
|
@@ -4158,7 +4208,7 @@ var Zn = {
|
|
|
4158
4208
|
async pinComment() {
|
|
4159
4209
|
let e = this.pins[0], t = this.draft.trim();
|
|
4160
4210
|
if (t && !this.busy) {
|
|
4161
|
-
if (!e) this.showToast(`Choose an element first: ${
|
|
4211
|
+
if (!e) this.showToast(`Choose an element first: ${P()}-click it, then pin.`);
|
|
4162
4212
|
else {
|
|
4163
4213
|
this.busy = "comment", this.render();
|
|
4164
4214
|
try {
|
|
@@ -4168,7 +4218,7 @@ var Zn = {
|
|
|
4168
4218
|
src: e.getAttribute("data-onsite-src") ?? "",
|
|
4169
4219
|
...n ? { comp: n } : {}
|
|
4170
4220
|
},
|
|
4171
|
-
context:
|
|
4221
|
+
context: We([e], {
|
|
4172
4222
|
host: this.host,
|
|
4173
4223
|
scheme: this.pageScheme
|
|
4174
4224
|
})
|
|
@@ -4226,7 +4276,7 @@ var Zn = {
|
|
|
4226
4276
|
exportChosen() {
|
|
4227
4277
|
let e = this.exportable().map((e) => e.id);
|
|
4228
4278
|
if (this.exportTakes) return this.exportTakes.filter((t) => e.includes(t));
|
|
4229
|
-
let t =
|
|
4279
|
+
let t = R(this.thread).filter((t) => e.includes(t));
|
|
4230
4280
|
if (t.length > 0) return t;
|
|
4231
4281
|
let n = e.at(-1);
|
|
4232
4282
|
return n ? [n] : [];
|
|
@@ -4272,7 +4322,7 @@ var Zn = {
|
|
|
4272
4322
|
downloadExport() {
|
|
4273
4323
|
let e = this.exportOut;
|
|
4274
4324
|
if (!e) return;
|
|
4275
|
-
let t = URL.createObjectURL(new Blob([e.markdown], { type: "text/markdown" })), n =
|
|
4325
|
+
let t = URL.createObjectURL(new Blob([e.markdown], { type: "text/markdown" })), n = A("a", {
|
|
4276
4326
|
href: t,
|
|
4277
4327
|
download: e.filename
|
|
4278
4328
|
});
|
|
@@ -4310,13 +4360,13 @@ var Zn = {
|
|
|
4310
4360
|
openComment: this.openComment,
|
|
4311
4361
|
takes: this.thread.takes,
|
|
4312
4362
|
shown: this.thread.shown,
|
|
4313
|
-
showing:
|
|
4363
|
+
showing: R(this.thread),
|
|
4314
4364
|
alt: this.alt,
|
|
4315
4365
|
altMarks: this.altMarks,
|
|
4316
4366
|
altMenu: this.altMenu,
|
|
4317
4367
|
avoid: this.ui.querySelector(".panel")?.getBoundingClientRect() ?? null,
|
|
4318
4368
|
frames: e,
|
|
4319
|
-
barRun:
|
|
4369
|
+
barRun: _t(e, this.chosenBar),
|
|
4320
4370
|
frameMarks: this.frameMarks,
|
|
4321
4371
|
liveMarks: this.liveMarks,
|
|
4322
4372
|
busy: !!this.busy,
|
|
@@ -4325,8 +4375,8 @@ var Zn = {
|
|
|
4325
4375
|
};
|
|
4326
4376
|
}
|
|
4327
4377
|
render() {
|
|
4328
|
-
this.host.dataset.scheme = this.panelScheme(), this.host.dataset.motion =
|
|
4329
|
-
let e =
|
|
4378
|
+
this.host.dataset.scheme = this.panelScheme(), this.host.dataset.motion = N() ? "reduce" : "full", this.drag || this.snapTimer ? this.stale = !0 : this.renderMover(), this.renderQuick(), this.iconTip.refresh();
|
|
4379
|
+
let e = Tn(this);
|
|
4330
4380
|
this.extras.replaceChildren(...e ? [e] : []), this.place(), this.layer.draw(), this.goBack();
|
|
4331
4381
|
}
|
|
4332
4382
|
renderMover() {
|
|
@@ -4338,8 +4388,8 @@ var Zn = {
|
|
|
4338
4388
|
".dockmore",
|
|
4339
4389
|
".grip",
|
|
4340
4390
|
"[data-menu-button]"
|
|
4341
|
-
], o = i instanceof HTMLElement && this.mover.contains(i) ? i.dataset.tipKey : void 0, s = i === this.textarea ? "textarea" : o ? `[data-tip-key="${o}"]` : a.find((e) => i?.matches(e) && this.mover.contains(i)) ?? "", { selectionStart: c, selectionEnd: l } = this.textarea, u = this.hidden ? [] :
|
|
4342
|
-
this.mover.replaceChildren(...u, this.open ?
|
|
4391
|
+
], o = i instanceof HTMLElement && this.mover.contains(i) ? i.dataset.tipKey : void 0, s = i === this.textarea ? "textarea" : o ? `[data-tip-key="${o}"]` : a.find((e) => i?.matches(e) && this.mover.contains(i)) ?? "", { selectionStart: c, selectionEnd: l } = this.textarea, u = this.hidden ? [] : xn(this);
|
|
4392
|
+
this.mover.replaceChildren(...u, this.open ? En(this, r) : this.tipEl), s === "textarea" && this.textarea.isConnected ? (this.textarea.focus({ preventScroll: !0 }), this.textarea.setSelectionRange(c, l)) : s && (this.refocusing = !0, this.mover.querySelector(s)?.focus({ preventScroll: !0 }), this.refocusing = !1);
|
|
4343
4393
|
let d = this.ui.querySelector(".body");
|
|
4344
4394
|
d && (d.scrollTop = t ? d.scrollHeight : n), this.open && this.fitText();
|
|
4345
4395
|
}
|
|
@@ -4348,13 +4398,13 @@ var Zn = {
|
|
|
4348
4398
|
this.quickWas = !1, this.quickBox.firstChild && this.quickBox.replaceChildren();
|
|
4349
4399
|
return;
|
|
4350
4400
|
}
|
|
4351
|
-
let e = this.shadow.activeElement, t = e === this.textarea, n = e instanceof HTMLElement && this.quickBox.contains(e) ? e.dataset.tipKey : void 0, { selectionStart: r, selectionEnd: i } = this.textarea, a =
|
|
4352
|
-
a.style.width = `${
|
|
4401
|
+
let e = this.shadow.activeElement, t = e === this.textarea, n = e instanceof HTMLElement && this.quickBox.contains(e) ? e.dataset.tipKey : void 0, { selectionStart: r, selectionEnd: i } = this.textarea, a = Gn(this, !this.quickWas);
|
|
4402
|
+
a.style.width = `${Yt(Q())}px`, this.quickBox.replaceChildren(a), this.quickWas = !0, t ? (this.textarea.focus({ preventScroll: !0 }), this.textarea.setSelectionRange(r, i)) : n && this.quickBox.querySelector(`[data-tip-key="${n}"]`)?.focus({ preventScroll: !0 }), this.fitText(), this.placeQuick();
|
|
4353
4403
|
}
|
|
4354
4404
|
renderLive() {
|
|
4355
4405
|
let e = this.ui.querySelector("[data-live]");
|
|
4356
4406
|
if (!e || !this.live) return this.render();
|
|
4357
|
-
e.replaceChildren(document.createTextNode(this.live.text),
|
|
4407
|
+
e.replaceChildren(document.createTextNode(this.live.text), A("span", {
|
|
4358
4408
|
class: "caret",
|
|
4359
4409
|
"aria-hidden": "true"
|
|
4360
4410
|
}));
|
|
@@ -4373,11 +4423,11 @@ var Zn = {
|
|
|
4373
4423
|
for (let e of this.cleanups) e();
|
|
4374
4424
|
this.stopScheme(), clearTimeout(this.toastTimer), clearTimeout(this.changesTimer), clearTimeout(this.exportTimer), clearTimeout(this.tipTimer), clearTimeout(this.resizeTimer), clearTimeout(this.snapTimer), clearTimeout(this.frameTimer), this.host.remove();
|
|
4375
4425
|
}
|
|
4376
|
-
},
|
|
4377
|
-
function
|
|
4426
|
+
}, ir = (e) => `${e.id}:${e.state}`, ar = (e) => e.running ? (e.entries.find((t) => t.id === e.running && t.who === "person")?.steps ?? []).filter((e) => e.take).length : 0;
|
|
4427
|
+
function or(e) {
|
|
4378
4428
|
return typeof e == "number" && Number.isInteger(e) ? Math.max(1, Math.min(3, e)) : 1;
|
|
4379
4429
|
}
|
|
4380
|
-
function
|
|
4430
|
+
function sr(e) {
|
|
4381
4431
|
try {
|
|
4382
4432
|
let t = JSON.parse(e ?? "[]");
|
|
4383
4433
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
|
|
@@ -4386,8 +4436,8 @@ function rr(e) {
|
|
|
4386
4436
|
}
|
|
4387
4437
|
}
|
|
4388
4438
|
// src/index.ts
|
|
4389
|
-
function
|
|
4390
|
-
return typeof document > "u" || document.querySelector("onsite-overlay") ? null : new
|
|
4439
|
+
function cr(e = {}) {
|
|
4440
|
+
return typeof document > "u" || document.querySelector("onsite-overlay") ? null : new rr(e);
|
|
4391
4441
|
}
|
|
4392
|
-
typeof document < "u" && !globalThis.__ONSITE_NO_BOOT__ &&
|
|
4393
|
-
export {
|
|
4442
|
+
typeof document < "u" && !globalThis.__ONSITE_NO_BOOT__ && cr();
|
|
4443
|
+
export { Kn as HOST_TAG, rr as Overlay, cr as mount, We as pageContext, Oe as propsOf, Ve as snapshot };
|