feat(后端架构): 完善后端解耦
build.yaml / build (push) Successful in 39s

This commit is contained in:
xiaoqidun committed 2026-09-23 16:12:57 +08:00
1 parent 73472c5d4b
commit 77ffbe6a72
56 files changed
+2420 -1635

No files matched your search

+13 -10
View File
@@ -43,13 +43,14 @@
<button id="continuousButton" class="button" type="button" data-short="连" title="连续显示" aria-label="连续显示" aria-pressed="false" disabled>连续</button>
<button id="annotationButton" class="button" type="button" data-short="注" title="隐藏注解" aria-label="隐藏注解" aria-pressed="true">注解</button>
</div>
<div class="tool-group">
<div class="tool-group" role="group" aria-labelledby="exportLabel">
<span id="exportLabel" class="tool-label">导出</span>
<select id="exportFormat" class="format-select" title="导出格式" aria-label="导出格式" disabled></select>
<select id="imageDPI" class="format-select dpi-select" title="图片 DPI" aria-label="图片 DPI" disabled>
<option value="96">96</option>
<option value="150">150</option>
<option value="300" selected>300</option>
<option value="600">600</option>
<select id="imageDPI" class="format-select dpi-select" title="导出DPI(仅PNG/JPG)" aria-label="导出DPI" disabled>
<option value="96">96 dpi</option>
<option value="150">150 dpi</option>
<option value="300" selected>300 dpi</option>
<option value="600">600 dpi</option>
</select>
<button id="exportPageButton" class="button" type="button" data-short="单" title="导出单页" aria-label="导出单页" disabled>单页</button>
<button id="exportButton" class="button" type="button" data-short="多" title="导出文档" aria-label="导出文档" aria-haspopup="dialog" aria-controls="exportPanel" disabled>文档</button>
@@ -434,21 +435,23 @@
<section id="renderPanel" class="render-panel" aria-label="渲染">
<div class="panel-row">
<label class="panel-title compact" for="renderBackend">渲染</label>
<select id="renderBackend" title="渲染后端" disabled></select>
<div class="render-controls">
<select id="renderBackend" title="渲染后端" disabled></select>
</div>
</div>
<div class="render-mode-row">
<span id="renderModeLabel">显示</span>
<span id="renderModeLabel">预览</span>
<div class="render-controls">
<div class="render-modes" role="group" aria-labelledby="renderModeLabel">
<button id="renderVectorButton" class="small-button" type="button" aria-pressed="true" title="矢量显示" disabled>矢量</button>
<button id="renderRasterButton" class="small-button" type="button" aria-pressed="false" title="位图显示" disabled>位图</button>
</div>
<select id="renderDPI" aria-label="精度" title="位图精度" disabled><option value="96">96 dpi</option><option value="150" selected>150 dpi</option><option value="300">300 dpi</option></select>
<select id="renderDPI" aria-label="预览DPI" title="预览DPI(仅位图)" disabled><option value="96">96 dpi</option><option value="150" selected>150 dpi</option><option value="300">300 dpi</option><option value="600">600 dpi</option></select>
</div>
</div>
<details class="render-support">
<summary>详情</summary>
<dl><div><dt>显示</dt><dd id="renderDisplay">SVG</dd></div><div><dt>编辑</dt><dd>SVG</dd></div><div><dt>编译</dt><dd id="renderCompiler"></dd></div><div><dt>图片</dt><dd id="renderImages"></dd></div><div><dt>SVG</dt><dd id="renderSVG"></dd></div><div><dt>PDF</dt><dd id="renderPDF"></dd></div><div><dt>EPS</dt><dd id="renderEPS"></dd></div></dl>
<dl><div><dt>显示</dt><dd id="renderDisplay">SVG</dd></div><div><dt>编辑</dt><dd>SVG</dd></div><div><dt>字体</dt><dd id="renderFonts"></dd></div><div><dt>几何</dt><dd id="renderGeometry"></dd></div><div><dt>编译</dt><dd id="renderCompiler"></dd></div><div><dt>图片</dt><dd id="renderImages"></dd></div><div><dt>SVG</dt><dd id="renderSVG"></dd></div><div><dt>PDF</dt><dd id="renderPDF"></dd></div><div><dt>EPS</dt><dd id="renderEPS"></dd></div></dl>
</details>
</section>
<div class="panel-row">
+17 -17
View File
@@ -620,7 +620,12 @@ button:not(:disabled):hover {
}
.dpi-select {
width: 54px;
width: 79px;
}
.tool-label {
color: var(--text-muted);
white-space: nowrap;
}
.form-dialog {
@@ -985,6 +990,8 @@ body[data-hide-meta] .meta-panel {
}
.render-panel {
--render-controls-width: 166px;
--render-modes-width: 79px;
position: relative;
margin-bottom: 12px;
padding-bottom: 12px;
@@ -992,8 +999,7 @@ body[data-hide-meta] .meta-panel {
}
.render-panel select {
width: 180px;
max-width: calc(100% - 76px);
width: 100%;
height: 28px;
font-size: 12px;
}
@@ -1012,10 +1018,10 @@ body[data-hide-meta] .meta-panel {
}
.render-controls {
display: flex;
display: grid;
grid-template-columns: var(--render-modes-width) minmax(0, 1fr);
align-items: center;
width: 180px;
max-width: calc(100% - 76px);
width: var(--render-controls-width);
gap: 8px;
}
@@ -1025,7 +1031,7 @@ body[data-hide-meta] .meta-panel {
}
.render-modes .small-button {
width: 36px;
width: 40px;
height: 28px;
padding: 0;
}
@@ -1041,13 +1047,6 @@ body[data-hide-meta] .meta-panel {
color: var(--accent-strong);
}
.render-controls select {
flex: 1;
width: 0;
min-width: 0;
max-width: 100%;
}
.render-support {
font-size: 12px;
color: var(--text-muted);
@@ -1056,8 +1055,9 @@ body[data-hide-meta] .meta-panel {
.render-support summary {
position: absolute;
top: 0;
left: 32px;
width: fit-content;
right: 0;
width: calc(var(--render-controls-width) - var(--render-modes-width) - 8px);
text-align: center;
line-height: 28px;
cursor: pointer;
color: var(--accent-strong);
@@ -2579,6 +2579,6 @@ button.outline-link:hover {
}
.dpi-select {
width: 48px;
width: 79px;
}
}
+6
View File
@@ -332,6 +332,8 @@ const el = {
renderPDF: document.querySelector("#renderPDF"),
renderEPS: document.querySelector("#renderEPS"),
renderCompiler: document.querySelector("#renderCompiler"),
renderFonts: document.querySelector("#renderFonts"),
renderGeometry: document.querySelector("#renderGeometry"),
offlineStatus: document.querySelector("#offlineStatus"),
refreshAppButton: document.querySelector("#refreshAppButton"),
metaFile: document.querySelector("#metaFile"),
@@ -3140,6 +3142,7 @@ function updateRenderBackend() {
el.renderDPI.value = String(state.renderDPI);
el.renderBackend.disabled = !state.ready || state.exporting || document.body.hasAttribute("aria-busy");
el.renderDPI.disabled = el.renderBackend.disabled || displayMode() === "svg";
el.renderDPI.title = displayMode() === "svg" ? "矢量预览无需DPI" : "预览DPI(仅位图)";
el.renderVectorButton.disabled = el.renderRasterButton.disabled = el.renderBackend.disabled || state.editing;
el.renderVectorButton.setAttribute("aria-pressed", String(displayMode() === "svg"));
el.renderRasterButton.setAttribute("aria-pressed", String(displayMode() === "raster"));
@@ -3152,6 +3155,8 @@ function updateRenderBackend() {
el.renderPDF.textContent = renderBackendLabel(backend?.pdf);
el.renderEPS.textContent = renderBackendLabel(backend?.eps);
el.renderCompiler.textContent = renderBackendLabel(backend?.compiler);
el.renderFonts.textContent = renderBackendLabel(backend?.fonts);
el.renderGeometry.textContent = renderBackendLabel(backend?.geometry);
}
async function refreshRenderBackend(anchor = scaleAnchor(0)) {
@@ -6348,6 +6353,7 @@ function exportFormatUsesDPI(value) {
function updateDPIControl() {
el.imageDPI.disabled = state.exporting || !state.doc || !exportFormatUsesDPI(el.exportFormat.value);
el.imageDPI.title = exportFormatUsesDPI(el.exportFormat.value) ? "导出DPI(仅PNG/JPG)" : "当前格式无需DPI";
}
function currentImageDPI() {