diff --git a/src/lib/components/viewer/Note.svelte b/src/lib/components/viewer/Note.svelte index 274f1fd3b..cdca8702c 100644 --- a/src/lib/components/viewer/Note.svelte +++ b/src/lib/components/viewer/Note.svelte @@ -13,7 +13,7 @@ import type { Document, Note, Sizes } from "$lib/api/types"; import DOMPurify from "isomorphic-dompurify"; - import { createEventDispatcher, onMount } from "svelte"; + import { createEventDispatcher } from "svelte"; import { _ } from "svelte-i18n"; import { Globe16, @@ -25,7 +25,7 @@ } from "svelte-octicons"; import { ALLOWED_ATTR, ALLOWED_TAGS } from "@/config/config.js"; - import { width, height, isPageLevel, noteHashUrl } from "$lib/api/notes"; + import { width, height, isPageLevel } from "$lib/api/notes"; import { pageImageUrl } from "$lib/api/documents"; import Portal from "../layouts/Portal.svelte"; import Modal from "../layouts/Modal.svelte"; @@ -40,13 +40,13 @@ import { getViewerHref } from "$lib/utils/viewer"; import Button from "../common/Button.svelte"; - const documentStore = getDocument(); const pdf = getPDF(); const embed = isEmbedded(); const mode = getCurrentMode(); const dispatch = createEventDispatcher(); + export let document = getDocument(); export let note: Note; export let scale = 2; @@ -77,12 +77,12 @@ let shareNoteOpen = false; - $: document = $documentStore; + $: doc = $document; $: page_level = isPageLevel(note); $: page_number = note.page_number + 1; // note pages are 0-indexed $: user = typeof note.user === "object" ? (note.user as User) : null; - $: rendering = render(canvas, document, $pdf); // avoid re-using the same canvas - $: edit_link = getViewerHref({ document, note, mode: "annotating" }); + $: rendering = render(canvas, doc, $pdf); // avoid re-using the same canvas + $: edit_link = getViewerHref({ document: doc, note, mode: "annotating" }); $: canEdit = note.edit_access && !embed; async function render( @@ -207,7 +207,7 @@ style:--note-height={height(note)} >
- {#if !page_level && $mode === "document"} + {#if !embed && !page_level && $mode === "document"} @@ -231,36 +231,44 @@

{@html clean(note.content)}

{/if} - + + + {/if} -{#if shareNoteOpen} +{#if !embed && shareNoteOpen} (shareNoteOpen = false)}>

{$_("dialog.share")}

- +
{/if} diff --git a/src/routes/embed/documents/[id]/annotations/[note_id]/+page.svelte b/src/routes/embed/documents/[id]/annotations/[note_id]/+page.svelte index cbf46cd75..ab8a4ec7b 100644 --- a/src/routes/embed/documents/[id]/annotations/[note_id]/+page.svelte +++ b/src/routes/embed/documents/[id]/annotations/[note_id]/+page.svelte @@ -1,42 +1,36 @@ @@ -61,180 +55,19 @@ -
- - -
-
- - - +
+ +
+
-
- -
- {@html clean(note.content ?? "")} -
- - - -
+