@abtnode/ux 1.16.30 → 1.16.31-beta-4246ab25
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/blocklet/component/did-space/item.js +0 -1
- package/lib/blocklet/configuration.js +38 -1
- package/lib/blocklet/publish/create-release/header.js +1 -0
- package/lib/blocklet/publish/create-release/index.js +18 -12
- package/lib/blocklet/publish/utils/preserve-original-strings.js +11 -0
- package/lib/blocklet/storage/item.js +0 -1
- package/lib/blocklet/storage/preview-nft.js +35 -33
- package/lib/locales/en.js +7 -1
- package/lib/team/members/index.js +1 -1
- package/lib/team/members/member.js +11 -3
- package/package.json +21 -21
|
@@ -44,10 +44,11 @@ function BlockletEnvironment({
|
|
|
44
44
|
const {
|
|
45
45
|
t
|
|
46
46
|
} = useContext(LocaleContext);
|
|
47
|
-
const [loading, setLoading] = useState(
|
|
47
|
+
const [loading, setLoading] = useState(false);
|
|
48
48
|
const [showTransferOwner, setShowTransferOwner] = useState(false);
|
|
49
49
|
const whoCanAccess = getWhoCanAccess(blocklet);
|
|
50
50
|
const publicToStore = blocklet?.settings?.publicToStore;
|
|
51
|
+
const inviteEnabled = !!blocklet?.settings?.invite?.enabled;
|
|
51
52
|
const disabled = loading || !hasPermission;
|
|
52
53
|
const {
|
|
53
54
|
logoUrl,
|
|
@@ -171,6 +172,26 @@ function BlockletEnvironment({
|
|
|
171
172
|
};
|
|
172
173
|
const onDeletableChange = createBooleanConfigHandler('BLOCKLET_DELETABLE', checked => checked ? 'no' : 'yes');
|
|
173
174
|
const onTenantModeChange = createBooleanConfigHandler('BLOCKLET_APP_TENANT_MODE', checked => checked ? BLOCKLET_TENANT_MODES.MULTIPLE : BLOCKLET_TENANT_MODES.SINGLE);
|
|
175
|
+
const onChangeInviteSettings = async e => {
|
|
176
|
+
if (loading) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
setLoading(true);
|
|
180
|
+
try {
|
|
181
|
+
await api.updateInviteSettings({
|
|
182
|
+
input: {
|
|
183
|
+
did: blocklet.meta.did,
|
|
184
|
+
invite: {
|
|
185
|
+
enabled: e.target.checked
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
} catch (err) {
|
|
190
|
+
Toast.error(err.message);
|
|
191
|
+
} finally {
|
|
192
|
+
setLoading(false);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
174
195
|
const onUpdateCors = async value => {
|
|
175
196
|
const oldValue = site.corsAllowedOrigins || [];
|
|
176
197
|
const newValue = value.split(',').map(x => x.trim()).filter(Boolean);
|
|
@@ -493,6 +514,22 @@ function BlockletEnvironment({
|
|
|
493
514
|
onChange: onTenantModeChange
|
|
494
515
|
})]
|
|
495
516
|
})
|
|
517
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
518
|
+
className: "config-form",
|
|
519
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
520
|
+
className: "config-item",
|
|
521
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
522
|
+
className: "config-label",
|
|
523
|
+
children: [t('team.invite.setting'), /*#__PURE__*/_jsx(Box, {
|
|
524
|
+
className: "config-desc",
|
|
525
|
+
children: t(`team.invite.${inviteEnabled ? 'enabled' : 'disabled'}`)
|
|
526
|
+
})]
|
|
527
|
+
}), /*#__PURE__*/_jsx(Switch, {
|
|
528
|
+
disabled: disabled,
|
|
529
|
+
checked: inviteEnabled,
|
|
530
|
+
onChange: onChangeInviteSettings
|
|
531
|
+
})]
|
|
532
|
+
})
|
|
496
533
|
})]
|
|
497
534
|
})]
|
|
498
535
|
});
|
|
@@ -26,6 +26,7 @@ import ReleaseStepper from './release-stepper';
|
|
|
26
26
|
import ResourceUpload from './resource-upload';
|
|
27
27
|
import StopBox from './stop-box';
|
|
28
28
|
import Version from './version';
|
|
29
|
+
import preserveOriginalStrings from '../utils/preserve-original-strings';
|
|
29
30
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
31
|
const addComponentTabs = ({
|
|
31
32
|
tabs,
|
|
@@ -212,6 +213,7 @@ export default function CreateRelease({
|
|
|
212
213
|
Toast.error('Release not found');
|
|
213
214
|
return;
|
|
214
215
|
}
|
|
216
|
+
res.release = preserveOriginalStrings(res.release);
|
|
215
217
|
if (mode !== 'view') {
|
|
216
218
|
res.release.note = '';
|
|
217
219
|
}
|
|
@@ -245,7 +247,6 @@ export default function CreateRelease({
|
|
|
245
247
|
projectId
|
|
246
248
|
}
|
|
247
249
|
});
|
|
248
|
-
setLoading(false);
|
|
249
250
|
const data = res.project || {};
|
|
250
251
|
if (!data.blockletVersion) {
|
|
251
252
|
data.blockletVersion = '1.0.0';
|
|
@@ -258,24 +259,28 @@ export default function CreateRelease({
|
|
|
258
259
|
updateParamsByUrl();
|
|
259
260
|
}
|
|
260
261
|
} catch (err) {
|
|
261
|
-
setLoading(false);
|
|
262
262
|
Toast.error(formatError(err));
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
const getData = useCallback(async () => {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
setLoading(true);
|
|
267
|
+
try {
|
|
268
|
+
if (mode === 'view') {
|
|
269
|
+
if (!releaseId) {
|
|
270
|
+
Toast.error('Empty release id');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
await getProject();
|
|
274
|
+
await getRelease();
|
|
269
275
|
return;
|
|
270
276
|
}
|
|
271
277
|
await getProject();
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
await getRelease();
|
|
278
|
+
if (releaseId) {
|
|
279
|
+
setReleaseUsedLast(true);
|
|
280
|
+
await getRelease();
|
|
281
|
+
}
|
|
282
|
+
} finally {
|
|
283
|
+
setLoading(false);
|
|
279
284
|
}
|
|
280
285
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
286
|
}, [mode, releaseId]);
|
|
@@ -380,6 +385,7 @@ export default function CreateRelease({
|
|
|
380
385
|
flexDirection: isMobile ? 'column' : 'row',
|
|
381
386
|
children: [!isMobile && /*#__PURE__*/_jsx(ReleaseStepper, {
|
|
382
387
|
steps: steps,
|
|
388
|
+
loading: loading,
|
|
383
389
|
viewMode: mode === 'view',
|
|
384
390
|
params: params,
|
|
385
391
|
hasSelectedResources: hasSelectedResources || params.uploadedResource,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function preserveOriginalStrings(obj) {
|
|
2
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
3
|
+
for (const key in obj) {
|
|
4
|
+
if (typeof obj[key] === 'string') {
|
|
5
|
+
obj[key] = obj[key].replace(/\\\\/g, '\\');
|
|
6
|
+
} else if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
7
|
+
preserveOriginalStrings(obj[key]);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import ReactPlaceholder from 'react-placeholder';
|
|
4
3
|
import { string } from 'prop-types';
|
|
5
4
|
import { Dialog, DialogContent, IconButton } from '@mui/material';
|
|
6
5
|
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
|
|
@@ -204,39 +203,42 @@ EmptySpacesNFT.defaultProps = {
|
|
|
204
203
|
};
|
|
205
204
|
function PreviewSpaceNft({
|
|
206
205
|
src,
|
|
207
|
-
alt,
|
|
208
206
|
width,
|
|
209
207
|
height
|
|
210
208
|
}) {
|
|
211
|
-
const [showEmptySpaceNFT, setShowEmptySpaceNFT] = useState(false);
|
|
212
209
|
const [open, setOpen] = useState(false);
|
|
213
210
|
const handleOpen = () => setOpen(true);
|
|
214
211
|
const handleClose = () => setOpen(false);
|
|
215
212
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
216
|
-
children: [/*#__PURE__*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
_jsx("
|
|
222
|
-
|
|
223
|
-
cursor: 'pointer'
|
|
224
|
-
},
|
|
225
|
-
alt: alt,
|
|
226
|
-
src: src,
|
|
213
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
214
|
+
style: {
|
|
215
|
+
position: 'relative'
|
|
216
|
+
},
|
|
217
|
+
onClick: handleOpen,
|
|
218
|
+
children: [/*#__PURE__*/_jsx("object", {
|
|
219
|
+
data: src,
|
|
227
220
|
width: width,
|
|
228
221
|
height: height,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
222
|
+
children: /*#__PURE__*/_jsx(EmptySpacesNFT, {
|
|
223
|
+
viewBox: "0 0 228 258",
|
|
224
|
+
style: {
|
|
225
|
+
cursor: 'pointer',
|
|
226
|
+
width: '64px',
|
|
227
|
+
height: '64px'
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
233
231
|
style: {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
position: 'absolute',
|
|
233
|
+
top: 0,
|
|
234
|
+
left: 0,
|
|
235
|
+
width: '100%',
|
|
236
|
+
height: '100%',
|
|
237
|
+
zIndex: '1',
|
|
238
|
+
cursor: 'pointer'
|
|
237
239
|
},
|
|
238
240
|
onClick: handleOpen
|
|
239
|
-
})
|
|
241
|
+
})]
|
|
240
242
|
}), /*#__PURE__*/_jsx(Dialog, {
|
|
241
243
|
open: open,
|
|
242
244
|
onClose: handleClose,
|
|
@@ -260,27 +262,27 @@ function PreviewSpaceNft({
|
|
|
260
262
|
color: 'white'
|
|
261
263
|
},
|
|
262
264
|
children: /*#__PURE__*/_jsx(CloseOutlinedIcon, {})
|
|
263
|
-
}),
|
|
264
|
-
|
|
265
|
-
width: '100%',
|
|
266
|
-
height: '75vh'
|
|
267
|
-
}
|
|
268
|
-
}) : /*#__PURE__*/_jsx("img", {
|
|
269
|
-
src: src,
|
|
270
|
-
alt: "",
|
|
265
|
+
}), "(", /*#__PURE__*/_jsx("object", {
|
|
266
|
+
data: src,
|
|
271
267
|
style: {
|
|
272
268
|
width: '100%',
|
|
273
269
|
height: '75vh',
|
|
274
270
|
objectFit: 'contain'
|
|
275
|
-
}
|
|
276
|
-
|
|
271
|
+
},
|
|
272
|
+
children: /*#__PURE__*/_jsx(EmptySpacesNFT, {
|
|
273
|
+
viewBox: "0 0 228 258",
|
|
274
|
+
style: {
|
|
275
|
+
width: '100%',
|
|
276
|
+
height: '75vh'
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
}), ")"]
|
|
277
280
|
})
|
|
278
281
|
})]
|
|
279
282
|
});
|
|
280
283
|
}
|
|
281
284
|
PreviewSpaceNft.propTypes = {
|
|
282
285
|
src: string.isRequired,
|
|
283
|
-
alt: string.isRequired,
|
|
284
286
|
width: string,
|
|
285
287
|
height: string
|
|
286
288
|
};
|
package/lib/locales/en.js
CHANGED
|
@@ -1221,8 +1221,14 @@ export default {
|
|
|
1221
1221
|
title: 'Your Blocklet Server is up and running!'
|
|
1222
1222
|
},
|
|
1223
1223
|
team: {
|
|
1224
|
-
invite: 'Invite New',
|
|
1225
1224
|
add: 'Add New',
|
|
1225
|
+
invite: {
|
|
1226
|
+
action: 'Invite New',
|
|
1227
|
+
setting: 'Invite Settings',
|
|
1228
|
+
enabled: 'Allow any user to invite new user to this blocklet',
|
|
1229
|
+
disabled: 'Only owner/admin can invite new user to this blocklet',
|
|
1230
|
+
inviter: 'Invited By'
|
|
1231
|
+
},
|
|
1226
1232
|
member: {
|
|
1227
1233
|
name: 'Name',
|
|
1228
1234
|
passport: 'Passport',
|
|
@@ -148,10 +148,10 @@ export default function Member({
|
|
|
148
148
|
value: pageState.user.fullName
|
|
149
149
|
}, {
|
|
150
150
|
name: t('common.email'),
|
|
151
|
-
value: pageState.user.email
|
|
151
|
+
value: pageState.user.email || '-'
|
|
152
152
|
}, {
|
|
153
153
|
name: t('common.phone'),
|
|
154
|
-
value: pageState.user.phone
|
|
154
|
+
value: pageState.user.phone || '-'
|
|
155
155
|
}, {
|
|
156
156
|
name: t('team.member.source'),
|
|
157
157
|
value: /*#__PURE__*/_jsx(Box, {
|
|
@@ -173,7 +173,15 @@ export default function Member({
|
|
|
173
173
|
value: formatToDatetime(pageState.user.createdAt, locale)
|
|
174
174
|
}, {
|
|
175
175
|
name: t('common.remark'),
|
|
176
|
-
value: pageState.user.remark || '
|
|
176
|
+
value: pageState.user.remark || '-'
|
|
177
|
+
}, {
|
|
178
|
+
name: t('team.invite.inviter'),
|
|
179
|
+
value: pageState.user.inviter ? /*#__PURE__*/_jsx(DidAddress, {
|
|
180
|
+
compact: true,
|
|
181
|
+
responsive: true,
|
|
182
|
+
did: pageState.user.inviter,
|
|
183
|
+
showQrcode: true
|
|
184
|
+
}) : '-'
|
|
177
185
|
}, Array.isArray(pageState.user.tags) && pageState.user.tags.length > 0 ? {
|
|
178
186
|
name: t('common.tags'),
|
|
179
187
|
value: pageState.user.tags.map(x => /*#__PURE__*/_jsx(Tag, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.31-beta-4246ab25",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,25 +25,25 @@
|
|
|
25
25
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@abtnode/auth": "1.16.
|
|
29
|
-
"@abtnode/constant": "1.16.
|
|
30
|
-
"@abtnode/util": "1.16.
|
|
28
|
+
"@abtnode/auth": "1.16.31-beta-4246ab25",
|
|
29
|
+
"@abtnode/constant": "1.16.31-beta-4246ab25",
|
|
30
|
+
"@abtnode/util": "1.16.31-beta-4246ab25",
|
|
31
31
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
32
|
-
"@arcblock/did": "^1.18.
|
|
33
|
-
"@arcblock/did-connect": "^2.10.
|
|
32
|
+
"@arcblock/did": "^1.18.135",
|
|
33
|
+
"@arcblock/did-connect": "^2.10.27",
|
|
34
34
|
"@arcblock/did-motif": "^1.1.13",
|
|
35
|
-
"@arcblock/icons": "^2.10.
|
|
36
|
-
"@arcblock/nft-display": "2.10.
|
|
37
|
-
"@arcblock/react-hooks": "^2.10.
|
|
38
|
-
"@arcblock/terminal": "^2.10.
|
|
39
|
-
"@arcblock/ux": "^2.10.
|
|
40
|
-
"@blocklet/constant": "1.16.
|
|
41
|
-
"@blocklet/js-sdk": "1.16.
|
|
42
|
-
"@blocklet/launcher-layout": "2.10.
|
|
35
|
+
"@arcblock/icons": "^2.10.27",
|
|
36
|
+
"@arcblock/nft-display": "2.10.27",
|
|
37
|
+
"@arcblock/react-hooks": "^2.10.27",
|
|
38
|
+
"@arcblock/terminal": "^2.10.27",
|
|
39
|
+
"@arcblock/ux": "^2.10.27",
|
|
40
|
+
"@blocklet/constant": "1.16.31-beta-4246ab25",
|
|
41
|
+
"@blocklet/js-sdk": "1.16.31-beta-4246ab25",
|
|
42
|
+
"@blocklet/launcher-layout": "2.10.27",
|
|
43
43
|
"@blocklet/list": "^0.13.18",
|
|
44
|
-
"@blocklet/meta": "1.16.
|
|
45
|
-
"@blocklet/ui-react": "^2.10.
|
|
46
|
-
"@blocklet/uploader": "0.1.
|
|
44
|
+
"@blocklet/meta": "1.16.31-beta-4246ab25",
|
|
45
|
+
"@blocklet/ui-react": "^2.10.27",
|
|
46
|
+
"@blocklet/uploader": "0.1.28",
|
|
47
47
|
"@emotion/react": "^11.10.4",
|
|
48
48
|
"@emotion/styled": "^11.10.4",
|
|
49
49
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@mui/styles": "^5.15.11",
|
|
57
57
|
"@mui/x-date-pickers": "^6.19.0",
|
|
58
58
|
"@mui/x-tree-view": "^6.17.0",
|
|
59
|
-
"@ocap/client": "1.18.
|
|
59
|
+
"@ocap/client": "1.18.135",
|
|
60
60
|
"@uiw/react-markdown-preview": "^5.1.1",
|
|
61
61
|
"ahooks": "^3.7.8",
|
|
62
|
-
"axios": "^1.7.
|
|
62
|
+
"axios": "^1.7.5",
|
|
63
63
|
"classnames": "^2.3.2",
|
|
64
64
|
"copy-to-clipboard": "^3.3.3",
|
|
65
65
|
"date-fns": "^2.30.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"react-sortable-tree-theme-material-ui": "^1.0.16",
|
|
93
93
|
"react-use": "^17.4.0",
|
|
94
94
|
"rehype-external-links": "^3.0.0",
|
|
95
|
-
"semver": "^7.3
|
|
95
|
+
"semver": "^7.6.3",
|
|
96
96
|
"timeago.js": "^4.0.2",
|
|
97
97
|
"ufo": "^1.5.3",
|
|
98
98
|
"validator": "^13.9.0"
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"jest": "^29.7.0",
|
|
109
109
|
"jest-environment-jsdom": "^29.7.0"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "ef93705b89033e4cd5fed458b64521d0a994a1d0"
|
|
112
112
|
}
|