Private
Public Access
Markdown support was already complete and documented, but nothing in the composer pointed at it -- unlike @, # and : (which advertise themselves when typed), formatting syntax was only discoverable via Help, buried in the account menu. The composer stays a plain markdown textarea; a new "Aa" button opens a toolbar that inserts the syntax for you: bold, italic, strikethrough, inline code, code block, link, quote, bulleted/numbered lists, H1-H3, sub/superscript. Collapsed by default, remembered across reloads and room switches. Clicking a button again removes the formatting (native undo doesn't track programmatic edits), and bold/italic/sub/strike toggles are run-length aware so "***x***" is handled correctly. The selection math is pure functions in lib/markdownFormat.ts, unit-tested. The "?" opens /help#formatting in a new tab so the draft isn't lost; HelpPage now scrolls to the hash once the guide has loaded, since the browser's own hash scroll fired before the async-fetched headings existed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
284 lines
5.1 KiB
CSS
284 lines
5.1 KiB
CSS
.composer {
|
|
position: relative;
|
|
padding: var(--sp-3) var(--sp-4);
|
|
border-top: 1px solid var(--ds-border);
|
|
background: var(--ds-surface);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
|
|
.composer-drop-overlay {
|
|
position: absolute;
|
|
inset: 4px;
|
|
z-index: 20;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: color-mix(in srgb, var(--ds-accent) 12%, var(--ds-surface) 88%);
|
|
border: 2px dashed var(--ds-accent);
|
|
border-radius: var(--radius);
|
|
color: var(--ds-accent);
|
|
font-size: 0.86rem;
|
|
font-weight: 700;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.composer-box {
|
|
display: flex;
|
|
gap: var(--sp-2);
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.composer-textarea-wrap {
|
|
position: relative;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.composer-box textarea {
|
|
width: 100%;
|
|
resize: none;
|
|
background: var(--ds-surface-2);
|
|
border: 1px solid var(--ds-border);
|
|
border-radius: var(--radius);
|
|
padding: 9px 12px;
|
|
color: var(--ds-text);
|
|
font-size: 0.88rem;
|
|
outline: none;
|
|
max-height: 120px;
|
|
}
|
|
|
|
.composer-box textarea:focus {
|
|
border-color: var(--ds-accent);
|
|
}
|
|
|
|
.composer-send {
|
|
width: 36px;
|
|
height: 36px;
|
|
flex: none;
|
|
border-radius: var(--radius);
|
|
background: var(--ds-accent);
|
|
color: var(--ds-void);
|
|
border: none;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-send:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.composer-file-input {
|
|
display: none;
|
|
}
|
|
|
|
.composer-emoji-wrap {
|
|
position: relative;
|
|
flex: none;
|
|
}
|
|
|
|
.composer-emoji-trigger {
|
|
width: 36px;
|
|
height: 36px;
|
|
flex: none;
|
|
border-radius: var(--radius);
|
|
background: transparent;
|
|
border: 1px solid var(--ds-border);
|
|
font-size: 1rem;
|
|
line-height: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-emoji-trigger:hover:not(:disabled) {
|
|
border-color: var(--ds-accent);
|
|
}
|
|
|
|
.composer-emoji-trigger:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.composer-format-toggle {
|
|
width: 36px;
|
|
height: 36px;
|
|
flex: none;
|
|
border-radius: var(--radius);
|
|
background: transparent;
|
|
color: var(--ds-muted);
|
|
border: 1px solid var(--ds-border);
|
|
font-size: 0.82rem;
|
|
font-weight: 700;
|
|
line-height: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-format-toggle:hover:not(:disabled),
|
|
.composer-format-toggle-open {
|
|
color: var(--ds-text);
|
|
border-color: var(--ds-accent);
|
|
}
|
|
|
|
.composer-format-toggle:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.composer-attach-wrap {
|
|
position: relative;
|
|
flex: none;
|
|
}
|
|
|
|
.composer-attach {
|
|
width: 36px;
|
|
height: 36px;
|
|
flex: none;
|
|
border-radius: var(--radius);
|
|
background: transparent;
|
|
color: var(--ds-muted);
|
|
border: 1px solid var(--ds-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-attach-menu-scrim {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 30;
|
|
}
|
|
|
|
.composer-attach-menu {
|
|
position: absolute;
|
|
bottom: calc(100% + 8px);
|
|
left: 0;
|
|
z-index: 31;
|
|
background: var(--card-bg);
|
|
border: 1px solid var(--ds-border);
|
|
border-radius: var(--radius);
|
|
padding: var(--sp-2);
|
|
min-width: 160px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.composer-attach-menu button[role='menuitem'] {
|
|
background: transparent;
|
|
border: none;
|
|
color: var(--ds-text);
|
|
text-align: left;
|
|
padding: 8px;
|
|
border-radius: 6px;
|
|
font-size: 0.86rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-attach-menu button[role='menuitem']:hover {
|
|
background: var(--ds-surface-2);
|
|
}
|
|
|
|
.composer-attach:hover:not(:disabled) {
|
|
color: var(--ds-text);
|
|
border-color: var(--ds-accent);
|
|
}
|
|
|
|
.composer-attach:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.composer-spinner {
|
|
animation: composer-spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes composer-spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
.composer-attachment {
|
|
position: relative;
|
|
width: fit-content;
|
|
}
|
|
|
|
.composer-attachment-thumb {
|
|
max-height: 72px;
|
|
max-width: 140px;
|
|
border-radius: var(--radius);
|
|
border: 1px solid var(--ds-border);
|
|
display: block;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.composer-attachment-file {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
background: var(--ds-surface-2);
|
|
border: 1px solid var(--ds-border);
|
|
border-radius: var(--radius);
|
|
padding: 6px 28px 6px 10px;
|
|
color: var(--ds-text);
|
|
max-width: 260px;
|
|
}
|
|
|
|
.composer-attachment-file svg {
|
|
flex: none;
|
|
color: var(--ds-muted);
|
|
}
|
|
|
|
.composer-attachment-filename {
|
|
font-size: 0.82rem;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.composer-attachment-size {
|
|
font-size: 0.72rem;
|
|
color: var(--ds-muted);
|
|
font-family: var(--mono);
|
|
flex: none;
|
|
}
|
|
|
|
.composer-attachment-remove {
|
|
position: absolute;
|
|
top: -6px;
|
|
right: -6px;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: 50%;
|
|
background: var(--ds-surface-2);
|
|
border: 1px solid var(--ds-border);
|
|
color: var(--ds-text);
|
|
font-size: 0.7rem;
|
|
line-height: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.composer-status {
|
|
font-size: 0.76rem;
|
|
color: var(--ds-muted);
|
|
padding-left: 2px;
|
|
}
|
|
|
|
.composer-error {
|
|
color: var(--ds-danger, #e5484d);
|
|
}
|