@rightkit/system-ui 0.0.0-stage → 0.1.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/CHANGELOG.md +5 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +36 -2
- package/dist/activityLease.d.ts +1 -0
- package/dist/activityLease.js +20 -0
- package/dist/api.d.ts +1011 -0
- package/dist/api.js +296 -0
- package/dist/chart.d.ts +14 -0
- package/dist/chart.js +94 -0
- package/dist/components/Chart.d.ts +40 -0
- package/dist/components/Chart.js +109 -0
- package/dist/env.d.ts +60 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +28 -0
- package/dist/kept.d.ts +3 -0
- package/dist/kept.js +21 -0
- package/dist/lib/chatKind.d.ts +4 -0
- package/dist/lib/chatKind.js +15 -0
- package/dist/lib/legal.d.ts +26 -0
- package/dist/lib/legal.js +39 -0
- package/dist/lib/onboardingSettings.d.ts +2 -0
- package/dist/lib/onboardingSettings.js +17 -0
- package/dist/lib/qr.d.ts +9 -0
- package/dist/lib/qr.js +286 -0
- package/dist/lib/rk.d.ts +6 -0
- package/dist/lib/rk.js +30 -0
- package/dist/metrics.d.ts +24 -0
- package/dist/metrics.js +76 -0
- package/dist/onboarding/flow.d.ts +31 -0
- package/dist/onboarding/flow.js +81 -0
- package/dist/onboarding/gate.d.ts +8 -0
- package/dist/onboarding/gate.js +52 -0
- package/dist/styles.css +8 -0
- package/dist/views/Activity.d.ts +3 -0
- package/dist/views/Activity.js +111 -0
- package/dist/views/Apps.d.ts +1 -0
- package/dist/views/Apps.js +478 -0
- package/dist/views/Chat.d.ts +1 -0
- package/dist/views/Chat.js +255 -0
- package/dist/views/ChromeSnapshots.d.ts +6 -0
- package/dist/views/ChromeSnapshots.js +19 -0
- package/dist/views/Cleanup.d.ts +4 -0
- package/dist/views/Cleanup.js +291 -0
- package/dist/views/DriveHealth.d.ts +14 -0
- package/dist/views/DriveHealth.js +81 -0
- package/dist/views/Duplicates.d.ts +2 -0
- package/dist/views/Duplicates.js +99 -0
- package/dist/views/LauncherSettings.d.ts +63 -0
- package/dist/views/LauncherSettings.js +242 -0
- package/dist/views/NearbySettings.d.ts +117 -0
- package/dist/views/NearbySettings.js +237 -0
- package/dist/views/Storage.d.ts +9 -0
- package/dist/views/Storage.js +916 -0
- package/dist/views/activity.css +94 -0
- package/dist/views/apps.css +98 -0
- package/dist/views/chat.css +61 -0
- package/dist/views/cleanup.css +49 -0
- package/dist/views/health.css +17 -0
- package/dist/views/membrane.css +23 -0
- package/dist/views/monitor.css +99 -0
- package/dist/views/settings.css +176 -0
- package/dist/views/settingsKit.d.ts +14 -0
- package/dist/views/settingsKit.js +43 -0
- package/dist/views/storage.css +121 -0
- package/dist/views/storageEstimate.d.ts +6 -0
- package/dist/views/storageEstimate.js +7 -0
- package/dist/visible.d.ts +3 -0
- package/dist/visible.js +42 -0
- package/package.json +110 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* the host app's own pieces of the Settings look. Groups, rows, items, sections, the search provider and
|
|
3
|
+
* the search state (`useSettingsSearch`) are @rightkit/settings-ui; this file keeps only what
|
|
4
|
+
* settings-ui does not draw.
|
|
5
|
+
*/
|
|
6
|
+
/** Under a Permissions row: what switched-on features need it. Nothing when the notch does not say. */
|
|
7
|
+
export declare function NeedsLine({ needs }: {
|
|
8
|
+
needs?: string[];
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
10
|
+
/** The browser's key event as a shortcut ("ctrl+opt+left"), or null when it
|
|
11
|
+
* names no key or has no modifier. Matches the names in WindowShortcut.swift. */
|
|
12
|
+
export declare function windowShortcutFrom(e: KeyboardEvent): string | null;
|
|
13
|
+
/** The "Open <section>" button's text while searching. */
|
|
14
|
+
export declare const openSectionLabel: (title: string) => string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* the host app's own pieces of the Settings look. Groups, rows, items, sections, the search provider and
|
|
4
|
+
* the search state (`useSettingsSearch`) are @rightkit/settings-ui; this file keeps only what
|
|
5
|
+
* settings-ui does not draw.
|
|
6
|
+
*/
|
|
7
|
+
/** Under a Permissions row: what switched-on features need it. Nothing when the notch does not say. */
|
|
8
|
+
export function NeedsLine({ needs }) {
|
|
9
|
+
if (!needs)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsx("div", { className: "ck-sub ck-foot ck-needs", children: needs.length > 0 ? `Needed for: ${needs.join(" · ")}` : "Not needed by anything you have on" }));
|
|
12
|
+
}
|
|
13
|
+
/** The browser's key event as a shortcut ("ctrl+opt+left"), or null when it
|
|
14
|
+
* names no key or has no modifier. Matches the names in WindowShortcut.swift. */
|
|
15
|
+
export function windowShortcutFrom(e) {
|
|
16
|
+
const names = {
|
|
17
|
+
ArrowLeft: "left", ArrowRight: "right", ArrowUp: "up", ArrowDown: "down",
|
|
18
|
+
Enter: "return", NumpadEnter: "return", Space: "space", Backspace: "delete", Tab: "tab",
|
|
19
|
+
Minus: "-", Equal: "=", BracketLeft: "[", BracketRight: "]", Comma: ",", Period: ".",
|
|
20
|
+
Slash: "/", Semicolon: ";", Quote: "'", Backslash: "\\", Backquote: "`",
|
|
21
|
+
};
|
|
22
|
+
let key = names[e.code] ?? "";
|
|
23
|
+
if (!key) {
|
|
24
|
+
const match = /^(?:Key|Digit)([A-Z0-9])$/.exec(e.code);
|
|
25
|
+
key = match ? match[1].toLowerCase() : "";
|
|
26
|
+
}
|
|
27
|
+
if (!key)
|
|
28
|
+
return null;
|
|
29
|
+
const mods = [];
|
|
30
|
+
if (e.ctrlKey)
|
|
31
|
+
mods.push("ctrl");
|
|
32
|
+
if (e.altKey)
|
|
33
|
+
mods.push("opt");
|
|
34
|
+
if (e.shiftKey)
|
|
35
|
+
mods.push("shift");
|
|
36
|
+
if (e.metaKey)
|
|
37
|
+
mods.push("cmd");
|
|
38
|
+
if (mods.length === 0)
|
|
39
|
+
return null;
|
|
40
|
+
return [...mods, key].join("+");
|
|
41
|
+
}
|
|
42
|
+
/** The "Open <section>" button's text while searching. */
|
|
43
|
+
export const openSectionLabel = (title) => `Open ${title}`;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* Storage: one volume line, one workspace. Tokens come from styles.css and the app shell. */
|
|
2
|
+
.view.st { gap: 10px; overflow: hidden; flex-wrap: nowrap; }
|
|
3
|
+
.st > * { flex: none; min-width: 0; }
|
|
4
|
+
.st :focus-visible { outline: 2px solid var(--rk-focus, var(--rk-accent)); outline-offset: 2px; }
|
|
5
|
+
.st .num { min-width: 0; text-align: left; }
|
|
6
|
+
|
|
7
|
+
.st-volume { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border: 1px solid var(--rk-hairline); border-radius: 12px; background: var(--rk-fill-2); }
|
|
8
|
+
.st-volume-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
|
|
9
|
+
.st-volume-icon { flex: none; color: var(--rk-accent); }
|
|
10
|
+
.st-select { flex: 1 1 160px; min-width: 0; max-width: 340px; }
|
|
11
|
+
.st-free { display: inline-flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; font-variant-numeric: tabular-nums; }
|
|
12
|
+
.st-net-label { flex: none; padding: 0 6px; border-radius: 999px; background: var(--rk-fill-2); color: var(--rk-ink-2); font-size: 11px; line-height: 18px; }
|
|
13
|
+
.st-volume-line > button { margin-left: auto; flex: none; }
|
|
14
|
+
.st-volume .bar { flex: none; width: 100%; background: var(--rk-plane); }
|
|
15
|
+
.st-volume-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 18px; }
|
|
16
|
+
|
|
17
|
+
.st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; font-size: 12px; }
|
|
18
|
+
.st-meta-text { color: var(--rk-ink-2); }
|
|
19
|
+
.st-chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px 0 10px; min-height: 28px; border: 1px solid var(--rk-hairline); border-radius: 8px; background: var(--rk-fill-2); font-size: 12px; color: var(--rk-ink-2); }
|
|
20
|
+
.st-chip-name { overflow-wrap: anywhere; color: var(--rk-ink); }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
.st-scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; scroll-padding: 10px; border-radius: 8px; }
|
|
27
|
+
.st-scroll > * { flex: none; }
|
|
28
|
+
|
|
29
|
+
.st-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--rk-hairline); border-radius: 12px; background: var(--rk-fill-2); }
|
|
30
|
+
.st-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding-bottom: 4px; }
|
|
31
|
+
.st-card-head > div { min-width: 0; }
|
|
32
|
+
.st-h { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; line-height: 1.35; font-weight: 650; color: var(--rk-ink); overflow-wrap: anywhere; }
|
|
33
|
+
.st-h svg { flex: none; color: var(--rk-accent); }
|
|
34
|
+
.st-sub { margin: 0; font-size: 12px; color: var(--rk-ink-2); overflow-wrap: anywhere; }
|
|
35
|
+
.st-card .finding { grid-template-columns: 16px minmax(0, 1fr) auto auto; padding: 6px 0; }
|
|
36
|
+
|
|
37
|
+
.st-finding { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--rk-hairline); }
|
|
38
|
+
.st-disclose { display: flex; align-items: flex-start; gap: 6px; min-width: 0; min-height: 36px; padding: 2px 4px 2px 0; border-radius: 6px; color: var(--rk-ink); font: inherit; text-align: left; }
|
|
39
|
+
.st-disclose > svg { flex: none; margin-top: 3px; color: var(--rk-ink-2); }
|
|
40
|
+
.st-finding-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
41
|
+
.st-finding-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; overflow-wrap: anywhere; }
|
|
42
|
+
.st-reason { font-size: 12px; color: var(--rk-ink-2); overflow-wrap: anywhere; }
|
|
43
|
+
.st-measure { display: flex; align-items: center; gap: 10px; }
|
|
44
|
+
.st-measure .st-size { min-width: 64px; text-align: right; }
|
|
45
|
+
.st-size { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--rk-ink); white-space: nowrap; }
|
|
46
|
+
.st-sub-items { grid-column: 1 / -1; display: flex; flex-direction: column; padding-left: 20px; }
|
|
47
|
+
.st-sub-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px dashed var(--rk-hairline); }
|
|
48
|
+
.st-sub-item:first-child { border-top: 0; }
|
|
49
|
+
.st-sub-item .st-size { font-weight: 400; color: var(--rk-ink-2); }
|
|
50
|
+
.st-path { font-size: 12px; color: var(--rk-ink-2); overflow-wrap: anywhere; word-break: break-word; }
|
|
51
|
+
.st-more-btn { align-self: flex-start; }
|
|
52
|
+
|
|
53
|
+
.st-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--rk-hairline); }
|
|
54
|
+
.st-notes-head { font-size: 12px; font-weight: 600; color: var(--rk-ink-2); }
|
|
55
|
+
.st-note { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 12px; color: var(--rk-ink-2); }
|
|
56
|
+
.st-note > svg { margin-top: 2px; }
|
|
57
|
+
.st-note-text { overflow-wrap: anywhere; }
|
|
58
|
+
.st-note-size { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
59
|
+
|
|
60
|
+
.st-crumbs { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; font-size: 12px; }
|
|
61
|
+
.st-crumbs > span { display: inline-flex; align-items: center; }
|
|
62
|
+
.st-crumb-sep { flex: none; color: var(--rk-ink-3); }
|
|
63
|
+
.st-search { width: 100%; box-sizing: border-box; height: 30px; flex: none; }
|
|
64
|
+
.st-coverage { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--rk-ink-3); }
|
|
65
|
+
|
|
66
|
+
.st-treemap { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--rk-plane); }
|
|
67
|
+
.st-treemap text { paint-order: stroke; stroke: rgba(0, 0, 0, 0.6); stroke-width: 2.5px; stroke-linejoin: round; }
|
|
68
|
+
|
|
69
|
+
.st-list { display: flex; flex-direction: column; }
|
|
70
|
+
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px 64px 28px; align-items: center; gap: 10px; min-height: 36px; padding: 4px 4px; border-top: 1px solid var(--rk-hairline); }
|
|
71
|
+
.st-row.clickable { cursor: pointer; }
|
|
72
|
+
.st-row.clickable:hover { background: var(--rk-plane); }
|
|
73
|
+
.st-row:focus-visible { outline-offset: -2px; }
|
|
74
|
+
.st-name { display: flex; align-items: flex-start; gap: 6px; min-width: 0; overflow-wrap: anywhere; color: var(--rk-ink); }
|
|
75
|
+
.st-name > svg { flex: none; margin-top: 2px; color: var(--rk-ink-3); }
|
|
76
|
+
.st-dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; }
|
|
77
|
+
.st-pct { text-align: right; font-size: 12px; color: var(--rk-ink-2); font-variant-numeric: tabular-nums; }
|
|
78
|
+
.st-row .bar { flex: none; min-width: 0; background: var(--rk-plane); }
|
|
79
|
+
|
|
80
|
+
.st-changes { display: flex; flex-direction: column; }
|
|
81
|
+
.st-change { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 36px; padding: 4px; border-top: 1px solid var(--rk-hairline); color: var(--rk-ink); font: inherit; text-align: left; }
|
|
82
|
+
.st-change:hover:not(:disabled) { background: var(--rk-plane); }
|
|
83
|
+
.st-change span:first-child { overflow-wrap: anywhere; }
|
|
84
|
+
.st-delta { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
|
|
85
|
+
.st-delta.up { color: var(--rk-warn); }
|
|
86
|
+
.st-delta.down { color: var(--rk-ok); }
|
|
87
|
+
|
|
88
|
+
@media (max-width: 860px) {
|
|
89
|
+
.view.st { gap: 8px; padding: 10px 12px; }
|
|
90
|
+
.st-card { padding: 8px 10px; }
|
|
91
|
+
.st-row { grid-template-columns: minmax(0, 1fr) 64px 34px 60px 28px; gap: 8px; }
|
|
92
|
+
.st-split { flex-direction: column; }
|
|
93
|
+
.st-inspector { position: static; flex: none; width: 100%; box-sizing: border-box; }
|
|
94
|
+
}
|
|
95
|
+
@media (forced-colors: active) {
|
|
96
|
+
.st-card, .st-volume, .st-chip, .st-inspector { border-color: CanvasText; }
|
|
97
|
+
.st-row[aria-current="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
|
|
98
|
+
.st :focus-visible { outline-color: Highlight; }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Filters above the list: Kind, Size, the clear action and the count. */
|
|
102
|
+
.st-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
|
|
103
|
+
.st-filters .st-select { flex: 0 0 auto; width: auto; min-width: 128px; max-width: 100%; }
|
|
104
|
+
.st-count { margin-left: auto; font-size: 12px; color: var(--rk-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
105
|
+
|
|
106
|
+
/* The list beside the inspector; below it on narrow widths. */
|
|
107
|
+
.st-split { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
|
|
108
|
+
.st-split-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-width: 0; }
|
|
109
|
+
.st-row.selected { background: var(--rk-plane); box-shadow: inset 2px 0 0 var(--rk-accent); }
|
|
110
|
+
.st-inspector { position: sticky; top: 0; display: flex; flex: 0 0 280px; flex-direction: column; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--rk-hairline); border-radius: 12px; background: var(--rk-plane); }
|
|
111
|
+
.st-inspector-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; }
|
|
112
|
+
.st-inspector-title { display: flex; align-items: flex-start; gap: 7px; min-width: 0; font-size: 14px; font-weight: 650; color: var(--rk-ink); overflow-wrap: anywhere; }
|
|
113
|
+
.st-inspector-title svg { flex: none; margin-top: 2px; color: var(--rk-accent); }
|
|
114
|
+
.st-inspector-path-line { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
|
|
115
|
+
.st-inspector-path { display: block; max-width: 100%; font-size: 12px; color: var(--rk-ink-2); overflow-wrap: anywhere; word-break: break-word; user-select: text; -webkit-user-select: text; cursor: text; }
|
|
116
|
+
.st-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 12px; }
|
|
117
|
+
.st-facts dt { color: var(--rk-ink-2); }
|
|
118
|
+
.st-facts dd { margin: 0; min-width: 0; color: var(--rk-ink); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
|
|
119
|
+
.st-inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
120
|
+
.st-preview-image { display: block; max-width: 100%; max-height: 200px; width: auto; height: auto; object-fit: contain; border: 1px solid var(--rk-hairline); border-radius: 8px; }
|
|
121
|
+
.st-help { margin: 0; font-size: 11px; line-height: 1.4; color: var(--rk-ink-2); overflow-wrap: anywhere; }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Wording for a size the scan could not prove would be freed. Same text as Cleanup's estimate note. */
|
|
2
|
+
export declare const ESTIMATE = "An estimate from allocated size on disk, not file size. Hard links and clones can make the real gain smaller.";
|
|
3
|
+
/** Any removal figure is allocated size, so it is an upper bound; a partial scan reads as a floor. */
|
|
4
|
+
export declare const upTo: (n: number, partial?: boolean) => string;
|
|
5
|
+
/** Items in the Trash keep their space until the Trash is emptied. */
|
|
6
|
+
export declare const trashFreesNothing: (trash: string) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { bytes } from "../api.js";
|
|
2
|
+
/** Wording for a size the scan could not prove would be freed. Same text as Cleanup's estimate note. */
|
|
3
|
+
export const ESTIMATE = "An estimate from allocated size on disk, not file size. Hard links and clones can make the real gain smaller.";
|
|
4
|
+
/** Any removal figure is allocated size, so it is an upper bound; a partial scan reads as a floor. */
|
|
5
|
+
export const upTo = (n, partial = false) => `${partial ? "≥ " : "up to "}${bytes(n)}`;
|
|
6
|
+
/** Items in the Trash keep their space until the Trash is emptied. */
|
|
7
|
+
export const trashFreesNothing = (trash) => `Items moved to the ${trash} free no space until the ${trash} is emptied.`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** `setInterval` that skips its ticks while the hub's window is hidden and runs once when it is shown again. */
|
|
2
|
+
export declare function visibleInterval(tick: () => void, ms: number): number;
|
|
3
|
+
export declare function clearVisibleInterval(id: number | null | undefined): void;
|
package/dist/visible.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { listen } from "@tauri-apps/api/event";
|
|
2
|
+
// The hub keeps running with its window closed (it serves the notch), and this page keeps
|
|
3
|
+
// running with it. Refreshing a page nobody can see kept the web view and the hub at about
|
|
4
|
+
// one percent of a core between them. The hub says when its window is hidden or shown
|
|
5
|
+
// (`hub-visibility`); until it says anything the page counts as shown, and any input in the
|
|
6
|
+
// page counts as shown too, so a missed event cannot leave a visible page frozen.
|
|
7
|
+
let shown = true;
|
|
8
|
+
const wakers = new Map();
|
|
9
|
+
function setShown(next) {
|
|
10
|
+
if (shown === next)
|
|
11
|
+
return;
|
|
12
|
+
shown = next;
|
|
13
|
+
if (next)
|
|
14
|
+
for (const wake of [...wakers.values()])
|
|
15
|
+
wake();
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
void listen("hub-visibility", (event) => setShown(event.payload === true)).catch(() => { });
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// Outside the hub (a test page) there is nobody to say; the page stays shown.
|
|
22
|
+
}
|
|
23
|
+
if (typeof window !== "undefined") {
|
|
24
|
+
for (const name of ["focus", "pointerdown", "pointermove", "keydown"]) {
|
|
25
|
+
window.addEventListener(name, () => setShown(true), { passive: true, capture: true });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** `setInterval` that skips its ticks while the hub's window is hidden and runs once when it is shown again. */
|
|
29
|
+
export function visibleInterval(tick, ms) {
|
|
30
|
+
const id = setInterval(() => {
|
|
31
|
+
if (shown)
|
|
32
|
+
tick();
|
|
33
|
+
}, ms);
|
|
34
|
+
wakers.set(id, tick);
|
|
35
|
+
return id;
|
|
36
|
+
}
|
|
37
|
+
export function clearVisibleInterval(id) {
|
|
38
|
+
if (id == null)
|
|
39
|
+
return;
|
|
40
|
+
clearInterval(id);
|
|
41
|
+
wakers.delete(id);
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,113 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rightkit/system-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "System monitor views (activity, storage, cleanup, duplicates, drive health, apps, chat) and chart helpers for desktop utility apps.",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./styles.css": "./dist/styles.css",
|
|
15
|
+
"./activityLease": {
|
|
16
|
+
"types": "./dist/activityLease.d.ts",
|
|
17
|
+
"import": "./dist/activityLease.js"
|
|
18
|
+
},
|
|
19
|
+
"./api": {
|
|
20
|
+
"types": "./dist/api.d.ts",
|
|
21
|
+
"import": "./dist/api.js"
|
|
22
|
+
},
|
|
23
|
+
"./components/Chart": {
|
|
24
|
+
"types": "./dist/components/Chart.d.ts",
|
|
25
|
+
"import": "./dist/components/Chart.js"
|
|
26
|
+
},
|
|
27
|
+
"./lib/qr": {
|
|
28
|
+
"types": "./dist/lib/qr.d.ts",
|
|
29
|
+
"import": "./dist/lib/qr.js"
|
|
30
|
+
},
|
|
31
|
+
"./metrics": {
|
|
32
|
+
"types": "./dist/metrics.d.ts",
|
|
33
|
+
"import": "./dist/metrics.js"
|
|
34
|
+
},
|
|
35
|
+
"./onboarding/gate": {
|
|
36
|
+
"types": "./dist/onboarding/gate.d.ts",
|
|
37
|
+
"import": "./dist/onboarding/gate.js"
|
|
38
|
+
},
|
|
39
|
+
"./views/LauncherSettings": {
|
|
40
|
+
"types": "./dist/views/LauncherSettings.d.ts",
|
|
41
|
+
"import": "./dist/views/LauncherSettings.js"
|
|
42
|
+
},
|
|
43
|
+
"./views/NearbySettings": {
|
|
44
|
+
"types": "./dist/views/NearbySettings.d.ts",
|
|
45
|
+
"import": "./dist/views/NearbySettings.js"
|
|
46
|
+
},
|
|
47
|
+
"./views/Storage": {
|
|
48
|
+
"types": "./dist/views/Storage.d.ts",
|
|
49
|
+
"import": "./dist/views/Storage.js"
|
|
50
|
+
},
|
|
51
|
+
"./views/membrane.css": "./dist/views/membrane.css",
|
|
52
|
+
"./views/monitor.css": "./dist/views/monitor.css",
|
|
53
|
+
"./views/settings.css": "./dist/views/settings.css",
|
|
54
|
+
"./views/settingsKit": {
|
|
55
|
+
"types": "./dist/views/settingsKit.d.ts",
|
|
56
|
+
"import": "./dist/views/settingsKit.js"
|
|
57
|
+
},
|
|
58
|
+
"./visible": {
|
|
59
|
+
"types": "./dist/visible.d.ts",
|
|
60
|
+
"import": "./dist/visible.js"
|
|
61
|
+
},
|
|
62
|
+
"./package.json": "./package.json"
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist",
|
|
66
|
+
"README.md",
|
|
67
|
+
"CHANGELOG.md",
|
|
68
|
+
"LICENSE-MIT",
|
|
69
|
+
"LICENSE-APACHE"
|
|
70
|
+
],
|
|
71
|
+
"sideEffects": [
|
|
72
|
+
"*.css"
|
|
73
|
+
],
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@rightkit/legal-ui": "^0.4.1",
|
|
76
|
+
"@rightkit/logs": "^0.1.6",
|
|
77
|
+
"@rightkit/onboarding": "^0.6.3",
|
|
78
|
+
"@rightkit/platform-ui": "^0.4.0",
|
|
79
|
+
"@rightkit/react-shell": "^0.7.2",
|
|
80
|
+
"@rightkit/settings-ui": "^0.7.0",
|
|
81
|
+
"@rightkit/tauri": "^0.3.0",
|
|
82
|
+
"@rightkit/tauri-shell": "^0.1.3",
|
|
83
|
+
"@tauri-apps/api": "2.12.4",
|
|
84
|
+
"lucide-react": "^1.57.0"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"react": ">=18 <21"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"@types/node": "^26.6.6",
|
|
91
|
+
"@types/react": "^19.3.0",
|
|
92
|
+
"@types/react-dom": "^19.3.0",
|
|
93
|
+
"react": "^19.3.1",
|
|
94
|
+
"react-dom": "^19.3.1",
|
|
95
|
+
"typescript": "^7.0.2",
|
|
96
|
+
"vite": "^8.3.4",
|
|
97
|
+
"vitest": "^5.0.5"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"registry": "https://registry.npmjs.org",
|
|
101
|
+
"access": "public"
|
|
102
|
+
},
|
|
103
|
+
"repository": {
|
|
104
|
+
"type": "git",
|
|
105
|
+
"url": "git+https://github.com/bogusyogi/rightkit.git",
|
|
106
|
+
"directory": "packages/system-ui"
|
|
107
|
+
},
|
|
108
|
+
"scripts": {
|
|
109
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
110
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
111
|
+
"test": "pnpm --filter \"@rightkit/system-ui^...\" run build && vitest run"
|
|
112
|
+
}
|
|
6
113
|
}
|