Skip to content

Commit

Permalink
Release v0.2.44.
Browse files Browse the repository at this point in the history
Rewrite the router navigation guard.

Convert Vue SFC to script setup syntax.

Convert Book Vue SFC to script setup syntax.

Convert Dialog Vue SFC to script setup syntax.

Add Prettier.

Lint the files with ESLint and Prettier.

Convert Prettier file to JavaScript.

Undo hiding the loading indicator.

Update dependencies.

Fix empty header in search dialog on mobile.

Fix dialogs wrong z-order in sm breakpoint.

Increase filter dialog height in mobile.

Add missing fade transitions and fix imports.

Show header anchors on focus too.

Bump the version to release.
  • Loading branch information
alessandrojean committed Mar 2, 2022
1 parent 664d4f5 commit 36099b7
Show file tree
Hide file tree
Showing 176 changed files with 8,877 additions and 9,601 deletions.
19 changes: 13 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
module.exports = {
root: true,
plugins: ['jest'],
plugins: ['jest', 'prettier'],
env: {
browser: true,
node: true,
'jest/globals': true
},
extends: [
'plugin:vue/vue3-essential',
'@vue/standard'
],
extends: ['plugin:vue/vue3-essential', 'prettier'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/multi-word-component-names': 'off'
'vue/multi-word-component-names': 'off',
'prettier/prettier': [
'warn',
{
semi: false,
printWidth: 80,
singleQuote: true,
trailingComma: 'none'
}
]
}
}
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
npm run test
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
printWidth: 80,
singleQuote: true,
trailingComma: 'never'
}
32 changes: 18 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"name": "toshokan",
"version": "0.2.43",
"version": "0.2.44",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"dev": "vite",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"prepare": "husky install",
"serve": "vite preview",
"test": "jest ./src/tests",
"test:watch": "jest --watch ./src/tests"
},
"dependencies": {
"@headlessui/vue": "^1.5.0",
"@heroicons/vue": "^1.0.5",
"@heroicons/vue": "^1.0.6",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/forms": "^0.5.0",
"@tailwindcss/typography": "^0.5.2",
"@vuelidate/core": "^2.0.0-alpha.34",
"@vuelidate/validators": "^2.0.0-alpha.26",
"apexcharts": "^3.33.1",
"apexcharts": "^3.33.2",
"axios": "^0.26.0",
"core-js": "^3.21.1",
"dedent": "^0.7.0",
Expand All @@ -39,7 +40,7 @@
"vue": "^3.2.31",
"vue-i18n": "^9.1.9",
"vue-query": "^1.19.1",
"vue-router": "^4.0.12",
"vue-router": "^4.0.13",
"vue3-apexcharts": "^1.4.1",
"vuedraggable": "^4.1.0"
},
Expand All @@ -51,27 +52,30 @@
"@types/gapi.client.drive": "^3.0.13",
"@types/gapi.client.sheets": "^4.0.20201029",
"@types/google.visualization": "^0.0.68",
"@types/jest": "^27.4.0",
"@types/jest": "^27.4.1",
"@types/tailwindcss": "^3.0.9",
"@vitejs/plugin-vue": "^2.2.2",
"@vitejs/plugin-vue": "^2.2.4",
"@vue/compiler-sfc": "^3.2.31",
"@vue/eslint-config-standard": "^6.1.0",
"autoprefixer": "^10.4.2",
"babel-jest": "^27.5.1",
"eslint": "^8.9.0",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^8.4.1",
"eslint-plugin-vue": "^8.5.0",
"git-describe": "^4.1.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"postcss": "^8.4.6",
"postcss": "^8.4.7",
"postcss-loader": "^6.2.1",
"prettier": "^2.5.1",
"source-map": "^0.7.3",
"tailwindcss": "^3.0.23",
"vite": "^2.8.4",
"vite": "^2.8.6",
"vite-plugin-pwa": "^0.11.13"
}
}
155 changes: 67 additions & 88 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,110 +1,89 @@
<script setup>
import { computed, nextTick, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useAuthStore } from './stores/auth'
import { useStore } from '@/stores/main'
import FadeTransition from '@/components/transitions/FadeTransition.vue'
import LoadingSpinIcon from '@/components/icons/LoadingSpinIcon.vue'
import ReloadDialog from '@/components/dialogs/ReloadDialog.vue'
const authStore = useAuthStore()
const mainStore = useStore()
const { t, locale } = useI18n({ useScope: 'global' })
const authStarted = computed(() => authStore.started)
const hasCriticalError = computed(() => mainStore.hasCriticalError)
const route = useRoute()
const jumpToMain = ref(null)
const navigationHelpText = ref('')
const appStarted = ref(false)
function focusOnJumpLink() {
if (jumpToMain.value && appStarted.value) {
jumpToMain.value.focus()
appStarted.value = true
}
}
function changeNavigationHelpText(pageTitle) {
navigationHelpText.value = t('a11y.pageChanged', { pageTitle })
}
watch(
() => route.fullPath,
() => {
nextTick(() => {
setTimeout(() => {
changeNavigationHelpText(route.meta.title())
focusOnJumpLink()
}, 500)
})
}
)
watch(locale, (newLocale) => {
document.title = route.meta.title() + ' | ' + t('app.name')
document.documentElement.lang = newLocale
localStorage.setItem('locale', newLocale)
})
const showLoadingIndicator = computed(() => {
return !authStarted.value && !hasCriticalError.value
})
</script>

<template>
<transition
leave-active-class="transition motion-reduce:transition-none duration-200 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
enter-active-class="transition motion-reduce:transition-none duration-200 ease-out"
enter-from-class="opacity-0"
enter-to-class="opacity-100"
>
<FadeTransition>
<div
v-if="!authStarted && !hasCriticalError"
v-if="showLoadingIndicator"
class="z-50 absolute w-full h-full flex flex-col justify-center items-center bg-opacity-90 bg-gray-100 dark:bg-gray-900"
>
<span aria-hidden="true">
<LoadingSpinIcon class="motion-safe:animate-spin h-10 w-10 mx-auto text-primary-500" aria-hidden="true" />
<LoadingSpinIcon
class="motion-safe:animate-spin h-10 w-10 mx-auto text-primary-500"
aria-hidden="true"
/>
</span>
<p class="font-display font-medium sm:text-lg mt-6 dark:text-gray-200">
{{ t('app.starting') }}
</p>
</div>
</transition>
</FadeTransition>
<a href="#main-content" class="jump-to" ref="jumpToMain">
{{ t('a11y.jumpToMain') }}
</a>
<p class="sr-only" aria-live="polite" aria-hidden="true">
{{ navigationHelpText }}
</p>
<router-view v-slot="{ Component }">
<transition
mode="out-in"
enter-active-class="transition motion-reduce:transition-none duration-500 ease-out"
enter-from-class="opacity-0"
enter-to-class="opacity-100 "
leave-active-class="transition motion-reduce:transition-none duration-300 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<FadeTransition>
<component :is="Component" />
</transition>
</FadeTransition>
</router-view>

<ReloadDialog />
</template>

<script>
import { computed, nextTick, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useAuthStore } from './stores/auth'
import { useStore } from '@/stores/main'
import LoadingSpinIcon from '@/components/icons/LoadingSpinIcon.vue'
import ReloadDialog from '@/components/dialogs/ReloadDialog.vue'
export default {
components: {
LoadingSpinIcon,
ReloadDialog
},
setup () {
const authStore = useAuthStore()
const mainStore = useStore()
const { t, locale } = useI18n({ useScope: 'global' })
const authStarted = computed(() => authStore.started)
const hasCriticalError = computed(() => mainStore.hasCriticalError)
const route = useRoute()
const jumpToMain = ref(null)
const navigationHelpText = ref('')
const appStarted = ref(false)
function focusOnJumpLink () {
if (jumpToMain.value && appStarted.value) {
jumpToMain.value.focus()
appStarted.value = true
}
}
function changeNavigationHelpText (pageTitle) {
navigationHelpText.value = t('a11y.pageChanged', { pageTitle })
}
watch(() => route.fullPath, () => {
nextTick(() => {
setTimeout(() => {
changeNavigationHelpText(route.meta.title())
focusOnJumpLink()
}, 500)
})
})
watch(locale, newLocale => {
document.title = route.meta.title() + ' | ' + t('app.name')
document.documentElement.lang = newLocale
localStorage.setItem('locale', newLocale)
})
return {
authStarted,
hasCriticalError,
jumpToMain,
navigationHelpText,
t
}
}
}
</script>
Loading

0 comments on commit 36099b7

Please sign in to comment.