@blocklet/did-space-react 1.0.53 → 1.0.55

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,4 +4,4 @@ export interface PopupAuthProps {
4
4
  onClose?: () => void | Promise<void>;
5
5
  open?: boolean;
6
6
  }
7
- export declare function PopupAuth({ open, extraParams, onSuccess, onClose }: PopupAuthProps): null;
7
+ export declare function PopupAuth({ open, extraParams, onSuccess, onClose }: PopupAuthProps): any;
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  const useConnect = require('@arcblock/did-connect/lib/Connect/use-connect');
4
+ const jsSdk = require('@blocklet/js-sdk');
4
5
  const useLocale = require('../../hooks/use-locale.js');
5
6
  const constants = require('../../libs/constants.js');
6
7
  const env = require('../../libs/env.js');
7
8
 
8
9
  function PopupAuth({ open, extraParams, onSuccess, onClose }) {
9
10
  const { locale } = useLocale();
10
- const { connectApi } = useConnect();
11
+ const { connectApi, connectHolder } = useConnect();
11
12
  if (open) {
12
13
  const finalExtraParams = {
13
14
  appPid: window.blocklet?.appPid,
@@ -21,8 +22,11 @@ function PopupAuth({ open, extraParams, onSuccess, onClose }) {
21
22
  ...extraParams
22
23
  };
23
24
  const popupProps = {
24
- prefix: "/connect-to-did-space",
25
- custom: true,
25
+ popup: true,
26
+ action: "connect-to-did-space",
27
+ baseUrl: env.DID_SPACES_BASE_URL,
28
+ prefix: env.DID_CONNECT_PREFIX,
29
+ checkFn: jsSdk.createAxios({ baseURL: env.DID_SPACES_BASE_URL }).get,
26
30
  extraParams: {
27
31
  provider: "wallet",
28
32
  ...finalExtraParams,
@@ -39,11 +43,9 @@ function PopupAuth({ open, extraParams, onSuccess, onClose }) {
39
43
  }
40
44
  }
41
45
  };
42
- connectApi.openPopup(popupProps, {
43
- baseUrl: env.DID_SPACES_BASE_URL
44
- });
46
+ connectApi.open(popupProps);
45
47
  }
46
- return null;
48
+ return connectHolder;
47
49
  }
48
50
 
49
51
  exports.PopupAuth = PopupAuth;
@@ -1 +1,2 @@
1
1
  export declare const DID_SPACES_BASE_URL: any;
2
+ export declare const DID_CONNECT_PREFIX = "/space/api/did";
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const DID_SPACES_BASE_URL = window?.blocklet?.DID_SPACES_BASE_URL || "https://www.didspaces.com/app";
4
+ const DID_CONNECT_PREFIX = "/space/api/did";
4
5
 
6
+ exports.DID_CONNECT_PREFIX = DID_CONNECT_PREFIX;
5
7
  exports.DID_SPACES_BASE_URL = DID_SPACES_BASE_URL;
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "1.0.53";
3
+ const version = "1.0.55";
4
4
 
5
5
  exports.version = version;
@@ -4,4 +4,4 @@ export interface PopupAuthProps {
4
4
  onClose?: () => void | Promise<void>;
5
5
  open?: boolean;
6
6
  }
7
- export declare function PopupAuth({ open, extraParams, onSuccess, onClose }: PopupAuthProps): null;
7
+ export declare function PopupAuth({ open, extraParams, onSuccess, onClose }: PopupAuthProps): any;
@@ -1,11 +1,12 @@
1
1
  import useConnect from '@arcblock/did-connect/lib/Connect/use-connect';
2
+ import { createAxios } from '@blocklet/js-sdk';
2
3
  import useLocale from '../../hooks/use-locale.js';
3
4
  import { AUTHORIZE } from '../../libs/constants.js';
4
- import { DID_SPACES_BASE_URL } from '../../libs/env.js';
5
+ import { DID_SPACES_BASE_URL, DID_CONNECT_PREFIX } from '../../libs/env.js';
5
6
 
6
7
  function PopupAuth({ open, extraParams, onSuccess, onClose }) {
7
8
  const { locale } = useLocale();
8
- const { connectApi } = useConnect();
9
+ const { connectApi, connectHolder } = useConnect();
9
10
  if (open) {
10
11
  const finalExtraParams = {
11
12
  appPid: window.blocklet?.appPid,
@@ -19,8 +20,11 @@ function PopupAuth({ open, extraParams, onSuccess, onClose }) {
19
20
  ...extraParams
20
21
  };
21
22
  const popupProps = {
22
- prefix: "/connect-to-did-space",
23
- custom: true,
23
+ popup: true,
24
+ action: "connect-to-did-space",
25
+ baseUrl: DID_SPACES_BASE_URL,
26
+ prefix: DID_CONNECT_PREFIX,
27
+ checkFn: createAxios({ baseURL: DID_SPACES_BASE_URL }).get,
24
28
  extraParams: {
25
29
  provider: "wallet",
26
30
  ...finalExtraParams,
@@ -37,11 +41,9 @@ function PopupAuth({ open, extraParams, onSuccess, onClose }) {
37
41
  }
38
42
  }
39
43
  };
40
- connectApi.openPopup(popupProps, {
41
- baseUrl: DID_SPACES_BASE_URL
42
- });
44
+ connectApi.open(popupProps);
43
45
  }
44
- return null;
46
+ return connectHolder;
45
47
  }
46
48
 
47
49
  export { PopupAuth };
@@ -1 +1,2 @@
1
1
  export declare const DID_SPACES_BASE_URL: any;
2
+ export declare const DID_CONNECT_PREFIX = "/space/api/did";
@@ -1,3 +1,4 @@
1
1
  const DID_SPACES_BASE_URL = window?.blocklet?.DID_SPACES_BASE_URL || "https://www.didspaces.com/app";
2
+ const DID_CONNECT_PREFIX = "/space/api/did";
2
3
 
3
- export { DID_SPACES_BASE_URL };
4
+ export { DID_CONNECT_PREFIX, DID_SPACES_BASE_URL };
@@ -1,3 +1,3 @@
1
- const version = "1.0.53";
1
+ const version = "1.0.55";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/did-space-react",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "Reusable react components for did space",
5
5
  "keywords": [
6
6
  "react",
@@ -80,20 +80,20 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
- "@arcblock/did": "^1.20.8",
84
- "@did-space/core": "^1.0.53",
83
+ "@arcblock/did": "^1.20.11",
84
+ "@did-space/core": "^1.0.55",
85
85
  "@mui/icons-material": "^5.17.1",
86
86
  "@mui/lab": "^5.0.0-alpha.176",
87
87
  "@mui/material": "^5.17.1",
88
88
  "@mui/system": "^5.17.1",
89
- "ahooks": "^3.8.4",
89
+ "ahooks": "^3.8.5",
90
90
  "axios": "^1.9.0",
91
91
  "flat": "^5.0.2",
92
92
  "is-url": "^1.2.4",
93
93
  "lodash": "^4.17.21",
94
94
  "p-wait-for": "3",
95
95
  "react-error-boundary": "^4.1.2",
96
- "semver": "^7.7.1",
96
+ "semver": "^7.7.2",
97
97
  "timeago.js": "^4.0.2",
98
98
  "ufo": "^1.6.1",
99
99
  "xbytes": "^1.9.1"
@@ -109,9 +109,9 @@
109
109
  "access": "public"
110
110
  },
111
111
  "devDependencies": {
112
- "@arcblock/did-connect": "^2.13.29",
112
+ "@arcblock/did-connect": "^2.13.45",
113
113
  "@arcblock/eslint-config-ts": "^0.3.3",
114
- "@arcblock/ux": "^2.13.29",
114
+ "@arcblock/ux": "^2.13.45",
115
115
  "@babel/cli": "^7.27.2",
116
116
  "@babel/core": "^7.27.1",
117
117
  "@babel/preset-env": "^7.27.2",
@@ -128,10 +128,10 @@
128
128
  "@storybook/react-vite": "^7.6.20",
129
129
  "@storybook/test": "^7.6.20",
130
130
  "@svgr/rollup": "^8.1.0",
131
- "@types/react": "^18.3.21",
131
+ "@types/react": "^18.3.22",
132
132
  "@types/react-dom": "^18.3.7",
133
133
  "@vitejs/plugin-legacy": "^5.4.3",
134
- "@vitest/coverage-v8": "^3.1.3",
134
+ "@vitest/coverage-v8": "^3.1.4",
135
135
  "babel-plugin-inline-react-svg": "^2.0.2",
136
136
  "copyfiles": "^2.4.1",
137
137
  "eslint": "^8.57.1",
@@ -148,7 +148,7 @@
148
148
  "vite": "^5.4.19",
149
149
  "vite-plugin-babel": "^1.3.1",
150
150
  "vite-plugin-node-polyfills": "^0.22.0",
151
- "vitest": "^3.1.3"
151
+ "vitest": "^3.1.4"
152
152
  },
153
- "gitHead": "4613f96f8ad252146f9a8f4bf10c1e1a869364f9"
153
+ "gitHead": "759257e0bd0c7e91916693f73eaddcd01a4bed7e"
154
154
  }