@opendesign-plus-test/plugins 0.0.1-rc.8 → 0.0.1-rc.9
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 +10 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as B, o as K, v as O } from "./plugin-lvjNLBe-.js";
|
|
2
|
-
const
|
|
2
|
+
const f = {}, L = `
|
|
3
3
|
(function () {
|
|
4
4
|
function getCookie(key) {
|
|
5
5
|
const name = encodeURIComponent(key) + '=';
|
|
@@ -34,9 +34,9 @@ function R(e) {
|
|
|
34
34
|
attributeLightValue: s = t,
|
|
35
35
|
attributeDarkValue: c = r,
|
|
36
36
|
classLightValue: w = t,
|
|
37
|
-
classDarkValue:
|
|
37
|
+
classDarkValue: p = r,
|
|
38
38
|
filename: l = "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, w).replace(/\$CLASS_DARK_VALUE/g,
|
|
39
|
+
} = e, g = L.replace(/\$COOKIE_KEY/g, n).replace(/\$LIGHT_VALUE/g, t).replace(/\$DARK_VALUE/g, r).replace(/\$CLASS_LIGHT_VALUE/g, w).replace(/\$CLASS_DARK_VALUE/g, p).replace(/\$ATTRIBUTE_NAME/g, a).replace(/\$ATTRIBUTE_LIGHT_VALUE/g, s).replace(/\$ATTRIBUTE_DARK_VALUE/g, c);
|
|
40
40
|
let d = "", h = !1, u = "", m = !1;
|
|
41
41
|
return {
|
|
42
42
|
name: "vite-check-theme-plugin",
|
|
@@ -56,7 +56,7 @@ function R(e) {
|
|
|
56
56
|
]);
|
|
57
57
|
},
|
|
58
58
|
generateBundle() {
|
|
59
|
-
h ||
|
|
59
|
+
h || f.existsSync(f.join(u, l)) || (f.existsSync(u) || f.mkdirSync(u, { recursive: !0 }), f.writeFileSync(f.join(u, l), g, "utf-8"));
|
|
60
60
|
},
|
|
61
61
|
configureServer(o) {
|
|
62
62
|
o.middlewares.use(`${d}${l}`, (k, x) => {
|
|
@@ -69,6 +69,8 @@ function R(e) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
function b(e) {
|
|
72
|
+
if (typeof window > "u")
|
|
73
|
+
return !1;
|
|
72
74
|
let n;
|
|
73
75
|
try {
|
|
74
76
|
n = new URL(e, window.location.href);
|
|
@@ -123,14 +125,14 @@ function C(e, n, t) {
|
|
|
123
125
|
</div>
|
|
124
126
|
</div>
|
|
125
127
|
`, document.body.appendChild(i));
|
|
126
|
-
const s = i.querySelector(".elg-title"), c = i.querySelector(".elg-message"), w = i.querySelector(".elg-url"),
|
|
128
|
+
const s = i.querySelector(".elg-title"), c = i.querySelector(".elg-message"), w = i.querySelector(".elg-url"), p = i.querySelector(".elg-cancel"), l = i.querySelector(".elg-confirm");
|
|
127
129
|
s.textContent = r.title, c.textContent = r.message(t), w.textContent = n, i.style.display = "flex";
|
|
128
130
|
const g = (m) => {
|
|
129
|
-
i && (i.style.display = "none", i.removeEventListener("click", u),
|
|
131
|
+
i && (i.style.display = "none", i.removeEventListener("click", u), p.removeEventListener("click", d), l.removeEventListener("click", h), v = !1, a(m));
|
|
130
132
|
}, d = () => g(!1), h = () => g(!0), u = (m) => {
|
|
131
133
|
m.target === i && g(!1);
|
|
132
134
|
};
|
|
133
|
-
i.addEventListener("click", u),
|
|
135
|
+
i.addEventListener("click", u), p.addEventListener("click", d), l.addEventListener("click", h);
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
138
|
function _() {
|
|
@@ -298,7 +300,7 @@ function S(e) {
|
|
|
298
300
|
function I(e = {}) {
|
|
299
301
|
return {
|
|
300
302
|
install() {
|
|
301
|
-
U(e), S(e);
|
|
303
|
+
typeof window > "u" || (U(e), S(e));
|
|
302
304
|
}
|
|
303
305
|
};
|
|
304
306
|
}
|