feat(documents): rebuild project document workbench

This commit is contained in:
2026-07-24 12:16:02 +08:00
parent 366136cee9
commit 77beaebb30
73 changed files with 5867 additions and 1264 deletions

View File

@@ -1400,6 +1400,386 @@
min-width: 0;
}
.documents-canvas {
position: relative;
height: calc(100vh - 90px);
min-height: 560px;
display: flex;
margin: -16px;
overflow: hidden;
background: var(--senlin-panel);
color: var(--senlin-text);
}
.documents-tree-pane {
min-width: 210px;
max-width: 420px;
display: flex;
flex: 0 0 auto;
flex-direction: column;
overflow: hidden;
border-right: 1px solid var(--senlin-border);
background: color-mix(in srgb, var(--senlin-panel) 94%, var(--senlin-bg));
}
.documents-tree-tools,
.documents-tabs-bar {
min-height: 42px;
display: flex;
align-items: center;
border-bottom: 1px solid var(--senlin-border);
}
.documents-tree-tools {
gap: 2px;
padding: 0 6px;
}
.documents-tree-spacer {
flex: 1;
}
.documents-tree {
min-height: 0;
flex: 1;
overflow: auto;
padding: 6px 0 12px;
}
.document-tree-row {
width: calc(100% - 8px);
height: 30px;
display: flex;
align-items: center;
gap: 7px;
margin: 1px 4px;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--senlin-text);
font-size: 13px;
text-align: left;
cursor: default;
}
.document-tree-row:hover {
background: color-mix(in srgb, var(--senlin-primary) 8%, transparent);
}
.document-tree-row.active {
background: color-mix(in srgb, var(--senlin-primary) 14%, transparent);
color: var(--senlin-primary);
}
.document-tree-row > span:last-child {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.document-tree-row .arco-icon {
flex: 0 0 auto;
}
.tree-chevron {
width: 11px;
flex: 0 0 11px;
color: var(--senlin-muted);
font-size: 15px;
line-height: 1;
}
.documents-resizer {
z-index: 2;
width: 4px;
flex: 0 0 4px;
margin-left: -4px;
cursor: col-resize;
}
.documents-resizer:hover {
background: var(--senlin-primary);
}
.documents-editor-pane {
min-width: 0;
display: flex;
flex: 1;
flex-direction: column;
}
.documents-tabs-bar {
flex: 0 0 42px;
background: color-mix(in srgb, var(--senlin-panel) 97%, var(--senlin-bg));
}
.documents-tabs {
min-width: 0;
display: flex;
flex: 1;
align-self: stretch;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
}
.document-tab {
min-width: 132px;
max-width: 220px;
display: flex;
align-items: center;
gap: 7px;
border: 0;
border-right: 1px solid var(--senlin-border);
border-bottom: 2px solid transparent;
background: color-mix(in srgb, var(--senlin-bg) 50%, var(--senlin-panel));
color: var(--senlin-muted);
padding: 0 10px;
cursor: pointer;
}
.document-tab.active {
border-bottom-color: var(--senlin-primary);
background: var(--senlin-panel);
color: var(--senlin-text);
}
.document-tab > span {
min-width: 0;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
.document-tab > .arco-icon:last-child {
opacity: 0;
}
.document-tab:hover > .arco-icon:last-child,
.document-tab.active > .arco-icon:last-child {
opacity: 1;
}
.save-dot {
width: 6px;
height: 6px;
flex: 0 0 6px;
border-radius: 50%;
background: transparent;
}
.save-dot.dirty {
background: #ff7d00;
}
.save-dot.saving {
background: #165dff;
animation: document-pulse 1s infinite;
}
.save-dot.saved {
background: #00b42a;
}
.save-dot.error {
background: #f53f3f;
}
@keyframes document-pulse {
50% { opacity: 0.3; }
}
.documents-tab-actions {
height: 100%;
display: flex;
flex: 0 0 auto;
align-items: center;
border-left: 1px solid var(--senlin-border);
padding: 0 5px;
}
.document-editor-body {
min-height: 0;
flex: 1;
overflow: hidden;
background: var(--senlin-panel);
}
.document-codemirror,
.document-codemirror .cm-editor {
height: 100%;
}
.document-markdown-preview,
.document-office-preview,
.document-text-preview,
.document-sheet-preview {
width: min(900px, calc(100% - 48px));
height: 100%;
box-sizing: border-box;
margin: 0 auto;
overflow: auto;
padding: 28px 34px 60px;
}
.document-markdown-preview {
font-size: 15px;
line-height: 1.75;
}
.document-markdown-preview img {
max-width: 100%;
}
.document-markdown-preview pre,
.document-text-preview {
border-radius: 6px;
background: color-mix(in srgb, var(--senlin-bg) 78%, var(--senlin-panel));
padding: 14px;
white-space: pre-wrap;
}
.document-markdown-preview table,
.document-sheet-preview table {
border-collapse: collapse;
}
.document-markdown-preview th,
.document-markdown-preview td,
.document-sheet-preview td {
border: 1px solid var(--senlin-border);
padding: 7px 10px;
}
.document-pdf-preview {
width: 100%;
height: 100%;
border: 0;
}
.document-media-preview {
width: 100%;
height: 100%;
display: grid;
place-items: center;
overflow: auto;
padding: 24px;
box-sizing: border-box;
}
.document-media-preview img,
.document-media-preview video {
max-width: 100%;
max-height: 100%;
}
.document-upload-summary {
display: grid;
gap: 6px;
border-top: 1px solid var(--senlin-border);
padding: 9px 10px 10px;
font-size: 12px;
}
.document-upload-summary > div,
.document-upload-row {
min-width: 0;
display: flex;
justify-content: space-between;
gap: 8px;
}
.document-upload-row span:first-child {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.document-upload-row button {
border: 0;
background: transparent;
color: var(--senlin-primary);
padding: 0;
font-size: 12px;
cursor: pointer;
}
.document-context-menu {
position: fixed;
z-index: 1000;
width: 150px;
display: grid;
border: 1px solid var(--senlin-border);
border-radius: 6px;
background: var(--senlin-panel);
box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
padding: 5px;
}
.document-context-menu button {
display: flex;
align-items: center;
gap: 8px;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--senlin-text);
padding: 8px 10px;
text-align: left;
}
.document-context-menu button:hover {
background: var(--senlin-soft-blue);
}
.document-context-menu button.danger {
color: #f53f3f;
}
.documents-mobile-switch {
display: none;
}
@media (max-width: 720px) {
.documents-canvas {
min-height: 480px;
}
.documents-canvas .documents-tree-pane,
.documents-canvas .documents-editor-pane {
width: 100% !important;
max-width: none;
}
.documents-canvas.mobile-tree .documents-editor-pane,
.documents-canvas.mobile-editor .documents-tree-pane,
.documents-canvas .documents-resizer {
display: none;
}
.documents-mobile-switch {
display: block;
border-bottom: 1px solid var(--senlin-border);
padding: 4px 8px;
}
.document-markdown-preview,
.document-office-preview,
.document-text-preview,
.document-sheet-preview {
width: 100%;
padding: 20px 18px 48px;
}
.documents-tab-actions .arco-btn {
padding: 0 7px;
}
}
.compact-card .arco-card-body {
padding: 12px 14px;
}