Typst Editor (Svelte)
{#if loading} 加载中… {:else if saving} 保存中… {:else if compiling} 编译中… {:else} {activeFileDisplayPath} · 实时预览 {/if}
{#if activeFilePath}
{activeFileDisplayPath}
{/if}
{#if previewOpen}
Preview
{/if} {#if imageOpen}
原图定位
{#if imagePreviews.length > 0}
{#each imagePreviews as preview, i}
{preview.imageName}
{preview.imageName} {#if preview.width && preview.height} {#each preview.boxes as box, boxIndex (box.coordKey)} {@const bounds = getBoxBounds(box.coords)} {@const active = isActiveImageBox(preview.imageName, box.coordKey)} {@const edgeThickness = Math.max(3, Math.min(5, Math.min(bounds.maxX - bounds.minX, bounds.maxY - bounds.minY) * 0.08))} {@const horizontalHandleWidth = Math.max(10, Math.min((bounds.maxX - bounds.minX) * 0.7, Math.max(12, (bounds.maxX - bounds.minX) * 0.32)))} {@const verticalHandleHeight = Math.max(10, Math.min((bounds.maxY - bounds.minY) * 0.7, Math.max(12, (bounds.maxY - bounds.minY) * 0.32)))} startImageBoxEdit(e, i, boxIndex, 'move')} /> startImageBoxEdit(e, i, boxIndex, 'top')} /> startImageBoxEdit(e, i, boxIndex, 'right')} /> startImageBoxEdit(e, i, boxIndex, 'bottom')} /> startImageBoxEdit(e, i, boxIndex, 'left')} /> {/each} {/if}
{/each}
{:else}
点击或划选左侧预览区文本查看原图
{/if}
{/if}