@ansidev-oss/vitepress-theme-ansidev 1.0.12 → 1.1.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-k7SUudua.js +624 -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/node/composables.d.mts +7 -17
- package/dist/node/composables.mjs +7 -15
- package/dist/node/config.d.mts +2 -17
- package/dist/node/config.mjs +9 -6
- package/package.json +14 -6
- package/src/client/components/PostDate.test.ts +73 -0
- package/src/client/components/PostDate.vue +18 -8
- package/src/client/components/PostItem.vue +1 -1
- package/src/client/composables/index.ts +1 -0
- package/src/client/composables/lang.test.ts +52 -0
- package/src/client/composables/lang.ts +58 -0
- package/src/client/index.ts +5 -0
- package/src/client/plugins/sharing/index.ts +3 -1
- package/src/client/styles/base.css +30 -0
- package/src/client/styles/blog.css +352 -0
- package/src/client/styles/index.css +3 -30
- 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
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
var E = Object.assign || function(m) {
|
|
2
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
3
|
-
var a = arguments[t];
|
|
4
|
-
for (var u in a)
|
|
5
|
-
Object.prototype.hasOwnProperty.call(a, u) && (m[u] = a[u]);
|
|
6
|
-
}
|
|
7
|
-
return m;
|
|
8
|
-
}, x = function(t) {
|
|
9
|
-
return t.tagName === "IMG";
|
|
10
|
-
}, de = function(t) {
|
|
11
|
-
return NodeList.prototype.isPrototypeOf(t);
|
|
12
|
-
}, A = function(t) {
|
|
13
|
-
return t && t.nodeType === 1;
|
|
14
|
-
}, U = function(t) {
|
|
15
|
-
var a = t.currentSrc || t.src;
|
|
16
|
-
return a.substr(-4).toLowerCase() === ".svg";
|
|
17
|
-
}, W = function(t) {
|
|
18
|
-
try {
|
|
19
|
-
return Array.isArray(t) ? t.filter(x) : de(t) ? [].slice.call(t).filter(x) : A(t) ? [t].filter(x) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(x) : [];
|
|
20
|
-
} catch {
|
|
21
|
-
throw new TypeError(`The provided selector is invalid.
|
|
22
|
-
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
23
|
-
See: https://github.com/francoischalifour/medium-zoom`);
|
|
24
|
-
}
|
|
25
|
-
}, me = function(t) {
|
|
26
|
-
var a = document.createElement("div");
|
|
27
|
-
return a.classList.add("medium-zoom-overlay"), a.style.background = t, a;
|
|
28
|
-
}, le = function(t) {
|
|
29
|
-
var a = t.getBoundingClientRect(), u = a.top, g = a.left, N = a.width, I = a.height, h = t.cloneNode(), j = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, C = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
30
|
-
return h.removeAttribute("id"), h.style.position = "absolute", h.style.top = u + j + "px", h.style.left = g + C + "px", h.style.width = N + "px", h.style.height = I + "px", h.style.transform = "", h;
|
|
31
|
-
}, L = function(t, a) {
|
|
32
|
-
var u = E({
|
|
33
|
-
bubbles: !1,
|
|
34
|
-
cancelable: !1,
|
|
35
|
-
detail: void 0
|
|
36
|
-
}, a);
|
|
37
|
-
if (typeof window.CustomEvent == "function")
|
|
38
|
-
return new CustomEvent(t, u);
|
|
39
|
-
var g = document.createEvent("CustomEvent");
|
|
40
|
-
return g.initCustomEvent(t, u.bubbles, u.cancelable, u.detail), g;
|
|
41
|
-
}, ue = function m(t) {
|
|
42
|
-
var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = window.Promise || function(o) {
|
|
43
|
-
function n() {
|
|
44
|
-
}
|
|
45
|
-
o(n, n);
|
|
46
|
-
}, g = function(o) {
|
|
47
|
-
var n = o.target;
|
|
48
|
-
if (n === S) {
|
|
49
|
-
z();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
v.indexOf(n) !== -1 && Z({ target: n });
|
|
53
|
-
}, N = function() {
|
|
54
|
-
if (!(b || !e.original)) {
|
|
55
|
-
var o = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
56
|
-
Math.abs(B - o) > i.scrollOffset && setTimeout(z, 150);
|
|
57
|
-
}
|
|
58
|
-
}, I = function(o) {
|
|
59
|
-
var n = o.key || o.keyCode;
|
|
60
|
-
(n === "Escape" || n === "Esc" || n === 27) && z();
|
|
61
|
-
}, h = function() {
|
|
62
|
-
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = o;
|
|
63
|
-
if (o.background && (S.style.background = o.background), o.container && o.container instanceof Object && (n.container = E({}, i.container, o.container)), o.template) {
|
|
64
|
-
var d = A(o.template) ? o.template : document.querySelector(o.template);
|
|
65
|
-
n.template = d;
|
|
66
|
-
}
|
|
67
|
-
return i = E({}, i, n), v.forEach(function(l) {
|
|
68
|
-
l.dispatchEvent(L("medium-zoom:update", {
|
|
69
|
-
detail: { zoom: c }
|
|
70
|
-
}));
|
|
71
|
-
}), c;
|
|
72
|
-
}, j = function() {
|
|
73
|
-
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
74
|
-
return m(E({}, i, o));
|
|
75
|
-
}, C = function() {
|
|
76
|
-
for (var o = arguments.length, n = Array(o), d = 0; d < o; d++)
|
|
77
|
-
n[d] = arguments[d];
|
|
78
|
-
var l = n.reduce(function(r, f) {
|
|
79
|
-
return [].concat(r, W(f));
|
|
80
|
-
}, []);
|
|
81
|
-
return l.filter(function(r) {
|
|
82
|
-
return v.indexOf(r) === -1;
|
|
83
|
-
}).forEach(function(r) {
|
|
84
|
-
v.push(r), r.classList.add("medium-zoom-image");
|
|
85
|
-
}), O.forEach(function(r) {
|
|
86
|
-
var f = r.type, p = r.listener, w = r.options;
|
|
87
|
-
l.forEach(function(y) {
|
|
88
|
-
y.addEventListener(f, p, w);
|
|
89
|
-
});
|
|
90
|
-
}), c;
|
|
91
|
-
}, _ = function() {
|
|
92
|
-
for (var o = arguments.length, n = Array(o), d = 0; d < o; d++)
|
|
93
|
-
n[d] = arguments[d];
|
|
94
|
-
e.zoomed && z();
|
|
95
|
-
var l = n.length > 0 ? n.reduce(function(r, f) {
|
|
96
|
-
return [].concat(r, W(f));
|
|
97
|
-
}, []) : v;
|
|
98
|
-
return l.forEach(function(r) {
|
|
99
|
-
r.classList.remove("medium-zoom-image"), r.dispatchEvent(L("medium-zoom:detach", {
|
|
100
|
-
detail: { zoom: c }
|
|
101
|
-
}));
|
|
102
|
-
}), v = v.filter(function(r) {
|
|
103
|
-
return l.indexOf(r) === -1;
|
|
104
|
-
}), c;
|
|
105
|
-
}, F = function(o, n) {
|
|
106
|
-
var d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
107
|
-
return v.forEach(function(l) {
|
|
108
|
-
l.addEventListener("medium-zoom:" + o, n, d);
|
|
109
|
-
}), O.push({ type: "medium-zoom:" + o, listener: n, options: d }), c;
|
|
110
|
-
}, X = function(o, n) {
|
|
111
|
-
var d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
112
|
-
return v.forEach(function(l) {
|
|
113
|
-
l.removeEventListener("medium-zoom:" + o, n, d);
|
|
114
|
-
}), O = O.filter(function(l) {
|
|
115
|
-
return !(l.type === "medium-zoom:" + o && l.listener.toString() === n.toString());
|
|
116
|
-
}), c;
|
|
117
|
-
}, Y = function() {
|
|
118
|
-
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = o.target, d = function() {
|
|
119
|
-
var r = {
|
|
120
|
-
width: document.documentElement.clientWidth,
|
|
121
|
-
height: document.documentElement.clientHeight,
|
|
122
|
-
left: 0,
|
|
123
|
-
top: 0,
|
|
124
|
-
right: 0,
|
|
125
|
-
bottom: 0
|
|
126
|
-
}, f = void 0, p = void 0;
|
|
127
|
-
if (i.container)
|
|
128
|
-
if (i.container instanceof Object)
|
|
129
|
-
r = E({}, r, i.container), f = r.width - r.left - r.right - i.margin * 2, p = r.height - r.top - r.bottom - i.margin * 2;
|
|
130
|
-
else {
|
|
131
|
-
var w = A(i.container) ? i.container : document.querySelector(i.container), y = w.getBoundingClientRect(), k = y.width, J = y.height, Q = y.left, V = y.top;
|
|
132
|
-
r = E({}, r, {
|
|
133
|
-
width: k,
|
|
134
|
-
height: J,
|
|
135
|
-
left: Q,
|
|
136
|
-
top: V
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
f = f || r.width - i.margin * 2, p = p || r.height - i.margin * 2;
|
|
140
|
-
var H = e.zoomedHd || e.original, $ = U(H) ? f : H.naturalWidth || f, ee = U(H) ? p : H.naturalHeight || p, T = H.getBoundingClientRect(), te = T.top, oe = T.left, M = T.width, P = T.height, ne = Math.min(Math.max(M, $), f) / M, re = Math.min(Math.max(P, ee), p) / P, q = Math.min(ne, re), ie = (-oe + (f - M) / 2 + i.margin + r.left) / q, ae = (-te + (p - P) / 2 + i.margin + r.top) / q, R = "scale(" + q + ") translate3d(" + ie + "px, " + ae + "px, 0)";
|
|
141
|
-
e.zoomed.style.transform = R, e.zoomedHd && (e.zoomedHd.style.transform = R);
|
|
142
|
-
};
|
|
143
|
-
return new u(function(l) {
|
|
144
|
-
if (n && v.indexOf(n) === -1) {
|
|
145
|
-
l(c);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
var r = function k() {
|
|
149
|
-
b = !1, e.zoomed.removeEventListener("transitionend", k), e.original.dispatchEvent(L("medium-zoom:opened", {
|
|
150
|
-
detail: { zoom: c }
|
|
151
|
-
})), l(c);
|
|
152
|
-
};
|
|
153
|
-
if (e.zoomed) {
|
|
154
|
-
l(c);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (n)
|
|
158
|
-
e.original = n;
|
|
159
|
-
else if (v.length > 0) {
|
|
160
|
-
var f = v;
|
|
161
|
-
e.original = f[0];
|
|
162
|
-
} else {
|
|
163
|
-
l(c);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (e.original.dispatchEvent(L("medium-zoom:open", {
|
|
167
|
-
detail: { zoom: c }
|
|
168
|
-
})), B = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, b = !0, e.zoomed = le(e.original), document.body.appendChild(S), i.template) {
|
|
169
|
-
var p = A(i.template) ? i.template : document.querySelector(i.template);
|
|
170
|
-
e.template = document.createElement("div"), e.template.appendChild(p.content.cloneNode(!0)), document.body.appendChild(e.template);
|
|
171
|
-
}
|
|
172
|
-
if (e.original.parentElement && e.original.parentElement.tagName === "PICTURE" && e.original.currentSrc && (e.zoomed.src = e.original.currentSrc), document.body.appendChild(e.zoomed), window.requestAnimationFrame(function() {
|
|
173
|
-
document.body.classList.add("medium-zoom--opened");
|
|
174
|
-
}), e.original.classList.add("medium-zoom-image--hidden"), e.zoomed.classList.add("medium-zoom-image--opened"), e.zoomed.addEventListener("click", z), e.zoomed.addEventListener("transitionend", r), e.original.getAttribute("data-zoom-src")) {
|
|
175
|
-
e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("srcset"), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading"), e.zoomedHd.src = e.zoomed.getAttribute("data-zoom-src"), e.zoomedHd.onerror = function() {
|
|
176
|
-
clearInterval(w), console.warn("Unable to reach the zoom image target " + e.zoomedHd.src), e.zoomedHd = null, d();
|
|
177
|
-
};
|
|
178
|
-
var w = setInterval(function() {
|
|
179
|
-
e.zoomedHd.complete && (clearInterval(w), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", z), document.body.appendChild(e.zoomedHd), d());
|
|
180
|
-
}, 10);
|
|
181
|
-
} else if (e.original.hasAttribute("srcset")) {
|
|
182
|
-
e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading");
|
|
183
|
-
var y = e.zoomedHd.addEventListener("load", function() {
|
|
184
|
-
e.zoomedHd.removeEventListener("load", y), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", z), document.body.appendChild(e.zoomedHd), d();
|
|
185
|
-
});
|
|
186
|
-
} else
|
|
187
|
-
d();
|
|
188
|
-
});
|
|
189
|
-
}, z = function() {
|
|
190
|
-
return new u(function(o) {
|
|
191
|
-
if (b || !e.original) {
|
|
192
|
-
o(c);
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
var n = function d() {
|
|
196
|
-
e.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(e.zoomed), e.zoomedHd && document.body.removeChild(e.zoomedHd), document.body.removeChild(S), e.zoomed.classList.remove("medium-zoom-image--opened"), e.template && document.body.removeChild(e.template), b = !1, e.zoomed.removeEventListener("transitionend", d), e.original.dispatchEvent(L("medium-zoom:closed", {
|
|
197
|
-
detail: { zoom: c }
|
|
198
|
-
})), e.original = null, e.zoomed = null, e.zoomedHd = null, e.template = null, o(c);
|
|
199
|
-
};
|
|
200
|
-
b = !0, document.body.classList.remove("medium-zoom--opened"), e.zoomed.style.transform = "", e.zoomedHd && (e.zoomedHd.style.transform = ""), e.template && (e.template.style.transition = "opacity 150ms", e.template.style.opacity = 0), e.original.dispatchEvent(L("medium-zoom:close", {
|
|
201
|
-
detail: { zoom: c }
|
|
202
|
-
})), e.zoomed.addEventListener("transitionend", n);
|
|
203
|
-
});
|
|
204
|
-
}, Z = function() {
|
|
205
|
-
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = o.target;
|
|
206
|
-
return e.original ? z() : Y({ target: n });
|
|
207
|
-
}, K = function() {
|
|
208
|
-
return i;
|
|
209
|
-
}, D = function() {
|
|
210
|
-
return v;
|
|
211
|
-
}, G = function() {
|
|
212
|
-
return e.original;
|
|
213
|
-
}, v = [], O = [], b = !1, B = 0, i = a, e = {
|
|
214
|
-
original: null,
|
|
215
|
-
zoomed: null,
|
|
216
|
-
zoomedHd: null,
|
|
217
|
-
template: null
|
|
218
|
-
// If the selector is omitted, it's replaced by the options
|
|
219
|
-
};
|
|
220
|
-
Object.prototype.toString.call(t) === "[object Object]" ? i = t : (t || typeof t == "string") && C(t), i = E({
|
|
221
|
-
margin: 0,
|
|
222
|
-
background: "#fff",
|
|
223
|
-
scrollOffset: 40,
|
|
224
|
-
container: null,
|
|
225
|
-
template: null
|
|
226
|
-
}, i);
|
|
227
|
-
var S = me(i.background);
|
|
228
|
-
document.addEventListener("click", g), document.addEventListener("keyup", I), document.addEventListener("scroll", N), window.addEventListener("resize", z);
|
|
229
|
-
var c = {
|
|
230
|
-
open: Y,
|
|
231
|
-
close: z,
|
|
232
|
-
toggle: Z,
|
|
233
|
-
update: h,
|
|
234
|
-
clone: j,
|
|
235
|
-
attach: C,
|
|
236
|
-
detach: _,
|
|
237
|
-
on: F,
|
|
238
|
-
off: X,
|
|
239
|
-
getOptions: K,
|
|
240
|
-
getImages: D,
|
|
241
|
-
getZoomedImage: G
|
|
242
|
-
};
|
|
243
|
-
return c;
|
|
244
|
-
};
|
|
245
|
-
function ce(m, t) {
|
|
246
|
-
t === void 0 && (t = {});
|
|
247
|
-
var a = t.insertAt;
|
|
248
|
-
if (!(typeof document > "u")) {
|
|
249
|
-
var u = document.head || document.getElementsByTagName("head")[0], g = document.createElement("style");
|
|
250
|
-
g.type = "text/css", a === "top" && u.firstChild ? u.insertBefore(g, u.firstChild) : u.appendChild(g), g.styleSheet ? g.styleSheet.cssText = m : g.appendChild(document.createTextNode(m));
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
var se = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.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{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
|
|
254
|
-
ce(se);
|
|
255
|
-
const fe = (m) => {
|
|
256
|
-
if (!m.selector)
|
|
257
|
-
return;
|
|
258
|
-
const t = ue(m.zoomOptions);
|
|
259
|
-
t.refresh = (a = m.selector) => {
|
|
260
|
-
t.detach(), t.attach(a);
|
|
261
|
-
}, setTimeout(() => t.refresh(m.selector), m.delay || 1e3);
|
|
262
|
-
};
|
|
263
|
-
export {
|
|
264
|
-
fe as useMediumZoom
|
|
265
|
-
};
|