Add the slash menu, bubble menu, mentions and inline comments

Editor:
- "/" opens a filterable block menu (text, headings, lists, quote, code,
  divider, and image or file upload when the host can store files).
- Selecting text shows a formatting toolbar (bold, italic, strike, code,
  link) and, for anyone who may comment, a Comment button.
- "@" finds people in the page's workspace; the mention node is always in
  the schema so documents with mentions open in every client.
- The popups are plain DOM in the design system's slash-menu style, so
  the framework-free mobile bridge keeps building and can use them.
- Menu words come from the host; the web app passes English or Polish.

Inline comments (basic): commenters cannot edit the document, so a
comment's anchor is a pair of Yjs relative positions stored with the
comment rather than a mark in the text. Highlights follow local edits by
mapping and are re-resolved when comments change or remote edits arrive.
Pages get a comments panel (side column, or a bottom sheet on narrow
screens). Authors and space admins can delete comments.

Server: comments collection and endpoints, and a people lookup any
workspace member may use for mentions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-10-31 17:25:19 +01:00
1 parent dac6d6da63
commit 92cd81fd96
32 files changed
+1992 -123

No files matched your search

+89
View File
@@ -149,3 +149,92 @@
white-space: nowrap;
user-select: none;
}
/* "@" mentions. */
.dw-prose .dw-mention {
border-radius: var(--radius-xs);
background: var(--color-accent-soft);
padding: 0 0.15em;
font-weight: 500;
white-space: nowrap;
}
/* Commented text; the active comment's text stands out more. */
.dw-prose .dw-comment {
background: color-mix(in srgb, var(--color-warning-soft) 70%, transparent);
border-bottom: 2px solid color-mix(in srgb, var(--color-warning) 55%, transparent);
cursor: pointer;
}
.dw-prose .dw-comment.is-active {
background: var(--color-warning-soft);
border-bottom-color: var(--color-warning);
}
/* The "/" and "@" popups (suggestion.ts): the design system's slash menu,
drawn without a framework so every host can show it. */
.dw-suggest {
position: fixed;
z-index: 60;
left: 0;
top: 0;
width: 20rem;
max-width: calc(100vw - 16px);
max-height: 22rem;
overflow-y: auto;
padding: 4px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
box-shadow: var(--dw-shadow-menu);
font-family: var(--font-sans);
}
.dw-suggest__query {
padding: 8px 8px 4px;
font-family: var(--font-mono);
font-size: var(--text-ui-xs);
color: var(--color-ink-muted);
}
.dw-suggest__empty {
padding: 6px 8px;
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
}
.dw-suggest__item {
display: flex;
align-items: center;
gap: 12px;
padding: 6px 8px;
border-radius: var(--radius-sm);
cursor: pointer;
}
.dw-suggest__item.is-active {
background: var(--color-surface-hover);
}
.dw-suggest__icon {
display: grid;
place-items: center;
flex-shrink: 0;
width: 36px;
height: 36px;
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: var(--color-surface);
color: var(--color-ink-muted);
}
.dw-suggest__text {
display: flex;
flex-direction: column;
min-width: 0;
}
.dw-suggest__label {
font-size: var(--text-ui-md);
font-weight: 500;
color: var(--color-ink);
}
.dw-suggest__desc {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: var(--text-ui-xs);
color: var(--color-ink-muted);
}