@abtnode/ux 1.16.14-beta-a2de000a → 1.16.14
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.
|
@@ -4,6 +4,16 @@ import { isNull } from 'lodash';
|
|
|
4
4
|
import { useNodeContext } from '../contexts/node';
|
|
5
5
|
import useBackups from './use-backups';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {{
|
|
9
|
+
* appDid: string;
|
|
10
|
+
* meta: { did: string };
|
|
11
|
+
* message: string;
|
|
12
|
+
* progress: number;
|
|
13
|
+
* completed: boolean;
|
|
14
|
+
* }} EventData
|
|
15
|
+
*/
|
|
16
|
+
|
|
7
17
|
/**
|
|
8
18
|
* @description 实时显示备份的进度
|
|
9
19
|
* @param {{appDid: string}} {appDid}
|
|
@@ -26,10 +36,17 @@ function useBackupProgress({
|
|
|
26
36
|
useSubscription
|
|
27
37
|
}
|
|
28
38
|
} = node;
|
|
29
|
-
useSubscription(BlockletEvents.backupProgress,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
useSubscription(BlockletEvents.backupProgress,
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {EventData} data
|
|
43
|
+
*/
|
|
44
|
+
data => {
|
|
45
|
+
if (appDid === data?.appDid) {
|
|
46
|
+
setProgress(() => ({
|
|
47
|
+
...data
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
33
50
|
}, [appDid]);
|
|
34
51
|
useEffect(() => {
|
|
35
52
|
// @note: isNull(backups[0]?.status) 表示正在备份中...
|
|
@@ -15,6 +15,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
16
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
17
17
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {{
|
|
20
|
+
* appDid: string;
|
|
21
|
+
* meta: { did: string };
|
|
22
|
+
* message: string;
|
|
23
|
+
* progress: number;
|
|
24
|
+
* completed: boolean;
|
|
25
|
+
* }} EventData
|
|
26
|
+
*/
|
|
18
27
|
/**
|
|
19
28
|
* @description 实时显示备份的进度
|
|
20
29
|
* @param {{appDid: string}} {appDid}
|
|
@@ -38,8 +47,15 @@ function useBackupProgress(_ref) {
|
|
|
38
47
|
useSubscription
|
|
39
48
|
}
|
|
40
49
|
} = node;
|
|
41
|
-
useSubscription(_constant.BlockletEvents.backupProgress,
|
|
42
|
-
|
|
50
|
+
useSubscription(_constant.BlockletEvents.backupProgress,
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param {EventData} data
|
|
54
|
+
*/
|
|
55
|
+
data => {
|
|
56
|
+
if (appDid === (data === null || data === void 0 ? void 0 : data.appDid)) {
|
|
57
|
+
setProgress(() => _objectSpread({}, data));
|
|
58
|
+
}
|
|
43
59
|
}, [appDid]);
|
|
44
60
|
(0, _react.useEffect)(() => {
|
|
45
61
|
var _backups$;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.14
|
|
3
|
+
"version": "1.16.14",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.14
|
|
31
|
-
"@abtnode/constant": "1.16.14
|
|
32
|
-
"@abtnode/util": "1.16.14
|
|
30
|
+
"@abtnode/auth": "1.16.14",
|
|
31
|
+
"@abtnode/constant": "1.16.14",
|
|
32
|
+
"@abtnode/util": "1.16.14",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.89",
|
|
35
35
|
"@arcblock/did-connect": "^2.7.6",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@arcblock/react-hooks": "^2.7.6",
|
|
40
40
|
"@arcblock/terminal": "^2.7.6",
|
|
41
41
|
"@arcblock/ux": "^2.7.6",
|
|
42
|
-
"@blocklet/constant": "1.16.14
|
|
42
|
+
"@blocklet/constant": "1.16.14",
|
|
43
43
|
"@blocklet/launcher-layout": "2.1.93",
|
|
44
|
-
"@blocklet/list": "^0.12.
|
|
45
|
-
"@blocklet/meta": "1.16.14
|
|
44
|
+
"@blocklet/list": "^0.12.27",
|
|
45
|
+
"@blocklet/meta": "1.16.14",
|
|
46
46
|
"@blocklet/ui-react": "^2.7.6",
|
|
47
47
|
"@emotion/react": "^11.10.4",
|
|
48
48
|
"@emotion/styled": "^11.10.4",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
99
99
|
"glob": "^10.3.3"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "a2f588d8d5cbe9312260ffbd8fb4cb3bd4104853",
|
|
102
102
|
"exports": {
|
|
103
103
|
".": {
|
|
104
104
|
"import": "./es/index.js",
|