feat(compose): 正文内嵌隐藏块并升级 Markdown 编辑器

去掉整帖可见性表单,改为 :::hide 按块脱敏;工具栏补齐代码块、链接/图片对话框与粘贴拖拽上传。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-17 04:58:20 +08:00
parent d1155cbd64
commit 01e2fd05ca
19 changed files with 1867 additions and 471 deletions

View File

@@ -1320,9 +1320,137 @@ body {
color: var(--accent);
}
.j13-md-tool:disabled { opacity: 0.4; }
.j13-md-tool:focus-visible {
.j13-md-tool.is-active {
background: var(--accent-soft);
color: var(--accent);
}
.j13-md-sep {
width: 1px;
height: 18px;
margin: 0 4px;
background: var(--line);
flex-shrink: 0;
}
.j13-md-popover-anchor {
position: relative;
}
.j13-md-popover {
position: absolute;
top: calc(100% + 6px);
left: 0;
z-index: 40;
min-width: 168px;
padding: 6px;
border-radius: 12px;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow-lg);
display: flex;
flex-direction: column;
gap: 2px;
}
.j13-md-popover-wide {
min-width: 200px;
max-height: 280px;
}
.j13-md-popover-form {
min-width: 260px;
padding: 10px;
gap: 8px;
}
.j13-md-popover button[role="menuitem"],
.j13-md-menu-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
text-align: left;
padding: 8px 10px;
border-radius: 8px;
font-size: 13px;
color: var(--ink);
background: transparent;
}
.j13-md-popover button[role="menuitem"]:hover,
.j13-md-menu-item:hover {
background: var(--accent-soft);
color: var(--accent);
}
.j13-md-popover-input {
width: 100%;
height: 34px;
padding: 0 10px;
border-radius: 8px;
border: 1px solid var(--line);
background: var(--bg);
color: var(--ink);
font-size: 13px;
}
.j13-md-popover-input:focus {
outline: 2px solid var(--accent);
outline-offset: 1px;
outline-offset: 0;
}
.j13-md-popover-list {
max-height: 200px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 1px;
}
.j13-md-popover-list button {
text-align: left;
padding: 7px 10px;
border-radius: 8px;
font-size: 12.5px;
font-family: var(--font-mono, ui-monospace, monospace);
color: var(--ink-2);
}
.j13-md-popover-list button:hover {
background: var(--accent-soft);
color: var(--accent);
}
.j13-md-field {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: var(--ink-3);
}
.j13-md-popover-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 2px;
}
.btn-sm {
height: 30px;
padding: 0 12px;
font-size: 12.5px;
}
.j13-md-write-wrap {
position: relative;
flex: 1 1 auto;
display: flex;
flex-direction: column;
min-height: 0;
}
.j13-md-write-wrap.is-dragover .j13-md-textarea {
opacity: 0.35;
}
.j13-md-drop-mask {
position: absolute;
inset: 8px 0;
z-index: 5;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12px;
border: 2px dashed var(--accent);
background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
color: var(--accent);
font-weight: 600;
font-size: 14px;
pointer-events: none;
}
.j13-md-mode {
display: inline-flex;
@@ -1394,6 +1522,66 @@ body {
background: transparent;
}
/* 正文内嵌隐藏块 */
.j13-hide-block {
margin: 1.1rem 0;
border-radius: 14px;
border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
overflow: hidden;
}
.j13-hide-block-bar {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 14px;
border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
}
.j13-hide-badge {
display: inline-flex;
align-items: center;
height: 22px;
padding: 0 9px;
border-radius: 999px;
font-size: 11.5px;
font-weight: 600;
color: var(--accent);
background: var(--accent-soft);
}
.j13-hide-block-body {
padding: 12px 16px 14px;
}
.j13-hide-block-body > :first-child { margin-top: 0; }
.j13-hide-block-body > :last-child { margin-bottom: 0; }
.j13-hide-gate {
margin: 1.1rem 0;
border-radius: 14px;
padding: 1.35rem 1.25rem;
text-align: center;
background: var(--accent-soft);
border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent);
}
.j13-hide-gate-icon {
margin: 0 auto 0.55rem;
color: var(--accent);
}
.j13-hide-gate-title {
font-weight: 700;
font-size: 15px;
color: var(--ink);
margin-bottom: 0.25rem;
}
.j13-hide-gate-desc {
margin-bottom: 0.9rem;
font-size: 13px;
}
.j13-hide-gate-actions {
display: flex;
justify-content: center;
gap: 8px;
flex-wrap: wrap;
}
.j13-compose-shell {
background: var(--panel);
border: 1px solid var(--line);