Pages are now shared Yjs documents. docwell-server relays the y-websocket protocol at /collab (token sent as the first message), flushes updates to page_yupdates every second, and compacts them into page_ydoc with yrs compiled to WebAssembly under wazero (ADR-3) after 30 s idle or when the last editor leaves. Compaction refreshes content_json/content_text and records page_versions; versions can be listed, previewed and restored. The editor connects through a small y-protocols provider with carets and presence. Pages saved before this change are seeded from content_json. The yrs module lives in Server/ycrdt-wasm and is built by go generate, CI and the Dockerfiles rather than committed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
67 lines
2.6 KiB
CSS
67 lines
2.6 KiB
CSS
/* Document styles for the Docwell editor, from the design system's Document
|
|
type scale. Uses tokens from @docwell/ui/theme.css. */
|
|
|
|
.dw-prose {
|
|
outline: none;
|
|
font-family: var(--font-sans);
|
|
font-size: var(--text-doc-body);
|
|
line-height: var(--text-doc-body--line-height);
|
|
color: var(--color-ink);
|
|
min-height: 12rem;
|
|
}
|
|
/* Paragraph blocks sit space-2 apart; a heading gets space-5 above it. */
|
|
.dw-prose > * + * { margin-top: 8px; }
|
|
.dw-prose > :is(h1, h2, h3) { margin-top: 20px; }
|
|
.dw-prose h1 { font-family: var(--font-serif); font-size: var(--text-doc-h1); line-height: var(--text-doc-h1--line-height); font-weight: 600; }
|
|
.dw-prose h2 { font-family: var(--font-serif); font-size: var(--text-doc-h2); line-height: var(--text-doc-h2--line-height); font-weight: 600; }
|
|
.dw-prose h3 { font-size: var(--text-doc-h3); line-height: var(--text-doc-h3--line-height); font-weight: 600; }
|
|
.dw-prose ul { list-style: disc; padding-left: 1.5rem; }
|
|
.dw-prose ol { list-style: decimal; padding-left: 1.5rem; }
|
|
.dw-prose a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
|
|
.dw-prose blockquote { border-left: 3px solid var(--color-line); padding-left: 1rem; color: var(--color-ink-muted); }
|
|
.dw-prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--color-code-bg); padding: 0.1em 0.3em; border-radius: var(--radius-xs); }
|
|
.dw-prose pre {
|
|
font-family: var(--font-mono);
|
|
font-size: var(--text-code);
|
|
line-height: var(--text-code--line-height);
|
|
background: var(--color-code-bg);
|
|
padding: 12px 16px;
|
|
border-radius: var(--radius-md);
|
|
overflow-x: auto;
|
|
}
|
|
.dw-prose pre code { background: none; padding: 0; font-size: inherit; }
|
|
.dw-prose hr { border: none; border-top: 1px solid var(--color-line); margin: 24px 0; }
|
|
.dw-prose ::selection { background: var(--color-selection); }
|
|
.dw-prose p.is-editor-empty:first-child::before {
|
|
content: attr(data-placeholder);
|
|
color: var(--color-ink-faint);
|
|
float: left;
|
|
height: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Other editors' carets (CollaborationCaret's default render). */
|
|
.dw-prose .collaboration-carets__caret {
|
|
position: relative;
|
|
margin-left: -1px;
|
|
margin-right: -1px;
|
|
border-left: 1px solid;
|
|
border-right: 1px solid;
|
|
word-break: normal;
|
|
pointer-events: none;
|
|
}
|
|
.dw-prose .collaboration-carets__label {
|
|
position: absolute;
|
|
top: -1.4em;
|
|
left: -1px;
|
|
padding: 0.1rem 0.3rem;
|
|
border-radius: var(--radius-xs) var(--radius-xs) var(--radius-xs) 0;
|
|
font-family: var(--font-sans);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
line-height: normal;
|
|
color: #fff;
|
|
white-space: nowrap;
|
|
user-select: none;
|
|
}
|