{#if selected}
{#if !renaming} {/if} Note versions
{#if currentImage} {#if currentImage.imageId === null}

This note names an image the instance does not have.

{:else} {@const isPreserved = currentImage.bytes > 0} {#if isPreserved} {currentImage.alt} {:else}
{currentImage.alt}
{/if} {#if currentImage.mime === 'image/gif'}

An animated GIF flattens to its first frame in the display copy. The original keeps every frame.

{/if}
{ if (currentImage) { noteImages[selected.id] = { ...currentImage, alt: e.currentTarget.value }; } e.currentTarget.form?.requestSubmit(); }} />
{#if replacing}

Replace this image? The previous image is not kept in history.

{ const file = e.currentTarget.files?.[0]; if (file) handleImageFile(file); e.currentTarget.value = ''; }} />
{:else if confirmingRemove}

Remove this image? The previous image is not kept in history.

{:else}
{/if} {/if} {:else}
{ e.preventDefault(); imageDragging = true; }} ondragleave={() => (imageDragging = false)} ondrop={(e) => { e.preventDefault(); imageDragging = false; const file = e.dataTransfer?.files?.[0]; if (file) handleImageFile(file); }} > { const file = e.currentTarget.files?.[0]; if (file) handleImageFile(file); e.currentTarget.value = ''; }} /> {#if uploadingImage}

Preparing image…

{:else}

Drop an image here, or

{/if}
{#if preserveOriginals} {/if}
{/if} {#if imageError}

{imageError}

{/if}
{#if renaming}
(renaming = false))} >
{:else}

{selected.title}

{/if} {#if !renaming && selectedType?.hasTemplate && noteIsEmpty}

{selectedType.name} starts from a template.

{/if} {#if templateError}

{templateError}

{/if} {#if noteError}

{noteError}

{/if} {#if !renaming}
{#if confirmingDelete}

Delete “{selected.title}”? Recovery can restore it.

{ confirmingDelete = false; openNote(null); })} >
{:else} {/if}
{/if}
{#key `${selected.id}:${editorEpoch}`} { latest = { ...latest, [saved.id]: { body: saved.body, text: saved.text, revision: saved.revision } }; if (saved.text.trim().length > 0 && templateRequests[saved.id]?.error) { templateRequests[saved.id] = { ...templateRequests[saved.id], error: null }; } }} /> {/key}

In scenes {scenesForNote.length}

{#if scenesForNote.length === 0}

Not linked to a scene yet. Link it from the scene inspector.

{:else}
    {#each scenesForNote as link (link.sceneId)}
  • {/each}
{/if}
{:else}

Story notes

{#if !creating} Types {/if} {#if onclose} {/if}
{#if noteError}

{noteError}

{/if} {#if creating}
{/if}
{#if notes.length === 0}

No notes yet. Characters, places, and objects you want beside the draft go here.

{:else} {#each grouped as group (group.type.id)} {@const collapsed = collapsedGroups.has(group.type.id)}

{#if !collapsed} {#each group.items as note (note.id)} {/each} {/if}
{/each} {/if}
{/if}