@unicom-cloud/utils 0.1.5 → 0.1.11
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/caseName.js +11 -0
- package/className.js +5 -0
- package/clipboardCopy.js +6 -0
- package/constant.js +4 -0
- package/content-disposition/index.js +56 -0
- package/contentDisposition.js +7 -0
- package/convert-time/index.js +61 -0
- package/convertTime.js +4 -0
- package/cookie.js +7 -0
- package/dayjs.js +5 -0
- package/decimal.js +5 -0
- package/eventEmitter.js +4 -0
- package/file.js +6 -0
- package/filesize.js +8 -0
- package/index.js +44 -31
- package/invariant.js +4 -0
- package/is.js +92 -0
- package/lunar-converter/index.js +641 -0
- package/lunarConverter.js +4 -0
- package/math.js +9 -0
- package/md5.js +4 -0
- package/mock.js +8 -0
- package/normalizeWheel.js +6 -0
- package/number-to-chinese/index.js +72 -0
- package/numberToChinese.js +4 -0
- package/nzh.js +4 -0
- package/object-keys-sort/index.js +7 -0
- package/objectKeysSort.js +2 -5
- package/package.json +1 -1
- package/random.js +15 -0
- package/screenfull.js +4 -0
- package/search-tree/index.js +54 -0
- package/searchTree.js +4 -0
- package/snapdom/src/api/preCache.js +31 -27
- package/snapdom/src/core/capture.js +55 -44
- package/snapdom/src/core/clone.js +11 -11
- package/snapdom/src/core/prepare.js +38 -31
- package/snapdom/src/modules/background.js +18 -43
- package/snapdom/src/modules/pseudo.js +66 -67
- package/snapdom/src/utils/helpers.js +105 -56
- package/snapdom.js +6 -0
- package/tree.js +11 -0
- package/turboStream.js +6 -0
- package/types/case-name/index.d.ts +11 -0
- package/types/class-name/index.d.ts +2 -0
- package/types/clipboard-copy/index.d.ts +2 -0
- package/types/constant/address.d.ts +14 -0
- package/types/constant/chineseCharacters.d.ts +2 -0
- package/types/constant/constellations.d.ts +2 -0
- package/types/constant/domain.d.ts +2 -0
- package/types/constant/identity.d.ts +2 -0
- package/types/constant/index.d.ts +1 -0
- package/types/constant/keyboardCode.d.ts +158 -0
- package/types/constant/licensePlate.d.ts +2 -0
- package/types/constant/name.d.ts +4 -0
- package/types/constant/platform.d.ts +11 -0
- package/types/constant/protocol.d.ts +2 -0
- package/types/constant/ui.d.ts +14 -0
- package/types/content-disposition/index.d.ts +10 -0
- package/types/convert-time/index.d.ts +32 -0
- package/types/cookie/index.d.ts +4 -0
- package/types/cookie/src/index.d.ts +114 -0
- package/types/dayjs/index.d.ts +1 -0
- package/types/decimal/decimal.d.ts +4 -0
- package/types/decimal/index.d.ts +1 -0
- package/types/event-emitter/index.d.ts +17 -0
- package/types/file/fileToURL.d.ts +2 -0
- package/types/file/index.d.ts +3 -0
- package/types/file/saveAs.d.ts +2 -0
- package/types/filesize/index.d.ts +2 -0
- package/types/filesize/src/constants.d.ts +42 -0
- package/types/filesize/src/filesize.d.ts +47 -0
- package/types/index.d.ts +24 -0
- package/types/invariant/index.d.ts +2 -0
- package/types/is/index.d.ts +53 -0
- package/types/lunar-converter/index.d.ts +113 -0
- package/types/math/index.d.ts +11 -0
- package/types/md5/index.d.ts +2 -0
- package/types/mock/MockWebSocket.d.ts +17 -0
- package/types/mock/MockXMLHttpRequest.d.ts +17 -0
- package/types/mock/index.d.ts +2 -0
- package/types/normalize-wheel/ExecutionEnvironment.d.ts +9 -0
- package/types/normalize-wheel/UserAgent_DEPRECATED.d.ts +86 -0
- package/types/normalize-wheel/index.d.ts +115 -0
- package/types/normalize-wheel/isEventSupported.d.ts +16 -0
- package/types/number-to-chinese/index.d.ts +11 -0
- package/types/nzh/cn.d.ts +8 -0
- package/types/nzh/hk.d.ts +8 -0
- package/types/nzh/index.d.ts +1 -0
- package/types/nzh/nzh.d.ts +36 -0
- package/types/nzh/src/autoGet.d.ts +8 -0
- package/types/nzh/src/index.d.ts +34 -0
- package/types/nzh/src/langs/cn_b.d.ts +10 -0
- package/types/nzh/src/langs/cn_s.d.ts +7 -0
- package/types/nzh/src/langs/hk_b.d.ts +10 -0
- package/types/nzh/src/langs/hk_s.d.ts +7 -0
- package/types/nzh/src/utils.d.ts +65 -0
- package/types/object-keys-sort/index.d.ts +4 -0
- package/types/random/address.d.ts +8 -0
- package/types/random/constellation.d.ts +2 -0
- package/types/random/image.d.ts +5 -0
- package/types/random/index.d.ts +40 -0
- package/types/random/licensePlate.d.ts +2 -0
- package/types/random/name.d.ts +9 -0
- package/types/random/number.d.ts +6 -0
- package/types/random/text.d.ts +13 -0
- package/types/random/time.d.ts +2 -0
- package/types/random/web.d.ts +11 -0
- package/types/screenfull/index.d.ts +10 -0
- package/types/search-tree/index.d.ts +20 -0
- package/types/snapdom/index.d.ts +1 -0
- package/types/snapdom/src/api/preCache.d.ts +8 -0
- package/types/snapdom/src/api/snapdom.d.ts +26 -0
- package/types/snapdom/src/core/cache.d.ts +11 -0
- package/types/snapdom/src/core/capture.d.ts +17 -0
- package/types/snapdom/src/core/clone.d.ts +11 -0
- package/types/snapdom/src/core/prepare.d.ts +8 -0
- package/types/snapdom/src/index.browser.d.ts +1 -0
- package/types/snapdom/src/index.d.ts +2 -0
- package/types/snapdom/src/modules/background.d.ts +10 -0
- package/types/snapdom/src/modules/fonts.d.ts +25 -0
- package/types/snapdom/src/modules/images.d.ts +8 -0
- package/types/snapdom/src/modules/pseudo.d.ts +12 -0
- package/types/snapdom/src/modules/styles.d.ts +10 -0
- package/types/snapdom/src/utils/cssTools.d.ts +38 -0
- package/types/snapdom/src/utils/helpers.d.ts +71 -0
- package/types/tree/index.d.ts +8 -0
- package/types/turbo-stream/index.d.ts +1 -0
- package/types/turbo-stream/src/decode.d.ts +7 -0
- package/types/turbo-stream/src/encode.d.ts +27 -0
- package/types/turbo-stream/src/shared.d.ts +107 -0
- package/types/turbo-stream/src/turbo-stream.d.ts +4 -0
- package/types/url-toolkit/index.d.ts +2 -0
- package/types/url-toolkit/src/url-toolkit.d.ts +18 -0
- package/urlToolkit.js +8 -0
|
@@ -1,93 +1,92 @@
|
|
|
1
|
-
import { iconToImage as
|
|
2
|
-
import { getStyleKey as
|
|
3
|
-
import { getStyle as
|
|
4
|
-
async function
|
|
5
|
-
if (!(l instanceof Element) || !(
|
|
1
|
+
import { iconToImage as z } from "./fonts.js";
|
|
2
|
+
import { getStyleKey as V } from "../utils/cssTools.js";
|
|
3
|
+
import { getStyle as U, snapshotComputedStyle as I, parseContent as W, extractURL as j, fetchImage as A, safeEncodeURI as D, splitBackgroundImage as L, inlineSingleBackgroundEntry as $ } from "../utils/helpers.js";
|
|
4
|
+
async function R(l, i, g, F, h, w = !1) {
|
|
5
|
+
if (!(l instanceof Element) || !(i instanceof Element)) return;
|
|
6
6
|
for (const n of ["::before", "::after", "::first-letter"])
|
|
7
7
|
try {
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
8
|
+
const t = U(l, n);
|
|
9
|
+
if (!t || typeof t[Symbol.iterator] != "function") continue;
|
|
10
10
|
if (n === "::first-letter") {
|
|
11
11
|
const a = getComputedStyle(l);
|
|
12
|
-
if (!(
|
|
13
|
-
const
|
|
14
|
-
(
|
|
12
|
+
if (!(t.color !== a.color || t.fontSize !== a.fontSize || t.fontWeight !== a.fontWeight)) continue;
|
|
13
|
+
const d = Array.from(i.childNodes).find(
|
|
14
|
+
(e) => e.nodeType === Node.TEXT_NODE && e.textContent && e.textContent.trim().length > 0
|
|
15
15
|
);
|
|
16
|
-
if (!
|
|
17
|
-
const
|
|
16
|
+
if (!d) continue;
|
|
17
|
+
const p = d.textContent, f = p.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0], b = p.slice(f?.length || 0);
|
|
18
18
|
if (!f || /[\uD800-\uDFFF]/.test(f)) continue;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
19
|
+
const r = document.createElement("span");
|
|
20
|
+
r.textContent = f, r.dataset.snapdomPseudo = "::first-letter";
|
|
21
|
+
const s = I(t), N = V(s, "span", h);
|
|
22
|
+
g.set(r, N);
|
|
23
|
+
const x = document.createTextNode(b);
|
|
24
|
+
i.replaceChild(x, d), i.insertBefore(r, x);
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const a =
|
|
27
|
+
const S = t.getPropertyValue("content"), u = t.getPropertyValue("background-image"), m = t.getPropertyValue("background-color"), T = S !== "none", y = u && u !== "none", C = m && m !== "transparent" && m !== "rgba(0, 0, 0, 0)";
|
|
28
|
+
if (T || y || C) {
|
|
29
|
+
const a = t.getPropertyValue("font-family"), B = parseInt(t.getPropertyValue("font-size")) || 32, d = parseInt(t.getPropertyValue("font-weight")) || !1, p = t.getPropertyValue("color") || "#000", o = document.createElement("span");
|
|
30
30
|
o.dataset.snapdomPseudo = n;
|
|
31
|
-
const f =
|
|
32
|
-
|
|
33
|
-
const
|
|
31
|
+
const f = I(t), b = V(f, "span", h);
|
|
32
|
+
g.set(o, b);
|
|
33
|
+
const r = a && /font.*awesome|material|bootstrap|glyphicons|ionicons|remixicon|simple-line-icons|octicons|feather|typicons|weathericons|lucide/i.test(
|
|
34
34
|
a
|
|
35
|
-
),
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
), s = W(S);
|
|
36
|
+
if (!w && r && s.length === 1) {
|
|
37
|
+
const e = document.createElement("img");
|
|
38
|
+
e.src = await z(
|
|
39
|
+
s,
|
|
40
40
|
a,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
),
|
|
45
|
-
} else if (
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
41
|
+
d,
|
|
42
|
+
B,
|
|
43
|
+
p
|
|
44
|
+
), e.style = "display:block;width:100%;height:100%;object-fit:contain;", o.appendChild(e);
|
|
45
|
+
} else if (s.startsWith("url(")) {
|
|
46
|
+
const e = j(s);
|
|
47
|
+
if (e && e.trim() !== "")
|
|
48
48
|
try {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
} catch (
|
|
49
|
+
const c = document.createElement("img"), E = await A(D(e));
|
|
50
|
+
c.src = E, c.style = "display:block;width:100%;height:100%;object-fit:contain;", o.appendChild(c);
|
|
51
|
+
} catch (c) {
|
|
52
52
|
console.error(
|
|
53
53
|
`[snapdom] Error in pseudo ${n} for`,
|
|
54
54
|
l,
|
|
55
|
-
|
|
55
|
+
c
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
} else !
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
n === "::before" ? r.insertBefore(o, r.firstChild) : r.appendChild(o);
|
|
58
|
+
} else !r && s && s !== "none" && (o.textContent = s);
|
|
59
|
+
if (y)
|
|
60
|
+
try {
|
|
61
|
+
const e = L(u), c = await Promise.all(
|
|
62
|
+
e.map((E) => $(E))
|
|
63
|
+
);
|
|
64
|
+
o.style.backgroundImage = c.join(", ");
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.warn(
|
|
67
|
+
`[snapdom] Failed to inline background-image for ${n}`,
|
|
68
|
+
e
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (C && (o.style.backgroundColor = m), !(o.childNodes.length > 0 || o.textContent && o.textContent.trim() !== "" || y || C)) continue;
|
|
72
|
+
n === "::before" ? i.insertBefore(o, i.firstChild) : i.appendChild(o);
|
|
74
73
|
}
|
|
75
|
-
} catch (
|
|
76
|
-
console.warn(`[snapdom] Failed to capture ${n} for`, l,
|
|
74
|
+
} catch (t) {
|
|
75
|
+
console.warn(`[snapdom] Failed to capture ${n} for`, l, t);
|
|
77
76
|
}
|
|
78
|
-
const
|
|
77
|
+
const P = Array.from(l.children), k = Array.from(i.children).filter(
|
|
79
78
|
(n) => !n.dataset.snapdomPseudo
|
|
80
79
|
);
|
|
81
|
-
for (let n = 0; n < Math.min(
|
|
82
|
-
await
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
p,
|
|
86
|
-
F,
|
|
80
|
+
for (let n = 0; n < Math.min(P.length, k.length); n++)
|
|
81
|
+
await R(
|
|
82
|
+
P[n],
|
|
83
|
+
k[n],
|
|
87
84
|
g,
|
|
88
|
-
|
|
85
|
+
F,
|
|
86
|
+
h,
|
|
87
|
+
w
|
|
89
88
|
);
|
|
90
89
|
}
|
|
91
90
|
export {
|
|
92
|
-
|
|
91
|
+
R as inlinePseudoElements
|
|
93
92
|
};
|
|
@@ -1,35 +1,52 @@
|
|
|
1
|
-
import { imageCache as
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
import { imageCache as l, computedStyleCache as m, bgCache as u } from "../core/cache.js";
|
|
2
|
+
async function w(t, e = {}) {
|
|
3
|
+
const n = t.startsWith("url("), a = /^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(
|
|
4
|
+
t
|
|
5
|
+
);
|
|
6
|
+
if (n) {
|
|
7
|
+
const r = d(t);
|
|
8
|
+
if (!r) return t;
|
|
9
|
+
const i = g(r);
|
|
10
|
+
if (u.has(i))
|
|
11
|
+
return e.skipInline ? void 0 : `url(${u.get(i)})`;
|
|
12
|
+
{
|
|
13
|
+
const s = e.crossOrigin ? e.crossOrigin(i) : "anonymous", o = await f(i, 3e3, s);
|
|
14
|
+
return u.set(i, o), e.skipInline ? void 0 : `url(${o})`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
function I(t, { fast: e = !1 } = {}) {
|
|
20
|
+
if (e) return t();
|
|
4
21
|
"requestIdleCallback" in window ? requestIdleCallback(t, { timeout: 50 }) : setTimeout(t, 1);
|
|
5
22
|
}
|
|
6
|
-
function
|
|
23
|
+
function x(t, e = null) {
|
|
7
24
|
if (!(t instanceof Element))
|
|
8
|
-
return window.getComputedStyle(t,
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
const a = window.getComputedStyle(t,
|
|
12
|
-
|
|
25
|
+
return window.getComputedStyle(t, e);
|
|
26
|
+
let n = m.get(t);
|
|
27
|
+
if (n || (n = /* @__PURE__ */ new Map(), m.set(t, n)), !n.has(e)) {
|
|
28
|
+
const a = window.getComputedStyle(t, e);
|
|
29
|
+
n.set(e, a);
|
|
13
30
|
}
|
|
14
|
-
return
|
|
31
|
+
return n.get(e);
|
|
15
32
|
}
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
33
|
+
function C(t) {
|
|
34
|
+
let e = t.replace(/^['"]|['"]$/g, "");
|
|
35
|
+
if (e.startsWith("\\"))
|
|
19
36
|
try {
|
|
20
|
-
return String.fromCharCode(parseInt(
|
|
37
|
+
return String.fromCharCode(parseInt(e.replace("\\", ""), 16));
|
|
21
38
|
} catch {
|
|
22
|
-
return
|
|
39
|
+
return e;
|
|
23
40
|
}
|
|
24
|
-
return
|
|
41
|
+
return e;
|
|
25
42
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
return
|
|
43
|
+
function d(t) {
|
|
44
|
+
const e = t.indexOf("url(");
|
|
45
|
+
if (e === -1) return null;
|
|
46
|
+
let n = t.slice(e + 4).trim();
|
|
47
|
+
return n.endsWith(")") && (n = n.slice(0, -1).trim()), (n.startsWith('"') && n.endsWith('"') || n.startsWith("'") && n.endsWith("'")) && (n = n.slice(1, -1)), n;
|
|
31
48
|
}
|
|
32
|
-
function
|
|
49
|
+
function S(t) {
|
|
33
50
|
return [
|
|
34
51
|
/font\s*awesome/i,
|
|
35
52
|
/material\s*icons/i,
|
|
@@ -40,51 +57,83 @@ function p(t) {
|
|
|
40
57
|
/remix\s*icons/i,
|
|
41
58
|
/heroicons/i,
|
|
42
59
|
/lucide/i
|
|
43
|
-
].some((
|
|
60
|
+
].some((n) => n.test(t));
|
|
44
61
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
clearTimeout(
|
|
62
|
+
function f(t, e = 3e3, n = "anonymous") {
|
|
63
|
+
return l.has(t) ? Promise.resolve(l.get(t)) : new Promise((a, r) => {
|
|
64
|
+
const i = setTimeout(() => {
|
|
65
|
+
r(new Error("Image load timed out"));
|
|
66
|
+
}, e), s = new Image();
|
|
67
|
+
s.crossOrigin = n, s.onload = async () => {
|
|
68
|
+
clearTimeout(i);
|
|
52
69
|
try {
|
|
53
|
-
await
|
|
54
|
-
const
|
|
55
|
-
|
|
70
|
+
await s.decode();
|
|
71
|
+
const o = document.createElement("canvas");
|
|
72
|
+
o.width = s.width, o.height = s.height, o.getContext("2d").drawImage(s, 0, 0, o.width, o.height);
|
|
56
73
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
74
|
+
const c = o.toDataURL("image/png");
|
|
75
|
+
l.set(t, c), a(c);
|
|
59
76
|
} catch {
|
|
60
|
-
|
|
77
|
+
r(new Error("CORS restrictions prevented image capture"));
|
|
61
78
|
}
|
|
62
|
-
} catch (
|
|
63
|
-
o
|
|
79
|
+
} catch (o) {
|
|
80
|
+
r(o);
|
|
64
81
|
}
|
|
65
|
-
},
|
|
66
|
-
clearTimeout(
|
|
67
|
-
new Error("Failed to load image: " + (
|
|
82
|
+
}, s.onerror = (o) => {
|
|
83
|
+
clearTimeout(i), r(
|
|
84
|
+
new Error("Failed to load image: " + (o.message || "Unknown error"))
|
|
68
85
|
);
|
|
69
|
-
},
|
|
86
|
+
}, s.src = t;
|
|
70
87
|
});
|
|
71
88
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
for (let
|
|
75
|
-
n
|
|
76
|
-
return
|
|
89
|
+
function U(t) {
|
|
90
|
+
const e = {};
|
|
91
|
+
for (let n of t)
|
|
92
|
+
e[n] = t.getPropertyValue(n);
|
|
93
|
+
return e;
|
|
77
94
|
}
|
|
78
|
-
function
|
|
95
|
+
function y() {
|
|
79
96
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
80
97
|
}
|
|
98
|
+
function k(t) {
|
|
99
|
+
if (!t || t === "none") return "";
|
|
100
|
+
let e = t.replace(/translate[XY]?\([^)]*\)/g, "");
|
|
101
|
+
return e = e.replace(/matrix\(([^)]+)\)/g, (n, a) => {
|
|
102
|
+
const r = a.split(",").map((i) => i.trim());
|
|
103
|
+
return r.length !== 6 ? `matrix(${a})` : (r[4] = "0", r[5] = "0", `matrix(${r.join(", ")})`);
|
|
104
|
+
}), e = e.replace(/matrix3d\(([^)]+)\)/g, (n, a) => {
|
|
105
|
+
const r = a.split(",").map((i) => i.trim());
|
|
106
|
+
return r.length !== 16 ? `matrix3d(${a})` : (r[12] = "0", r[13] = "0", `matrix3d(${r.join(", ")})`);
|
|
107
|
+
}), e.trim().replace(/\s{2,}/g, " ");
|
|
108
|
+
}
|
|
109
|
+
function g(t) {
|
|
110
|
+
if (/%[0-9A-Fa-f]{2}/.test(t)) return t;
|
|
111
|
+
try {
|
|
112
|
+
return encodeURI(t);
|
|
113
|
+
} catch {
|
|
114
|
+
return t;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function E(t) {
|
|
118
|
+
const e = [];
|
|
119
|
+
let n = 0, a = 0;
|
|
120
|
+
for (let r = 0; r < t.length; r++) {
|
|
121
|
+
const i = t[r];
|
|
122
|
+
i === "(" && n++, i === ")" && n--, i === "," && n === 0 && (e.push(t.slice(a, r).trim()), a = r + 1);
|
|
123
|
+
}
|
|
124
|
+
return e.push(t.slice(a).trim()), e;
|
|
125
|
+
}
|
|
81
126
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
127
|
+
d as extractURL,
|
|
128
|
+
f as fetchImage,
|
|
129
|
+
x as getStyle,
|
|
130
|
+
I as idle,
|
|
131
|
+
w as inlineSingleBackgroundEntry,
|
|
132
|
+
S as isIconFont,
|
|
133
|
+
y as isSafari,
|
|
134
|
+
C as parseContent,
|
|
135
|
+
g as safeEncodeURI,
|
|
136
|
+
U as snapshotComputedStyle,
|
|
137
|
+
E as splitBackgroundImage,
|
|
138
|
+
k as stripTranslate
|
|
90
139
|
};
|
package/snapdom.js
ADDED
package/tree.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getItemBy as y, findNodeBy as B, getChildWithParentBy as g, getItemBy as m, getItemBy2 as a, getItemBy3 as I, getItemByID as i, getLabelFromDictionaryByValue as o } from "./tree/index.js";
|
|
2
|
+
export {
|
|
3
|
+
y as default,
|
|
4
|
+
B as findNodeBy,
|
|
5
|
+
g as getChildWithParentBy,
|
|
6
|
+
m as getItemBy,
|
|
7
|
+
a as getItemBy2,
|
|
8
|
+
I as getItemBy3,
|
|
9
|
+
i as getItemByID,
|
|
10
|
+
o as getLabelFromDictionaryByValue
|
|
11
|
+
};
|
package/turboStream.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default caseName;
|
|
2
|
+
declare function caseName(name: any): {
|
|
3
|
+
kebabCaseName: string;
|
|
4
|
+
snakeCaseName: string;
|
|
5
|
+
camelCaseName: string;
|
|
6
|
+
capitalizeName: string;
|
|
7
|
+
startCaseName: string;
|
|
8
|
+
lowerFirstCaseName: Uncapitalize<any>;
|
|
9
|
+
upperFirstCaseName: Capitalize<any>;
|
|
10
|
+
ComponentCaseName: Capitalize<string>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default CHINESE_CHARACTERS;
|
|
2
|
+
declare const CHINESE_CHARACTERS: "\u7684\u4E00\u662F\u5728\u4E0D\u4E86\u6709\u548C\u4EBA\u8FD9\u4E2D\u5927\u4E3A\u4E0A\u4E2A\u56FD\u6211\u4EE5\u8981\u4ED6\u65F6\u6765\u7528\u4EEC\u751F\u5230\u4F5C\u5730\u4E8E\u51FA\u5C31\u5206\u5BF9\u6210\u4F1A\u53EF\u4E3B\u53D1\u5E74\u52A8\u540C\u5DE5\u4E5F\u80FD\u4E0B\u8FC7\u5B50\u8BF4\u4EA7\u79CD\u9762\u800C\u65B9\u540E\u591A\u5B9A\u884C\u5B66\u6CD5\u6240\u6C11\u5F97\u7ECF\u5341\u4E09\u4E4B\u8FDB\u7740\u7B49\u90E8\u5EA6\u5BB6\u7535\u529B\u91CC\u5982\u6C34\u5316\u9AD8\u81EA\u4E8C\u7406\u8D77\u5C0F\u7269\u73B0\u5B9E\u52A0\u91CF\u90FD\u4E24\u4F53\u5236\u673A\u5F53\u4F7F\u70B9\u4ECE\u4E1A\u672C\u53BB\u628A\u6027\u597D\u5E94\u5F00\u5B83\u5408\u8FD8\u56E0\u7531\u5176\u4E9B\u7136\u524D\u5916\u5929\u653F\u56DB\u65E5\u90A3\u793E\u4E49\u4E8B\u5E73\u5F62\u76F8\u5168\u8868\u95F4\u6837\u4E0E\u5173\u5404\u91CD\u65B0\u7EBF\u5185\u6570\u6B63\u5FC3\u53CD\u4F60\u660E\u770B\u539F\u53C8\u4E48\u5229\u6BD4\u6216\u4F46\u8D28\u6C14\u7B2C\u5411\u9053\u547D\u6B64\u53D8\u6761\u53EA\u6CA1\u7ED3\u89E3\u95EE\u610F\u5EFA\u6708\u516C\u65E0\u7CFB\u519B\u5F88\u60C5\u8005\u6700\u7ACB\u4EE3\u60F3\u5DF2\u901A\u5E76\u63D0\u76F4\u9898\u515A\u7A0B\u5C55\u4E94\u679C\u6599\u8C61\u5458\u9769\u4F4D\u5165\u5E38\u6587\u603B\u6B21\u54C1\u5F0F\u6D3B\u8BBE\u53CA\u7BA1\u7279\u4EF6\u957F\u6C42\u8001\u5934\u57FA\u8D44\u8FB9\u6D41\u8DEF\u7EA7\u5C11\u56FE\u5C71\u7EDF\u63A5\u77E5\u8F83\u5C06\u7EC4\u89C1\u8BA1\u522B\u5979\u624B\u89D2\u671F\u6839\u8BBA\u8FD0\u519C\u6307\u51E0\u4E5D\u533A\u5F3A\u653E\u51B3\u897F\u88AB\u5E72\u505A\u5FC5\u6218\u5148\u56DE\u5219\u4EFB\u53D6\u636E\u5904\u961F\u5357\u7ED9\u8272\u5149\u95E8\u5373\u4FDD\u6CBB\u5317\u9020\u767E\u89C4\u70ED\u9886\u4E03\u6D77\u53E3\u4E1C\u5BFC\u5668\u538B\u5FD7\u4E16\u91D1\u589E\u4E89\u6D4E\u9636\u6CB9\u601D\u672F\u6781\u4EA4\u53D7\u8054\u4EC0\u8BA4\u516D\u5171\u6743\u6536\u8BC1\u6539\u6E05\u5DF1\u7F8E\u518D\u91C7\u8F6C\u66F4\u5355\u98CE\u5207\u6253\u767D\u6559\u901F\u82B1\u5E26\u5B89\u573A\u8EAB\u8F66\u4F8B\u771F\u52A1\u5177\u4E07\u6BCF\u76EE\u81F3\u8FBE\u8D70\u79EF\u793A\u8BAE\u58F0\u62A5\u6597\u5B8C\u7C7B\u516B\u79BB\u534E\u540D\u786E\u624D\u79D1\u5F20\u4FE1\u9A6C\u8282\u8BDD\u7C73\u6574\u7A7A\u5143\u51B5\u4ECA\u96C6\u6E29\u4F20\u571F\u8BB8\u6B65\u7FA4\u5E7F\u77F3\u8BB0\u9700\u6BB5\u7814\u754C\u62C9\u6797\u5F8B\u53EB\u4E14\u7A76\u89C2\u8D8A\u7EC7\u88C5\u5F71\u7B97\u4F4E\u6301\u97F3\u4F17\u4E66\u5E03\u590D\u5BB9\u513F\u987B\u9645\u5546\u975E\u9A8C\u8FDE\u65AD\u6DF1\u96BE\u8FD1\u77FF\u5343\u5468\u59D4\u7D20\u6280\u5907\u534A\u529E\u9752\u7701\u5217\u4E60\u54CD\u7EA6\u652F\u822C\u53F2\u611F\u52B3\u4FBF\u56E2\u5F80\u9178\u5386\u5E02\u514B\u4F55\u9664\u6D88\u6784\u5E9C\u79F0\u592A\u51C6\u7CBE\u503C\u53F7\u7387\u65CF\u7EF4\u5212\u9009\u6807\u5199\u5B58\u5019\u6BDB\u4EB2\u5FEB\u6548\u65AF\u9662\u67E5\u6C5F\u578B\u773C\u738B\u6309\u683C\u517B\u6613\u7F6E\u6D3E\u5C42\u7247\u59CB\u5374\u4E13\u72B6\u80B2\u5382\u4EAC\u8BC6\u9002\u5C5E\u5706\u5305\u706B\u4F4F\u8C03\u6EE1\u53BF\u5C40\u7167\u53C2\u7EA2\u7EC6\u5F15\u542C\u8BE5\u94C1\u4EF7\u4E25\u9F99\u98DE";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MATCH_MEDIA_PREFERS_COLOR_SCHEME_DARK: MediaQueryList;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export namespace Enter {
|
|
2
|
+
let key: string;
|
|
3
|
+
let code: string;
|
|
4
|
+
let keyCode: number;
|
|
5
|
+
}
|
|
6
|
+
export namespace Esc {
|
|
7
|
+
let key_1: string;
|
|
8
|
+
export { key_1 as key };
|
|
9
|
+
let code_1: string;
|
|
10
|
+
export { code_1 as code };
|
|
11
|
+
let keyCode_1: number;
|
|
12
|
+
export { keyCode_1 as keyCode };
|
|
13
|
+
}
|
|
14
|
+
export namespace Escape { }
|
|
15
|
+
export namespace Backspace {
|
|
16
|
+
let key_2: string;
|
|
17
|
+
export { key_2 as key };
|
|
18
|
+
let code_2: string;
|
|
19
|
+
export { code_2 as code };
|
|
20
|
+
let keyCode_2: number;
|
|
21
|
+
export { keyCode_2 as keyCode };
|
|
22
|
+
}
|
|
23
|
+
export namespace Tab {
|
|
24
|
+
let key_3: string;
|
|
25
|
+
export { key_3 as key };
|
|
26
|
+
let code_3: string;
|
|
27
|
+
export { code_3 as code };
|
|
28
|
+
let keyCode_3: number;
|
|
29
|
+
export { keyCode_3 as keyCode };
|
|
30
|
+
}
|
|
31
|
+
export namespace Space {
|
|
32
|
+
let key_4: string;
|
|
33
|
+
export { key_4 as key };
|
|
34
|
+
let code_4: string;
|
|
35
|
+
export { code_4 as code };
|
|
36
|
+
let keyCode_4: number;
|
|
37
|
+
export { keyCode_4 as keyCode };
|
|
38
|
+
}
|
|
39
|
+
export namespace ArrowLeft {
|
|
40
|
+
let key_5: string;
|
|
41
|
+
export { key_5 as key };
|
|
42
|
+
let code_5: string;
|
|
43
|
+
export { code_5 as code };
|
|
44
|
+
let keyCode_5: number;
|
|
45
|
+
export { keyCode_5 as keyCode };
|
|
46
|
+
}
|
|
47
|
+
export namespace ArrowUp {
|
|
48
|
+
let key_6: string;
|
|
49
|
+
export { key_6 as key };
|
|
50
|
+
let code_6: string;
|
|
51
|
+
export { code_6 as code };
|
|
52
|
+
let keyCode_6: number;
|
|
53
|
+
export { keyCode_6 as keyCode };
|
|
54
|
+
}
|
|
55
|
+
export namespace ArrowRight {
|
|
56
|
+
let key_7: string;
|
|
57
|
+
export { key_7 as key };
|
|
58
|
+
let code_7: string;
|
|
59
|
+
export { code_7 as code };
|
|
60
|
+
let keyCode_7: number;
|
|
61
|
+
export { keyCode_7 as keyCode };
|
|
62
|
+
}
|
|
63
|
+
export namespace ArrowDown {
|
|
64
|
+
let key_8: string;
|
|
65
|
+
export { key_8 as key };
|
|
66
|
+
let code_8: string;
|
|
67
|
+
export { code_8 as code };
|
|
68
|
+
let keyCode_8: number;
|
|
69
|
+
export { keyCode_8 as keyCode };
|
|
70
|
+
}
|
|
71
|
+
export namespace CapsLock {
|
|
72
|
+
let key_9: string;
|
|
73
|
+
export { key_9 as key };
|
|
74
|
+
let code_9: string;
|
|
75
|
+
export { code_9 as code };
|
|
76
|
+
let keyCode_9: number;
|
|
77
|
+
export { keyCode_9 as keyCode };
|
|
78
|
+
}
|
|
79
|
+
export namespace Meta {
|
|
80
|
+
let key_10: string;
|
|
81
|
+
export { key_10 as key };
|
|
82
|
+
}
|
|
83
|
+
export namespace MetaLeft {
|
|
84
|
+
let key_11: string;
|
|
85
|
+
export { key_11 as key };
|
|
86
|
+
let code_10: string;
|
|
87
|
+
export { code_10 as code };
|
|
88
|
+
let keyCode_10: number;
|
|
89
|
+
export { keyCode_10 as keyCode };
|
|
90
|
+
}
|
|
91
|
+
export namespace MetaRight {
|
|
92
|
+
let key_12: string;
|
|
93
|
+
export { key_12 as key };
|
|
94
|
+
let code_11: string;
|
|
95
|
+
export { code_11 as code };
|
|
96
|
+
let keyCode_11: number;
|
|
97
|
+
export { keyCode_11 as keyCode };
|
|
98
|
+
}
|
|
99
|
+
export namespace Control {
|
|
100
|
+
let key_13: string;
|
|
101
|
+
export { key_13 as key };
|
|
102
|
+
}
|
|
103
|
+
export namespace ControlLeft {
|
|
104
|
+
let key_14: string;
|
|
105
|
+
export { key_14 as key };
|
|
106
|
+
let code_12: string;
|
|
107
|
+
export { code_12 as code };
|
|
108
|
+
let keyCode_12: number;
|
|
109
|
+
export { keyCode_12 as keyCode };
|
|
110
|
+
}
|
|
111
|
+
export namespace ControlRight {
|
|
112
|
+
let key_15: string;
|
|
113
|
+
export { key_15 as key };
|
|
114
|
+
let code_13: string;
|
|
115
|
+
export { code_13 as code };
|
|
116
|
+
let keyCode_13: number;
|
|
117
|
+
export { keyCode_13 as keyCode };
|
|
118
|
+
}
|
|
119
|
+
export namespace Alt {
|
|
120
|
+
let key_16: string;
|
|
121
|
+
export { key_16 as key };
|
|
122
|
+
}
|
|
123
|
+
export namespace AltLeft {
|
|
124
|
+
let key_17: string;
|
|
125
|
+
export { key_17 as key };
|
|
126
|
+
let code_14: string;
|
|
127
|
+
export { code_14 as code };
|
|
128
|
+
let keyCode_14: number;
|
|
129
|
+
export { keyCode_14 as keyCode };
|
|
130
|
+
}
|
|
131
|
+
export namespace AltRight {
|
|
132
|
+
let key_18: string;
|
|
133
|
+
export { key_18 as key };
|
|
134
|
+
let code_15: string;
|
|
135
|
+
export { code_15 as code };
|
|
136
|
+
let keyCode_15: number;
|
|
137
|
+
export { keyCode_15 as keyCode };
|
|
138
|
+
}
|
|
139
|
+
export namespace Shift {
|
|
140
|
+
let key_19: string;
|
|
141
|
+
export { key_19 as key };
|
|
142
|
+
}
|
|
143
|
+
export namespace ShiftLeft {
|
|
144
|
+
let key_20: string;
|
|
145
|
+
export { key_20 as key };
|
|
146
|
+
let code_16: string;
|
|
147
|
+
export { code_16 as code };
|
|
148
|
+
let keyCode_16: number;
|
|
149
|
+
export { keyCode_16 as keyCode };
|
|
150
|
+
}
|
|
151
|
+
export namespace ShiftRight {
|
|
152
|
+
let key_21: string;
|
|
153
|
+
export { key_21 as key };
|
|
154
|
+
let code_17: string;
|
|
155
|
+
export { code_17 as code };
|
|
156
|
+
let keyCode_17: number;
|
|
157
|
+
export { keyCode_17 as keyCode };
|
|
158
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const isWeChatMiniProgram: boolean;
|
|
2
|
+
export const isWeChatBrowser: boolean;
|
|
3
|
+
export const isDingtalkBrowser: boolean;
|
|
4
|
+
export const isAlipayBrowser: boolean;
|
|
5
|
+
export const isIOS_OS: boolean;
|
|
6
|
+
export const isAndroidOS: boolean;
|
|
7
|
+
export const isHarmony: boolean;
|
|
8
|
+
export const isMacOS: boolean;
|
|
9
|
+
export const isWindowsOS: boolean;
|
|
10
|
+
export const isMobileDevice: boolean;
|
|
11
|
+
export const isPWA: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const PC_KEY: "pc";
|
|
2
|
+
export const MOBILE_KEY: "mobile";
|
|
3
|
+
export const UI_COMMON_PREFIX: "pqbc";
|
|
4
|
+
export const UI_COMMON_KEY: "pqb-common";
|
|
5
|
+
export const UI_COMMON_THEME_LIGHT_CLASS_NAME: "pqbc-theme-light";
|
|
6
|
+
export const UI_COMMON_THEME_DARK_CLASS_NAME: "pqbc-theme-dark";
|
|
7
|
+
export const UI_PC_PREFIX: "pqb";
|
|
8
|
+
export const UI_PC_KEY: "pqb-pc";
|
|
9
|
+
export const UI_PC_THEME_LIGHT_CLASS_NAME: "pqb-theme-light";
|
|
10
|
+
export const UI_PC_THEME_DARK_CLASS_NAME: "pqb-theme-dark";
|
|
11
|
+
export const UI_MOBILE_PREFIX: "pqbm";
|
|
12
|
+
export const UI_MOBILE_KEY: "pqb-mobile";
|
|
13
|
+
export const UI_MOBILE_THEME_LIGHT_CLASS_NAME: "pqbm-theme-light";
|
|
14
|
+
export const UI_MOBILE_THEME_DARK_CLASS_NAME: "pqbm-theme-dark";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default parseContentDisposition;
|
|
2
|
+
export function getContentDispositionFromHeader(params: any): Object | undefined;
|
|
3
|
+
export function getContentDispositionParametersFilenameFromHeader(params: any): any;
|
|
4
|
+
export function getContentDispositionParametersFromHeader(params: any): any;
|
|
5
|
+
/**
|
|
6
|
+
* 解析 Content-Disposition 头部
|
|
7
|
+
* @param {string} contentDisposition - Content-Disposition 头部字符串
|
|
8
|
+
* @returns {Object} 包含 disposition 类型和参数的对象
|
|
9
|
+
*/
|
|
10
|
+
declare function parseContentDisposition(contentDisposition: string): Object;
|