@abtnode/ux 1.16.25-next-bc2f4c63 → 1.16.25
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/es/blocklet/actions.js +11 -1
- package/es/blocklet/component/add-component-core.js +5 -0
- package/es/blocklet/component/component-cell.js +2 -1
- package/es/blocklet/icons.js +3 -1
- package/es/blocklet/overview.js +13 -7
- package/es/blocklet/publish/create-release.js +150 -43
- package/es/blocklet/publish/index.js +0 -4
- package/es/blocklet/publish/project-list.js +133 -29
- package/es/blocklet/publish/release-list.js +18 -4
- package/es/blocklet/publish/resource.js +35 -32
- package/es/blocklet/router/rule-list.js +2 -1
- package/es/locales/ar.js +13 -8
- package/es/locales/de.js +13 -8
- package/es/locales/en.js +12 -7
- package/es/locales/es.js +13 -8
- package/es/locales/fr.js +13 -8
- package/es/locales/hi.js +13 -8
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +13 -8
- package/es/locales/ja.js +13 -8
- package/es/locales/ko.js +13 -8
- package/es/locales/pt.js +13 -8
- package/es/locales/ru.js +13 -8
- package/es/locales/th.js +13 -8
- package/es/locales/vi.js +13 -8
- package/es/locales/zh-tw.js +13 -8
- package/es/locales/zh.js +17 -12
- package/es/team/members/connections.js +2 -1
- package/es/team/members/member.js +2 -1
- package/lib/blocklet/actions.js +14 -2
- package/lib/blocklet/component/add-component-core.js +1 -1
- package/lib/blocklet/component/component-cell.js +2 -1
- package/lib/blocklet/icons.js +3 -1
- package/lib/blocklet/overview.js +13 -7
- package/lib/blocklet/publish/create-release.js +154 -43
- package/lib/blocklet/publish/index.js +0 -4
- package/lib/blocklet/publish/project-list.js +133 -29
- package/lib/blocklet/publish/release-list.js +18 -4
- package/lib/blocklet/publish/resource.js +34 -31
- package/lib/blocklet/router/rule-list.js +2 -1
- package/lib/locales/ar.js +13 -8
- package/lib/locales/de.js +13 -8
- package/lib/locales/en.js +12 -7
- package/lib/locales/es.js +13 -8
- package/lib/locales/fr.js +13 -8
- package/lib/locales/hi.js +13 -8
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +13 -8
- package/lib/locales/ja.js +13 -8
- package/lib/locales/ko.js +13 -8
- package/lib/locales/pt.js +13 -8
- package/lib/locales/ru.js +13 -8
- package/lib/locales/th.js +13 -8
- package/lib/locales/vi.js +13 -8
- package/lib/locales/zh-tw.js +13 -8
- package/lib/locales/zh.js +17 -12
- package/lib/team/members/connections.js +2 -1
- package/lib/team/members/member.js +2 -1
- package/package.json +16 -16
- package/es/blocklet/publish/create-project.js +0 -205
- package/lib/blocklet/publish/create-project.js +0 -215
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Link, useNavigate, useParams } from 'react-router-dom';
|
|
3
|
-
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
|
4
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
5
|
-
import TextField from '@mui/material/TextField';
|
|
6
|
-
import Typography from '@mui/material/Typography';
|
|
7
|
-
import Breadcrumbs from '@mui/material/Breadcrumbs';
|
|
8
|
-
import InputAdornment from '@mui/material/InputAdornment';
|
|
9
|
-
import styled from '@emotion/styled';
|
|
10
|
-
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
11
|
-
import Box from '@mui/material/Box';
|
|
12
|
-
import Button from '@arcblock/ux/lib/Button';
|
|
13
|
-
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
14
|
-
import Toast from '@arcblock/ux/lib/Toast';
|
|
15
|
-
import { useNodeContext } from '../../contexts/node';
|
|
16
|
-
import { useBlockletContext } from '../../contexts/blocklet';
|
|
17
|
-
import { useSessionContext } from '../../contexts/session';
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
const Types = [{
|
|
20
|
-
label: {
|
|
21
|
-
en: 'Resource',
|
|
22
|
-
zh: '资源'
|
|
23
|
-
},
|
|
24
|
-
value: 'resource'
|
|
25
|
-
}, {
|
|
26
|
-
label: {
|
|
27
|
-
en: 'Application',
|
|
28
|
-
zh: '应用'
|
|
29
|
-
},
|
|
30
|
-
value: 'pack'
|
|
31
|
-
}];
|
|
32
|
-
export default function CreateProject({
|
|
33
|
-
...rest
|
|
34
|
-
}) {
|
|
35
|
-
const navigate = useNavigate();
|
|
36
|
-
const {
|
|
37
|
-
t,
|
|
38
|
-
locale
|
|
39
|
-
} = useLocaleContext();
|
|
40
|
-
const {
|
|
41
|
-
blocklet
|
|
42
|
-
} = useBlockletContext();
|
|
43
|
-
const [blockletTitle, setBlockletTitle] = useState('');
|
|
44
|
-
const [loading, setLoading] = useState(false);
|
|
45
|
-
const [type, setType] = useState('resource'); // resource, pack
|
|
46
|
-
const {
|
|
47
|
-
api: sessionApi
|
|
48
|
-
} = useSessionContext();
|
|
49
|
-
const {
|
|
50
|
-
api
|
|
51
|
-
} = useNodeContext();
|
|
52
|
-
const [blockletDid, setBlockletDid] = useState();
|
|
53
|
-
const [openConnect, setOpenConnect] = useState(false);
|
|
54
|
-
const [manualCreateBlockletDid] = useLocalStorage('manual-create-blocklet-did', false);
|
|
55
|
-
const {
|
|
56
|
-
componentDid = ''
|
|
57
|
-
} = useParams();
|
|
58
|
-
const handleCreateBlockletDidError = err => {
|
|
59
|
-
Toast.error(err.message);
|
|
60
|
-
setOpenConnect(false);
|
|
61
|
-
};
|
|
62
|
-
const handleCreateBlockletDidSuccess = result => {
|
|
63
|
-
const did = result?.blockletWallet?.address;
|
|
64
|
-
if (!did) {
|
|
65
|
-
Toast.error('Empty Blocklet DID');
|
|
66
|
-
} else {
|
|
67
|
-
setBlockletDid(did);
|
|
68
|
-
}
|
|
69
|
-
setOpenConnect(false);
|
|
70
|
-
};
|
|
71
|
-
const onCreate = () => {
|
|
72
|
-
if (!blockletDid) {
|
|
73
|
-
Toast.error(t('blocklet.publish.errorTip.noDid'));
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (!blockletTitle) {
|
|
77
|
-
Toast.error(t('blocklet.publish.errorTip.noTitle'));
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
setLoading(true);
|
|
81
|
-
api.createProject({
|
|
82
|
-
input: {
|
|
83
|
-
did: blocklet.meta.did,
|
|
84
|
-
blockletTitle: blockletTitle || '',
|
|
85
|
-
blockletDid,
|
|
86
|
-
type,
|
|
87
|
-
componentDid
|
|
88
|
-
}
|
|
89
|
-
}).then(() => {
|
|
90
|
-
setLoading(false);
|
|
91
|
-
navigate('../', {
|
|
92
|
-
replace: true
|
|
93
|
-
});
|
|
94
|
-
}).catch(err => {
|
|
95
|
-
setLoading(false);
|
|
96
|
-
Toast.error(err.message);
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
return /*#__PURE__*/_jsxs(Main, {
|
|
100
|
-
...rest,
|
|
101
|
-
children: [/*#__PURE__*/_jsxs(Breadcrumbs, {
|
|
102
|
-
className: "breadcrumbs",
|
|
103
|
-
"aria-label": "breadcrumb",
|
|
104
|
-
children: [/*#__PURE__*/_jsx(Link, {
|
|
105
|
-
to: "..",
|
|
106
|
-
children: t('common.publish')
|
|
107
|
-
}), /*#__PURE__*/_jsxs(Typography, {
|
|
108
|
-
color: "text.primary",
|
|
109
|
-
children: [t('common.create'), " Blocklet"]
|
|
110
|
-
})]
|
|
111
|
-
}), /*#__PURE__*/_jsxs(Box, {
|
|
112
|
-
style: {
|
|
113
|
-
maxWidth: 500
|
|
114
|
-
},
|
|
115
|
-
children: [/*#__PURE__*/_jsx(TextField, {
|
|
116
|
-
required: true,
|
|
117
|
-
sx: {
|
|
118
|
-
mb: 4
|
|
119
|
-
},
|
|
120
|
-
label: "Blocklet DID",
|
|
121
|
-
fullWidth: true,
|
|
122
|
-
readonly: true,
|
|
123
|
-
autoComplete: "off",
|
|
124
|
-
variant: "outlined",
|
|
125
|
-
onChange: e => manualCreateBlockletDid && setBlockletDid(e.target.value),
|
|
126
|
-
onClick: () => !manualCreateBlockletDid && !blockletDid && setOpenConnect(true),
|
|
127
|
-
InputProps: {
|
|
128
|
-
'data-cy': 'export-blocklet-did',
|
|
129
|
-
endAdornment: !manualCreateBlockletDid && /*#__PURE__*/_jsx(InputAdornment, {
|
|
130
|
-
position: "end",
|
|
131
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
132
|
-
onClick: () => setOpenConnect(true),
|
|
133
|
-
children: t(blockletDid ? 'common.update' : 'common.create')
|
|
134
|
-
})
|
|
135
|
-
})
|
|
136
|
-
},
|
|
137
|
-
helperText: "",
|
|
138
|
-
value: blockletDid || ''
|
|
139
|
-
}), openConnect && /*#__PURE__*/_jsx(DidConnect, {
|
|
140
|
-
open: true,
|
|
141
|
-
popup: true,
|
|
142
|
-
onClose: () => setOpenConnect(false),
|
|
143
|
-
action: "gen-blocklet-key-pair",
|
|
144
|
-
locale: locale,
|
|
145
|
-
checkFn: sessionApi.get,
|
|
146
|
-
saveConnect: false,
|
|
147
|
-
forceConnected: false,
|
|
148
|
-
checkTimeout: 5 * 60 * 1000,
|
|
149
|
-
onSuccess: handleCreateBlockletDidSuccess,
|
|
150
|
-
onError: handleCreateBlockletDidError,
|
|
151
|
-
extraParams: {
|
|
152
|
-
did: blocklet.meta.did
|
|
153
|
-
},
|
|
154
|
-
messages: {
|
|
155
|
-
title: t('blocklet.publish.connect.title'),
|
|
156
|
-
scan: t('blocklet.publish.connect.scan'),
|
|
157
|
-
confirm: t('blocklet.publish.connect.confirm'),
|
|
158
|
-
success: t('blocklet.publish.connect.success')
|
|
159
|
-
}
|
|
160
|
-
}), /*#__PURE__*/_jsx(TextField, {
|
|
161
|
-
required: true,
|
|
162
|
-
label: `Blocklet ${t('common.title')}`,
|
|
163
|
-
autoComplete: "off",
|
|
164
|
-
variant: "outlined",
|
|
165
|
-
InputProps: {
|
|
166
|
-
'data-cy': 'export-blocklet-title'
|
|
167
|
-
},
|
|
168
|
-
fullWidth: true,
|
|
169
|
-
helperText: "",
|
|
170
|
-
value: blockletTitle || '',
|
|
171
|
-
onChange: e => {
|
|
172
|
-
setBlockletTitle(e.target.value);
|
|
173
|
-
}
|
|
174
|
-
}), /*#__PURE__*/_jsx(TextField, {
|
|
175
|
-
sx: {
|
|
176
|
-
my: 4
|
|
177
|
-
},
|
|
178
|
-
id: "blocklet-type",
|
|
179
|
-
select: true,
|
|
180
|
-
label: `Blocklet ${t('common.type')}`,
|
|
181
|
-
helperText: "",
|
|
182
|
-
fullWidth: true,
|
|
183
|
-
value: type,
|
|
184
|
-
onChange: e => setType(e.target.value),
|
|
185
|
-
children: Types.map(x => /*#__PURE__*/_jsx(MenuItem, {
|
|
186
|
-
value: x.value,
|
|
187
|
-
disabled: x.disabled,
|
|
188
|
-
children: x.label[locale] || x.label.en
|
|
189
|
-
}, x.value))
|
|
190
|
-
})]
|
|
191
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
192
|
-
variant: "contained",
|
|
193
|
-
disabled: loading,
|
|
194
|
-
onClick: onCreate,
|
|
195
|
-
children: t('common.create')
|
|
196
|
-
})]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
CreateProject.propTypes = {};
|
|
200
|
-
CreateProject.defaultProps = {};
|
|
201
|
-
const Main = styled.div`
|
|
202
|
-
.breadcrumbs {
|
|
203
|
-
margin-bottom: 24px;
|
|
204
|
-
}
|
|
205
|
-
`;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = CreateProject;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactRouterDom = require("react-router-dom");
|
|
9
|
-
var _useLocalStorage = _interopRequireDefault(require("react-use/lib/useLocalStorage"));
|
|
10
|
-
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
11
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
12
|
-
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
13
|
-
var _Breadcrumbs = _interopRequireDefault(require("@mui/material/Breadcrumbs"));
|
|
14
|
-
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
15
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
16
|
-
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
17
|
-
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
18
|
-
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
19
|
-
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
20
|
-
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
21
|
-
var _node = require("../../contexts/node");
|
|
22
|
-
var _blocklet = require("../../contexts/blocklet");
|
|
23
|
-
var _session = require("../../contexts/session");
|
|
24
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
var _templateObject;
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
|
-
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; }
|
|
29
|
-
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; }
|
|
30
|
-
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; }
|
|
31
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
32
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
34
|
-
const Types = [{
|
|
35
|
-
label: {
|
|
36
|
-
en: 'Resource',
|
|
37
|
-
zh: '资源'
|
|
38
|
-
},
|
|
39
|
-
value: 'resource'
|
|
40
|
-
}, {
|
|
41
|
-
label: {
|
|
42
|
-
en: 'Application',
|
|
43
|
-
zh: '应用'
|
|
44
|
-
},
|
|
45
|
-
value: 'pack'
|
|
46
|
-
}];
|
|
47
|
-
function CreateProject(_ref) {
|
|
48
|
-
let rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
49
|
-
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
50
|
-
const {
|
|
51
|
-
t,
|
|
52
|
-
locale
|
|
53
|
-
} = (0, _context.useLocaleContext)();
|
|
54
|
-
const {
|
|
55
|
-
blocklet
|
|
56
|
-
} = (0, _blocklet.useBlockletContext)();
|
|
57
|
-
const [blockletTitle, setBlockletTitle] = (0, _react.useState)('');
|
|
58
|
-
const [loading, setLoading] = (0, _react.useState)(false);
|
|
59
|
-
const [type, setType] = (0, _react.useState)('resource'); // resource, pack
|
|
60
|
-
const {
|
|
61
|
-
api: sessionApi
|
|
62
|
-
} = (0, _session.useSessionContext)();
|
|
63
|
-
const {
|
|
64
|
-
api
|
|
65
|
-
} = (0, _node.useNodeContext)();
|
|
66
|
-
const [blockletDid, setBlockletDid] = (0, _react.useState)();
|
|
67
|
-
const [openConnect, setOpenConnect] = (0, _react.useState)(false);
|
|
68
|
-
const [manualCreateBlockletDid] = (0, _useLocalStorage.default)('manual-create-blocklet-did', false);
|
|
69
|
-
const {
|
|
70
|
-
componentDid = ''
|
|
71
|
-
} = (0, _reactRouterDom.useParams)();
|
|
72
|
-
const handleCreateBlockletDidError = err => {
|
|
73
|
-
_Toast.default.error(err.message);
|
|
74
|
-
setOpenConnect(false);
|
|
75
|
-
};
|
|
76
|
-
const handleCreateBlockletDidSuccess = result => {
|
|
77
|
-
var _result$blockletWalle;
|
|
78
|
-
const did = result === null || result === void 0 || (_result$blockletWalle = result.blockletWallet) === null || _result$blockletWalle === void 0 ? void 0 : _result$blockletWalle.address;
|
|
79
|
-
if (!did) {
|
|
80
|
-
_Toast.default.error('Empty Blocklet DID');
|
|
81
|
-
} else {
|
|
82
|
-
setBlockletDid(did);
|
|
83
|
-
}
|
|
84
|
-
setOpenConnect(false);
|
|
85
|
-
};
|
|
86
|
-
const onCreate = () => {
|
|
87
|
-
if (!blockletDid) {
|
|
88
|
-
_Toast.default.error(t('blocklet.publish.errorTip.noDid'));
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (!blockletTitle) {
|
|
92
|
-
_Toast.default.error(t('blocklet.publish.errorTip.noTitle'));
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
setLoading(true);
|
|
96
|
-
api.createProject({
|
|
97
|
-
input: {
|
|
98
|
-
did: blocklet.meta.did,
|
|
99
|
-
blockletTitle: blockletTitle || '',
|
|
100
|
-
blockletDid,
|
|
101
|
-
type,
|
|
102
|
-
componentDid
|
|
103
|
-
}
|
|
104
|
-
}).then(() => {
|
|
105
|
-
setLoading(false);
|
|
106
|
-
navigate('../', {
|
|
107
|
-
replace: true
|
|
108
|
-
});
|
|
109
|
-
}).catch(err => {
|
|
110
|
-
setLoading(false);
|
|
111
|
-
_Toast.default.error(err.message);
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Main, _objectSpread(_objectSpread({}, rest), {}, {
|
|
115
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Breadcrumbs.default, {
|
|
116
|
-
className: "breadcrumbs",
|
|
117
|
-
"aria-label": "breadcrumb",
|
|
118
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.Link, {
|
|
119
|
-
to: "..",
|
|
120
|
-
children: t('common.publish')
|
|
121
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
122
|
-
color: "text.primary",
|
|
123
|
-
children: [t('common.create'), " Blocklet"]
|
|
124
|
-
})]
|
|
125
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
126
|
-
style: {
|
|
127
|
-
maxWidth: 500
|
|
128
|
-
},
|
|
129
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
|
130
|
-
required: true,
|
|
131
|
-
sx: {
|
|
132
|
-
mb: 4
|
|
133
|
-
},
|
|
134
|
-
label: "Blocklet DID",
|
|
135
|
-
fullWidth: true,
|
|
136
|
-
readonly: true,
|
|
137
|
-
autoComplete: "off",
|
|
138
|
-
variant: "outlined",
|
|
139
|
-
onChange: e => manualCreateBlockletDid && setBlockletDid(e.target.value),
|
|
140
|
-
onClick: () => !manualCreateBlockletDid && !blockletDid && setOpenConnect(true),
|
|
141
|
-
InputProps: {
|
|
142
|
-
'data-cy': 'export-blocklet-did',
|
|
143
|
-
endAdornment: !manualCreateBlockletDid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputAdornment.default, {
|
|
144
|
-
position: "end",
|
|
145
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
146
|
-
onClick: () => setOpenConnect(true),
|
|
147
|
-
children: t(blockletDid ? 'common.update' : 'common.create')
|
|
148
|
-
})
|
|
149
|
-
})
|
|
150
|
-
},
|
|
151
|
-
helperText: "",
|
|
152
|
-
value: blockletDid || ''
|
|
153
|
-
}), openConnect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
154
|
-
open: true,
|
|
155
|
-
popup: true,
|
|
156
|
-
onClose: () => setOpenConnect(false),
|
|
157
|
-
action: "gen-blocklet-key-pair",
|
|
158
|
-
locale: locale,
|
|
159
|
-
checkFn: sessionApi.get,
|
|
160
|
-
saveConnect: false,
|
|
161
|
-
forceConnected: false,
|
|
162
|
-
checkTimeout: 5 * 60 * 1000,
|
|
163
|
-
onSuccess: handleCreateBlockletDidSuccess,
|
|
164
|
-
onError: handleCreateBlockletDidError,
|
|
165
|
-
extraParams: {
|
|
166
|
-
did: blocklet.meta.did
|
|
167
|
-
},
|
|
168
|
-
messages: {
|
|
169
|
-
title: t('blocklet.publish.connect.title'),
|
|
170
|
-
scan: t('blocklet.publish.connect.scan'),
|
|
171
|
-
confirm: t('blocklet.publish.connect.confirm'),
|
|
172
|
-
success: t('blocklet.publish.connect.success')
|
|
173
|
-
}
|
|
174
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
|
175
|
-
required: true,
|
|
176
|
-
label: "Blocklet ".concat(t('common.title')),
|
|
177
|
-
autoComplete: "off",
|
|
178
|
-
variant: "outlined",
|
|
179
|
-
InputProps: {
|
|
180
|
-
'data-cy': 'export-blocklet-title'
|
|
181
|
-
},
|
|
182
|
-
fullWidth: true,
|
|
183
|
-
helperText: "",
|
|
184
|
-
value: blockletTitle || '',
|
|
185
|
-
onChange: e => {
|
|
186
|
-
setBlockletTitle(e.target.value);
|
|
187
|
-
}
|
|
188
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
|
189
|
-
sx: {
|
|
190
|
-
my: 4
|
|
191
|
-
},
|
|
192
|
-
id: "blocklet-type",
|
|
193
|
-
select: true,
|
|
194
|
-
label: "Blocklet ".concat(t('common.type')),
|
|
195
|
-
helperText: "",
|
|
196
|
-
fullWidth: true,
|
|
197
|
-
value: type,
|
|
198
|
-
onChange: e => setType(e.target.value),
|
|
199
|
-
children: Types.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
200
|
-
value: x.value,
|
|
201
|
-
disabled: x.disabled,
|
|
202
|
-
children: x.label[locale] || x.label.en
|
|
203
|
-
}, x.value))
|
|
204
|
-
})]
|
|
205
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
206
|
-
variant: "contained",
|
|
207
|
-
disabled: loading,
|
|
208
|
-
onClick: onCreate,
|
|
209
|
-
children: t('common.create')
|
|
210
|
-
})]
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
CreateProject.propTypes = {};
|
|
214
|
-
CreateProject.defaultProps = {};
|
|
215
|
-
const Main = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .breadcrumbs {\n margin-bottom: 24px;\n }\n"])));
|