@adea-ai/ui 0.100.0 → 0.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
- package/dist/components/composites/about-dialog/about-dialog.js +2 -1
- package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
- package/dist/components/composites/account-menu/account-menu.d.ts +7 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +116 -89
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
- package/dist/components/composites/help-center/help-center.js +26 -21
- package/dist/components/composites/help-center/help-center.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +43 -36
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +46 -35
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +73 -58
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +19 -13
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts.map +1 -1
- package/dist/components/theme/appearance-panel.js +37 -18
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +5 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/card/card.js +5 -1
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/chart/chart-options.d.ts +3 -2
- package/dist/components/ui/chart/chart-options.d.ts.map +1 -1
- package/dist/components/ui/chart/chart-options.js +30 -9
- package/dist/components/ui/chart/chart-options.js.map +1 -1
- package/dist/components/ui/chart/chart.d.ts +4 -9
- package/dist/components/ui/chart/chart.d.ts.map +1 -1
- package/dist/components/ui/chart/chart.js +65 -10
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +5 -1
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer/drawer.js +5 -1
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +2 -1
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/item/item.d.ts +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +5 -1
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/typography/index.d.ts +3 -0
- package/dist/components/ui/typography/index.d.ts.map +1 -0
- package/dist/components/ui/typography/index.js +2 -0
- package/dist/components/ui/typography/typography.d.ts +84 -0
- package/dist/components/ui/typography/typography.d.ts.map +1 -0
- package/dist/components/ui/typography/typography.js +179 -0
- package/dist/components/ui/typography/typography.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/r/account-menu.json +1 -0
- package/dist/r/alert-dialog.json +1 -0
- package/dist/r/card.json +1 -0
- package/dist/r/dialog.json +1 -0
- package/dist/r/drawer.json +1 -0
- package/dist/r/field.json +1 -0
- package/dist/r/help-center.json +1 -0
- package/dist/r/page.json +1 -0
- package/dist/r/registry.json +37 -0
- package/dist/r/settings.json +1 -0
- package/dist/r/sheet.json +1 -0
- package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +3 -2
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +105 -66
- package/dist/r/src/components/composites/help-center/help-center.tsx +2 -1
- package/dist/r/src/components/composites/settings/settings.tsx +4 -1
- package/dist/r/src/components/composites/stat/stat.tsx +7 -2
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +36 -24
- package/dist/r/src/components/layout/page/page.tsx +3 -2
- package/dist/r/src/components/theme/appearance-panel.tsx +13 -4
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +2 -1
- package/dist/r/src/components/ui/card/card.tsx +2 -1
- package/dist/r/src/components/ui/chart/chart-options.ts +35 -7
- package/dist/r/src/components/ui/chart/chart.tsx +65 -12
- package/dist/r/src/components/ui/dialog/dialog.tsx +2 -1
- package/dist/r/src/components/ui/drawer/drawer.tsx +2 -1
- package/dist/r/src/components/ui/field/field.tsx +2 -3
- package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
- package/dist/r/src/components/ui/typography/index.ts +9 -0
- package/dist/r/src/components/ui/typography/typography.tsx +205 -0
- package/dist/r/stat.json +1 -0
- package/dist/r/theming.json +1 -0
- package/dist/r/typography.json +24 -0
- package/dist/r/update-dialog.json +1 -0
- package/package.json +1 -1
- package/registry.json +37 -0
- package/src/components/composites/about-dialog/about-dialog.tsx +3 -2
- package/src/components/composites/account-menu/account-menu.tsx +105 -66
- package/src/components/composites/help-center/help-center.tsx +2 -1
- package/src/components/composites/settings/settings.tsx +4 -1
- package/src/components/composites/stat/stat.tsx +7 -2
- package/src/components/composites/update-dialog/update-dialog.tsx +36 -24
- package/src/components/layout/page/page.tsx +3 -2
- package/src/components/theme/appearance-panel.tsx +13 -4
- package/src/components/ui/alert-dialog/alert-dialog.tsx +2 -1
- package/src/components/ui/card/card.tsx +2 -1
- package/src/components/ui/chart/chart-options.ts +35 -7
- package/src/components/ui/chart/chart.tsx +65 -12
- package/src/components/ui/dialog/dialog.tsx +2 -1
- package/src/components/ui/drawer/drawer.tsx +2 -1
- package/src/components/ui/field/field.tsx +2 -3
- package/src/components/ui/sheet/sheet.tsx +5 -1
- package/src/components/ui/typography/index.ts +9 -0
- package/src/components/ui/typography/typography.tsx +205 -0
- package/src/index.ts +1 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Heading } from "../../ui/typography/typography.js";
|
|
2
3
|
import { Badge } from "../../ui/badge/badge.js";
|
|
3
4
|
import { Button } from "../../ui/button/button.js";
|
|
4
5
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, createDialogFocusRestoration } from "../../ui/dialog/dialog.js";
|
|
@@ -10,14 +11,14 @@ import { Check, CircleStop, Download, ExternalLink, LoaderCircle, Monitor, Refre
|
|
|
10
11
|
import { Show, createEffect, createMemo, createSignal, onCleanup, onMount, splitProps } from "solid-js";
|
|
11
12
|
//#region src/components/composites/update-dialog/update-dialog.tsx
|
|
12
13
|
var _tmpl$ = /*#__PURE__*/ template(`<div class="flex items-center gap-3"><div>`);
|
|
13
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<
|
|
14
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<section class="
|
|
15
|
-
var _tmpl$4 = /*#__PURE__*/ template(`<
|
|
14
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<p class="text-foreground flex items-center gap-2 text-sm"role=status> is up to date.`);
|
|
15
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<section class="rounded-xl border border-primary/35 bg-primary-subtle p-4"aria-label="Available update"><div class="flex flex-wrap items-start justify-between gap-4"><div class="flex flex-col gap-1"><p class="flex items-center gap-2 text-sm font-semibold">Version <!> </p><p class="text-sm text-muted-foreground">The signed installer is verified before <!> restarts.`);
|
|
16
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<section class="grid gap-2"aria-label="Update progress"><p class="text-xs text-muted-foreground"role=status>`);
|
|
16
17
|
var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-foreground flex items-center gap-2 text-sm"role=status>`);
|
|
17
18
|
var _tmpl$6 = /*#__PURE__*/ template(`<p class="text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm"role=alert>`);
|
|
18
19
|
var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-release-notes class="text-sm font-semibold text-foreground">What changed in this release</h2></div><div class="max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-release-notes tabindex=0>`);
|
|
19
|
-
var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><h2 id=update-changelog class="text-sm font-semibold text-foreground">Installed changelog</h2><p class="text-xs text-muted-foreground">All versions and updates included with this installation.</p><div class="max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-changelog tabindex=0>`);
|
|
20
|
-
var _tmpl$9 = /*#__PURE__*/ template(`<div class="flex min-h-0 flex-col gap-5 overflow-y-auto p-6"><section class="rounded-xl border border-border bg-background/45 p-4"aria-label="Version status"><div class="flex flex-wrap items-start justify-between gap-4"><div class="flex flex-col gap-1"><p class="text-2xs font-semibold tracking-widest text-muted-foreground uppercase">Installed version</p><p class="text-
|
|
20
|
+
var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><div class="flex items-center gap-2"><h2 id=update-changelog class="text-sm font-semibold text-foreground">Installed changelog</h2></div><p class="text-xs text-muted-foreground">All versions and updates included with this installation.</p><div class="max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground"role=region aria-labelledby=update-changelog tabindex=0>`);
|
|
21
|
+
var _tmpl$9 = /*#__PURE__*/ template(`<div class="flex min-h-0 flex-col gap-5 overflow-y-auto p-6"><section class="rounded-xl border border-border bg-background/45 p-4"aria-label="Version status"><div class="flex flex-wrap items-start justify-between gap-4"><div class="flex flex-col gap-1"><p class="text-2xs font-semibold tracking-widest text-muted-foreground uppercase">Installed version</p><p class="text-sm text-muted-foreground"></p></div><div class="flex flex-col items-end gap-2">`);
|
|
21
22
|
var _tmpl$0 = /*#__PURE__*/ template(`<img alt class=size-10 aria-hidden=true>`);
|
|
22
23
|
var _tmpl$1 = /*#__PURE__*/ template(`<p class="text-xs text-muted-foreground">Released `);
|
|
23
24
|
function messageText(value) {
|
|
@@ -384,11 +385,16 @@ function UpdateDialog(props) {
|
|
|
384
385
|
return _el$;
|
|
385
386
|
} }),
|
|
386
387
|
(() => {
|
|
387
|
-
var _el$3 = _tmpl$9(), _el$
|
|
388
|
-
_el$
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
388
|
+
var _el$3 = _tmpl$9(), _el$6 = _el$3.firstChild.firstChild.firstChild, _el$8 = _el$6.firstChild.nextSibling, _el$9 = _el$6.nextSibling;
|
|
389
|
+
insert(_el$6, createComponent(Heading, {
|
|
390
|
+
as: "p",
|
|
391
|
+
size: "page",
|
|
392
|
+
tone: "foreground",
|
|
393
|
+
get children() {
|
|
394
|
+
return ["v", memo(() => state()?.currentVersion || local.fallbackVersion || "0.1.0")];
|
|
395
|
+
}
|
|
396
|
+
}), _el$8);
|
|
397
|
+
insert(_el$8, createComponent(Show, {
|
|
392
398
|
get when() {
|
|
393
399
|
return isCurrent();
|
|
394
400
|
},
|
|
@@ -407,7 +413,7 @@ function UpdateDialog(props) {
|
|
|
407
413
|
},
|
|
408
414
|
children: "You are running the latest release."
|
|
409
415
|
}));
|
|
410
|
-
insert(_el$
|
|
416
|
+
insert(_el$9, createComponent(ActionButton, {
|
|
411
417
|
type: "button",
|
|
412
418
|
variant: "outline",
|
|
413
419
|
size: "sm",
|
|
@@ -433,27 +439,41 @@ function UpdateDialog(props) {
|
|
|
433
439
|
}), memo(() => checkFailed() ? "Retry update check" : "Check latest version")];
|
|
434
440
|
}
|
|
435
441
|
}), null);
|
|
442
|
+
insert(_el$9, createComponent(Show, {
|
|
443
|
+
get when() {
|
|
444
|
+
return isCurrent();
|
|
445
|
+
},
|
|
446
|
+
get children() {
|
|
447
|
+
var _el$0 = _tmpl$2(), _el$1 = _el$0.firstChild;
|
|
448
|
+
insert(_el$0, createComponent(Check, {
|
|
449
|
+
"class": "size-4 text-success",
|
|
450
|
+
"aria-hidden": "true"
|
|
451
|
+
}), _el$1);
|
|
452
|
+
insert(_el$0, appName, _el$1);
|
|
453
|
+
return _el$0;
|
|
454
|
+
}
|
|
455
|
+
}), null);
|
|
436
456
|
insert(_el$3, createComponent(Show, {
|
|
437
457
|
get when() {
|
|
438
458
|
return memo(() => !!(state()?.availableVersion && state()?.phase !== "installed"))() && state()?.phase !== "unavailable";
|
|
439
459
|
},
|
|
440
460
|
get children() {
|
|
441
|
-
var _el$
|
|
442
|
-
_el$
|
|
443
|
-
var _el$
|
|
444
|
-
_el$
|
|
445
|
-
insert(_el$
|
|
461
|
+
var _el$10 = _tmpl$3(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$16 = _el$14.nextSibling;
|
|
462
|
+
_el$16.nextSibling;
|
|
463
|
+
var _el$17 = _el$13.nextSibling, _el$20 = _el$17.firstChild.nextSibling;
|
|
464
|
+
_el$20.nextSibling;
|
|
465
|
+
insert(_el$13, createComponent(Sparkles, {
|
|
446
466
|
"class": "size-4 text-primary",
|
|
447
467
|
"aria-hidden": "true"
|
|
448
|
-
}), _el$
|
|
449
|
-
insert(_el$
|
|
450
|
-
insert(_el$
|
|
468
|
+
}), _el$14);
|
|
469
|
+
insert(_el$13, () => state()?.availableVersion, _el$16);
|
|
470
|
+
insert(_el$13, () => [
|
|
451
471
|
"downloading",
|
|
452
472
|
"installing",
|
|
453
473
|
"cancelling"
|
|
454
474
|
].includes(state()?.phase ?? "") ? "is being prepared" : "is ready", null);
|
|
455
|
-
insert(_el$
|
|
456
|
-
insert(_el$
|
|
475
|
+
insert(_el$17, appName, _el$20);
|
|
476
|
+
insert(_el$12, createComponent(Show, {
|
|
457
477
|
get when() {
|
|
458
478
|
return formatReleaseDate(state()?.releaseDate ?? null);
|
|
459
479
|
},
|
|
@@ -464,7 +484,7 @@ function UpdateDialog(props) {
|
|
|
464
484
|
return _el$35;
|
|
465
485
|
})()
|
|
466
486
|
}), null);
|
|
467
|
-
insert(_el$
|
|
487
|
+
insert(_el$11, createComponent(ActionButton, {
|
|
468
488
|
type: "button",
|
|
469
489
|
size: "sm",
|
|
470
490
|
get tooltip() {
|
|
@@ -491,7 +511,7 @@ function UpdateDialog(props) {
|
|
|
491
511
|
}), "Install and restart"];
|
|
492
512
|
}
|
|
493
513
|
}), null);
|
|
494
|
-
return _el$
|
|
514
|
+
return _el$10;
|
|
495
515
|
}
|
|
496
516
|
}), null);
|
|
497
517
|
insert(_el$3, createComponent(Show, {
|
|
@@ -499,16 +519,16 @@ function UpdateDialog(props) {
|
|
|
499
519
|
return state()?.phase === "downloading" || state()?.phase === "installing" || state()?.phase === "cancelling";
|
|
500
520
|
},
|
|
501
521
|
get children() {
|
|
502
|
-
var _el$
|
|
503
|
-
insert(_el$
|
|
522
|
+
var _el$21 = _tmpl$4(), _el$22 = _el$21.firstChild;
|
|
523
|
+
insert(_el$21, createComponent(Progress, {
|
|
504
524
|
get value() {
|
|
505
525
|
return progressValue() ?? void 0;
|
|
506
526
|
},
|
|
507
527
|
get ["aria-label"]() {
|
|
508
528
|
return state()?.phase === "installing" ? "Installing update" : "Downloading update";
|
|
509
529
|
}
|
|
510
|
-
}), _el$
|
|
511
|
-
insert(_el$
|
|
530
|
+
}), _el$22);
|
|
531
|
+
insert(_el$22, createComponent(Show, {
|
|
512
532
|
get when() {
|
|
513
533
|
return state()?.phase === "installing";
|
|
514
534
|
},
|
|
@@ -525,7 +545,7 @@ function UpdateDialog(props) {
|
|
|
525
545
|
},
|
|
526
546
|
children: "Applying the update…"
|
|
527
547
|
}));
|
|
528
|
-
insert(_el$
|
|
548
|
+
insert(_el$21, createComponent(Show, {
|
|
529
549
|
get when() {
|
|
530
550
|
return local.adapter.cancel;
|
|
531
551
|
},
|
|
@@ -545,21 +565,7 @@ function UpdateDialog(props) {
|
|
|
545
565
|
});
|
|
546
566
|
}
|
|
547
567
|
}), null);
|
|
548
|
-
return _el$
|
|
549
|
-
}
|
|
550
|
-
}), null);
|
|
551
|
-
insert(_el$3, createComponent(Show, {
|
|
552
|
-
get when() {
|
|
553
|
-
return isCurrent();
|
|
554
|
-
},
|
|
555
|
-
get children() {
|
|
556
|
-
var _el$22 = _tmpl$4(), _el$23 = _el$22.firstChild;
|
|
557
|
-
insert(_el$22, createComponent(Check, {
|
|
558
|
-
"class": "size-4 text-success",
|
|
559
|
-
"aria-hidden": "true"
|
|
560
|
-
}), _el$23);
|
|
561
|
-
insert(_el$22, appName, _el$23);
|
|
562
|
-
return _el$22;
|
|
568
|
+
return _el$21;
|
|
563
569
|
}
|
|
564
570
|
}), null);
|
|
565
571
|
insert(_el$3, createComponent(Show, {
|
|
@@ -567,12 +573,12 @@ function UpdateDialog(props) {
|
|
|
567
573
|
return state()?.phase === "installed";
|
|
568
574
|
},
|
|
569
575
|
get children() {
|
|
570
|
-
var _el$
|
|
571
|
-
insert(_el$
|
|
576
|
+
var _el$23 = _tmpl$5();
|
|
577
|
+
insert(_el$23, createComponent(Check, {
|
|
572
578
|
"class": "size-4 text-success",
|
|
573
579
|
"aria-hidden": "true"
|
|
574
580
|
}), null);
|
|
575
|
-
insert(_el$
|
|
581
|
+
insert(_el$23, createComponent(Show, {
|
|
576
582
|
get when() {
|
|
577
583
|
return state()?.restartRequired;
|
|
578
584
|
},
|
|
@@ -585,7 +591,7 @@ function UpdateDialog(props) {
|
|
|
585
591
|
];
|
|
586
592
|
}
|
|
587
593
|
}), null);
|
|
588
|
-
return _el$
|
|
594
|
+
return _el$23;
|
|
589
595
|
}
|
|
590
596
|
}), null);
|
|
591
597
|
insert(_el$3, createComponent(Show, {
|
|
@@ -593,9 +599,9 @@ function UpdateDialog(props) {
|
|
|
593
599
|
return error();
|
|
594
600
|
},
|
|
595
601
|
get children() {
|
|
596
|
-
var _el$
|
|
597
|
-
insert(_el$
|
|
598
|
-
return _el$
|
|
602
|
+
var _el$24 = _tmpl$6();
|
|
603
|
+
insert(_el$24, error);
|
|
604
|
+
return _el$24;
|
|
599
605
|
}
|
|
600
606
|
}), null);
|
|
601
607
|
insert(_el$3, createComponent(Show, {
|
|
@@ -603,18 +609,18 @@ function UpdateDialog(props) {
|
|
|
603
609
|
return notes();
|
|
604
610
|
},
|
|
605
611
|
get children() {
|
|
606
|
-
var _el$
|
|
607
|
-
_el$
|
|
608
|
-
var _el$
|
|
609
|
-
insert(_el$
|
|
612
|
+
var _el$25 = _tmpl$7(), _el$26 = _el$25.firstChild;
|
|
613
|
+
_el$26.firstChild;
|
|
614
|
+
var _el$28 = _el$26.nextSibling;
|
|
615
|
+
insert(_el$26, createComponent(Badge, {
|
|
610
616
|
variant: "subtle",
|
|
611
617
|
size: "sm",
|
|
612
618
|
get children() {
|
|
613
619
|
return ["v", memo(() => state()?.availableVersion)];
|
|
614
620
|
}
|
|
615
621
|
}), null);
|
|
616
|
-
insert(_el$
|
|
617
|
-
return _el$
|
|
622
|
+
insert(_el$28, notes);
|
|
623
|
+
return _el$25;
|
|
618
624
|
}
|
|
619
625
|
}), null);
|
|
620
626
|
insert(_el$3, createComponent(Show, {
|
|
@@ -622,9 +628,18 @@ function UpdateDialog(props) {
|
|
|
622
628
|
return changelog();
|
|
623
629
|
},
|
|
624
630
|
get children() {
|
|
625
|
-
var _el$
|
|
631
|
+
var _el$29 = _tmpl$8(), _el$30 = _el$29.firstChild;
|
|
632
|
+
_el$30.firstChild;
|
|
633
|
+
var _el$33 = _el$30.nextSibling.nextSibling;
|
|
634
|
+
insert(_el$30, createComponent(Badge, {
|
|
635
|
+
variant: "subtle",
|
|
636
|
+
size: "sm",
|
|
637
|
+
get children() {
|
|
638
|
+
return ["v", memo(() => state()?.currentVersion || local.fallbackVersion || "0.1.0")];
|
|
639
|
+
}
|
|
640
|
+
}), null);
|
|
626
641
|
insert(_el$33, changelog);
|
|
627
|
-
return _el$
|
|
642
|
+
return _el$29;
|
|
628
643
|
}
|
|
629
644
|
}), null);
|
|
630
645
|
return _el$3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-dialog.js","names":["createEffect","createMemo","createSignal","onCleanup","onMount","Show","splitProps","Accessor","Check","CircleStop","Download","ExternalLink","LoaderCircle","Monitor","RefreshCw","Sparkles","Badge","Button","ActionButton","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","DialogTrigger","createDialogFocusRestoration","Progress","cn","formatBytes","formatReleaseDate","plainTextFromMarkdown","UpdatePhase","UpdateState","Readonly","phase","currentVersion","availableVersion","changelog","releaseNotes","releaseDate","downloadedBytes","totalBytes","error","releaseUrl","restartRequired","UpdateAdapter","getStatus","Promise","check","install","expectedVersion","cancel","pollIntervalMs","openExternal","url","isDesktopRuntime","UpdateDialogProps","adapter","appName","appIcon","fallbackVersion","desktopOnlyMessage","open","defaultOpen","onOpenChange","restoreFocusRef","HTMLElement","class","messageText","value","undefined","message","trim","errorMessage","caught","fallback","Error","plainMessage","record","safe","nestedError","isBusy","state","UpdateDialog","props","local","uncontrolledOpen","setUncontrolledOpen","setOpen","next","focusRestoration","desktop","setState","busy","setBusy","setError","checkFailed","setCheckFailed","cancelPending","setCancelPending","lifecycleEpoch","activeOpenEpoch","disposed","loadStatus","isCurrent","status","previous","hasActionableSnapshot","candidate","preservesSnapshot","epoch","failCheck","applyCheckResult","current","checked","active","version","includes","requestInFlight","timer","window","setInterval","Math","max","clearInterval","openRelease","notes","working","triggerLabel","progressValue","min","round","_$createComponent","children","when","as","variant","size","_$memo","onKeyDown","event","KeyboardEvent","key","defaultPrevented","preventDefault","onOpenAutoFocus","currentTarget","focus","preventScroll","onCloseAutoFocus","_el$","_tmpl$","_el$2","firstChild","_$insert","icon","_el$34","_tmpl$0","_$effect","_$setAttribute","_el$3","_tmpl$9","_el$4","_el$5","_el$6","_el$7","_el$8","nextSibling","_el$9","_el$0","type","tooltip","disabled","onClick","_el$1","_tmpl$2","_el$10","_el$11","_el$12","_el$13","_el$15","_el$14","_el$16","_el$17","_el$19","_el$18","released","_el$35","_tmpl$1","_el$36","_el$20","_tmpl$3","_el$21","aria-label","_el$22","_tmpl$4","_el$23","_el$24","_tmpl$5","_el$25","_tmpl$6","_el$26","_tmpl$7","_el$27","_el$28","_el$29","_el$30","_tmpl$8","_el$31","_el$32","_el$33","_$createComponent","_$memo","_$setAttribute"],"sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n Show,\n splitProps,\n} from 'solid-js'\nimport type { Accessor } from 'solid-js'\nimport {\n Check,\n CircleStop,\n Download,\n ExternalLink,\n LoaderCircle,\n Monitor,\n RefreshCw,\n Sparkles,\n} from 'lucide-solid'\nimport { Badge } from '../../ui/badge'\nimport { Button } from '../../ui/button'\nimport { ActionButton } from '../action-button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '../../ui/dialog'\nimport { createDialogFocusRestoration } from '../../ui/dialog/dialog'\nimport { Progress } from '../../ui/progress'\nimport { cn } from '#lib/utils'\nimport { formatBytes, formatReleaseDate, plainTextFromMarkdown } from '#lib/version-notes'\n\n/**\n * UpdateDialog.\n *\n * A software-update surface: the installed version, whether a newer release\n * exists, a download that shows its progress, and the release notes for what is\n * about to arrive.\n *\n * The transport is an adapter, because an update is the one thing a component\n * library genuinely cannot implement: it is signed, downloaded and applied by the\n * application's own updater, and the mechanism differs per shell. What *is*\n * general is the phase machine and the way each phase is presented — and that is\n * where the hard-won detail lives:\n *\n * **A refused install answers with a normal payload, not a rejection.** adea's\n * shell returns a status whose phase is `failed` when a download or an extract\n * fails, rather than throwing. Without handling that, clicking install looked like\n * nothing happened at all — the button spun, the phase never changed, and the\n * error sat unread in a field nobody rendered. The `failed` phase after an install\n * is therefore surfaced as an error, explicitly.\n *\n * **Busy is derived from the snapshot as well as from the click.** An update can\n * be downloading while the dialog is open — started before it opened, or by the\n * shell's own poll — so a local `busy` flag alone would offer an enabled Install\n * button mid-download.\n *\n * **Opening the dialog loads status first, then checks.** Status paints the\n * installed version immediately; the check is a network round trip. Doing them in\n * the other order leaves the dialog blank for as long as the check takes, on a\n * dialog whose first question is always \"what am I running?\".\n *\n * **A failed check is not a current result.** A cached `current` status can only\n * be shown as up to date after the latest check succeeds; a failed check remains\n * retryable and suppresses that claim.\n *\n * **Errors are not always `Error`s.** An adapter can reject with a string or a\n * structured safe message. Unknown object fields are never serialized into the\n * UI; a generic fallback is shown instead.\n *\n * The adapter's `isDesktopRuntime` gate exists because an update is a desktop\n * concern: a browser build has no installer, and the honest thing to show is that\n * updates are available in the desktop application rather than a disabled button\n * with no reason.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/**\n * The updater, as the application exposes it. Three calls, each answering with a\n * full snapshot rather than a delta — an updater's state is small, and a snapshot\n * cannot drift from the shell's own view of it.\n */\nexport type UpdateAdapter = Readonly<{\n /** The current state, without contacting the release channel. */\n getStatus(): Promise<UpdateState>\n /** Ask the release channel, and answer with what it found. */\n check(): Promise<UpdateState>\n /**\n * Download and apply `expectedVersion`.\n *\n * The argument is the version the caller believes is available, so the updater\n * can refuse a request that raced a newer release rather than installing the\n * wrong one.\n */\n install(expectedVersion: string): Promise<UpdateState>\n /** Optional native cancellation, available only while work is in flight. */\n cancel?(): Promise<UpdateState>\n /** Enable status polling during native work; omit for push-driven adapters. */\n pollIntervalMs?: number\n /** Route external links through the native shell when needed. */\n openExternal?(url: string): Promise<void>\n /** False in a browser build, where there is no installer to drive. */\n isDesktopRuntime(): boolean\n}>\n\nexport type UpdateDialogProps = {\n adapter: UpdateAdapter\n /** The application's name, used in the title and the copy. */\n appName?: string\n /** The actual desktop application icon, supplied by its host. */\n appIcon?: string\n /** Complete build-time history, also available before the native status arrives. */\n changelog?: string\n /** Shown before the first status arrives, so the dialog is never blank. */\n fallbackVersion?: string\n /** Copy for the adapter's non-desktop case. */\n desktopOnlyMessage?: string\n /** A controlled open state. Omit for the trigger to manage its own. */\n open?: boolean\n /**\n * Start open, uncontrolled — for a caller that opens the dialog because it found\n * something (\"an update is available\") rather than because the user asked. The\n * trigger is still rendered, so the dialog is reachable again after closing.\n */\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /**\n * Supplies a stable external control to focus when a controlled dialog closes.\n * Useful when a menu or other layer closes before this dialog opens; when omitted,\n * the element focused immediately before the dialog opens is used when available.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Render only the panel, for a caller that provides its own dialog. */\n class?: string\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\nfunction errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nfunction isBusy(state: UpdateState | null): boolean {\n return (\n state?.phase === 'checking' ||\n state?.phase === 'downloading' ||\n state?.phase === 'installing' ||\n state?.phase === 'cancelling'\n )\n}\n\nexport function UpdateDialog(props: UpdateDialogProps) {\n const [local] = splitProps(props, [\n 'adapter',\n 'appName',\n 'appIcon',\n 'changelog',\n 'fallbackVersion',\n 'desktopOnlyMessage',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'restoreFocusRef',\n 'class',\n ])\n\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const focusRestoration = createDialogFocusRestoration({\n open,\n restoreFocusRef: local.restoreFocusRef,\n })\n\n const appName = () => local.appName ?? 'the application'\n const desktop = () => local.adapter.isDesktopRuntime()\n const [state, setState] = createSignal<UpdateState | null>(null)\n const [busy, setBusy] = createSignal(false)\n const [error, setError] = createSignal('')\n const [checkFailed, setCheckFailed] = createSignal(false)\n const [cancelPending, setCancelPending] = createSignal(false)\n let lifecycleEpoch = 0\n let activeOpenEpoch: number | undefined\n let disposed = false\n\n onCleanup(() => {\n disposed = true\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n })\n\n const loadStatus = async (isCurrent: () => boolean = () => !disposed) => {\n if (!desktop() || !isCurrent()) return\n try {\n const status = await local.adapter.getStatus()\n const previous = state()\n const hasActionableSnapshot = (candidate: UpdateState | null) =>\n candidate?.phase === 'available' || isBusy(candidate)\n const preservesSnapshot =\n previous?.phase === 'available'\n ? status.phase === 'available' || isBusy(status)\n : isBusy(previous) && isBusy(status)\n if (\n isCurrent() &&\n !(checkFailed() && hasActionableSnapshot(previous) && !preservesSnapshot)\n ) {\n setState(status)\n }\n } catch (caught) {\n if (isCurrent()) setError(errorMessage(caught, 'Version status is unavailable'))\n }\n }\n\n onMount(() => {\n if (desktop() && !open()) {\n const epoch = lifecycleEpoch\n void loadStatus(() => !disposed && lifecycleEpoch === epoch)\n }\n })\n\n const failCheck = (caught: unknown, fallback: string) => {\n const message = errorMessage(caught, fallback)\n setCheckFailed(true)\n setError(message)\n }\n\n const applyCheckResult = (next: UpdateState) => {\n if (next.phase === 'failed') {\n const current = state()\n if (!current) setState(next)\n failCheck(next.error, 'Could not check for updates')\n return\n }\n setState(next)\n setCheckFailed(false)\n setError('')\n }\n\n const check = async () => {\n if (!desktop()) {\n setError(local.desktopOnlyMessage ?? `Update checks are available from the desktop app.`)\n return\n }\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!isCurrent()) return\n setBusy(true)\n setError('')\n setCheckFailed(false)\n try {\n const checked = await local.adapter.check()\n if (isCurrent()) applyCheckResult(checked)\n } catch (caught) {\n if (isCurrent()) {\n failCheck(caught, 'Could not check for updates')\n await loadStatus(isCurrent)\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n /**\n * Status first, then the check — and an `active` flag, because the dialog can\n * close while the check is in flight and a late `setState` would write into a\n * disposed scope.\n */\n createEffect(() => {\n if (!open() || !desktop()) {\n setCancelPending(false)\n if (activeOpenEpoch !== undefined) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n return\n }\n const epoch = ++lifecycleEpoch\n activeOpenEpoch = epoch\n let active = true\n const isCurrent = () =>\n active && !disposed && activeOpenEpoch === epoch && lifecycleEpoch === epoch && open()\n onCleanup(() => {\n active = false\n if (activeOpenEpoch === epoch) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n })\n setError('')\n setCheckFailed(false)\n setCancelPending(false)\n setBusy(true)\n void (async () => {\n try {\n const current = await local.adapter.getStatus()\n if (!isCurrent()) return\n setState(current)\n const checked = await local.adapter.check()\n if (isCurrent()) applyCheckResult(checked)\n } catch (caught) {\n if (isCurrent()) failCheck(caught, 'Could not check for updates')\n } finally {\n if (isCurrent()) setBusy(false)\n }\n })()\n })\n\n const install = async () => {\n const version = state()?.availableVersion\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!version || !isCurrent()) return\n setBusy(true)\n setError('')\n setState((current) =>\n current ? { ...current, phase: 'downloading', downloadedBytes: 0, totalBytes: null } : current\n )\n try {\n const next = await local.adapter.install(version)\n if (!isCurrent()) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n // A refused install answers with a normal payload whose phase is `failed`.\n // Without this the click looked like nothing happened.\n if (next.phase === 'failed') {\n setError(errorMessage(next.error, 'Update installation failed'))\n } else {\n setCheckFailed(false)\n }\n } catch (caught) {\n if (!isCurrent()) return\n setError(errorMessage(caught, 'Update installation failed'))\n await loadStatus(isCurrent)\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n // Poll only an open, active native operation. Epoch ownership prevents a late\n // status response from replacing a reopened dialog's newer snapshot.\n createEffect(() => {\n const phase = state()?.phase\n if (\n !open() ||\n !desktop() ||\n !local.adapter.pollIntervalMs ||\n !['downloading', 'installing', 'cancelling'].includes(phase ?? '')\n )\n return\n const epoch = activeOpenEpoch\n let active = true\n let requestInFlight = false\n const timer = window.setInterval(\n () => {\n if (requestInFlight) return\n requestInFlight = true\n void (async () => {\n try {\n const next = await local.adapter.getStatus()\n if (!active || disposed || !open() || activeOpenEpoch !== epoch) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n if (next.phase === 'failed')\n setError(errorMessage(next.error, 'Update installation failed'))\n } catch (caught) {\n if (active && !disposed && activeOpenEpoch === epoch)\n setError(errorMessage(caught, 'Update progress is unavailable'))\n } finally {\n requestInFlight = false\n }\n })()\n },\n Math.max(250, local.adapter.pollIntervalMs)\n )\n onCleanup(() => {\n active = false\n window.clearInterval(timer)\n })\n })\n\n const cancel = async () => {\n if (!local.adapter.cancel || cancelPending() || state()?.phase === 'cancelling') return\n const epoch = activeOpenEpoch\n setError('')\n setCancelPending(true)\n setState((current) => (current ? { ...current, phase: 'cancelling' } : current))\n try {\n const next = await local.adapter.cancel()\n if (!disposed && open() && activeOpenEpoch === epoch) setState(next)\n } catch (caught) {\n if (!disposed && open() && activeOpenEpoch === epoch) {\n setError(errorMessage(caught, 'Could not cancel the update'))\n await loadStatus(() => !disposed && open() && activeOpenEpoch === epoch)\n }\n } finally {\n if (!disposed && open() && activeOpenEpoch === epoch) setCancelPending(false)\n }\n }\n\n const openRelease = async (url: string) => {\n try {\n if (local.adapter.openExternal) await local.adapter.openExternal(url)\n else window.open(url, '_blank', 'noopener,noreferrer')\n } catch (caught) {\n if (!disposed) setError(errorMessage(caught, 'Could not open the release page'))\n }\n }\n\n const changelog = createMemo(() =>\n plainTextFromMarkdown(state()?.changelog || local.changelog || '')\n )\n const notes = () => {\n const value = state()?.releaseNotes\n return value ? plainTextFromMarkdown(value) : ''\n }\n const working = () => busy() || cancelPending() || isBusy(state())\n const isCurrent = () => state()?.phase === 'current' && !error() && !checkFailed() && !working()\n\n const triggerLabel = () => {\n const current = state()\n const fallback = `v${local.fallbackVersion ?? '0.1.0'}`\n if (checkFailed()) return `Version ${current?.currentVersion || fallback} · Retry`\n if (!current) return `${appName()} ${fallback}`\n switch (current.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return current.availableVersion\n ? `Update v${current.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${current.currentVersion || fallback} · Retry`\n default:\n return `${appName()} v${current.currentVersion || fallback}`\n }\n }\n\n const progressValue = () => {\n const current = state()\n if (!current?.totalBytes || !current.downloadedBytes) return null\n return Math.min(100, Math.round((current.downloadedBytes / current.totalBytes) * 100))\n }\n\n return (\n <Dialog open={open()} onOpenChange={setOpen}>\n <Show when={local.open === undefined}>\n <DialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Open version and updates\"\n aria-haspopup=\"dialog\"\n >\n <Show when={state()?.phase === 'available'} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <Sparkles aria-hidden=\"true\" />\n </Show>\n {triggerLabel()}\n </DialogTrigger>\n </Show>\n\n <DialogContent\n class={cn('max-w-3xl', local.class)}\n onKeyDown={(event: KeyboardEvent) => {\n // An explanatory tooltip must not consume the popup's close shortcut,\n // including while its exit animation still owns Kobalte's top layer.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault()\n setOpen(false)\n }\n }}\n onOpenAutoFocus={(event) => {\n focusRestoration.onOpenAutoFocus(event)\n // Start at the readable panel rather than opening an action's tooltip.\n if (!event.defaultPrevented && event.currentTarget instanceof HTMLElement) {\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n }\n }}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader>\n <div class=\"flex items-center gap-3\">\n <Show\n when={local.appIcon}\n fallback={<Monitor class=\"size-10 text-primary\" aria-hidden=\"true\" />}\n >\n {(icon) => <img src={icon()} alt=\"\" class=\"size-10\" aria-hidden=\"true\" />}\n </Show>\n <div>\n <DialogTitle>Version & updates</DialogTitle>\n <DialogDescription>\n Keep {appName()} current and review what changed in each release.\n </DialogDescription>\n </div>\n </div>\n </DialogHeader>\n\n <div class=\"flex min-h-0 flex-col gap-5 overflow-y-auto p-6\">\n <section\n class=\"rounded-xl border border-border bg-background/45 p-4\"\n aria-label=\"Version status\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"text-2xs font-semibold tracking-widest text-muted-foreground uppercase\">\n Installed version\n </p>\n <p class=\"text-xl font-semibold tracking-tight text-foreground\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </p>\n <p class=\"text-sm text-muted-foreground\">\n <Show\n when={isCurrent()}\n fallback={\n <Show\n when={state()?.phase === 'available' && state()?.availableVersion}\n fallback={\n state()?.phase === 'unavailable'\n ? 'No signed package is published for this platform.'\n : state()?.phase === 'cancelled'\n ? 'Update cancelled. You can retry when ready.'\n : desktop()\n ? 'Check the release channel for the latest signed build.'\n : (local.desktopOnlyMessage ??\n `Open this dialog inside the desktop app to check for updates.`)\n }\n >\n {`A newer release, v${state()?.availableVersion}, is ready.`}\n </Show>\n }\n >\n You are running the latest release.\n </Show>\n </p>\n </div>\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Check the release channel for the latest signed app version.\"\n disabled={!desktop() || working()}\n onClick={() => void check()}\n >\n <Show when={working()} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n {checkFailed() ? 'Retry update check' : 'Check latest version'}\n </ActionButton>\n </div>\n </section>\n\n <Show\n when={\n state()?.availableVersion &&\n state()?.phase !== 'installed' &&\n state()?.phase !== 'unavailable'\n }\n >\n <section\n class=\"rounded-xl border border-primary/35 bg-primary-subtle p-4\"\n aria-label=\"Available update\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"flex items-center gap-2 text-sm font-semibold\">\n <Sparkles class=\"size-4 text-primary\" aria-hidden=\"true\" />\n Version {state()?.availableVersion}{' '}\n {['downloading', 'installing', 'cancelling'].includes(state()?.phase ?? '')\n ? 'is being prepared'\n : 'is ready'}\n </p>\n <p class=\"text-sm text-muted-foreground\">\n The signed installer is verified before {appName()} restarts.\n </p>\n <Show when={formatReleaseDate(state()?.releaseDate ?? null)}>\n {(released) => (\n <p class=\"text-xs text-muted-foreground\">Released {released()}</p>\n )}\n </Show>\n </div>\n <ActionButton\n type=\"button\"\n size=\"sm\"\n tooltip={`Download the signed update and restart ${appName()}.`}\n disabled={working()}\n onClick={() => void install()}\n >\n <Show when={working()} fallback={<Download aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n Install and restart\n </ActionButton>\n </div>\n </section>\n </Show>\n\n {/*\n Progress with both numbers: a bar alone does not distinguish a stalled\n download from a slow one, and \"12.4 MB of 48.1 MB\" does.\n */}\n <Show\n when={\n state()?.phase === 'downloading' ||\n state()?.phase === 'installing' ||\n state()?.phase === 'cancelling'\n }\n >\n <section class=\"grid gap-2\" aria-label=\"Update progress\">\n <Progress\n value={progressValue() ?? undefined}\n aria-label={\n state()?.phase === 'installing' ? 'Installing update' : 'Downloading update'\n }\n />\n <p class=\"text-xs text-muted-foreground\" role=\"status\">\n <Show\n when={state()?.phase === 'installing'}\n fallback={\n <Show when={progressValue() !== null} fallback=\"Downloading…\">\n {`${formatBytes(state()?.downloadedBytes ?? 0)} of ${formatBytes(\n state()?.totalBytes ?? 0\n )} · ${progressValue()}%`}\n </Show>\n }\n >\n Applying the update…\n </Show>\n </p>\n <Show when={local.adapter.cancel}>\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Stop the current update download or installation.\"\n disabled={cancelPending() || state()?.phase === 'cancelling'}\n onClick={() => void cancel()}\n >\n <CircleStop aria-hidden=\"true\" />\n {cancelPending() || state()?.phase === 'cancelling'\n ? 'Cancelling…'\n : 'Cancel update'}\n </ActionButton>\n </Show>\n </section>\n </Show>\n\n <Show when={isCurrent()}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n {appName()} is up to date.\n </p>\n </Show>\n\n <Show when={state()?.phase === 'installed'}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n <Show when={state()?.restartRequired} fallback=\"The update is applied.\">\n Restart {appName()} to finish the update.\n </Show>\n </p>\n </Show>\n\n <Show when={error()}>\n <p\n class=\"text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm\"\n role=\"alert\"\n >\n {error()}\n </p>\n </Show>\n\n <Show when={notes()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-release-notes\" class=\"text-sm font-semibold text-foreground\">\n What changed in this release\n </h2>\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.availableVersion}\n </Badge>\n </div>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-release-notes\"\n tabindex=\"0\"\n >\n {notes()}\n </div>\n </div>\n </Show>\n\n <Show when={changelog()}>\n <div class=\"flex flex-col gap-2\">\n <h2 id=\"update-changelog\" class=\"text-sm font-semibold text-foreground\">\n Installed changelog\n </h2>\n <p class=\"text-xs text-muted-foreground\">\n All versions and updates included with this installation.\n </p>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-changelog\"\n tabindex=\"0\"\n >\n {changelog()}\n </div>\n </div>\n </Show>\n </div>\n\n <DialogFooter>\n <Show when={state()?.releaseUrl}>\n {(url) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n tooltip=\"Open the release history in your browser.\"\n // `noopener,noreferrer` because the release page is a different\n // origin and must not get a handle on this window.\n onClick={() => void openRelease(url())}\n >\n <ExternalLink aria-hidden=\"true\" />\n View releases\n </ActionButton>\n )}\n </Show>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Close\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoLA,SAASsE,YAAYC,OAAoC;CACvD,IAAI,OAAOA,UAAU,UAAU,OAAOC,KAAAA;CACtC,MAAMC,UAAUF,MAAMG,KAAK;CAC3B,OAAOD,WAAWA,YAAY,oBAAoBA,UAAUD,KAAAA;AAC9D;AAEA,SAASG,aAAaC,QAAiBC,UAA0B;CAC/D,IAAID,kBAAkBE,OAAO,OAAOR,YAAYM,OAAOH,OAAO,KAAKI;CACnE,MAAME,eAAeT,YAAYM,MAAM;CACvC,IAAIG,cAAc,OAAOA;CACzB,IAAI,CAACH,UAAU,OAAOA,WAAW,UAAU,OAAOC;CAElD,MAAMG,SAASJ;CACf,MAAMK,OAAOD,OAAOC;CACpB,MAAMC,cAAcF,OAAOpC;CAC3B,OAAO0B,YAAYW,MAAMR,OAAO,KAAKH,YAAYY,aAAaD,MAAMR,OAAO,KAAKI;AAClF;;;;;;;AAQA,SAASM,OAAOC,OAAoC;CAClD,OACEA,OAAOhD,UAAU,cACjBgD,OAAOhD,UAAU,iBACjBgD,OAAOhD,UAAU,gBACjBgD,OAAOhD,UAAU;AAErB;AAEA,SAAgBiD,aAAaC,OAA0B;CACrD,MAAM,CAACC,SAASjF,WAAWgF,OAAO;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;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2H,gBAEFlH,aAAW;QAACqH,IAAIxH;QAAQyH,SAAO;QAAWC,MAAI;QAAAJ,UAAA;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
|
|
1
|
+
{"version":3,"file":"update-dialog.js","names":["createEffect","createMemo","createSignal","onCleanup","onMount","Show","splitProps","Accessor","Check","CircleStop","Download","ExternalLink","LoaderCircle","Monitor","RefreshCw","Sparkles","Badge","Button","ActionButton","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","DialogTrigger","createDialogFocusRestoration","Progress","Heading","cn","formatBytes","formatReleaseDate","plainTextFromMarkdown","UpdatePhase","UpdateState","Readonly","phase","currentVersion","availableVersion","changelog","releaseNotes","releaseDate","downloadedBytes","totalBytes","error","releaseUrl","restartRequired","UpdateAdapter","getStatus","Promise","check","install","expectedVersion","cancel","pollIntervalMs","openExternal","url","isDesktopRuntime","UpdateDialogProps","adapter","appName","appIcon","fallbackVersion","desktopOnlyMessage","open","defaultOpen","onOpenChange","restoreFocusRef","HTMLElement","class","messageText","value","undefined","message","trim","errorMessage","caught","fallback","Error","plainMessage","record","safe","nestedError","isBusy","state","UpdateDialog","props","local","uncontrolledOpen","setUncontrolledOpen","setOpen","next","focusRestoration","desktop","setState","busy","setBusy","setError","checkFailed","setCheckFailed","cancelPending","setCancelPending","lifecycleEpoch","activeOpenEpoch","disposed","loadStatus","isCurrent","status","previous","hasActionableSnapshot","candidate","preservesSnapshot","epoch","failCheck","applyCheckResult","current","checked","active","version","includes","requestInFlight","timer","window","setInterval","Math","max","clearInterval","openRelease","notes","working","triggerLabel","progressValue","min","round","_$createComponent","children","when","as","variant","size","_$memo","onKeyDown","event","KeyboardEvent","key","defaultPrevented","preventDefault","onOpenAutoFocus","currentTarget","focus","preventScroll","onCloseAutoFocus","_el$","_tmpl$","_el$2","firstChild","_$insert","icon","_el$34","_tmpl$0","_$effect","_$setAttribute","_el$3","_tmpl$9","_el$4","_el$5","_el$6","_el$7","_el$8","nextSibling","_el$9","tone","type","tooltip","disabled","onClick","_el$0","_tmpl$2","_el$1","_el$10","_tmpl$3","_el$11","_el$12","_el$13","_el$14","_el$16","_el$15","_el$17","_el$18","_el$20","_el$19","released","_el$35","_tmpl$1","_el$36","_el$21","_tmpl$4","_el$22","aria-label","_el$23","_tmpl$5","_el$24","_tmpl$6","_el$25","_tmpl$7","_el$26","_el$27","_el$28","_el$29","_tmpl$8","_el$30","_el$31","_el$32","_el$33","_$createComponent","_$memo","_$setAttribute"],"sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"sourcesContent":["import {\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n onMount,\n Show,\n splitProps,\n} from 'solid-js'\nimport type { Accessor } from 'solid-js'\nimport {\n Check,\n CircleStop,\n Download,\n ExternalLink,\n LoaderCircle,\n Monitor,\n RefreshCw,\n Sparkles,\n} from 'lucide-solid'\nimport { Badge } from '../../ui/badge'\nimport { Button } from '../../ui/button'\nimport { ActionButton } from '../action-button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '../../ui/dialog'\nimport { createDialogFocusRestoration } from '../../ui/dialog/dialog'\nimport { Progress } from '../../ui/progress'\nimport { Heading } from '../../ui/typography'\nimport { cn } from '#lib/utils'\nimport { formatBytes, formatReleaseDate, plainTextFromMarkdown } from '#lib/version-notes'\n\n/**\n * UpdateDialog.\n *\n * A software-update surface: the installed version, whether a newer release\n * exists, a download that shows its progress, and the release notes for what is\n * about to arrive.\n *\n * The transport is an adapter, because an update is the one thing a component\n * library genuinely cannot implement: it is signed, downloaded and applied by the\n * application's own updater, and the mechanism differs per shell. What *is*\n * general is the phase machine and the way each phase is presented — and that is\n * where the hard-won detail lives:\n *\n * **A refused install answers with a normal payload, not a rejection.** adea's\n * shell returns a status whose phase is `failed` when a download or an extract\n * fails, rather than throwing. Without handling that, clicking install looked like\n * nothing happened at all — the button spun, the phase never changed, and the\n * error sat unread in a field nobody rendered. The `failed` phase after an install\n * is therefore surfaced as an error, explicitly.\n *\n * **Busy is derived from the snapshot as well as from the click.** An update can\n * be downloading while the dialog is open — started before it opened, or by the\n * shell's own poll — so a local `busy` flag alone would offer an enabled Install\n * button mid-download.\n *\n * **Opening the dialog loads status first, then checks.** Status paints the\n * installed version immediately; the check is a network round trip. Doing them in\n * the other order leaves the dialog blank for as long as the check takes, on a\n * dialog whose first question is always \"what am I running?\".\n *\n * **A failed check is not a current result.** A cached `current` status can only\n * be shown as up to date after the latest check succeeds; a failed check remains\n * retryable and suppresses that claim.\n *\n * **Errors are not always `Error`s.** An adapter can reject with a string or a\n * structured safe message. Unknown object fields are never serialized into the\n * UI; a generic fallback is shown instead.\n *\n * The adapter's `isDesktopRuntime` gate exists because an update is a desktop\n * concern: a browser build has no installer, and the honest thing to show is that\n * updates are available in the desktop application rather than a disabled button\n * with no reason.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/**\n * The updater, as the application exposes it. Three calls, each answering with a\n * full snapshot rather than a delta — an updater's state is small, and a snapshot\n * cannot drift from the shell's own view of it.\n */\nexport type UpdateAdapter = Readonly<{\n /** The current state, without contacting the release channel. */\n getStatus(): Promise<UpdateState>\n /** Ask the release channel, and answer with what it found. */\n check(): Promise<UpdateState>\n /**\n * Download and apply `expectedVersion`.\n *\n * The argument is the version the caller believes is available, so the updater\n * can refuse a request that raced a newer release rather than installing the\n * wrong one.\n */\n install(expectedVersion: string): Promise<UpdateState>\n /** Optional native cancellation, available only while work is in flight. */\n cancel?(): Promise<UpdateState>\n /** Enable status polling during native work; omit for push-driven adapters. */\n pollIntervalMs?: number\n /** Route external links through the native shell when needed. */\n openExternal?(url: string): Promise<void>\n /** False in a browser build, where there is no installer to drive. */\n isDesktopRuntime(): boolean\n}>\n\nexport type UpdateDialogProps = {\n adapter: UpdateAdapter\n /** The application's name, used in the title and the copy. */\n appName?: string\n /** The actual desktop application icon, supplied by its host. */\n appIcon?: string\n /** Complete build-time history, also available before the native status arrives. */\n changelog?: string\n /** Shown before the first status arrives, so the dialog is never blank. */\n fallbackVersion?: string\n /** Copy for the adapter's non-desktop case. */\n desktopOnlyMessage?: string\n /** A controlled open state. Omit for the trigger to manage its own. */\n open?: boolean\n /**\n * Start open, uncontrolled — for a caller that opens the dialog because it found\n * something (\"an update is available\") rather than because the user asked. The\n * trigger is still rendered, so the dialog is reachable again after closing.\n */\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /**\n * Supplies a stable external control to focus when a controlled dialog closes.\n * Useful when a menu or other layer closes before this dialog opens; when omitted,\n * the element focused immediately before the dialog opens is used when available.\n */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Render only the panel, for a caller that provides its own dialog. */\n class?: string\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\nfunction errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nfunction isBusy(state: UpdateState | null): boolean {\n return (\n state?.phase === 'checking' ||\n state?.phase === 'downloading' ||\n state?.phase === 'installing' ||\n state?.phase === 'cancelling'\n )\n}\n\nexport function UpdateDialog(props: UpdateDialogProps) {\n const [local] = splitProps(props, [\n 'adapter',\n 'appName',\n 'appIcon',\n 'changelog',\n 'fallbackVersion',\n 'desktopOnlyMessage',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'restoreFocusRef',\n 'class',\n ])\n\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const open = () => local.open ?? uncontrolledOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n }\n\n const focusRestoration = createDialogFocusRestoration({\n open,\n restoreFocusRef: local.restoreFocusRef,\n })\n\n const appName = () => local.appName ?? 'the application'\n const desktop = () => local.adapter.isDesktopRuntime()\n const [state, setState] = createSignal<UpdateState | null>(null)\n const [busy, setBusy] = createSignal(false)\n const [error, setError] = createSignal('')\n const [checkFailed, setCheckFailed] = createSignal(false)\n const [cancelPending, setCancelPending] = createSignal(false)\n let lifecycleEpoch = 0\n let activeOpenEpoch: number | undefined\n let disposed = false\n\n onCleanup(() => {\n disposed = true\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n })\n\n const loadStatus = async (isCurrent: () => boolean = () => !disposed) => {\n if (!desktop() || !isCurrent()) return\n try {\n const status = await local.adapter.getStatus()\n const previous = state()\n const hasActionableSnapshot = (candidate: UpdateState | null) =>\n candidate?.phase === 'available' || isBusy(candidate)\n const preservesSnapshot =\n previous?.phase === 'available'\n ? status.phase === 'available' || isBusy(status)\n : isBusy(previous) && isBusy(status)\n if (\n isCurrent() &&\n !(checkFailed() && hasActionableSnapshot(previous) && !preservesSnapshot)\n ) {\n setState(status)\n }\n } catch (caught) {\n if (isCurrent()) setError(errorMessage(caught, 'Version status is unavailable'))\n }\n }\n\n onMount(() => {\n if (desktop() && !open()) {\n const epoch = lifecycleEpoch\n void loadStatus(() => !disposed && lifecycleEpoch === epoch)\n }\n })\n\n const failCheck = (caught: unknown, fallback: string) => {\n const message = errorMessage(caught, fallback)\n setCheckFailed(true)\n setError(message)\n }\n\n const applyCheckResult = (next: UpdateState) => {\n if (next.phase === 'failed') {\n const current = state()\n if (!current) setState(next)\n failCheck(next.error, 'Could not check for updates')\n return\n }\n setState(next)\n setCheckFailed(false)\n setError('')\n }\n\n const check = async () => {\n if (!desktop()) {\n setError(local.desktopOnlyMessage ?? `Update checks are available from the desktop app.`)\n return\n }\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!isCurrent()) return\n setBusy(true)\n setError('')\n setCheckFailed(false)\n try {\n const checked = await local.adapter.check()\n if (isCurrent()) applyCheckResult(checked)\n } catch (caught) {\n if (isCurrent()) {\n failCheck(caught, 'Could not check for updates')\n await loadStatus(isCurrent)\n }\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n /**\n * Status first, then the check — and an `active` flag, because the dialog can\n * close while the check is in flight and a late `setState` would write into a\n * disposed scope.\n */\n createEffect(() => {\n if (!open() || !desktop()) {\n setCancelPending(false)\n if (activeOpenEpoch !== undefined) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n return\n }\n const epoch = ++lifecycleEpoch\n activeOpenEpoch = epoch\n let active = true\n const isCurrent = () =>\n active && !disposed && activeOpenEpoch === epoch && lifecycleEpoch === epoch && open()\n onCleanup(() => {\n active = false\n if (activeOpenEpoch === epoch) {\n activeOpenEpoch = undefined\n lifecycleEpoch += 1\n }\n })\n setError('')\n setCheckFailed(false)\n setCancelPending(false)\n setBusy(true)\n void (async () => {\n try {\n const current = await local.adapter.getStatus()\n if (!isCurrent()) return\n setState(current)\n const checked = await local.adapter.check()\n if (isCurrent()) applyCheckResult(checked)\n } catch (caught) {\n if (isCurrent()) failCheck(caught, 'Could not check for updates')\n } finally {\n if (isCurrent()) setBusy(false)\n }\n })()\n })\n\n const install = async () => {\n const version = state()?.availableVersion\n const epoch = activeOpenEpoch\n const isCurrent = () =>\n !disposed &&\n epoch !== undefined &&\n activeOpenEpoch === epoch &&\n lifecycleEpoch === epoch &&\n open()\n if (!version || !isCurrent()) return\n setBusy(true)\n setError('')\n setState((current) =>\n current ? { ...current, phase: 'downloading', downloadedBytes: 0, totalBytes: null } : current\n )\n try {\n const next = await local.adapter.install(version)\n if (!isCurrent()) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n // A refused install answers with a normal payload whose phase is `failed`.\n // Without this the click looked like nothing happened.\n if (next.phase === 'failed') {\n setError(errorMessage(next.error, 'Update installation failed'))\n } else {\n setCheckFailed(false)\n }\n } catch (caught) {\n if (!isCurrent()) return\n setError(errorMessage(caught, 'Update installation failed'))\n await loadStatus(isCurrent)\n } finally {\n if (isCurrent()) setBusy(false)\n }\n }\n\n // Poll only an open, active native operation. Epoch ownership prevents a late\n // status response from replacing a reopened dialog's newer snapshot.\n createEffect(() => {\n const phase = state()?.phase\n if (\n !open() ||\n !desktop() ||\n !local.adapter.pollIntervalMs ||\n !['downloading', 'installing', 'cancelling'].includes(phase ?? '')\n )\n return\n const epoch = activeOpenEpoch\n let active = true\n let requestInFlight = false\n const timer = window.setInterval(\n () => {\n if (requestInFlight) return\n requestInFlight = true\n void (async () => {\n try {\n const next = await local.adapter.getStatus()\n if (!active || disposed || !open() || activeOpenEpoch !== epoch) return\n setState(\n cancelPending() && ['downloading', 'installing'].includes(next.phase)\n ? { ...next, phase: 'cancelling' }\n : next\n )\n if (next.phase === 'failed')\n setError(errorMessage(next.error, 'Update installation failed'))\n } catch (caught) {\n if (active && !disposed && activeOpenEpoch === epoch)\n setError(errorMessage(caught, 'Update progress is unavailable'))\n } finally {\n requestInFlight = false\n }\n })()\n },\n Math.max(250, local.adapter.pollIntervalMs)\n )\n onCleanup(() => {\n active = false\n window.clearInterval(timer)\n })\n })\n\n const cancel = async () => {\n if (!local.adapter.cancel || cancelPending() || state()?.phase === 'cancelling') return\n const epoch = activeOpenEpoch\n setError('')\n setCancelPending(true)\n setState((current) => (current ? { ...current, phase: 'cancelling' } : current))\n try {\n const next = await local.adapter.cancel()\n if (!disposed && open() && activeOpenEpoch === epoch) setState(next)\n } catch (caught) {\n if (!disposed && open() && activeOpenEpoch === epoch) {\n setError(errorMessage(caught, 'Could not cancel the update'))\n await loadStatus(() => !disposed && open() && activeOpenEpoch === epoch)\n }\n } finally {\n if (!disposed && open() && activeOpenEpoch === epoch) setCancelPending(false)\n }\n }\n\n const openRelease = async (url: string) => {\n try {\n if (local.adapter.openExternal) await local.adapter.openExternal(url)\n else window.open(url, '_blank', 'noopener,noreferrer')\n } catch (caught) {\n if (!disposed) setError(errorMessage(caught, 'Could not open the release page'))\n }\n }\n\n const changelog = createMemo(() =>\n plainTextFromMarkdown(state()?.changelog || local.changelog || '')\n )\n const notes = () => {\n const value = state()?.releaseNotes\n return value ? plainTextFromMarkdown(value) : ''\n }\n const working = () => busy() || cancelPending() || isBusy(state())\n const isCurrent = () => state()?.phase === 'current' && !error() && !checkFailed() && !working()\n\n const triggerLabel = () => {\n const current = state()\n const fallback = `v${local.fallbackVersion ?? '0.1.0'}`\n if (checkFailed()) return `Version ${current?.currentVersion || fallback} · Retry`\n if (!current) return `${appName()} ${fallback}`\n switch (current.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return current.availableVersion\n ? `Update v${current.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${current.currentVersion || fallback} · Retry`\n default:\n return `${appName()} v${current.currentVersion || fallback}`\n }\n }\n\n const progressValue = () => {\n const current = state()\n if (!current?.totalBytes || !current.downloadedBytes) return null\n return Math.min(100, Math.round((current.downloadedBytes / current.totalBytes) * 100))\n }\n\n return (\n <Dialog open={open()} onOpenChange={setOpen}>\n <Show when={local.open === undefined}>\n <DialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Open version and updates\"\n aria-haspopup=\"dialog\"\n >\n <Show when={state()?.phase === 'available'} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <Sparkles aria-hidden=\"true\" />\n </Show>\n {triggerLabel()}\n </DialogTrigger>\n </Show>\n\n <DialogContent\n class={cn('max-w-3xl', local.class)}\n onKeyDown={(event: KeyboardEvent) => {\n // An explanatory tooltip must not consume the popup's close shortcut,\n // including while its exit animation still owns Kobalte's top layer.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault()\n setOpen(false)\n }\n }}\n onOpenAutoFocus={(event) => {\n focusRestoration.onOpenAutoFocus(event)\n // Start at the readable panel rather than opening an action's tooltip.\n if (!event.defaultPrevented && event.currentTarget instanceof HTMLElement) {\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n }\n }}\n onCloseAutoFocus={focusRestoration.onCloseAutoFocus}\n >\n <DialogHeader>\n <div class=\"flex items-center gap-3\">\n <Show\n when={local.appIcon}\n fallback={<Monitor class=\"size-10 text-primary\" aria-hidden=\"true\" />}\n >\n {(icon) => <img src={icon()} alt=\"\" class=\"size-10\" aria-hidden=\"true\" />}\n </Show>\n <div>\n <DialogTitle>Version & updates</DialogTitle>\n <DialogDescription>\n Keep {appName()} current and review what changed in each release.\n </DialogDescription>\n </div>\n </div>\n </DialogHeader>\n\n <div class=\"flex min-h-0 flex-col gap-5 overflow-y-auto p-6\">\n <section\n class=\"rounded-xl border border-border bg-background/45 p-4\"\n aria-label=\"Version status\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"text-2xs font-semibold tracking-widest text-muted-foreground uppercase\">\n Installed version\n </p>\n <Heading as=\"p\" size=\"page\" tone=\"foreground\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Heading>\n <p class=\"text-sm text-muted-foreground\">\n <Show\n when={isCurrent()}\n fallback={\n <Show\n when={state()?.phase === 'available' && state()?.availableVersion}\n fallback={\n state()?.phase === 'unavailable'\n ? 'No signed package is published for this platform.'\n : state()?.phase === 'cancelled'\n ? 'Update cancelled. You can retry when ready.'\n : desktop()\n ? 'Check the release channel for the latest signed build.'\n : (local.desktopOnlyMessage ??\n `Open this dialog inside the desktop app to check for updates.`)\n }\n >\n {`A newer release, v${state()?.availableVersion}, is ready.`}\n </Show>\n }\n >\n You are running the latest release.\n </Show>\n </p>\n </div>\n <div class=\"flex flex-col items-end gap-2\">\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Check the release channel for the latest signed app version.\"\n disabled={!desktop() || working()}\n onClick={() => void check()}\n >\n <Show when={working()} fallback={<RefreshCw aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n {checkFailed() ? 'Retry update check' : 'Check latest version'}\n </ActionButton>\n {/* The up-to-date confirmation reads as the button's outcome,\n so it sits directly beneath it rather than floating as a\n full-width row between sections. */}\n <Show when={isCurrent()}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n {appName()} is up to date.\n </p>\n </Show>\n </div>\n </div>\n </section>\n\n <Show\n when={\n state()?.availableVersion &&\n state()?.phase !== 'installed' &&\n state()?.phase !== 'unavailable'\n }\n >\n <section\n class=\"rounded-xl border border-primary/35 bg-primary-subtle p-4\"\n aria-label=\"Available update\"\n >\n <div class=\"flex flex-wrap items-start justify-between gap-4\">\n <div class=\"flex flex-col gap-1\">\n <p class=\"flex items-center gap-2 text-sm font-semibold\">\n <Sparkles class=\"size-4 text-primary\" aria-hidden=\"true\" />\n Version {state()?.availableVersion}{' '}\n {['downloading', 'installing', 'cancelling'].includes(state()?.phase ?? '')\n ? 'is being prepared'\n : 'is ready'}\n </p>\n <p class=\"text-sm text-muted-foreground\">\n The signed installer is verified before {appName()} restarts.\n </p>\n <Show when={formatReleaseDate(state()?.releaseDate ?? null)}>\n {(released) => (\n <p class=\"text-xs text-muted-foreground\">Released {released()}</p>\n )}\n </Show>\n </div>\n <ActionButton\n type=\"button\"\n size=\"sm\"\n tooltip={`Download the signed update and restart ${appName()}.`}\n disabled={working()}\n onClick={() => void install()}\n >\n <Show when={working()} fallback={<Download aria-hidden=\"true\" />}>\n <LoaderCircle class=\"animate-spin\" aria-hidden=\"true\" />\n </Show>\n Install and restart\n </ActionButton>\n </div>\n </section>\n </Show>\n\n {/*\n Progress with both numbers: a bar alone does not distinguish a stalled\n download from a slow one, and \"12.4 MB of 48.1 MB\" does.\n */}\n <Show\n when={\n state()?.phase === 'downloading' ||\n state()?.phase === 'installing' ||\n state()?.phase === 'cancelling'\n }\n >\n <section class=\"grid gap-2\" aria-label=\"Update progress\">\n <Progress\n value={progressValue() ?? undefined}\n aria-label={\n state()?.phase === 'installing' ? 'Installing update' : 'Downloading update'\n }\n />\n <p class=\"text-xs text-muted-foreground\" role=\"status\">\n <Show\n when={state()?.phase === 'installing'}\n fallback={\n <Show when={progressValue() !== null} fallback=\"Downloading…\">\n {`${formatBytes(state()?.downloadedBytes ?? 0)} of ${formatBytes(\n state()?.totalBytes ?? 0\n )} · ${progressValue()}%`}\n </Show>\n }\n >\n Applying the update…\n </Show>\n </p>\n <Show when={local.adapter.cancel}>\n <ActionButton\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n tooltip=\"Stop the current update download or installation.\"\n disabled={cancelPending() || state()?.phase === 'cancelling'}\n onClick={() => void cancel()}\n >\n <CircleStop aria-hidden=\"true\" />\n {cancelPending() || state()?.phase === 'cancelling'\n ? 'Cancelling…'\n : 'Cancel update'}\n </ActionButton>\n </Show>\n </section>\n </Show>\n\n <Show when={state()?.phase === 'installed'}>\n <p class=\"text-foreground flex items-center gap-2 text-sm\" role=\"status\">\n <Check class=\"size-4 text-success\" aria-hidden=\"true\" />\n <Show when={state()?.restartRequired} fallback=\"The update is applied.\">\n Restart {appName()} to finish the update.\n </Show>\n </p>\n </Show>\n\n <Show when={error()}>\n <p\n class=\"text-foreground rounded-lg border border-destructive/35 bg-destructive-subtle px-3 py-2 text-sm\"\n role=\"alert\"\n >\n {error()}\n </p>\n </Show>\n\n <Show when={notes()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-release-notes\" class=\"text-sm font-semibold text-foreground\">\n What changed in this release\n </h2>\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.availableVersion}\n </Badge>\n </div>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-52 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-release-notes\"\n tabindex=\"0\"\n >\n {notes()}\n </div>\n </div>\n </Show>\n\n <Show when={changelog()}>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <h2 id=\"update-changelog\" class=\"text-sm font-semibold text-foreground\">\n Installed changelog\n </h2>\n {/* The version pill identifies which build's history this is —\n the same treatment the available-update heading carries. */}\n <Badge variant=\"subtle\" size=\"sm\">\n v{state()?.currentVersion || local.fallbackVersion || '0.1.0'}\n </Badge>\n </div>\n <p class=\"text-xs text-muted-foreground\">\n All versions and updates included with this installation.\n </p>\n {/* A long text block with no focusable descendant: it needs its own tab\n stop, named by the heading above it, or a keyboard user cannot\n scroll it (`scrollable-region-focusable`). */}\n <div\n class=\"max-h-72 overflow-y-auto rounded-xl border border-border bg-background/45 p-4 font-mono text-xs leading-5 whitespace-pre-wrap text-muted-foreground\"\n role=\"region\"\n aria-labelledby=\"update-changelog\"\n tabindex=\"0\"\n >\n {changelog()}\n </div>\n </div>\n </Show>\n </div>\n\n <DialogFooter>\n <Show when={state()?.releaseUrl}>\n {(url) => (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n tooltip=\"Open the release history in your browser.\"\n // `noopener,noreferrer` because the release page is a different\n // origin and must not get a handle on this window.\n onClick={() => void openRelease(url())}\n >\n <ExternalLink aria-hidden=\"true\" />\n View releases\n </ActionButton>\n )}\n </Show>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Close\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqLA,SAASuE,YAAYC,OAAoC;CACvD,IAAI,OAAOA,UAAU,UAAU,OAAOC,KAAAA;CACtC,MAAMC,UAAUF,MAAMG,KAAK;CAC3B,OAAOD,WAAWA,YAAY,oBAAoBA,UAAUD,KAAAA;AAC9D;AAEA,SAASG,aAAaC,QAAiBC,UAA0B;CAC/D,IAAID,kBAAkBE,OAAO,OAAOR,YAAYM,OAAOH,OAAO,KAAKI;CACnE,MAAME,eAAeT,YAAYM,MAAM;CACvC,IAAIG,cAAc,OAAOA;CACzB,IAAI,CAACH,UAAU,OAAOA,WAAW,UAAU,OAAOC;CAElD,MAAMG,SAASJ;CACf,MAAMK,OAAOD,OAAOC;CACpB,MAAMC,cAAcF,OAAOpC;CAC3B,OAAO0B,YAAYW,MAAMR,OAAO,KAAKH,YAAYY,aAAaD,MAAMR,OAAO,KAAKI;AAClF;;;;;;;AAQA,SAASM,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EAAE/C,kBAAkBkD,MAAMzB,mBAAmB,OAAO,CAAA;UAAA;SAAA,CAAA,GAAA,IAAA;SAAA8F,OAAAyD,QAe9D9K,SAAS;SAAA,OAAAyK;QAAA;OAAA,CAAA,GAAA,IAAA;OAAA,OAAA9C;MAAA,EAAA,CAAA;MAAA5B,gBAMjBhH,cAAY,EAAA,IAAAiH,WAAA;OAAA,OAAA,CAAAD,gBACVlI,MAAI;QAAA,IAACoI,OAAI;SAAA,OAAEpD,MAAM,CAAC,EAAEvC;QAAU;QAAA0F,WAC3B/E,QAAG8E,gBACFrH,cAAY;SACX2J,MAAI;SACJlC,SAAO;SACPC,MAAI;SACJkC,SAAO;SAGPE,eAAe,KAAKhD,YAAYvE,IAAI,CAAC;SAAC,IAAA+E,WAAA;UAAA,OAAA,CAAAD,gBAErC5H,cAAY,EAAA,eAAA,OAAA,CAAA,GAAA,eAAA;SAAA;QAAA,CAAA;OAGhB,CAAA,GAAA4H,gBAEFnH,aAAW;QAACsH,IAAIzH;QAAQ0H,SAAO;QAAWC,MAAI;QAAAJ,UAAA;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/page/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/page/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,eAazD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS7D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,eAS1D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,eAS/D;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS7D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,eA4BlG;AAED,gEAAgE;AAChE,wBAAgB,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAShD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { Heading, headingVariants } from "../../ui/typography/typography.js";
|
|
2
3
|
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
3
4
|
import { Show, splitProps } from "solid-js";
|
|
4
5
|
//#region src/components/layout/page/page.tsx
|
|
@@ -9,7 +10,7 @@ var _tmpl$4 = /*#__PURE__*/ template(`<p data-slot=page-header-description>`);
|
|
|
9
10
|
var _tmpl$5 = /*#__PURE__*/ template(`<div data-slot=page-header-actions>`);
|
|
10
11
|
var _tmpl$6 = /*#__PURE__*/ template(`<p class="max-w-prose text-sm text-muted-foreground text-pretty">`);
|
|
11
12
|
var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex shrink-0 items-center gap-2">`);
|
|
12
|
-
var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex items-baseline justify-between gap-3"><div class="flex min-w-0 flex-col gap-0.5"
|
|
13
|
+
var _tmpl$8 = /*#__PURE__*/ template(`<div class="flex items-baseline justify-between gap-3"><div class="flex min-w-0 flex-col gap-0.5">`);
|
|
13
14
|
var _tmpl$9 = /*#__PURE__*/ template(`<section data-slot=page-section>`);
|
|
14
15
|
var _tmpl$0 = /*#__PURE__*/ template(`<div data-slot=page>`);
|
|
15
16
|
/**
|
|
@@ -48,7 +49,7 @@ function PageHeaderTitle(props) {
|
|
|
48
49
|
return (() => {
|
|
49
50
|
var _el$3 = _tmpl$3();
|
|
50
51
|
spread(_el$3, mergeProps({ get ["class"]() {
|
|
51
|
-
return cn(
|
|
52
|
+
return cn(headingVariants({ size: "page" }), local.class);
|
|
52
53
|
} }, rest), false, false);
|
|
53
54
|
return _el$3;
|
|
54
55
|
})();
|
|
@@ -97,16 +98,21 @@ function PageSection(props) {
|
|
|
97
98
|
return local.title;
|
|
98
99
|
},
|
|
99
100
|
get children() {
|
|
100
|
-
var _el$7 = _tmpl$8(), _el$8 = _el$7.firstChild
|
|
101
|
-
insert(_el$
|
|
101
|
+
var _el$7 = _tmpl$8(), _el$8 = _el$7.firstChild;
|
|
102
|
+
insert(_el$8, createComponent(Heading, {
|
|
103
|
+
size: "section",
|
|
104
|
+
get children() {
|
|
105
|
+
return local.title;
|
|
106
|
+
}
|
|
107
|
+
}), null);
|
|
102
108
|
insert(_el$8, createComponent(Show, {
|
|
103
109
|
get when() {
|
|
104
110
|
return local.description;
|
|
105
111
|
},
|
|
106
112
|
get children() {
|
|
107
|
-
var _el$
|
|
108
|
-
insert(_el$
|
|
109
|
-
return _el$
|
|
113
|
+
var _el$9 = _tmpl$6();
|
|
114
|
+
insert(_el$9, () => local.description);
|
|
115
|
+
return _el$9;
|
|
110
116
|
}
|
|
111
117
|
}), null);
|
|
112
118
|
insert(_el$7, createComponent(Show, {
|
|
@@ -114,9 +120,9 @@ function PageSection(props) {
|
|
|
114
120
|
return local.action;
|
|
115
121
|
},
|
|
116
122
|
get children() {
|
|
117
|
-
var _el$
|
|
118
|
-
insert(_el$
|
|
119
|
-
return _el$
|
|
123
|
+
var _el$0 = _tmpl$7();
|
|
124
|
+
insert(_el$0, () => local.action);
|
|
125
|
+
return _el$0;
|
|
120
126
|
}
|
|
121
127
|
}), null);
|
|
122
128
|
return _el$7;
|
|
@@ -130,11 +136,11 @@ function PageSection(props) {
|
|
|
130
136
|
function Page(props) {
|
|
131
137
|
const [local, rest] = splitProps(props, ["class"]);
|
|
132
138
|
return (() => {
|
|
133
|
-
var _el$
|
|
134
|
-
spread(_el$
|
|
139
|
+
var _el$1 = _tmpl$0();
|
|
140
|
+
spread(_el$1, mergeProps({ get ["class"]() {
|
|
135
141
|
return cn("flex min-h-0 flex-1 flex-col overflow-y-auto", local.class);
|
|
136
142
|
} }, rest), false, false);
|
|
137
|
-
return _el$
|
|
143
|
+
return _el$1;
|
|
138
144
|
})();
|
|
139
145
|
}
|
|
140
146
|
//#endregion
|