From f7f316fa1bba5303ca59d4d7261e06ca7274ad75 Mon Sep 17 00:00:00 2001 From: Zavier Miller Date: Sat, 12 Oct 2024 15:28:07 -0500 Subject: [PATCH 01/16] fix(VListItem): fix avatar-badge spacing fixes #20573 --- .../src/components/VList/VListItem.sass | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/vuetify/src/components/VList/VListItem.sass b/packages/vuetify/src/components/VList/VListItem.sass index 3dfb6b0b782..da3aaba712c 100644 --- a/packages/vuetify/src/components/VList/VListItem.sass +++ b/packages/vuetify/src/components/VList/VListItem.sass @@ -80,11 +80,11 @@ ~ .v-list-item__spacer width: $list-item-icon-margin-start - > .v-avatar ~ .v-list-item__spacer - width: $list-item-avatar-margin-start + > .v-avatar, + > .v-badge:has(.v-avatar) + ~ .v-list-item__spacer + width: $list-item-avatar-margin-start - > .v-list-item-action ~ .v-list-item__spacer - width: $list-item-action-spacer-width .v-list-item--slim & > .v-badge, @@ -93,8 +93,10 @@ ~ .v-list-item__spacer width: $list-item-slim-spacer-width - > .v-avatar ~ .v-list-item__spacer - width: $list-item-slim-avatar-spacer-width + > .v-avatar, + > .v-badge:has(.v-avatar) + ~ .v-list-item__spacer + width: $list-item-slim-avatar-spacer-width > .v-list-item-action ~ .v-list-item__spacer width: $list-item-slim-action-spacer-width @@ -118,8 +120,10 @@ ~ .v-list-item__spacer width: $list-item-icon-margin-end - > .v-avatar ~ .v-list-item__spacer - width: $list-item-avatar-margin-end + > .v-avatar, + > .v-badge:has(.v-avatar) + ~ .v-list-item__spacer + width: $list-item-avatar-margin-end > .v-list-item-action ~ .v-list-item__spacer width: $list-item-action-spacer-width @@ -131,8 +135,10 @@ ~ .v-list-item__spacer width: $list-item-slim-spacer-width - > .v-avatar ~ .v-list-item__spacer - width: $list-item-slim-avatar-spacer-width + > .v-avatar, + > .v-badge:has(.v-avatar) + ~ .v-list-item__spacer + width: $list-item-slim-avatar-spacer-width > .v-list-item-action ~ .v-list-item__spacer width: $list-item-slim-action-spacer-width From 499f632c44ba1e10b0d26e146ed6e63f04fbde3d Mon Sep 17 00:00:00 2001 From: Kael Date: Mon, 14 Oct 2024 23:05:26 +1100 Subject: [PATCH 02/16] docs: make the service worker optional, improve precache logic (#20425) --- docker-compose.yml | 8 + packages/docs/auto-imports.d.ts | 22 ++ packages/docs/components.d.ts | 1 + .../src/components/app/bar/SettingsToggle.vue | 17 ++ .../components/app/settings/DeveloperMode.vue | 36 ++- .../src/components/app/settings/Drawer.vue | 7 +- .../src/components/app/settings/Options.vue | 14 +- .../app/settings/SettingsHeader.vue | 11 +- .../app/settings/options/AdOption.vue | 29 ++- .../app/settings/options/ApiOption.vue | 29 ++- .../app/settings/options/CodeOption.vue | 29 ++- .../app/settings/options/OfflineOption.vue | 67 ++++++ .../app/settings/options/PinOption.vue | 44 ++-- .../settings/options/SlashSearchOption.vue | 23 +- packages/docs/src/i18n/messages/en.json | 14 +- packages/docs/src/plugins/pwa.ts | 25 +- packages/docs/src/plugins/vuetify.ts | 1 + packages/docs/src/service-worker.js | 220 +++--------------- packages/docs/src/shims.d.ts | 2 + packages/docs/src/stores/pwa.ts | 61 +++++ packages/docs/src/utils/pwa.ts | 97 ++++++++ packages/docs/tsconfig.json | 1 + packages/docs/vite.config.mts | 7 +- 23 files changed, 445 insertions(+), 320 deletions(-) create mode 100644 docker-compose.yml create mode 100644 packages/docs/src/components/app/settings/options/OfflineOption.vue create mode 100644 packages/docs/src/stores/pwa.ts create mode 100644 packages/docs/src/utils/pwa.ts diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..3aa0fd8b8b7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + docs: + image: nginx:alpine + ports: + - ${PORT:-8095}:80 + volumes: + - ./packages/docs/dist:/usr/share/nginx/html + - ./packages/docs/build/nginx.conf:/etc/nginx/nginx.conf diff --git a/packages/docs/auto-imports.d.ts b/packages/docs/auto-imports.d.ts index b41ec364536..e6b6cfa4212 100644 --- a/packages/docs/auto-imports.d.ts +++ b/packages/docs/auto-imports.d.ts @@ -14,13 +14,16 @@ declare global { const PropType: typeof import('vue')['PropType'] const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] const anyLanguagePattern: typeof import('./src/utils/routes')['anyLanguagePattern'] + const cacheManifestEntries: typeof import('./src/utils/pwa')['cacheManifestEntries'] const camelCase: typeof import('lodash-es')['camelCase'] const camelize: typeof import('vue')['camelize'] + const cleanCache: typeof import('./src/utils/pwa')['cleanCache'] const computed: typeof import('vue')['computed'] const configureMarkdown: typeof import('./src/utils/markdown-it')['configureMarkdown'] const copyElementContent: typeof import('./src/utils/helpers')['copyElementContent'] const createAdProps: typeof import('./src/composables/ad')['createAdProps'] const createApp: typeof import('vue')['createApp'] + const createCacheKey: typeof import('./src/utils/pwa')['createCacheKey'] const createOne: typeof import('@vuetify/one')['createOne'] const createPinia: typeof import('pinia')['createPinia'] const customRef: typeof import('vue')['customRef'] @@ -29,12 +32,14 @@ declare global { const defineStore: typeof import('pinia')['defineStore'] const disabledLanguagePattern: typeof import('./src/utils/routes')['disabledLanguagePattern'] const effectScope: typeof import('vue')['effectScope'] + const ensureCacheableResponse: typeof import('./src/utils/pwa')['ensureCacheableResponse'] const eventName: typeof import('./src/utils/helpers')['eventName'] const genAppMetaInfo: typeof import('./src/utils/metadata')['genAppMetaInfo'] const genMetaInfo: typeof import('./src/utils/metadata')['genMetaInfo'] const generatedRoutes: typeof import('./src/utils/routes')['generatedRoutes'] const getActivePinia: typeof import('pinia')['getActivePinia'] const getBranch: typeof import('./src/utils/helpers')['getBranch'] + const getCacheKeyForUrl: typeof import('./src/utils/pwa')['getCacheKeyForUrl'] const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] const getDistance: typeof import('./src/utils/helpers')['getDistance'] @@ -58,7 +63,9 @@ declare global { const mapWritableState: typeof import('pinia')['mapWritableState'] const markRaw: typeof import('vue')['markRaw'] const markdownItRules: typeof import('./src/utils/markdown-it-rules')['default'] + const matchPrecache: typeof import('./src/utils/pwa')['matchPrecache'] const mergeProps: typeof import('vue')['mergeProps'] + const messageSW: typeof import('./src/utils/pwa')['messageSW'] const nextTick: typeof import('vue')['nextTick'] const onActivated: typeof import('vue')['onActivated'] const onBeforeMount: typeof import('vue')['onBeforeMount'] @@ -76,9 +83,11 @@ declare global { const onServerPrefetch: typeof import('vue')['onServerPrefetch'] const onUnmounted: typeof import('vue')['onUnmounted'] const onUpdated: typeof import('vue')['onUpdated'] + const openCache: typeof import('./src/utils/pwa')['openCache'] const preferredLocale: typeof import('./src/utils/routes')['preferredLocale'] const propsToString: typeof import('./src/utils/helpers')['propsToString'] const provide: typeof import('vue')['provide'] + const pwaStore: typeof import('./src/stores/pwa')['pwaStore'] const reactive: typeof import('vue')['reactive'] const readonly: typeof import('vue')['readonly'] const redirectRoutes: typeof import('./src/utils/routes')['redirectRoutes'] @@ -125,6 +134,7 @@ declare global { const usePlayground: typeof import('./src/composables/playground')['usePlayground'] const useProductsStore: typeof import('@vuetify/one')['useProductsStore'] const usePromotionsStore: typeof import('./src/stores/promotions')['usePromotionsStore'] + const usePwaStore: typeof import('./src/stores/pwa')['usePwaStore'] const useQueueStore: typeof import('@vuetify/one')['useQueueStore'] const useReleasesStore: typeof import('./src/stores/releases')['useReleasesStore'] const useRoute: typeof import('vue-router')['useRoute'] @@ -164,8 +174,10 @@ declare module 'vue' { readonly IS_SERVER: UnwrapRef readonly acceptHMRUpdate: UnwrapRef readonly anyLanguagePattern: UnwrapRef + readonly cacheManifestEntries: UnwrapRef readonly camelCase: UnwrapRef readonly camelize: UnwrapRef + readonly cleanCache: UnwrapRef readonly computed: UnwrapRef readonly configureMarkdown: UnwrapRef readonly copyElementContent: UnwrapRef @@ -179,6 +191,7 @@ declare module 'vue' { readonly defineStore: UnwrapRef readonly disabledLanguagePattern: UnwrapRef readonly effectScope: UnwrapRef + readonly ensureCacheableResponse: UnwrapRef readonly eventName: UnwrapRef readonly genAppMetaInfo: UnwrapRef readonly genMetaInfo: UnwrapRef @@ -209,6 +222,7 @@ declare module 'vue' { readonly markRaw: UnwrapRef readonly markdownItRules: UnwrapRef readonly mergeProps: UnwrapRef + readonly messageSW: UnwrapRef readonly nextTick: UnwrapRef readonly onActivated: UnwrapRef readonly onBeforeMount: UnwrapRef @@ -225,6 +239,7 @@ declare module 'vue' { readonly onServerPrefetch: UnwrapRef readonly onUnmounted: UnwrapRef readonly onUpdated: UnwrapRef + readonly openCache: UnwrapRef readonly preferredLocale: UnwrapRef readonly propsToString: UnwrapRef readonly provide: UnwrapRef @@ -274,6 +289,7 @@ declare module 'vue' { readonly usePlayground: UnwrapRef readonly useProductsStore: UnwrapRef readonly usePromotionsStore: UnwrapRef + readonly usePwaStore: UnwrapRef readonly useQueueStore: UnwrapRef readonly useReleasesStore: UnwrapRef readonly useRoute: UnwrapRef @@ -306,8 +322,10 @@ declare module '@vue/runtime-core' { readonly IS_SERVER: UnwrapRef readonly acceptHMRUpdate: UnwrapRef readonly anyLanguagePattern: UnwrapRef + readonly cacheManifestEntries: UnwrapRef readonly camelCase: UnwrapRef readonly camelize: UnwrapRef + readonly cleanCache: UnwrapRef readonly computed: UnwrapRef readonly configureMarkdown: UnwrapRef readonly copyElementContent: UnwrapRef @@ -321,6 +339,7 @@ declare module '@vue/runtime-core' { readonly defineStore: UnwrapRef readonly disabledLanguagePattern: UnwrapRef readonly effectScope: UnwrapRef + readonly ensureCacheableResponse: UnwrapRef readonly eventName: UnwrapRef readonly genAppMetaInfo: UnwrapRef readonly genMetaInfo: UnwrapRef @@ -351,6 +370,7 @@ declare module '@vue/runtime-core' { readonly markRaw: UnwrapRef readonly markdownItRules: UnwrapRef readonly mergeProps: UnwrapRef + readonly messageSW: UnwrapRef readonly nextTick: UnwrapRef readonly onActivated: UnwrapRef readonly onBeforeMount: UnwrapRef @@ -367,6 +387,7 @@ declare module '@vue/runtime-core' { readonly onServerPrefetch: UnwrapRef readonly onUnmounted: UnwrapRef readonly onUpdated: UnwrapRef + readonly openCache: UnwrapRef readonly preferredLocale: UnwrapRef readonly propsToString: UnwrapRef readonly provide: UnwrapRef @@ -416,6 +437,7 @@ declare module '@vue/runtime-core' { readonly usePlayground: UnwrapRef readonly useProductsStore: UnwrapRef readonly usePromotionsStore: UnwrapRef + readonly usePwaStore: UnwrapRef readonly useQueueStore: UnwrapRef readonly useReleasesStore: UnwrapRef readonly useRoute: UnwrapRef diff --git a/packages/docs/components.d.ts b/packages/docs/components.d.ts index 3d6c948e850..421ea1bea37 100644 --- a/packages/docs/components.d.ts +++ b/packages/docs/components.d.ts @@ -76,6 +76,7 @@ declare module 'vue' { AppSettingsOptionsBannerOption: typeof import('./src/components/app/settings/options/BannerOption.vue')['default'] AppSettingsOptionsCodeOption: typeof import('./src/components/app/settings/options/CodeOption.vue')['default'] AppSettingsOptionsNotificationsOption: typeof import('./src/components/app/settings/options/NotificationsOption.vue')['default'] + AppSettingsOptionsOfflineOption: typeof import('./src/components/app/settings/options/OfflineOption.vue')['default'] AppSettingsOptionsPinOption: typeof import('./src/components/app/settings/options/PinOption.vue')['default'] AppSettingsOptionsQuickbarOption: typeof import('./src/components/app/settings/options/QuickbarOption.vue')['default'] AppSettingsOptionsRailDrawerOption: typeof import('./src/components/app/settings/options/RailDrawerOption.vue')['default'] diff --git a/packages/docs/src/components/app/bar/SettingsToggle.vue b/packages/docs/src/components/app/bar/SettingsToggle.vue index a181f2a0ea7..f5a4f486a78 100644 --- a/packages/docs/src/components/app/bar/SettingsToggle.vue +++ b/packages/docs/src/components/app/bar/SettingsToggle.vue @@ -1,5 +1,21 @@