@arcblock/react-hooks 2.13.70 → 3.0.1
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/lib/index.js +10 -4
- package/lib/useBrowser.js +43 -46
- package/lib/useInterval.js +15 -19
- package/lib/useLineClamp.js +77 -109
- package/lib/useStorage.js +17 -34
- package/package.json +6 -12
- package/src/useLineClamp.ts +2 -2
- package/vite.config.mjs +25 -0
- package/lib/index.d.ts +0 -4
- package/lib/useBrowser.d.ts +0 -42
- package/lib/useInterval.d.ts +0 -1
- package/lib/useLineClamp.d.ts +0 -17
- package/lib/useStorage.d.ts +0 -1
package/lib/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { default as a } from "./useInterval.js";
|
|
2
|
+
import { default as t } from "./useStorage.js";
|
|
3
|
+
import { default as f } from "./useBrowser.js";
|
|
4
|
+
import { default as l } from "./useLineClamp.js";
|
|
5
|
+
export {
|
|
6
|
+
f as useBrowser,
|
|
7
|
+
a as useInterval,
|
|
8
|
+
l as useLineClamp,
|
|
9
|
+
t as useStorage
|
|
10
|
+
};
|
package/lib/useBrowser.js
CHANGED
|
@@ -1,63 +1,60 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const reg = new RegExp(`${tag}/(?<version>[0-9.]+)`, 'g');
|
|
9
|
-
const result = reg.exec(userAgent);
|
|
10
|
-
const version = result?.groups?.version;
|
|
11
|
-
return version;
|
|
1
|
+
import { useState as f } from "react";
|
|
2
|
+
import i from "ismobilejs";
|
|
3
|
+
const n = "ABTWallet", r = "ArcSphere";
|
|
4
|
+
function t(e, s) {
|
|
5
|
+
var l;
|
|
6
|
+
const o = new RegExp(`${s}/(?<version>[0-9.]+)`, "g").exec(e);
|
|
7
|
+
return (l = o == null ? void 0 : o.groups) == null ? void 0 : l.version;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const [browser] = useState({
|
|
9
|
+
function b() {
|
|
10
|
+
var a;
|
|
11
|
+
const e = (a = window == null ? void 0 : window.navigator) == null ? void 0 : a.userAgent, [s] = f({
|
|
17
12
|
// FIXME: @zhanghan 待应用中相关代码兼容 arcSphere 的判断后,才能移除 arcSphere 的判断
|
|
18
13
|
// https://github.com/search?q=org%3AArcBlock%20browser.wallet&type=code
|
|
19
14
|
// https://github.com/search?q=org%3Ablocklet+browser.wallet&type=code
|
|
20
|
-
wallet:
|
|
21
|
-
walletVersion:
|
|
22
|
-
arcSphere:
|
|
23
|
-
arcSphereVersion:
|
|
24
|
-
wechat: /MicroMessenger/i.test(
|
|
15
|
+
wallet: e.indexOf(n) > -1 || e.indexOf(r) > -1,
|
|
16
|
+
walletVersion: t(e, n),
|
|
17
|
+
arcSphere: e.indexOf(r) > -1,
|
|
18
|
+
arcSphereVersion: t(e, r),
|
|
19
|
+
wechat: /MicroMessenger/i.test(e),
|
|
25
20
|
mobile: {
|
|
26
21
|
apple: {
|
|
27
|
-
phone:
|
|
28
|
-
ipod:
|
|
29
|
-
tablet:
|
|
30
|
-
device:
|
|
22
|
+
phone: !1,
|
|
23
|
+
ipod: !1,
|
|
24
|
+
tablet: !1,
|
|
25
|
+
device: !1
|
|
31
26
|
},
|
|
32
27
|
amazon: {
|
|
33
|
-
phone:
|
|
34
|
-
tablet:
|
|
35
|
-
device:
|
|
28
|
+
phone: !1,
|
|
29
|
+
tablet: !1,
|
|
30
|
+
device: !1
|
|
36
31
|
},
|
|
37
32
|
android: {
|
|
38
|
-
phone:
|
|
39
|
-
tablet:
|
|
40
|
-
device:
|
|
33
|
+
phone: !1,
|
|
34
|
+
tablet: !1,
|
|
35
|
+
device: !1
|
|
41
36
|
},
|
|
42
37
|
windows: {
|
|
43
|
-
phone:
|
|
44
|
-
tablet:
|
|
45
|
-
device:
|
|
38
|
+
phone: !1,
|
|
39
|
+
tablet: !1,
|
|
40
|
+
device: !1
|
|
46
41
|
},
|
|
47
42
|
other: {
|
|
48
|
-
blackberry:
|
|
49
|
-
blackberry10:
|
|
50
|
-
opera:
|
|
51
|
-
firefox:
|
|
52
|
-
chrome:
|
|
53
|
-
device:
|
|
43
|
+
blackberry: !1,
|
|
44
|
+
blackberry10: !1,
|
|
45
|
+
opera: !1,
|
|
46
|
+
firefox: !1,
|
|
47
|
+
chrome: !1,
|
|
48
|
+
device: !1
|
|
54
49
|
},
|
|
55
|
-
phone:
|
|
56
|
-
tablet:
|
|
57
|
-
any:
|
|
58
|
-
...
|
|
59
|
-
}
|
|
50
|
+
phone: !1,
|
|
51
|
+
tablet: !1,
|
|
52
|
+
any: !1,
|
|
53
|
+
...i(e)
|
|
54
|
+
}
|
|
60
55
|
});
|
|
61
|
-
|
|
62
|
-
return browser;
|
|
56
|
+
return s;
|
|
63
57
|
}
|
|
58
|
+
export {
|
|
59
|
+
b as default
|
|
60
|
+
};
|
package/lib/useInterval.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
savedCallback.current = callback;
|
|
10
|
-
}, [callback]);
|
|
11
|
-
|
|
12
|
-
// Set up the interval.
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
function tick() {
|
|
15
|
-
savedCallback.current();
|
|
1
|
+
import { useRef as f, useEffect as r } from "react";
|
|
2
|
+
function o(e, t) {
|
|
3
|
+
const n = f();
|
|
4
|
+
r(() => {
|
|
5
|
+
n.current = e;
|
|
6
|
+
}, [e]), r(() => {
|
|
7
|
+
function u() {
|
|
8
|
+
n.current();
|
|
16
9
|
}
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
return () => clearInterval(
|
|
10
|
+
if (t !== null) {
|
|
11
|
+
const c = setInterval(u, t);
|
|
12
|
+
return () => clearInterval(c);
|
|
20
13
|
}
|
|
21
|
-
}, [
|
|
14
|
+
}, [t]);
|
|
22
15
|
}
|
|
16
|
+
export {
|
|
17
|
+
o as default
|
|
18
|
+
};
|
package/lib/useLineClamp.js
CHANGED
|
@@ -1,127 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
text,
|
|
8
|
-
ellipsis =
|
|
9
|
-
lines = 3,
|
|
10
|
-
expanded =
|
|
11
|
-
debounceTime = 300,
|
|
12
|
-
charWidth = 1.2,
|
|
13
|
-
offset = 1
|
|
1
|
+
import { useReactive as z, useMemoizedFn as w, useDebounceFn as E, useMount as N, useUpdateEffect as F } from "ahooks";
|
|
2
|
+
import { useRef as k } from "react";
|
|
3
|
+
const B = "…";
|
|
4
|
+
let D = 0;
|
|
5
|
+
const f = () => `__clamp_text_key__${D++}`;
|
|
6
|
+
function $({
|
|
7
|
+
text: o,
|
|
8
|
+
ellipsis: c = B,
|
|
9
|
+
lines: i = 3,
|
|
10
|
+
expanded: l = !1,
|
|
11
|
+
debounceTime: T = 300,
|
|
12
|
+
charWidth: u = 1.2,
|
|
13
|
+
offset: L = 1
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
16
|
-
needClamp:
|
|
17
|
-
noClamp:
|
|
18
|
-
clampedText: "
|
|
19
|
-
key:
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const buttonRef = useRef();
|
|
23
|
-
const lineHeightRef = useRef(0);
|
|
24
|
-
const clampLines = useMemoizedFn(({ lineHeight, originalText, expanded: expanded2, ellipsis: ellipsis2, lines: lines2 }) => {
|
|
25
|
-
if (!textRef.current) {
|
|
15
|
+
const e = z({
|
|
16
|
+
needClamp: !0,
|
|
17
|
+
noClamp: !1,
|
|
18
|
+
clampedText: "…",
|
|
19
|
+
key: f()
|
|
20
|
+
}), a = k(void 0), H = k(void 0), m = k(0), p = w(({ lineHeight: s, originalText: t, expanded: _, ellipsis: g, lines: x }) => {
|
|
21
|
+
if (!a.current)
|
|
26
22
|
return;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!originalText || expanded2) {
|
|
31
|
-
currentState.noClamp = true;
|
|
32
|
-
currentState.clampedText = originalText;
|
|
33
|
-
currentState.key = getNewKey();
|
|
23
|
+
const n = a.current, d = H.current;
|
|
24
|
+
if (!t || _) {
|
|
25
|
+
e.noClamp = !0, e.clampedText = t, e.key = f();
|
|
34
26
|
return;
|
|
35
27
|
}
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let end = originalText.length;
|
|
40
|
-
if (!node.clientHeight) {
|
|
28
|
+
const M = s * x + 1;
|
|
29
|
+
let h = 0, r = 0, y = t.length;
|
|
30
|
+
if (!n.clientHeight)
|
|
41
31
|
return;
|
|
32
|
+
function b() {
|
|
33
|
+
((n == null ? void 0 : n.getBoundingClientRect().height) ?? 1) <= M ? h = r + 1 : y = r - 1;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
start = middle + 1;
|
|
47
|
-
} else {
|
|
48
|
-
end = middle - 1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
while (start <= end) {
|
|
52
|
-
middle = Math.floor((start + end) / 2);
|
|
53
|
-
node.innerText = originalText.slice(0, middle) + ellipsis2;
|
|
54
|
-
if (button) {
|
|
55
|
-
node.appendChild(button.cloneNode(true));
|
|
56
|
-
}
|
|
57
|
-
if (middle === originalText.length) {
|
|
58
|
-
currentState.needClamp = false;
|
|
59
|
-
currentState.noClamp = true;
|
|
60
|
-
currentState.clampedText = originalText;
|
|
61
|
-
currentState.key = getNewKey();
|
|
35
|
+
for (; h <= y; ) {
|
|
36
|
+
if (r = Math.floor((h + y) / 2), n.innerText = t.slice(0, r) + g, d && n.appendChild(d.cloneNode(!0)), r === t.length) {
|
|
37
|
+
e.needClamp = !1, e.noClamp = !0, e.clampedText = t, e.key = f();
|
|
62
38
|
return;
|
|
63
39
|
}
|
|
64
|
-
|
|
40
|
+
b();
|
|
65
41
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const resizeListener = useMemoizedFn(() => {
|
|
79
|
-
debouncedClampLines({
|
|
80
|
-
lineHeight: lineHeightRef.current,
|
|
81
|
-
originalText: text,
|
|
82
|
-
expanded,
|
|
83
|
-
ellipsis,
|
|
84
|
-
lines,
|
|
85
|
-
charWidth
|
|
42
|
+
const v = t.slice(0, Math.max(r - L, 0)).trim() + (typeof g == "string" ? g : "");
|
|
43
|
+
n.innerText = v, d && n.appendChild(d.cloneNode(!0)), e.needClamp = !0, e.noClamp = !1, e.clampedText = v, e.key = f();
|
|
44
|
+
}), { run: R } = E(p, {
|
|
45
|
+
wait: T
|
|
46
|
+
}), C = w(() => {
|
|
47
|
+
R({
|
|
48
|
+
lineHeight: m.current,
|
|
49
|
+
originalText: o,
|
|
50
|
+
expanded: l,
|
|
51
|
+
ellipsis: c,
|
|
52
|
+
lines: i,
|
|
53
|
+
charWidth: u
|
|
86
54
|
});
|
|
87
55
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
setTimeout(() => {
|
|
93
|
-
|
|
94
|
-
lineHeight,
|
|
95
|
-
originalText:
|
|
96
|
-
expanded,
|
|
97
|
-
ellipsis,
|
|
98
|
-
lines,
|
|
99
|
-
charWidth
|
|
56
|
+
return N(() => {
|
|
57
|
+
var s;
|
|
58
|
+
if (o && !m.current) {
|
|
59
|
+
const t = (((s = a.current) == null ? void 0 : s.clientHeight) ?? 1) + 1;
|
|
60
|
+
m.current = t, setTimeout(() => {
|
|
61
|
+
p({
|
|
62
|
+
lineHeight: t,
|
|
63
|
+
originalText: o,
|
|
64
|
+
expanded: l,
|
|
65
|
+
ellipsis: c,
|
|
66
|
+
lines: i,
|
|
67
|
+
charWidth: u
|
|
100
68
|
});
|
|
101
69
|
});
|
|
102
70
|
}
|
|
103
|
-
window.addEventListener("resize",
|
|
104
|
-
|
|
105
|
-
window.removeEventListener("resize", resizeListener);
|
|
71
|
+
return window.addEventListener("resize", C), () => {
|
|
72
|
+
window.removeEventListener("resize", C);
|
|
106
73
|
};
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
charWidth
|
|
74
|
+
}), F(() => {
|
|
75
|
+
p({
|
|
76
|
+
lineHeight: m.current,
|
|
77
|
+
originalText: o,
|
|
78
|
+
expanded: l,
|
|
79
|
+
ellipsis: c,
|
|
80
|
+
lines: i,
|
|
81
|
+
charWidth: u
|
|
116
82
|
});
|
|
117
|
-
}, [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
run: resizeListener
|
|
83
|
+
}, [l, o, u, c, i]), {
|
|
84
|
+
textRef: a,
|
|
85
|
+
buttonRef: H,
|
|
86
|
+
needClamp: e.needClamp,
|
|
87
|
+
noClamp: e.noClamp,
|
|
88
|
+
clampedText: e.clampedText,
|
|
89
|
+
key: e.key,
|
|
90
|
+
run: C
|
|
126
91
|
};
|
|
127
92
|
}
|
|
93
|
+
export {
|
|
94
|
+
$ as default
|
|
95
|
+
};
|
package/lib/useStorage.js
CHANGED
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const storeKey = `${keyPrefix}.${key}`;
|
|
9
|
-
const raw = storage.getItem(storeKey);
|
|
10
|
-
const [value, setValue] = useState(raw ? JSON.parse(raw) : defaultValue);
|
|
11
|
-
|
|
12
|
-
const updater = (updatedValue) => {
|
|
13
|
-
setValue(updatedValue);
|
|
14
|
-
storage.setItem(storeKey, JSON.stringify(updatedValue));
|
|
15
|
-
evtTarget.dispatchEvent(new CustomEvent('storage_change', { detail: { key } }));
|
|
1
|
+
import { useState as u, useEffect as p } from "react";
|
|
2
|
+
import { EventTarget as E } from "event-target-shim";
|
|
3
|
+
const a = new E();
|
|
4
|
+
function w(n, m) {
|
|
5
|
+
return (r, s) => {
|
|
6
|
+
const o = `${m}.${r}`, t = n.getItem(o), [f, c] = u(t ? JSON.parse(t) : s), i = (e) => {
|
|
7
|
+
c(e), n.setItem(o, JSON.stringify(e)), a.dispatchEvent(new CustomEvent("storage_change", { detail: { key: r } }));
|
|
16
8
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
const listener = ({ detail }) => {
|
|
24
|
-
if (detail.key === key) {
|
|
25
|
-
const _raw = storage.getItem(storeKey);
|
|
26
|
-
|
|
27
|
-
if (_raw !== raw) {
|
|
28
|
-
setValue(JSON.parse(_raw));
|
|
29
|
-
}
|
|
9
|
+
return s != null && !t && i(s), p(() => {
|
|
10
|
+
const e = ({ detail: v }) => {
|
|
11
|
+
if (v.key === r) {
|
|
12
|
+
const g = n.getItem(o);
|
|
13
|
+
g !== t && c(JSON.parse(g));
|
|
30
14
|
}
|
|
31
15
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return () => evtTarget.removeEventListener('storage_change', listener);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return [value, updater];
|
|
16
|
+
return a.addEventListener("storage_change", e), () => a.removeEventListener("storage_change", e);
|
|
17
|
+
}), [f, i];
|
|
38
18
|
};
|
|
39
19
|
}
|
|
20
|
+
export {
|
|
21
|
+
w as default
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/react-hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "React hooks used by arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"lint": "eslint src tests --ext js --ext jsx",
|
|
20
20
|
"lint:fix": "npm run lint -- --fix",
|
|
21
|
-
"build": "
|
|
22
|
-
"watch": "
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"watch": "vite build --watch",
|
|
23
23
|
"precommit": "CI=1 npm run lint",
|
|
24
24
|
"prepush": "CI=1 npm run lint",
|
|
25
25
|
"prepublish": "npm run build",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"url": "https://github.com/ArcBlock/ux/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"core-js": "^3.25.5",
|
|
34
33
|
"event-target-shim": "^5.0.1",
|
|
35
34
|
"ismobilejs": "^1.1.1"
|
|
36
35
|
},
|
|
@@ -38,13 +37,8 @@
|
|
|
38
37
|
"access": "public"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@babel/preset-env": "^7.19.3",
|
|
44
|
-
"@babel/preset-react": "^7.18.6",
|
|
45
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
46
|
-
"jest": "^29.7.0",
|
|
47
|
-
"unbuild": "^2.0.0"
|
|
40
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
41
|
+
"jest": "^29.7.0"
|
|
48
42
|
},
|
|
49
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "36d86df0c9fd5fdf668fb3505492c830e437b3a5"
|
|
50
44
|
}
|
package/src/useLineClamp.ts
CHANGED
|
@@ -34,8 +34,8 @@ export default function useLineClamp({
|
|
|
34
34
|
key: getNewKey(),
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const textRef = useRef<HTMLElement | null>();
|
|
38
|
-
const buttonRef = useRef<HTMLElement | null>();
|
|
37
|
+
const textRef = useRef<HTMLElement | null>(undefined);
|
|
38
|
+
const buttonRef = useRef<HTMLElement | null>(undefined);
|
|
39
39
|
const lineHeightRef = useRef(0);
|
|
40
40
|
|
|
41
41
|
const clampLines = useMemoizedFn(({ lineHeight, originalText, expanded, ellipsis, lines }) => {
|
package/vite.config.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import noBundlePlugin from 'vite-plugin-no-bundle';
|
|
4
|
+
import fg from 'fast-glob';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [
|
|
8
|
+
react({ jsxRuntime: 'automatic' }),
|
|
9
|
+
noBundlePlugin({
|
|
10
|
+
root: 'src',
|
|
11
|
+
copy: ['**/*.png', '**/*.gif', '**/*.jpg', '**/*.jpeg', '**/*.d.ts'],
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
build: {
|
|
15
|
+
lib: {
|
|
16
|
+
entry: fg.sync('src/**/*.{tsx,ts,jsx,js}', {
|
|
17
|
+
ignore: ['**/stories/**', '**/demo/**', '**/*.d.ts', '**/*.stories.*'],
|
|
18
|
+
}),
|
|
19
|
+
formats: ['es'],
|
|
20
|
+
fileName: (format, entryName) => `${entryName}.js`,
|
|
21
|
+
},
|
|
22
|
+
outDir: 'lib',
|
|
23
|
+
emptyOutDir: true,
|
|
24
|
+
},
|
|
25
|
+
});
|
package/lib/index.d.ts
DELETED
package/lib/useBrowser.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export default function useBrowser(): {
|
|
2
|
-
wallet: boolean;
|
|
3
|
-
walletVersion: string | undefined;
|
|
4
|
-
arcSphere: boolean;
|
|
5
|
-
arcSphereVersion: string | undefined;
|
|
6
|
-
wechat: boolean;
|
|
7
|
-
mobile: {
|
|
8
|
-
apple: {
|
|
9
|
-
phone: boolean;
|
|
10
|
-
ipod: boolean;
|
|
11
|
-
tablet: boolean;
|
|
12
|
-
universal: boolean;
|
|
13
|
-
device: boolean;
|
|
14
|
-
};
|
|
15
|
-
amazon: {
|
|
16
|
-
phone: boolean;
|
|
17
|
-
tablet: boolean;
|
|
18
|
-
device: boolean;
|
|
19
|
-
};
|
|
20
|
-
android: {
|
|
21
|
-
phone: boolean;
|
|
22
|
-
tablet: boolean;
|
|
23
|
-
device: boolean;
|
|
24
|
-
};
|
|
25
|
-
windows: {
|
|
26
|
-
phone: boolean;
|
|
27
|
-
tablet: boolean;
|
|
28
|
-
device: boolean;
|
|
29
|
-
};
|
|
30
|
-
other: {
|
|
31
|
-
blackberry: boolean;
|
|
32
|
-
blackberry10: boolean;
|
|
33
|
-
opera: boolean;
|
|
34
|
-
firefox: boolean;
|
|
35
|
-
chrome: boolean;
|
|
36
|
-
device: boolean;
|
|
37
|
-
};
|
|
38
|
-
phone: boolean;
|
|
39
|
-
tablet: boolean;
|
|
40
|
-
any: boolean;
|
|
41
|
-
};
|
|
42
|
-
};
|
package/lib/useInterval.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useInterval(callback: any, delay: any): void;
|
package/lib/useLineClamp.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default function useLineClamp({ text, ellipsis, lines, expanded, debounceTime, charWidth, offset, }: {
|
|
2
|
-
text: string;
|
|
3
|
-
ellipsis?: string;
|
|
4
|
-
lines?: number;
|
|
5
|
-
expanded?: boolean;
|
|
6
|
-
debounceTime?: number;
|
|
7
|
-
charWidth?: number;
|
|
8
|
-
offset?: number;
|
|
9
|
-
}): {
|
|
10
|
-
textRef: import("react").MutableRefObject<HTMLElement | null | undefined>;
|
|
11
|
-
buttonRef: import("react").MutableRefObject<HTMLElement | null | undefined>;
|
|
12
|
-
needClamp: boolean;
|
|
13
|
-
noClamp: boolean;
|
|
14
|
-
clampedText: string;
|
|
15
|
-
key: string;
|
|
16
|
-
run: (this: unknown) => void;
|
|
17
|
-
};
|
package/lib/useStorage.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useStorage(storage: any, keyPrefix: any): (key: any, defaultValue: any) => any[];
|