@abtnode/ux 1.16.20-beta-cf6dfce1 → 1.16.20-beta-148929e2

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.
Files changed (183) hide show
  1. package/es/blocklet/access/index.js +1 -1
  2. package/es/blocklet/actions.js +0 -1
  3. package/es/blocklet/add-cert.js +24 -12
  4. package/es/blocklet/component/add-component-core.js +0 -1
  5. package/es/blocklet/component/did-space/connect-to.js +1 -1
  6. package/es/blocklet/component/domain-list.js +99 -87
  7. package/es/blocklet/component/index.js +7 -7
  8. package/es/blocklet/publish/tree.js +0 -1
  9. package/es/blocklet/router/add-domain.js +15 -9
  10. package/es/blocklet/router/dns-tip.js +5 -3
  11. package/es/clear-cache.js +1 -1
  12. package/es/hooks/use-space-gateways.js +1 -1
  13. package/es/locales/en.js +1 -1
  14. package/es/locales/index.js +4 -5
  15. package/es/locales/zh.js +1 -1
  16. package/lib/actions.js +2 -2
  17. package/lib/analytics/card.js +2 -2
  18. package/lib/analytics/chart.js +4 -4
  19. package/lib/analytics/disk.js +2 -2
  20. package/lib/analytics/runtime.js +2 -2
  21. package/lib/analytics/traffic.js +2 -2
  22. package/lib/blocklet/access/config-access.js +1 -2
  23. package/lib/blocklet/access/index.js +3 -3
  24. package/lib/blocklet/actions.js +2 -3
  25. package/lib/blocklet/add-cert.js +28 -16
  26. package/lib/blocklet/agreement-app.js +2 -2
  27. package/lib/blocklet/app-avatar.js +2 -2
  28. package/lib/blocklet/bundle-avatar.js +2 -2
  29. package/lib/blocklet/component/add-component-core.js +2 -3
  30. package/lib/blocklet/component/button.js +2 -2
  31. package/lib/blocklet/component/delete.js +2 -2
  32. package/lib/blocklet/component/did-space/connect-to.js +6 -7
  33. package/lib/blocklet/component/did-space/connected.js +1 -2
  34. package/lib/blocklet/component/did-space/delete.js +3 -4
  35. package/lib/blocklet/component/did-space/disconnect.js +3 -4
  36. package/lib/blocklet/component/did-space/index.js +3 -4
  37. package/lib/blocklet/component/did-space/item.js +5 -6
  38. package/lib/blocklet/component/domain-list.js +103 -90
  39. package/lib/blocklet/component/environment.js +2 -2
  40. package/lib/blocklet/component/index.js +11 -11
  41. package/lib/blocklet/component/navigation/locale-tabs.js +1 -2
  42. package/lib/blocklet/component/navigation/navigation-actions.js +1 -2
  43. package/lib/blocklet/component/navigation/navigation-dialog.js +3 -4
  44. package/lib/blocklet/component/navigation/navigation-preview.js +1 -2
  45. package/lib/blocklet/component/navigation/simple-select.js +3 -4
  46. package/lib/blocklet/component/select-store.js +2 -2
  47. package/lib/blocklet/component/setting.js +2 -2
  48. package/lib/blocklet/component/sortable-tree.js +3 -4
  49. package/lib/blocklet/component/space-connector.js +5 -6
  50. package/lib/blocklet/component/space-selector.js +5 -6
  51. package/lib/blocklet/component/store-blocklet-list.js +4 -4
  52. package/lib/blocklet/component/switch-control.js +3 -4
  53. package/lib/blocklet/config-navigation.js +3 -4
  54. package/lib/blocklet/configuration.js +4 -4
  55. package/lib/blocklet/disk-info.js +2 -2
  56. package/lib/blocklet/icons.js +2 -3
  57. package/lib/blocklet/install-from-url.js +2 -2
  58. package/lib/blocklet/log.js +2 -2
  59. package/lib/blocklet/logo-uploader.js +2 -2
  60. package/lib/blocklet/migration.js +2 -2
  61. package/lib/blocklet/mode.js +2 -2
  62. package/lib/blocklet/notification/email.js +3 -4
  63. package/lib/blocklet/notification/index.js +1 -2
  64. package/lib/blocklet/oauth/auth0.js +3 -4
  65. package/lib/blocklet/oauth/common-settings.js +2 -2
  66. package/lib/blocklet/oauth/federated-detail-dialog.js +1 -2
  67. package/lib/blocklet/oauth/federated-invite-dialog.js +1 -2
  68. package/lib/blocklet/oauth/federated-join-dialog.js +1 -2
  69. package/lib/blocklet/oauth/federated-site-list.js +1 -2
  70. package/lib/blocklet/oauth/index.js +1 -2
  71. package/lib/blocklet/overview.js +2 -2
  72. package/lib/blocklet/page-group.js +2 -2
  73. package/lib/blocklet/preferences/index.js +4 -4
  74. package/lib/blocklet/publish/create-project.js +2 -2
  75. package/lib/blocklet/publish/create-release.js +4 -4
  76. package/lib/blocklet/publish/index.js +2 -2
  77. package/lib/blocklet/publish/project-list.js +2 -2
  78. package/lib/blocklet/publish/release-list.js +2 -2
  79. package/lib/blocklet/publish/tree.js +0 -1
  80. package/lib/blocklet/purchase/common.js +2 -4
  81. package/lib/blocklet/purchase/component-purchase.js +3 -4
  82. package/lib/blocklet/resource-type.js +2 -2
  83. package/lib/blocklet/router/action/add-domain-alias.js +2 -2
  84. package/lib/blocklet/router/action/add-rule.js +4 -4
  85. package/lib/blocklet/router/action/config-routing-rule.js +4 -4
  86. package/lib/blocklet/router/action/update-rule.js +2 -2
  87. package/lib/blocklet/router/add-domain.js +21 -15
  88. package/lib/blocklet/router/dns-tip.js +7 -5
  89. package/lib/blocklet/router/rule-actions.js +2 -2
  90. package/lib/blocklet/router/rule-list.js +2 -2
  91. package/lib/blocklet/runtime-info.js +2 -2
  92. package/lib/blocklet/status.js +2 -2
  93. package/lib/blocklet/storage/action.js +5 -6
  94. package/lib/blocklet/storage/auto-backup.js +9 -10
  95. package/lib/blocklet/storage/backups.js +10 -11
  96. package/lib/blocklet/storage/connect-to.js +9 -10
  97. package/lib/blocklet/storage/connected.js +1 -2
  98. package/lib/blocklet/storage/delete.js +3 -4
  99. package/lib/blocklet/storage/disconnect.js +3 -4
  100. package/lib/blocklet/storage/index.js +1 -2
  101. package/lib/blocklet/storage/item.js +5 -6
  102. package/lib/blocklet/storage/preview-nft.js +5 -6
  103. package/lib/blocklet/types.js +2 -3
  104. package/lib/blocklet/util.js +4 -8
  105. package/lib/blocklet/version.js +2 -2
  106. package/lib/clear-cache.js +5 -5
  107. package/lib/click-to-copy.js +2 -2
  108. package/lib/confirm.js +2 -2
  109. package/lib/contexts/audit-log.js +1 -2
  110. package/lib/contexts/blocklet-storage.js +26 -27
  111. package/lib/contexts/blocklet.js +1 -2
  112. package/lib/contexts/config-space.js +1 -2
  113. package/lib/contexts/node.js +3 -4
  114. package/lib/contexts/team.js +1 -2
  115. package/lib/delete-confirm.js +2 -2
  116. package/lib/did-address.js +3 -4
  117. package/lib/dot.js +1 -2
  118. package/lib/empty-spinner.js +2 -2
  119. package/lib/exchange-passport.js +3 -4
  120. package/lib/form/form-select-input.js +4 -4
  121. package/lib/form/form-text-input.js +4 -4
  122. package/lib/form/form-wrapper.js +1 -2
  123. package/lib/form/required.js +1 -2
  124. package/lib/hooks/blocklet.js +2 -2
  125. package/lib/hooks/mobile-width.js +1 -2
  126. package/lib/hooks/url-evaluation.js +2 -2
  127. package/lib/hooks/use-backup-progress.js +4 -4
  128. package/lib/hooks/use-blocklet-info-for-connect-did-spaces.js +1 -2
  129. package/lib/hooks/use-navigation.js +2 -2
  130. package/lib/hooks/use-space-gateways.js +1 -1
  131. package/lib/images.js +2 -2
  132. package/lib/invitation/invitation-app.js +3 -4
  133. package/lib/invitation/invitation-login.js +1 -2
  134. package/lib/invitation/invitation-passport.js +1 -2
  135. package/lib/invitation/invitation-receive.js +3 -4
  136. package/lib/invitation/invitation-success.js +1 -2
  137. package/lib/invitation/invitation-user.js +1 -2
  138. package/lib/invitation/invitation.js +1 -2
  139. package/lib/issue-passport.js +1 -2
  140. package/lib/launch-blocklet/content-layout.js +2 -2
  141. package/lib/launch-blocklet/page-header.js +1 -2
  142. package/lib/layout/addon.js +2 -2
  143. package/lib/locales/en.js +5 -1
  144. package/lib/locales/index.js +8 -5
  145. package/lib/locales/zh.js +5 -1
  146. package/lib/logs/clock.js +1 -2
  147. package/lib/logs/log-terminal.js +3 -4
  148. package/lib/lost-passport.js +3 -4
  149. package/lib/nav-logo.js +2 -2
  150. package/lib/passport-tag.js +2 -2
  151. package/lib/permission.js +2 -2
  152. package/lib/relative-time.js +2 -2
  153. package/lib/result-message.js +1 -2
  154. package/lib/schema-form/common-prop-types.js +2 -3
  155. package/lib/schema-form/index.js +2 -2
  156. package/lib/schema-form/passport-input.js +2 -2
  157. package/lib/schema-form/text-input.js +2 -2
  158. package/lib/subscription.js +3 -4
  159. package/lib/table-icons.js +2 -3
  160. package/lib/table.js +1 -2
  161. package/lib/tag.js +2 -2
  162. package/lib/team/members/index.js +4 -4
  163. package/lib/team/members/member.js +2 -2
  164. package/lib/team/members/passport-item.js +2 -2
  165. package/lib/team/members/passports.js +4 -4
  166. package/lib/team/passports/color.js +2 -2
  167. package/lib/team/passports/detail.js +2 -2
  168. package/lib/team/passports/index.js +2 -2
  169. package/lib/team/passports/trusted-factories.js +4 -4
  170. package/lib/team/passports/trusted-factory.js +2 -2
  171. package/lib/team/passports/trusted-issuer.js +4 -4
  172. package/lib/team/passports/trusted-issuers.js +4 -4
  173. package/lib/team/search-input.js +3 -4
  174. package/lib/team/styles/dialog.js +1 -2
  175. package/lib/team/styles/list-header.js +1 -2
  176. package/lib/util/api.js +2 -4
  177. package/lib/util/constants.js +2 -4
  178. package/lib/util/index.js +11 -22
  179. package/lib/util/mode.js +1 -2
  180. package/lib/util/space-gateway.js +2 -2
  181. package/lib/who-can-access/config.js +2 -3
  182. package/lib/wrap-locale.js +2 -2
  183. package/package.json +16 -16
@@ -150,7 +150,7 @@ function ComponentItem({
150
150
  }, "actions")]
151
151
  }, "group-not-gateway-box"), /*#__PURE__*/_jsx(Line, {
152
152
  depth: depth
153
- }), blocklet.children?.length ? /*#__PURE__*/_jsx(Collapse, {
153
+ }, "line"), blocklet.children?.length ? /*#__PURE__*/_jsx(Collapse, {
154
154
  in: expand,
155
155
  children: blocklet.children.map(x => /*#__PURE__*/_jsx(ComponentItem, {
156
156
  blocklet: x,
@@ -125,7 +125,6 @@ export default function BlockletActions({
125
125
  } else {
126
126
  await sleep(1000); // just avoid user feeling so fast
127
127
  }
128
-
129
128
  if (action === 'reload') {
130
129
  Toast.success(t('blocklet.reloadSuccess'));
131
130
  }
@@ -5,9 +5,9 @@ import useAsyncRetry from 'react-use/lib/useAsyncRetry';
5
5
  import Tooltip from '@mui/material/Tooltip';
6
6
  import CircularProgress from '@mui/material/CircularProgress';
7
7
  import Alert from '@arcblock/ux/lib/Alert';
8
+ import Toast from '@arcblock/ux/lib/Toast';
8
9
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
9
10
  import { BlockletEvents } from '@blocklet/constant';
10
- import Toast from '@arcblock/ux/lib/Toast';
11
11
  import Confirm from '../confirm';
12
12
  import { useNodeContext } from '../contexts/node';
13
13
  import { useBlockletContext } from '../contexts/blocklet';
@@ -21,21 +21,26 @@ function Add(props) {
21
21
  t
22
22
  } = useLocaleContext();
23
23
  const [loading, setLoading] = useState(false);
24
+ const {
25
+ inService
26
+ } = useNodeContext();
24
27
  const [confirmSetting, setConfirmSetting] = useState(null);
25
28
  const {
29
+ siteId,
26
30
  domain,
27
31
  onAdd,
28
32
  children,
29
33
  did
30
34
  } = props;
35
+ const [issuing, setIssuing] = useState(false);
31
36
  const {
32
37
  api,
33
38
  ws: {
34
39
  useSubscription
35
40
  }
36
41
  } = useNodeContext();
37
- const [issuing, setIssuing] = useState(false);
38
42
  const {
43
+ mode,
39
44
  actions: {
40
45
  refreshDomainStatus
41
46
  }
@@ -54,18 +59,24 @@ function Add(props) {
54
59
  const handleIssueComplete = (cert, type) => {
55
60
  if (cert.domain === domain) {
56
61
  setIssuing(false);
57
- if (type === 'success') {
58
- Toast.success(`The ${cert.domain} certificate is issued successfully`);
59
- } else if (type === 'error') {
60
- Toast.error(`Failed to issue certificate for ${cert.domain}`);
62
+ setLoading(false);
63
+
64
+ // Setup 模式下有全局通知,所以这里不需要通知
65
+ if (inService && mode !== 'setup') {
66
+ if (type === 'success') {
67
+ Toast.success(`The ${cert.domain} certificate is issued successfully`);
68
+ } else if (type === 'error') {
69
+ Toast.error(`Failed to issue certificate for ${cert.domain}`);
70
+ }
61
71
  }
62
72
  }
63
73
  };
64
74
  useEffect(() => {
65
- if (!certState.loading && isCertInProgress(certState.value?.status)) {
66
- setIssuing(true);
75
+ if (certState.loading) {
76
+ return;
67
77
  }
68
- }, [certState]);
78
+ setIssuing(isCertInProgress(certState.value?.status));
79
+ }, [certState.loading, certState.value?.status]);
69
80
  useSubscription(BlockletEvents.certError, cert => handleIssueComplete(cert, 'error'));
70
81
  useSubscription(BlockletEvents.certIssued, cert => {
71
82
  certState.retry();
@@ -75,11 +86,9 @@ function Add(props) {
75
86
  if (certState.loading) {
76
87
  return ''; // 如果正在加载证书的状态,则不渲染任何元素
77
88
  }
78
-
79
89
  if (certState.value?.status === 'normal') {
80
90
  return ''; // 如果证书已经生成,则不渲染任何元素
81
91
  }
82
-
83
92
  const onCancel = () => {
84
93
  setLoading(false);
85
94
  setConfirmSetting(null);
@@ -89,8 +98,10 @@ function Add(props) {
89
98
  try {
90
99
  await api.issueLetsEncryptCert({
91
100
  input: {
101
+ siteId,
92
102
  domain,
93
- did
103
+ did,
104
+ inBlockletSetup: mode === 'setup'
94
105
  }
95
106
  });
96
107
  onAdd();
@@ -142,6 +153,7 @@ function Add(props) {
142
153
  Add.propTypes = {
143
154
  domain: PropTypes.string.isRequired,
144
155
  did: PropTypes.string.isRequired,
156
+ siteId: PropTypes.string.isRequired,
145
157
  onAdd: PropTypes.func,
146
158
  children: PropTypes.any
147
159
  };
@@ -746,7 +746,6 @@ export default function AddComponentCore({
746
746
  ...chooseParams,
747
747
  inStore: true // choose from store, must be inStore
748
748
  },
749
-
750
749
  isInit: true
751
750
  });
752
751
  },
@@ -12,7 +12,7 @@ import { func } from 'prop-types';
12
12
  import { PROD_DID_SPACES } from '@abtnode/constant';
13
13
  import useBlockletInfoForConnectDIDSpaces from '../../../hooks/use-blocklet-info-for-connect-did-spaces';
14
14
  import { extraDIDSpacesCoreUrl, getDIDSpaceDidFromEndpoint, getSpaceGatewayUrl, isValidSpaceGatewayUrl } from '../../../util/spaces';
15
- import { formatError, getWebWalletUrl } from '../../../../lib/util';
15
+ import { formatError, getWebWalletUrl } from '../../../util';
16
16
  import { useBlockletContext } from '../../../contexts/blocklet';
17
17
  import { useConfigSpaceContext } from '../../../contexts/config-space';
18
18
  import { useNodeContext } from '../../../contexts/node';
@@ -1,7 +1,7 @@
1
1
  import Button from '@arcblock/ux/lib/Button';
2
2
  import styled from '@emotion/styled';
3
3
  import PropTypes from 'prop-types';
4
- import React, { useMemo, useState } from 'react';
4
+ import React, { Fragment, useMemo, useState } from 'react';
5
5
  import AddIcon from '@mui/icons-material/Add';
6
6
  import DiamondIcon from '@mui/icons-material/Diamond';
7
7
  import ExpandLess from '@mui/icons-material/ExpandLess';
@@ -149,93 +149,102 @@ function DomainList({
149
149
  flexDirection: 'column',
150
150
  gap: 1
151
151
  },
152
- children: (showAllDomains ? domains : displayDomains).map(domain => /*#__PURE__*/_jsxs(_Fragment, {
153
- children: [isMobile && /*#__PURE__*/_jsxs(Box, {
154
- display: "flex",
155
- flexDirection: "column",
156
- children: [/*#__PURE__*/_jsx(Box, {
157
- display: "flex",
158
- alignItems: "center",
159
- justifyContent: "flex-start",
160
- children: /*#__PURE__*/_jsx(DomainLink, {
161
- domain: domain,
162
- target: "_blank",
163
- children: domain.value
164
- })
165
- }), /*#__PURE__*/_jsxs(Box, {
166
- display: "flex",
167
- alignItems: "center",
168
- justifyContent: "space-between",
169
- children: [/*#__PURE__*/_jsxs(Box, {
170
- sx: {
171
- display: 'flex',
172
- alignItems: 'center',
173
- justifyContent: 'flex-start',
174
- gap: 1
175
- },
176
- children: [/*#__PURE__*/_jsx(DomainStatus, {
177
- domain: domain,
178
- filters: ['domain']
179
- }, `${domain.value}-domain`), /*#__PURE__*/_jsx(InnerAddDomain, {
180
- domain: domain,
181
- blocklet: blocklet,
182
- hasMutatePermission: hasMutatePermission
152
+ children: (showAllDomains ? domains : displayDomains).map(domain => {
153
+ const key = domain.value;
154
+ return (
155
+ /*#__PURE__*/
156
+ // HACK: 必须给 Fragment 元素一个 key,否则会警告 key 的问题
157
+ _jsxs(Fragment, {
158
+ children: [isMobile && /*#__PURE__*/_jsxs(Box, {
159
+ display: "flex",
160
+ flexDirection: "column",
161
+ children: [/*#__PURE__*/_jsx(Box, {
162
+ display: "flex",
163
+ alignItems: "center",
164
+ justifyContent: "flex-start",
165
+ children: /*#__PURE__*/_jsx(DomainLink, {
166
+ domain: domain,
167
+ target: "_blank",
168
+ children: domain.value
169
+ })
170
+ }), /*#__PURE__*/_jsxs(Box, {
171
+ display: "flex",
172
+ alignItems: "center",
173
+ justifyContent: "space-between",
174
+ children: [/*#__PURE__*/_jsxs(Box, {
175
+ sx: {
176
+ display: 'flex',
177
+ alignItems: 'center',
178
+ justifyContent: 'flex-start',
179
+ gap: 1
180
+ },
181
+ children: [/*#__PURE__*/_jsx(DomainStatus, {
182
+ domain: domain,
183
+ filters: ['domain']
184
+ }, `${domain.value}-domain`), /*#__PURE__*/_jsx(InnerAddDomain, {
185
+ siteId: blocklet.site?.id,
186
+ domain: domain,
187
+ blocklet: blocklet,
188
+ hasMutatePermission: hasMutatePermission
189
+ })]
190
+ }), /*#__PURE__*/_jsx(Box, {
191
+ sx: {
192
+ button: {
193
+ padding: 0
194
+ }
195
+ },
196
+ children: /*#__PURE__*/_jsx(InnerAction, {
197
+ hasMutatePermission: hasMutatePermission,
198
+ site: site,
199
+ domain: domain,
200
+ blocklet: blocklet
201
+ })
202
+ })]
183
203
  })]
184
- }), /*#__PURE__*/_jsx(Box, {
185
- sx: {
186
- button: {
187
- padding: 0
188
- }
189
- },
190
- children: /*#__PURE__*/_jsx(InnerAction, {
191
- hasMutatePermission: hasMutatePermission,
192
- site: site,
193
- domain: domain,
194
- blocklet: blocklet
195
- })
196
- })]
197
- })]
198
- }, domain.value), !isMobile && /*#__PURE__*/_jsxs(Box, {
199
- display: "flex",
200
- alignItems: "center",
201
- justifyContent: "space-between",
202
- children: [/*#__PURE__*/_jsxs(Box, {
203
- display: "flex",
204
- alignItems: "center",
205
- justifyContent: "flex-start",
206
- children: [/*#__PURE__*/_jsx(DomainStatus, {
207
- domain: domain,
208
- filters: ['domain']
209
- }, `${domain.value}-domain`), /*#__PURE__*/_jsx(Box, {
210
- sx: {
211
- ml: 2,
212
- mr: 0.5
213
- },
214
- children: /*#__PURE__*/_jsx(DomainLink, {
215
- domain: domain,
216
- target: "_blank",
217
- children: domain.value
218
- })
219
- }), /*#__PURE__*/_jsx(InnerAddDomain, {
220
- domain: domain,
221
- blocklet: blocklet,
222
- hasMutatePermission: hasMutatePermission
223
- })]
224
- }), /*#__PURE__*/_jsx(Box, {
225
- sx: {
226
- button: {
227
- padding: 0
228
- }
229
- },
230
- children: /*#__PURE__*/_jsx(InnerAction, {
231
- hasMutatePermission: hasMutatePermission,
232
- site: site,
233
- domain: domain,
234
- blocklet: blocklet
235
- })
236
- })]
237
- }, domain.value)]
238
- }))
204
+ }, key), !isMobile && /*#__PURE__*/_jsxs(Box, {
205
+ display: "flex",
206
+ alignItems: "center",
207
+ justifyContent: "space-between",
208
+ children: [/*#__PURE__*/_jsxs(Box, {
209
+ display: "flex",
210
+ alignItems: "center",
211
+ justifyContent: "flex-start",
212
+ children: [/*#__PURE__*/_jsx(DomainStatus, {
213
+ domain: domain,
214
+ filters: ['domain']
215
+ }, `${domain.value}-domain`), /*#__PURE__*/_jsx(Box, {
216
+ sx: {
217
+ ml: 2,
218
+ mr: 0.5
219
+ },
220
+ children: /*#__PURE__*/_jsx(DomainLink, {
221
+ domain: domain,
222
+ target: "_blank",
223
+ children: domain.value
224
+ })
225
+ }), /*#__PURE__*/_jsx(InnerAddDomain, {
226
+ siteId: blocklet.site?.id,
227
+ domain: domain,
228
+ blocklet: blocklet,
229
+ hasMutatePermission: hasMutatePermission
230
+ })]
231
+ }), /*#__PURE__*/_jsx(Box, {
232
+ sx: {
233
+ button: {
234
+ padding: 0
235
+ }
236
+ },
237
+ children: /*#__PURE__*/_jsx(InnerAction, {
238
+ hasMutatePermission: hasMutatePermission,
239
+ site: site,
240
+ domain: domain,
241
+ blocklet: blocklet
242
+ })
243
+ })]
244
+ }, key)]
245
+ }, key)
246
+ );
247
+ })
239
248
  }), hiddenDomains.length > 0 && /*#__PURE__*/_jsx("div", {
240
249
  style: {
241
250
  marginLeft: '20px',
@@ -374,6 +383,7 @@ InnerAction.propTypes = {
374
383
  blocklet: PropTypes.object.isRequired
375
384
  };
376
385
  function InnerAddDomain({
386
+ siteId,
377
387
  domain,
378
388
  blocklet,
379
389
  hasMutatePermission
@@ -486,6 +496,7 @@ function InnerAddDomain({
486
496
  domain: domain,
487
497
  filters: ['http']
488
498
  }, `${domain.value}-http`), hasMutatePermission && /*#__PURE__*/_jsx(AddCert, {
499
+ siteId: siteId,
489
500
  domain: domain.value,
490
501
  domainStatus: domain.domainStatus,
491
502
  did: blocklet.meta.did,
@@ -503,6 +514,7 @@ function InnerAddDomain({
503
514
  });
504
515
  }
505
516
  InnerAddDomain.propTypes = {
517
+ siteId: PropTypes.string.isRequired,
506
518
  domain: DomainType.isRequired,
507
519
  blocklet: PropTypes.object.isRequired,
508
520
  hasMutatePermission: PropTypes.bool.isRequired
@@ -237,7 +237,7 @@ function ComponentItem({
237
237
  value: /*#__PURE__*/_jsx(Box, {
238
238
  children: blocklet.dependents.map(x => /*#__PURE__*/_jsx(Box, {
239
239
  children: `${getComponentName(x.id, app)} ${x.required ? `(${t('common.required')})` : ''}`
240
- }))
240
+ }, x.id))
241
241
  })
242
242
  } : null, blocklet.meta.resources?.length ? {
243
243
  name: t('common.resource'),
@@ -313,7 +313,7 @@ function ComponentItem({
313
313
  title: [`${t('common.dependents')}: `, blocklet.dependents.map(x => /*#__PURE__*/_jsx(Box, {
314
314
  pl: 1,
315
315
  children: `${getComponentName(x.id, app)} ${x.required ? `(${t('common.required')})` : ''}`
316
- }))],
316
+ }, x.id))],
317
317
  children: /*#__PURE__*/_jsx(Box, {
318
318
  display: "flex",
319
319
  color: "primary.main",
@@ -439,7 +439,7 @@ function ComponentItem({
439
439
  }, "actions")]
440
440
  }, "group-not-gateway-box"), /*#__PURE__*/_jsx(Line, {
441
441
  depth: 2
442
- }), !!componentInfo && /*#__PURE__*/_jsx(Dialog, {
442
+ }, "line"), !!componentInfo && /*#__PURE__*/_jsx(Dialog, {
443
443
  open: true,
444
444
  fullWidth: true,
445
445
  maxWidth: "md",
@@ -470,7 +470,7 @@ function ComponentItem({
470
470
  onCancel: () => setShowDeleteConfirm(false),
471
471
  hideBtn: true,
472
472
  showConfirm: showDeleteConfirm
473
- }), confirmSetting && /*#__PURE__*/_jsx(Confirm, {
473
+ }, "delete-component"), confirmSetting && /*#__PURE__*/_jsx(Confirm, {
474
474
  title: confirmSetting.title,
475
475
  description: confirmSetting.description,
476
476
  confirm: confirmSetting.confirm,
@@ -478,7 +478,7 @@ function ComponentItem({
478
478
  params: confirmSetting.params,
479
479
  onConfirm: confirmSetting.onConfirm,
480
480
  onCancel: confirmSetting.onCancel
481
- })];
481
+ }, "confirm-setting")];
482
482
  }
483
483
  ComponentItem.propTypes = {
484
484
  blocklet: PropTypes.object.isRequired,
@@ -830,7 +830,7 @@ export default function BlockletComponent({
830
830
  })]
831
831
  })
832
832
  })]
833
- }), components && components.length ? /*#__PURE__*/_jsxs(Box, {
833
+ }), components?.length ? /*#__PURE__*/_jsxs(Box, {
834
834
  mt: 2,
835
835
  ml: {
836
836
  xs: '-12px',
@@ -924,7 +924,7 @@ export default function BlockletComponent({
924
924
  })]
925
925
  })]
926
926
  }, `${x.name}-${x.newVersion}`)]
927
- }))
927
+ }, x.name))
928
928
  }), /*#__PURE__*/_jsxs(DialogActions, {
929
929
  style: {
930
930
  padding: '8px 24px 24px'
@@ -29,7 +29,6 @@ const bfsSearch = (graph, targetId) => {
29
29
  }
30
30
  return []; // Target node not found
31
31
  };
32
-
33
32
  function ResourceIcon({
34
33
  icon
35
34
  }) {
@@ -10,9 +10,8 @@ import trim from 'lodash/trim';
10
10
  import PropTypes from 'prop-types';
11
11
  import useSetState from 'react-use/lib/useSetState';
12
12
  import joinURL from 'url-join';
13
- import { validateDomain } from '../../../lib/util';
14
13
  import { useNodeContext } from '../../contexts/node';
15
- import { sleep } from '../../util';
14
+ import { sleep, validateDomain } from '../../util';
16
15
  import { axios } from '../../util/api';
17
16
  import DNSTip from './dns-tip';
18
17
  import { parseDomainFromURL } from './util';
@@ -30,6 +29,7 @@ export default function AddDomain({
30
29
  onSuccess,
31
30
  disabled,
32
31
  autoFocus,
32
+ inBlockletSetup,
33
33
  ...props
34
34
  }) {
35
35
  const {
@@ -56,14 +56,16 @@ export default function AddDomain({
56
56
  chainHost
57
57
  }) => {
58
58
  try {
59
+ const tmpDomain = parseDomainFromURL(domain);
59
60
  await api.addDomainAlias({
60
61
  input: {
61
62
  id: siteId,
62
63
  type: 'nft-domain',
63
- domainAlias: parseDomainFromURL(domain),
64
+ domainAlias: tmpDomain,
64
65
  nftDid,
65
66
  chainHost,
66
- teamDid
67
+ teamDid,
68
+ inBlockletSetup
67
69
  }
68
70
  });
69
71
  await sleep(2000);
@@ -72,8 +74,10 @@ export default function AddDomain({
72
74
  showNFTDomainAuth: false
73
75
  });
74
76
  onSuccess({
75
- domain,
76
- type: state.type
77
+ domain: tmpDomain,
78
+ type: state.type,
79
+ nftDid,
80
+ chainHost
77
81
  });
78
82
  } finally {
79
83
  setState({
@@ -215,7 +219,7 @@ export default function AddDomain({
215
219
  gap: '1em'
216
220
  },
217
221
  children: inputDomainTypes.map((type, index) => /*#__PURE__*/_jsxs(Box, {
218
- children: [/*#__PURE__*/_jsx(Box, {
222
+ children: [inputDomainTypes.length > 1 && /*#__PURE__*/_jsx(Box, {
219
223
  children: `${t(`optionsOrder.${index + 1}`)}: ${domainTypes[type]?.name}`
220
224
  }), /*#__PURE__*/_jsx(Box, {
221
225
  sx: {
@@ -237,7 +241,8 @@ AddDomain.propTypes = {
237
241
  appId: PropTypes.string,
238
242
  appPk: PropTypes.string,
239
243
  disabled: PropTypes.bool,
240
- autoFocus: PropTypes.bool
244
+ autoFocus: PropTypes.bool,
245
+ inBlockletSetup: PropTypes.bool
241
246
  };
242
247
  AddDomain.defaultProps = {
243
248
  defaultCustomDomain: '',
@@ -246,5 +251,6 @@ AddDomain.defaultProps = {
246
251
  appId: '',
247
252
  appPk: '',
248
253
  disabled: false,
249
- autoFocus: true
254
+ autoFocus: true,
255
+ inBlockletSetup: false
250
256
  };
@@ -78,11 +78,13 @@ function Tip({
78
78
  children: [/*#__PURE__*/_jsx(Typography, {
79
79
  component: "span",
80
80
  color: "primary.main",
81
- wordWrap: "break-word",
82
81
  overflow: "auto",
83
82
  sx: isMobile ? {
84
- maxWidth: '95%'
85
- } : {},
83
+ maxWidth: '95%',
84
+ wordWrap: 'break-word'
85
+ } : {
86
+ wordWrap: 'break-word'
87
+ },
86
88
  children: value
87
89
  }), /*#__PURE__*/_jsx(CopyButton, {
88
90
  content: value,
package/es/clear-cache.js CHANGED
@@ -3,7 +3,7 @@ import Toast from '@arcblock/ux/lib/Toast';
3
3
  import Button from '@arcblock/ux/lib/Button';
4
4
  import Spinner from '@mui/material/CircularProgress';
5
5
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
- import { formatError } from '../lib/util';
6
+ import { formatError } from './util';
7
7
  import { useNodeContext } from './contexts/node';
8
8
  import Confirm from './confirm';
9
9
 
@@ -3,7 +3,7 @@ import { useAsyncEffect } from 'ahooks';
3
3
  import toast from '@arcblock/ux/lib/Toast';
4
4
  import { useNodeContext } from '../contexts/node';
5
5
  import { updateSpaceGatewaysFromDIDSpaces } from '../util/space-gateway';
6
- import { formatError } from '../../lib/util';
6
+ import { formatError } from '../util';
7
7
  import { useBlockletContext } from '../contexts/blocklet';
8
8
 
9
9
  /**
package/es/locales/en.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  setup: {
3
3
  connect: {
4
4
  title: 'Signature Required',
@@ -1,9 +1,8 @@
1
+ /* eslint-disable import/prefer-default-export */
1
2
  const flat = require('flat');
2
3
  const en = require('./en');
3
4
  const zh = require('./zh');
4
- module.exports = {
5
- translations: {
6
- zh: flat(zh),
7
- en: flat(en)
8
- }
5
+ export const translations = {
6
+ zh: flat(zh),
7
+ en: flat(en)
9
8
  };
package/es/locales/zh.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  setup: {
3
3
  connect: {
4
4
  title: '扫码签名',
package/lib/actions.js CHANGED
@@ -19,8 +19,8 @@ const _excluded = ["actions", "size"],
19
19
  _excluded2 = ["icon", "text", "onClick", "disabled"];
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
24
  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; }
25
25
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
26
26
  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); }
@@ -14,8 +14,8 @@ var _jsxRuntime = require("react/jsx-runtime");
14
14
  var _templateObject;
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  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; }
20
20
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21
21
  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); }
@@ -11,10 +11,10 @@ var _Sparkline = _interopRequireDefault(require("@arcblock/ux/lib/Sparkline"));
11
11
  var _card = _interopRequireDefault(require("./card"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
18
  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; }
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
20
20
  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); }