@abtnode/ux 1.16.26-beta-818ea1c5 → 1.16.26-beta-351de484

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 (81) hide show
  1. package/es/blocklet/{oauth → authentication/federated}/federated-detail-dialog.js +2 -2
  2. package/es/blocklet/{oauth → authentication/federated}/federated-join-dialog.js +2 -2
  3. package/es/blocklet/{oauth → authentication/federated}/federated-site-list.js +3 -3
  4. package/es/blocklet/{oauth/federated.js → authentication/federated/index.js} +1 -1
  5. package/es/blocklet/{oauth → authentication}/index.js +7 -5
  6. package/es/blocklet/authentication/oauth/apple.js +198 -0
  7. package/es/blocklet/{oauth → authentication/oauth}/auth0.js +27 -7
  8. package/es/blocklet/authentication/oauth/drag-item.js +177 -0
  9. package/es/blocklet/authentication/oauth/github.js +145 -0
  10. package/es/blocklet/authentication/oauth/google.js +144 -0
  11. package/es/blocklet/authentication/oauth/index.js +122 -0
  12. package/es/blocklet/preferences/index.js +6 -6
  13. package/es/blocklet/publish/connect-store-list.js +8 -6
  14. package/es/blocklet/publish/create-release.js +16 -7
  15. package/es/blocklet/publish/project-list.js +30 -3
  16. package/es/confirm.js +5 -2
  17. package/es/layout/feedback.js +7 -4
  18. package/es/locales/ar.js +34 -4
  19. package/es/locales/de.js +35 -5
  20. package/es/locales/en.js +34 -4
  21. package/es/locales/es.js +35 -5
  22. package/es/locales/fr.js +35 -5
  23. package/es/locales/hi.js +35 -5
  24. package/es/locales/i18n.db +0 -0
  25. package/es/locales/id.js +35 -5
  26. package/es/locales/ja.js +34 -4
  27. package/es/locales/ko.js +35 -5
  28. package/es/locales/pt.js +35 -5
  29. package/es/locales/ru.js +34 -4
  30. package/es/locales/th.js +34 -4
  31. package/es/locales/vi.js +34 -4
  32. package/es/locales/zh-tw.js +34 -4
  33. package/es/locales/zh.js +35 -5
  34. package/es/store/connect-actions.js +14 -5
  35. package/es/store/delete.js +7 -3
  36. package/es/store/item.js +99 -20
  37. package/es/team/members/index.js +16 -13
  38. package/es/team/members/member.js +2 -7
  39. package/lib/blocklet/{oauth → authentication/federated}/federated-detail-dialog.js +2 -2
  40. package/lib/blocklet/{oauth → authentication/federated}/federated-join-dialog.js +2 -2
  41. package/lib/blocklet/{oauth → authentication/federated}/federated-site-list.js +3 -3
  42. package/lib/blocklet/{oauth/federated.js → authentication/federated/index.js} +1 -1
  43. package/lib/blocklet/{oauth → authentication}/index.js +7 -5
  44. package/lib/blocklet/authentication/oauth/apple.js +226 -0
  45. package/lib/blocklet/authentication/oauth/auth0.js +189 -0
  46. package/lib/blocklet/authentication/oauth/drag-item.js +185 -0
  47. package/lib/blocklet/{oauth/auth0.js → authentication/oauth/github.js} +26 -25
  48. package/lib/blocklet/authentication/oauth/google.js +166 -0
  49. package/lib/blocklet/authentication/oauth/index.js +136 -0
  50. package/lib/blocklet/preferences/index.js +6 -6
  51. package/lib/blocklet/publish/connect-store-list.js +9 -8
  52. package/lib/blocklet/publish/create-release.js +16 -6
  53. package/lib/blocklet/publish/project-list.js +29 -2
  54. package/lib/confirm.js +7 -4
  55. package/lib/layout/feedback.js +6 -3
  56. package/lib/locales/ar.js +34 -4
  57. package/lib/locales/de.js +35 -5
  58. package/lib/locales/en.js +34 -4
  59. package/lib/locales/es.js +35 -5
  60. package/lib/locales/fr.js +35 -5
  61. package/lib/locales/hi.js +35 -5
  62. package/lib/locales/i18n.db +0 -0
  63. package/lib/locales/id.js +35 -5
  64. package/lib/locales/ja.js +34 -4
  65. package/lib/locales/ko.js +35 -5
  66. package/lib/locales/pt.js +35 -5
  67. package/lib/locales/ru.js +34 -4
  68. package/lib/locales/th.js +34 -4
  69. package/lib/locales/vi.js +34 -4
  70. package/lib/locales/zh-tw.js +34 -4
  71. package/lib/locales/zh.js +35 -5
  72. package/lib/store/connect-actions.js +14 -5
  73. package/lib/store/delete.js +7 -3
  74. package/lib/store/item.js +111 -19
  75. package/lib/team/members/index.js +13 -11
  76. package/lib/team/members/member.js +1 -6
  77. package/package.json +30 -20
  78. /package/es/blocklet/{oauth → authentication}/common-settings.js +0 -0
  79. /package/es/blocklet/{oauth → authentication/federated}/federated-invite-dialog.js +0 -0
  80. /package/lib/blocklet/{oauth → authentication}/common-settings.js +0 -0
  81. /package/lib/blocklet/{oauth → authentication/federated}/federated-invite-dialog.js +0 -0
@@ -0,0 +1,144 @@
1
+ import { Box, Button, FormControl, FormControlLabel, TextField } from '@mui/material';
2
+ import pick from 'lodash/pick';
3
+ import { useMemoizedFn } from 'ahooks';
4
+ import { Controller, useForm } from 'react-hook-form';
5
+ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
6
+ import Toast from '@arcblock/ux/lib/Toast';
7
+ import { useNodeContext } from '../../../contexts/node';
8
+ import { useBlockletContext } from '../../../contexts/blocklet';
9
+ import SwitchControl from '../../component/switch-control';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ function OAuthGoogle() {
12
+ const {
13
+ api
14
+ } = useNodeContext();
15
+ const {
16
+ blocklet
17
+ } = useBlockletContext();
18
+ const {
19
+ t
20
+ } = useLocaleContext();
21
+ const did = blocklet?.meta?.did;
22
+ const authData = Object.assign({
23
+ enabled: false,
24
+ clientId: '',
25
+ clientSecret: ''
26
+ }, blocklet?.settings?.oauth?.google || {});
27
+ const {
28
+ handleSubmit,
29
+ control,
30
+ formState,
31
+ watch,
32
+ reset
33
+ } = useForm({
34
+ defaultValues: pick(authData, ['clientSecret', 'clientId', 'enabled'])
35
+ });
36
+ const enabled = watch('enabled');
37
+ const onSubmit = useMemoizedFn(async data => {
38
+ try {
39
+ const {
40
+ blocklet: blockletChanged
41
+ } = await api.configOAuth({
42
+ input: {
43
+ did,
44
+ oauth: JSON.stringify({
45
+ google: data
46
+ })
47
+ }
48
+ });
49
+ const defaultValues = Object.assign({
50
+ enabled: false,
51
+ clientId: '',
52
+ clientSecret: ''
53
+ }, blockletChanged?.settings?.oauth?.google || {});
54
+ // 将当前表单的默认值重置为新的数据,这样能够修正页面的 isDirty 数据
55
+ reset(defaultValues);
56
+ Toast.success(t('oauth.saveSuccess'));
57
+ } catch (err) {
58
+ Toast.error(err.message || t('oauth.saveFailed'));
59
+ }
60
+ });
61
+ const validateClientId = useMemoizedFn(val => {
62
+ if (!val?.trim()) {
63
+ return t('oauth.google.clientIdDescribe');
64
+ }
65
+ return true;
66
+ });
67
+ const validateClientSecret = useMemoizedFn(val => {
68
+ if (!val?.trim()) {
69
+ return t('oauth.google.clientSecretDescribe');
70
+ }
71
+ return true;
72
+ });
73
+ const noop = useMemoizedFn(() => true);
74
+ return /*#__PURE__*/_jsx(Box, {
75
+ children: /*#__PURE__*/_jsxs("form", {
76
+ onSubmit: handleSubmit(onSubmit),
77
+ disabled: true,
78
+ children: [/*#__PURE__*/_jsx(Controller, {
79
+ name: "enabled",
80
+ control: control,
81
+ render: ({
82
+ field
83
+ }) => /*#__PURE__*/_jsx(FormControlLabel, {
84
+ control: /*#__PURE__*/_jsx(SwitchControl, {
85
+ checked: field.value,
86
+ style: {
87
+ marginRight: '6px'
88
+ },
89
+ ...field
90
+ }),
91
+ label: t('oauth.google.enable'),
92
+ sx: {
93
+ marginBottom: 2,
94
+ ml: 1
95
+ }
96
+ })
97
+ }), /*#__PURE__*/_jsx(Controller, {
98
+ name: "clientId",
99
+ control: control,
100
+ rules: {
101
+ validate: enabled ? validateClientId : noop
102
+ },
103
+ render: ({
104
+ field
105
+ }) => /*#__PURE__*/_jsx(FormControl, {
106
+ fullWidth: true,
107
+ children: /*#__PURE__*/_jsx(TextField, {
108
+ ...field,
109
+ error: !!formState.errors[field.name],
110
+ label: t('oauth.google.clientId'),
111
+ helperText: formState.errors[field.name]?.message || ' ',
112
+ disabled: !enabled
113
+ })
114
+ })
115
+ }), /*#__PURE__*/_jsx(Controller, {
116
+ name: "clientSecret",
117
+ control: control,
118
+ rules: {
119
+ validate: enabled ? validateClientSecret : noop
120
+ },
121
+ render: ({
122
+ field
123
+ }) => /*#__PURE__*/_jsx(FormControl, {
124
+ fullWidth: true,
125
+ children: /*#__PURE__*/_jsx(TextField, {
126
+ ...field,
127
+ type: "password",
128
+ label: t('oauth.google.clientSecret'),
129
+ error: !!formState.errors[field.name],
130
+ helperText: formState.errors[field.name]?.message || ' ',
131
+ disabled: !enabled
132
+ })
133
+ })
134
+ }), /*#__PURE__*/_jsx(Button, {
135
+ type: "submit",
136
+ variant: "contained",
137
+ onSubmit: handleSubmit(onSubmit),
138
+ disabled: !formState.isDirty,
139
+ children: t('oauth.save')
140
+ })]
141
+ })
142
+ });
143
+ }
144
+ export default OAuthGoogle;
@@ -0,0 +1,122 @@
1
+ import { Box } from '@mui/material';
2
+ import { useCreation, useMemoizedFn, useReactive } from 'ahooks';
3
+ import { DndProvider } from 'react-dnd';
4
+ import { HTML5Backend } from 'react-dnd-html5-backend';
5
+ import { Icon } from '@iconify/react';
6
+ import AppleIcon from '@iconify-icons/logos/apple';
7
+ import GithubIcon from '@iconify-icons/logos/github-icon';
8
+ import GoogleIcon from '@iconify-icons/logos/google-icon';
9
+ import Auth0Icon from '@iconify-icons/logos/auth0-icon';
10
+ import OAuthAuth0 from './auth0';
11
+ import OAuthGithub from './github';
12
+ import OAuthGoogle from './google';
13
+ import OAuthApple from './apple';
14
+ import DragItem from './drag-item';
15
+ import { useNodeContext } from '../../../contexts/node';
16
+ import { useBlockletContext } from '../../../contexts/blocklet';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ const avaliableAuthentication = [{
19
+ name: 'github',
20
+ title: 'GitHub',
21
+ icon: /*#__PURE__*/_jsx(Icon, {
22
+ icon: GithubIcon
23
+ }),
24
+ component: /*#__PURE__*/_jsx(OAuthGithub, {})
25
+ }, {
26
+ name: 'google',
27
+ title: 'Google',
28
+ icon: /*#__PURE__*/_jsx(Icon, {
29
+ icon: GoogleIcon
30
+ }),
31
+ component: /*#__PURE__*/_jsx(OAuthGoogle, {})
32
+ }, {
33
+ name: 'apple',
34
+ title: 'Apple',
35
+ icon: /*#__PURE__*/_jsx(Icon, {
36
+ icon: AppleIcon
37
+ }),
38
+ component: /*#__PURE__*/_jsx(OAuthApple, {})
39
+ }, {
40
+ name: 'auth0',
41
+ title: 'Auth0',
42
+ icon: /*#__PURE__*/_jsx(Icon, {
43
+ icon: Auth0Icon
44
+ }),
45
+ component: /*#__PURE__*/_jsx(OAuthAuth0, {})
46
+ }];
47
+ const DEFAULT_OAUTH_LIST = ['github', 'google', 'apple', 'auth0'];
48
+ export default function OAuthLogin() {
49
+ const {
50
+ api
51
+ } = useNodeContext();
52
+ const {
53
+ blocklet
54
+ } = useBlockletContext();
55
+ const did = blocklet?.meta?.did;
56
+ const oauthConfig = blocklet?.settings?.oauth || {};
57
+ const oauthSort = Object.keys(oauthConfig).sort((a, b) => {
58
+ if (oauthConfig[a]?.order !== undefined && oauthConfig[b]?.order !== undefined) {
59
+ return oauthConfig[a].order - oauthConfig[b].order;
60
+ }
61
+ if (oauthConfig[a]?.order !== undefined) {
62
+ return -1;
63
+ }
64
+ return 1;
65
+ });
66
+ for (const OAUTH_ITEM of DEFAULT_OAUTH_LIST) {
67
+ if (!oauthSort.includes(OAUTH_ITEM)) {
68
+ oauthSort.push(OAUTH_ITEM);
69
+ }
70
+ }
71
+ const sortMaps = useReactive(oauthSort.reduce((total, value, index) => Object.assign(total, {
72
+ [value]: index
73
+ }), {}));
74
+ const sortedAuthentication = useCreation(() => {
75
+ const list = [...avaliableAuthentication];
76
+ list.sort((a, b) => sortMaps[a.name] - sortMaps[b.name]);
77
+ return list;
78
+ }, [sortMaps.auth0, sortMaps.github, sortMaps.google]);
79
+ const dndProps = {};
80
+ if (typeof window !== 'undefined') {
81
+ dndProps.context = window;
82
+ }
83
+ const saveOrder = useMemoizedFn(async rawOrderData => {
84
+ const orderData = {};
85
+ Object.keys(rawOrderData).forEach(oauthName => {
86
+ orderData[oauthName] = {
87
+ order: rawOrderData[oauthName]
88
+ };
89
+ });
90
+ await api.configOAuth({
91
+ input: {
92
+ did,
93
+ oauth: JSON.stringify(orderData)
94
+ }
95
+ });
96
+ });
97
+ const handleMoveItem = useMemoizedFn((dragIndex, hoverIndex) => {
98
+ const dragItem = sortedAuthentication[dragIndex];
99
+ const hoverItem = sortedAuthentication[hoverIndex];
100
+ sortMaps[dragItem.name] = hoverIndex;
101
+ sortMaps[hoverItem.name] = dragIndex;
102
+ });
103
+ const handleSaveOrder = useMemoizedFn(async () => {
104
+ await saveOrder(sortMaps);
105
+ });
106
+ return /*#__PURE__*/_jsx(Box, {
107
+ children: /*#__PURE__*/_jsx(DndProvider, {
108
+ backend: HTML5Backend,
109
+ ...dndProps,
110
+ children: sortedAuthentication.map((x, index) => /*#__PURE__*/_jsx(DragItem, {
111
+ index: index,
112
+ id: x.name,
113
+ title: x.title,
114
+ icon: x.icon,
115
+ onMove: handleMoveItem,
116
+ onEnd: handleSaveOrder,
117
+ defaultExpand: x.enabled,
118
+ children: x.component
119
+ }, x.name))
120
+ })
121
+ });
122
+ }
@@ -22,7 +22,7 @@ import BlockletConfiguration from '../configuration';
22
22
  import BlockletNotification from '../notification';
23
23
  import Access from '../access/index';
24
24
  import { useNodeContext } from '../../contexts/node';
25
- import OAuth from '../oauth';
25
+ import Authentication from '../authentication';
26
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
27
  const addComponentTabs = ({
28
28
  tabs,
@@ -129,7 +129,7 @@ export default function BlockletPreferences({
129
129
  label: /*#__PURE__*/_jsxs(Box, {
130
130
  display: "flex",
131
131
  alignItems: "center",
132
- "data-cy": "configuration-tab-oauth",
132
+ "data-cy": "configuration-tab-authentication",
133
133
  children: [/*#__PURE__*/_jsx(LoginIcon, {
134
134
  sx: {
135
135
  fontSize: 24
@@ -143,8 +143,8 @@ export default function BlockletPreferences({
143
143
  children: t('common.login')
144
144
  })
145
145
  })]
146
- }, "oauth"),
147
- value: 'oauth'
146
+ }, "authentication"),
147
+ value: 'authentication'
148
148
  }, {
149
149
  label: /*#__PURE__*/_jsxs(Box, {
150
150
  display: "flex",
@@ -225,8 +225,8 @@ export default function BlockletPreferences({
225
225
  });
226
226
  } else if (current === 'access') {
227
227
  content = /*#__PURE__*/_jsx(Access, {});
228
- } else if (current === 'oauth') {
229
- content = /*#__PURE__*/_jsx(OAuth, {});
228
+ } else if (current === 'authentication') {
229
+ content = /*#__PURE__*/_jsx(Authentication, {});
230
230
  } else if (current === 'notification') {
231
231
  content = /*#__PURE__*/_jsx(BlockletNotification, {});
232
232
  } else {
@@ -7,6 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  function ConnectStoreList({
8
8
  blocklet,
9
9
  releaseId,
10
+ connectedStores,
10
11
  projectId,
11
12
  releaseType,
12
13
  publishedStoreIds,
@@ -15,14 +16,14 @@ function ConnectStoreList({
15
16
  }) {
16
17
  const storeList = blocklet?.settings?.storeList || [];
17
18
  const connectedMap = useMemo(() => {
18
- if (!blocklet?.settings?.connectedStores) {
19
+ if (!connectedStores?.length) {
19
20
  return {};
20
21
  }
21
- return blocklet?.settings?.connectedStores?.reduce((acc, x) => {
22
- acc[x.storeUrl] = x;
22
+ return connectedStores?.reduce((acc, x) => {
23
+ acc[x.storeId] = x;
23
24
  return acc;
24
25
  }, {});
25
- }, [blocklet?.settings?.connectedStores]);
26
+ }, [connectedStores]);
26
27
  const did = blocklet?.meta?.did;
27
28
  const handleAddStore = () => {};
28
29
  return /*#__PURE__*/_jsxs(List, {
@@ -37,7 +38,7 @@ function ConnectStoreList({
37
38
  teamDid: did,
38
39
  store: x,
39
40
  published: publishedStoreIds?.indexOf(x.id) > -1,
40
- connected: !!connectedMap[x.url],
41
+ connectedStore: connectedMap[x.id],
41
42
  onPublish: onPublish,
42
43
  onDelete: onDelete
43
44
  })
@@ -56,7 +57,8 @@ ConnectStoreList.propTypes = {
56
57
  releaseType: PropTypes.string.isRequired,
57
58
  onPublish: PropTypes.func,
58
59
  onDelete: PropTypes.func,
59
- publishedStoreIds: PropTypes.arrayOf(PropTypes.string)
60
+ publishedStoreIds: PropTypes.arrayOf(PropTypes.string),
61
+ connectedStores: PropTypes.arrayOf(PropTypes.object).isRequired
60
62
  };
61
63
  ConnectStoreList.defaultProps = {
62
64
  publishedStoreIds: [],
@@ -25,7 +25,7 @@ import Tabs from '@arcblock/ux/lib/Tabs';
25
25
  import Dialog from '@arcblock/ux/lib/Dialog';
26
26
  import Alert from '@arcblock/ux/lib/Alert';
27
27
  import { PROJECT } from '@blocklet/constant';
28
- import { WELLKNOWN_SERVICE_PATH_PREFIX, UNOWNED_DID } from '@abtnode/constant';
28
+ import { EVENTS, STUDIO_CONNECTED_STORE, WELLKNOWN_SERVICE_PATH_PREFIX, UNOWNED_DID } from '@abtnode/constant';
29
29
  import BlockletBundleAvatar from '../bundle-avatar';
30
30
  import { useSessionContext } from '../../contexts/session';
31
31
  import { useNodeContext } from '../../contexts/node';
@@ -108,9 +108,10 @@ const addComponentTabs = ({
108
108
  });
109
109
  };
110
110
  const pickParams = (release, app) => {
111
- const params = pick(release, ['blockletVersion', 'blockletTitle', 'blockletDescription', 'blockletLogo', 'blockletIntroduction', 'blockletScreenshots', 'blockletComponents', 'publishedStoreIds', 'note']);
111
+ const params = pick(release, ['blockletVersion', 'blockletTitle', 'blockletDescription', 'blockletLogo', 'blockletIntroduction', 'blockletScreenshots', 'blockletComponents', 'publishedStoreIds', 'connectedStores', 'note']);
112
112
  params.blockletScreenshots ||= [];
113
113
  params.publishedStoreIds ||= [];
114
+ params.connectedStores ||= [];
114
115
  if (!params.blockletComponents) {
115
116
  params.blockletComponents = (app.children || []).map(x => ({
116
117
  did: x.meta.did,
@@ -150,7 +151,10 @@ export default function CreateRelease({
150
151
  const [createLoading, setCreateLoading] = useState(false);
151
152
  const [release, setRelease] = useState(null);
152
153
  const {
153
- api
154
+ api,
155
+ ws: {
156
+ useSubscription
157
+ }
154
158
  } = useNodeContext();
155
159
  const uploaderLogoRef = useRef(null);
156
160
  const uploaderScreenshotRef = useRef(null);
@@ -217,7 +221,7 @@ export default function CreateRelease({
217
221
  }
218
222
  }).then(res => {
219
223
  setLoading(false);
220
- setParams(pickParams(res?.release, blocklet));
224
+ // setParams(pickParams(res?.release, blocklet));
221
225
  setRelease(res?.release);
222
226
  }).catch(err => {
223
227
  setLoading(false);
@@ -232,9 +236,7 @@ export default function CreateRelease({
232
236
  }
233
237
  getRelease();
234
238
  }
235
- if (mode === 'create') {
236
- getProject();
237
- }
239
+ getProject();
238
240
  // eslint-disable-next-line react-hooks/exhaustive-deps
239
241
  }, [mode, releaseId]);
240
242
  const onRelease = status => {
@@ -367,6 +369,11 @@ export default function CreateRelease({
367
369
  useEffect(() => {
368
370
  getData();
369
371
  }, [getData]);
372
+ useSubscription(EVENTS.NOTIFICATION_BLOCKLET_CREATE, notification => {
373
+ if (notification?.meta?.eventType === STUDIO_CONNECTED_STORE) {
374
+ getData();
375
+ }
376
+ }, [getData]);
370
377
  if (!params && loading) {
371
378
  return /*#__PURE__*/_jsx(EmptySpinner, {});
372
379
  }
@@ -951,6 +958,8 @@ export default function CreateRelease({
951
958
  projectId: projectId,
952
959
  releaseId: releaseId,
953
960
  onPublish: getRelease,
961
+ onDelete: getData,
962
+ connectedStores: params.connectedStores,
954
963
  publishedStoreIds: release?.publishedStoreIds
955
964
  })
956
965
  })]
@@ -10,6 +10,7 @@ import DeleteIcon from '@mui/icons-material/Delete';
10
10
  import VisibilityIcon from '@mui/icons-material/FileOpen';
11
11
  import NewFileIcon from '@mui/icons-material/AddBox';
12
12
  import HelpOutlineOutlinedIcon from '@mui/icons-material/HelpOutlineOutlined';
13
+ import ErrorIcon from '@mui/icons-material/Error';
13
14
  import { UNOWNED_DID } from '@abtnode/constant';
14
15
  import Datatable from '@arcblock/ux/lib/Datatable';
15
16
  import Button from '@arcblock/ux/lib/Button';
@@ -17,7 +18,7 @@ import Toast from '@arcblock/ux/lib/Toast';
17
18
  import Tag from '@arcblock/ux/lib/Tag';
18
19
  import RelativeTime from '@arcblock/ux/lib/RelativeTime';
19
20
  import DidConnect from '@arcblock/did-connect/lib/Connect';
20
- import { Tooltip } from '@mui/material';
21
+ import { Tooltip, Typography } from '@mui/material';
21
22
  import { useSessionContext } from '../../contexts/session';
22
23
  import { useBlockletContext } from '../../contexts/blocklet';
23
24
  import { useNodeContext } from '../../contexts/node';
@@ -357,10 +358,36 @@ export default function ProjectList() {
357
358
  }
358
359
  }), deleteConfirm && /*#__PURE__*/_jsx(Confirm, {
359
360
  title: `${t('common.delete')} ${deleteConfirm.blockletTitle}`,
360
- description: t('blocklet.publish.deleteBlockletTip'),
361
+ description: t('blocklet.publish.deleteProject.description'),
361
362
  confirm: t('common.confirm'),
362
363
  onConfirm: confirmDeleteProject,
363
- onCancel: () => setDeleteConfirm(null)
364
+ onCancel: () => setDeleteConfirm(null),
365
+ children: /*#__PURE__*/_jsx(Box, {
366
+ sx: {
367
+ marginTop: 2
368
+ },
369
+ children: [t('blocklet.publish.deleteProject.tip1'), t('blocklet.publish.deleteProject.tip2'), t('blocklet.publish.deleteProject.tip3')].map(x => /*#__PURE__*/_jsxs(Box, {
370
+ sx: {
371
+ display: 'flex',
372
+ marginTop: 1,
373
+ flexDirection: 'row',
374
+ alignItems: 'flex-start'
375
+ },
376
+ children: [/*#__PURE__*/_jsx(ErrorIcon, {
377
+ color: "warning",
378
+ sx: {
379
+ marginRight: 1,
380
+ fontSize: 20,
381
+ marginTop: '2px'
382
+ }
383
+ }), /*#__PURE__*/_jsx(Typography, {
384
+ component: "span",
385
+ variant: "inherit",
386
+ color: "text.secondary",
387
+ children: x
388
+ })]
389
+ }))
390
+ })
364
391
  }), didConnect]
365
392
  });
366
393
  }
package/es/confirm.js CHANGED
@@ -27,6 +27,7 @@ export default function ConfirmDialog({
27
27
  onConfirm,
28
28
  loading: inputLoading,
29
29
  displayError,
30
+ children,
30
31
  ...rest
31
32
  }) {
32
33
  const [params, setParams] = useState(initialParams);
@@ -89,7 +90,7 @@ export default function ConfirmDialog({
89
90
  marginTop: 8
90
91
  },
91
92
  children: error
92
- })]
93
+ }), children]
93
94
  }), /*#__PURE__*/_jsxs(DialogActions, {
94
95
  className: "delete-actions",
95
96
  style: {
@@ -138,9 +139,11 @@ ConfirmDialog.propTypes = {
138
139
  onCancel: PropTypes.func,
139
140
  onConfirm: PropTypes.func.isRequired,
140
141
  loading: PropTypes.bool,
141
- displayError: PropTypes.bool
142
+ displayError: PropTypes.bool,
143
+ children: PropTypes.any
142
144
  };
143
145
  ConfirmDialog.defaultProps = {
146
+ children: undefined,
144
147
  onCancel: () => {},
145
148
  showCancel: true,
146
149
  cancel: '',
@@ -10,15 +10,18 @@ export default function Feedback({
10
10
  const {
11
11
  t
12
12
  } = useLocaleContext();
13
+ const feedbackUrl = new URL('https://community.arcblock.io/discussions/add');
14
+ infos.forEach(x => {
15
+ feedbackUrl.searchParams.set(x.label, x.value);
16
+ });
13
17
  const infoStr = infos.map(x => `* ${x.label}: ${x.value}`).join('\n');
14
- const feedbackUrl = new URL('https://github.com/blocklet/blocklet-site/issues/new');
15
- feedbackUrl.searchParams.set('title', '[Feedback]');
16
- feedbackUrl.searchParams.set('body', `<!-- [Enter feedback here] -->
18
+ feedbackUrl.searchParams.set('report', 'server');
19
+ feedbackUrl.searchParams.set('context', `[Enter feedback here]
17
20
 
18
21
 
19
22
 
20
23
  <!--
21
- Document Details
24
+ [Server Info]
22
25
  ${infoStr}
23
26
  * Page: ${window.location.href}
24
27
  -->
package/es/locales/ar.js CHANGED
@@ -663,7 +663,6 @@ export default {
663
663
  blockletEmptyTip: 'لا توجد أي كتل هنا',
664
664
  createBlockletTip: 'يمكنك إنشاء وحدة جديدة من خلال الموارد والمكونات والتكوين الحالي في هذا التطبيق',
665
665
  createBlocklet: 'بلوكليت جديد',
666
- deleteBlockletTip: 'لا يمكن استعادة البلوكليت بعد الحذف ، يرجى التأكيد',
667
666
  componentNotRunning: 'المكون {name} غير قيد التشغيل ، يرجى تشغيله أولاً',
668
667
  releaseEmptyTip: 'لا توجد أي إصدارات هنا',
669
668
  createReleaseTip: 'يمكنك إنشاء إصدار للـ بلوكليت، جنباً إلى جنب مع ملاحظات الإصدار والموارد، ليستخدمها الآخرون.',
@@ -708,7 +707,11 @@ export default {
708
707
  title: 'احذف {name}',
709
708
  scan: 'امسح رمز الاستجابة السريعة أدناه لحذف {name}',
710
709
  confirm: 'يرجى تأكيد استخدام محفظة الهوية اللامركزية',
711
- success: 'تم حذف مشروع Blocklet ، يرجى متابعة العملية الخاصة بك.'
710
+ success: 'تم حذف مشروع Blocklet ، يرجى متابعة العملية الخاصة بك.',
711
+ tip1: 'لن يكون من الممكن استعادة مشروع Blocklet بعد الحذف',
712
+ tip2: 'لن تكون قادرًا بعد الآن على نشر إصدارات جديدة للبلوكليت المحذوف ، مما يعني أن البلوكليت لن يتم تحديثه في المتجر بعد الآن.',
713
+ tip3: 'سيؤدي حذف البلوكليت إلى ضرورة نشر الإصدار الحالي منه في المتجر.',
714
+ description: 'بعد حذف البلوكليت، ستواجه المشكلات التالية، هل أنت متأكد أنك تريد حذفه؟'
712
715
  }
713
716
  },
714
717
  titleValidationError: 'يجب أن يكون طول العنوان على الأقل 3 أحرف',
@@ -1685,12 +1688,39 @@ export default {
1685
1688
  domain: 'مجال',
1686
1689
  domainDescription: 'مطلوب نطاق Auth0',
1687
1690
  clientId: 'معرف العميل',
1688
- clientIdDescribe: 'مطلوب معرف عميل Auth0'
1691
+ clientIdDescribe: 'مطلوب معرف عميل Auth0',
1692
+ clientSecret: 'سر العميل'
1689
1693
  },
1690
1694
  comingSoon: 'تحت الإنشاء طرق تسجيل الدخول الأخرى.',
1691
1695
  moreLogin: 'تسجيل الدخول المزيد',
1692
1696
  federated: 'تسجيل الدخول الموحد',
1693
- runTest: 'اختبار'
1697
+ runTest: 'اختبار',
1698
+ github: {
1699
+ enable: 'تمكين تسجيل الدخول على Github',
1700
+ clientId: 'معرف العميل',
1701
+ clientIdDescribe: 'مطلوب معرف عميل (clientId) لتطبيق Github OAuth',
1702
+ clientSecret: 'سر العميل',
1703
+ clientSecretDescribe: 'مطلوب clientSecret لتطبيق Github OAuth'
1704
+ },
1705
+ google: {
1706
+ enable: 'تفعيل تسجيل الدخول في جوجل',
1707
+ clientId: 'معرف العميل',
1708
+ clientIdDescribe: 'مطلوب معرف تطبيق Google OAuth',
1709
+ clientSecret: 'سر العميل',
1710
+ clientSecretDescribe: 'مطلوب clientSecret لتطبيق Google OAuth'
1711
+ },
1712
+ apple: {
1713
+ enable: 'تفعيل تسجيل الدخول الخاص بـ آبل',
1714
+ teamId: 'رقم فريق',
1715
+ teamIdDescribe: 'مطلوب معرف فريق لتطبيق Apple OAuth',
1716
+ serviceId: 'رقم الخدمة',
1717
+ serviceIdDescribe: 'مطلوب معرف خدمة لتطبيق Apple OAuth',
1718
+ keyId: 'مفتاح ID',
1719
+ keyIdDescribe: 'مطلوب مفتاح تطبيق OAuth لأبل',
1720
+ authKey: 'مفتاح Auth',
1721
+ authKeyDescribe: 'مفتاح المصادقة لتطبيق Apple OAuth مطلوب'
1722
+ },
1723
+ oauth: 'تسجيل الدخول من طرف ثالث'
1694
1724
  },
1695
1725
  expiration: {
1696
1726
  mobile: {
package/es/locales/de.js CHANGED
@@ -663,7 +663,6 @@ export default {
663
663
  blockletEmptyTip: 'Es gibt hier keine Blocklets',
664
664
  createBlockletTip: 'Sie können über vorhandene Ressourcen, Komponenten und Konfigurationen in dieser Anwendung einen neuen Blocklet erstellen',
665
665
  createBlocklet: 'Neuer Blocklet',
666
- deleteBlockletTip: 'Der Blocklet kann nach dem Löschen nicht wiederhergestellt werden, bitte bestätigen',
667
666
  componentNotRunning: 'Komponente {name} läuft nicht, starten Sie sie bitte zuerst',
668
667
  releaseEmptyTip: 'Es gibt hier keine Veröffentlichungen',
669
668
  createReleaseTip: 'Du kannst eine Veröffentlichung des Blocklets erstellen, zusammen mit Versionshinweisen und Ressourcen, die andere Personen nutzen können.',
@@ -708,7 +707,11 @@ export default {
708
707
  title: 'Lösche {name}',
709
708
  scan: 'Scanne den QR-Code unten, um {name} zu löschen',
710
709
  confirm: 'Bitte bestätigen Sie die Verwendung der DID-Brieftasche',
711
- success: 'Das Blocklet-Projekt wurde gelöscht, bitte fahren Sie mit Ihrer Operation fort.'
710
+ success: 'Das Blocklet-Projekt wurde gelöscht, bitte fahren Sie mit Ihrer Operation fort.',
711
+ tip1: 'Das Blocklet-Projekt kann nach der Löschung nicht wiederhergestellt werden',
712
+ tip2: 'Sie können keine neuen Versionen mehr für den gelöschten Blocklet veröffentlichen, was bedeutet, dass das Blocklet nicht mehr im Store aktualisiert wird.',
713
+ tip3: 'Das Löschen des Blocklets hat keine Auswirkungen auf seine derzeit veröffentlichte Version im Store.',
714
+ description: 'Nach dem Löschen der Blocklet werden Sie auf die folgenden Probleme stoßen. Sind Sie sicher, dass Sie es löschen möchten?'
712
715
  }
713
716
  },
714
717
  titleValidationError: 'Die Länge des Titels muss mindestens 3 Zeichen betragen',
@@ -1684,13 +1687,40 @@ export default {
1684
1687
  enable: 'Auth0-Anmeldung aktivieren',
1685
1688
  domain: 'Domain',
1686
1689
  domainDescription: 'Die Domäne von Auth0 ist erforderlich',
1687
- clientId: 'Kundennummer',
1688
- clientIdDescribe: 'Die clientId von Auth0 ist erforderlich'
1690
+ clientId: 'Kunden-ID',
1691
+ clientIdDescribe: 'Die clientId von Auth0 ist erforderlich',
1692
+ clientSecret: 'Geheimclient'
1689
1693
  },
1690
1694
  comingSoon: 'Es werden weitere Anmeldeverfahren entwickelt.',
1691
1695
  moreLogin: 'Mehr Anmeldung',
1692
1696
  federated: 'Föderiertes Login',
1693
- runTest: 'Test'
1697
+ runTest: 'Test',
1698
+ github: {
1699
+ enable: 'Aktiviere Github-Anmeldung',
1700
+ clientId: 'Client ID',
1701
+ clientIdDescribe: 'Für die Github OAuth-Anwendung ist eine clientId erforderlich',
1702
+ clientSecret: 'Client Secret',
1703
+ clientSecretDescribe: 'Für die Github OAuth-Anwendung ist ein clientSecret erforderlich'
1704
+ },
1705
+ google: {
1706
+ enable: 'Google-Anmeldung aktivieren',
1707
+ clientId: 'Client ID',
1708
+ clientIdDescribe: 'Für die Google OAuth-Anwendung ist die Client-ID erforderlich',
1709
+ clientSecret: 'Geheimnis des Kunden',
1710
+ clientSecretDescribe: 'Für die Google OAuth-Anwendung ist ein clientSecret erforderlich'
1711
+ },
1712
+ apple: {
1713
+ enable: 'Anmeldung mit Apple aktivieren',
1714
+ teamId: 'Team-ID',
1715
+ teamIdDescribe: 'Für die Apple OAuth-Anwendung ist eine Team-ID erforderlich',
1716
+ serviceId: 'Service-ID',
1717
+ serviceIdDescribe: 'Für die Apple OAuth-Anwendung ist eine Dienst-ID erforderlich',
1718
+ keyId: 'Schlüssel-ID',
1719
+ keyIdDescribe: 'Für Apple OAuth ist eine Anwendungsschlüssel-ID erforderlich',
1720
+ authKey: 'Auth Schlüssel',
1721
+ authKeyDescribe: 'Authentifizierungsschlüssel für Apple OAuth-Anwendung erforderlich'
1722
+ },
1723
+ oauth: 'Drittanbieter-Anmeldung'
1694
1724
  },
1695
1725
  expiration: {
1696
1726
  mobile: {