@opendesign-plus-test/plugins 0.0.1-rc.25 → 0.0.1-rc.27
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/index.js +40 -37
- package/dist/{sitemap/generate-lastmod-changefreq.d.ts → vite/generate-lastmod-changefreq/index.d.ts} +2 -2
- package/dist/vite/generate-lastmod-changefreq/index.js +1377 -0
- package/package.json +4 -4
- package/dist/nuxt/sitemap/index.js +0 -1480
- package/dist/nuxt/sitemap.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
const
|
|
1
|
+
import { i as K, o as z, v as O } from "./plugin-lvjNLBe-.js";
|
|
2
|
+
const p = {}, L = `
|
|
3
3
|
(function () {
|
|
4
4
|
function getCookie(key) {
|
|
5
5
|
const name = encodeURIComponent(key) + '=';
|
|
@@ -25,18 +25,18 @@ const f = {}, L = `
|
|
|
25
25
|
}
|
|
26
26
|
})();
|
|
27
27
|
`.trim();
|
|
28
|
-
function
|
|
28
|
+
function I(e) {
|
|
29
29
|
const {
|
|
30
30
|
cookieKey: n,
|
|
31
31
|
lightValue: t = "light",
|
|
32
32
|
darkValue: r = "dark",
|
|
33
33
|
attribute: a = "data-o-theme",
|
|
34
|
-
attributeLightValue:
|
|
35
|
-
attributeDarkValue:
|
|
36
|
-
classLightValue:
|
|
37
|
-
classDarkValue:
|
|
38
|
-
filename:
|
|
39
|
-
} = e, g = L.replace(/\$COOKIE_KEY/g, n).replace(/\$LIGHT_VALUE/g, t).replace(/\$DARK_VALUE/g, r).replace(/\$CLASS_LIGHT_VALUE/g,
|
|
34
|
+
attributeLightValue: c = t,
|
|
35
|
+
attributeDarkValue: l = r,
|
|
36
|
+
classLightValue: x = t,
|
|
37
|
+
classDarkValue: f = r,
|
|
38
|
+
filename: s = "check-theme.js"
|
|
39
|
+
} = e, g = L.replace(/\$COOKIE_KEY/g, n).replace(/\$LIGHT_VALUE/g, t).replace(/\$DARK_VALUE/g, r).replace(/\$CLASS_LIGHT_VALUE/g, x).replace(/\$CLASS_DARK_VALUE/g, f).replace(/\$ATTRIBUTE_NAME/g, a).replace(/\$ATTRIBUTE_LIGHT_VALUE/g, c).replace(/\$ATTRIBUTE_DARK_VALUE/g, l);
|
|
40
40
|
let d = "", h = !1, u = "", m = !1;
|
|
41
41
|
return {
|
|
42
42
|
name: "vite-check-theme-plugin",
|
|
@@ -44,27 +44,27 @@ function R(e) {
|
|
|
44
44
|
configResolved(o) {
|
|
45
45
|
if (d = o.base, h = o.command === "serve", u = o.build.outDir, m = !!o.vitepress, !m || !Array.isArray(o.vitepress.site.head))
|
|
46
46
|
return;
|
|
47
|
-
const k = o.vitepress.site.head.find((
|
|
47
|
+
const k = o.vitepress.site.head.find((w) => {
|
|
48
48
|
var y, E;
|
|
49
|
-
return
|
|
49
|
+
return w[0] === "script" && ((E = (y = w[1]) == null ? void 0 : y.src) == null ? void 0 : E.startsWith(`${d}${s}`));
|
|
50
50
|
});
|
|
51
|
-
k ? k[1].src = `${d}${
|
|
51
|
+
k ? k[1].src = `${d}${s}?t=${(/* @__PURE__ */ new Date()).getTime()}` : o.vitepress.site.head.push([
|
|
52
52
|
"script",
|
|
53
53
|
{
|
|
54
|
-
src: `${d}${
|
|
54
|
+
src: `${d}${s}?t=${(/* @__PURE__ */ new Date()).getTime()}`
|
|
55
55
|
}
|
|
56
56
|
]);
|
|
57
57
|
},
|
|
58
58
|
generateBundle() {
|
|
59
|
-
h ||
|
|
59
|
+
h || p.existsSync(p.join(u, s)) || (p.existsSync(u) || p.mkdirSync(u, { recursive: !0 }), p.writeFileSync(p.join(u, s), g, "utf-8"));
|
|
60
60
|
},
|
|
61
61
|
configureServer(o) {
|
|
62
|
-
o.middlewares.use(`${d}${
|
|
63
|
-
|
|
62
|
+
o.middlewares.use(`${d}${s}`, (k, w) => {
|
|
63
|
+
w.setHeader("Content-Type", "application/javascript"), w.end(g);
|
|
64
64
|
});
|
|
65
65
|
},
|
|
66
66
|
transformIndexHtml(o) {
|
|
67
|
-
return m ? o : o.replace("</head>", `<script src="${d}${
|
|
67
|
+
return m ? o : o.replace("</head>", `<script src="${d}${s}?t=${(/* @__PURE__ */ new Date()).getTime()}"><\/script></head>`);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
@@ -125,14 +125,14 @@ function C(e, n, t) {
|
|
|
125
125
|
</div>
|
|
126
126
|
</div>
|
|
127
127
|
`, document.body.appendChild(i));
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const c = i.querySelector(".elg-title"), l = i.querySelector(".elg-message"), x = i.querySelector(".elg-url"), f = i.querySelector(".elg-cancel"), s = i.querySelector(".elg-confirm");
|
|
129
|
+
c.textContent = r.title, l.textContent = r.message(t), x.textContent = n, f.textContent = r.cancel, s.textContent = r.confirm, i.style.display = "flex";
|
|
130
130
|
const g = (m) => {
|
|
131
|
-
i && (i.style.display = "none", i.removeEventListener("click", u),
|
|
131
|
+
i && (i.style.display = "none", i.removeEventListener("click", u), f.removeEventListener("click", d), s.removeEventListener("click", h), v = !1, a(m));
|
|
132
132
|
}, d = () => g(!1), h = () => g(!0), u = (m) => {
|
|
133
133
|
m.target === i && g(!1);
|
|
134
134
|
};
|
|
135
|
-
i.addEventListener("click", u),
|
|
135
|
+
i.addEventListener("click", u), f.addEventListener("click", d), s.addEventListener("click", h);
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
function _() {
|
|
@@ -253,15 +253,18 @@ function _() {
|
|
|
253
253
|
}
|
|
254
254
|
`, document.head.appendChild(e);
|
|
255
255
|
}
|
|
256
|
+
function U() {
|
|
257
|
+
return typeof window > "u" ? "zh" : /\/en(\/|$)/.test(window.location.pathname) ? "en" : "zh";
|
|
258
|
+
}
|
|
256
259
|
async function $(e, n) {
|
|
257
260
|
if (n.showCustomConfirm)
|
|
258
|
-
return C(n.lang
|
|
261
|
+
return C(n.lang ?? U(), e, n.community || "");
|
|
259
262
|
const t = n.message ?? `即将离开本站,前往第三方网站:
|
|
260
263
|
|
|
261
264
|
${e}`;
|
|
262
265
|
return Promise.resolve(window.confirm(t));
|
|
263
266
|
}
|
|
264
|
-
function
|
|
267
|
+
function S(e) {
|
|
265
268
|
const n = window.open;
|
|
266
269
|
document.addEventListener(
|
|
267
270
|
"click",
|
|
@@ -272,42 +275,42 @@ function U(e) {
|
|
|
272
275
|
const a = r.closest("a[href]");
|
|
273
276
|
if (!a)
|
|
274
277
|
return;
|
|
275
|
-
const
|
|
276
|
-
if (!
|
|
278
|
+
const c = a.getAttribute("href");
|
|
279
|
+
if (!c || c.startsWith("#") || !b(c))
|
|
277
280
|
return;
|
|
278
|
-
const
|
|
279
|
-
if (A(
|
|
281
|
+
const l = new URL(c, window.location.href);
|
|
282
|
+
if (A(l.hostname, e.whitelist))
|
|
280
283
|
return;
|
|
281
|
-
t.preventDefault(), await $(
|
|
284
|
+
t.preventDefault(), await $(l.href, e) && ((a.getAttribute("target") || "_self") === "_blank" ? n.call(window, l.href, "_blank", "noopener,noreferrer") : window.location.href = l.href);
|
|
282
285
|
},
|
|
283
286
|
!0
|
|
284
287
|
);
|
|
285
288
|
}
|
|
286
|
-
function
|
|
289
|
+
function R(e) {
|
|
287
290
|
const n = window.open;
|
|
288
291
|
window.open = async function(t, ...r) {
|
|
289
292
|
if (t) {
|
|
290
293
|
const a = t.toString();
|
|
291
294
|
if (b(a)) {
|
|
292
|
-
const
|
|
293
|
-
if (!A(
|
|
295
|
+
const c = new URL(a, window.location.href);
|
|
296
|
+
if (!A(c.hostname, e.whitelist) && !await $(c.href, e))
|
|
294
297
|
return null;
|
|
295
298
|
}
|
|
296
299
|
}
|
|
297
300
|
return n.call(window, t, ...r);
|
|
298
301
|
};
|
|
299
302
|
}
|
|
300
|
-
function
|
|
303
|
+
function V(e = {}) {
|
|
301
304
|
return {
|
|
302
305
|
install() {
|
|
303
|
-
typeof window > "u" || (
|
|
306
|
+
typeof window > "u" || typeof document > "u" || (S(e), R(e));
|
|
304
307
|
}
|
|
305
308
|
};
|
|
306
309
|
}
|
|
307
310
|
export {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
I as CheckThemePlugin,
|
|
312
|
+
V as createExternalLinkGuard,
|
|
313
|
+
K as initOpenDesignAnalytics,
|
|
314
|
+
z as oaReport,
|
|
312
315
|
O as vAnalytics
|
|
313
316
|
};
|
|
@@ -6,7 +6,7 @@ export interface PageInfo {
|
|
|
6
6
|
}
|
|
7
7
|
export interface LastModifiedPluginOptions {
|
|
8
8
|
modifyDepMap?: (map: Map<string, Set<string>>) => (Map<string, Set<string>> | void) | Promise<Map<string, Set<string>> | void>;
|
|
9
|
-
pageEntryPattern: string | RegExp;
|
|
9
|
+
pageEntryPattern: string | RegExp | (string | RegExp)[];
|
|
10
10
|
/** Path to the git repository root. */
|
|
11
11
|
rootDir?: string;
|
|
12
12
|
/** Absolute path for the output JSON file.
|
|
@@ -19,4 +19,4 @@ export interface LastModifiedPluginOptions {
|
|
|
19
19
|
/** Glob patterns (relative to appDir) to exclude dependency files from traversal and timestamp calculation. */
|
|
20
20
|
ignoreDeps?: string | string[];
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export default function generateLastmodAndChangefreq(options: LastModifiedPluginOptions): Plugin;
|