vitepress-theme-teek 1.5.6 → 1.5.7
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/ImageViewer/src/ImageViewer.vue2.mjs +1 -0
- package/es/components/common/ImageViewer/src/imageViewer.d.ts +7 -0
- package/es/components/theme/ArticleOverviewPage/src/index.vue2.mjs +1 -1
- package/es/components/theme/ConfigProvider/index.mjs +14 -6
- package/es/components/theme/HomeFriendLinkCard/src/ItemInfo.vue.d.ts +3 -1
- package/es/components/theme/HomeFriendLinkCard/src/ItemInfo.vue2.mjs +19 -3
- package/es/components/theme/HomeFriendLinkCard/src/index.vue2.mjs +1 -1
- package/es/components/theme/Layout/src/index.vue2.mjs +7 -6
- package/es/config/types.d.ts +1 -1
- package/es/index.css +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +44 -18
- package/index.min.js +21 -21
- package/index.min.mjs +39 -39
- package/index.mjs +45 -19
- package/lib/components/common/ImageViewer/src/ImageViewer.vue2.js +1 -0
- package/lib/components/common/ImageViewer/src/imageViewer.d.ts +7 -0
- package/lib/components/theme/ArticleOverviewPage/src/index.vue2.js +1 -1
- package/lib/components/theme/ConfigProvider/index.js +14 -6
- package/lib/components/theme/HomeFriendLinkCard/src/ItemInfo.vue.d.ts +3 -1
- package/lib/components/theme/HomeFriendLinkCard/src/ItemInfo.vue2.js +18 -2
- package/lib/components/theme/HomeFriendLinkCard/src/index.vue2.js +1 -1
- package/lib/components/theme/Layout/src/index.vue2.js +7 -6
- package/lib/config/types.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -6
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/components/theme/body-bg-image.scss +4 -1
- package/theme-chalk/tk-body-bg-image.css +1 -1
|
@@ -33,7 +33,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
const categoriesPageLink = computed(() => {
|
|
34
34
|
const localeIndexConst = localeIndex.value;
|
|
35
35
|
const localeName = localeIndexConst !== "root" ? `/${localeIndexConst}` : "";
|
|
36
|
-
return `${localeName}${categoryConfig.value.path}${site.value.cleanUrls ? "" : ".html"}
|
|
36
|
+
return withBase(`${localeName}${categoryConfig.value.path}${site.value.cleanUrls ? "" : ".html"}`);
|
|
37
37
|
});
|
|
38
38
|
const getFileWords = (url) => {
|
|
39
39
|
return eachFileWords.value.filter((item) => {
|
|
@@ -56,11 +56,19 @@ const usePageState = () => {
|
|
|
56
56
|
);
|
|
57
57
|
const isCategoriesPage = computed(() => !!frontmatter.value.categoriesPage);
|
|
58
58
|
const isTagsPage = computed(() => !!frontmatter.value.tagsPage);
|
|
59
|
-
const isArchivesPage = computed(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
59
|
+
const isArchivesPage = computed(
|
|
60
|
+
() => !!frontmatter.value.archivesPage || frontmatter.value.layout === "TkArchivesPage"
|
|
61
|
+
);
|
|
62
|
+
const isCataloguePage = computed(
|
|
63
|
+
() => !!frontmatter.value.catalogue || frontmatter.value.layout === "TkCataloguePage"
|
|
64
|
+
);
|
|
65
|
+
const isArticleOverviewPage = computed(
|
|
66
|
+
() => !!frontmatter.value.articleOverviewPage || frontmatter.value.layout === "TkArticleOverviewPage"
|
|
67
|
+
);
|
|
68
|
+
const isLoginUrl = computed(() => !!frontmatter.value.loginPage || frontmatter.value.layout === "TkLoginPage");
|
|
69
|
+
const isRiskLinkPage = computed(
|
|
70
|
+
() => !!frontmatter.value.riskLinkPage || frontmatter.value.layout === "TkRiskLinkPage"
|
|
71
|
+
);
|
|
64
72
|
return {
|
|
65
73
|
isHomePage,
|
|
66
74
|
isCategoriesPage,
|
|
@@ -99,7 +107,7 @@ const usePagePath = () => {
|
|
|
99
107
|
url
|
|
100
108
|
} = item;
|
|
101
109
|
const isPageLayout = layout === "page";
|
|
102
|
-
if (layout === "
|
|
110
|
+
if (layout === "TkArchivesPage" || isPageLayout && archivesPage === true) archivesUrl = url;
|
|
103
111
|
if (layout === "TkArticleOverviewPage" || isPageLayout && articleOverviewPage === true) {
|
|
104
112
|
articleOverviewUrl = url;
|
|
105
113
|
}
|
|
@@ -5,5 +5,7 @@ type __VLS_Props = {
|
|
|
5
5
|
item: FriendLinkItem;
|
|
6
6
|
ns: UseNamespaceReturn;
|
|
7
7
|
};
|
|
8
|
-
declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
8
|
+
declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
9
|
+
imgInstance: HTMLImageElement;
|
|
10
|
+
}, HTMLAnchorElement>;
|
|
9
11
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, unref, createElementVNode, normalizeClass, toDisplayString } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, onMounted, openBlock, createElementBlock, unref, createElementVNode, normalizeClass, toDisplayString } from 'vue';
|
|
2
2
|
import { withBase } from 'vitepress';
|
|
3
3
|
|
|
4
4
|
const _hoisted_1 = ["href", "aria-label"];
|
|
@@ -13,6 +13,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
ns: {}
|
|
14
14
|
},
|
|
15
15
|
setup(__props) {
|
|
16
|
+
const imgInstance = useTemplateRef("imgInstance");
|
|
17
|
+
const addLoadedClass = (e) => {
|
|
18
|
+
if (e?.target) e.target.classList.add("loaded");
|
|
19
|
+
else if (imgInstance.value) imgInstance.value.classList.add("loaded");
|
|
20
|
+
};
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
const img = imgInstance.value;
|
|
23
|
+
if (!img) return;
|
|
24
|
+
if (img.complete) addLoadedClass();
|
|
25
|
+
else {
|
|
26
|
+
img.addEventListener("load", () => addLoadedClass());
|
|
27
|
+
img.addEventListener("error", () => addLoadedClass());
|
|
28
|
+
}
|
|
29
|
+
});
|
|
16
30
|
return (_ctx, _cache) => {
|
|
17
31
|
return openBlock(), createElementBlock("a", {
|
|
18
32
|
href: __props.item.link && unref(withBase)(__props.item.link),
|
|
@@ -22,12 +36,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
36
|
}, [
|
|
23
37
|
createElementVNode("div", _hoisted_2, [
|
|
24
38
|
createElementVNode("img", {
|
|
39
|
+
ref_key: "imgInstance",
|
|
40
|
+
ref: imgInstance,
|
|
25
41
|
src: __props.item.avatar && unref(withBase)(__props.item.avatar),
|
|
26
42
|
class: "avatar",
|
|
27
43
|
alt: __props.item.alt || __props.item.name,
|
|
28
44
|
"aria-hidden": "true",
|
|
29
|
-
onLoad:
|
|
30
|
-
onError:
|
|
45
|
+
onLoad: addLoadedClass,
|
|
46
|
+
onError: addLoadedClass
|
|
31
47
|
}, null, 40, _hoisted_3)
|
|
32
48
|
]),
|
|
33
49
|
createElementVNode(
|
|
@@ -68,7 +68,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
68
|
pageSize: unref(friendLinkConfig).limit,
|
|
69
69
|
total: unref(friendLinkConfig).list.length,
|
|
70
70
|
title: finalTitle.value,
|
|
71
|
-
titleClick: unref(friendLinkConfig).titleClick ? handleTitleClick : void 0,
|
|
71
|
+
titleClick: unref(friendLinkConfig).titleClick !== void 0 ? handleTitleClick : void 0,
|
|
72
72
|
autoPage: unref(friendLinkConfig).autoPage,
|
|
73
73
|
pageSpeed: unref(friendLinkConfig).pageSpeed,
|
|
74
74
|
class: normalizeClass(unref(ns).b()),
|
|
@@ -80,9 +80,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
80
|
riskLink: { enabled: false },
|
|
81
81
|
themeEnhance: { enabled: true },
|
|
82
82
|
articleBanner: { enabled: false },
|
|
83
|
-
pageStyle: "default"
|
|
83
|
+
pageStyle: "default",
|
|
84
|
+
articleAnalyze: {}
|
|
84
85
|
});
|
|
85
|
-
const loading = ref(teekConfig.value.loading);
|
|
86
|
+
const loading = ref(!!teekConfig.value.loading);
|
|
86
87
|
const commentConfig = computed(() => {
|
|
87
88
|
const frontmatterComment = frontmatter.value.comment;
|
|
88
89
|
const configComment = teekConfig.value.comment;
|
|
@@ -369,17 +370,17 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
369
370
|
64
|
|
370
371
|
/* STABLE_FRAGMENT */
|
|
371
372
|
)) : createCommentVNode("v-if", true),
|
|
372
|
-
|
|
373
|
+
unref(teekConfig).articleAnalyze.imageViewer?.enabled ?? true ? (openBlock(), createBlock(unref(_sfc_main$m), { key: 1 })) : createCommentVNode("v-if", true),
|
|
373
374
|
createVNode(unref(_sfc_main$n)),
|
|
374
|
-
unref(teekConfig).codeBlock.enabled ?? true ? (openBlock(), createBlock(unref(_sfc_main$o), { key:
|
|
375
|
+
unref(teekConfig).codeBlock.enabled ?? true ? (openBlock(), createBlock(unref(_sfc_main$o), { key: 2 })) : createCommentVNode("v-if", true),
|
|
375
376
|
topTipConfig.value ? (openBlock(), createBlock(
|
|
376
377
|
unref(_sfc_main$k),
|
|
377
|
-
normalizeProps(mergeProps({ key:
|
|
378
|
+
normalizeProps(mergeProps({ key: 3 }, unref(isBoolean)(topTipConfig.value) ? {} : topTipConfig.value)),
|
|
378
379
|
null,
|
|
379
380
|
16
|
|
380
381
|
/* FULL_PROPS */
|
|
381
382
|
)) : createCommentVNode("v-if", true),
|
|
382
|
-
unref(teekConfig).sidebarTrigger ? (openBlock(), createBlock(unref(_sfc_main$p), { key:
|
|
383
|
+
unref(teekConfig).sidebarTrigger ? (openBlock(), createBlock(unref(_sfc_main$p), { key: 4 }, {
|
|
383
384
|
default: withCtx((scope) => [
|
|
384
385
|
renderSlot(_ctx.$slots, "teek-sidebar-trigger", normalizeProps(guardReactiveProps(scope)))
|
|
385
386
|
]),
|