@blueshed/joined 0.2.2 → 0.3.1

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.
Files changed (237) hide show
  1. package/.claude/skills/joined/SKILL.md +9 -1
  2. package/.claude/skills/joined/reference.md +316 -63
  3. package/.claude/skills/joined-door/SKILL.md +57 -0
  4. package/README.md +19 -50
  5. package/docs/design.md +158 -37
  6. package/docs/introduction.md +27 -27
  7. package/docs/light-and-shadow.svg +2 -1
  8. package/docs/links-and-trust.svg +1 -0
  9. package/docs/stories-to-code.svg +2 -1
  10. package/docs/wire-op.svg +1 -0
  11. package/examples/README.md +20 -0
  12. package/examples/account/account.json +1 -0
  13. package/examples/account/derive.ts +41 -0
  14. package/examples/account/generated/elements.ts +52 -0
  15. package/examples/account/generated/rows.ts +22 -0
  16. package/examples/account/generated/rules.ts +32 -0
  17. package/examples/account/routes.ts +5 -0
  18. package/examples/app.css +11 -1
  19. package/examples/cafe/books.html +2 -2
  20. package/examples/cafe/cafe.css +96 -85
  21. package/examples/cafe/generated/books.rows.ts +22 -0
  22. package/examples/cafe/generated/books.rules.ts +3 -2
  23. package/examples/cafe/generated/kitchen.rows.ts +27 -0
  24. package/examples/cafe/generated/kitchen.rules.ts +11 -1
  25. package/examples/cafe/generated/menu.rows.ts +22 -0
  26. package/examples/cafe/generated/menu.rules.ts +3 -2
  27. package/examples/cafe/generated/order.rows.ts +27 -0
  28. package/examples/cafe/generated/order.rules.ts +11 -1
  29. package/examples/cafe/generated/staff.elements.ts +7 -2
  30. package/examples/cafe/generated/staff.rows.ts +22 -0
  31. package/examples/cafe/generated/staff.rules.ts +9 -1
  32. package/examples/cafe/generated/supplies.queries.ts +4 -2
  33. package/examples/cafe/generated/supplies.rows.ts +22 -0
  34. package/examples/cafe/generated/supplies.rules.ts +17 -1
  35. package/examples/cafe/generated/till.queries.ts +2 -0
  36. package/examples/cafe/generated/till.rows.ts +27 -0
  37. package/examples/cafe/generated/till.rules.ts +11 -1
  38. package/examples/cafe/index.html +14 -15
  39. package/examples/cafe/kitchen.css +11 -19
  40. package/examples/cafe/kitchen.ts +7 -3
  41. package/examples/cafe/look.ts +30 -0
  42. package/examples/cafe/menu.html +10 -26
  43. package/examples/cafe/menu.ts +8 -80
  44. package/examples/cafe/migrations/002-guard-supplies.ts +15 -0
  45. package/examples/cafe/order.html +8 -7
  46. package/examples/cafe/order.ts +6 -2
  47. package/examples/cafe/routes.ts +0 -1
  48. package/examples/cafe/staff.json +5 -0
  49. package/examples/cafe/stories.jsonl +6 -2
  50. package/examples/cafe/supplies.html +35 -34
  51. package/examples/cafe/supplies.ts +59 -39
  52. package/examples/cafe/till.ts +19 -11
  53. package/examples/cafe/views.ts +7 -5
  54. package/examples/chart/arches.ts +150 -0
  55. package/examples/chart/chart.css +11 -0
  56. package/examples/chart/chart.json +87 -0
  57. package/examples/chart/generated/elements.ts +105 -0
  58. package/examples/chart/generated/queries.ts +36 -0
  59. package/examples/chart/generated/rows.ts +27 -0
  60. package/examples/chart/generated/rules.ts +111 -0
  61. package/examples/chart/grid.ts +118 -0
  62. package/examples/chart/index.html +78 -0
  63. package/examples/chart/migrations/001-chart.ts +6 -0
  64. package/examples/chart/migrations/002-create-conditions.ts +6 -0
  65. package/examples/chart/page.ts +20 -0
  66. package/examples/chart/routes.ts +7 -0
  67. package/examples/chart/stories.jsonl +14 -0
  68. package/examples/chart/teeth.ts +57 -0
  69. package/examples/desk/desk.css +6 -10
  70. package/examples/desk/generated/elements.ts +1 -1
  71. package/examples/desk/generated/rows.ts +22 -0
  72. package/examples/desk/generated/rules.ts +34 -1
  73. package/examples/desk/index.html +10 -3
  74. package/examples/desk/lanes.css +21 -19
  75. package/examples/desk/routes.ts +0 -2
  76. package/examples/desk/stories.jsonl +4 -3
  77. package/examples/desk/tally.css +1 -1
  78. package/examples/desk/thumbs.ts +2 -2
  79. package/examples/docs.ts +7 -4
  80. package/examples/hello/generated/elements.ts +2 -2
  81. package/examples/hello/generated/rules.ts +3 -2
  82. package/examples/hello/hello.css +2 -4
  83. package/examples/hello/index.html +10 -3
  84. package/examples/hello/page.ts +4 -4
  85. package/examples/index.html +20 -12
  86. package/examples/notes/generated/elements.ts +112 -0
  87. package/examples/notes/generated/queries.ts +42 -0
  88. package/examples/notes/generated/rows.ts +27 -0
  89. package/examples/notes/generated/rules.ts +133 -0
  90. package/examples/notes/index.html +32 -0
  91. package/examples/notes/look.ts +41 -0
  92. package/examples/notes/migrations/001-notes.ts +7 -0
  93. package/examples/notes/notes.json +78 -0
  94. package/examples/notes/page.ts +21 -0
  95. package/examples/notes/routes.ts +6 -0
  96. package/examples/notes/stories.jsonl +24 -0
  97. package/examples/page.ts +9 -2
  98. package/examples/people/generated/rows.ts +22 -0
  99. package/examples/people/generated/rules.ts +11 -1
  100. package/examples/people/links.ts +8 -9
  101. package/examples/people/people.css +1 -1
  102. package/examples/people/routes.ts +1 -3
  103. package/examples/people/stories.jsonl +1 -0
  104. package/examples/people/view.ts +5 -2
  105. package/examples/trip/generated/elements.ts +5 -3
  106. package/examples/trip/generated/queries.ts +12 -1
  107. package/examples/trip/generated/rows.ts +27 -0
  108. package/examples/trip/generated/rules.ts +56 -2
  109. package/examples/trip/index.html +58 -12
  110. package/examples/trip/line.css +186 -0
  111. package/examples/trip/line.ts +51 -40
  112. package/examples/trip/page.ts +65 -71
  113. package/examples/trip/routes.ts +9 -5
  114. package/examples/trip/stays.css +13 -13
  115. package/examples/trip/stays.ts +15 -10
  116. package/examples/trip/stories.jsonl +2 -0
  117. package/examples/trip/told.ts +3 -26
  118. package/examples/trip/trip.css +16 -0
  119. package/examples/trips/generated/elements.ts +1 -1
  120. package/examples/trips/generated/rows.ts +22 -0
  121. package/examples/trips/generated/rules.ts +9 -1
  122. package/examples/trips/index.html +10 -10
  123. package/examples/trips/map.ts +3 -14
  124. package/examples/trips/new-trip.ts +14 -16
  125. package/examples/trips/trips.css +24 -23
  126. package/examples/weeks/generated/elements.ts +1 -1
  127. package/examples/weeks/generated/queries.ts +11 -0
  128. package/examples/weeks/generated/rows.ts +22 -0
  129. package/examples/weeks/generated/rules.ts +11 -5
  130. package/examples/weeks/routes.ts +3 -2
  131. package/examples/weeks/stories.jsonl +1 -0
  132. package/examples/welcome.css +43 -33
  133. package/package.json +8 -2
  134. package/src/attachment.ts +17 -2
  135. package/src/awesome.ts +103 -0
  136. package/src/board.css +76 -0
  137. package/src/board.ts +173 -0
  138. package/src/cli.ts +28 -3
  139. package/src/compile.ts +821 -109
  140. package/src/definitions.ts +113 -27
  141. package/src/demo.css +2 -5
  142. package/src/draft.ts +48 -27
  143. package/src/drawer.ts +248 -0
  144. package/src/engine.ts +253 -170
  145. package/src/fields.ts +341 -0
  146. package/src/file-value.ts +12 -2
  147. package/src/files.ts +113 -33
  148. package/src/ground.ts +110 -0
  149. package/src/icon-names.ts +19 -2
  150. package/src/keep.ts +16 -3
  151. package/src/kit.ts +51 -0
  152. package/src/link.ts +3 -3
  153. package/src/map.css +140 -0
  154. package/src/map.ts +200 -0
  155. package/src/mcp.ts +129 -24
  156. package/src/members/demo.ts +13 -12
  157. package/src/members/generated/rows.ts +22 -0
  158. package/src/members/generated/rules.ts +3 -2
  159. package/src/members/group.ts +105 -55
  160. package/src/members/keys.ts +95 -79
  161. package/src/members/panel.css +40 -35
  162. package/src/members/panel.ts +58 -37
  163. package/src/migrate.ts +178 -125
  164. package/src/migrations/005-change-kept.ts +7 -0
  165. package/src/month.css +129 -0
  166. package/src/month.ts +179 -0
  167. package/src/ops.ts +40 -1
  168. package/src/page.css +11 -2
  169. package/src/page.ts +68 -17
  170. package/src/parts.css +614 -230
  171. package/src/parts.ts +259 -36
  172. package/src/plane.css +61 -0
  173. package/src/plane.ts +153 -0
  174. package/src/postgres-server.ts +60 -0
  175. package/src/reading.css +73 -0
  176. package/src/reading.ts +238 -0
  177. package/src/rows.css +289 -0
  178. package/src/rows.ts +864 -0
  179. package/src/search.css +80 -0
  180. package/src/search.ts +130 -0
  181. package/src/server.ts +355 -137
  182. package/src/settings.ts +9 -4
  183. package/src/sheet.ts +116 -0
  184. package/src/skill.ts +40 -0
  185. package/src/slots.css +90 -0
  186. package/src/slots.ts +213 -0
  187. package/src/specs.ts +38 -0
  188. package/src/starter.ts +19 -2
  189. package/src/store.ts +224 -161
  190. package/src/stories.ts +43 -11
  191. package/src/surface.ts +164 -0
  192. package/src/time.ts +2 -0
  193. package/src/timeline.css +111 -0
  194. package/src/timeline.ts +235 -0
  195. package/src/toast.ts +21 -48
  196. package/src/together.ts +15 -24
  197. package/src/tokens.css +89 -3
  198. package/src/tokens.json +287 -7
  199. package/src/tool.ts +210 -0
  200. package/src/upkeep.ts +47 -22
  201. package/src/views.css +43 -0
  202. package/src/views.ts +111 -0
  203. package/src/week.css +150 -0
  204. package/src/week.ts +254 -0
  205. package/src/write.ts +326 -78
  206. package/starter/CHANGELOG.md +8 -0
  207. package/starter/CLAUDE.md +9 -3
  208. package/starter/bunfig +5 -0
  209. package/starter/githooks/pre-commit +13 -0
  210. package/starter/prettierignore +5 -0
  211. package/starter/tests/hello.test.ts +2 -0
  212. package/starter/tests/records.test.ts +40 -0
  213. package/starter/todo.jsonl +0 -0
  214. package/docs/learning.md +0 -76
  215. package/examples/cafe/trust.ts +0 -20
  216. package/examples/desk/trust.ts +0 -24
  217. package/examples/people/trust.ts +0 -14
  218. package/examples/trip/answer-rows.ts +0 -70
  219. package/examples/trip/bar.ts +0 -89
  220. package/examples/trip/calendar-map.css +0 -711
  221. package/examples/trip/calendar-map.ts +0 -249
  222. package/examples/trip/drags.ts +0 -143
  223. package/examples/trip/drawer.ts +0 -250
  224. package/examples/trip/event-form.ts +0 -200
  225. package/examples/trip/holding.ts +0 -61
  226. package/examples/trip/map.ts +0 -234
  227. package/examples/trip/month.ts +0 -87
  228. package/examples/trip/other-weeks.ts +0 -67
  229. package/examples/trip/peek.ts +0 -71
  230. package/examples/trip/people-chips.ts +0 -74
  231. package/examples/trip/shell.ts +0 -39
  232. package/examples/trip/trust.ts +0 -51
  233. package/examples/trip/week.ts +0 -237
  234. package/examples/trip/writes.ts +0 -91
  235. package/examples/trip/zones.ts +0 -16
  236. package/examples/weeks/derive.ts +0 -23
  237. package/src/scrim.ts +0 -81
@@ -0,0 +1,118 @@
1
+ // The NHS grid, drawn once: a five-surface box for each tooth in the Palmer grid (data-slot="UR6 M"), the patient's
2
+ // right on the left, each tooth in profile above and below (its crown and roots); each tooth a place of its own around
3
+ // its box (data-slot="UR6"), its condition drawn across it: a cross, a ring, its roots filled.
4
+
5
+ import { conditionStyle, s, sides, TEETH, type Tooth } from "./teeth.ts";
6
+
7
+ /** A tooth in profile, above or below its box: its crown, and its roots (upper molars three, lower two). */
8
+ function profile(t: Tooth, cx: number) {
9
+ const up = t.row === "U",
10
+ neck = up ? 72 : 212,
11
+ Y = (v: number) => (up ? 72 + v : 212 - v),
12
+ dir = up ? -1 : 1,
13
+ cw = { 1: 22, 2: 18, 3: 22, 4: 21, 5: 21, 6: 32, 7: 30, 8: 28 }[t.n]!,
14
+ roots = up ? (t.n <= 3 ? 1 : t.n === 4 ? 2 : t.n === 5 ? 1 : 3) : t.n <= 5 ? 1 : 2,
15
+ len = t.n === 3 ? 44 : 36,
16
+ sw = cw * 0.7;
17
+ const g = s("g", { style: "pointer-events: none" });
18
+ for (let r = 0; r < roots; r++) {
19
+ const bx = cx - sw / 2 + (sw * (r + 0.5)) / roots,
20
+ bw = (sw / roots) * 0.95,
21
+ ay = neck + dir * len * (roots === 3 && r === 1 ? 0.82 : 1);
22
+ g.append(
23
+ s("path", {
24
+ style: "fill: var(--well); stroke: var(--muted)",
25
+ d: `M${bx - bw / 2},${neck} C${bx - bw / 2},${(neck + ay) / 2} ${bx - bw * 0.2},${ay} ${bx},${ay} C${bx + bw * 0.2},${ay} ${bx + bw / 2},${(neck + ay) / 2} ${bx + bw / 2},${neck} Z`,
26
+ }),
27
+ s("path", { d: `M${bx},${neck} L${bx},${ay - dir * 4}`, class: "rootfill" }),
28
+ );
29
+ }
30
+ const L = cx - cw / 2,
31
+ R = cx + cw / 2,
32
+ edge =
33
+ t.n >= 6
34
+ ? `Q${cx - cw * 0.21},${Y(30)} ${cx},${Y(26)} Q${cx + cw * 0.21},${Y(30)} ${cx + cw * 0.42},${Y(26)}`
35
+ : t.n >= 3
36
+ ? `Q${cx},${Y(t.n === 3 ? 33 : 30)} ${cx + cw * 0.42},${Y(26)}`
37
+ : `L${cx + cw * 0.42},${Y(26)}`;
38
+ g.append(
39
+ s("path", {
40
+ style: "fill: var(--card); stroke: var(--muted)",
41
+ d: `M${cx - cw * 0.37},${Y(0)} C${L - cw * 0.06},${Y(4)} ${L - cw * 0.02},${Y(18)} ${cx - cw * 0.42},${Y(26)} ${edge} C${R + cw * 0.02},${Y(18)} ${R + cw * 0.06},${Y(4)} ${cx + cw * 0.37},${Y(0)} Z`,
42
+ }),
43
+ );
44
+ return g;
45
+ }
46
+
47
+ /** The NHS grid: a five-surface box for each tooth in the Palmer grid, its name, and the tooth in profile. */
48
+ export function grid() {
49
+ const svg = s("svg", {
50
+ slot: "ground",
51
+ viewBox: "0 0 680 285",
52
+ role: "img",
53
+ "aria-label": "The teeth, as the NHS grid charts them",
54
+ });
55
+ svg.append(conditionStyle());
56
+ for (const t of TEETH) {
57
+ const x = 20 + t.i * 40,
58
+ y = t.row === "U" ? 102 : 142,
59
+ ant = t.n <= 3,
60
+ size = 40,
61
+ ax = ant ? size * 0.18 : size * 0.3,
62
+ ay = ant ? size * 0.42 : size * 0.3,
63
+ side = sides(t);
64
+ const P: Record<string, number[][]> = {
65
+ top: [
66
+ [0, 0],
67
+ [size, 0],
68
+ [size - ax, ay],
69
+ [ax, ay],
70
+ ],
71
+ bot: [
72
+ [0, size],
73
+ [size, size],
74
+ [size - ax, size - ay],
75
+ [ax, size - ay],
76
+ ],
77
+ left: [
78
+ [0, 0],
79
+ [ax, ay],
80
+ [ax, size - ay],
81
+ [0, size],
82
+ ],
83
+ right: [
84
+ [size, 0],
85
+ [size, size],
86
+ [size - ax, size - ay],
87
+ [size - ax, ay],
88
+ ],
89
+ };
90
+ const box = s("g", { transform: `translate(${x} ${y})` });
91
+ for (const [k, pts] of Object.entries(P))
92
+ box.append(
93
+ s("polygon", {
94
+ points: pts.map((p) => p.join(",")).join(" "),
95
+ "data-slot": `${t.key} ${side[k as keyof typeof side]}`,
96
+ }),
97
+ );
98
+ box.append(
99
+ s("rect", { x: ax, y: ay, width: size - 2 * ax, height: size - 2 * ay, "data-slot": `${t.key} O` }),
100
+ s("rect", { x: 2, y: 2, width: size - 4, height: size - 4, class: "ring" }),
101
+ s("path", { d: `M3,3 L${size - 3},${size - 3} M${size - 3},3 L3,${size - 3}`, class: "x" }),
102
+ );
103
+ const name = s("text", {
104
+ x: x + 20,
105
+ y: t.row === "U" ? 12 : 274,
106
+ "font-size": 11,
107
+ style: "fill: var(--muted)",
108
+ "text-anchor": "middle",
109
+ });
110
+ name.textContent = t.key;
111
+ svg.append(s("g", { "data-slot": t.key }, profile(t, x + 20), box), name);
112
+ }
113
+ svg.append(
114
+ s("line", { x1: 340, y1: 20, x2: 340, y2: 262, style: "stroke: var(--ink); stroke-width: 1.6" }),
115
+ s("line", { x1: 20, y1: 142, x2: 660, y2: 142, style: "stroke: var(--ink); stroke-width: 1.4" }),
116
+ );
117
+ return svg;
118
+ }
@@ -0,0 +1,78 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>joined: a dental chart</title>
7
+ <link rel="stylesheet" href="joined/tokens.css" />
8
+ <link rel="stylesheet" href="joined/page.css" />
9
+ <link rel="stylesheet" href="../app.css" />
10
+ <link rel="stylesheet" href="./chart.css" />
11
+ </head>
12
+ <body>
13
+ <a class="brand" href="/"><img src="joined/icon.png" alt="" width="28" height="28" />joined</a>
14
+ <h1>A dental chart</h1>
15
+ <p class="lead">
16
+ Choose what's there and, for this course, To do or Done, then tap a surface on either drawing: it's charted on
17
+ both at once, and the account takes care of itself. Both off, it's charted as found. Extract, Crown and Root
18
+ filling chart the whole tooth (a root filling on the grid, where roots are drawn): Extract with both off, it's
19
+ missing. Clear takes off what's tapped; Undo puts back the last change.
20
+ </p>
21
+ <main class="chart">
22
+ <section class="card" aria-label="The arches">
23
+ <h2>The arches</h2>
24
+ <j-slots
25
+ for="surfaces"
26
+ slot="tooth surface"
27
+ hue="status"
28
+ hues="to do:hue-2,done:hue-0,existing:ink"
29
+ layer="conditions"
30
+ layer-by="state"
31
+ layer-says="status"
32
+ pale="material:composite"
33
+ class="arches"
34
+ >
35
+ <j-tool sets="material" value="amalgam">Amalgam</j-tool>
36
+ <j-tool sets="material" value="composite">Composite</j-tool>
37
+ <j-tool sets="status" value="to do">To do</j-tool>
38
+ <j-tool sets="status" value="done">Done</j-tool>
39
+ <j-tool sets="status" value="existing" default></j-tool>
40
+ <j-tool clears>Clear</j-tool>
41
+ <j-tool for="conditions" sets="state" value="extract">Extract</j-tool>
42
+ <j-tool for="conditions" sets="state" value="crown">Crown</j-tool>
43
+ </j-slots>
44
+ </section>
45
+ <section class="card" aria-label="The NHS grid">
46
+ <h2>The NHS grid</h2>
47
+ <j-slots
48
+ for="surfaces"
49
+ slot="tooth surface"
50
+ hue="status"
51
+ hues="to do:hue-2,done:hue-0,existing:ink"
52
+ layer="conditions"
53
+ layer-by="state"
54
+ layer-says="status"
55
+ pale="material:composite"
56
+ class="grid"
57
+ >
58
+ <j-tool sets="material" value="amalgam">Amalgam</j-tool>
59
+ <j-tool sets="material" value="composite">Composite</j-tool>
60
+ <j-tool sets="status" value="to do">To do</j-tool>
61
+ <j-tool sets="status" value="done">Done</j-tool>
62
+ <j-tool sets="status" value="existing" default></j-tool>
63
+ <j-tool clears>Clear</j-tool>
64
+ <j-tool for="conditions" sets="state" value="extract">Extract</j-tool>
65
+ <j-tool for="conditions" sets="state" value="crown">Crown</j-tool>
66
+ <j-tool for="conditions" sets="state" value="root filling">Root filling</j-tool>
67
+ </j-slots>
68
+ </section>
69
+ <section class="card" aria-label="The account">
70
+ <h2>The account</h2>
71
+ <j-charges-rows><j-charges doc="account"></j-charges></j-charges-rows>
72
+ </section>
73
+ <div hidden><j-surfaces doc="chart"></j-surfaces><j-conditions doc="chart"></j-conditions></div>
74
+ </main>
75
+ <j-sheet for="surfaces"></j-sheet>
76
+ <script type="module" src="./page.ts"></script>
77
+ </body>
78
+ </html>
@@ -0,0 +1,6 @@
1
+ // Made by `bun run compile` from the stories: what they say beyond the migrations before it.
2
+ import { createTable } from "joined/migrate";
3
+
4
+ export const changes = [
5
+ createTable("surfaces", { columns: { tooth: { type: "text", is: { type: "string", said: "tooth is a string" } }, surface: { type: "text", is: { type: "string", said: "surface is a string" } }, material: { type: "text", is: { type: "string", said: "material is a string" } }, status: { type: "text", is: { type: "string", said: "status is a string" } } }, strict: true, needs: { columns: ["tooth", "surface", "material", "status"], said: "a surface needs tooth (string), surface (string), material (string), status (string)" } }),
6
+ ];
@@ -0,0 +1,6 @@
1
+ // Made by `bun run compile` from the stories: what they say beyond the migrations before it.
2
+ import { createTable } from "joined/migrate";
3
+
4
+ export const changes = [
5
+ createTable("conditions", { columns: { tooth: { type: "text", is: { type: "string", said: "tooth is a string" } }, state: { type: "text", is: { type: "string", said: "state is a string" } }, status: { type: "text", is: { type: "string", said: "status is a string" } } }, strict: true, needs: { columns: ["tooth", "state", "status"], said: "a condition needs tooth (string), state (string), status (string)" } }),
6
+ ];
@@ -0,0 +1,20 @@
1
+ // The chart's page: the mouth drawn once, both ways (./arches.ts, ./grid.ts), put in each map before joined's kit is given the
2
+ // chart's collections; the account's rows as the compiler writes them; the surfaces' elements as compiled.
3
+
4
+ import "joined/toast";
5
+ import "joined/kit";
6
+ import { use } from "joined/kit";
7
+ import { define } from "joined/rows";
8
+ import { specs } from "./generated/rows.ts";
9
+ import { collections } from "./generated/rules.ts";
10
+ import { JCondition, JSurface } from "./generated/elements.ts";
11
+ import { JChargesRows } from "../account/generated/rows.ts";
12
+ import { arches } from "./arches.ts";
13
+ import { grid } from "./grid.ts";
14
+
15
+ document.querySelector("j-slots.arches")!.append(arches());
16
+ document.querySelector("j-slots.grid")!.append(grid());
17
+ use(specs);
18
+ define(JChargesRows);
19
+ customElements.define(collections.surfaces.tag, JSurface);
20
+ customElements.define(collections.conditions.tag, JCondition);
@@ -0,0 +1,7 @@
1
+ // A dental chart: a patient's teeth, each surface charted with what's to be done to it and what's done, drawn two
2
+ // ways as dentists draw it (the arches, and the NHS grid), with the course's account derived from it (../account).
3
+
4
+ import page from "./index.html";
5
+
6
+ export * as document from "./generated/rules.ts";
7
+ export const routes = { "/chart": page };
@@ -0,0 +1,14 @@
1
+ {"unique":{"surfaces":[["tooth","surface"]],"conditions":[["tooth","state"]]}}
2
+ {"story":"The dentist charts a cavity in UR5's mesial surface, to fill with amalgam","does":{"doc":"chart","ops":[{"op":"add","path":"/surfaces/-","value":{"tooth":"UR5","surface":"M","material":"amalgam","status":"to do"}}]}}
3
+ {"story":"The filling is done","does":{"doc":"chart","ops":[{"op":"replace","path":"/surfaces/2/status","value":"done"}]}}
4
+ {"story":"It's filled with composite instead","does":{"doc":"chart","ops":[{"op":"replace","path":"/surfaces/2/material","value":"composite"}]}}
5
+ {"story":"A surface charted by mistake is taken off","does":{"doc":"chart","ops":[{"op":"remove","path":"/surfaces/3"}]}}
6
+ {"story":"A surface is charted once: what's done to it is changed, never charted again","cannot":{"doc":"chart","ops":[{"op":"add","path":"/surfaces/-","value":{"tooth":"UR6","surface":"M","material":"composite","status":"to do"}}]}}
7
+ {"story":"A surface needs its tooth","cannot":{"doc":"chart","ops":[{"op":"add","path":"/surfaces/-","value":{"surface":"M","material":"amalgam","status":"to do"}}]}}
8
+ {"story":"At the first look, a filling already there is charted as it is: pre-existing","does":{"doc":"chart","ops":[{"op":"add","path":"/surfaces/-","value":{"tooth":"LL5","surface":"O","material":"amalgam","status":"existing"}}]}}
9
+ {"story":"UR8 is to be extracted","does":{"doc":"chart","ops":[{"op":"add","path":"/conditions/-","value":{"tooth":"UR8","state":"extract","status":"to do"}}]}}
10
+ {"story":"LR8 is extracted","does":{"doc":"chart","ops":[{"op":"replace","path":"/conditions/2/status","value":"done"}]}}
11
+ {"story":"A tooth's condition charted by mistake is taken off","does":{"doc":"chart","ops":[{"op":"remove","path":"/conditions/1"}]}}
12
+ {"story":"LR7, root filled, is to be crowned too: both are kept","does":{"doc":"chart","ops":[{"op":"add","path":"/conditions/-","value":{"tooth":"LR7","state":"crown","status":"to do"}}]}}
13
+ {"story":"LR7's root filling is done","does":{"doc":"chart","ops":[{"op":"replace","path":"/conditions/3/status","value":"done"}]}}
14
+ {"story":"A tooth is crowned once: its crown is changed, never charted again","cannot":{"doc":"chart","ops":[{"op":"add","path":"/conditions/-","value":{"tooth":"LL6","state":"crown","status":"to do"}}]}}
@@ -0,0 +1,57 @@
1
+ // The teeth a chart draws: the 32 by their Palmer names, each kind's size, which side of a box is which surface, and an
2
+ // SVG element made. What the two pictures (./arches.ts, ./grid.ts) share.
3
+
4
+ const NS = "http://www.w3.org/2000/svg";
5
+ export const s = (tag: string, attrs: Record<string, string | number> = {}, ...inside: Element[]) => {
6
+ const e = document.createElementNS(NS, tag);
7
+ for (const [k, v] of Object.entries(attrs)) e.setAttribute(k, String(v));
8
+ e.append(...inside);
9
+ return e;
10
+ };
11
+ /** The 32 teeth: upper then lower, each row from the patient's right to their left, as Palmer names them. */
12
+ export const TEETH = ["U", "L"].flatMap((row) =>
13
+ Array.from({ length: 16 }, (_, i) => ({
14
+ row,
15
+ i,
16
+ key: `${row}${i < 8 ? "R" : "L"}${i < 8 ? 8 - i : i - 7}`,
17
+ n: i < 8 ? 8 - i : i - 7,
18
+ })),
19
+ );
20
+ export type Tooth = (typeof TEETH)[number];
21
+ /** Its mesio-distal width and bucco-lingual depth, by its kind. */
22
+ export const DIM: Record<number, [number, number]> = {
23
+ 1: [13, 10],
24
+ 2: [11, 9.5],
25
+ 3: [12, 12],
26
+ 4: [11.5, 13.5],
27
+ 5: [11, 13],
28
+ 6: [15, 16],
29
+ 7: [14, 15],
30
+ 8: [13, 14],
31
+ };
32
+ /** Which of a box's sides is which surface, as the chart has it: buccal outside, mesial toward the midline. */
33
+ export const sides = (t: Tooth) => ({
34
+ top: t.row === "U" ? "B" : "L",
35
+ bot: t.row === "U" ? "L" : "B",
36
+ left: t.i < 8 ? "D" : "M",
37
+ right: t.i < 8 ? "M" : "D",
38
+ });
39
+
40
+ /** How a tooth's conditions are drawn, as its place says them (data-extract, data-crown, data-root-filling, each its
41
+ * status): missing (to extract, as found) faint; a cross to extract; a crown's ring; its roots filled; red to do,
42
+ * blue done, ink as found. Put in each picture, so it's drawn in the map's own shadow. */
43
+ export const conditionStyle = () => {
44
+ const style = document.createElementNS("http://www.w3.org/2000/svg", "style");
45
+ const by = (status: string, colour: string) =>
46
+ `[data-extract="${status}"] .x, [data-crown="${status}"] .ring, [data-root-filling="${status}"] .rootfill { display: inline; stroke: var(--${colour}); }`;
47
+ style.textContent = `
48
+ .outline { fill: none; stroke: var(--ink); pointer-events: none; }
49
+ .x, .ring, .rootfill { display: none; fill: none; stroke-width: 2.5; stroke-linecap: round; pointer-events: none; }
50
+ ${by("to do", "hue-2")}
51
+ ${by("done", "hue-0")}
52
+ [data-crown="existing"] .ring, [data-root-filling="existing"] .rootfill { display: inline; stroke: var(--ink); }
53
+ [data-extract="existing"] { opacity: 0.25; }
54
+ [data-extract="done"] { opacity: 0.4; }
55
+ `;
56
+ return style;
57
+ };
@@ -1,17 +1,13 @@
1
- /* The desk's page: the tally in a card over the lanes, and the form to add a task under them. */
1
+ /* The desk's page: the tally in joined's card over the lanes, and the form to add a task under them. */
2
2
  main.desk {
3
3
  display: grid;
4
4
  gap: var(--space-24);
5
5
  }
6
6
  .card.tally {
7
- padding: var(--space-16);
8
- border: 1px solid var(--edge);
9
- border-radius: 4px;
10
- background: var(--card);
7
+ --spacing: var(--space-16);
11
8
  }
12
- form.add input[type="number"] {
13
- flex: 0 0 6rem;
14
- }
15
- form.add input[name="title"] {
16
- flex-basis: 12rem;
9
+ /* its points, a number of one or two figures between its − and +: three fingers wide, never the task box's width */
10
+ form.add wa-number-input {
11
+ flex: none;
12
+ width: calc(3 * var(--size-finger));
17
13
  }
@@ -17,7 +17,7 @@ const send = (from: Element, ops: object[], why?: string) => new Promise<Answer>
17
17
  /** A task's fields, as the stories give them. */
18
18
  export type JTaskData = { "title": string; "points": number; "rank": number; "status"?: string; "ups"?: number[]; "downs"?: number[]; "by"?: number; "added"?: string };
19
19
  /** An add of a task, as it's sent: its fields as the stories write them. */
20
- export type JTaskValue = { "title": string; "points": number; "rank": number; "status"?: string; "ups"?: number[]; "downs"?: number[]; "by"?: number | `$${number}`; "added"?: string };
20
+ export type JTaskValue = { "title": string; "points": number; "rank": number; "status"?: string; "ups"?: (number | `$${number}`)[]; "downs"?: (number | `$${number}`)[]; "by"?: number | `$${number}`; "added"?: string };
21
21
 
22
22
  /** <j-task key>: title (string), points (integer), rank (decimal), status (string), ups (ids in members), downs (ids in members), by (an id in members), added (instant), each an attribute. */
23
23
  export class JTask extends HTMLElement {
@@ -0,0 +1,22 @@
1
+ // Written by src/compile.ts from examples/desk/stories.jsonl: change the stories, not this.
2
+
3
+ // Each collection of desk as rows (joined/rows, the skill's §3): a page defines the ones it shows, as they are or
4
+ // extended, by define() from joined/rows, and holds each collection's element in its rows:
5
+ // <j-tasks-rows><j-tasks></j-tasks></j-tasks-rows>
6
+ // A collection whose items are each of one of another's is drawn under it there, where its element is put in too.
7
+ // To change what one says or does, extend its class and override a part (label, named, says, facts, deeds, row,
8
+ // step, asks); to change how it looks, style its parts (::part(row), title, state, facts, deeds, mine, step, add,
9
+ // under, drawer). Its sheet, a search of it and how a field reads are joined/kit's, given these collections by
10
+ // use(specs) (define() gives a display's own). To draw something else altogether, don't define it: a display of the app's own holds the same
11
+ // elements. Never change this file: change the stories.
12
+
13
+ import { rows, type Spec } from "joined/rows";
14
+ import { JTask } from "./elements.ts";
15
+
16
+ const tasks: Spec = {"doc":"desk","name":"tasks","place":"j-tasks","tag":"j-task","one":"task","title":"title","fields":[{"name":"title","type":"string","needed":true},{"name":"points","type":"integer","needed":true},{"name":"rank","type":"decimal","needed":true},{"name":"status","type":"string","how":"moves","steps":["queued","working","review","done"]},{"name":"ups","type":"ids","how":"mine","with":["downs"],"to":{"tag":"j-member","people":true},"ref":true},{"name":"downs","type":"ids","how":"mine","with":["ups"],"to":{"tag":"j-member","people":true},"ref":true},{"name":"by","type":"integer","how":"filled","to":{"tag":"j-member","people":true},"ref":true},{"name":"added","type":"instant","how":"filled"}]};
17
+
18
+ /** Each collection as joined's kit (joined/kit) is given it, by name: use(specs). */
19
+ export const specs = { "tasks": tasks };
20
+
21
+ /** <j-tasks-rows>: desk's tasks as rows, each named by its title. */
22
+ export class JTasksRows extends rows(tasks, { "j-task": JTask }) {}
@@ -3,7 +3,7 @@
3
3
  export type Op = { op: "add" | "replace" | "remove"; path: string; value?: any };
4
4
 
5
5
  /** The document, and each collection: its element, the element its items are, their fields, those an add needs, and
6
- * what each link is to. */
6
+ * what each link is to and what each field pops (a value with a form, its view; a reference, what it points at). */
7
7
  export const doc = "desk";
8
8
  export const collections = {
9
9
  "tasks": {
@@ -29,6 +29,20 @@ export const collections = {
29
29
  "downs": "members",
30
30
  "by": "members"
31
31
  },
32
+ "pops": {
33
+ "ups": {
34
+ "to": "members"
35
+ },
36
+ "downs": {
37
+ "to": "members"
38
+ },
39
+ "by": {
40
+ "to": "members"
41
+ },
42
+ "added": {
43
+ "form": "instant"
44
+ }
45
+ },
32
46
  "order": "rank",
33
47
  "fills": {
34
48
  "status": "queued",
@@ -49,6 +63,25 @@ export const moves = {"tasks":"status"};
49
63
  /** The document as one statement over its tables (generated/queries.ts). */
50
64
  export { query, postgres, items, triggers } from "./queries.ts";
51
65
 
66
+ /** Why the document, as a write leaves it, breaks what its definitions hold (unique, noOverlap): each item the
67
+ * write touched, against the rest of its collection. Null if it holds. */
68
+ export function holds(d: Record<string, unknown>, touched: Record<string, number[]>): string | null {
69
+ for (const id of touched["tasks"] ?? []) {
70
+ const all = (d["tasks"] ?? []) as any[];
71
+ const a = all.find((i) => i.id === id);
72
+ if (!a) continue;
73
+ {
74
+ const lists = ["ups","downs"].map((f) => (a[f] ?? []) as number[]);
75
+ if (lists.some((l, n) => l.some((m) => lists.slice(n + 1).some((o) => o.includes(m)))))
76
+ return "tasks " + a.id + " has someone in two of ups and downs: take one back first";
77
+ }
78
+ }
79
+ return null;
80
+ }
81
+
82
+ /** The lists that are each member's own (its definitions' mine), or links to one: a member gives and takes only their own id. */
83
+ export const mine: Record<string, string[]> = {"tasks":["ups","downs"]};
84
+
52
85
  /** desk is one document. */
53
86
  export const kind = null;
54
87
 
@@ -20,11 +20,18 @@
20
20
  <nav class="bar"><members-panel></members-panel></nav>
21
21
  </header>
22
22
  <main class="desk">
23
- <section class="card tally" aria-label="How it's going"><desk-tally></desk-tally></section>
23
+ <wa-card class="card tally" aria-label="How it's going"><desk-tally></desk-tally></wa-card>
24
24
  <desk-lanes><j-tasks></j-tasks></desk-lanes>
25
25
  <form class="add">
26
- <input name="title" placeholder="A task" aria-label="A task" required autocomplete="off" />
27
- <input name="points" type="number" min="0" value="1" aria-label="Its points" />
26
+ <wa-input
27
+ class="j-bare"
28
+ name="title"
29
+ placeholder="A task"
30
+ label="A task"
31
+ required
32
+ autocomplete="off"
33
+ ></wa-input>
34
+ <wa-number-input class="j-bare" name="points" min="0" value="1" label="Its points"></wa-number-input>
28
35
  <button class="act ink" data-icon="add">Put it on the desk</button>
29
36
  <p class="said" role="status"></p>
30
37
  </form>
@@ -1,5 +1,5 @@
1
- /* <desk-lanes>'s look, in its shadow (with joined's parts): a lane for each status side by side where there's room,
2
- one under another on a phone; each its name and how many, and its cards, each a card in its edge: its title, who
1
+ /* <desk-lanes>'s look, in its shadow (with joined's parts): a lane for each status side by side, one under another
2
+ on a phone (below the one breakpoint); each its name and how many, and its cards, each a card in its edge: its title, who
3
3
  put it there and its points, its thumbs, its moves. The lane a card may go to is marked as it's held over it; a
4
4
  card just changed glows a moment (./pulse.ts), and doesn't where the device asks for less motion. */
5
5
  :host {
@@ -10,23 +10,18 @@
10
10
  grid-template-columns: repeat(4, minmax(0, 1fr));
11
11
  gap: var(--space-12);
12
12
  }
13
- @media (max-width: 52rem) {
14
- .lanes {
15
- grid-template-columns: repeat(2, minmax(0, 1fr));
16
- }
17
- }
18
- @media (max-width: 30rem) {
13
+ @media (max-width: 40rem) {
19
14
  .lanes {
20
15
  grid-template-columns: minmax(0, 1fr);
21
16
  }
22
17
  }
23
18
  section {
24
19
  min-height: 6rem;
25
- border-radius: 4px;
20
+ border-radius: var(--radius);
26
21
  }
27
22
  section[over] {
28
- outline: 2px dashed var(--ink);
29
- outline-offset: 2px;
23
+ outline: var(--size-ring) dashed var(--ink);
24
+ outline-offset: var(--size-ring);
30
25
  }
31
26
  h3 {
32
27
  display: flex;
@@ -47,7 +42,7 @@ ol {
47
42
  gap: var(--space-8);
48
43
  padding: var(--space-12);
49
44
  border: 1px solid var(--edge);
50
- border-radius: 4px;
45
+ border-radius: var(--radius);
51
46
  background: var(--card);
52
47
  color: var(--ink);
53
48
  touch-action: pan-y;
@@ -57,7 +52,8 @@ ol {
57
52
  position: relative;
58
53
  z-index: 1;
59
54
  cursor: grabbing;
60
- box-shadow: 0 4px 16px rgb(0 0 0 / 0.16);
55
+ /* held: outlined in ink, as picked is (no shadows: design.md, Layout) */
56
+ outline: var(--size-ring) solid var(--ink);
61
57
  }
62
58
  .card p {
63
59
  margin: 0;
@@ -77,13 +73,13 @@ ol {
77
73
  display: inline-flex;
78
74
  align-items: center;
79
75
  gap: var(--space-4);
80
- min-height: 32px;
76
+ min-height: var(--size-touch);
81
77
  padding: 0 var(--space-8);
82
- border: 1px solid var(--line);
83
- border-radius: 99px;
78
+ border: 1px solid var(--control-edge);
79
+ border-radius: var(--radius);
84
80
  background: none;
85
81
  color: var(--muted);
86
- font: var(--font-small);
82
+ font: var(--font-tool);
87
83
  }
88
84
  button.thumb {
89
85
  cursor: pointer;
@@ -113,10 +109,16 @@ button.thumb {
113
109
  }
114
110
  @keyframes pulse {
115
111
  from {
116
- box-shadow: 0 0 0 3px var(--hue-5);
112
+ outline: var(--size-ring) solid var(--accent);
117
113
  }
118
114
  to {
119
- box-shadow: 0 0 0 3px transparent;
115
+ outline: var(--size-ring) solid transparent;
116
+ }
117
+ }
118
+ /* under a finger, a thumb is a finger tall */
119
+ @media (max-width: 40rem), (pointer: coarse) {
120
+ .thumb {
121
+ min-height: var(--size-finger);
120
122
  }
121
123
  }
122
124
  @media (prefers-reduced-motion: reduce) {
@@ -4,6 +4,4 @@
4
4
  import page from "./index.html";
5
5
 
6
6
  export * as document from "./generated/rules.ts";
7
- /** The desk's own rule: a thumb is your own, one a task (./trust.ts). */
8
- export { trust } from "./trust.ts";
9
7
  export const routes = { "/desk": page };
@@ -3,8 +3,9 @@
3
3
  {"order":{"tasks":"rank"}}
4
4
  {"fills":{"tasks":{"status":"queued","by":"me","added":"now"}}}
5
5
  {"moves":{"tasks":"status"}}
6
+ {"mine":{"tasks":[["ups","downs"]]}}
6
7
  {"story":"Peter puts a task on the desk: it's queued, his, and dated","as":"peter","does":{"doc":"desk","ops":[{"op":"add","path":"/tasks/-","value":{"title":"Print the badges","points":1,"rank":5}}]},"seen":["peter","phone","agent"],"then":{"/tasks/5/status":"queued","/tasks/5/by":1}}
7
- {"story":"Peter can't say whose a task is: the desk fills it","as":"peter","cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/-","value":{"title":"Print the badges","by":2}}]},"refused":"by is the server's to fill"}
8
+ {"story":"Peter can't say whose a task is: the desk fills it","as":"peter","cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/-","value":{"title":"Print the badges","points":1,"rank":5,"by":2}}]},"refused":"by is the server's to fill"}
8
9
  {"story":"The agent starts the welcome","as":"agent","does":{"doc":"desk","ops":[{"op":"replace","path":"/tasks/1/status","value":"working"}]},"seen":["peter","agent"]}
9
10
  {"story":"The agent puts the rota up for review","as":"agent","does":{"doc":"desk","ops":[{"op":"replace","path":"/tasks/2/status","value":"review"}]},"seen":["peter","agent"]}
10
11
  {"story":"Peter approves the hall: it's done","as":"peter","does":{"doc":"desk","ops":[{"op":"replace","path":"/tasks/3/status","value":"done"}]},"seen":["peter","agent"]}
@@ -14,5 +15,5 @@
14
15
  {"story":"Nora thumbs the welcome up","as":"nora","does":{"doc":"desk","ops":[{"op":"add","path":"/tasks/1/ups/-","value":3}]},"seen":["nora","peter"],"then":{"/tasks/1/ups":[3]}}
15
16
  {"story":"Nora changes her mind: up becomes down, in one write","as":"nora","premise":{"nora":[{"doc":"desk","ops":[{"op":"add","path":"/tasks/1/ups/-","value":3}]}]},"does":{"doc":"desk","ops":[{"op":"remove","path":"/tasks/1/ups/3"},{"op":"add","path":"/tasks/1/downs/-","value":3}]},"seen":["nora","peter"],"then":{"/tasks/1/downs":[3]}}
16
17
  {"story":"Nora takes her thumb back","as":"nora","premise":{"nora":[{"doc":"desk","ops":[{"op":"add","path":"/tasks/1/downs/-","value":3}]}]},"does":{"doc":"desk","ops":[{"op":"remove","path":"/tasks/1/downs/3"}]},"seen":["nora","peter"]}
17
- {"story":"Nora can't thumb for Nick","as":"nora","cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/1/ups/-","value":2}]},"refused":"You thumb only for yourself."}
18
- {"story":"Nora can't thumb the hall both ways","as":"nora","premise":{"nora":[{"doc":"desk","ops":[{"op":"add","path":"/tasks/3/ups/-","value":3}]}]},"cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/3/downs/-","value":3}]},"refused":"One thumb a task: take the other back first."}
18
+ {"story":"Nora can't thumb for Nick","as":"nora","cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/1/ups/-","value":2}]},"refused":"ups is each member's own to give"}
19
+ {"story":"Nora can't thumb the hall both ways","as":"nora","premise":{"nora":[{"doc":"desk","ops":[{"op":"add","path":"/tasks/3/ups/-","value":3}]}]},"cannot":{"doc":"desk","ops":[{"op":"add","path":"/tasks/3/downs/-","value":3}]},"refused":"tasks 3 has someone in two of ups and downs: take one back first"}
@@ -12,7 +12,7 @@
12
12
  .bar {
13
13
  display: flex;
14
14
  height: var(--space-12);
15
- border-radius: 99px;
15
+ border-radius: var(--radius-pill);
16
16
  overflow: hidden;
17
17
  background: var(--line);
18
18
  }
@@ -1,7 +1,7 @@
1
1
  // Recipe: a thumb up or down, each person's own, as two lists of ids on the item (`ups` and `downs`, links to
2
2
  // members): the buttons say how many, yours pressed; pressed, your thumb is given, the other taken back in the same
3
- // write; pressed again, taken back. Offered where `may` offers adding to the list; the app's trust.ts holds a thumb
4
- // to its giver and one an item (no story can say that). idea-cards' thumbs and cardlet's votes are this.
3
+ // write; pressed again, taken back. Offered where `may` offers adding to the list; the desk's definitions hold a
4
+ // thumb to its giver and one an item (`mine`, in its stories' header lines). idea-cards' thumbs and cardlet's votes are this.
5
5
 
6
6
  import { icon } from "joined/icons";
7
7
  import { said } from "joined/parts";
package/examples/docs.ts CHANGED
@@ -15,12 +15,15 @@ export async function docs(req: { params: { file: string } }) {
15
15
  return new Response(
16
16
  `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>joined — ${name}</title><style>${tokens}${page}${style}
17
17
  img { max-width: 100%; height: auto; display: block; margin: var(--space-20) 0; }
18
- pre { padding: var(--space-12) var(--space-16); background: var(--well); border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; font-size: 0.85rem; }
19
- code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
18
+ /* the doc's own logo: the page's head is joined's brand line, as every page's */
19
+ img[src="logo.svg"] { display: none; }
20
+ pre { padding: var(--space-12) var(--space-16); background: var(--well); border: 1px solid var(--edge); border-radius: var(--radius); overflow-x: auto; font: var(--font-small); }
21
+ code { font-family: var(--mono); }
22
+ pre code { font: inherit; font-family: var(--mono); }
20
23
  hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-24) 0; }
21
- table { width: 100%; border-collapse: collapse; margin: var(--space-16) 0; font-size: 0.95rem; }
24
+ table { width: 100%; border-collapse: collapse; margin: var(--space-16) 0; font: var(--font-row); }
22
25
  th, td { text-align: left; padding: var(--space-8) var(--space-10); border-bottom: 1px solid var(--line); }
23
- </style></head><body><p class="bar"><a href="/">← joined</a></p>${Bun.markdown.html(await md.text(), { tables: true })}</body></html>`,
26
+ </style></head><body><a class="brand" href="/"><img src="/apple-touch-icon.png" alt="" width="28" height="28" />joined</a>${Bun.markdown.html(await md.text(), { tables: true })}</body></html>`,
24
27
  { headers: { "content-type": "text/html; charset=utf-8" } },
25
28
  );
26
29
  const raw = Bun.file(`${DOCS}/${req.params.file}`);