From 00510820a2794efcadbc83f7f8b54318fe198ecb Mon Sep 17 00:00:00 2001 From: Zéro~Informatique Date: Tue, 26 Jul 2022 08:44:34 +0200 Subject: viewer: migrate to vue 3, general refactoring and cleanup Non-exhaustive list of fixes and improvements done at the same time: - html default background to grey (avoids white flash during init) - unified links behavior - added more theme variables - removed the flex-expand transition (it wasn't working) and replaced it with a slide - fixed LdLoading not centered on the content - title on removable tags - fixed an issue with encoded URI from vue-router - unified Item resource URLs - removed the iframe for PlainTextViewer (it wasn't working properly) and replaced it with a pre - fixed clear and search buttons tabindex - fixed the information panel bumping up during the fade animation of tag's dropdown - fixed some focus outlines not appearing correctly - moved CSS variables to the :root context - Code cleaning GitHub: closes #217 GitHub: closes #300 GitHub: closes #297 GitHub: closes #105 GitHub: closes #267 GitHub: closes #275 GitHub: closes #228 GitHub: closes #215 GitHub: closes #112 --- viewer/src/components/LdBreadcrumb.vue | 129 -------------- viewer/src/components/LdCommand.vue | 98 ----------- viewer/src/components/LdCommandSearch.vue | 56 ------- viewer/src/components/LdCommandSort.vue | 60 ------- viewer/src/components/LdError.vue | 58 ------- viewer/src/components/LdGallery.vue | 59 ------- viewer/src/components/LdInformation.vue | 84 ---------- viewer/src/components/LdInput.vue | 60 +++++++ viewer/src/components/LdKeyPress.vue | 49 ------ viewer/src/components/LdLink.vue | 75 +++++++++ viewer/src/components/LdLoading.vue | 51 ++++++ viewer/src/components/LdNotice.vue | 57 +++++++ viewer/src/components/LdProposition.vue | 186 --------------------- viewer/src/components/LdTagInput.vue | 96 ----------- viewer/src/components/LdThumbnail.vue | 91 ---------- viewer/src/components/LdTitle.vue | 47 ------ viewer/src/components/async/AsyncLdMarkdown.vue | 125 ++++++++++++++ viewer/src/components/async/Markdown.vue | 123 -------------- viewer/src/components/async/index.ts | 24 ++- viewer/src/components/index.ts | 44 ----- .../src/components/item_handlers/LdAudioViewer.vue | 56 ------- .../components/item_handlers/LdDirectoryViewer.vue | 41 ----- .../components/item_handlers/LdDownloadViewer.vue | 58 ------- .../components/item_handlers/LdMarkdownViewer.vue | 76 --------- .../src/components/item_handlers/LdPdfViewer.vue | 44 ----- .../components/item_handlers/LdPictureViewer.vue | 128 -------------- .../components/item_handlers/LdPlainTextViewer.vue | 56 ------- .../src/components/item_handlers/LdVideoViewer.vue | 46 ----- 28 files changed, 389 insertions(+), 1688 deletions(-) delete mode 100644 viewer/src/components/LdBreadcrumb.vue delete mode 100644 viewer/src/components/LdCommand.vue delete mode 100644 viewer/src/components/LdCommandSearch.vue delete mode 100644 viewer/src/components/LdCommandSort.vue delete mode 100644 viewer/src/components/LdError.vue delete mode 100644 viewer/src/components/LdGallery.vue delete mode 100644 viewer/src/components/LdInformation.vue create mode 100644 viewer/src/components/LdInput.vue delete mode 100644 viewer/src/components/LdKeyPress.vue create mode 100644 viewer/src/components/LdLink.vue create mode 100644 viewer/src/components/LdLoading.vue create mode 100644 viewer/src/components/LdNotice.vue delete mode 100644 viewer/src/components/LdProposition.vue delete mode 100644 viewer/src/components/LdTagInput.vue delete mode 100644 viewer/src/components/LdThumbnail.vue delete mode 100644 viewer/src/components/LdTitle.vue create mode 100644 viewer/src/components/async/AsyncLdMarkdown.vue delete mode 100644 viewer/src/components/async/Markdown.vue delete mode 100644 viewer/src/components/index.ts delete mode 100644 viewer/src/components/item_handlers/LdAudioViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdDirectoryViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdDownloadViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdMarkdownViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdPdfViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdPictureViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdPlainTextViewer.vue delete mode 100644 viewer/src/components/item_handlers/LdVideoViewer.vue (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdBreadcrumb.vue b/viewer/src/components/LdBreadcrumb.vue deleted file mode 100644 index d518365..0000000 --- a/viewer/src/components/LdBreadcrumb.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue deleted file mode 100644 index 19174ad..0000000 --- a/viewer/src/components/LdCommand.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdCommandSearch.vue b/viewer/src/components/LdCommandSearch.vue deleted file mode 100644 index 61b66f4..0000000 --- a/viewer/src/components/LdCommandSearch.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdCommandSort.vue b/viewer/src/components/LdCommandSort.vue deleted file mode 100644 index c8a822e..0000000 --- a/viewer/src/components/LdCommandSort.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdError.vue b/viewer/src/components/LdError.vue deleted file mode 100644 index c71e2ad..0000000 --- a/viewer/src/components/LdError.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue deleted file mode 100644 index e567e7c..0000000 --- a/viewer/src/components/LdGallery.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdInformation.vue b/viewer/src/components/LdInformation.vue deleted file mode 100644 index 68e1817..0000000 --- a/viewer/src/components/LdInformation.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdInput.vue b/viewer/src/components/LdInput.vue new file mode 100644 index 0000000..1d737d1 --- /dev/null +++ b/viewer/src/components/LdInput.vue @@ -0,0 +1,60 @@ + + + + + + + diff --git a/viewer/src/components/LdKeyPress.vue b/viewer/src/components/LdKeyPress.vue deleted file mode 100644 index 151d6c6..0000000 --- a/viewer/src/components/LdKeyPress.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/viewer/src/components/LdLink.vue b/viewer/src/components/LdLink.vue new file mode 100644 index 0000000..a5fd4d5 --- /dev/null +++ b/viewer/src/components/LdLink.vue @@ -0,0 +1,75 @@ + + + + + + + diff --git a/viewer/src/components/LdLoading.vue b/viewer/src/components/LdLoading.vue new file mode 100644 index 0000000..f392916 --- /dev/null +++ b/viewer/src/components/LdLoading.vue @@ -0,0 +1,51 @@ + + + + + + + diff --git a/viewer/src/components/LdNotice.vue b/viewer/src/components/LdNotice.vue new file mode 100644 index 0000000..f53997b --- /dev/null +++ b/viewer/src/components/LdNotice.vue @@ -0,0 +1,57 @@ + + + + + + + + diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue deleted file mode 100644 index 07b27f5..0000000 --- a/viewer/src/components/LdProposition.vue +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue deleted file mode 100644 index 49ea3f4..0000000 --- a/viewer/src/components/LdTagInput.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdThumbnail.vue b/viewer/src/components/LdThumbnail.vue deleted file mode 100644 index 4623b44..0000000 --- a/viewer/src/components/LdThumbnail.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/LdTitle.vue b/viewer/src/components/LdTitle.vue deleted file mode 100644 index e1d47d1..0000000 --- a/viewer/src/components/LdTitle.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/viewer/src/components/async/AsyncLdMarkdown.vue b/viewer/src/components/async/AsyncLdMarkdown.vue new file mode 100644 index 0000000..213c11c --- /dev/null +++ b/viewer/src/components/async/AsyncLdMarkdown.vue @@ -0,0 +1,125 @@ + + + + + + + + diff --git a/viewer/src/components/async/Markdown.vue b/viewer/src/components/async/Markdown.vue deleted file mode 100644 index c4e282b..0000000 --- a/viewer/src/components/async/Markdown.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/async/index.ts b/viewer/src/components/async/index.ts index 5a7d9a6..05a0814 100644 --- a/viewer/src/components/async/index.ts +++ b/viewer/src/components/async/index.ts @@ -1,4 +1,22 @@ -// Declare async constants for internal components -// Their name can't start with 'Ld' +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2022 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ -export const Markdown = () => import(/* webpackChunkName: "markdown" */ "./Markdown.vue"); +import { defineAsyncComponent } from 'vue'; + +export const LdMarkdown = defineAsyncComponent(() => import(/* webpackChunkName: "markdown" */ './AsyncLdMarkdown.vue')); diff --git a/viewer/src/components/index.ts b/viewer/src/components/index.ts deleted file mode 100644 index f34eea1..0000000 --- a/viewer/src/components/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* ldgallery - A static generator which turns a collection of tagged --- pictures into a searchable web gallery. --- --- Copyright (C) 2019-2020 Guillaume FOUET --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU Affero General Public License as --- published by the Free Software Foundation, either version 3 of the --- License, or (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU Affero General Public License for more details. --- --- You should have received a copy of the GNU Affero General Public License --- along with this program. If not, see . -*/ - -import Vue from "vue"; - -const requireComponent = require.context( - "@/components", - true, // Whether or not to look in subfolders - // The regular expression used to match base component filenames - /Ld[A-Z]\w+\.vue$/ -); - -requireComponent.keys().forEach(fileName => { - const componentConfig = requireComponent(fileName); - const componentName = fileName - .split("/") - .pop()! - .replace(/\.vue$/, ""); - - // Register component globally - Vue.component( - componentName, - // Look for the component options on `.default`, which will - // exist if the component was exported with `export default`, - // otherwise fall back to module's root. - componentConfig.default ?? componentConfig - ); -}); diff --git a/viewer/src/components/item_handlers/LdAudioViewer.vue b/viewer/src/components/item_handlers/LdAudioViewer.vue deleted file mode 100644 index 559b10a..0000000 --- a/viewer/src/components/item_handlers/LdAudioViewer.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/item_handlers/LdDirectoryViewer.vue b/viewer/src/components/item_handlers/LdDirectoryViewer.vue deleted file mode 100644 index 2259f12..0000000 --- a/viewer/src/components/item_handlers/LdDirectoryViewer.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/viewer/src/components/item_handlers/LdDownloadViewer.vue b/viewer/src/components/item_handlers/LdDownloadViewer.vue deleted file mode 100644 index 60c7c49..0000000 --- a/viewer/src/components/item_handlers/LdDownloadViewer.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/item_handlers/LdMarkdownViewer.vue b/viewer/src/components/item_handlers/LdMarkdownViewer.vue deleted file mode 100644 index 3b9a8d6..0000000 --- a/viewer/src/components/item_handlers/LdMarkdownViewer.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - diff --git a/viewer/src/components/item_handlers/LdPdfViewer.vue b/viewer/src/components/item_handlers/LdPdfViewer.vue deleted file mode 100644 index 04cba0c..0000000 --- a/viewer/src/components/item_handlers/LdPdfViewer.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/viewer/src/components/item_handlers/LdPictureViewer.vue b/vie