merge: 合入最新 main(#353 agent-open-tools / #360 markdown-html-toc 等),解决 PR 合并性

# Conflicts:
#	src/client/EditorHost.tsx
#	tests/prefs.spec.ts
This commit is contained in:
HuanLinOTO
2026-08-24 16:41:02 +08:00
58 changed files with 2685 additions and 91 deletions
+132
View File
@@ -2758,3 +2758,135 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
.openWithPinActive {
color: var(--dsw-alias-state-business-primary);
}
/* ── Markdown preview: raw-HTML runs + table of contents ─────────────────
The HTML runs lifted out of the markdown source (MarkdownHtml.tsx) render
as sanitized block leaves; the TOC is a zero-height sticky bar keeping the
outline button pinned at the preview's top-right without consuming layout.
All visuals ride the alias tokens (skin system follows automatically). */
/* A sanitized HTML run leaf (block-level box; content is DOMPurify output). */
.editorHtmlBlock {
margin: 8px 0;
}
.editorHtmlBlock img,
.editorHtmlBlock video {
max-width: 100%;
}
.editorHtmlBlock details {
margin: 4px 0;
padding: 4px 0;
}
.editorHtmlBlock summary {
cursor: pointer;
}
/* The zero-height sticky bar: occupies no layout, keeps the button visible
while the preview scrolls, and lets pointer events pass through the bar
itself (only the interactive children re-enable them). */
.tocBar {
position: sticky;
top: 0;
z-index: 3;
display: flex;
justify-content: flex-end;
height: 0;
pointer-events: none;
}
.tocButton {
pointer-events: auto;
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
margin: 4px 2px 0 0;
padding: 0;
border: 1px solid var(--dsw-alias-border-l1);
border-radius: 6px;
background: var(--dsw-alias-bg-layer-1);
color: var(--dsw-alias-label-secondary);
cursor: pointer;
}
.tocButton:hover {
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-primary);
}
/* The outline popover, anchored under the button (the bar is the containing
block; its height is 0, so the panel drops below the pinned button row). */
.tocPanel {
position: absolute;
top: 32px;
right: 2px;
display: flex;
flex-direction: column;
width: min(300px, 82%);
max-height: 60vh;
overflow-y: auto;
padding: 4px;
border: 1px solid var(--dsw-alias-border-l1);
border-radius: 8px;
background: var(--dsw-alias-bg-layer-2);
box-shadow: var(--dsw-shadow-lv2);
pointer-events: auto;
}
.tocItem {
display: flex;
align-items: baseline;
gap: 8px;
min-width: 0;
padding: 4px 8px;
border: none;
border-radius: 6px;
background: transparent;
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xxs-12);
text-align: left;
cursor: pointer;
}
.tocItem:hover {
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-primary);
}
/* Indent by heading level (h2 = one step, h3 = two steps…). */
.tocItem[data-level='2'] { padding-left: 18px; }
.tocItem[data-level='3'] { padding-left: 28px; }
.tocItem[data-level='4'] { padding-left: 38px; }
.tocItem[data-level='5'] { padding-left: 48px; }
.tocItem[data-level='6'] { padding-left: 58px; }
/* The tiny level number keeps deep outlines scannable. */
.tocItemLevel {
flex: none;
font: var(--dsw-font-xxxs-11);
color: var(--dsw-alias-label-tertiary);
}
.tocItemText {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* The jumped-to heading flashes once (the class is added to the host-rendered
heading element by md-toc.tsx; @keyframes rides the CSS module). */
@keyframes dsh-toc-flash {
0%, 60% { background: var(--dsw-alias-interactive-bg-hover); }
100% { background: transparent; }
}
.tocFlash {
animation: dsh-toc-flash 1.2s ease-out;
border-radius: 4px;
}