vitepress-theme-teek 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/common/index.mjs +6 -6
- package/es/components/theme/ArchivesPage/src/index.vue2.mjs +2 -2
- package/es/components/theme/ArticleAnalyze/src/index.vue2.mjs +15 -19
- package/es/components/theme/ArticleBreadcrumb/src/index.vue2.mjs +5 -5
- package/es/components/theme/ArticleUpdate/src/index.vue2.mjs +1 -1
- package/es/components/theme/CataloguePage/src/CatalogueItem.vue2.mjs +2 -2
- package/es/components/theme/CodeBlockToggle/src/index.vue2.mjs +6 -2
- package/es/components/theme/Home/src/index.vue.d.ts +2 -0
- package/es/components/theme/HomeCardList/src/index.vue.d.ts +4 -2
- package/es/components/theme/HomeCardList/src/index.vue2.mjs +77 -60
- package/es/components/theme/HomeCategoryCard/src/index.vue.d.ts +2 -21
- package/es/components/theme/HomeCategoryCard/src/index.vue2.mjs +73 -85
- package/es/components/theme/HomeDocAnalysisCard/src/index.vue.d.ts +1 -18
- package/es/components/theme/HomeDocAnalysisCard/src/index.vue2.mjs +63 -81
- package/es/components/theme/HomeFeature/src/index.vue2.mjs +2 -2
- package/es/components/theme/HomeFriendLinkCard/src/index.vue.d.ts +2 -21
- package/es/components/theme/HomeFriendLinkCard/src/index.vue2.mjs +90 -102
- package/es/components/theme/HomeFullscreenWallpaper/src/index.vue2.mjs +9 -9
- package/es/components/theme/HomeMyCard/src/index.vue.d.ts +1 -18
- package/es/components/theme/HomeMyCard/src/index.vue2.mjs +99 -111
- package/es/components/theme/HomePostList/src/index.vue.d.ts +1 -0
- package/es/components/theme/HomePostList/src/index.vue2.mjs +4 -3
- package/es/components/theme/HomeTagCard/src/index.vue.d.ts +1 -18
- package/es/components/theme/HomeTagCard/src/index.vue2.mjs +72 -84
- package/es/components/theme/HomeTopArticleCard/src/index.vue.d.ts +2 -21
- package/es/components/theme/HomeTopArticleCard/src/index.vue2.mjs +88 -100
- package/es/components/theme/LoginPage/src/useWatchLogin.mjs +1 -1
- package/es/components/theme/RightBottomButton/src/ThemeColor.vue2.mjs +2 -2
- package/es/components/theme/RightBottomButton/src/index.vue2.mjs +1 -1
- package/es/components/theme/index.mjs +10 -10
- package/es/composables/useUvPv.d.ts +4 -4
- package/es/composables/useUvPv.mjs +9 -3
- package/es/composables/useVpRouter.mjs +12 -12
- package/es/composables/useWindowSize.d.ts +1 -0
- package/es/composables/useWindowSize.mjs +5 -3
- package/es/config/index.d.ts +1 -0
- package/es/config/index.mjs +1 -0
- package/es/config/interface/codeBlock.d.ts +11 -0
- package/es/config/interface/wallpaper.d.ts +0 -6
- package/es/config/post/index.d.ts +2 -2
- package/es/config/post/index.mjs +12 -6
- package/es/index.css +1 -1
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +626 -678
- package/index.min.js +33 -33
- package/index.min.mjs +85 -85
- package/index.mjs +627 -679
- package/lib/components/common/index.js +23 -23
- package/lib/components/theme/ArchivesPage/src/index.vue2.js +1 -1
- package/lib/components/theme/ArticleAnalyze/src/index.vue2.js +15 -19
- package/lib/components/theme/ArticleBreadcrumb/src/index.vue2.js +5 -5
- package/lib/components/theme/ArticleUpdate/src/index.vue2.js +1 -1
- package/lib/components/theme/CataloguePage/src/CatalogueItem.vue2.js +2 -2
- package/lib/components/theme/CodeBlockToggle/src/index.vue2.js +6 -2
- package/lib/components/theme/Home/src/index.vue.d.ts +2 -0
- package/lib/components/theme/HomeCardList/src/index.vue.d.ts +4 -2
- package/lib/components/theme/HomeCardList/src/index.vue2.js +76 -59
- package/lib/components/theme/HomeCategoryCard/src/index.vue.d.ts +2 -21
- package/lib/components/theme/HomeCategoryCard/src/index.vue2.js +72 -84
- package/lib/components/theme/HomeDocAnalysisCard/src/index.vue.d.ts +1 -18
- package/lib/components/theme/HomeDocAnalysisCard/src/index.vue2.js +62 -80
- package/lib/components/theme/HomeFeature/src/index.vue2.js +1 -1
- package/lib/components/theme/HomeFriendLinkCard/src/index.vue.d.ts +2 -21
- package/lib/components/theme/HomeFriendLinkCard/src/index.vue2.js +89 -101
- package/lib/components/theme/HomeFullscreenWallpaper/src/index.vue2.js +9 -9
- package/lib/components/theme/HomeMyCard/src/index.vue.d.ts +1 -18
- package/lib/components/theme/HomeMyCard/src/index.vue2.js +98 -110
- package/lib/components/theme/HomePostList/src/index.vue.d.ts +1 -0
- package/lib/components/theme/HomePostList/src/index.vue2.js +3 -2
- package/lib/components/theme/HomeTagCard/src/index.vue.d.ts +1 -18
- package/lib/components/theme/HomeTagCard/src/index.vue2.js +71 -83
- package/lib/components/theme/HomeTopArticleCard/src/index.vue.d.ts +2 -21
- package/lib/components/theme/HomeTopArticleCard/src/index.vue2.js +87 -99
- package/lib/components/theme/LoginPage/src/useWatchLogin.js +1 -1
- package/lib/components/theme/RightBottomButton/src/ThemeColor.vue2.js +2 -2
- package/lib/components/theme/RightBottomButton/src/index.vue2.js +1 -1
- package/lib/components/theme/index.js +33 -33
- package/lib/composables/useUvPv.d.ts +4 -4
- package/lib/composables/useUvPv.js +8 -2
- package/lib/composables/useVpRouter.js +12 -12
- package/lib/composables/useWindowSize.d.ts +1 -0
- package/lib/composables/useWindowSize.js +5 -3
- package/lib/config/index.d.ts +1 -0
- package/lib/config/index.js +5 -0
- package/lib/config/interface/codeBlock.d.ts +11 -0
- package/lib/config/interface/wallpaper.d.ts +0 -6
- package/lib/config/post/index.d.ts +2 -2
- package/lib/config/post/index.js +12 -6
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -7
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/common/tk.scss +1 -1
- package/theme-chalk/src/components/theme/theme-enhance.scss +1 -0
- package/theme-chalk/tk-base.css +1 -1
- package/theme-chalk/tk-theme-enhance.css +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
export { createImageViewer } from './ImageViewer/index.mjs';
|
|
2
1
|
export { default as TkArticlePage } from './ArticlePage/src/index.vue2.mjs';
|
|
3
2
|
export { default as TkDocAsideOutline } from './ArticlePage/src/components/DocAsideOutline.vue2.mjs';
|
|
4
3
|
export { default as TkAvatar } from './Avatar/src/index.vue2.mjs';
|
|
5
4
|
export { default as TkBreadcrumb } from './Breadcrumb/src/Breadcrumb.vue2.mjs';
|
|
6
5
|
export { default as TkBreadcrumbItem } from './Breadcrumb/src/BreadcrumbItem.vue2.mjs';
|
|
6
|
+
export { default as TkFocusTrap } from './FocusTrap/src/index.vue.mjs';
|
|
7
7
|
export { default as TkIcon } from './Icon/src/index.vue2.mjs';
|
|
8
|
-
export {
|
|
8
|
+
export { WhatsApp, bilibili, email, gitee, github, moblieQQ, music, telegram } from './Icon/src/SocialIcons.mjs';
|
|
9
|
+
export { addCollection as addIcons } from '@iconify/vue';
|
|
10
|
+
export { createImageViewer } from './ImageViewer/index.mjs';
|
|
9
11
|
export { default as TkInputSlide } from './InputSlide/src/index.vue2.mjs';
|
|
10
12
|
export { default as TkMessage } from './Message/src/method.mjs';
|
|
13
|
+
export { getInstance, getLastOffset, getOffsetOrSpace, instances } from './Message/src/instance.mjs';
|
|
11
14
|
export { default as TkPagination } from './Pagination/src/index.vue2.mjs';
|
|
12
15
|
export { default as TkPopover } from './Popover/src/index.vue2.mjs';
|
|
13
16
|
export { default as TkSegmented } from './Segmented/src/Segmented.vue2.mjs';
|
|
@@ -16,7 +19,4 @@ export { default as TkTitleTag } from './TitleTag/src/index.vue2.mjs';
|
|
|
16
19
|
export { default as TkTransitionCollapse } from './TransitionCollapse/src/index.vue2.mjs';
|
|
17
20
|
export { default as TkVerifyCode } from './VerifyCode/src/index.vue2.mjs';
|
|
18
21
|
export { default as TkVpContainer } from './VpContainer/src/index.vue2.mjs';
|
|
19
|
-
export { default as
|
|
20
|
-
export { addCollection as addIcons } from '@iconify/vue';
|
|
21
|
-
export { WhatsApp, bilibili, email, gitee, github, moblieQQ, music, telegram } from './Icon/src/SocialIcons.mjs';
|
|
22
|
-
export { getInstance, getLastOffset, getOffsetOrSpace, instances } from './Message/src/instance.mjs';
|
|
22
|
+
export { default as TkImageViewer } from './ImageViewer/src/index.vue2.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed,
|
|
1
|
+
import { defineComponent, computed, ref, onMounted, resolveComponent, createBlock, openBlock, unref, normalizeClass, withCtx, renderSlot, createElementVNode, toDisplayString, createVNode, createElementBlock, Fragment, renderList } from 'vue';
|
|
2
2
|
import { useData, withBase } from 'vitepress';
|
|
3
3
|
import { useLocale } from '../../../../composables/useLocale.mjs';
|
|
4
4
|
import { useNamespace } from '../../../../composables/useNamespace.mjs';
|
|
@@ -36,7 +36,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
};
|
|
37
37
|
});
|
|
38
38
|
const windowTransition = useWindowTransitionConfig((config) => config.archives);
|
|
39
|
-
const timelineItemListInstance =
|
|
39
|
+
const timelineItemListInstance = ref(null);
|
|
40
40
|
const { start } = useWindowTransition(timelineItemListInstance, false);
|
|
41
41
|
onMounted(() => {
|
|
42
42
|
windowTransition.value && start();
|
|
@@ -44,13 +44,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
author: getTeekConfig("author", {}),
|
|
45
45
|
date: frontmatter.value.date,
|
|
46
46
|
frontmatter: frontmatter.value,
|
|
47
|
-
url: ""
|
|
47
|
+
url: "",
|
|
48
|
+
relativePath: ""
|
|
48
49
|
}));
|
|
49
50
|
const docAnalysisInfo = computed(() => theme.value.docAnalysisInfo || {});
|
|
50
51
|
const pageViewInfo = computed(() => {
|
|
51
52
|
let pageViewInfo2 = {};
|
|
52
53
|
docAnalysisInfo.value.eachFileWords?.forEach((item) => {
|
|
53
|
-
if (item.fileInfo.relativePath === router.route.data.
|
|
54
|
+
if (item.fileInfo.relativePath === router.route.data.filePath) pageViewInfo2 = item;
|
|
54
55
|
});
|
|
55
56
|
return pageViewInfo2;
|
|
56
57
|
});
|
|
@@ -93,25 +94,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
94
|
}));
|
|
94
95
|
const usePageView = computed(() => !!statisticsConfig.value.provider && statisticsConfig.value.pageView);
|
|
95
96
|
const { pagePv, isGet, request } = useUvPv(false, statisticsConfig.value);
|
|
96
|
-
const statisticsInfo = computed(() => ({ pagePv: pagePv.value, isGet: isGet.value }));
|
|
97
97
|
watch(usePageView, (newVal) => {
|
|
98
98
|
if (newVal) request();
|
|
99
99
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
{ immediate: true }
|
|
113
|
-
);
|
|
114
|
-
}
|
|
100
|
+
watch(
|
|
101
|
+
router.route,
|
|
102
|
+
() => {
|
|
103
|
+
if (usePageView.value) {
|
|
104
|
+
if (statisticsConfig.value.permalink && router.state?.permalinkPlugin) {
|
|
105
|
+
nextTick(request);
|
|
106
|
+
} else request();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{ immediate: true }
|
|
110
|
+
);
|
|
115
111
|
return (_ctx, _cache) => {
|
|
116
112
|
return openBlock(), createElementBlock("div", {
|
|
117
113
|
class: normalizeClass(`${unref(ns).b()} flx-justify-between`),
|
|
@@ -163,7 +159,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
163
159
|
title: unref(t)("tk.articleAnalyze.pageView"),
|
|
164
160
|
class: "hover-color",
|
|
165
161
|
"aria-label": unref(t)("tk.articleAnalyze.pageView")
|
|
166
|
-
}, toDisplayString(
|
|
162
|
+
}, toDisplayString(unref(isGet) ? unref(pagePv) : "Get..."), 9, _hoisted_7)
|
|
167
163
|
])) : createCommentVNode("v-if", true)
|
|
168
164
|
],
|
|
169
165
|
2
|
|
@@ -26,7 +26,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
separator: "/",
|
|
27
27
|
homeLabel: t("tk.articleBreadcrumb.home")
|
|
28
28
|
});
|
|
29
|
-
const relativePathArr = computed(() => page.value.
|
|
29
|
+
const relativePathArr = computed(() => page.value.filePath.split("/") || []);
|
|
30
30
|
const breadcrumbList = computed(() => {
|
|
31
31
|
const classifyList = [];
|
|
32
32
|
const relativePathArrConst = relativePathArr.value;
|
|
@@ -35,7 +35,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
if ((index !== relativePathArrConst.length - 1 || breadcrumb.value.showCurrentName) && fileName !== localeIndex.value) {
|
|
36
36
|
classifyList.push({
|
|
37
37
|
fileName,
|
|
38
|
-
|
|
38
|
+
url: theme.value.catalogues?.inv[item]?.url || ""
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -78,10 +78,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
78
|
{ key: index },
|
|
79
79
|
{
|
|
80
80
|
default: withCtx(() => [
|
|
81
|
-
(openBlock(), createBlock(resolveDynamicComponent(item.
|
|
82
|
-
href: item.
|
|
81
|
+
(openBlock(), createBlock(resolveDynamicComponent(item.url ? "a" : "span"), {
|
|
82
|
+
href: item.url && unref(withBase)(`/${item.url}`),
|
|
83
83
|
title: item.fileName,
|
|
84
|
-
class: normalizeClass([item.
|
|
84
|
+
class: normalizeClass([item.url ? "hover-color" : ""]),
|
|
85
85
|
"aria-label": item.fileName
|
|
86
86
|
}, {
|
|
87
87
|
default: withCtx(() => [
|
|
@@ -27,7 +27,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
limit: 3
|
|
28
28
|
});
|
|
29
29
|
const updatePosts = computed(() => {
|
|
30
|
-
const path = "/" + route.data.
|
|
30
|
+
const path = "/" + route.data.filePath.replace(".md", "");
|
|
31
31
|
return [
|
|
32
32
|
...posts.value.sortPostsByDate.filter((item) => ![route.path, path, `${path}.html`].includes(item.url)).slice(0, articleConfig.value.limit),
|
|
33
33
|
{ title: "\u66F4\u591A\u6587\u7AE0 >", url: archivesPath.value, frontmatter: {}, date: "" }
|
|
@@ -30,7 +30,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
[
|
|
31
31
|
!_ctx.item.children ? (openBlock(), createElementBlock("a", {
|
|
32
32
|
key: 0,
|
|
33
|
-
href: _ctx.item.
|
|
33
|
+
href: _ctx.item.url && unref(withBase)(_ctx.item.url),
|
|
34
34
|
"aria-label": `${_ctx.index}. ${_ctx.item.title}`
|
|
35
35
|
}, [
|
|
36
36
|
createTextVNode(
|
|
@@ -48,7 +48,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
48
|
size: "small",
|
|
49
49
|
"aria-label": _ctx.item.frontmatter?.titleTag
|
|
50
50
|
}, null, 8, ["text", "aria-label"])) : createCommentVNode("v-if", true)
|
|
51
|
-
], 8, _hoisted_1)) : _ctx.item.children.length
|
|
51
|
+
], 8, _hoisted_1)) : _ctx.item.children.length ? (openBlock(), createElementBlock(
|
|
52
52
|
Fragment,
|
|
53
53
|
{ key: 1 },
|
|
54
54
|
[
|
|
@@ -22,15 +22,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
collapseHeight: 700,
|
|
23
23
|
copiedDone: void 0,
|
|
24
24
|
overlay: false,
|
|
25
|
-
overlayHeight: 400
|
|
25
|
+
overlayHeight: 400,
|
|
26
|
+
langTextTransform: ""
|
|
26
27
|
});
|
|
27
28
|
watch(
|
|
28
29
|
codeBlockConfig,
|
|
29
30
|
(newVal) => {
|
|
30
31
|
if (!isClient) return;
|
|
31
|
-
const { disabled } = newVal || {};
|
|
32
|
+
const { disabled, langTextTransform } = newVal || {};
|
|
32
33
|
if (disabled) return document.documentElement.removeAttribute(documentAttribute);
|
|
33
34
|
document.documentElement.setAttribute(documentAttribute, ns.namespace);
|
|
35
|
+
if (langTextTransform) {
|
|
36
|
+
document.documentElement.style.setProperty(ns.cssVarName("code-block-lang-transform"), langTextTransform);
|
|
37
|
+
}
|
|
34
38
|
nextTick(() => initCodeBlock());
|
|
35
39
|
},
|
|
36
40
|
{ immediate: true }
|
|
@@ -66,6 +66,7 @@ declare function __VLS_template(): {
|
|
|
66
66
|
'teek-home-post-list'?(_: {
|
|
67
67
|
currentPosts: {
|
|
68
68
|
url: string;
|
|
69
|
+
relativePath: string;
|
|
69
70
|
src?: string | undefined;
|
|
70
71
|
html?: string | undefined;
|
|
71
72
|
frontmatter: Record<string, any>;
|
|
@@ -149,6 +150,7 @@ declare const __VLS_component: DefineComponent<{}, {}, {}, {}, {}, ComponentOpti
|
|
|
149
150
|
'teek-home-post-list'?(_: {
|
|
150
151
|
currentPosts: {
|
|
151
152
|
url: string;
|
|
153
|
+
relativePath: string;
|
|
152
154
|
src?: string | undefined;
|
|
153
155
|
html?: string | undefined;
|
|
154
156
|
frontmatter: Record<string, any>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
|
-
slots: Partial<Record<any, (_: {}) => any>> & Partial<Record<any, (_: {}) => any>> & {
|
|
4
|
+
slots: Partial<Record<`${any}-before`, (_: {}) => any>> & Partial<Record<any, (_: {}) => any>> & Partial<Record<`${any}-after`, (_: {}) => any>> & Partial<Record<`${any}-before`, (_: {}) => any>> & Partial<Record<any, (_: {}) => any>> & Partial<Record<`${any}-after`, (_: {}) => any>> & {
|
|
5
5
|
'teek-home-card-before'?(_: {}): any;
|
|
6
|
-
'teek-home-card'?(_: {
|
|
6
|
+
'teek-home-card'?(_: {
|
|
7
|
+
homeCard: string[];
|
|
8
|
+
}): any;
|
|
7
9
|
'teek-home-card-after'?(_: {}): any;
|
|
8
10
|
};
|
|
9
11
|
refs: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed,
|
|
1
|
+
import { defineComponent, computed, ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot, Fragment, renderList, createCommentVNode, createElementVNode, createBlock, resolveDynamicComponent, mergeProps } from 'vue';
|
|
2
2
|
import 'vitepress';
|
|
3
3
|
import { useNamespace } from '../../../../composables/useNamespace.mjs';
|
|
4
4
|
import { useWindowTransition } from '../../../../composables/useWindowTransition.mjs';
|
|
@@ -32,39 +32,39 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
32
|
my: {
|
|
33
33
|
el: _sfc_main$6,
|
|
34
34
|
show: homePage,
|
|
35
|
-
slot:
|
|
35
|
+
slot: "teek-home-card-my"
|
|
36
36
|
},
|
|
37
37
|
topArticle: {
|
|
38
38
|
el: _sfc_main$5,
|
|
39
39
|
show: homePage && topArticle?.enabled !== false,
|
|
40
|
-
slot:
|
|
40
|
+
slot: "teek-home-card-top-article"
|
|
41
41
|
},
|
|
42
42
|
category: {
|
|
43
43
|
el: _sfc_main$4,
|
|
44
44
|
props: { categoriesPage },
|
|
45
45
|
show: (homePage || categoriesPage) && category?.enabled !== false,
|
|
46
|
-
slot:
|
|
46
|
+
slot: "teek-home-card-category"
|
|
47
47
|
},
|
|
48
48
|
tag: {
|
|
49
49
|
el: _sfc_main$3,
|
|
50
50
|
props: { tagsPage },
|
|
51
51
|
show: (homePage || tagsPage) && tag?.enabled !== false,
|
|
52
|
-
slot:
|
|
52
|
+
slot: "teek-home-card-tag"
|
|
53
53
|
},
|
|
54
54
|
docAnalysis: {
|
|
55
55
|
el: _sfc_main$2,
|
|
56
56
|
show: homePage && docAnalysis?.enabled !== false,
|
|
57
|
-
slot:
|
|
57
|
+
slot: "teek-home-card-doc-analysis"
|
|
58
58
|
},
|
|
59
59
|
friendLink: {
|
|
60
60
|
el: _sfc_main$1,
|
|
61
61
|
show: homePage && friendLink?.enabled !== false,
|
|
62
|
-
slot:
|
|
62
|
+
slot: "teek-home-card-friend-link"
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
66
|
const windowTransition = useWindowTransitionConfig((config) => config.card);
|
|
67
|
-
const cardListInstance =
|
|
67
|
+
const cardListInstance = ref(null);
|
|
68
68
|
const { start } = useWindowTransition(cardListInstance, false);
|
|
69
69
|
onMounted(() => {
|
|
70
70
|
windowTransition.value && start();
|
|
@@ -77,7 +77,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
77
|
},
|
|
78
78
|
[
|
|
79
79
|
renderSlot(_ctx.$slots, "teek-home-card-before"),
|
|
80
|
-
renderSlot(_ctx.$slots, "teek-home-card", {}, () => [
|
|
80
|
+
renderSlot(_ctx.$slots, "teek-home-card", { homeCard: finalHomeCardSort.value }, () => [
|
|
81
81
|
(openBlock(true), createElementBlock(
|
|
82
82
|
Fragment,
|
|
83
83
|
null,
|
|
@@ -88,66 +88,83 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
88
|
[
|
|
89
89
|
createCommentVNode(" \u4F7F\u7528\u6DE1\u5165\u52A8\u753B "),
|
|
90
90
|
unref(windowTransition) ? (openBlock(), createElementBlock(
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
key: 0,
|
|
94
|
-
ref_for: true,
|
|
95
|
-
ref_key: "cardListInstance",
|
|
96
|
-
ref: cardListInstance
|
|
97
|
-
},
|
|
91
|
+
Fragment,
|
|
92
|
+
{ key: 0 },
|
|
98
93
|
[
|
|
99
|
-
componentMap.value[item]?.
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
_ctx.$slots[`${componentMap.value[item]?.slot}-before`] ? (openBlock(), createElementBlock(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
102
97
|
key: 0,
|
|
103
|
-
ref_for: true
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
98
|
+
ref_for: true,
|
|
99
|
+
ref_key: "cardListInstance",
|
|
100
|
+
ref: cardListInstance
|
|
101
|
+
},
|
|
102
|
+
[
|
|
103
|
+
renderSlot(_ctx.$slots, `${componentMap.value[item]?.slot}-before`)
|
|
104
|
+
],
|
|
105
|
+
512
|
|
106
|
+
/* NEED_PATCH */
|
|
107
|
+
)) : createCommentVNode("v-if", true),
|
|
108
|
+
createElementVNode(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
ref_for: true,
|
|
112
|
+
ref_key: "cardListInstance",
|
|
113
|
+
ref: cardListInstance
|
|
114
|
+
},
|
|
115
|
+
[
|
|
116
|
+
renderSlot(_ctx.$slots, componentMap.value[item]?.slot, {}, () => [
|
|
117
|
+
componentMap.value[item]?.show ? (openBlock(), createBlock(
|
|
118
|
+
resolveDynamicComponent(componentMap.value[item]?.el),
|
|
119
|
+
mergeProps({
|
|
120
|
+
key: 0,
|
|
121
|
+
ref_for: true
|
|
122
|
+
}, componentMap.value[item]?.props),
|
|
123
|
+
null,
|
|
124
|
+
16
|
|
125
|
+
/* FULL_PROPS */
|
|
126
|
+
)) : createCommentVNode("v-if", true)
|
|
127
|
+
])
|
|
128
|
+
],
|
|
129
|
+
512
|
|
130
|
+
/* NEED_PATCH */
|
|
131
|
+
),
|
|
132
|
+
_ctx.$slots[`${componentMap.value[item]?.slot}-after`] ? (openBlock(), createElementBlock(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
key: 1,
|
|
136
|
+
ref_for: true,
|
|
137
|
+
ref_key: "cardListInstance",
|
|
138
|
+
ref: cardListInstance
|
|
139
|
+
},
|
|
140
|
+
[
|
|
141
|
+
renderSlot(_ctx.$slots, `${componentMap.value[item]?.slot}-after`)
|
|
142
|
+
],
|
|
143
|
+
512
|
|
144
|
+
/* NEED_PATCH */
|
|
120
145
|
)) : createCommentVNode("v-if", true)
|
|
121
146
|
],
|
|
122
|
-
|
|
123
|
-
/*
|
|
147
|
+
64
|
|
148
|
+
/* STABLE_FRAGMENT */
|
|
124
149
|
)) : (openBlock(), createElementBlock(
|
|
125
150
|
Fragment,
|
|
126
151
|
{ key: 1 },
|
|
127
152
|
[
|
|
128
153
|
createCommentVNode(" \u4E0D\u4F7F\u7528\u6DE1\u5165\u52A8\u753B "),
|
|
129
|
-
componentMap.value[item]?.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
renderSlot(_ctx.$slots, name)
|
|
144
|
-
])
|
|
145
|
-
};
|
|
146
|
-
})
|
|
147
|
-
]),
|
|
148
|
-
1040
|
|
149
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
150
|
-
)) : createCommentVNode("v-if", true)
|
|
154
|
+
componentMap.value[item]?.slot ? renderSlot(_ctx.$slots, `${componentMap.value[item]?.slot}-before`, { key: 0 }) : createCommentVNode("v-if", true),
|
|
155
|
+
componentMap.value[item]?.slot ? renderSlot(_ctx.$slots, componentMap.value[item]?.slot, { key: 1 }, () => [
|
|
156
|
+
componentMap.value[item]?.show ? (openBlock(), createBlock(
|
|
157
|
+
resolveDynamicComponent(componentMap.value[item]?.el),
|
|
158
|
+
mergeProps({
|
|
159
|
+
key: 0,
|
|
160
|
+
ref_for: true
|
|
161
|
+
}, componentMap.value[item]?.props),
|
|
162
|
+
null,
|
|
163
|
+
16
|
|
164
|
+
/* FULL_PROPS */
|
|
165
|
+
)) : createCommentVNode("v-if", true)
|
|
166
|
+
]) : createCommentVNode("v-if", true),
|
|
167
|
+
componentMap.value[item]?.slot ? renderSlot(_ctx.$slots, `${componentMap.value[item]?.slot}-after`, { key: 2 }) : createCommentVNode("v-if", true)
|
|
151
168
|
],
|
|
152
169
|
64
|
|
153
170
|
/* STABLE_FRAGMENT */
|
|
@@ -2,26 +2,7 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
categoriesPage?: boolean;
|
|
4
4
|
};
|
|
5
|
-
declare
|
|
6
|
-
attrs: Partial<{}>;
|
|
7
|
-
slots: {
|
|
8
|
-
'teek-home-card-category-before'?(_: {}): any;
|
|
9
|
-
'teek-home-card-category'?(_: {}): any;
|
|
10
|
-
'teek-home-card-category-after'?(_: {}): any;
|
|
11
|
-
};
|
|
12
|
-
refs: {
|
|
13
|
-
itemRefs: HTMLAnchorElement[];
|
|
14
|
-
};
|
|
15
|
-
rootEl: any;
|
|
16
|
-
};
|
|
17
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
-
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
5
|
+
declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
19
6
|
itemRefs: HTMLAnchorElement[];
|
|
20
|
-
},
|
|
21
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
7
|
+
}, HTMLDivElement>;
|
|
22
8
|
export default _default;
|
|
23
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
-
new (): {
|
|
25
|
-
$slots: S;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, inject, onMounted, watch,
|
|
1
|
+
import { defineComponent, ref, computed, inject, onMounted, watch, createBlock, openBlock, unref, normalizeClass, withCtx, createElementBlock, TransitionGroup, createCommentVNode, Fragment, renderList, normalizeStyle, createElementVNode, toDisplayString } from 'vue';
|
|
2
2
|
import { useRouter, withBase } from 'vitepress';
|
|
3
3
|
import { isFunction } from '../../../../helper/dist/index.mjs';
|
|
4
4
|
import { useLocale } from '../../../../composables/useLocale.mjs';
|
|
@@ -89,91 +89,79 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
89
|
);
|
|
90
90
|
const itemRefs = ref([]);
|
|
91
91
|
return (_ctx, _cache) => {
|
|
92
|
-
return openBlock(),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
[
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
92
|
+
return openBlock(), createBlock(unref(_sfc_main$1), {
|
|
93
|
+
page: !_ctx.categoriesPage,
|
|
94
|
+
modelValue: pageNum.value,
|
|
95
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => pageNum.value = $event),
|
|
96
|
+
pageSize: unref(categoryConfig).limit,
|
|
97
|
+
total: categories.value.length,
|
|
98
|
+
title: finalTitle.value[_ctx.categoriesPage ? "pt" : "ht"],
|
|
99
|
+
titleClick: handleSwitchCategory,
|
|
100
|
+
autoPage: unref(categoryConfig).autoPage,
|
|
101
|
+
pageSpeed: unref(categoryConfig).pageSpeed,
|
|
102
|
+
class: normalizeClass([unref(ns).b(), unref(ns).is("page", _ctx.categoriesPage)]),
|
|
103
|
+
"aria-label": unref(t)("tk.categoryCard.label")
|
|
104
|
+
}, {
|
|
105
|
+
default: withCtx(({ transitionName }) => [
|
|
106
|
+
categories.value.length ? (openBlock(), createBlock(TransitionGroup, {
|
|
107
|
+
key: 0,
|
|
108
|
+
name: transitionName,
|
|
109
|
+
tag: "div",
|
|
110
|
+
mode: "out-in",
|
|
111
|
+
class: normalizeClass(`${unref(ns).e("list")} flx-column`),
|
|
112
|
+
"aria-label": unref(t)("tk.categoryCard.listLabel")
|
|
113
|
+
}, {
|
|
114
|
+
default: withCtx(() => [
|
|
115
|
+
(openBlock(true), createElementBlock(
|
|
116
|
+
Fragment,
|
|
117
|
+
null,
|
|
118
|
+
renderList(currentCategories.value, (item, index) => {
|
|
119
|
+
return openBlock(), createElementBlock("a", {
|
|
120
|
+
ref_for: true,
|
|
121
|
+
ref_key: "itemRefs",
|
|
122
|
+
ref: itemRefs,
|
|
123
|
+
key: item.name,
|
|
124
|
+
onClick: ($event) => handleSwitchCategory(item.name),
|
|
125
|
+
class: normalizeClass([{ active: item.name === selectedCategory.value }, "hover-color"]),
|
|
126
|
+
style: normalizeStyle(`top: ${index * itemRefs.value?.[index]?.getBoundingClientRect().height || 0}px`),
|
|
127
|
+
"aria-label": item.name
|
|
128
|
+
}, [
|
|
129
|
+
createElementVNode(
|
|
130
|
+
"span",
|
|
131
|
+
_hoisted_2,
|
|
132
|
+
toDisplayString(item.name),
|
|
133
|
+
1
|
|
134
|
+
/* TEXT */
|
|
135
|
+
),
|
|
136
|
+
createElementVNode(
|
|
137
|
+
"span",
|
|
123
138
|
null,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}),
|
|
151
|
-
128
|
|
152
|
-
/* KEYED_FRAGMENT */
|
|
153
|
-
)),
|
|
154
|
-
!_ctx.categoriesPage && unref(categoryConfig).limit < categories.value.length ? (openBlock(), createElementBlock("a", {
|
|
155
|
-
key: 0,
|
|
156
|
-
href: unref(withBase)(unref(categoryPath)),
|
|
157
|
-
"aria-label": unref(categoryConfig).moreLabel
|
|
158
|
-
}, toDisplayString(unref(categoryConfig).moreLabel), 9, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
159
|
-
]),
|
|
160
|
-
_: 2
|
|
161
|
-
/* DYNAMIC */
|
|
162
|
-
}, 1032, ["name", "class", "aria-label"])) : (openBlock(), createElementBlock("div", {
|
|
163
|
-
key: 1,
|
|
164
|
-
class: normalizeClass(unref(ns).m("empty")),
|
|
165
|
-
"aria-label": unref(categoryConfig).emptyLabel
|
|
166
|
-
}, toDisplayString(unref(categoryConfig).emptyLabel), 11, _hoisted_4))
|
|
167
|
-
]),
|
|
168
|
-
_: 1
|
|
169
|
-
/* STABLE */
|
|
170
|
-
}, 8, ["page", "modelValue", "pageSize", "total", "title", "autoPage", "pageSpeed", "class", "aria-label"])
|
|
171
|
-
]),
|
|
172
|
-
renderSlot(_ctx.$slots, "teek-home-card-category-after")
|
|
173
|
-
],
|
|
174
|
-
64
|
|
175
|
-
/* STABLE_FRAGMENT */
|
|
176
|
-
);
|
|
139
|
+
toDisplayString(item.length),
|
|
140
|
+
1
|
|
141
|
+
/* TEXT */
|
|
142
|
+
)
|
|
143
|
+
], 14, _hoisted_1);
|
|
144
|
+
}),
|
|
145
|
+
128
|
|
146
|
+
/* KEYED_FRAGMENT */
|
|
147
|
+
)),
|
|
148
|
+
!_ctx.categoriesPage && unref(categoryConfig).limit < categories.value.length ? (openBlock(), createElementBlock("a", {
|
|
149
|
+
key: 0,
|
|
150
|
+
href: unref(withBase)(unref(categoryPath)),
|
|
151
|
+
"aria-label": unref(categoryConfig).moreLabel
|
|
152
|
+
}, toDisplayString(unref(categoryConfig).moreLabel), 9, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
153
|
+
]),
|
|
154
|
+
_: 2
|
|
155
|
+
/* DYNAMIC */
|
|
156
|
+
}, 1032, ["name", "class", "aria-label"])) : (openBlock(), createElementBlock("div", {
|
|
157
|
+
key: 1,
|
|
158
|
+
class: normalizeClass(unref(ns).m("empty")),
|
|
159
|
+
"aria-label": unref(categoryConfig).emptyLabel
|
|
160
|
+
}, toDisplayString(unref(categoryConfig).emptyLabel), 11, _hoisted_4))
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
/* STABLE */
|
|
164
|
+
}, 8, ["page", "modelValue", "pageSize", "total", "title", "autoPage", "pageSpeed", "class", "aria-label"]);
|
|
177
165
|
};
|
|
178
166
|
}
|
|
179
167
|
});
|