anentrypoint-design 0.0.121 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +253 -253
- package/app-shell.css +931 -594
- package/colors_and_type.css +226 -226
- package/community.css +817 -1222
- package/dist/247420.css +2202 -2084
- package/dist/247420.js +13 -13
- package/package.json +80 -80
- package/src/bootstrap.js +25 -25
- package/src/components/chat.js +199 -199
- package/src/components/community.js +190 -208
- package/src/components/content.js +269 -269
- package/src/components/editor-primitives.js +100 -0
- package/src/components/files-modals.js +107 -107
- package/src/components/files.js +118 -118
- package/src/components/freddie/helpers.js +50 -50
- package/src/components/freddie.js +33 -33
- package/src/components/shell.js +117 -117
- package/src/components/theme-toggle.js +70 -70
- package/src/components.js +59 -57
- package/src/debug.js +30 -30
- package/src/deck-stage.js +21 -21
- package/src/highlight.js +65 -32
- package/src/index.js +86 -86
- package/src/kits/os/about-app.js +52 -52
- package/src/kits/os/app-panes.css +152 -152
- package/src/kits/os/browser-app.js +58 -58
- package/src/kits/os/files-app.js +44 -44
- package/src/kits/os/freddie/helpers.js +59 -59
- package/src/kits/os/freddie/pages-chat.js +143 -143
- package/src/kits/os/freddie/pages-core.js +101 -101
- package/src/kits/os/freddie/pages-os.js +51 -51
- package/src/kits/os/freddie/pages-tools.js +183 -183
- package/src/kits/os/freddie/routes.js +24 -24
- package/src/kits/os/freddie-dashboard.css +51 -51
- package/src/kits/os/freddie-dashboard.js +101 -101
- package/src/kits/os/icons.js +17 -17
- package/src/kits/os/index.js +17 -17
- package/src/kits/os/launcher.css +61 -61
- package/src/kits/os/launcher.js +79 -79
- package/src/kits/os/monitor-app.js +34 -34
- package/src/kits/os/shell.js +214 -214
- package/src/kits/os/terminal-app.js +45 -45
- package/src/kits/os/theme.css +450 -450
- package/src/kits/os/validate.css +19 -19
- package/src/kits/os/validator-app.js +55 -55
- package/src/kits/os/wm.css +115 -115
- package/src/kits/os/wm.js +111 -111
- package/src/markdown.js +39 -39
- package/src/motion.js +35 -35
- package/src/page-html.js +196 -196
- package/src/styles.js +25 -25
- package/src/theme.js +99 -99
- package/src/web-components/ds-chat.js +116 -116
- package/dist/.nojekyll +0 -0
- package/dist/app-shell.css +0 -594
- package/dist/colors_and_type.css +0 -197
- package/dist/favicon.svg +0 -1
- package/dist/index.html +0 -308
- package/dist/preview/buttons.html +0 -28
- package/dist/preview/colors-core.html +0 -45
- package/dist/preview/colors-lore.html +0 -28
- package/dist/preview/colors-semantic.html +0 -34
- package/dist/preview/dateline.html +0 -19
- package/dist/preview/dropzone.html +0 -30
- package/dist/preview/file-grid.html +0 -19
- package/dist/preview/file-row.html +0 -20
- package/dist/preview/file-toolbar.html +0 -40
- package/dist/preview/file-viewer.html +0 -31
- package/dist/preview/header.html +0 -24
- package/dist/preview/icons-unicode.html +0 -26
- package/dist/preview/index-row.html +0 -25
- package/dist/preview/inputs.html +0 -22
- package/dist/preview/manifesto.html +0 -52
- package/dist/preview/motion-default.js +0 -106
- package/dist/preview/rules.html +0 -16
- package/dist/preview/spacing.html +0 -18
- package/dist/preview/stamps-lore.html +0 -20
- package/dist/preview/stamps.html +0 -14
- package/dist/preview/theme-ink.html +0 -15
- package/dist/preview/type-display.html +0 -16
- package/dist/preview/type-mono.html +0 -15
- package/dist/preview/type-prose.html +0 -11
- package/dist/preview/type-scale.html +0 -20
- package/dist/preview/wordmarks.html +0 -28
- package/dist/robots.txt +0 -8
- package/dist/site/content/globals/navigation.yaml +0 -5
- package/dist/site/content/globals/site.yaml +0 -16
- package/dist/site/content/pages/freddie.yaml +0 -88
- package/dist/site/content/pages/home.yaml +0 -190
- package/dist/site/theme.mjs +0 -368
- package/dist/sitemap.xml +0 -31
- package/dist/slides/deck-stage-overlay.js +0 -63
- package/dist/slides/deck-stage-state.js +0 -81
- package/dist/slides/deck-stage-style.js +0 -117
- package/dist/slides/deck-stage.js +0 -159
- package/dist/slides/index.html +0 -276
- package/dist/src/bootstrap.js +0 -25
- package/dist/src/components/chat.js +0 -199
- package/dist/src/components/community.js +0 -167
- package/dist/src/components/content.js +0 -213
- package/dist/src/components/files-modals.js +0 -107
- package/dist/src/components/files.js +0 -118
- package/dist/src/components/freddie/helpers.js +0 -50
- package/dist/src/components/freddie.js +0 -33
- package/dist/src/components/shell.js +0 -117
- package/dist/src/components/theme-toggle.js +0 -70
- package/dist/src/components.js +0 -52
- package/dist/src/debug.js +0 -30
- package/dist/src/deck-stage.js +0 -21
- package/dist/src/highlight.js +0 -32
- package/dist/src/index.js +0 -86
- package/dist/src/kits/os/about-app.js +0 -52
- package/dist/src/kits/os/app-panes.css +0 -152
- package/dist/src/kits/os/browser-app.js +0 -58
- package/dist/src/kits/os/files-app.js +0 -44
- package/dist/src/kits/os/freddie/helpers.js +0 -59
- package/dist/src/kits/os/freddie/pages-chat.js +0 -143
- package/dist/src/kits/os/freddie/pages-core.js +0 -101
- package/dist/src/kits/os/freddie/pages-os.js +0 -51
- package/dist/src/kits/os/freddie/pages-tools.js +0 -183
- package/dist/src/kits/os/freddie/routes.js +0 -24
- package/dist/src/kits/os/freddie-dashboard.css +0 -51
- package/dist/src/kits/os/freddie-dashboard.js +0 -101
- package/dist/src/kits/os/icons.js +0 -17
- package/dist/src/kits/os/index.js +0 -5
- package/dist/src/kits/os/launcher.css +0 -61
- package/dist/src/kits/os/launcher.js +0 -79
- package/dist/src/kits/os/monitor-app.js +0 -34
- package/dist/src/kits/os/shell.js +0 -214
- package/dist/src/kits/os/terminal-app.js +0 -45
- package/dist/src/kits/os/theme.css +0 -412
- package/dist/src/kits/os/validate.css +0 -19
- package/dist/src/kits/os/validator-app.js +0 -55
- package/dist/src/kits/os/wm.css +0 -115
- package/dist/src/kits/os/wm.js +0 -111
- package/dist/src/markdown.js +0 -39
- package/dist/src/motion.js +0 -35
- package/dist/src/page-html.js +0 -196
- package/dist/src/styles.js +0 -25
- package/dist/src/theme.js +0 -99
- package/dist/src/web-components/ds-chat.js +0 -45
- package/dist/ui_kits/aicat/README.md +0 -7
- package/dist/ui_kits/aicat/app.js +0 -156
- package/dist/ui_kits/aicat/index.html +0 -26
- package/dist/ui_kits/aicat/sample-square.png +0 -0
- package/dist/ui_kits/aicat/sample-svg.svg +0 -1
- package/dist/ui_kits/aicat/sample.pdf +0 -32
- package/dist/ui_kits/blog/README.md +0 -3
- package/dist/ui_kits/blog/index.html +0 -90
- package/dist/ui_kits/chat/README.md +0 -5
- package/dist/ui_kits/chat/app.js +0 -110
- package/dist/ui_kits/chat/index.html +0 -26
- package/dist/ui_kits/chat/sample-square.png +0 -0
- package/dist/ui_kits/chat/sample-svg.svg +0 -1
- package/dist/ui_kits/chat/sample.pdf +0 -32
- package/dist/ui_kits/community/app.js +0 -134
- package/dist/ui_kits/community/index.html +0 -24
- package/dist/ui_kits/dashboard/app.js +0 -92
- package/dist/ui_kits/dashboard/index.html +0 -26
- package/dist/ui_kits/docs/README.md +0 -3
- package/dist/ui_kits/docs/index.html +0 -123
- package/dist/ui_kits/error_404/app.js +0 -56
- package/dist/ui_kits/error_404/index.html +0 -26
- package/dist/ui_kits/file_browser/README.md +0 -48
- package/dist/ui_kits/file_browser/app.js +0 -231
- package/dist/ui_kits/file_browser/index.html +0 -33
- package/dist/ui_kits/gallery/app.js +0 -121
- package/dist/ui_kits/gallery/index.html +0 -26
- package/dist/ui_kits/homepage/README.md +0 -7
- package/dist/ui_kits/homepage/app.js +0 -167
- package/dist/ui_kits/homepage/index.html +0 -46
- package/dist/ui_kits/project_page/README.md +0 -3
- package/dist/ui_kits/project_page/app.js +0 -154
- package/dist/ui_kits/project_page/index.html +0 -45
- package/dist/ui_kits/search/app.js +0 -107
- package/dist/ui_kits/search/index.html +0 -26
- package/dist/ui_kits/settings/app.js +0 -133
- package/dist/ui_kits/settings/index.html +0 -26
- package/dist/ui_kits/signin/app.js +0 -115
- package/dist/ui_kits/signin/index.html +0 -26
- package/dist/ui_kits/slide_deck/app.js +0 -174
- package/dist/ui_kits/slide_deck/index.html +0 -26
- package/dist/ui_kits/system_primer/app.js +0 -152
- package/dist/ui_kits/system_primer/index.html +0 -26
- package/dist/ui_kits/terminal/app.js +0 -150
- package/dist/ui_kits/terminal/index.html +0 -26
- package/dist/vendor/webjsx/applyDiff.js +0 -182
- package/dist/vendor/webjsx/attributes.js +0 -154
- package/dist/vendor/webjsx/constants.js +0 -4
- package/dist/vendor/webjsx/createDOMElement.js +0 -52
- package/dist/vendor/webjsx/createElement.js +0 -75
- package/dist/vendor/webjsx/elementTags.js +0 -115
- package/dist/vendor/webjsx/factory.js +0 -6
- package/dist/vendor/webjsx/index.js +0 -6
- package/dist/vendor/webjsx/jsx-dev-runtime.js +0 -2
- package/dist/vendor/webjsx/jsx-runtime.js +0 -30
- package/dist/vendor/webjsx/jsx.js +0 -2
- package/dist/vendor/webjsx/package.json +0 -39
- package/dist/vendor/webjsx/renderSuspension.js +0 -25
- package/dist/vendor/webjsx/types.js +0 -5
- package/dist/vendor/webjsx/utils.js +0 -84
- package/src/components/overlays.js +0 -151
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import * as webjsx from '../../../vendor/webjsx/index.js';
|
|
2
|
-
import * as components from '../../components.js';
|
|
3
|
-
import { ROUTES, OS_ROUTE_DEFS } from './freddie/routes.js';
|
|
4
|
-
import { makeCorePages } from './freddie/pages-core.js';
|
|
5
|
-
import { makeChatPage } from './freddie/pages-chat.js';
|
|
6
|
-
import { makeToolsPages } from './freddie/pages-tools.js';
|
|
7
|
-
import { makeOsPages } from './freddie/pages-os.js';
|
|
8
|
-
|
|
9
|
-
const { AppShell, Topbar, Side, Crumb, Status, Panel, Chip, EmptyState } = components;
|
|
10
|
-
|
|
11
|
-
function pre(obj) {
|
|
12
|
-
return webjsx.createElement('pre', { class: 'fd-pre' }, typeof obj === 'string' ? obj : JSON.stringify(obj, null, 2));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function createFreddieDashboard({ instance, bootHost, osSurfaces }) {
|
|
16
|
-
const root = document.createElement('div');
|
|
17
|
-
root.className = 'app-fd ds-247420 fd-root';
|
|
18
|
-
|
|
19
|
-
const state = { active: 'home', ts: new Date().toLocaleTimeString(), body: null, error: null };
|
|
20
|
-
let host = instance.host || null;
|
|
21
|
-
const allRoutes = osSurfaces ? [...ROUTES, ...OS_ROUTE_DEFS] : ROUTES;
|
|
22
|
-
|
|
23
|
-
async function ensureHost() {
|
|
24
|
-
if (host) return host;
|
|
25
|
-
if (typeof bootHost !== 'function') throw new Error('createFreddieDashboard: instance.host or bootHost required');
|
|
26
|
-
host = instance.host = await bootHost({ fs: instance.fs });
|
|
27
|
-
return host;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function setActive(p) { state.active = p; rerender(); }
|
|
31
|
-
if (typeof window !== 'undefined') window.__fd_nav = setActive;
|
|
32
|
-
|
|
33
|
-
function rerender() { webjsx.applyDiff(root, view()); loadActive(); }
|
|
34
|
-
|
|
35
|
-
const ctx = { instance, osSurfaces, root, state, rerender, get host() { return host; } };
|
|
36
|
-
const PAGES = {
|
|
37
|
-
...makeCorePages(ctx),
|
|
38
|
-
chat: makeChatPage(ctx),
|
|
39
|
-
...makeToolsPages(ctx),
|
|
40
|
-
...(osSurfaces ? makeOsPages(ctx) : {}),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
function buildSide() {
|
|
44
|
-
const sections = [{
|
|
45
|
-
group: 'FREDDIE',
|
|
46
|
-
items: ROUTES.map(r => ({
|
|
47
|
-
glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
|
|
48
|
-
active: state.active === r.path,
|
|
49
|
-
onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
|
|
50
|
-
})),
|
|
51
|
-
}];
|
|
52
|
-
if (osSurfaces) sections.push({
|
|
53
|
-
group: 'OS',
|
|
54
|
-
items: OS_ROUTE_DEFS.map(r => ({
|
|
55
|
-
glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
|
|
56
|
-
active: state.active === r.path,
|
|
57
|
-
onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
|
|
58
|
-
})),
|
|
59
|
-
});
|
|
60
|
-
return Side({ sections });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function view() {
|
|
64
|
-
const route = allRoutes.find(r => r.path === state.active) || ROUTES[1];
|
|
65
|
-
return AppShell({
|
|
66
|
-
topbar: Topbar({ brand: 'freddie', leaf: 'dashboard', items: [], active: '' }),
|
|
67
|
-
crumb: Crumb({ trail: ['freddie', instance.id], leaf: route.path, right: state.error ? Chip({ tone: 'miss', children: 'error' }) : Chip({ tone: 'ok', children: 'live' }) }),
|
|
68
|
-
side: buildSide(),
|
|
69
|
-
main: state.body || EmptyState({ text: 'loading…', glyph: '◌' }),
|
|
70
|
-
status: Status({ left: ['ds-247420 · webjsx · ' + allRoutes.length + ' routes', 'instance=' + instance.id], right: [state.ts] }),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async function loadActive() {
|
|
75
|
-
try {
|
|
76
|
-
const h0 = await ensureHost();
|
|
77
|
-
const page = PAGES[state.active] || PAGES.home;
|
|
78
|
-
state.body = await page(h0, instance);
|
|
79
|
-
state.error = null;
|
|
80
|
-
} catch (e) {
|
|
81
|
-
state.error = String(e && e.stack || e);
|
|
82
|
-
state.body = Panel({ title: 'error', children: pre(state.error) });
|
|
83
|
-
}
|
|
84
|
-
state.ts = new Date().toLocaleTimeString();
|
|
85
|
-
webjsx.applyDiff(root, view());
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
rerender();
|
|
89
|
-
|
|
90
|
-
if (typeof window !== 'undefined') {
|
|
91
|
-
window.__debug = window.__debug || {};
|
|
92
|
-
window.__debug.instances = window.__debug.instances || {};
|
|
93
|
-
window.__debug.instances[instance.id] = window.__debug.instances[instance.id] || {};
|
|
94
|
-
window.__debug.instances[instance.id].dashboard = {
|
|
95
|
-
root, routes: allRoutes.map(r => r.path), setActive,
|
|
96
|
-
get active() { return state.active; },
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return { node: root, dispose() {} };
|
|
101
|
-
}
|
|
1
|
+
import * as webjsx from '../../../vendor/webjsx/index.js';
|
|
2
|
+
import * as components from '../../components.js';
|
|
3
|
+
import { ROUTES, OS_ROUTE_DEFS } from './freddie/routes.js';
|
|
4
|
+
import { makeCorePages } from './freddie/pages-core.js';
|
|
5
|
+
import { makeChatPage } from './freddie/pages-chat.js';
|
|
6
|
+
import { makeToolsPages } from './freddie/pages-tools.js';
|
|
7
|
+
import { makeOsPages } from './freddie/pages-os.js';
|
|
8
|
+
|
|
9
|
+
const { AppShell, Topbar, Side, Crumb, Status, Panel, Chip, EmptyState } = components;
|
|
10
|
+
|
|
11
|
+
function pre(obj) {
|
|
12
|
+
return webjsx.createElement('pre', { class: 'fd-pre' }, typeof obj === 'string' ? obj : JSON.stringify(obj, null, 2));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createFreddieDashboard({ instance, bootHost, osSurfaces }) {
|
|
16
|
+
const root = document.createElement('div');
|
|
17
|
+
root.className = 'app-fd ds-247420 fd-root';
|
|
18
|
+
|
|
19
|
+
const state = { active: 'home', ts: new Date().toLocaleTimeString(), body: null, error: null };
|
|
20
|
+
let host = instance.host || null;
|
|
21
|
+
const allRoutes = osSurfaces ? [...ROUTES, ...OS_ROUTE_DEFS] : ROUTES;
|
|
22
|
+
|
|
23
|
+
async function ensureHost() {
|
|
24
|
+
if (host) return host;
|
|
25
|
+
if (typeof bootHost !== 'function') throw new Error('createFreddieDashboard: instance.host or bootHost required');
|
|
26
|
+
host = instance.host = await bootHost({ fs: instance.fs });
|
|
27
|
+
return host;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function setActive(p) { state.active = p; rerender(); }
|
|
31
|
+
if (typeof window !== 'undefined') window.__fd_nav = setActive;
|
|
32
|
+
|
|
33
|
+
function rerender() { webjsx.applyDiff(root, view()); loadActive(); }
|
|
34
|
+
|
|
35
|
+
const ctx = { instance, osSurfaces, root, state, rerender, get host() { return host; } };
|
|
36
|
+
const PAGES = {
|
|
37
|
+
...makeCorePages(ctx),
|
|
38
|
+
chat: makeChatPage(ctx),
|
|
39
|
+
...makeToolsPages(ctx),
|
|
40
|
+
...(osSurfaces ? makeOsPages(ctx) : {}),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function buildSide() {
|
|
44
|
+
const sections = [{
|
|
45
|
+
group: 'FREDDIE',
|
|
46
|
+
items: ROUTES.map(r => ({
|
|
47
|
+
glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
|
|
48
|
+
active: state.active === r.path,
|
|
49
|
+
onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
|
|
50
|
+
})),
|
|
51
|
+
}];
|
|
52
|
+
if (osSurfaces) sections.push({
|
|
53
|
+
group: 'OS',
|
|
54
|
+
items: OS_ROUTE_DEFS.map(r => ({
|
|
55
|
+
glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
|
|
56
|
+
active: state.active === r.path,
|
|
57
|
+
onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
|
|
58
|
+
})),
|
|
59
|
+
});
|
|
60
|
+
return Side({ sections });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function view() {
|
|
64
|
+
const route = allRoutes.find(r => r.path === state.active) || ROUTES[1];
|
|
65
|
+
return AppShell({
|
|
66
|
+
topbar: Topbar({ brand: 'freddie', leaf: 'dashboard', items: [], active: '' }),
|
|
67
|
+
crumb: Crumb({ trail: ['freddie', instance.id], leaf: route.path, right: state.error ? Chip({ tone: 'miss', children: 'error' }) : Chip({ tone: 'ok', children: 'live' }) }),
|
|
68
|
+
side: buildSide(),
|
|
69
|
+
main: state.body || EmptyState({ text: 'loading…', glyph: '◌' }),
|
|
70
|
+
status: Status({ left: ['ds-247420 · webjsx · ' + allRoutes.length + ' routes', 'instance=' + instance.id], right: [state.ts] }),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function loadActive() {
|
|
75
|
+
try {
|
|
76
|
+
const h0 = await ensureHost();
|
|
77
|
+
const page = PAGES[state.active] || PAGES.home;
|
|
78
|
+
state.body = await page(h0, instance);
|
|
79
|
+
state.error = null;
|
|
80
|
+
} catch (e) {
|
|
81
|
+
state.error = String(e && e.stack || e);
|
|
82
|
+
state.body = Panel({ title: 'error', children: pre(state.error) });
|
|
83
|
+
}
|
|
84
|
+
state.ts = new Date().toLocaleTimeString();
|
|
85
|
+
webjsx.applyDiff(root, view());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
rerender();
|
|
89
|
+
|
|
90
|
+
if (typeof window !== 'undefined') {
|
|
91
|
+
window.__debug = window.__debug || {};
|
|
92
|
+
window.__debug.instances = window.__debug.instances || {};
|
|
93
|
+
window.__debug.instances[instance.id] = window.__debug.instances[instance.id] || {};
|
|
94
|
+
window.__debug.instances[instance.id].dashboard = {
|
|
95
|
+
root, routes: allRoutes.map(r => r.path), setActive,
|
|
96
|
+
get active() { return state.active; },
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return { node: root, dispose() {} };
|
|
101
|
+
}
|
package/src/kits/os/icons.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export const icons = {
|
|
2
|
-
terminal: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 9l3 3-3 3M13 15h4"/></svg>',
|
|
3
|
-
browser: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"/></svg>',
|
|
4
|
-
canvas: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="14" rx="2"/><path d="M3 17l6-5 4 3 5-4 3 2"/></svg>',
|
|
5
|
-
files: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></svg>',
|
|
6
|
-
monitor: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12l4-8 4 14 4-10 4 8 2-3"/></svg>',
|
|
7
|
-
validator: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l4 4L19 6"/></svg>',
|
|
8
|
-
about: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v.01M11 12h1v5h1"/></svg>',
|
|
9
|
-
apps: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></svg>',
|
|
10
|
-
plus: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>',
|
|
11
|
-
home: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h16M4 18h16"/></svg>',
|
|
12
|
-
xdisplay: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="13" rx="1.5"/><path d="M8 21h8M12 17v4M9 9l6 4M15 9l-6 4"/></svg>',
|
|
13
|
-
close: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6l12 12M18 6l-12 12"/></svg>',
|
|
14
|
-
chat: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5h16v11H8l-4 4z"/><path d="M8 9h8M8 12h6"/></svg>',
|
|
15
|
-
tools: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 7l3-3 3 3-3 3-3-3zM7 14l3 3-7 7-3-3 7-7zM5 7l3-3M14 14l6 6"/></svg>',
|
|
16
|
-
freddie: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2M8 12a4 4 0 008 0"/></svg>',
|
|
17
|
-
};
|
|
1
|
+
export const icons = {
|
|
2
|
+
terminal: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 9l3 3-3 3M13 15h4"/></svg>',
|
|
3
|
+
browser: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"/></svg>',
|
|
4
|
+
canvas: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="14" rx="2"/><path d="M3 17l6-5 4 3 5-4 3 2"/></svg>',
|
|
5
|
+
files: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></svg>',
|
|
6
|
+
monitor: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12l4-8 4 14 4-10 4 8 2-3"/></svg>',
|
|
7
|
+
validator: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l4 4L19 6"/></svg>',
|
|
8
|
+
about: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v.01M11 12h1v5h1"/></svg>',
|
|
9
|
+
apps: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></svg>',
|
|
10
|
+
plus: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>',
|
|
11
|
+
home: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h16M4 18h16"/></svg>',
|
|
12
|
+
xdisplay: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="13" rx="1.5"/><path d="M8 21h8M12 17v4M9 9l6 4M15 9l-6 4"/></svg>',
|
|
13
|
+
close: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6l12 12M18 6l-12 12"/></svg>',
|
|
14
|
+
chat: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5h16v11H8l-4 4z"/><path d="M8 9h8M8 12h6"/></svg>',
|
|
15
|
+
tools: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 7l3-3 3 3-3 3-3-3zM7 14l3 3-7 7-3-3 7-7zM5 7l3-3M14 14l6 6"/></svg>',
|
|
16
|
+
freddie: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2M8 12a4 4 0 008 0"/></svg>',
|
|
17
|
+
};
|
package/src/kits/os/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { icons } from './icons.js';
|
|
2
|
-
export { createDesktopShell } from './shell.js';
|
|
3
|
-
export { renderWindow } from './wm.js';
|
|
4
|
-
export { renderDock } from './launcher.js';
|
|
5
|
-
|
|
6
|
-
// App modules — surfaced through the kit entry point so consumers can use a
|
|
7
|
-
// single import site. Each module also remains importable from its own path
|
|
8
|
-
// for tree-shaking and back-compat.
|
|
9
|
-
export { renderAboutApp } from './about-app.js';
|
|
10
|
-
export { renderBrowserPane } from './browser-app.js';
|
|
11
|
-
export { renderFilesApp } from './files-app.js';
|
|
12
|
-
export { renderMonitorApp } from './monitor-app.js';
|
|
13
|
-
export { renderTerminal } from './terminal-app.js';
|
|
14
|
-
export { renderValidator } from './validator-app.js';
|
|
15
|
-
export { createFreddieDashboard } from './freddie-dashboard.js';
|
|
16
|
-
|
|
17
|
-
export const themeUrl = new URL('./theme.css', import.meta.url).href;
|
|
1
|
+
export { icons } from './icons.js';
|
|
2
|
+
export { createDesktopShell } from './shell.js';
|
|
3
|
+
export { renderWindow } from './wm.js';
|
|
4
|
+
export { renderDock } from './launcher.js';
|
|
5
|
+
|
|
6
|
+
// App modules — surfaced through the kit entry point so consumers can use a
|
|
7
|
+
// single import site. Each module also remains importable from its own path
|
|
8
|
+
// for tree-shaking and back-compat.
|
|
9
|
+
export { renderAboutApp } from './about-app.js';
|
|
10
|
+
export { renderBrowserPane } from './browser-app.js';
|
|
11
|
+
export { renderFilesApp } from './files-app.js';
|
|
12
|
+
export { renderMonitorApp } from './monitor-app.js';
|
|
13
|
+
export { renderTerminal } from './terminal-app.js';
|
|
14
|
+
export { renderValidator } from './validator-app.js';
|
|
15
|
+
export { createFreddieDashboard } from './freddie-dashboard.js';
|
|
16
|
+
|
|
17
|
+
export const themeUrl = new URL('./theme.css', import.meta.url).href;
|
package/src/kits/os/launcher.css
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/* ============================================================
|
|
2
|
-
Launcher dock — paired with createLauncher() (validation harness path)
|
|
3
|
-
Bible: tonal step from canvas, no borders, pill controls, lowercase.
|
|
4
|
-
============================================================ */
|
|
5
|
-
|
|
6
|
-
.launcher-dock {
|
|
7
|
-
position: fixed;
|
|
8
|
-
left: 0; top: 0; bottom: 0;
|
|
9
|
-
width: 56px;
|
|
10
|
-
background: var(--os-bg-2);
|
|
11
|
-
border: none;
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
align-items: center;
|
|
15
|
-
padding: 8px 0;
|
|
16
|
-
gap: 8px;
|
|
17
|
-
z-index: 10000;
|
|
18
|
-
pointer-events: auto;
|
|
19
|
-
font: 11px var(--os-mono);
|
|
20
|
-
color: var(--os-fg);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.launcher-btn {
|
|
24
|
-
width: 40px; height: 40px;
|
|
25
|
-
background: transparent;
|
|
26
|
-
color: inherit;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
border-radius: var(--os-radius-sm);
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
padding: 0;
|
|
33
|
-
font: inherit;
|
|
34
|
-
transition: background 80ms ease, color 80ms ease, box-shadow 80ms ease;
|
|
35
|
-
}
|
|
36
|
-
.launcher-btn:hover { background: var(--panel-hover, var(--os-bg-1)); color: var(--os-fg); }
|
|
37
|
-
.launcher-btn.active {
|
|
38
|
-
background: var(--panel-select, var(--os-accent-soft));
|
|
39
|
-
color: var(--os-fg);
|
|
40
|
-
box-shadow: inset 4px 0 0 var(--os-accent);
|
|
41
|
-
}
|
|
42
|
-
.launcher-add { font-size: 20px; }
|
|
43
|
-
|
|
44
|
-
.launcher-instances {
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: center;
|
|
48
|
-
gap: 8px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.launcher-row {
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: 2px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.launcher-close { font-size: 11px; opacity: 0.7; width: 20px; height: 20px; }
|
|
59
|
-
.launcher-close:hover { opacity: 1; }
|
|
60
|
-
|
|
61
|
-
.launcher-dock + .wm-root { left: 56px !important; }
|
|
1
|
+
/* ============================================================
|
|
2
|
+
Launcher dock — paired with createLauncher() (validation harness path)
|
|
3
|
+
Bible: tonal step from canvas, no borders, pill controls, lowercase.
|
|
4
|
+
============================================================ */
|
|
5
|
+
|
|
6
|
+
.launcher-dock {
|
|
7
|
+
position: fixed;
|
|
8
|
+
left: 0; top: 0; bottom: 0;
|
|
9
|
+
width: 56px;
|
|
10
|
+
background: var(--os-bg-2);
|
|
11
|
+
border: none;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
padding: 8px 0;
|
|
16
|
+
gap: 8px;
|
|
17
|
+
z-index: 10000;
|
|
18
|
+
pointer-events: auto;
|
|
19
|
+
font: 11px var(--os-mono);
|
|
20
|
+
color: var(--os-fg);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.launcher-btn {
|
|
24
|
+
width: 40px; height: 40px;
|
|
25
|
+
background: transparent;
|
|
26
|
+
color: inherit;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
border-radius: var(--os-radius-sm);
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
padding: 0;
|
|
33
|
+
font: inherit;
|
|
34
|
+
transition: background 80ms ease, color 80ms ease, box-shadow 80ms ease;
|
|
35
|
+
}
|
|
36
|
+
.launcher-btn:hover { background: var(--panel-hover, var(--os-bg-1)); color: var(--os-fg); }
|
|
37
|
+
.launcher-btn.active {
|
|
38
|
+
background: var(--panel-select, var(--os-accent-soft));
|
|
39
|
+
color: var(--os-fg);
|
|
40
|
+
box-shadow: inset 4px 0 0 var(--os-accent);
|
|
41
|
+
}
|
|
42
|
+
.launcher-add { font-size: 20px; }
|
|
43
|
+
|
|
44
|
+
.launcher-instances {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.launcher-row {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.launcher-close { font-size: 11px; opacity: 0.7; width: 20px; height: 20px; }
|
|
59
|
+
.launcher-close:hover { opacity: 1; }
|
|
60
|
+
|
|
61
|
+
.launcher-dock + .wm-root { left: 56px !important; }
|
package/src/kits/os/launcher.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
// Launcher dock paint surface — pure DOM rendering, no lifecycle.
|
|
2
|
-
// Consumer (thebird) owns instance creation, fs/worker/shell wiring, teardown.
|
|
3
|
-
// renderDock returns a handle whose setInstances/setActive are called from
|
|
4
|
-
// lifecycle code. Visuals are bible-aligned: panel-select bg + accent inset
|
|
5
|
-
// rail for active, tonal hover, lowercase mono labels.
|
|
6
|
-
|
|
7
|
-
export function renderDock(opts = {}) {
|
|
8
|
-
const { root = document.body, callbacks = {} } = opts;
|
|
9
|
-
|
|
10
|
-
const el = document.createElement('div');
|
|
11
|
-
el.className = 'launcher-dock';
|
|
12
|
-
|
|
13
|
-
const addBtn = document.createElement('button');
|
|
14
|
-
addBtn.className = 'launcher-btn launcher-add';
|
|
15
|
-
addBtn.textContent = '+';
|
|
16
|
-
addBtn.title = 'new instance';
|
|
17
|
-
addBtn.addEventListener('click', () => callbacks.onNewInstance && callbacks.onNewInstance());
|
|
18
|
-
el.appendChild(addBtn);
|
|
19
|
-
|
|
20
|
-
const instancesHost = document.createElement('div');
|
|
21
|
-
instancesHost.className = 'launcher-instances';
|
|
22
|
-
el.appendChild(instancesHost);
|
|
23
|
-
|
|
24
|
-
root.appendChild(el);
|
|
25
|
-
|
|
26
|
-
let activeId = null;
|
|
27
|
-
const buttons = new Map();
|
|
28
|
-
|
|
29
|
-
function clear() {
|
|
30
|
-
while (instancesHost.firstChild) instancesHost.removeChild(instancesHost.firstChild);
|
|
31
|
-
buttons.clear();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function setInstances(list) {
|
|
35
|
-
clear();
|
|
36
|
-
for (const inst of list) {
|
|
37
|
-
const row = document.createElement('div');
|
|
38
|
-
row.className = 'launcher-row';
|
|
39
|
-
row.dataset.instanceId = inst.id;
|
|
40
|
-
|
|
41
|
-
const selBtn = document.createElement('button');
|
|
42
|
-
selBtn.className = 'launcher-btn';
|
|
43
|
-
selBtn.textContent = inst.label || inst.id;
|
|
44
|
-
selBtn.title = 'instance ' + inst.id;
|
|
45
|
-
selBtn.dataset.role = 'select';
|
|
46
|
-
selBtn.dataset.instanceId = inst.id;
|
|
47
|
-
if (inst.active || inst.id === activeId) selBtn.classList.add('active');
|
|
48
|
-
selBtn.addEventListener('click', () => callbacks.onSelectInstance && callbacks.onSelectInstance(inst.id));
|
|
49
|
-
|
|
50
|
-
const closeBtn = document.createElement('button');
|
|
51
|
-
closeBtn.className = 'launcher-btn launcher-close';
|
|
52
|
-
closeBtn.textContent = 'x';
|
|
53
|
-
closeBtn.title = 'close ' + inst.id;
|
|
54
|
-
closeBtn.dataset.role = 'close';
|
|
55
|
-
closeBtn.dataset.instanceId = inst.id;
|
|
56
|
-
closeBtn.addEventListener('click', e => {
|
|
57
|
-
e.stopPropagation();
|
|
58
|
-
callbacks.onCloseInstance && callbacks.onCloseInstance(inst.id);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
row.append(selBtn, closeBtn);
|
|
62
|
-
instancesHost.appendChild(row);
|
|
63
|
-
buttons.set(inst.id, { selBtn, closeBtn, row });
|
|
64
|
-
}
|
|
65
|
-
if (activeId && !buttons.has(activeId)) activeId = null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function setActive(id) {
|
|
69
|
-
activeId = id;
|
|
70
|
-
for (const [iid, b] of buttons) b.selBtn.classList.toggle('active', iid === id);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function dispose() {
|
|
74
|
-
el.remove();
|
|
75
|
-
buttons.clear();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return { el, setInstances, setActive, dispose };
|
|
79
|
-
}
|
|
1
|
+
// Launcher dock paint surface — pure DOM rendering, no lifecycle.
|
|
2
|
+
// Consumer (thebird) owns instance creation, fs/worker/shell wiring, teardown.
|
|
3
|
+
// renderDock returns a handle whose setInstances/setActive are called from
|
|
4
|
+
// lifecycle code. Visuals are bible-aligned: panel-select bg + accent inset
|
|
5
|
+
// rail for active, tonal hover, lowercase mono labels.
|
|
6
|
+
|
|
7
|
+
export function renderDock(opts = {}) {
|
|
8
|
+
const { root = document.body, callbacks = {} } = opts;
|
|
9
|
+
|
|
10
|
+
const el = document.createElement('div');
|
|
11
|
+
el.className = 'launcher-dock';
|
|
12
|
+
|
|
13
|
+
const addBtn = document.createElement('button');
|
|
14
|
+
addBtn.className = 'launcher-btn launcher-add';
|
|
15
|
+
addBtn.textContent = '+';
|
|
16
|
+
addBtn.title = 'new instance';
|
|
17
|
+
addBtn.addEventListener('click', () => callbacks.onNewInstance && callbacks.onNewInstance());
|
|
18
|
+
el.appendChild(addBtn);
|
|
19
|
+
|
|
20
|
+
const instancesHost = document.createElement('div');
|
|
21
|
+
instancesHost.className = 'launcher-instances';
|
|
22
|
+
el.appendChild(instancesHost);
|
|
23
|
+
|
|
24
|
+
root.appendChild(el);
|
|
25
|
+
|
|
26
|
+
let activeId = null;
|
|
27
|
+
const buttons = new Map();
|
|
28
|
+
|
|
29
|
+
function clear() {
|
|
30
|
+
while (instancesHost.firstChild) instancesHost.removeChild(instancesHost.firstChild);
|
|
31
|
+
buttons.clear();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function setInstances(list) {
|
|
35
|
+
clear();
|
|
36
|
+
for (const inst of list) {
|
|
37
|
+
const row = document.createElement('div');
|
|
38
|
+
row.className = 'launcher-row';
|
|
39
|
+
row.dataset.instanceId = inst.id;
|
|
40
|
+
|
|
41
|
+
const selBtn = document.createElement('button');
|
|
42
|
+
selBtn.className = 'launcher-btn';
|
|
43
|
+
selBtn.textContent = inst.label || inst.id;
|
|
44
|
+
selBtn.title = 'instance ' + inst.id;
|
|
45
|
+
selBtn.dataset.role = 'select';
|
|
46
|
+
selBtn.dataset.instanceId = inst.id;
|
|
47
|
+
if (inst.active || inst.id === activeId) selBtn.classList.add('active');
|
|
48
|
+
selBtn.addEventListener('click', () => callbacks.onSelectInstance && callbacks.onSelectInstance(inst.id));
|
|
49
|
+
|
|
50
|
+
const closeBtn = document.createElement('button');
|
|
51
|
+
closeBtn.className = 'launcher-btn launcher-close';
|
|
52
|
+
closeBtn.textContent = 'x';
|
|
53
|
+
closeBtn.title = 'close ' + inst.id;
|
|
54
|
+
closeBtn.dataset.role = 'close';
|
|
55
|
+
closeBtn.dataset.instanceId = inst.id;
|
|
56
|
+
closeBtn.addEventListener('click', e => {
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
callbacks.onCloseInstance && callbacks.onCloseInstance(inst.id);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
row.append(selBtn, closeBtn);
|
|
62
|
+
instancesHost.appendChild(row);
|
|
63
|
+
buttons.set(inst.id, { selBtn, closeBtn, row });
|
|
64
|
+
}
|
|
65
|
+
if (activeId && !buttons.has(activeId)) activeId = null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function setActive(id) {
|
|
69
|
+
activeId = id;
|
|
70
|
+
for (const [iid, b] of buttons) b.selBtn.classList.toggle('active', iid === id);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function dispose() {
|
|
74
|
+
el.remove();
|
|
75
|
+
buttons.clear();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return { el, setInstances, setActive, dispose };
|
|
79
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// Monitor-app paint surface — bible classes, pure DOM. Consumer supplies getStats().
|
|
2
|
-
// getStats() -> Promise<{instanceId, frames, shells, windows, appsRegistered, jsHeapMb, jsHeapLimitMb, time}>.
|
|
3
|
-
// Field names map directly to displayed lines so consumer controls labels by value, not template.
|
|
4
|
-
|
|
5
|
-
export function renderMonitorApp(opts = {}) {
|
|
6
|
-
const { getStats, pollMs = 1000 } = opts;
|
|
7
|
-
const node = document.createElement('div');
|
|
8
|
-
node.className = 'app-pane mono';
|
|
9
|
-
node.dataset.component = 'monitor-app';
|
|
10
|
-
|
|
11
|
-
async function tick() {
|
|
12
|
-
const s = (await Promise.resolve(getStats())) || {};
|
|
13
|
-
const heap = (s.jsHeapMb != null && s.jsHeapLimitMb != null)
|
|
14
|
-
? `js heap: ${Number(s.jsHeapMb).toFixed(1)} MB / ${Number(s.jsHeapLimitMb).toFixed(0)} MB`
|
|
15
|
-
: 'js heap: n/a';
|
|
16
|
-
node.textContent = [
|
|
17
|
-
`instance: ${s.instanceId ?? ''}`,
|
|
18
|
-
`worker frames: ${s.frames ?? 0}`,
|
|
19
|
-
`shells: ${s.shells ?? 0}`,
|
|
20
|
-
`windows: ${s.windows ?? 0}`,
|
|
21
|
-
`apps registered: ${s.appsRegistered ?? 0}`,
|
|
22
|
-
heap,
|
|
23
|
-
`now: ${s.time ?? new Date().toLocaleTimeString()}`,
|
|
24
|
-
].join('\n');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
tick().catch(() => {});
|
|
28
|
-
const timer = setInterval(() => tick().catch(() => {}), pollMs);
|
|
29
|
-
return {
|
|
30
|
-
node,
|
|
31
|
-
tick,
|
|
32
|
-
dispose() { clearInterval(timer); },
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
// Monitor-app paint surface — bible classes, pure DOM. Consumer supplies getStats().
|
|
2
|
+
// getStats() -> Promise<{instanceId, frames, shells, windows, appsRegistered, jsHeapMb, jsHeapLimitMb, time}>.
|
|
3
|
+
// Field names map directly to displayed lines so consumer controls labels by value, not template.
|
|
4
|
+
|
|
5
|
+
export function renderMonitorApp(opts = {}) {
|
|
6
|
+
const { getStats, pollMs = 1000 } = opts;
|
|
7
|
+
const node = document.createElement('div');
|
|
8
|
+
node.className = 'app-pane mono';
|
|
9
|
+
node.dataset.component = 'monitor-app';
|
|
10
|
+
|
|
11
|
+
async function tick() {
|
|
12
|
+
const s = (await Promise.resolve(getStats())) || {};
|
|
13
|
+
const heap = (s.jsHeapMb != null && s.jsHeapLimitMb != null)
|
|
14
|
+
? `js heap: ${Number(s.jsHeapMb).toFixed(1)} MB / ${Number(s.jsHeapLimitMb).toFixed(0)} MB`
|
|
15
|
+
: 'js heap: n/a';
|
|
16
|
+
node.textContent = [
|
|
17
|
+
`instance: ${s.instanceId ?? ''}`,
|
|
18
|
+
`worker frames: ${s.frames ?? 0}`,
|
|
19
|
+
`shells: ${s.shells ?? 0}`,
|
|
20
|
+
`windows: ${s.windows ?? 0}`,
|
|
21
|
+
`apps registered: ${s.appsRegistered ?? 0}`,
|
|
22
|
+
heap,
|
|
23
|
+
`now: ${s.time ?? new Date().toLocaleTimeString()}`,
|
|
24
|
+
].join('\n');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
tick().catch(() => {});
|
|
28
|
+
const timer = setInterval(() => tick().catch(() => {}), pollMs);
|
|
29
|
+
return {
|
|
30
|
+
node,
|
|
31
|
+
tick,
|
|
32
|
+
dispose() { clearInterval(timer); },
|
|
33
|
+
};
|
|
34
|
+
}
|