diff --git a/src/lib/catalog/pages.ts b/src/lib/catalog/pages.ts new file mode 100644 index 00000000..0fbe7061 --- /dev/null +++ b/src/lib/catalog/pages.ts @@ -0,0 +1,23 @@ +import type { VolumeData, Page } from '$lib/types'; + +/** + * Get the current working version of pages. + * Returns edited version if it exists, otherwise original. + */ +export function getCurrentPages(volumeData: VolumeData): Page[] { + return volumeData.edited_pages ?? volumeData.pages; +} + +/** + * Check if volume has edits + */ +export function hasEdits(volumeData: VolumeData): boolean { + return volumeData.edited_pages !== undefined; +} + +/** + * Get original pages (for reference in editor) + */ +export function getOriginalPages(volumeData: VolumeData): Page[] { + return volumeData.pages; +} diff --git a/src/lib/components/Editor/EditCanvas.svelte b/src/lib/components/Editor/EditCanvas.svelte new file mode 100644 index 00000000..5c0c335d --- /dev/null +++ b/src/lib/components/Editor/EditCanvas.svelte @@ -0,0 +1,127 @@ + + +
{line}
+ {/each} +Failed to load page data
+