From c2e69bd1521518ce890ae28ea3998bb1a7ef33a8 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Thu, 14 Dec 2023 15:03:47 -0500 Subject: [PATCH 1/2] Add viewer controls to storybook --- src/assets/fullscreen.svg | 1 - src/pages/viewer/Body.svelte | 2 +- src/pages/viewer/Footer.svelte | 3 +- src/pages/viewer/Header.svelte | 11 +- src/pages/viewer/SelectableWord.svelte | 10 +- src/pages/viewer/Sidebar.svelte | 187 +++++++++--------- src/pages/viewer/SimpleBody.svelte | 2 +- src/pages/viewer/TextBody.svelte | 1 - src/pages/viewer/Viewer.svelte | 27 +-- src/pages/viewer/controls/FullScreen.svelte | 27 ++- src/pages/viewer/controls/Hamburger.svelte | 13 +- src/pages/viewer/controls/Paginator.svelte | 121 ++++++------ .../stories/FullScreen.stories.svelte | 15 ++ .../controls/stories/Hamburger.stories.svelte | 13 ++ .../controls/stories/Paginator.stories.svelte | 13 ++ .../controls/stories/Search.stories.svelte | 22 +++ .../stories/ViewDropdown.stories.svelte | 13 ++ .../controls/stories/Zoom.stories.svelte | 13 ++ 18 files changed, 290 insertions(+), 204 deletions(-) delete mode 100644 src/assets/fullscreen.svg delete mode 100644 src/pages/viewer/TextBody.svelte create mode 100644 src/pages/viewer/controls/stories/FullScreen.stories.svelte create mode 100644 src/pages/viewer/controls/stories/Hamburger.stories.svelte create mode 100644 src/pages/viewer/controls/stories/Paginator.stories.svelte create mode 100644 src/pages/viewer/controls/stories/Search.stories.svelte create mode 100644 src/pages/viewer/controls/stories/ViewDropdown.stories.svelte create mode 100644 src/pages/viewer/controls/stories/Zoom.stories.svelte diff --git a/src/assets/fullscreen.svg b/src/assets/fullscreen.svg deleted file mode 100644 index 55ff5a932..000000000 --- a/src/assets/fullscreen.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/pages/viewer/Body.svelte b/src/pages/viewer/Body.svelte index aebdc89ef..e937061e8 100644 --- a/src/pages/viewer/Body.svelte +++ b/src/pages/viewer/Body.svelte @@ -17,7 +17,7 @@ enterAnnotateMode, enterModifyMode, enterSectionsMode, - } from "@/viewer/actions"; + } from "@/viewer/actions.js"; let docElem; let actionHeight; diff --git a/src/pages/viewer/Footer.svelte b/src/pages/viewer/Footer.svelte index cf94c3639..e7975ff02 100644 --- a/src/pages/viewer/Footer.svelte +++ b/src/pages/viewer/Footer.svelte @@ -11,6 +11,7 @@ export let compact = false; export let embed = false; export let showFullscreen = false; + export let document; $: style = `height: ${FOOTER_HEIGHT}px;`; @@ -29,7 +30,7 @@ {#if embed && showFullscreen} - + {/if} {/if} diff --git a/src/pages/viewer/Header.svelte b/src/pages/viewer/Header.svelte index f6c9111d0..79e2adbf5 100644 --- a/src/pages/viewer/Header.svelte +++ b/src/pages/viewer/Header.svelte @@ -1,14 +1,15 @@
- {@html backArrowSvg} + {/if} @@ -57,7 +60,7 @@
- + dispatch("toggle.sidebar")} />
diff --git a/src/pages/viewer/SelectableWord.svelte b/src/pages/viewer/SelectableWord.svelte index 9f85fee41..8b61e01da 100644 --- a/src/pages/viewer/SelectableWord.svelte +++ b/src/pages/viewer/SelectableWord.svelte @@ -110,7 +110,7 @@ /> {/if} - diff --git a/src/pages/viewer/controls/Hamburger.svelte b/src/pages/viewer/controls/Hamburger.svelte index 0e800b981..1693ff2ac 100644 --- a/src/pages/viewer/controls/Hamburger.svelte +++ b/src/pages/viewer/controls/Hamburger.svelte @@ -1,18 +1,13 @@ - - diff --git a/src/pages/viewer/controls/stories/FullScreen.stories.svelte b/src/pages/viewer/controls/stories/FullScreen.stories.svelte new file mode 100644 index 000000000..ec45ccdeb --- /dev/null +++ b/src/pages/viewer/controls/stories/FullScreen.stories.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/src/pages/viewer/controls/stories/Hamburger.stories.svelte b/src/pages/viewer/controls/stories/Hamburger.stories.svelte new file mode 100644 index 000000000..7b9be2cbb --- /dev/null +++ b/src/pages/viewer/controls/stories/Hamburger.stories.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/src/pages/viewer/controls/stories/Paginator.stories.svelte b/src/pages/viewer/controls/stories/Paginator.stories.svelte new file mode 100644 index 000000000..5c8b1ce65 --- /dev/null +++ b/src/pages/viewer/controls/stories/Paginator.stories.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/src/pages/viewer/controls/stories/Search.stories.svelte b/src/pages/viewer/controls/stories/Search.stories.svelte new file mode 100644 index 000000000..e8ff1a7df --- /dev/null +++ b/src/pages/viewer/controls/stories/Search.stories.svelte @@ -0,0 +1,22 @@ + + + +
+ +
+
+ + diff --git a/src/pages/viewer/controls/stories/ViewDropdown.stories.svelte b/src/pages/viewer/controls/stories/ViewDropdown.stories.svelte new file mode 100644 index 000000000..de16a30f8 --- /dev/null +++ b/src/pages/viewer/controls/stories/ViewDropdown.stories.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/src/pages/viewer/controls/stories/Zoom.stories.svelte b/src/pages/viewer/controls/stories/Zoom.stories.svelte new file mode 100644 index 000000000..7e6e579f5 --- /dev/null +++ b/src/pages/viewer/controls/stories/Zoom.stories.svelte @@ -0,0 +1,13 @@ + + + + + From 10adce6d3678d90aae7e95974f218752f0bc63b1 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Thu, 14 Dec 2023 15:12:30 -0500 Subject: [PATCH 2/2] Check for doc --- src/pages/viewer/Footer.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/viewer/Footer.svelte b/src/pages/viewer/Footer.svelte index e7975ff02..469f1b60d 100644 --- a/src/pages/viewer/Footer.svelte +++ b/src/pages/viewer/Footer.svelte @@ -29,7 +29,7 @@ - {#if embed && showFullscreen} + {#if document && embed && showFullscreen} {/if}