@ansidev-oss/vitepress-theme-ansidev 1.0.12 → 1.2.0
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/dist/client/Donation-BBPb8v5p.js +66 -0
- package/dist/client/GoogleAnalytics-34XEM7eO.js +25 -0
- package/dist/client/Sharing-CpagX9oy.js +185 -0
- package/dist/client/Swetrix-GKEyGNrV.js +647 -0
- package/dist/client/components/PostDate.test.d.ts +1 -0
- package/dist/client/composables/index.d.ts +1 -0
- package/dist/client/composables/lang.d.ts +27 -0
- package/dist/client/composables/lang.test.d.ts +1 -0
- package/dist/client/index.js +3769 -9
- package/dist/client/medium-zoom-DPl0T7qn.js +266 -0
- package/dist/client/record-Cgv_fXDH.js +2739 -0
- package/dist/client/styles.css +2 -1
- package/dist/client/types/index.d.ts +8 -0
- package/dist/node/composables.d.mts +16 -17
- package/dist/node/composables.mjs +39 -15
- package/dist/node/config.d.mts +2 -17
- package/dist/node/config.mjs +9 -6
- package/package.json +27 -21
- package/src/client/components/DonationWidget.vue +9 -3
- package/src/client/components/Footer.vue +11 -4
- package/src/client/components/Link.vue +11 -5
- package/src/client/components/LocaleSwitcher.vue +5 -5
- package/src/client/components/PostDate.test.ts +82 -0
- package/src/client/components/PostDate.vue +32 -13
- package/src/client/components/PostItem.vue +17 -7
- package/src/client/components/PostList.vue +7 -4
- package/src/client/components/ProjectCard.vue +42 -14
- package/src/client/components/ProjectList.vue +12 -5
- package/src/client/components/RouterLink.vue +3 -3
- package/src/client/components/SharingWidget.vue +3 -1
- package/src/client/components/StatusBadge.vue +10 -10
- package/src/client/components/TermBadge.vue +11 -7
- package/src/client/components/TermLink.vue +4 -4
- package/src/client/composables/date.ts +1 -1
- package/src/client/composables/index.ts +1 -0
- package/src/client/composables/lang.test.ts +56 -0
- package/src/client/composables/lang.ts +65 -0
- package/src/client/composables/locale.ts +4 -1
- package/src/client/composables/project.ts +3 -3
- package/src/client/composables/rank.ts +5 -2
- package/src/client/index.ts +5 -0
- package/src/client/layouts/Layout.vue +2 -2
- package/src/client/pages/ArchivesPage.vue +10 -5
- package/src/client/pages/CategoriesPage.vue +13 -5
- package/src/client/pages/HomePage.vue +3 -3
- package/src/client/pages/Page.vue +13 -11
- package/src/client/pages/PostsPage.vue +4 -4
- package/src/client/pages/ProjectsPage.vue +10 -7
- package/src/client/pages/TagsPage.vue +10 -4
- package/src/client/plugins/donation/components/Donation.vue +5 -3
- package/src/client/plugins/donation/components/DonationButton.vue +3 -1
- package/src/client/plugins/donation/index.ts +11 -8
- package/src/client/plugins/i18n/index.ts +2 -2
- package/src/client/plugins/sharing/components/Sharing.vue +39 -15
- package/src/client/plugins/sharing/components/SharingButton.vue +34 -14
- package/src/client/plugins/sharing/index.ts +6 -2
- package/src/client/styles/base.css +30 -0
- package/src/client/styles/blog.css +376 -0
- package/src/client/styles/index.css +2 -30
- package/src/client/types/index.ts +8 -0
- package/src/node/composables/excerpt.test.ts +88 -0
- package/src/node/composables/excerpt.ts +57 -0
- package/src/node/composables/index.ts +1 -0
- package/src/node/composables/markdown.ts +8 -2
- package/src/node/composables/route.ts +15 -7
- package/src/node/composables/slug.ts +12 -4
- package/src/node/config.ts +20 -14
- package/src/shared/composables/useSlug.ts +2 -1
- package/src/vite-env.d.ts +1 -0
- package/dist/client/Donation-D9Xn0MPt.js +0 -76
- package/dist/client/GoogleAnalytics-Dp3EGn1x.js +0 -29
- package/dist/client/Sharing-ZrU7YF-x.js +0 -190
- package/dist/client/Swetrix-CM1mbD6X.js +0 -450
- package/dist/client/VPAlgoliaSearchBox-C18GEhLm.js +0 -126
- package/dist/client/VPCarbonAds-DwoamMao.js +0 -31
- package/dist/client/VPLocalSearchBox-DyteUinQ.js +0 -4086
- package/dist/client/index-BtT3qA6T.js +0 -12663
- package/dist/client/index-CCR5sUM8.js +0 -10688
- package/dist/client/index-CkmxezC0.js +0 -7616
- package/dist/client/index-DuYWs0vj.js +0 -265
- package/dist/node/composables/index.d.ts +0 -3
- package/dist/node/composables/markdown.d.ts +0 -2
- package/dist/node/composables/route.d.ts +0 -15
- package/dist/node/composables/slug.d.ts +0 -7
- package/dist/node/composables/types.d.ts +0 -7
- package/dist/node/config.d.ts +0 -45
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/medium-zoom@1.1.2/node_modules/medium-zoom/dist/medium-zoom.esm.js
|
|
2
|
+
function e() {
|
|
3
|
+
return e = Object.assign ? Object.assign.bind() : function(e) {
|
|
4
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
5
|
+
var n = arguments[t];
|
|
6
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
7
|
+
}
|
|
8
|
+
return e;
|
|
9
|
+
}, e.apply(null, arguments);
|
|
10
|
+
}
|
|
11
|
+
var t = function(e) {
|
|
12
|
+
return e.tagName === "IMG";
|
|
13
|
+
}, n = function(e) {
|
|
14
|
+
return e && e.nodeType === 1;
|
|
15
|
+
}, r = function(e) {
|
|
16
|
+
return (e.currentSrc || e.src).substr(-4).toLowerCase() === ".svg";
|
|
17
|
+
}, i = function(e) {
|
|
18
|
+
try {
|
|
19
|
+
return Array.isArray(e) ? e.filter(t) : function(e) {
|
|
20
|
+
return NodeList.prototype.isPrototypeOf(e);
|
|
21
|
+
}(e) ? [].slice.call(e).filter(t) : n(e) ? [e].filter(t) : typeof e == "string" ? [].slice.call(document.querySelectorAll(e)).filter(t) : [];
|
|
22
|
+
} catch {
|
|
23
|
+
throw TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom");
|
|
24
|
+
}
|
|
25
|
+
}, a = function(t, o) {
|
|
26
|
+
o === void 0 && (o = {});
|
|
27
|
+
var s = window.Promise || function(e) {
|
|
28
|
+
function t() {}
|
|
29
|
+
e(t, t);
|
|
30
|
+
}, c = function(e, t) {
|
|
31
|
+
return e.dispatchEvent(function(e, t) {
|
|
32
|
+
if (typeof window.CustomEvent == "function") return new CustomEvent(e, { detail: t });
|
|
33
|
+
var n = document.createEvent("CustomEvent");
|
|
34
|
+
return n.initCustomEvent(e, !1, !1, t), n;
|
|
35
|
+
}("medium-zoom:" + t, { zoom: k }));
|
|
36
|
+
}, l = function(e) {
|
|
37
|
+
var t = e.target;
|
|
38
|
+
t === O ? b() : S.indexOf(t) !== -1 && x({ target: t });
|
|
39
|
+
}, u = function() {
|
|
40
|
+
if (D.o) {
|
|
41
|
+
var e = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
42
|
+
if (D.t || window.visualViewport && window.visualViewport.scale > D.i) return T = e, clearTimeout(D.u), void (D.u = null);
|
|
43
|
+
w || Math.abs(T - e) > E.scrollOffset && !D.u && (D.u = setTimeout(b, 150));
|
|
44
|
+
}
|
|
45
|
+
}, d = function(e) {
|
|
46
|
+
e.touches.length >= 2 && (D.t = !0), D.t && u(), e.touches.length === 0 && (D.t = !1);
|
|
47
|
+
}, f = function(e) {
|
|
48
|
+
var t = e.key || e.keyCode;
|
|
49
|
+
t !== "Escape" && t !== "Esc" && t !== 27 || b();
|
|
50
|
+
}, p = !1, m = function() {
|
|
51
|
+
var e = S.length > 0;
|
|
52
|
+
p !== e && (document[e ? "addEventListener" : "removeEventListener"]("click", l), p = e);
|
|
53
|
+
}, h = function() {
|
|
54
|
+
var e = [...arguments].reduce(function(e, t) {
|
|
55
|
+
return [].concat(e, i(t));
|
|
56
|
+
}, []);
|
|
57
|
+
return e.filter(function(e) {
|
|
58
|
+
return S.indexOf(e) === -1;
|
|
59
|
+
}).forEach(function(e) {
|
|
60
|
+
S.push(e), e.classList.add("medium-zoom-image");
|
|
61
|
+
}), C.forEach(function(t) {
|
|
62
|
+
var n = t.type, r = t.listener, i = t.options;
|
|
63
|
+
e.forEach(function(e) {
|
|
64
|
+
e.addEventListener(n, r, i);
|
|
65
|
+
});
|
|
66
|
+
}), m(), k;
|
|
67
|
+
}, g = !1, _ = function(e) {
|
|
68
|
+
if (g !== e) {
|
|
69
|
+
var t = e ? "addEventListener" : "removeEventListener";
|
|
70
|
+
document[t]("keyup", f), document[t]("scroll", u);
|
|
71
|
+
var n = { passive: !0 };
|
|
72
|
+
[
|
|
73
|
+
"touchstart",
|
|
74
|
+
"touchend",
|
|
75
|
+
"touchcancel"
|
|
76
|
+
].forEach(function(e) {
|
|
77
|
+
return document[t](e, d, n);
|
|
78
|
+
}), window[t]("resize", b), g = e;
|
|
79
|
+
}
|
|
80
|
+
}, v = function(e, t) {
|
|
81
|
+
var n, r, i = !1, a = window.matchMedia("(prefers-reduced-motion)"), o = function(e) {
|
|
82
|
+
return Math.max.apply(Math, e.split(",").map(parseFloat));
|
|
83
|
+
}, s = function(e) {
|
|
84
|
+
i || e && e.propertyName !== "transform" || (l(), t());
|
|
85
|
+
}, c = function() {
|
|
86
|
+
a.matches && s();
|
|
87
|
+
}, l = function() {
|
|
88
|
+
i = !0, clearTimeout(n), window.cancelAnimationFrame(r), e.removeEventListener("transitionend", s), a.removeListener(c);
|
|
89
|
+
};
|
|
90
|
+
e.addEventListener("transitionend", s), a.addListener(c);
|
|
91
|
+
var u = window.getComputedStyle(e), d = 1e3 * (o(u.transitionDuration) + o(u.transitionDelay));
|
|
92
|
+
return n = setTimeout(s, Math.max(0, d) + 50), d <= 0 && (r = window.requestAnimationFrame(function() {
|
|
93
|
+
return s();
|
|
94
|
+
})), l;
|
|
95
|
+
}, y = function(t) {
|
|
96
|
+
var i = (t === void 0 ? {} : t).target, a = {};
|
|
97
|
+
return new s(function(t) {
|
|
98
|
+
if (D.o || i && S.indexOf(i) === -1) t(k);
|
|
99
|
+
else {
|
|
100
|
+
D = a;
|
|
101
|
+
var o, s = function() {}, l = function() {}, u = function(e) {
|
|
102
|
+
a.m && (s(), l(), window.cancelAnimationFrame(o), a.m = null, w = !1, t(k), e && (document.body.classList.add("medium-zoom--opened"), c(a.o, "opened")));
|
|
103
|
+
};
|
|
104
|
+
if (a.m = u, a.o = i || S[0], a.o) {
|
|
105
|
+
if (a.i = window.visualViewport ? window.visualViewport.scale : 1, _(!0), w = !0, c(a.o, "open"), !a.l) {
|
|
106
|
+
if (T = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, a.v = function(e) {
|
|
107
|
+
var t = e.getBoundingClientRect(), n = t.top, r = t.left, i = t.width, a = t.height, o = e.cloneNode(), s = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, c = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
108
|
+
return o.removeAttribute("id"), o.style.position = "absolute", o.style.top = n + s + "px", o.style.left = r + c + "px", o.style.width = i + "px", o.style.height = a + "px", o.style.transform = "", o;
|
|
109
|
+
}(a.o), document.body.appendChild(O), E.template) {
|
|
110
|
+
var d = n(E.template) ? E.template : document.querySelector(E.template);
|
|
111
|
+
a.p = document.createElement("div"), a.p.appendChild(d.content.cloneNode(!0)), document.body.appendChild(a.p);
|
|
112
|
+
}
|
|
113
|
+
a.o.parentElement && a.o.parentElement.tagName === "PICTURE" && a.o.currentSrc && (a.v.src = a.o.currentSrc), document.body.appendChild(a.v), o = window.requestAnimationFrame(function() {
|
|
114
|
+
document.body.classList.add("medium-zoom--opened");
|
|
115
|
+
}), a.o.classList.add("medium-zoom-image--hidden"), a.v.classList.add("medium-zoom-image--opened"), a.v.addEventListener("click", b);
|
|
116
|
+
var f = function() {
|
|
117
|
+
(function() {
|
|
118
|
+
var t, i, o = {
|
|
119
|
+
width: document.documentElement.clientWidth,
|
|
120
|
+
height: document.documentElement.clientHeight,
|
|
121
|
+
left: 0,
|
|
122
|
+
top: 0,
|
|
123
|
+
right: 0,
|
|
124
|
+
bottom: 0
|
|
125
|
+
};
|
|
126
|
+
if (E.container) {
|
|
127
|
+
if (E.container instanceof Object) t = (o = e({}, o, E.container)).width - o.left - o.right - 2 * E.margin, i = o.height - o.top - o.bottom - 2 * E.margin;
|
|
128
|
+
else {
|
|
129
|
+
var s = (n(E.container) ? E.container : document.querySelector(E.container)).getBoundingClientRect();
|
|
130
|
+
o = e({}, o, {
|
|
131
|
+
width: s.width,
|
|
132
|
+
height: s.height,
|
|
133
|
+
left: s.left,
|
|
134
|
+
top: s.top
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
t ||= o.width - 2 * E.margin, i ||= o.height - 2 * E.margin;
|
|
139
|
+
var c = a.h || a.o, l = r(c) ? t : c.naturalWidth || t, u = r(c) ? i : c.naturalHeight || i, d = c.getBoundingClientRect(), f = d.top, p = d.left, m = d.width, h = d.height;
|
|
140
|
+
if (m && h) {
|
|
141
|
+
var g = Math.min(Math.max(m, l), t) / m, _ = Math.min(Math.max(h, u), i) / h, v = Math.min(g, _), y = "scale(" + v + ") translate3d(" + ((t - m) / 2 - p + E.margin + o.left) / v + "px, " + ((i - h) / 2 - f + E.margin + o.top) / v + "px, 0)";
|
|
142
|
+
a.v.style.transform = y, a.h && (a.h.style.transform = y);
|
|
143
|
+
}
|
|
144
|
+
})(), s = v(a.v, function() {
|
|
145
|
+
return u(!0);
|
|
146
|
+
});
|
|
147
|
+
}, p = a.o.getAttribute("data-zoom-src");
|
|
148
|
+
if (p || a.o.hasAttribute("srcset")) {
|
|
149
|
+
var m = document.createElement("img");
|
|
150
|
+
[].slice.call(a.v.attributes).forEach(function(e) {
|
|
151
|
+
var t = e.name, n = e.value;
|
|
152
|
+
/^(src|srcset|sizes|loading)$/.test(t) || m.setAttribute(t, n);
|
|
153
|
+
}), a.h = m;
|
|
154
|
+
var h = function() {
|
|
155
|
+
l(), a.l || (m.naturalWidth ? (m.classList.add("medium-zoom-image--opened"), m.addEventListener("click", b), document.body.appendChild(m)) : (console.warn("Unable to reach the zoom image target " + (m.currentSrc || m.src)), a.h = null), f());
|
|
156
|
+
};
|
|
157
|
+
l = function() {
|
|
158
|
+
m.removeEventListener("load", h), m.removeEventListener("error", h);
|
|
159
|
+
}, m.addEventListener("load", h), m.addEventListener("error", h), p || (m.srcset = a.v.srcset), m.src = p || a.v.src;
|
|
160
|
+
} else f();
|
|
161
|
+
}
|
|
162
|
+
} else t(k);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}, b = function() {
|
|
166
|
+
return new s(function(e) {
|
|
167
|
+
var t = D;
|
|
168
|
+
if (t.o && !t.l) {
|
|
169
|
+
t.l = !0, t.m && t.m(), clearTimeout(t.u), w = !0;
|
|
170
|
+
var n = function() {
|
|
171
|
+
t.o.classList.remove("medium-zoom-image--hidden"), [
|
|
172
|
+
t.v,
|
|
173
|
+
t.h,
|
|
174
|
+
t.p,
|
|
175
|
+
O
|
|
176
|
+
].forEach(function(e) {
|
|
177
|
+
e && (e.removeEventListener("click", b), e.parentNode && e.parentNode.removeChild(e));
|
|
178
|
+
}), D = {}, w = !1, _(!1), e(k), c(t.o, "closed");
|
|
179
|
+
};
|
|
180
|
+
t.v && v(t.v, n), document.body.classList.remove("medium-zoom--opened"), t.v && (t.v.style.transform = ""), t.h && (t.h.style.transform = ""), t.p && (t.p.style.transition = parseFloat(window.getComputedStyle(t.v).transitionDuration) ? "opacity 150ms" : "none", t.p.style.opacity = 0), c(t.o, "close"), t.v || n();
|
|
181
|
+
} else e(k);
|
|
182
|
+
});
|
|
183
|
+
}, x = function(e) {
|
|
184
|
+
var t = (e === void 0 ? {} : e).target;
|
|
185
|
+
return D.o ? b() : y({ target: t });
|
|
186
|
+
}, S = [], C = [], w = !1, T = 0, E = o, D = {};
|
|
187
|
+
Object.prototype.toString.call(t) === "[object Object]" ? E = t : (t || typeof t == "string") && h(t);
|
|
188
|
+
var O = function(e) {
|
|
189
|
+
var t = document.createElement("div");
|
|
190
|
+
return t.classList.add("medium-zoom-overlay"), t.style.background = e, t;
|
|
191
|
+
}((E = e({
|
|
192
|
+
margin: 0,
|
|
193
|
+
background: "#fff",
|
|
194
|
+
scrollOffset: 40,
|
|
195
|
+
container: null,
|
|
196
|
+
template: null
|
|
197
|
+
}, E)).background), k = {
|
|
198
|
+
open: y,
|
|
199
|
+
close: b,
|
|
200
|
+
toggle: x,
|
|
201
|
+
update: function(t) {
|
|
202
|
+
t === void 0 && (t = {});
|
|
203
|
+
var r = t;
|
|
204
|
+
return t.background && (O.style.background = t.background), t.container && t.container instanceof Object && (r.container = e({}, E.container, t.container)), t.template && (r.template = n(t.template) ? t.template : document.querySelector(t.template)), E = e({}, E, r), S.forEach(function(e) {
|
|
205
|
+
c(e, "update");
|
|
206
|
+
}), k;
|
|
207
|
+
},
|
|
208
|
+
clone: function(t) {
|
|
209
|
+
return a(e({}, E, t));
|
|
210
|
+
},
|
|
211
|
+
attach: h,
|
|
212
|
+
detach: function() {
|
|
213
|
+
D.v && b();
|
|
214
|
+
var e = [...arguments], t = e.length > 0 ? e.reduce(function(e, t) {
|
|
215
|
+
return [].concat(e, i(t));
|
|
216
|
+
}, []) : S;
|
|
217
|
+
return t.forEach(function(e) {
|
|
218
|
+
e.classList.remove("medium-zoom-image"), c(e, "detach");
|
|
219
|
+
}), S = S.filter(function(e) {
|
|
220
|
+
return t.indexOf(e) === -1;
|
|
221
|
+
}), m(), k;
|
|
222
|
+
},
|
|
223
|
+
on: function(e, t, n) {
|
|
224
|
+
n === void 0 && (n = {});
|
|
225
|
+
var r = "medium-zoom:" + e;
|
|
226
|
+
return S.forEach(function(e) {
|
|
227
|
+
e.addEventListener(r, t, n);
|
|
228
|
+
}), C.push({
|
|
229
|
+
type: r,
|
|
230
|
+
listener: t,
|
|
231
|
+
options: n
|
|
232
|
+
}), k;
|
|
233
|
+
},
|
|
234
|
+
off: function(e, t, n) {
|
|
235
|
+
n === void 0 && (n = {});
|
|
236
|
+
var r = "medium-zoom:" + e;
|
|
237
|
+
return S.forEach(function(e) {
|
|
238
|
+
e.removeEventListener(r, t, n);
|
|
239
|
+
}), C = C.filter(function(e) {
|
|
240
|
+
return e.type !== r || e.listener.toString() !== t.toString();
|
|
241
|
+
}), k;
|
|
242
|
+
},
|
|
243
|
+
getOptions: function() {
|
|
244
|
+
return E;
|
|
245
|
+
},
|
|
246
|
+
getImages: function() {
|
|
247
|
+
return S;
|
|
248
|
+
},
|
|
249
|
+
getZoomedImage: function() {
|
|
250
|
+
return D.o || null;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
return k;
|
|
254
|
+
};
|
|
255
|
+
if (typeof document < "u") {
|
|
256
|
+
var o = document.createElement("style");
|
|
257
|
+
o.textContent = ".medium-zoom-overlay{opacity:0;will-change:opacity;transition:opacity .3s;position:fixed;top:0;bottom:0;left:0;right:0}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{cursor:pointer;cursor:zoom-out;will-change:transform;position:relative}@media (prefers-reduced-motion:reduce){.medium-zoom-image,.medium-zoom-overlay{transition:none!important}}", document.head.appendChild(o);
|
|
258
|
+
}
|
|
259
|
+
var s = a, c = (e) => {
|
|
260
|
+
if (!e.selector) return;
|
|
261
|
+
let t = s(e.zoomOptions);
|
|
262
|
+
t.refresh = (n = e.selector) => {
|
|
263
|
+
t.detach(), t.attach(n);
|
|
264
|
+
}, setTimeout(() => t.refresh(e.selector), e.delay || 1e3);
|
|
265
|
+
};
|
|
266
|
+
export { c as useMediumZoom };
|