Skip to content

Commit 9359451

Browse files
committed
chore: batch improvements
1 parent 46eaaeb commit 9359451

9 files changed

Lines changed: 114 additions & 69 deletions

File tree

docs/auto-imports.d.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ declare global {
2929
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
3030
const createPinia: typeof import('pinia')['createPinia']
3131
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
32+
const createRef: typeof import('@vueuse/core')['createRef']
3233
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
3334
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
3435
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
@@ -45,6 +46,7 @@ declare global {
4546
const getActivePinia: typeof import('pinia')['getActivePinia']
4647
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
4748
const getCurrentScope: typeof import('vue')['getCurrentScope']
49+
const getCurrentWatcher: typeof import('vue')['getCurrentWatcher']
4850
const h: typeof import('vue')['h']
4951
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
5052
const inject: typeof import('vue')['inject']
@@ -54,6 +56,7 @@ declare global {
5456
const isReactive: typeof import('vue')['isReactive']
5557
const isReadonly: typeof import('vue')['isReadonly']
5658
const isRef: typeof import('vue')['isRef']
59+
const isShallow: typeof import('vue')['isShallow']
5760
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
5861
const mapActions: typeof import('pinia')['mapActions']
5962
const mapGetters: typeof import('pinia')['mapGetters']
@@ -71,6 +74,7 @@ declare global {
7174
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
7275
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
7376
const onDeactivated: typeof import('vue')['onDeactivated']
77+
const onElementRemoval: typeof import('@vueuse/core')['onElementRemoval']
7478
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
7579
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
7680
const onLongPress: typeof import('@vueuse/core')['onLongPress']
@@ -156,6 +160,7 @@ declare global {
156160
const useCloned: typeof import('@vueuse/core')['useCloned']
157161
const useColorMode: typeof import('@vueuse/core')['useColorMode']
158162
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
163+
const useCountdown: typeof import('@vueuse/core')['useCountdown']
159164
const useCounter: typeof import('@vueuse/core')['useCounter']
160165
const useCssModule: typeof import('vue')['useCssModule']
161166
const useCssVar: typeof import('@vueuse/core')['useCssVar']
@@ -236,13 +241,15 @@ declare global {
236241
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
237242
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
238243
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
244+
const usePreferredReducedTransparency: typeof import('@vueuse/core')['usePreferredReducedTransparency']
239245
const usePrevious: typeof import('@vueuse/core')['usePrevious']
240246
const useQqEmojiStore: typeof import('./stores/qq-emoji')['useQqEmojiStore']
241247
const useRafFn: typeof import('@vueuse/core')['useRafFn']
242248
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
243249
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
244250
const useRoute: typeof import('vue-router')['useRoute']
245251
const useRouter: typeof import('vue-router')['useRouter']
252+
const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth']
246253
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
247254
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
248255
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
@@ -269,6 +276,7 @@ declare global {
269276
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
270277
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
271278
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
279+
const useTimeAgoIntl: typeof import('@vueuse/core')['useTimeAgoIntl']
272280
const useTimeout: typeof import('@vueuse/core')['useTimeout']
273281
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
274282
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
@@ -313,25 +321,26 @@ declare global {
313321
// for type re-export
314322
declare global {
315323
// @ts-ignore
316-
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
324+
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
317325
import('vue')
318326
// @ts-ignore
319-
export type { QqSysEmojiAssetType } from './types/QqSysEmoji'
327+
export type { QqSysEmojiAssetType, QqSysEmojiItem, QqSysEmojiGroup, QQSysEmojiConfig, QqSysEmojiAsset, QqSysEmojiWithAssets, QqNTSystemEmojiItem } from './types/QqSysEmoji'
320328
import('./types/QqSysEmoji')
329+
// @ts-ignore
330+
export type { WechatNewEmojiItem, WechatNewEmojiConfig } from './types/WechatNewEmoji'
331+
import('./types/WechatNewEmoji')
321332
}
322333

323334
// for vue template auto import
324335
import { UnwrapRef } from 'vue'
325336
declare module 'vue' {
326337
interface GlobalComponents {}
327338
interface ComponentCustomProperties {
328-
readonly Button: UnwrapRef<typeof import('./components/ui/button/index')['Button']>
329339
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
330340
readonly QqSysEmojiAssetType: UnwrapRef<typeof import('./types/QqSysEmoji')['QqSysEmojiAssetType']>
331341
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
332342
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
333343
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
334-
readonly buttonVariants: UnwrapRef<typeof import('./components/ui/button/index')['buttonVariants']>
335344
readonly cn: UnwrapRef<typeof import('./utils/shadcn')['cn']>
336345
readonly computed: UnwrapRef<typeof import('vue')['computed']>
337346
readonly computedAsync: UnwrapRef<typeof import('@vueuse/core')['computedAsync']>
@@ -346,6 +355,7 @@ declare module 'vue' {
346355
readonly createInjectionState: UnwrapRef<typeof import('@vueuse/core')['createInjectionState']>
347356
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
348357
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
358+
readonly createRef: UnwrapRef<typeof import('@vueuse/core')['createRef']>
349359
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
350360
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
351361
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
@@ -362,6 +372,7 @@ declare module 'vue' {
362372
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
363373
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
364374
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
375+
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
365376
readonly h: UnwrapRef<typeof import('vue')['h']>
366377
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
367378
readonly inject: UnwrapRef<typeof import('vue')['inject']>
@@ -371,6 +382,7 @@ declare module 'vue' {
371382
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
372383
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
373384
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
385+
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
374386
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
375387
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
376388
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
@@ -387,6 +399,7 @@ declare module 'vue' {
387399
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
388400
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
389401
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
402+
readonly onElementRemoval: UnwrapRef<typeof import('@vueuse/core')['onElementRemoval']>
390403
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
391404
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
392405
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
@@ -472,6 +485,7 @@ declare module 'vue' {
472485
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
473486
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
474487
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
488+
readonly useCountdown: UnwrapRef<typeof import('@vueuse/core')['useCountdown']>
475489
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
476490
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
477491
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
@@ -552,13 +566,15 @@ declare module 'vue' {
552566
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
553567
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
554568
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
569+
readonly usePreferredReducedTransparency: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedTransparency']>
555570
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
556571
readonly useQqEmojiStore: UnwrapRef<typeof import('./stores/qq-emoji')['useQqEmojiStore']>
557572
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
558573
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
559574
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
560575
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
561576
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
577+
readonly useSSRWidth: UnwrapRef<typeof import('@vueuse/core')['useSSRWidth']>
562578
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
563579
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
564580
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
@@ -585,6 +601,7 @@ declare module 'vue' {
585601
readonly useThrottleFn: UnwrapRef<typeof import('@vueuse/core')['useThrottleFn']>
586602
readonly useThrottledRefHistory: UnwrapRef<typeof import('@vueuse/core')['useThrottledRefHistory']>
587603
readonly useTimeAgo: UnwrapRef<typeof import('@vueuse/core')['useTimeAgo']>
604+
readonly useTimeAgoIntl: UnwrapRef<typeof import('@vueuse/core')['useTimeAgoIntl']>
588605
readonly useTimeout: UnwrapRef<typeof import('@vueuse/core')['useTimeout']>
589606
readonly useTimeoutFn: UnwrapRef<typeof import('@vueuse/core')['useTimeoutFn']>
590607
readonly useTimeoutPoll: UnwrapRef<typeof import('@vueuse/core')['useTimeoutPoll']>

docs/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// @ts-nocheck
33
// Generated by unplugin-vue-components
44
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
56
export {}
67

78
/* prettier-ignore */
89
declare module 'vue' {
910
export interface GlobalComponents {
10-
Button: typeof import('./components/ui/button/Button.vue')['default']
1111
GlobalFooter: typeof import('./components/GlobalFooter.vue')['default']
1212
GlobalHeader: typeof import('./components/GlobalHeader.vue')['default']
1313
KoishiPlaceholder: typeof import('./components/KoishiPlaceholder.vue')['default']

docs/components/GlobalFooter.vue

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,7 @@ footer#global-footer
44
.footer-main
55
.footer-brand
66
.brand-logo
7-
svg(
8-
fill='none'
9-
height='32'
10-
viewBox='0 0 24 24'
11-
width='32'
12-
xmlns='http://www.w3.org/2000/svg'
13-
)
14-
path(
15-
d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'
16-
fill='url(#footerLogoGradient)'
17-
)
18-
defs
19-
linearGradient#footerLogoGradient(
20-
x1='0%'
21-
x2='100%'
22-
y1='0%'
23-
y2='100%'
24-
)
25-
stop(offset='0%' stop-color='#667eea')
26-
stop(offset='100%' stop-color='#764ba2')
7+
img(src='/assets/default.png')
278
.brand-info
289
h3 QFace
2910
p QQ Emoji 表情资源库

docs/components/KoishiPlaceholder.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
border: 8px solid #5546a3;
1717
overflow: hidden;
1818
box-sizing: border-box;
19+
display: inline-block;
1920
}
2021
.loader::after {
2122
content: '';

docs/components/QEmojiMiniCard.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
fill='currentColor'
3535
)
3636
span {{ assetCount }} 资源
37+
span(v-if='hasAPng') APNG
38+
span(v-if='hasLottie') Lottie
3739
.asset-count(v-else)
3840
span 资源暂缺
3941
</template>
@@ -61,6 +63,21 @@ const src = computed(
6163
)
6264
6365
const assetCount = computed(() => props.value.assets?.length || 0)
66+
67+
const hasAPng = computed(() => {
68+
return (
69+
props.value.assets?.some(
70+
(asset) => asset.type === QqSysEmojiAssetType.APNG
71+
) || false
72+
)
73+
})
74+
const hasLottie = computed(() => {
75+
return (
76+
props.value.assets?.some(
77+
(asset) => asset.type === QqSysEmojiAssetType.LOTTIE_JSON
78+
) || false
79+
)
80+
})
6481
</script>
6582

6683
<style scoped lang="sass">
@@ -131,6 +148,8 @@ const assetCount = computed(() => props.value.assets?.length || 0)
131148
justify-content: center
132149
opacity: 0
133150
transition: opacity 0.3s ease
151+
user-select: none
152+
pointer-events: none
134153
135154
.view-icon
136155
color: white

docs/pages/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<template lang="pug"></template>
22

33
<script setup lang="ts">
4-
const router = useRouter()
5-
router.replace('/qqnt')
4+
definePage({
5+
redirect: '/qqnt',
6+
})
67
</script>
78

89
<style scoped lang="sass"></style>

docs/pages/qqnt/[id].vue

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@
168168
.lottie-preview
169169
LottieViewer(
170170
:animation-link='file.path',
171-
:height='200',
172-
:play-on-hover='true',
173-
:width='200'
171+
:auto-play='true',
172+
:height='data.animationHeigh || 200',
173+
:width='data.animationWidth || 200'
174+
renderer='canvas'
174175
)
175176
.lottie-info
176177
.lottie-name {{ file.name }}
@@ -206,56 +207,26 @@
206207
stroke-width='2'
207208
)
208209

209-
.debug-section(v-if='showDebug')
210+
.debug-section
210211
.section-card
211212
.section-header
212213
h2.section-title 调试信息
213-
button.debug-toggle(@click='showDebug = false')
214-
svg(
215-
fill='none'
216-
height='16'
217-
viewBox='0 0 24 24'
218-
width='16'
219-
xmlns='http://www.w3.org/2000/svg'
220-
)
221-
path(
222-
d='M18 6L6 18M6 6l12 12'
223-
stroke='currentColor'
224-
stroke-linecap='round'
225-
stroke-linejoin='round'
226-
stroke-width='2'
227-
)
228214
.debug-content
229215
pre {{ JSON.stringify(data, null, 2) }}
230-
231-
.debug-toggle-btn(@click='showDebug = true' v-if='!showDebug')
232-
svg(
233-
fill='none'
234-
height='16'
235-
viewBox='0 0 24 24'
236-
width='16'
237-
xmlns='http://www.w3.org/2000/svg'
238-
)
239-
path(
240-
d='M9 12l2 2 4-4M21 12a9 9 0 11-18 0 9 9 0 0118 0z'
241-
stroke='currentColor'
242-
stroke-linecap='round'
243-
stroke-linejoin='round'
244-
stroke-width='2'
245-
)
246-
span 调试信息
247216
</template>
248217

249218
<script setup lang="ts">
250219
import { QqSysEmojiAssetType } from '@/types/QqSysEmoji'
251-
import { Vue3Lottie as LottieViewer } from 'vue3-lottie'
220+
221+
const LottieViewer = defineAsyncComponent(() =>
222+
import('vue3-lottie').then((m) => m.Vue3Lottie)
223+
)
252224
253225
const qStore = useQqEmojiStore()
254226
const route = useRoute()
255227
const router = useRouter()
256228
257229
const emojiId = ref(route.params.id as string)
258-
const showDebug = ref(false)
259230
260231
const data = computed(() => {
261232
return qStore.allEmojiList.find((item) => item.emojiId === emojiId.value)

docs/pages/qqnt/index.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,17 @@ onMounted(() => {
206206
207207
.emoji-grid
208208
display: grid
209-
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr))
209+
grid-template-columns: repeat(auto-fit, 200px)
210210
gap: 24px
211211
margin-top: 20px
212+
justify-content: space-between
212213
213214
.emoji-card-link
214215
text-decoration: none
215216
color: inherit
217+
display: inline-block
218+
width: 200px
219+
height: 240px
216220
217221
.empty-state
218222
display: flex
@@ -263,9 +267,13 @@ onMounted(() => {
263267
width: 100%
264268
265269
.emoji-grid
266-
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr))
270+
grid-template-columns: repeat(auto-fit, 160px)
267271
gap: 16px
268272
273+
.emoji-card-link
274+
width: 160px
275+
height: 200px
276+
269277
.content-section
270278
padding: 40px 16px
271279
@@ -275,5 +283,9 @@ onMounted(() => {
275283
gap: 24px
276284
277285
.emoji-grid
278-
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr))
286+
grid-template-columns: repeat(auto-fit, 140px)
287+
288+
.emoji-card-link
289+
width: 140px
290+
height: 180px
279291
</style>

0 commit comments

Comments
 (0)