@bigmistqke/whiteboard 0.3.0 → 0.4.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.
Files changed (155) hide show
  1. package/README.md +67 -17
  2. package/bin/whiteboard.ts +268 -71
  3. package/dist/client/runtime.js +88 -41
  4. package/dist/define.js +21 -2
  5. package/dist/plugins/callout/index.js +3 -1
  6. package/dist/plugins/callout/public/style.css +30 -0
  7. package/dist/plugins/chat/index.js +7 -4
  8. package/dist/plugins/chat/{client.js → public/client.js} +1 -1
  9. package/dist/plugins/chat/public/style.css +98 -0
  10. package/dist/plugins/code/index.js +3 -1
  11. package/dist/plugins/code/public/style.css +68 -0
  12. package/dist/plugins/comments/index.js +4 -5
  13. package/dist/plugins/comments/public/client.js +19 -0
  14. package/dist/plugins/comments/public/style.css +185 -0
  15. package/dist/plugins/details/index.js +7 -2
  16. package/dist/plugins/details/public/style.css +7 -0
  17. package/dist/plugins/form/index.js +37 -8
  18. package/dist/plugins/form/public/style.css +126 -0
  19. package/dist/plugins/gallery/index.js +4 -3
  20. package/dist/plugins/gallery/public/client.js +1 -0
  21. package/dist/plugins/gallery/public/style.css +90 -0
  22. package/dist/plugins/grid/index.js +9 -3
  23. package/dist/plugins/grid/public/style.css +71 -0
  24. package/dist/plugins/iframe/index.js +13 -14
  25. package/dist/plugins/iframe/public/style.css +13 -0
  26. package/dist/plugins/index.js +3 -1
  27. package/dist/plugins/mermaid/index.js +3 -1
  28. package/dist/plugins/mermaid/{style.css → public/style.css} +7 -2
  29. package/dist/plugins/terminal/index.js +10 -9
  30. package/dist/plugins/terminal/{style.css → public/style.css} +199 -45
  31. package/dist/plugins/toc/README.md +12 -0
  32. package/dist/plugins/toc/index.js +9 -5
  33. package/dist/plugins/toc/public/client.js +1 -0
  34. package/dist/plugins/toc/public/style.css +93 -0
  35. package/dist/plugins/window/README.md +29 -0
  36. package/dist/plugins/window/index.js +64 -0
  37. package/dist/solid/index.js +14 -11
  38. package/dist/src/client/page/base.css +1078 -199
  39. package/dist/src/client/page/main.js +174 -32
  40. package/dist/src/loader.js +7 -2
  41. package/dist/src/package.js +3 -6
  42. package/dist/src/pages/blocks.js +8 -13
  43. package/dist/src/pages/markdown.js +1 -1
  44. package/dist/src/pages/render.js +73 -13
  45. package/dist/src/pages/window.js +30 -0
  46. package/dist/src/public.js +24 -0
  47. package/dist/src/server.js +37 -15
  48. package/package.json +3 -1
  49. package/plugins/callout/index.ts +3 -1
  50. package/plugins/callout/public/style.css +30 -0
  51. package/plugins/chat/autosize.ts +43 -9
  52. package/plugins/chat/client.tsx +22 -5
  53. package/plugins/chat/index.ts +22 -8
  54. package/plugins/chat/public/style.css +98 -0
  55. package/plugins/claude-code/index.ts +49 -14
  56. package/plugins/code/diff.ts +28 -8
  57. package/plugins/code/index.ts +30 -20
  58. package/plugins/code/public/style.css +68 -0
  59. package/plugins/comments/client.ts +139 -71
  60. package/plugins/comments/index.ts +9 -7
  61. package/plugins/comments/public/style.css +185 -0
  62. package/plugins/details/index.ts +7 -2
  63. package/plugins/details/public/style.css +7 -0
  64. package/plugins/forge/index.ts +16 -3
  65. package/plugins/form/index.ts +75 -27
  66. package/plugins/form/public/style.css +126 -0
  67. package/plugins/gallery/client.tsx +9 -3
  68. package/plugins/gallery/index.ts +31 -9
  69. package/plugins/gallery/public/style.css +90 -0
  70. package/plugins/grid/index.ts +19 -5
  71. package/plugins/grid/public/style.css +71 -0
  72. package/plugins/iframe/index.ts +20 -23
  73. package/plugins/iframe/public/style.css +13 -0
  74. package/plugins/index.ts +16 -1
  75. package/plugins/mermaid/index.ts +3 -1
  76. package/plugins/mermaid/{style.css → public/style.css} +7 -2
  77. package/plugins/terminal/client.ts +105 -48
  78. package/plugins/terminal/host.ts +131 -29
  79. package/plugins/terminal/index.ts +84 -25
  80. package/plugins/terminal/public/style.css +225 -0
  81. package/plugins/terminal/server.ts +64 -13
  82. package/plugins/terminal/sizes.ts +13 -3
  83. package/plugins/toc/README.md +12 -0
  84. package/plugins/toc/client.ts +58 -29
  85. package/plugins/toc/index.ts +22 -5
  86. package/plugins/toc/public/style.css +93 -0
  87. package/plugins/window/README.md +29 -0
  88. package/plugins/window/index.ts +85 -0
  89. package/skills/whiteboard/SKILL.md +3 -1
  90. package/solid/index.tsx +24 -9
  91. package/src/auth.ts +25 -7
  92. package/src/client/forms.ts +74 -28
  93. package/src/client/markdown.ts +15 -4
  94. package/src/client/page/base.css +1078 -199
  95. package/src/client/page/elsewhere.ts +32 -15
  96. package/src/client/page/fresh.ts +91 -23
  97. package/src/client/page/hold.ts +11 -2
  98. package/src/client/page/live.ts +10 -6
  99. package/src/client/page/main.ts +106 -34
  100. package/src/client/page/orphans.ts +25 -10
  101. package/src/client/page/sort.ts +14 -4
  102. package/src/client/page/sticky.ts +11 -3
  103. package/src/client/page/theme.ts +11 -7
  104. package/src/client/page/waiting.ts +141 -34
  105. package/src/client/page/window.ts +40 -0
  106. package/src/client/reactive.ts +19 -0
  107. package/src/client/read.ts +17 -10
  108. package/src/client/runtime.ts +130 -35
  109. package/src/client/scroll.ts +14 -4
  110. package/src/client/toast.ts +19 -5
  111. package/src/config.ts +20 -5
  112. package/src/define.ts +67 -23
  113. package/src/events.ts +111 -24
  114. package/src/html.ts +6 -2
  115. package/src/icons.ts +4 -2
  116. package/src/load.ts +10 -2
  117. package/src/loader.ts +75 -11
  118. package/src/package.ts +9 -8
  119. package/src/pages/blocks.ts +20 -14
  120. package/src/pages/markdown.ts +113 -34
  121. package/src/pages/render.ts +198 -37
  122. package/src/pages/window.ts +71 -0
  123. package/src/plugins.ts +90 -24
  124. package/src/public.ts +39 -0
  125. package/src/running.ts +8 -2
  126. package/src/serve.ts +29 -7
  127. package/src/server.ts +351 -108
  128. package/src/status.ts +15 -9
  129. package/dist/plugins/callout/style.css +0 -12
  130. package/dist/plugins/chat/style.css +0 -24
  131. package/dist/plugins/code/style.css +0 -29
  132. package/dist/plugins/comments/client.js +0 -10
  133. package/dist/plugins/comments/style.css +0 -40
  134. package/dist/plugins/details/style.css +0 -3
  135. package/dist/plugins/form/style.css +0 -44
  136. package/dist/plugins/gallery/client.js +0 -1
  137. package/dist/plugins/gallery/style.css +0 -27
  138. package/dist/plugins/grid/style.css +0 -25
  139. package/dist/plugins/iframe/client.js +0 -1
  140. package/dist/plugins/iframe/style.css +0 -29
  141. package/dist/plugins/toc/client.js +0 -1
  142. package/dist/plugins/toc/style.css +0 -19
  143. package/plugins/callout/style.css +0 -12
  144. package/plugins/chat/style.css +0 -24
  145. package/plugins/code/style.css +0 -29
  146. package/plugins/comments/style.css +0 -40
  147. package/plugins/details/style.css +0 -3
  148. package/plugins/form/style.css +0 -44
  149. package/plugins/gallery/style.css +0 -27
  150. package/plugins/grid/style.css +0 -25
  151. package/plugins/iframe/client.ts +0 -46
  152. package/plugins/iframe/style.css +0 -29
  153. package/plugins/terminal/style.css +0 -71
  154. package/plugins/toc/style.css +0 -19
  155. /package/dist/plugins/terminal/{client.js → public/client.js} +0 -0
@@ -1,44 +0,0 @@
1
- /* a form reads as a set-off part of the article: hairline rules above and below, no box */
2
- .wb-form {
3
- margin: 3.6em 0; padding: 1.6em 0 1.7em; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
4
- display: grid; gap: 20px;
5
- }
6
- .wb-form-pending { min-height: 72px; }
7
- /* the form's body is markdown: its first and last blocks sit flush with the rules */
8
- .wb-form > :first-child { margin-top: 0; }
9
- .wb-form > :last-child { margin-bottom: 0; }
10
- .wb-form > :is(p, ul, ol, table, .wb-grid, div) { margin-top: 0; margin-bottom: 0; }
11
-
12
- /* an inline option, :radio[…] or :check[…]: the input and its label read as one */
13
- .wb-form-option { display: inline-flex; gap: 8px; align-items: baseline; cursor: pointer; }
14
- .wb-form-option + .wb-form-option { margin-left: 18px; }
15
- .wb-form-option input { margin: 0; translate: 0 .1em; }
16
- .wb-form-option-label { font-weight: 600; }
17
- /* an answer not on the list: a text box in the option's line (`other`) */
18
- .wb-form-other { align-items: center; }
19
- .wb-form-other .wb-form-other-text { translate: none; font: inherit; padding: 3px 8px; min-width: 12em; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
20
- .wb-form-recommended { font: 500 .7rem/1.4 var(--sans); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-left: 10px; }
21
-
22
- /* a list item that starts with an option is a row to pick: no bullet, the picked one tinted, and
23
- the rest of the item reads as what the option means */
24
- .wb-form li:has(> p:first-child > .wb-form-option:first-child),
25
- .wb-form li:has(> .wb-form-option:first-child) { list-style: none; margin-left: -1.2em; padding: 6px 10px; border-radius: 6px; }
26
- .wb-form li:has(> p:first-child > .wb-form-option:first-child):hover,
27
- .wb-form li:has(> .wb-form-option:first-child):hover { background: var(--tint); }
28
- .wb-form li:has(> p:first-child > .wb-form-option:first-child input:checked),
29
- .wb-form li:has(> .wb-form-option:first-child input:checked) { background: color-mix(in srgb, var(--accent) 8%, transparent); }
30
- .wb-form li > p:first-child { margin-bottom: .2em; }
31
- .wb-form li > p:first-child > .wb-form-option:first-child,
32
- .wb-form li > .wb-form-option:first-child { display: flex; margin-bottom: .15em; }
33
-
34
- /* fields: the label above the input */
35
- .wb-form-field { display: flex; flex-direction: column; gap: 7px; margin: 0; min-width: 0; }
36
- .wb-form-field :is(input:not([type=range]), textarea, select) { width: 100%; }
37
- .wb-form-field textarea { resize: vertical; }
38
- .wb-form-label { font: 600 .78rem/1.4 var(--sans); color: var(--muted); letter-spacing: .01em; }
39
- .wb-form-label:empty { display: none; }
40
-
41
- /* buttons: the first one of a form is its primary one */
42
- .wb-form button[name=action] + button[name=action] { margin-left: 8px; }
43
- .wb-form button.wb-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
44
- .wb-card .wb-form { padding: 0; border: 0; margin: .6em 0 0; }
@@ -1,27 +0,0 @@
1
- .wb-gallery {
2
- display: grid; gap: 40px 24px; margin: 4em 0;
3
- grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--wb-gallery-min, 240px)), 1fr));
4
- }
5
- .wb-gallery-item {
6
- margin: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
7
- }
8
- .wb-gallery-thumb { padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); cursor: zoom-in; display: block; }
9
- .wb-gallery-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
10
- .wb-gallery-item figcaption { padding: 14px 2px 0; font: .88rem/1.5 var(--serif); color: var(--text); }
11
- .wb-gallery-item figcaption h3 { margin: 0 0 .25em; font-size: 1rem; }
12
- .wb-gallery-item figcaption > div > :first-child { margin-top: 0; }
13
- .wb-gallery-item figcaption > div > :last-child { margin-bottom: 0; }
14
-
15
- .wb-lightbox {
16
- position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .86);
17
- display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 24px 16px;
18
- }
19
- .wb-lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; }
20
- .wb-lightbox-caption { color: #eee; text-align: center; padding-top: 10px; }
21
- .wb-lightbox button {
22
- position: absolute; background: rgb(255 255 255 / .12); color: #fff; border: 0; font-size: 1.6rem; line-height: 1;
23
- width: 44px; height: 44px; border-radius: 50%; padding: 0;
24
- }
25
- .wb-lightbox-prev { left: 12px; top: 50%; }
26
- .wb-lightbox-next { right: 12px; top: 50%; }
27
- .wb-lightbox-close { right: 12px; top: 12px; }
@@ -1,25 +0,0 @@
1
- .wb-grid {
2
- display: grid; gap: 22px; margin: 4em 0;
3
- grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--wide, 1040px) / var(--wb-grid-cols, 3) - 16px)), 1fr));
4
- }
5
- .wb-grid:not(.wb-wide) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
6
- .wb-card {
7
- background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
8
- padding: 18px 20px 20px; min-width: 0;
9
- }
10
- .wb-card > header { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; margin-bottom: .55em; }
11
- .wb-card h3 { margin: 0; font-size: 1.02rem; }
12
- .wb-card-body { font-size: .9rem; line-height: 1.6; }
13
- .wb-card-body > :first-child { margin-top: 0; }
14
- .wb-card-body > :last-child { margin-bottom: 0; }
15
-
16
- /* badge: a coloured dot and a word, not a pill */
17
- .wb-badge {
18
- --c: var(--muted); flex: none; display: inline-flex; align-items: center; gap: 6px;
19
- font: 500 .74rem/1 var(--sans); color: var(--muted); white-space: nowrap;
20
- }
21
- .wb-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
22
- .wb-badge:is([data-badge=done], [data-badge=ok], [data-badge=yes], [data-badge=good]) { --c: var(--ok); }
23
- .wb-badge:is([data-badge=active], [data-badge=new], [data-badge=info]) { --c: var(--info); }
24
- .wb-badge:is([data-badge=open], [data-badge=todo], [data-badge=maybe], [data-badge=warning]) { --c: var(--warn); }
25
- .wb-badge:is([data-badge=blocked], [data-badge=no], [data-badge=bad], [data-badge=error]) { --c: var(--bad); }
@@ -1,46 +0,0 @@
1
- // An iframe block filling the window, and back: its header's button, or Escape. Which one is
2
- // maximized is kept across the page's updates, which put back the block as the server wrote it.
3
- import type { PluginMount } from '../../src/define.ts'
4
-
5
- const figures = () => [...document.querySelectorAll<HTMLElement>('#wb-main div.wb-iframe')]
6
- // the maximized block, by its place among the page's iframe blocks and its address
7
- let maximized: { index: number; src: string } | null = null
8
-
9
- function apply() {
10
- const all = figures()
11
- let found: HTMLElement | null = null
12
- all.forEach((fig, i) => {
13
- const on = !!maximized && i === maximized.index && fig.querySelector('iframe')?.getAttribute('src') === maximized.src
14
- fig.toggleAttribute('data-maximized', on)
15
- const button = fig.querySelector<HTMLButtonElement>('[data-wb-maximize]')
16
- if (button) {
17
- button.title = on ? 'Back into the page (Esc)' : 'Fill the window'
18
- button.setAttribute('aria-label', button.title)
19
- button.setAttribute('aria-pressed', String(on))
20
- }
21
- if (on) found = fig
22
- })
23
- if (maximized && !found) maximized = null
24
- document.documentElement.toggleAttribute('data-wb-iframe-maximized', !!found)
25
- }
26
-
27
- function toggle(fig: HTMLElement) {
28
- const index = figures().indexOf(fig)
29
- const src = fig.querySelector('iframe')?.getAttribute('src') ?? ''
30
- maximized = maximized && maximized.index === index ? null : { index, src }
31
- apply()
32
- }
33
-
34
- const mount: PluginMount = (_root, _handle, api) => {
35
- document.addEventListener('click', e => {
36
- const button = (e.target as Element).closest?.('[data-wb-maximize]')
37
- const fig = button?.closest<HTMLElement>('div.wb-iframe')
38
- if (fig) toggle(fig)
39
- })
40
- document.addEventListener('keydown', e => {
41
- if (e.key === 'Escape' && maximized) { maximized = null; apply() }
42
- })
43
- api.onRendered(apply)
44
- }
45
-
46
- export default mount
@@ -1,29 +0,0 @@
1
- /* a page inside the page, framed like a browser window; its bottom edge drags it taller */
2
- .wb-iframe { margin: 1.6em 0; border: 1px solid var(--border); border-radius: var(--radius, 6px); overflow: hidden; background: var(--bg); }
3
- .wb-iframe-frame { resize: vertical; overflow: hidden; min-height: 120px; background: #fff; }
4
- .wb-iframe iframe { display: block; width: 100%; height: 100%; border: 0; }
5
-
6
- .wb-iframe-bar {
7
- display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; min-height: 32px; box-sizing: border-box;
8
- border-bottom: 1px solid var(--border); background: var(--tint, var(--bg)); font: .8rem/1.4 var(--sans); color: var(--muted);
9
- }
10
- .wb-iframe-name { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; overflow: hidden; white-space: nowrap; }
11
- .wb-iframe-title { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
12
- .wb-iframe-url { font-family: var(--mono, monospace); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }
13
- .wb-iframe-button {
14
- flex: none; display: inline-grid; place-items: center; width: 26px; height: 24px; padding: 0; border: 0; border-radius: 5px;
15
- background: none; color: var(--muted); cursor: pointer;
16
- }
17
- .wb-iframe-button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
18
- .wb-iframe-restore, .wb-iframe[data-maximized] .wb-iframe-max { display: none; }
19
- .wb-iframe[data-maximized] .wb-iframe-restore { display: contents; }
20
- .wb-iframe-max { display: contents; }
21
-
22
- /* filling the window, above the page and its header; the terminal drawer stays below it. The
23
- margin is !important: the page indents its blocks with a rule more specific than any here */
24
- .wb-iframe[data-maximized] {
25
- position: fixed; inset: 0 0 var(--wb-inset-bottom, 0px) 0; z-index: 40; margin: 0 !important; border-radius: 0; border: 0;
26
- display: flex; flex-direction: column; width: auto; left: 0; transform: none;
27
- }
28
- .wb-iframe[data-maximized] .wb-iframe-frame { flex: 1; height: auto !important; resize: none; }
29
- :root[data-wb-iframe-maximized] { overflow: hidden; }
@@ -1,71 +0,0 @@
1
- /* The terminal drawer (see terminal.ts). Pages morph into each other on navigation, and the drawer is
2
- named, so it keeps its place and size while the page around it changes. */
3
- @view-transition { navigation: auto; }
4
-
5
- /* How much of the window the drawer takes at the bottom, for the page to keep clear: its content
6
- scrolls to above it, and its own fixed elements sit above it (the page's buttons at the bottom).
7
- Registered as a length so that it computes to pixels a script can read. */
8
- @property --wb-inset-bottom { syntax: '<length>'; inherits: true; initial-value: 0px; }
9
-
10
- :root { --wb-term-h: 320px; --wb-term-bar: 34px; }
11
- :root:has(body > #wb-terminal) { --wb-inset-bottom: var(--wb-term-bar); }
12
- :root:has(body > #wb-terminal[data-state=open]) { --wb-inset-bottom: calc(var(--wb-term-bar) + var(--wb-term-h)); }
13
-
14
- #wb-terminal {
15
- view-transition-name: wb-terminal;
16
- position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
17
- display: flex; flex-direction: column;
18
- background: #0f1115; color: #d7dae0;
19
- border-top: 1px solid #2a2f3a;
20
- box-shadow: 0 -6px 24px rgb(0 0 0 / .18);
21
- font: 500 12px/1 ui-sans-serif, system-ui, sans-serif;
22
- }
23
- body:has(> #wb-terminal) { padding-bottom: var(--wb-inset-bottom); }
24
-
25
- .wb-term-grip { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; touch-action: none; }
26
- .wb-term-bar { height: var(--wb-term-bar); display: flex; align-items: center; gap: 12px; padding: 0 10px 0 6px; flex: none; }
27
- .wb-term-bar button {
28
- font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 5px;
29
- padding: 5px 8px; cursor: pointer;
30
- }
31
- .wb-term-bar button:hover { background: #1c2029; border-color: #2a2f3a; }
32
- .wb-term-toggle { display: inline-flex; align-items: center; gap: 7px; letter-spacing: .04em; text-transform: uppercase; }
33
- /* points up while closed (it opens upward), down while open */
34
- .wb-term-chevron { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .2s, translate .2s; }
35
- #wb-terminal[data-state=collapsed] .wb-term-chevron { rotate: -135deg; translate: 0 2px; }
36
- .wb-term-status { color: #8b93a3; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
37
- .wb-term-actions { display: flex; gap: 4px; }
38
-
39
- /* the tabs: one per session, the current one lit */
40
- /* the bar: the toggle, what the current tab says (status, actions), then the tabs and "+" at the right */
41
- .wb-term-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
42
- .wb-term-bar .wb-term-add { flex: none; }
43
- .wb-term-tab { display: inline-flex; align-items: center; flex: none; border-radius: 5px; }
44
- .wb-term-bar .wb-term-tab button { padding: 5px 4px 5px 8px; }
45
- .wb-term-bar .wb-term-tab .wb-term-tab-close { padding: 5px 7px 5px 3px; opacity: .45; }
46
- .wb-term-bar .wb-term-tab .wb-term-tab-close:hover { opacity: 1; background: transparent; border-color: transparent; }
47
- .wb-term-bar .wb-term-tab button:hover { background: transparent; border-color: transparent; }
48
- .wb-term-tab:hover { background: #1c2029; }
49
- .wb-term-tab.wb-current { background: #232836; color: #fff; }
50
- .wb-term-tab[data-exited] { color: #8b93a3; }
51
- .wb-term-bar .wb-term-add { padding: 3px 8px; font-size: 15px; line-height: 1; color: #8b93a3; }
52
- .wb-term-bar .wb-term-add:hover { color: #d7dae0; }
53
-
54
- /* content-box: the fit addon reads this height as the room for rows, so the padding must not be in it */
55
- .wb-term-screen { height: calc(var(--wb-term-h) - 10px); padding: 4px 0 6px 10px; box-sizing: content-box; overflow: hidden; }
56
- /* the screen as the server wrote it into the page, over the terminal until that has drawn it */
57
- .wb-term-screen { position: relative; }
58
- .wb-term-placeholder {
59
- position: absolute; inset: 4px 0 6px 10px; z-index: 1; overflow: hidden; background: #0f1115;
60
- font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; color: #d7dae0;
61
- }
62
- .wb-term-placeholder > div { height: 1.2em; }
63
- /* the server writes every tab's screen; the current tab's shows */
64
- .wb-term-placeholder:not(.wb-current) { display: none; }
65
- #wb-terminal[data-state=collapsed] .wb-term-screen { height: 0; padding: 0; visibility: hidden; }
66
-
67
- ::view-transition-group(wb-terminal) { animation-duration: .22s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
68
- /* opening and closing: the pictures keep their scale and stay anchored at the bar, so the text
69
- doesn't stretch while the drawer grows */
70
- ::view-transition-old(wb-terminal), ::view-transition-new(wb-terminal) { height: 100%; object-fit: none; object-position: top; }
71
- @media (prefers-reduced-motion: reduce) { ::view-transition-group(*) { animation: none !important; } }
@@ -1,19 +0,0 @@
1
- /* the table of contents (client.ts): in the margin left of the text, or opened from the header */
2
- .wb-toc { position: fixed; z-index: 4; font: .8rem/1.4 var(--sans, sans-serif); }
3
- .wb-toc[hidden], .wb-toc-toggle[hidden] { display: none; }
4
- .wb-toc-docked { top: 72px; left: max(16px, calc((100vw - var(--measure, 680px)) / 2 - 250px)); width: 210px; max-height: calc(100vh - 120px - var(--wb-inset-bottom, 0px)); overflow: auto; }
5
- .wb-toc-open:not(.wb-toc-docked) {
6
- top: 52px; left: 16px; width: min(300px, 100vw - 32px); max-height: calc(100vh - 100px - var(--wb-inset-bottom, 0px)); overflow: auto;
7
- padding: 6px; background: var(--bg, Canvas); border: 1px solid var(--border, #e3e5e9); border-radius: 8px; box-shadow: 0 8px 28px rgb(0 0 0 / .16);
8
- }
9
- .wb-toc ol { list-style: none; margin: 0; padding: 0; }
10
- .wb-toc li[data-level="3"] { padding-left: 14px; }
11
- .wb-toc a { display: flex; gap: 8px; align-items: baseline; padding: 3px 8px; border-radius: 5px; color: var(--muted, #696e76); text-decoration: none; border-left: 2px solid transparent; }
12
- .wb-toc a:hover { color: var(--text, CanvasText); background: color-mix(in srgb, var(--text, CanvasText) 6%, transparent); }
13
- .wb-toc a[aria-current] { color: var(--text, CanvasText); border-left-color: var(--accent, #1d5bbf); font-weight: 600; }
14
- .wb-toc-number { font-variant-numeric: tabular-nums; opacity: .7; flex: none; }
15
- .wb-toc-text { overflow: hidden; text-overflow: ellipsis; }
16
- /* something waits for the reader in this section */
17
- .wb-toc a[data-waiting]::after { content: ''; flex: none; width: 7px; height: 7px; margin-left: auto; align-self: center; border-radius: 50%; background: var(--accent, #1d5bbf); }
18
- .wb-toc-toggle { flex: none; display: inline-grid; place-items: center; height: 24px; box-sizing: border-box; padding: 0 7px; border-radius: 99px; border: 1px solid var(--border, #e3e5e9); background: none; color: var(--muted, #696e76); cursor: pointer; }
19
- .wb-toc-toggle:hover { color: var(--text, CanvasText); border-color: var(--muted, #696e76); }