diff --git a/calliope-web/src/lib/components/desk/Artboard.svelte b/calliope-web/src/lib/components/desk/Artboard.svelte index c38efd8a..69756981 100644 --- a/calliope-web/src/lib/components/desk/Artboard.svelte +++ b/calliope-web/src/lib/components/desk/Artboard.svelte @@ -59,6 +59,9 @@ onCancel: (job: Job) => void; onSendToSlot: (path: string) => void; onDelete: (job: Job) => void; + canAttach?: boolean; + attachBusy?: boolean; + onAttach?: () => void; } let { @@ -80,9 +83,13 @@ onCancel, onSendToSlot, onDelete, + canAttach = false, + attachBusy = false, + onAttach, }: Props = $props(); let detailsOpen = $state(false); + let deleteOpen = $state(false); let outIndex = $state(0); let compare = $state(false), compareAt = $state(50), @@ -90,6 +97,7 @@ $effect(() => { void job?.id; detailsOpen = false; + deleteOpen = false; compare = false; lightbox = false; }); @@ -132,16 +140,27 @@ return live?.progress ?? 3; }); let dims = $state(''); + let naturalWidth = $state(1), + naturalHeight = $state(1); + let stageWidth = $state(0), + stageHeight = $state(0); + const fitted = $derived( + Math.min(stageWidth / naturalWidth, stageHeight / naturalHeight), + ); $effect.pre(() => { void output; dims = ''; }); function noteImg(e: Event) { const img = e.currentTarget as HTMLImageElement; + naturalWidth = img.naturalWidth; + naturalHeight = img.naturalHeight; dims = `${img.naturalWidth}×${img.naturalHeight}`; } function noteVideo(e: Event) { const v = e.currentTarget as HTMLVideoElement; + naturalWidth = v.videoWidth; + naturalHeight = v.videoHeight; dims = `${v.videoWidth}×${v.videoHeight}`; } @@ -175,40 +194,29 @@
+ 确认移除这条生成记录及生成文件?关联项目中的回流记录也会移除。确认后有 5 + 秒可撤销,提交后无法恢复。 +
+ {#snippet footer()}