Syntax Highlighting tool, Markdown guide, unread share badge, Open in menu

- Syntax Highlighting (/syntax): highlight.js tokens rendered with VS Code
  (Dark/Light Modern, One Dark Pro, Monokai, Dracula, GitHub) and Android
  Studio (Darcula, Dark, IntelliJ Light) colors; copy as rich text (VS Code
  clipboard HTML), download RTF, share. Format via Prettier/sql-formatter
  (lazy-loaded), the JSON printer, or built-in whitespace-only formatters
  for brace languages, Python and XML.
- Markdown: Guide dialog, source next to rendered output, with Insert.
- Pastes created by Share count as unread on the Pastebin nav badge.
- Paste view: Open in menu built from registry opensPaste tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
neil 2026-11-02 00:30:13 -08:00
parent f4232ef9b5
commit dc2b12a3c6
37 changed files with 3704 additions and 27 deletions

View file

@ -277,3 +277,54 @@ textarea { tab-size: 4; }
.md-workspace[data-mode='split'], .json-workspace[data-mode='split'] { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.md-workspace[data-mode='preview'] .md-preview { padding: 20px 16px 60px; }
}
/* ---------- syntax highlighting ---------- */
.syntax-workspace[data-mode='source'], .syntax-workspace[data-mode='output'] { grid-template-columns: 1fr; }
.syntax-workspace[data-mode='source'] .syntax-out-pane,
.syntax-workspace[data-mode='output'] .md-edit-pane { display: none; }
.code-input { white-space: pre; overflow: auto; tab-size: 4; }
.syntax-out-pane { display: flex; flex-direction: column; overflow: hidden; }
.syntax-bar { flex-wrap: wrap; background: var(--surface); }
.syntax-output { flex: 1; overflow: auto; }
.syntax-output > div { min-height: 100%; width: max-content; min-width: 100%; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }
@media (max-width: 800px) {
.syntax-workspace[data-mode='split'] { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
/* ---------- badges, chips ---------- */
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font: 600 11px/20px var(--sans); text-align: center; }
.menu-btn { position: relative; }
.menu-btn.has-badge::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.chip { padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 600; }
.chip.new { background: var(--accent-soft); color: var(--accent); }
/* ---------- dropdown menu ---------- */
.dropdown { position: relative; display: inline-flex; }
.caret { font-size: 10px; opacity: 0.7; }
.menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; min-width: 200px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; background: none; color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
/* ---------- modal ---------- */
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; margin: 0; font-size: 17px; }
.modal-body { overflow: auto; padding: 0 20px 20px; }
/* markdown guide */
.guide-cols { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px 0 8px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.guide-section { margin: 20px 0 4px; font-size: 15px; }
.guide-row { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: 'label label' 'src out'; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.guide-label { grid-area: label; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.guide-src { grid-area: src; margin: 0; padding: 10px 12px; border-radius: 6px; background: var(--code-bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-out { grid-area: out; font-size: 14px; }
.guide-out > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
.guide-row { grid-template-columns: 1fr; grid-template-areas: 'label' 'src' 'out'; }
.guide-cols { display: none; }
}