@bigmistqke/whiteboard 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/LICENSE +21 -0
- package/README.md +609 -2
- package/bin/whiteboard.ts +431 -0
- package/dist/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/taggedTemplateLiteral.js +5 -0
- package/dist/bin/whiteboard.js +471 -0
- package/dist/client/runtime.js +391 -0
- package/dist/define.js +7 -0
- package/dist/plugins/callout/README.md +13 -0
- package/dist/plugins/callout/index.js +27 -0
- package/dist/plugins/callout/style.css +12 -0
- package/dist/plugins/chat/README.md +45 -0
- package/dist/plugins/chat/client.js +3 -0
- package/dist/plugins/chat/index.js +46 -0
- package/dist/plugins/chat/style.css +17 -0
- package/dist/plugins/claude-code/index.js +120 -0
- package/dist/plugins/code/README.md +42 -0
- package/dist/plugins/code/diff.js +64 -0
- package/dist/plugins/code/index.js +77 -0
- package/dist/plugins/code/style.css +29 -0
- package/dist/plugins/comments/client.js +10 -0
- package/dist/plugins/comments/index.js +51 -0
- package/dist/plugins/comments/style.css +32 -0
- package/dist/plugins/details/README.md +17 -0
- package/dist/plugins/details/index.js +17 -0
- package/dist/plugins/details/style.css +3 -0
- package/dist/plugins/form/README.md +111 -0
- package/dist/plugins/form/index.js +102 -0
- package/dist/plugins/form/style.css +41 -0
- package/dist/plugins/gallery/README.md +30 -0
- package/dist/plugins/gallery/client.js +1 -0
- package/dist/plugins/gallery/index.js +74 -0
- package/dist/plugins/gallery/style.css +27 -0
- package/dist/plugins/grid/README.md +33 -0
- package/dist/plugins/grid/index.js +33 -0
- package/dist/plugins/grid/style.css +25 -0
- package/dist/plugins/index.js +26 -0
- package/dist/plugins/mermaid/README.md +21 -0
- package/dist/plugins/mermaid/index.js +34 -0
- package/dist/plugins/mermaid/style.css +16 -0
- package/dist/plugins/quiet/README.md +26 -0
- package/dist/plugins/quiet/index.js +17 -0
- package/dist/plugins/terminal/client.js +41 -0
- package/dist/plugins/terminal/host.js +332 -0
- package/dist/plugins/terminal/index.js +171 -0
- package/dist/plugins/terminal/modes.js +32 -0
- package/dist/plugins/terminal/server.js +256 -0
- package/dist/plugins/terminal/sizes.js +57 -0
- package/dist/plugins/terminal/style.css +357 -0
- package/dist/solid/index.js +35 -0
- package/dist/src/auth.js +54 -0
- package/dist/src/client/page/base.css +274 -0
- package/dist/src/client/page/main.js +1004 -0
- package/dist/src/config.js +76 -0
- package/dist/src/events.js +162 -0
- package/dist/src/html.js +34 -0
- package/dist/src/load.js +77 -0
- package/dist/src/loader.js +120 -0
- package/dist/src/package.js +33 -0
- package/dist/src/pages/blocks.js +49 -0
- package/dist/src/pages/index.js +14 -0
- package/dist/src/pages/markdown.js +307 -0
- package/dist/src/pages/render.js +257 -0
- package/dist/src/plugins.js +238 -0
- package/dist/src/running.js +24 -0
- package/dist/src/serve.js +71 -0
- package/dist/src/server.js +700 -0
- package/dist/src/status.js +43 -0
- package/package.json +131 -4
- package/plugins/callout/README.md +13 -0
- package/plugins/callout/index.ts +25 -0
- package/plugins/callout/style.css +12 -0
- package/plugins/chat/README.md +45 -0
- package/plugins/chat/autosize.ts +101 -0
- package/plugins/chat/client.tsx +81 -0
- package/plugins/chat/index.ts +61 -0
- package/plugins/chat/style.css +17 -0
- package/plugins/claude-code/index.ts +136 -0
- package/plugins/code/README.md +42 -0
- package/plugins/code/diff.ts +58 -0
- package/plugins/code/index.ts +94 -0
- package/plugins/code/style.css +29 -0
- package/plugins/comments/client.ts +448 -0
- package/plugins/comments/index.ts +52 -0
- package/plugins/comments/style.css +32 -0
- package/plugins/details/README.md +17 -0
- package/plugins/details/index.ts +21 -0
- package/plugins/details/style.css +3 -0
- package/plugins/form/README.md +111 -0
- package/plugins/form/index.ts +104 -0
- package/plugins/form/style.css +41 -0
- package/plugins/gallery/README.md +30 -0
- package/plugins/gallery/client.tsx +64 -0
- package/plugins/gallery/index.ts +67 -0
- package/plugins/gallery/style.css +27 -0
- package/plugins/grid/README.md +33 -0
- package/plugins/grid/index.ts +36 -0
- package/plugins/grid/style.css +25 -0
- package/plugins/index.ts +19 -0
- package/plugins/mermaid/README.md +21 -0
- package/plugins/mermaid/index.ts +39 -0
- package/plugins/mermaid/style.css +16 -0
- package/plugins/quiet/README.md +26 -0
- package/plugins/quiet/index.ts +27 -0
- package/plugins/terminal/client.ts +317 -0
- package/plugins/terminal/host.ts +326 -0
- package/plugins/terminal/index.ts +138 -0
- package/plugins/terminal/modes.ts +30 -0
- package/plugins/terminal/server.ts +215 -0
- package/plugins/terminal/sizes.ts +60 -0
- package/plugins/terminal/style.css +71 -0
- package/skills/whiteboard/SKILL.md +292 -0
- package/solid/index.tsx +56 -0
- package/src/auth.ts +66 -0
- package/src/client/forms.ts +186 -0
- package/src/client/page/base.css +274 -0
- package/src/client/page/fresh.ts +205 -0
- package/src/client/page/main.ts +249 -0
- package/src/client/page/orphans.ts +46 -0
- package/src/client/page/theme.ts +32 -0
- package/src/client/page/view.ts +9 -0
- package/src/client/page/waiting.ts +109 -0
- package/src/client/runtime.ts +170 -0
- package/src/config.ts +96 -0
- package/src/define.ts +546 -0
- package/src/events.ts +194 -0
- package/src/html.ts +40 -0
- package/src/load.ts +89 -0
- package/src/loader.ts +109 -0
- package/src/package.ts +39 -0
- package/src/pages/blocks.ts +67 -0
- package/src/pages/index.ts +36 -0
- package/src/pages/markdown.ts +276 -0
- package/src/pages/render.ts +196 -0
- package/src/plugins.ts +197 -0
- package/src/running.ts +22 -0
- package/src/serve.ts +52 -0
- package/src/server.ts +644 -0
- package/src/status.ts +69 -0
package/dist/src/auth.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import crypto from "node:crypto";
|
|
4
|
+
// src/auth.ts
|
|
5
|
+
const COOKIE = "wb-token";
|
|
6
|
+
/** The project's token, made on first use. */
|
|
7
|
+
function projectToken(wb) {
|
|
8
|
+
const file = path.join(wb, "token");
|
|
9
|
+
try {
|
|
10
|
+
return fs.readFileSync(file, "utf8").trim();
|
|
11
|
+
} catch {}
|
|
12
|
+
const token = crypto.randomBytes(24).toString("base64url");
|
|
13
|
+
fs.writeFileSync(file, token + "\n", { mode: 384 });
|
|
14
|
+
return token;
|
|
15
|
+
}
|
|
16
|
+
function createAuth(wb) {
|
|
17
|
+
const token = projectToken(wb);
|
|
18
|
+
const same = (a, b) => typeof a === "string" && a.length === b.length && crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b));
|
|
19
|
+
const cookies = (req) => Object.fromEntries((req.headers.cookie ?? "").split(";").map((c) => c.trim().split("=")).filter(([k]) => k));
|
|
20
|
+
/** Has this request the token, from this origin? */
|
|
21
|
+
function authorized(req) {
|
|
22
|
+
const jar = cookies(req);
|
|
23
|
+
if (!(same(jar[COOKIE], token) || same(req.headers["x-whiteboard-token"], token))) return false;
|
|
24
|
+
const origin = req.headers.origin;
|
|
25
|
+
if (origin && !/^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(origin)) return false;
|
|
26
|
+
const site = req.headers["sec-fetch-site"];
|
|
27
|
+
if (site && site !== "same-origin" && site !== "none" && !opensPage(req)) return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
/** Opening a page as the tab's document: no frame, no fetch, and not an API route. */
|
|
31
|
+
const opensPage = (req) => req.method === "GET" && req.headers["sec-fetch-mode"] === "navigate" && req.headers["sec-fetch-dest"] === "document" && !(req.url ?? "").startsWith("/api/");
|
|
32
|
+
/** The /_/auth route; false for any other path. */
|
|
33
|
+
function handle(req, res, p, q) {
|
|
34
|
+
if (p !== "/_/auth") return false;
|
|
35
|
+
if (!same(q.token, token)) {
|
|
36
|
+
res.writeHead(403, { "content-type": "text/plain" });
|
|
37
|
+
res.end("wrong token");
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
const to = typeof q.to === "string" && q.to.startsWith("/") && !q.to.startsWith("//") ? q.to : "/";
|
|
41
|
+
res.writeHead(302, {
|
|
42
|
+
"set-cookie": `${COOKIE}=${token}; Path=/; HttpOnly; SameSite=Lax; Max-Age=31536000`,
|
|
43
|
+
location: to
|
|
44
|
+
});
|
|
45
|
+
res.end();
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
authorized,
|
|
50
|
+
handle,
|
|
51
|
+
token
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export { createAuth, projectToken };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/* Base page style: an article, set for reading. Blocks bring their own style.css;
|
|
2
|
+
<root>/style.css is loaded after this file to override anything here.
|
|
3
|
+
|
|
4
|
+
Theme: follows the system unless <html data-theme="light|dark"> is set (the nav toggle). */
|
|
5
|
+
:root {
|
|
6
|
+
--bg: #fdfdfc; --surface: #ffffff; --text: #1b1c1e; --muted: #696e76; --border: #e3e5e9;
|
|
7
|
+
--accent: #1d5bbf; --accent-text: #ffffff; --code-bg: #f2f3f5; --tint: #f6f7f9;
|
|
8
|
+
--ok: #1a7a49; --warn: #6b4fc0; --bad: #c4352b; --info: #1d5bbf;
|
|
9
|
+
--radius: 8px; --shadow: none;
|
|
10
|
+
--serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
|
|
11
|
+
--sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
|
|
12
|
+
--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
|
|
13
|
+
--measure: 680px;
|
|
14
|
+
--wide: 1040px;
|
|
15
|
+
--figure: 920px;
|
|
16
|
+
color-scheme: light;
|
|
17
|
+
}
|
|
18
|
+
@media (prefers-color-scheme: dark) {
|
|
19
|
+
:root:not([data-theme="light"]) {
|
|
20
|
+
--bg: #131417; --surface: #191a1e; --text: #e4e5e7; --muted: #979ca5; --border: #2b2e34;
|
|
21
|
+
--accent: #82aaff; --accent-text: #0d1220; --code-bg: #1e2026; --tint: #1a1c21;
|
|
22
|
+
--ok: #57c48c; --warn: #b4a0ff; --bad: #ff6f66; --info: #82aaff;
|
|
23
|
+
color-scheme: dark;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
:root[data-theme="dark"] {
|
|
27
|
+
--bg: #131417; --surface: #191a1e; --text: #e4e5e7; --muted: #979ca5; --border: #2b2e34;
|
|
28
|
+
--accent: #82aaff; --accent-text: #0d1220; --code-bg: #1e2026; --tint: #1a1c21;
|
|
29
|
+
--ok: #57c48c; --warn: #b4a0ff; --bad: #ff6f66; --info: #82aaff;
|
|
30
|
+
color-scheme: dark;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
* { box-sizing: border-box; }
|
|
34
|
+
html { -webkit-text-size-adjust: 100%; }
|
|
35
|
+
body {
|
|
36
|
+
margin: 0; background: var(--bg); color: var(--text);
|
|
37
|
+
font: 19px/1.72 var(--serif);
|
|
38
|
+
font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums;
|
|
39
|
+
text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
|
|
40
|
+
}
|
|
41
|
+
/* The column: headings sit on its left edge, everything else is indented by --indent, and section
|
|
42
|
+
numbers hang in the margin left of the headings. */
|
|
43
|
+
main { --indent: 34px; max-width: calc(var(--measure) + var(--indent) + 32px); margin: 0 auto; padding: 120px 16px 220px; }
|
|
44
|
+
main > :first-child { margin-top: 0; }
|
|
45
|
+
#wb-main > :not(h1, h2, h3, h4, h5, h6, hr, .wb-wide, .wb-island:has(.wb-wide), figure, .wb-figure, p:has(> img:only-child), p:has(> a:only-child > img:only-child)) { margin-left: var(--indent); }
|
|
46
|
+
#wb-main > :is(h1, h2, h3, h4) + * { margin-top: 0; }
|
|
47
|
+
|
|
48
|
+
/* text */
|
|
49
|
+
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
|
|
50
|
+
a:hover { text-decoration-color: currentColor; }
|
|
51
|
+
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
|
|
52
|
+
h1 { font-size: 2.9rem; line-height: 1.08; margin: 0 0 1.1em; letter-spacing: -0.022em; }
|
|
53
|
+
h2 { font-size: 1.62rem; margin: 4.6em 0 1.5em; }
|
|
54
|
+
h3 { font-size: 1.2rem; margin: 3.4em 0 1.2em; }
|
|
55
|
+
#wb-main > h3 { font-style: italic; } /* section headings only; card titles stay upright */
|
|
56
|
+
h4 { font: 600 .74rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 3em 0 1.1em; }
|
|
57
|
+
p, ul, ol, blockquote, pre, table { margin: 0 0 2.2em; }
|
|
58
|
+
p { margin-bottom: 2.4em; }
|
|
59
|
+
p { text-wrap: pretty; hyphens: auto; }
|
|
60
|
+
ul, ol { padding-left: 1.4em; }
|
|
61
|
+
li::marker { color: var(--muted); }
|
|
62
|
+
li + li { margin-top: .8em; }
|
|
63
|
+
li > p { margin-bottom: .8em; }
|
|
64
|
+
strong { font-weight: 650; }
|
|
65
|
+
img, video { max-width: 100%; height: auto; border-radius: 4px; }
|
|
66
|
+
figure { margin: 3.6em 0; }
|
|
67
|
+
figcaption { font: italic .9rem/1.5 var(--serif); color: var(--muted); margin-top: .7em; }
|
|
68
|
+
code { font: .82em/1.5 var(--mono); background: var(--code-bg); padding: .12em .35em; border-radius: 4px; }
|
|
69
|
+
pre { margin: 3em 0; background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: .92rem; line-height: 1.55; }
|
|
70
|
+
pre code { background: none; padding: 0; font-size: .82rem; }
|
|
71
|
+
table { margin: 3em 0; border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font: .88rem/1.5 var(--sans); }
|
|
72
|
+
th, td { border-bottom: 1px solid var(--border); padding: 7px 12px 7px 0; text-align: left; vertical-align: top; }
|
|
73
|
+
th { font-weight: 600; color: var(--muted); }
|
|
74
|
+
li:has(> input[type=checkbox]) { list-style: none; margin-left: -1.4em; }
|
|
75
|
+
li > input[type=checkbox] { margin-right: 8px; }
|
|
76
|
+
|
|
77
|
+
/* standfirst: the paragraph right under the title introduces the piece */
|
|
78
|
+
#wb-main > h1 + p {
|
|
79
|
+
font-size: 1.24em; line-height: 1.5; color: color-mix(in srgb, var(--text) 72%, var(--bg));
|
|
80
|
+
margin-bottom: 3.6em; padding-bottom: 2.6em; border-bottom: 1px solid var(--border);
|
|
81
|
+
}
|
|
82
|
+
/* pull quote */
|
|
83
|
+
blockquote {
|
|
84
|
+
margin: 3.4em 0; padding: 0 0 0 1em; border-left: 2px solid var(--text);
|
|
85
|
+
font-size: 1.24em; line-height: 1.45; font-style: italic; color: var(--text);
|
|
86
|
+
}
|
|
87
|
+
blockquote > :last-child { margin-bottom: 0; }
|
|
88
|
+
/* a section break: an asterism instead of a rule */
|
|
89
|
+
hr { border: 0; margin: 4.6em 0; text-align: center; height: auto; }
|
|
90
|
+
hr::after { content: "⁂"; font-size: 1.1em; color: var(--muted); letter-spacing: .3em; }
|
|
91
|
+
|
|
92
|
+
/* section numbers hanging in the margin: 1, 1.1, 1.1.1, in italic oldstyle figures. Only the
|
|
93
|
+
page's own headings (direct children of main), so headings inside cards stay unnumbered. The
|
|
94
|
+
number is an inline-block pulled into the margin, so it shares the heading's baseline. */
|
|
95
|
+
#wb-main { counter-reset: h2; }
|
|
96
|
+
#wb-main > h2 { counter-increment: h2; counter-reset: h3; }
|
|
97
|
+
#wb-main > h3 { counter-increment: h3; counter-reset: h4; }
|
|
98
|
+
#wb-main > h4 { counter-increment: h4; }
|
|
99
|
+
#wb-main > :is(h2, h3, h4)::before {
|
|
100
|
+
display: inline-block; box-sizing: content-box; width: 64px; margin-left: -86px; margin-right: 22px; text-align: right;
|
|
101
|
+
font-family: var(--serif); font-style: italic; font-weight: 400; font-variant-numeric: oldstyle-nums tabular-nums;
|
|
102
|
+
color: var(--muted); letter-spacing: 0; text-transform: none; white-space: nowrap;
|
|
103
|
+
}
|
|
104
|
+
#wb-main > h2::before { content: counter(h2); font-size: .82em; }
|
|
105
|
+
#wb-main > h3::before { content: counter(h2) "." counter(h3); font-size: .88em; }
|
|
106
|
+
#wb-main > h4::before { content: counter(h2) "." counter(h3) "." counter(h4); font-size: 1.3em; }
|
|
107
|
+
/* no margin to hang them in: set the number in front of the heading, and indent less */
|
|
108
|
+
@media (max-width: 860px) {
|
|
109
|
+
main { --indent: 0px; }
|
|
110
|
+
#wb-main > :is(h2, h3, h4)::before { width: auto; margin-left: 0; margin-right: .6em; text-align: left; }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* a <details>: a quiet, collapsible section rather than a box */
|
|
114
|
+
details { margin: 3.2em 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
|
115
|
+
details + details { margin-top: -3.2em; border-top: 0; }
|
|
116
|
+
details > summary {
|
|
117
|
+
cursor: pointer; list-style: none; padding: .95em 0; font: 500 .95rem/1.4 var(--sans); color: var(--text);
|
|
118
|
+
display: flex; gap: .6em; align-items: baseline;
|
|
119
|
+
}
|
|
120
|
+
details > summary::-webkit-details-marker { display: none; }
|
|
121
|
+
details > summary::before { content: "+"; font: 400 1.1em/1 var(--mono); color: var(--muted); width: .8em; flex: none; }
|
|
122
|
+
details[open] > summary::before { content: "−"; }
|
|
123
|
+
details > summary:hover { color: var(--accent); }
|
|
124
|
+
details > :not(summary) { margin-left: 1.4em; }
|
|
125
|
+
details[open] > :last-child { margin-bottom: 2em; }
|
|
126
|
+
|
|
127
|
+
/* figures: an image alone in its paragraph, an HTML <figure>, or anything with .wb-figure (blocks
|
|
128
|
+
opt in) may run wider than the text, up to --figure, centred on the column. Images keep their
|
|
129
|
+
natural size within that. */
|
|
130
|
+
#wb-main > :is(figure, .wb-figure, p:has(> img:only-child), p:has(> a:only-child > img:only-child)) {
|
|
131
|
+
width: min(var(--figure), 100vw - 32px); position: relative; left: 50%; transform: translateX(-50%);
|
|
132
|
+
margin-left: 0; margin-right: 0; text-align: center;
|
|
133
|
+
}
|
|
134
|
+
#wb-main > p:has(> img:only-child), #wb-main > p:has(> a:only-child > img:only-child) { margin-top: 3.6em; margin-bottom: 3.6em; }
|
|
135
|
+
#wb-main > :is(figure, .wb-figure) figcaption { text-align: center; }
|
|
136
|
+
|
|
137
|
+
/* blocks that may run wider than the text column (blocks opt in with .wb-wide) */
|
|
138
|
+
/* positioned with left + transform, not margins, so a block's own margin rules can't undo it */
|
|
139
|
+
.wb-wide { width: min(var(--wide), 100vw - 32px); position: relative; left: 50%; transform: translateX(-50%); }
|
|
140
|
+
|
|
141
|
+
/* frame */
|
|
142
|
+
.wb-nav {
|
|
143
|
+
position: sticky; top: 0; z-index: 5; display: flex; gap: 14px; align-items: center; justify-content: space-between;
|
|
144
|
+
padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
|
|
145
|
+
font: .8rem/1.4 var(--sans); color: var(--muted);
|
|
146
|
+
}
|
|
147
|
+
.wb-nav > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
148
|
+
.wb-nav a { color: var(--muted); text-decoration: none; }
|
|
149
|
+
.wb-nav a:hover { color: var(--text); }
|
|
150
|
+
.wb-live { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; opacity: .4; }
|
|
151
|
+
[data-wb-live] .wb-live { background: var(--ok); opacity: 1; }
|
|
152
|
+
.wb-theme {
|
|
153
|
+
font: inherit; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 99px;
|
|
154
|
+
padding: 2px 10px; cursor: pointer;
|
|
155
|
+
}
|
|
156
|
+
.wb-theme:hover { color: var(--text); border-color: var(--muted); }
|
|
157
|
+
.wb-meta { color: var(--muted); font: .8rem/1.5 var(--sans); }
|
|
158
|
+
.wb-index { padding: 0; }
|
|
159
|
+
.wb-index li { list-style: none; padding: 12px 0; border-bottom: 1px solid var(--border); }
|
|
160
|
+
.wb-index .wb-meta { display: block; }
|
|
161
|
+
.wb-error { color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--bg)); white-space: pre-wrap; font: .8rem/1.5 var(--mono); }
|
|
162
|
+
.wb-unknown > .wb-label { color: var(--muted); }
|
|
163
|
+
.wb-island { display: block; }
|
|
164
|
+
span.wb-island { display: inline; }
|
|
165
|
+
|
|
166
|
+
/* plain named forms: the only engine-level interaction */
|
|
167
|
+
input:not([type=checkbox], [type=radio], [type=range]), textarea, select {
|
|
168
|
+
font: .95rem/1.45 var(--sans); color: inherit; background: var(--surface); border: 1px solid var(--border);
|
|
169
|
+
border-radius: 6px; padding: 8px 10px; max-width: 100%;
|
|
170
|
+
}
|
|
171
|
+
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
|
|
172
|
+
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
|
|
173
|
+
button {
|
|
174
|
+
font: 500 .85rem/1.3 var(--sans); padding: 7px 14px; border-radius: 6px; cursor: pointer;
|
|
175
|
+
border: 1px solid var(--border); background: var(--surface); color: var(--text);
|
|
176
|
+
}
|
|
177
|
+
button:hover { border-color: var(--muted); }
|
|
178
|
+
|
|
179
|
+
/* new content since the reader last saw the page */
|
|
180
|
+
#wb-main > * { scroll-margin-top: 72px; }
|
|
181
|
+
.wb-new { position: relative; }
|
|
182
|
+
.wb-new::after {
|
|
183
|
+
content: ""; position: absolute; left: -14px; top: 3px; bottom: 3px; width: 3px; border-radius: 2px;
|
|
184
|
+
background: var(--bad); transition: opacity 1.2s ease;
|
|
185
|
+
}
|
|
186
|
+
.wb-wide.wb-new::after { left: -10px; }
|
|
187
|
+
.wb-new.wb-new-seen::after { opacity: 0; transition-delay: 1s; }
|
|
188
|
+
.wb-fresh button { display: inline-flex; align-items: center; gap: 8px; }
|
|
189
|
+
.wb-fresh-close { display: inline-block; margin-right: -4px; padding: 0 4px; border-left: 1px solid rgb(255 255 255 / .35); opacity: .75; }
|
|
190
|
+
.wb-fresh-close:hover { opacity: 1; }
|
|
191
|
+
.wb-fresh { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
|
|
192
|
+
|
|
193
|
+
form.wb-form[data-wb-folded] { padding: 1em 0; gap: 0; }
|
|
194
|
+
.wb-index .wb-waiting { color: var(--accent); font-weight: 600; }
|
|
195
|
+
/* named forms: the core marks where each stands (data-wb-waiting, -unheard, -pending, -decided); this is how that looks */
|
|
196
|
+
form[data-wb-state=sending] { opacity: .7; }
|
|
197
|
+
/* sending: the form's buttons can't send twice */
|
|
198
|
+
form[data-wb-state=sending] button { pointer-events: none; cursor: progress; }
|
|
199
|
+
/* just sent: a short green flash, and a line saying what happened, for a few seconds */
|
|
200
|
+
@keyframes wb-sent { from { background-color: color-mix(in srgb, var(--ok) 22%, transparent); } to { background-color: transparent; } }
|
|
201
|
+
form[data-wb-just-sent] { animation: wb-sent 1.4s ease-out; }
|
|
202
|
+
form.wb-form[data-wb-state=failed]::before { content: "couldn't send it: try again"; display: block; margin-bottom: 8px; color: var(--bad); font: 600 .75rem/1.4 var(--sans); }
|
|
203
|
+
form[data-wb-sent]:not(.wb-form)::after { content: "✓ sent " attr(data-wb-sent); display: block; margin-top: 6px; color: var(--ok); font: .8rem var(--sans); }
|
|
204
|
+
form[data-wb-state=failed]:not(.wb-form)::after { content: "failed to send"; color: var(--bad); }
|
|
205
|
+
|
|
206
|
+
/* the button in the page's corner that jumps to the next form waiting for the reader */
|
|
207
|
+
.wb-waiting-next { background: var(--accent); color: var(--accent-text); border-color: var(--accent); border-radius: 99px; font-size: .8rem; }
|
|
208
|
+
.wb-waiting-next[hidden] { display: none; }
|
|
209
|
+
|
|
210
|
+
/* what an agent is waiting for: a running `whiteboard wait` or `watch` covers the form */
|
|
211
|
+
form[data-wb-waiting] { outline: 2px solid var(--accent); outline-offset: 10px; border-radius: 2px; }
|
|
212
|
+
form[data-wb-waiting]::before { content: "waiting for you"; display: block; margin-bottom: 8px; color: var(--accent); font: 600 .75rem/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
|
|
213
|
+
form[data-wb-unheard]::before { content: "no agent is listening for this right now"; display: block; margin-bottom: 8px; color: var(--muted); font: .75rem/1.4 var(--sans); }
|
|
214
|
+
form[data-wb-pending]::before { content: "sent · waiting for the agent to pick it up"; display: block; margin-bottom: 8px; color: var(--muted); font: .75rem/1.4 var(--sans); }
|
|
215
|
+
form[data-wb-pending][data-wb-just-sent]::before { content: "✓ sent · waiting for the agent to pick it up"; color: var(--ok); font-weight: 600; }
|
|
216
|
+
|
|
217
|
+
/* decided: the agent picked up the latest answer; the form folds into one line quoting it */
|
|
218
|
+
form[data-wb-folded] { cursor: pointer; }
|
|
219
|
+
form[data-wb-folded] > :not([data-block=chat-thread]) { display: none !important; }
|
|
220
|
+
/* the question's chat stays with it, under the answer and the line that reopens it */
|
|
221
|
+
form[data-wb-folded] > [data-block=chat-thread] { order: 1; margin-top: 14px; cursor: auto; }
|
|
222
|
+
form[data-wb-folded]::before { content: "✓ " attr(data-wb-outcome); display: block; white-space: pre-line; color: var(--text); font: .95rem/1.5 var(--sans); }
|
|
223
|
+
form[data-wb-folded]::after { content: "decided · click to change the answer"; display: block; margin-top: 4px; color: var(--muted); font: .75rem/1.4 var(--sans); }
|
|
224
|
+
form[data-wb-folded][data-wb-just-sent]::after { content: "✓ sent · the agent has it"; color: var(--ok); font-weight: 600; }
|
|
225
|
+
form[data-wb-folded]:hover::after { color: var(--accent); }
|
|
226
|
+
|
|
227
|
+
/* the line above the page: what waits for the reader, what nobody listens for, what is answered */
|
|
228
|
+
.wb-summary[hidden] { display: none; }
|
|
229
|
+
.wb-summary button { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
|
|
230
|
+
.wb-summary button:hover { color: var(--text); }
|
|
231
|
+
.wb-summary button[data-state=waiting] { color: var(--accent); font-weight: 600; }
|
|
232
|
+
.wb-summary { max-width: calc(var(--measure) + var(--indent, 34px) + 32px); margin: 0 auto; padding: 96px 16px 0; box-sizing: border-box; color: var(--muted); font: .8rem/1.5 var(--sans); }
|
|
233
|
+
/* the summary takes the space above the title that the page would otherwise start with */
|
|
234
|
+
.wb-summary:not([hidden]) + main { padding-top: 20px; }
|
|
235
|
+
.wb-fresh[hidden], .wb-fresh button[hidden] { display: none; }
|
|
236
|
+
.wb-fresh button { background: var(--bad); color: #fff; border-color: var(--bad); border-radius: 99px; font-size: .8rem; }
|
|
237
|
+
|
|
238
|
+
@media (max-width: 600px) {
|
|
239
|
+
body { font-size: 18px; }
|
|
240
|
+
main { padding-top: 32px; }
|
|
241
|
+
h1 { font-size: 2.2rem; }
|
|
242
|
+
.wb-new::after { left: -9px; }
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* repository views: folder listings and code */
|
|
246
|
+
.wb-files { padding: 0; font: .92rem/1.5 var(--mono); }
|
|
247
|
+
.wb-files li { list-style: none; margin: 0; padding: 5px 0; border-bottom: 1px solid var(--border); }
|
|
248
|
+
.wb-files li + li { margin-top: 0; }
|
|
249
|
+
.wb-files a { text-decoration: none; }
|
|
250
|
+
.wb-code-title { font: 500 1.1rem/1.4 var(--mono); letter-spacing: 0; }
|
|
251
|
+
.wb-code.wb-wide { margin-top: 0; }
|
|
252
|
+
|
|
253
|
+
.wb-code > pre { margin-top: 0; }
|
|
254
|
+
|
|
255
|
+
/* the overview's list of the project's documents */
|
|
256
|
+
.wb-documents { margin-top: 2.5em; }
|
|
257
|
+
.wb-documents h2 { font-size: 1.1rem; margin-bottom: .4em; }
|
|
258
|
+
|
|
259
|
+
/* threads whose form is no longer on the page (orphans.ts): read-only, after the content */
|
|
260
|
+
.wb-orphans { --indent: 34px; max-width: calc(var(--measure) + var(--indent) + 32px); margin: 0 auto; padding: 0 16px 220px; box-sizing: border-box; font: .92rem/1.45 var(--sans); }
|
|
261
|
+
.wb-orphans > * { margin-left: var(--indent); }
|
|
262
|
+
.wb-orphans > h2 { margin-left: 0; padding-top: 2em; }
|
|
263
|
+
/* the page's own bottom space moves below the list */
|
|
264
|
+
main:has(+ .wb-orphans:not([hidden])) { padding-bottom: 0; }
|
|
265
|
+
@media (max-width: 860px) { .wb-orphans { --indent: 0px; } }
|
|
266
|
+
.wb-orphans[hidden] { display: none; }
|
|
267
|
+
.wb-orphans h2 { font-size: 1rem; margin: 0 0 .8em; color: var(--muted); }
|
|
268
|
+
.wb-orphans h3 { font: 600 .8rem/1.4 var(--mono, monospace); margin: 1.2em 0 .5em; }
|
|
269
|
+
.wb-orphan { display: flex; flex-direction: column; gap: 8px; }
|
|
270
|
+
.wb-orphan-message { display: flex; flex-direction: column; gap: 2px; max-width: 85%; align-self: flex-start; }
|
|
271
|
+
.wb-orphan-message[data-from=you] { align-self: flex-end; align-items: flex-end; }
|
|
272
|
+
.wb-orphan-who { font: 600 .68rem/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
|
|
273
|
+
.wb-orphan-message[data-from=agent] .wb-orphan-who { color: var(--accent); }
|
|
274
|
+
.wb-orphan-text { white-space: pre-wrap; padding: 6px 10px; border-radius: 12px; background: var(--tint, var(--surface)); border: 1px solid var(--border); }
|