anentrypoint-design 0.0.218 → 0.0.219
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/app-shell.css +4 -0
- package/dist/.nojekyll +0 -0
- package/dist/247420.css +4 -0
- package/dist/247420.js +13 -13
- package/dist/app-shell.css +594 -0
- package/dist/colors_and_type.css +197 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.html +308 -0
- package/dist/preview/buttons.html +28 -0
- package/dist/preview/colors-core.html +45 -0
- package/dist/preview/colors-lore.html +28 -0
- package/dist/preview/colors-semantic.html +34 -0
- package/dist/preview/dateline.html +19 -0
- package/dist/preview/dropzone.html +30 -0
- package/dist/preview/file-grid.html +19 -0
- package/dist/preview/file-row.html +20 -0
- package/dist/preview/file-toolbar.html +40 -0
- package/dist/preview/file-viewer.html +31 -0
- package/dist/preview/header.html +24 -0
- package/dist/preview/icons-unicode.html +26 -0
- package/dist/preview/index-row.html +25 -0
- package/dist/preview/inputs.html +22 -0
- package/dist/preview/manifesto.html +52 -0
- package/dist/preview/motion-default.js +106 -0
- package/dist/preview/rules.html +16 -0
- package/dist/preview/spacing.html +18 -0
- package/dist/preview/stamps-lore.html +20 -0
- package/dist/preview/stamps.html +14 -0
- package/dist/preview/theme-ink.html +15 -0
- package/dist/preview/type-display.html +16 -0
- package/dist/preview/type-mono.html +15 -0
- package/dist/preview/type-prose.html +11 -0
- package/dist/preview/type-scale.html +20 -0
- package/dist/preview/wordmarks.html +28 -0
- package/dist/robots.txt +8 -0
- package/dist/site/content/globals/navigation.yaml +5 -0
- package/dist/site/content/globals/site.yaml +16 -0
- package/dist/site/content/pages/freddie.yaml +88 -0
- package/dist/site/content/pages/home.yaml +190 -0
- package/dist/site/theme.mjs +368 -0
- package/dist/sitemap.xml +31 -0
- package/dist/slides/deck-stage-overlay.js +63 -0
- package/dist/slides/deck-stage-state.js +81 -0
- package/dist/slides/deck-stage-style.js +117 -0
- package/dist/slides/deck-stage.js +159 -0
- package/dist/slides/index.html +276 -0
- package/dist/src/bootstrap.js +25 -0
- package/dist/src/components/chat.js +199 -0
- package/dist/src/components/community.js +167 -0
- package/dist/src/components/content.js +213 -0
- package/dist/src/components/files-modals.js +107 -0
- package/dist/src/components/files.js +118 -0
- package/dist/src/components/freddie/helpers.js +50 -0
- package/dist/src/components/freddie.js +33 -0
- package/dist/src/components/shell.js +117 -0
- package/dist/src/components/theme-toggle.js +70 -0
- package/dist/src/components.js +52 -0
- package/dist/src/debug.js +30 -0
- package/dist/src/deck-stage.js +21 -0
- package/dist/src/highlight.js +32 -0
- package/dist/src/index.js +86 -0
- package/dist/src/kits/os/about-app.js +52 -0
- package/dist/src/kits/os/app-panes.css +152 -0
- package/dist/src/kits/os/browser-app.js +58 -0
- package/dist/src/kits/os/files-app.js +44 -0
- package/dist/src/kits/os/freddie/helpers.js +59 -0
- package/dist/src/kits/os/freddie/pages-chat.js +143 -0
- package/dist/src/kits/os/freddie/pages-core.js +101 -0
- package/dist/src/kits/os/freddie/pages-os.js +51 -0
- package/dist/src/kits/os/freddie/pages-tools.js +183 -0
- package/dist/src/kits/os/freddie/routes.js +24 -0
- package/dist/src/kits/os/freddie-dashboard.css +51 -0
- package/dist/src/kits/os/freddie-dashboard.js +101 -0
- package/dist/src/kits/os/icons.js +17 -0
- package/dist/src/kits/os/index.js +5 -0
- package/dist/src/kits/os/launcher.css +61 -0
- package/dist/src/kits/os/launcher.js +79 -0
- package/dist/src/kits/os/monitor-app.js +34 -0
- package/dist/src/kits/os/shell.js +214 -0
- package/dist/src/kits/os/terminal-app.js +45 -0
- package/dist/src/kits/os/theme.css +412 -0
- package/dist/src/kits/os/validate.css +19 -0
- package/dist/src/kits/os/validator-app.js +55 -0
- package/dist/src/kits/os/wm.css +115 -0
- package/dist/src/kits/os/wm.js +111 -0
- package/dist/src/markdown.js +39 -0
- package/dist/src/motion.js +35 -0
- package/dist/src/page-html.js +196 -0
- package/dist/src/styles.js +25 -0
- package/dist/src/theme.js +99 -0
- package/dist/src/web-components/ds-chat.js +45 -0
- package/dist/ui_kits/aicat/README.md +7 -0
- package/dist/ui_kits/aicat/app.js +156 -0
- package/dist/ui_kits/aicat/index.html +26 -0
- package/dist/ui_kits/aicat/sample-square.png +0 -0
- package/dist/ui_kits/aicat/sample-svg.svg +1 -0
- package/dist/ui_kits/aicat/sample.pdf +32 -0
- package/dist/ui_kits/blog/README.md +3 -0
- package/dist/ui_kits/blog/index.html +90 -0
- package/dist/ui_kits/chat/README.md +5 -0
- package/dist/ui_kits/chat/app.js +110 -0
- package/dist/ui_kits/chat/index.html +26 -0
- package/dist/ui_kits/chat/sample-square.png +0 -0
- package/dist/ui_kits/chat/sample-svg.svg +1 -0
- package/dist/ui_kits/chat/sample.pdf +32 -0
- package/dist/ui_kits/community/app.js +134 -0
- package/dist/ui_kits/community/index.html +24 -0
- package/dist/ui_kits/dashboard/app.js +92 -0
- package/dist/ui_kits/dashboard/index.html +26 -0
- package/dist/ui_kits/docs/README.md +3 -0
- package/dist/ui_kits/docs/index.html +123 -0
- package/dist/ui_kits/error_404/app.js +56 -0
- package/dist/ui_kits/error_404/index.html +26 -0
- package/dist/ui_kits/file_browser/README.md +48 -0
- package/dist/ui_kits/file_browser/app.js +231 -0
- package/dist/ui_kits/file_browser/index.html +33 -0
- package/dist/ui_kits/gallery/app.js +121 -0
- package/dist/ui_kits/gallery/index.html +26 -0
- package/dist/ui_kits/homepage/README.md +7 -0
- package/dist/ui_kits/homepage/app.js +167 -0
- package/dist/ui_kits/homepage/index.html +46 -0
- package/dist/ui_kits/project_page/README.md +3 -0
- package/dist/ui_kits/project_page/app.js +154 -0
- package/dist/ui_kits/project_page/index.html +45 -0
- package/dist/ui_kits/search/app.js +107 -0
- package/dist/ui_kits/search/index.html +26 -0
- package/dist/ui_kits/settings/app.js +133 -0
- package/dist/ui_kits/settings/index.html +26 -0
- package/dist/ui_kits/signin/app.js +115 -0
- package/dist/ui_kits/signin/index.html +26 -0
- package/dist/ui_kits/slide_deck/app.js +174 -0
- package/dist/ui_kits/slide_deck/index.html +26 -0
- package/dist/ui_kits/system_primer/app.js +152 -0
- package/dist/ui_kits/system_primer/index.html +26 -0
- package/dist/ui_kits/terminal/app.js +150 -0
- package/dist/ui_kits/terminal/index.html +26 -0
- package/dist/vendor/webjsx/applyDiff.js +182 -0
- package/dist/vendor/webjsx/attributes.js +171 -0
- package/dist/vendor/webjsx/constants.js +4 -0
- package/dist/vendor/webjsx/createDOMElement.js +52 -0
- package/dist/vendor/webjsx/createElement.js +75 -0
- package/dist/vendor/webjsx/elementTags.js +115 -0
- package/dist/vendor/webjsx/factory.js +6 -0
- package/dist/vendor/webjsx/index.js +6 -0
- package/dist/vendor/webjsx/jsx-dev-runtime.js +2 -0
- package/dist/vendor/webjsx/jsx-runtime.js +30 -0
- package/dist/vendor/webjsx/jsx.js +2 -0
- package/dist/vendor/webjsx/package.json +39 -0
- package/dist/vendor/webjsx/renderSuspension.js +25 -0
- package/dist/vendor/webjsx/types.js +5 -0
- package/dist/vendor/webjsx/utils.js +84 -0
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { STYLESHEET } from './deck-stage-style.js';
|
|
2
|
+
import { buildOverlay, buildTapzones, handleDeckKey } from './deck-stage-overlay.js';
|
|
3
|
+
import { loadNotes, restoreIndex, persistIndex, collectSlides, applyIndex, STORAGE_PREFIX } from './deck-stage-state.js';
|
|
4
|
+
|
|
5
|
+
const DESIGN_W_DEFAULT = 1920;
|
|
6
|
+
const DESIGN_H_DEFAULT = 1080;
|
|
7
|
+
const OVERLAY_HIDE_MS = 1800;
|
|
8
|
+
|
|
9
|
+
class DeckStage extends HTMLElement {
|
|
10
|
+
static get observedAttributes() { return ['width', 'height', 'noscale']; }
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this._root = this.attachShadow({ mode: 'open' });
|
|
15
|
+
this._index = 0;
|
|
16
|
+
this._slides = [];
|
|
17
|
+
this._notes = [];
|
|
18
|
+
this._hideTimer = null;
|
|
19
|
+
this._mouseIdleTimer = null;
|
|
20
|
+
this._storageKey = STORAGE_PREFIX + (location.pathname || '/');
|
|
21
|
+
this._onKey = this._onKey.bind(this);
|
|
22
|
+
this._onResize = this._onResize.bind(this);
|
|
23
|
+
this._onSlotChange = this._onSlotChange.bind(this);
|
|
24
|
+
this._onMouseMove = this._onMouseMove.bind(this);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get designWidth() { return parseInt(this.getAttribute('width'), 10) || DESIGN_W_DEFAULT; }
|
|
28
|
+
get designHeight() { return parseInt(this.getAttribute('height'), 10) || DESIGN_H_DEFAULT; }
|
|
29
|
+
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
this._render();
|
|
32
|
+
this._notes = loadNotes(this);
|
|
33
|
+
this._syncPrintPageRule();
|
|
34
|
+
window.addEventListener('keydown', this._onKey);
|
|
35
|
+
window.addEventListener('resize', this._onResize);
|
|
36
|
+
window.addEventListener('mousemove', this._onMouseMove, { passive: true });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
window.removeEventListener('keydown', this._onKey);
|
|
41
|
+
window.removeEventListener('resize', this._onResize);
|
|
42
|
+
window.removeEventListener('mousemove', this._onMouseMove);
|
|
43
|
+
if (this._hideTimer) clearTimeout(this._hideTimer);
|
|
44
|
+
if (this._mouseIdleTimer) clearTimeout(this._mouseIdleTimer);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
attributeChangedCallback() {
|
|
48
|
+
if (!this._canvas) return;
|
|
49
|
+
this._canvas.style.width = this.designWidth + 'px';
|
|
50
|
+
this._canvas.style.height = this.designHeight + 'px';
|
|
51
|
+
this._canvas.style.setProperty('--deck-design-w', this.designWidth + 'px');
|
|
52
|
+
this._canvas.style.setProperty('--deck-design-h', this.designHeight + 'px');
|
|
53
|
+
this._fit();
|
|
54
|
+
this._syncPrintPageRule();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
_render() {
|
|
58
|
+
const style = document.createElement('style');
|
|
59
|
+
style.textContent = STYLESHEET;
|
|
60
|
+
const stage = document.createElement('div');
|
|
61
|
+
stage.className = 'stage';
|
|
62
|
+
const canvas = document.createElement('div');
|
|
63
|
+
canvas.className = 'canvas';
|
|
64
|
+
canvas.style.width = this.designWidth + 'px';
|
|
65
|
+
canvas.style.height = this.designHeight + 'px';
|
|
66
|
+
canvas.style.setProperty('--deck-design-w', this.designWidth + 'px');
|
|
67
|
+
canvas.style.setProperty('--deck-design-h', this.designHeight + 'px');
|
|
68
|
+
const slot = document.createElement('slot');
|
|
69
|
+
slot.addEventListener('slotchange', this._onSlotChange);
|
|
70
|
+
canvas.appendChild(slot);
|
|
71
|
+
stage.appendChild(canvas);
|
|
72
|
+
|
|
73
|
+
const tapzones = buildTapzones({
|
|
74
|
+
onBack: (e) => { e.preventDefault(); this._go(this._index - 1, 'tap'); },
|
|
75
|
+
onForward: (e) => { e.preventDefault(); this._go(this._index + 1, 'tap'); }
|
|
76
|
+
});
|
|
77
|
+
const overlay = buildOverlay({
|
|
78
|
+
onPrev: () => this._go(this._index - 1, 'click'),
|
|
79
|
+
onNext: () => this._go(this._index + 1, 'click'),
|
|
80
|
+
onReset: () => this._go(0, 'click')
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
this._root.append(style, stage, tapzones, overlay);
|
|
84
|
+
this._canvas = canvas;
|
|
85
|
+
this._slot = slot;
|
|
86
|
+
this._overlay = overlay;
|
|
87
|
+
this._countEl = overlay.querySelector('.current');
|
|
88
|
+
this._totalEl = overlay.querySelector('.total');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_syncPrintPageRule() {
|
|
92
|
+
const id = 'deck-stage-print-page';
|
|
93
|
+
let tag = document.getElementById(id);
|
|
94
|
+
if (!tag) {
|
|
95
|
+
tag = document.createElement('style');
|
|
96
|
+
tag.id = id;
|
|
97
|
+
document.head.appendChild(tag);
|
|
98
|
+
}
|
|
99
|
+
tag.textContent =
|
|
100
|
+
'@page { size: ' + this.designWidth + 'px ' + this.designHeight + 'px; margin: 0; } ' +
|
|
101
|
+
'@media print { html, body { margin: 0 !important; padding: 0 !important; background: none !important; overflow: visible !important; height: auto !important; } ' +
|
|
102
|
+
'* { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_onSlotChange() {
|
|
106
|
+
this._slides = collectSlides(this, this._slot);
|
|
107
|
+
this._index = restoreIndex(this, this._slides);
|
|
108
|
+
applyIndex(this, {
|
|
109
|
+
index: this._index, prevIndex: this._prevIndex, slides: this._slides,
|
|
110
|
+
countEl: this._countEl, showOverlay: false, broadcast: true, reason: 'init',
|
|
111
|
+
flashFn: () => this._flashOverlay()
|
|
112
|
+
});
|
|
113
|
+
this._fit();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
_flashOverlay() {
|
|
118
|
+
if (!this._overlay) return;
|
|
119
|
+
this._overlay.setAttribute('data-visible', '');
|
|
120
|
+
if (this._hideTimer) clearTimeout(this._hideTimer);
|
|
121
|
+
this._hideTimer = setTimeout(() => this._overlay.removeAttribute('data-visible'), OVERLAY_HIDE_MS);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
_fit() {
|
|
125
|
+
if (!this._canvas) return;
|
|
126
|
+
if (this.hasAttribute('noscale')) { this._canvas.style.transform = 'none'; return; }
|
|
127
|
+
const s = Math.min(window.innerWidth / this.designWidth, window.innerHeight / this.designHeight);
|
|
128
|
+
this._canvas.style.transform = `scale(${s})`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_onResize() { this._fit(); }
|
|
132
|
+
_onMouseMove() { this._flashOverlay(); }
|
|
133
|
+
_onKey(e) { if (handleDeckKey(this, e)) { e.preventDefault(); this._flashOverlay(); } }
|
|
134
|
+
|
|
135
|
+
_go(i, reason = 'api') {
|
|
136
|
+
if (!this._slides.length) return;
|
|
137
|
+
const clamped = Math.max(0, Math.min(this._slides.length - 1, i));
|
|
138
|
+
if (clamped === this._index) { this._flashOverlay(); return; }
|
|
139
|
+
this._index = clamped;
|
|
140
|
+
applyIndex(this, {
|
|
141
|
+
index: this._index, prevIndex: this._prevIndex, slides: this._slides,
|
|
142
|
+
countEl: this._countEl, showOverlay: true, broadcast: true, reason,
|
|
143
|
+
flashFn: () => this._flashOverlay()
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
get index() { return this._index; }
|
|
148
|
+
get length() { return this._slides.length; }
|
|
149
|
+
goTo(i) { this._go(i, 'api'); }
|
|
150
|
+
next() { this._go(this._index + 1, 'api'); }
|
|
151
|
+
prev() { this._go(this._index - 1, 'api'); }
|
|
152
|
+
reset() { this._go(0, 'api'); }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (typeof customElements !== 'undefined' && !customElements.get('deck-stage')) {
|
|
156
|
+
customElements.define('deck-stage', DeckStage);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export { DeckStage };
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="auto" class="ds-247420"><head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
+
<meta name="theme-color" content="#247420" media="(prefers-color-scheme: light)">
|
|
6
|
+
<meta name="theme-color" content="#3A9A34" media="(prefers-color-scheme: dark)">
|
|
7
|
+
<meta name="color-scheme" content="light dark">
|
|
8
|
+
<title>deck / 247420</title>
|
|
9
|
+
<meta name="description" content="presentation deck template — title, content, quote, comparison, receipt, end.">
|
|
10
|
+
<meta name="author" content="247420 / AnEntrypoint">
|
|
11
|
+
<meta name="keywords" content="247420, anentrypoint, design system, webjsx, rippleui, creative collective">
|
|
12
|
+
<link rel="canonical" href="https://anentrypoint.github.io/design/slides/">
|
|
13
|
+
<link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
|
14
|
+
<meta property="og:type" content="website">
|
|
15
|
+
<meta property="og:title" content="deck / 247420">
|
|
16
|
+
<meta property="og:description" content="presentation deck template — title, content, quote, comparison, receipt, end.">
|
|
17
|
+
<meta property="og:url" content="https://anentrypoint.github.io/design/slides/">
|
|
18
|
+
<meta property="og:site_name" content="247420 / design">
|
|
19
|
+
<meta property="og:image" content="https://anentrypoint.github.io/design/og-card.png">
|
|
20
|
+
<meta property="og:image:width" content="1200">
|
|
21
|
+
<meta property="og:image:height" content="630">
|
|
22
|
+
<meta property="og:image:alt" content="247420 design system">
|
|
23
|
+
<meta property="og:locale" content="en_US">
|
|
24
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
25
|
+
<meta name="twitter:title" content="deck / 247420">
|
|
26
|
+
<meta name="twitter:description" content="presentation deck template — title, content, quote, comparison, receipt, end.">
|
|
27
|
+
<meta name="twitter:image" content="https://anentrypoint.github.io/design/og-card.png">
|
|
28
|
+
<meta name="twitter:site" content="@AnEntrypoint">
|
|
29
|
+
<meta name="robots" content="index, follow">
|
|
30
|
+
<link rel="stylesheet" href="../colors_and_type.css">
|
|
31
|
+
<link rel="stylesheet" href="../app-shell.css">
|
|
32
|
+
<style>
|
|
33
|
+
/* Slides consume panel tokens → auto light/dark */
|
|
34
|
+
body { background: var(--panel-0); margin: 0; }
|
|
35
|
+
deck-stage { display: block; }
|
|
36
|
+
section {
|
|
37
|
+
background: var(--panel-1);
|
|
38
|
+
color: var(--panel-text);
|
|
39
|
+
padding: 96px;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
}
|
|
44
|
+
/* Variant: elevated surface — deeper on light, lighter on dark */
|
|
45
|
+
section.s-elev { background: var(--panel-2); }
|
|
46
|
+
section.s-canvas { background: var(--panel-0); }
|
|
47
|
+
/* Variant: accent-filled slide — pairs bg with its contrast token
|
|
48
|
+
so light-theme (deep green) gets white text and dark-theme (mint)
|
|
49
|
+
gets ink text. Never hardcode #fff here — mint + white is invisible. */
|
|
50
|
+
section.s-accent {
|
|
51
|
+
background: var(--panel-accent);
|
|
52
|
+
color: var(--panel-accent-fg);
|
|
53
|
+
}
|
|
54
|
+
section.s-accent .s-label,
|
|
55
|
+
section.s-accent .s-footer,
|
|
56
|
+
section.s-accent .s-dateline { color: var(--panel-accent-fg); }
|
|
57
|
+
|
|
58
|
+
.s-dateline {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
align-items: baseline;
|
|
62
|
+
gap: 24px;
|
|
63
|
+
font-family: var(--ff-mono);
|
|
64
|
+
font-size: 18px;
|
|
65
|
+
text-transform: uppercase;
|
|
66
|
+
letter-spacing: 0.14em;
|
|
67
|
+
padding-bottom: 12px;
|
|
68
|
+
color: var(--panel-text-2);
|
|
69
|
+
}
|
|
70
|
+
.s-dateline .spread { flex: 1; align-self: center; }
|
|
71
|
+
|
|
72
|
+
.s-hero {
|
|
73
|
+
font-family: var(--ff-display);
|
|
74
|
+
font-size: 240px;
|
|
75
|
+
line-height: 0.95;
|
|
76
|
+
letter-spacing: -0.03em;
|
|
77
|
+
font-weight: 700;
|
|
78
|
+
color: var(--panel-text);
|
|
79
|
+
}
|
|
80
|
+
.s-h1 {
|
|
81
|
+
font-family: var(--ff-display);
|
|
82
|
+
font-size: 160px;
|
|
83
|
+
line-height: 1;
|
|
84
|
+
letter-spacing: -0.02em;
|
|
85
|
+
font-weight: 700;
|
|
86
|
+
color: var(--panel-text);
|
|
87
|
+
}
|
|
88
|
+
.s-label {
|
|
89
|
+
font-family: var(--ff-mono);
|
|
90
|
+
font-size: 22px;
|
|
91
|
+
text-transform: uppercase;
|
|
92
|
+
letter-spacing: 0.14em;
|
|
93
|
+
color: var(--panel-accent);
|
|
94
|
+
}
|
|
95
|
+
.s-sub {
|
|
96
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
97
|
+
font-size: 34px;
|
|
98
|
+
line-height: 1.4;
|
|
99
|
+
margin-top: 32px;
|
|
100
|
+
max-width: 32ch;
|
|
101
|
+
color: var(--panel-text-2);
|
|
102
|
+
font-weight: 400;
|
|
103
|
+
}
|
|
104
|
+
.s-footer {
|
|
105
|
+
font-family: var(--ff-mono);
|
|
106
|
+
font-size: 18px;
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
letter-spacing: 0.14em;
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
padding-top: 12px;
|
|
112
|
+
color: var(--panel-text-2);
|
|
113
|
+
}
|
|
114
|
+
.s-quote {
|
|
115
|
+
font-family: var(--ff-display);
|
|
116
|
+
font-size: 120px;
|
|
117
|
+
line-height: 1.05;
|
|
118
|
+
font-style: italic;
|
|
119
|
+
max-width: 22ch;
|
|
120
|
+
letter-spacing: -0.02em;
|
|
121
|
+
color: var(--panel-text);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.cmp {
|
|
125
|
+
display: grid;
|
|
126
|
+
grid-template-columns: 1fr 1fr;
|
|
127
|
+
gap: 16px;
|
|
128
|
+
min-height: 640px;
|
|
129
|
+
}
|
|
130
|
+
.cmp > div {
|
|
131
|
+
padding: 48px;
|
|
132
|
+
border-radius: 12px;
|
|
133
|
+
box-shadow: var(--panel-shadow);
|
|
134
|
+
}
|
|
135
|
+
.cmp .cmp-before { background: var(--panel-2); }
|
|
136
|
+
.cmp .cmp-after { background: var(--panel-accent); color: var(--panel-accent-fg); }
|
|
137
|
+
.cmp .cmp-l {
|
|
138
|
+
font-family: var(--ff-mono);
|
|
139
|
+
font-size: 22px;
|
|
140
|
+
text-transform: uppercase;
|
|
141
|
+
letter-spacing: 0.14em;
|
|
142
|
+
margin-bottom: 24px;
|
|
143
|
+
color: var(--panel-text-3);
|
|
144
|
+
}
|
|
145
|
+
.cmp .cmp-after .cmp-l { color: var(--panel-accent-fg); opacity: 0.8; }
|
|
146
|
+
.cmp .cmp-h {
|
|
147
|
+
font-family: var(--ff-display);
|
|
148
|
+
font-size: 96px;
|
|
149
|
+
line-height: 1;
|
|
150
|
+
letter-spacing: -0.02em;
|
|
151
|
+
margin-bottom: 16px;
|
|
152
|
+
color: var(--panel-text-3);
|
|
153
|
+
font-weight: 700;
|
|
154
|
+
}
|
|
155
|
+
.cmp .cmp-after .cmp-h { color: var(--panel-accent-fg); }
|
|
156
|
+
.cmp .cmp-p {
|
|
157
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
158
|
+
font-size: 28px;
|
|
159
|
+
line-height: 1.45;
|
|
160
|
+
color: var(--panel-text-3);
|
|
161
|
+
}
|
|
162
|
+
.cmp .cmp-after .cmp-p { color: var(--panel-accent-fg); opacity: 0.92; }
|
|
163
|
+
|
|
164
|
+
.receipt {
|
|
165
|
+
font-family: var(--ff-mono);
|
|
166
|
+
font-size: 28px;
|
|
167
|
+
max-width: 900px;
|
|
168
|
+
background: var(--panel-2);
|
|
169
|
+
border-radius: 12px;
|
|
170
|
+
padding: 28px 36px;
|
|
171
|
+
box-shadow: var(--panel-shadow);
|
|
172
|
+
}
|
|
173
|
+
.receipt-row {
|
|
174
|
+
display: flex;
|
|
175
|
+
gap: 24px;
|
|
176
|
+
padding: 10px 0;
|
|
177
|
+
align-items: baseline;
|
|
178
|
+
}
|
|
179
|
+
.receipt-row > span:nth-child(1) {
|
|
180
|
+
text-transform: uppercase;
|
|
181
|
+
letter-spacing: 0.14em;
|
|
182
|
+
font-size: 22px;
|
|
183
|
+
width: 320px;
|
|
184
|
+
flex-shrink: 0;
|
|
185
|
+
color: var(--panel-text-2);
|
|
186
|
+
}
|
|
187
|
+
.receipt-row > span:nth-child(2) {
|
|
188
|
+
flex: 1;
|
|
189
|
+
text-align: right;
|
|
190
|
+
color: var(--panel-text);
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
193
|
+
<script type="module" src="deck-stage.js"></script>
|
|
194
|
+
</head>
|
|
195
|
+
<body>
|
|
196
|
+
<deck-stage width="1920" height="1080">
|
|
197
|
+
|
|
198
|
+
<section class="s-elev" data-label="Title">
|
|
199
|
+
<div class="s-dateline"><span>247420 // an entrypoint</span><span class="spread"></span><span>apr 20 · 2026 · live</span></div>
|
|
200
|
+
<div>
|
|
201
|
+
<div class="s-label" style="margin-bottom:24px">// internal · do not circulate</div>
|
|
202
|
+
<div class="s-hero">we fart in its<br/>general direction.</div>
|
|
203
|
+
<div class="s-sub">a short presentation about what comes next, delivered at 4:20 sharp.</div>
|
|
204
|
+
</div>
|
|
205
|
+
<div class="s-footer"><span>deck 001</span><span>247420 / mmxxvi</span></div>
|
|
206
|
+
</section>
|
|
207
|
+
|
|
208
|
+
<section data-label="Section Intro">
|
|
209
|
+
<div class="s-dateline"><span>247420</span><span>§ 01</span><span class="spread"></span><span>of 05</span></div>
|
|
210
|
+
<div>
|
|
211
|
+
<div class="s-label" style="margin-bottom:32px">chapter one</div>
|
|
212
|
+
<div class="s-h1">the problem<br/>with everything.</div>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="s-footer"><span>chapter</span><span>the problem</span></div>
|
|
215
|
+
</section>
|
|
216
|
+
|
|
217
|
+
<section class="s-canvas" data-label="Big Quote">
|
|
218
|
+
<div class="s-dateline"><span>247420</span><span>§ quote</span><span class="spread"></span><span>overheard · 2am</span></div>
|
|
219
|
+
<div style="display:flex;align-items:center;height:100%">
|
|
220
|
+
<div>
|
|
221
|
+
<div style="font-family:var(--ff-display);font-size:240px;line-height:0.8;margin-bottom:-40px;color:var(--panel-accent)">“</div>
|
|
222
|
+
<div class="s-quote">we make things. some of them work. a few become the future.</div>
|
|
223
|
+
<div class="s-label" style="margin-top:48px;color:var(--panel-text-3)">— the collective, probably</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div class="s-footer"><span>quote</span><span>the collective</span></div>
|
|
227
|
+
</section>
|
|
228
|
+
|
|
229
|
+
<section class="s-elev" data-label="Receipt">
|
|
230
|
+
<div class="s-dateline"><span>247420</span><span>§ receipt · gm v0.4.1</span><span class="spread"></span><span>live</span></div>
|
|
231
|
+
<div>
|
|
232
|
+
<div class="s-label" style="margin-bottom:32px">// by the numbers</div>
|
|
233
|
+
<div class="receipt">
|
|
234
|
+
<div class="receipt-row"><span>stars</span><span>3,124</span></div>
|
|
235
|
+
<div class="receipt-row"><span>weekly downloads</span><span>47k</span></div>
|
|
236
|
+
<div class="receipt-row"><span>avg session length</span><span>4h 20m (of course)</span></div>
|
|
237
|
+
<div class="receipt-row"><span>runtime dependencies</span><span>0</span></div>
|
|
238
|
+
<div class="receipt-row"><span>lines of code</span><span>1,847</span></div>
|
|
239
|
+
<div class="receipt-row"><span>people who get it</span><span>enough</span></div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="s-footer"><span>receipt</span><span>gm</span></div>
|
|
243
|
+
</section>
|
|
244
|
+
|
|
245
|
+
<section data-label="Comparison">
|
|
246
|
+
<div class="s-dateline"><span>247420</span><span>§ a vs b</span><span class="spread"></span><span>it's not close</span></div>
|
|
247
|
+
<div>
|
|
248
|
+
<div class="cmp">
|
|
249
|
+
<div class="cmp-before">
|
|
250
|
+
<div class="cmp-l">before</div>
|
|
251
|
+
<div class="cmp-h" style="text-decoration:line-through">gradient ripple-ui demo</div>
|
|
252
|
+
<div class="cmp-p">purple to blue. glass cards. emoji rows. a "supercharge your workflow" somewhere in the fold.</div>
|
|
253
|
+
</div>
|
|
254
|
+
<div class="cmp-after">
|
|
255
|
+
<div class="cmp-l">after</div>
|
|
256
|
+
<div class="cmp-h">layered surfaces.<br/>loud content.</div>
|
|
257
|
+
<div class="cmp-p">quiet chrome. monospace labels. you can read it on a phone in direct sunlight. it looks good in dark mode too.</div>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
<div class="s-footer"><span>comparison</span><span>before / after</span></div>
|
|
262
|
+
</section>
|
|
263
|
+
|
|
264
|
+
<section class="s-accent" data-label="End">
|
|
265
|
+
<div class="s-dateline"><span>247420 // an entrypoint</span><span class="spread"></span><span>end · q&a</span></div>
|
|
266
|
+
<div style="display:flex;align-items:center;height:100%">
|
|
267
|
+
<div>
|
|
268
|
+
<div class="s-hero" style="font-size:280px;color:var(--panel-accent-fg)">gm.</div>
|
|
269
|
+
<div style="font-family:var(--ff-mono);font-size:32px;margin-top:32px;color:var(--panel-accent-fg);opacity:0.85">// questions? open a pr.</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
<div class="s-footer"><span>fin</span><span>247420 / mmxxvi</span></div>
|
|
273
|
+
</section>
|
|
274
|
+
|
|
275
|
+
</deck-stage>
|
|
276
|
+
</body></html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// mountKit — single entry every ui_kit uses. Installs motion, runs
|
|
2
|
+
// applyDiff, registers a debug snapshot.
|
|
3
|
+
|
|
4
|
+
import * as webjsx from '../vendor/webjsx/index.js';
|
|
5
|
+
import * as motion from './motion.js';
|
|
6
|
+
import { register } from './debug.js';
|
|
7
|
+
|
|
8
|
+
export function mountKit({ root, view, screen, animateOnMount = true } = {}) {
|
|
9
|
+
if (!root) throw new Error('mountKit: root required');
|
|
10
|
+
if (typeof view !== 'function') throw new Error('mountKit: view fn required');
|
|
11
|
+
if (screen && typeof document !== 'undefined') document.body.dataset.screenLabel = screen;
|
|
12
|
+
motion.installMotion();
|
|
13
|
+
let scheduled = false;
|
|
14
|
+
const render = () => {
|
|
15
|
+
scheduled = false;
|
|
16
|
+
webjsx.applyDiff(root, view());
|
|
17
|
+
if (animateOnMount) requestAnimationFrame(() => motion.animateTree(root));
|
|
18
|
+
};
|
|
19
|
+
const schedule = () => { if (scheduled) return; scheduled = true; queueMicrotask(render); };
|
|
20
|
+
register('bootstrap', () => ({ screen: screen || null, mounted: !!root.firstChild, root: root.id || root.tagName }));
|
|
21
|
+
render();
|
|
22
|
+
return { render, schedule };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { webjsx };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// Chat surface — matches upstream signatures (parts, typing, reactions,
|
|
2
|
+
// receipts, aicat). Pure factories — props in, vnode out.
|
|
3
|
+
// Includes ChatMessage, ChatComposer, Chat, AICat, AICatPortrait.
|
|
4
|
+
|
|
5
|
+
import * as webjsx from '../../vendor/webjsx/index.js';
|
|
6
|
+
import { renderMarkdown, ensureReady as ensureMarkdownReady } from '../markdown.js';
|
|
7
|
+
import { highlightAllUnder, ensurePrism } from '../highlight.js';
|
|
8
|
+
import { register } from '../debug.js';
|
|
9
|
+
|
|
10
|
+
const h = webjsx.createElement;
|
|
11
|
+
let _stats = { messages: 0, lastKindCounts: {} };
|
|
12
|
+
|
|
13
|
+
export function fmtBytes(n) {
|
|
14
|
+
if (n == null) return '';
|
|
15
|
+
if (n < 1024) return n + ' B';
|
|
16
|
+
if (n < 1024 * 1024) return (n / 1024).toFixed(1) + ' KB';
|
|
17
|
+
if (n < 1024 * 1024 * 1024) return (n / (1024 * 1024)).toFixed(1) + ' MB';
|
|
18
|
+
return (n / (1024 * 1024 * 1024)).toFixed(2) + ' GB';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Inline-only markdown subset; safe for chat bubbles.
|
|
22
|
+
export function renderInline(text) {
|
|
23
|
+
if (text == null) return [];
|
|
24
|
+
const out = [];
|
|
25
|
+
const re = /(\*\*([^*]+)\*\*|\*([^*]+)\*|`([^`]+)`|\[([^\]]+)\]\(([^)]+)\))/g;
|
|
26
|
+
let last = 0; let m; let i = 0;
|
|
27
|
+
const push = (n) => out.push(n);
|
|
28
|
+
while ((m = re.exec(text)) !== null) {
|
|
29
|
+
if (m.index > last) push(h('span', { key: 's' + i + 'a' }, text.slice(last, m.index)));
|
|
30
|
+
if (m[2] != null) push(h('strong', { key: 's' + i }, m[2]));
|
|
31
|
+
else if (m[3] != null) push(h('em', { key: 's' + i }, m[3]));
|
|
32
|
+
else if (m[4] != null) push(h('code', { key: 's' + i, class: 'chat-tick' }, m[4]));
|
|
33
|
+
else if (m[5] != null) push(h('a', { key: 's' + i, href: m[6], target: '_blank', rel: 'noopener' }, m[5]));
|
|
34
|
+
last = m.index + m[0].length; i += 1;
|
|
35
|
+
}
|
|
36
|
+
if (last < text.length) push(h('span', { key: 's' + i + 'a' }, text.slice(last)));
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const FILE_GLYPHS = { pdf: '▤', zip: '▦', tar: '▦', gz: '▦', mp4: '▶', mp3: '♪', wav: '♪', csv: '⊞', json: '{}', md: '§', txt: '§', default: '◫' };
|
|
41
|
+
function fileGlyph(name) {
|
|
42
|
+
const ext = String(name || '').split('.').pop().toLowerCase();
|
|
43
|
+
return FILE_GLYPHS[ext] || FILE_GLYPHS.default;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function MdNode(p) {
|
|
47
|
+
const refSink = (el) => {
|
|
48
|
+
if (!el) return;
|
|
49
|
+
if (el.dataset.mdSrc === p.text) return;
|
|
50
|
+
el.dataset.mdSrc = p.text || '';
|
|
51
|
+
ensureMarkdownReady().then(() => renderMarkdown(p.text || '')).then((html) => { el.innerHTML = html; });
|
|
52
|
+
};
|
|
53
|
+
return h('div', { class: 'chat-bubble chat-md', ref: refSink });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function CodeNode(p) {
|
|
57
|
+
const refSink = (el) => {
|
|
58
|
+
if (!el) return;
|
|
59
|
+
if (el.dataset.codeKey === (p.lang || '') + '|' + (p.code || '').length) return;
|
|
60
|
+
el.dataset.codeKey = (p.lang || '') + '|' + (p.code || '').length;
|
|
61
|
+
ensurePrism().then(() => highlightAllUnder(el));
|
|
62
|
+
};
|
|
63
|
+
return h('div', { class: 'chat-bubble chat-code', ref: refSink },
|
|
64
|
+
h('div', { class: 'chat-code-head' },
|
|
65
|
+
h('span', { class: 'lang' }, p.lang || 'code'),
|
|
66
|
+
p.filename ? h('span', { class: 'name' }, p.filename) : null
|
|
67
|
+
),
|
|
68
|
+
h('pre', {}, h('code', { class: p.lang ? 'lang-' + p.lang + ' language-' + p.lang : '' }, p.code || ''))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const PART_RENDERERS = {
|
|
73
|
+
text: (p) => h('div', { class: 'chat-bubble' }, ...renderInline(p.text || '')),
|
|
74
|
+
md: (p) => MdNode(p),
|
|
75
|
+
code: (p) => CodeNode(p),
|
|
76
|
+
image: (p) => h('a', { class: 'chat-image', href: p.href || p.src, target: '_blank', rel: 'noopener' },
|
|
77
|
+
h('img', { src: p.src, alt: p.alt || '', loading: 'lazy' }),
|
|
78
|
+
p.caption ? h('span', { class: 'cap' }, p.caption) : null),
|
|
79
|
+
pdf: (p) => h('div', { class: 'chat-pdf' },
|
|
80
|
+
h('div', { class: 'chat-pdf-head' },
|
|
81
|
+
h('span', { class: 'glyph' }, '▤'),
|
|
82
|
+
h('span', { class: 'name' }, p.name || 'document.pdf'),
|
|
83
|
+
p.size != null ? h('span', { class: 'size' }, fmtBytes(p.size)) : null,
|
|
84
|
+
h('a', { class: 'open', href: p.src, target: '_blank', rel: 'noopener' }, 'open ↗')
|
|
85
|
+
),
|
|
86
|
+
h('embed', { src: p.src, type: 'application/pdf' })),
|
|
87
|
+
file: (p) => h('a', { class: 'chat-file', href: p.src, target: '_blank', rel: 'noopener', download: p.name || true },
|
|
88
|
+
h('span', { class: 'glyph' }, fileGlyph(p.name)),
|
|
89
|
+
h('span', { class: 'meta' },
|
|
90
|
+
h('span', { class: 'name' }, p.name || 'attachment'),
|
|
91
|
+
h('span', { class: 'size' }, [p.kindLabel || (p.name || '').split('.').pop().toUpperCase(), p.size != null ? fmtBytes(p.size) : null].filter(Boolean).join(' · '))
|
|
92
|
+
),
|
|
93
|
+
h('span', { class: 'go' }, '↓')),
|
|
94
|
+
link: (p) => h('a', { class: 'chat-link', href: p.href, target: '_blank', rel: 'noopener' },
|
|
95
|
+
p.thumb ? h('img', { class: 'thumb', src: p.thumb, alt: '' }) : null,
|
|
96
|
+
h('span', { class: 'meta' },
|
|
97
|
+
h('span', { class: 'host' }, p.host || (() => { try { return new URL(p.href).host; } catch { return ''; } })()),
|
|
98
|
+
h('span', { class: 'title' }, p.title || p.href),
|
|
99
|
+
p.desc ? h('span', { class: 'desc' }, p.desc) : null
|
|
100
|
+
))
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
function renderPart(p, key) {
|
|
104
|
+
const fn = PART_RENDERERS[p.kind] || PART_RENDERERS.text;
|
|
105
|
+
const node = fn(p);
|
|
106
|
+
if (node && typeof node === 'object') node.props = { ...(node.props || {}), key: 'p' + key };
|
|
107
|
+
_stats.lastKindCounts[p.kind] = (_stats.lastKindCounts[p.kind] || 0) + 1;
|
|
108
|
+
return node;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function ChatMessage({ who = 'them', avatar, text, parts, time, typing, key, aicat, reactions, receipt, name }) {
|
|
112
|
+
_stats.messages += 1;
|
|
113
|
+
const cls = 'chat-msg ' + who + (aicat && who === 'them' ? ' aicat' : '');
|
|
114
|
+
const av = h('span', { class: 'chat-avatar' }, avatar || (who === 'you' ? 'u' : '?'));
|
|
115
|
+
let bodyNodes;
|
|
116
|
+
if (typing) bodyNodes = [h('span', { class: 'chat-typing', key: 'typ' }, h('span'), h('span'), h('span'))];
|
|
117
|
+
else if (parts && parts.length) bodyNodes = parts.map((p, i) => renderPart(p, i));
|
|
118
|
+
else bodyNodes = [h('div', { class: 'chat-bubble', key: 't' }, ...renderInline(text || ''))];
|
|
119
|
+
const reactionRow = reactions && reactions.length
|
|
120
|
+
? h('div', { class: 'chat-reactions' },
|
|
121
|
+
...reactions.map((r, i) => h('span', { class: 'rxn' + (r.you ? ' you' : ''), key: 'r' + i },
|
|
122
|
+
h('span', { class: 'e' }, r.emoji), h('span', { class: 'n' }, String(r.count)))))
|
|
123
|
+
: null;
|
|
124
|
+
const tickNode = who === 'you' && receipt
|
|
125
|
+
? h('span', { class: 'tick' + (receipt === 'read' ? ' read' : '') }, receipt === 'read' ? '✓✓' : '✓')
|
|
126
|
+
: null;
|
|
127
|
+
const metaItems = [];
|
|
128
|
+
if (name && who === 'them') metaItems.push(h('span', { class: 'who', key: 'w' }, name));
|
|
129
|
+
if (time) metaItems.push(h('span', { class: 't', key: 'ti' }, time));
|
|
130
|
+
if (tickNode) metaItems.push(tickNode);
|
|
131
|
+
const meta = metaItems.length ? h('div', { class: 'chat-meta' }, ...metaItems) : null;
|
|
132
|
+
const stack = h('div', { class: 'chat-stack' }, ...bodyNodes, reactionRow, meta);
|
|
133
|
+
return h('div', { key, class: cls }, who === 'you' ? stack : av, who === 'you' ? av : stack);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function ChatComposer({ value, onInput, onSend, placeholder = 'message…', disabled }) {
|
|
137
|
+
const send = () => {
|
|
138
|
+
const v = (value || '').trim();
|
|
139
|
+
if (!v || disabled) return;
|
|
140
|
+
if (onSend) onSend(v);
|
|
141
|
+
};
|
|
142
|
+
return h('div', { class: 'chat-composer' },
|
|
143
|
+
h('textarea', { value: value || '', placeholder, rows: 1,
|
|
144
|
+
oninput: (e) => onInput && onInput(e.target.value),
|
|
145
|
+
onkeydown: (e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); } } }),
|
|
146
|
+
h('button', { class: 'send', disabled: disabled || !(value && value.trim()), onclick: send }, '↑')
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function Chat({ title = 'chat', sub, messages = [], composer, header } = {}) {
|
|
151
|
+
return h('div', { class: 'chat' },
|
|
152
|
+
header || h('div', { class: 'chat-head' },
|
|
153
|
+
h('span', { class: 'dot' }),
|
|
154
|
+
h('span', {}, title),
|
|
155
|
+
sub ? h('span', { class: 'sub' }, ' · ' + sub) : null,
|
|
156
|
+
h('span', { class: 'spread' }),
|
|
157
|
+
h('span', { class: 'sub' }, String(messages.length).padStart(2, '0') + ' msgs')
|
|
158
|
+
),
|
|
159
|
+
h('div', { class: 'chat-thread' },
|
|
160
|
+
...messages.map((m, i) => ChatMessage({ ...m, key: m.key != null ? m.key : i }))
|
|
161
|
+
),
|
|
162
|
+
composer || null
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export const AICAT_FACE = ` /\\_/\\\n( o.o )\n > ^ <`;
|
|
167
|
+
|
|
168
|
+
export function AICatPortrait({ name = 'aicat', status = 'idle', face } = {}) {
|
|
169
|
+
return h('div', { class: 'aicat-portrait' },
|
|
170
|
+
h('pre', { class: 'aicat-face' }, face || AICAT_FACE),
|
|
171
|
+
h('div', { class: 'aicat-meta' },
|
|
172
|
+
h('span', { class: 'name' }, name),
|
|
173
|
+
h('span', { class: 'status' }, h('span', { class: 'dot' }, '● '), status)
|
|
174
|
+
)
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function AICat({ name = 'aicat', messages = [], thinking, composer, status = 'online · purring' } = {}) {
|
|
179
|
+
const annotated = messages.map((m) =>
|
|
180
|
+
m.who === 'them' ? { ...m, aicat: true, avatar: m.avatar || '=^.^=' } : m);
|
|
181
|
+
const all = thinking
|
|
182
|
+
? [...annotated, { who: 'them', aicat: true, avatar: '=^.^=', typing: true, key: '_thinking' }]
|
|
183
|
+
: annotated;
|
|
184
|
+
return h('div', { class: 'chat' },
|
|
185
|
+
h('div', { class: 'chat-head' },
|
|
186
|
+
h('span', { class: 'dot' }),
|
|
187
|
+
h('span', {}, name),
|
|
188
|
+
h('span', { class: 'sub' }, ' · ' + status),
|
|
189
|
+
h('span', { class: 'spread' }),
|
|
190
|
+
h('span', { class: 'sub' }, String(messages.length).padStart(2, '0') + ' turns')
|
|
191
|
+
),
|
|
192
|
+
h('div', { class: 'chat-thread' },
|
|
193
|
+
...all.map((m, i) => ChatMessage({ ...m, key: m.key != null ? m.key : i }))
|
|
194
|
+
),
|
|
195
|
+
composer || null
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
register('chat', () => ({ messages: _stats.messages, lastKindCounts: { ..._stats.lastKindCounts } }));
|