@abtnode/ux 1.16.27-beta-74c4e335 → 1.16.27-beta-4022dde0
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/add-component/add-component-core.js +4 -5
- package/lib/blocklet/component/add-component/step-connect.js +8 -0
- package/lib/blocklet/publish/{select-components.js → create-release/blocklets.js} +41 -20
- package/lib/blocklet/publish/create-release/branding.js +390 -0
- package/lib/blocklet/publish/{connect-store-list.js → create-release/connect-store-list.js} +2 -2
- package/lib/blocklet/publish/create-release/header.js +407 -0
- package/lib/blocklet/publish/create-release/index.js +575 -0
- package/lib/blocklet/publish/create-release/introduction-preview.js +28 -0
- package/lib/blocklet/publish/create-release/introduction.js +109 -0
- package/lib/blocklet/publish/create-release/release-stepper.js +161 -0
- package/lib/blocklet/publish/{resource.js → create-release/resources.js} +37 -21
- package/lib/blocklet/publish/create-release/step-icon.js +63 -0
- package/lib/blocklet/publish/{stop-box.js → create-release/stop-box.js} +13 -6
- package/lib/blocklet/publish/{tree.js → create-release/tree.js} +1 -1
- package/lib/blocklet/publish/create-release/version.js +93 -0
- package/lib/blocklet/publish/index.js +1 -1
- package/lib/blocklet/publish/project-list.js +3 -3
- package/lib/blocklet/publish/release-list.js +2 -2
- package/lib/blocklet/publish/utils/validate-params.js +92 -0
- package/lib/blocklet/router/add-domain.js +3 -2
- package/lib/hooks/use-bundle-logo.js +3 -2
- package/lib/layout/addon.js +3 -17
- package/lib/locales/ar.js +16 -2
- package/lib/locales/de.js +16 -2
- package/lib/locales/en.js +13 -0
- package/lib/locales/es.js +16 -2
- package/lib/locales/fr.js +16 -2
- package/lib/locales/hi.js +16 -2
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +16 -2
- package/lib/locales/ja.js +16 -2
- package/lib/locales/ko.js +16 -2
- package/lib/locales/pt.js +16 -2
- package/lib/locales/ru.js +16 -2
- package/lib/locales/th.js +16 -2
- package/lib/locales/vi.js +16 -2
- package/lib/locales/zh-tw.js +16 -2
- package/lib/locales/zh.js +16 -2
- package/lib/util/index.js +7 -5
- package/package.json +18 -18
- package/lib/blocklet/publish/create-release.js +0 -1207
- /package/lib/blocklet/publish/{connect-store-button.js → create-release/connect-store-button.js} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Box, InputAdornment, Tab, Tabs, TextField, Typography } from '@mui/material';
|
|
5
|
+
import { PROJECT } from '@blocklet/constant';
|
|
6
|
+
import IntroductionPreview from './introduction-preview';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Introduction({
|
|
9
|
+
params,
|
|
10
|
+
setParams,
|
|
11
|
+
paramsErrTip,
|
|
12
|
+
loading,
|
|
13
|
+
setParamsErrTip,
|
|
14
|
+
readOnly
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useLocaleContext();
|
|
19
|
+
const [nowTab, setNowTab] = useState(readOnly ? 'preview' : 'write');
|
|
20
|
+
const handleChange = (_, newValue) => {
|
|
21
|
+
setNowTab(newValue);
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
24
|
+
sx: {
|
|
25
|
+
border: '1px solid #fff',
|
|
26
|
+
width: '100%',
|
|
27
|
+
borderRadius: 2
|
|
28
|
+
},
|
|
29
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
30
|
+
sx: {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'space-between',
|
|
34
|
+
alignItems: 'center'
|
|
35
|
+
},
|
|
36
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
37
|
+
variant: "h6",
|
|
38
|
+
fontWeight: "bold",
|
|
39
|
+
sx: {},
|
|
40
|
+
children: t('common.introduction')
|
|
41
|
+
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
42
|
+
value: nowTab,
|
|
43
|
+
onChange: handleChange,
|
|
44
|
+
"aria-label": "wrapped label tabs example",
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
46
|
+
value: "write",
|
|
47
|
+
label: "Write"
|
|
48
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
49
|
+
value: "preview",
|
|
50
|
+
label: "Preview"
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
54
|
+
display: nowTab === 'write' ? 'block' : 'none',
|
|
55
|
+
sx: {
|
|
56
|
+
width: '100%',
|
|
57
|
+
marginTop: 3
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx(TextField, {
|
|
60
|
+
disabled: loading || readOnly,
|
|
61
|
+
sx: {
|
|
62
|
+
border: 'none'
|
|
63
|
+
}
|
|
64
|
+
// label={`Blocklet ${t('common.introduction')}`}
|
|
65
|
+
,
|
|
66
|
+
placeholder: `Blocklet ${t('common.introduction')}`,
|
|
67
|
+
InputProps: {
|
|
68
|
+
'data-cy': 'export-blocklet-introduction',
|
|
69
|
+
readOnly,
|
|
70
|
+
endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
|
|
71
|
+
position: "end",
|
|
72
|
+
children: [params?.blockletIntroduction?.length || 0, " / ", PROJECT.MAX_INTRO_LENGTH]
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
autoComplete: "off",
|
|
76
|
+
variant: "outlined",
|
|
77
|
+
fullWidth: true,
|
|
78
|
+
multiline: true,
|
|
79
|
+
minRows: 4,
|
|
80
|
+
value: params.blockletIntroduction || '',
|
|
81
|
+
onChange: e => {
|
|
82
|
+
setParamsErrTip({
|
|
83
|
+
blockletIntroduction: ''
|
|
84
|
+
});
|
|
85
|
+
setParams({
|
|
86
|
+
blockletIntroduction: e.target.value.slice(0, PROJECT.MAX_INTRO_LENGTH)
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
error: !!paramsErrTip.blockletIntroduction,
|
|
90
|
+
helperText: paramsErrTip.blockletIntroduction || ''
|
|
91
|
+
})
|
|
92
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
93
|
+
display: nowTab === 'preview' ? 'block' : 'none',
|
|
94
|
+
mt: 3,
|
|
95
|
+
children: /*#__PURE__*/_jsx(IntroductionPreview, {
|
|
96
|
+
text: params.blockletIntroduction || ''
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
Introduction.propTypes = {
|
|
102
|
+
params: PropTypes.object.isRequired,
|
|
103
|
+
setParams: PropTypes.func.isRequired,
|
|
104
|
+
paramsErrTip: PropTypes.object.isRequired,
|
|
105
|
+
setParamsErrTip: PropTypes.func.isRequired,
|
|
106
|
+
readOnly: PropTypes.bool.isRequired,
|
|
107
|
+
loading: PropTypes.bool.isRequired
|
|
108
|
+
};
|
|
109
|
+
export default Introduction;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { StepContent, Typography, Button, Step, Box, Stepper, StepButton, Paper } from '@mui/material';
|
|
3
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
4
|
+
import { validateParams, validateParamsStep } from '../utils/validate-params';
|
|
5
|
+
import StepIcon from './step-icon';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function ReleaseStepper({
|
|
8
|
+
steps,
|
|
9
|
+
activeStep,
|
|
10
|
+
setActiveStep,
|
|
11
|
+
isSelectedResources,
|
|
12
|
+
params,
|
|
13
|
+
loading,
|
|
14
|
+
paramsErrTip,
|
|
15
|
+
viewMode,
|
|
16
|
+
projectId
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
t
|
|
20
|
+
} = useLocaleContext();
|
|
21
|
+
const handleNext = () => {
|
|
22
|
+
setActiveStep(prevActiveStep => prevActiveStep + 1);
|
|
23
|
+
};
|
|
24
|
+
const handleBack = () => {
|
|
25
|
+
setActiveStep(prevActiveStep => prevActiveStep - 1);
|
|
26
|
+
};
|
|
27
|
+
const getStepError = step => {
|
|
28
|
+
if (step === 0) {
|
|
29
|
+
return paramsErrTip?.blockletTitle || paramsErrTip?.projectId || paramsErrTip?.blockletDescription;
|
|
30
|
+
}
|
|
31
|
+
if (step === 2) {
|
|
32
|
+
return paramsErrTip?.blockletResources;
|
|
33
|
+
}
|
|
34
|
+
if (step >= 4) {
|
|
35
|
+
return paramsErrTip?.blockletVersion || paramsErrTip?.note;
|
|
36
|
+
}
|
|
37
|
+
return '';
|
|
38
|
+
};
|
|
39
|
+
const readOnly = viewMode || validateParams({
|
|
40
|
+
isSelectedResources,
|
|
41
|
+
params,
|
|
42
|
+
projectId,
|
|
43
|
+
t
|
|
44
|
+
}) === null;
|
|
45
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
46
|
+
sx: {
|
|
47
|
+
width: 300,
|
|
48
|
+
maxWidth: 300,
|
|
49
|
+
minWidth: 300,
|
|
50
|
+
padding: 2,
|
|
51
|
+
border: '1px solid #ccc',
|
|
52
|
+
borderRadius: 2
|
|
53
|
+
},
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Stepper, {
|
|
55
|
+
activeStep: activeStep,
|
|
56
|
+
orientation: "vertical",
|
|
57
|
+
children: steps.map((step, index) => {
|
|
58
|
+
const labelProps = {};
|
|
59
|
+
const ok = loading || !validateParamsStep({
|
|
60
|
+
isSelectedResources,
|
|
61
|
+
params,
|
|
62
|
+
projectId,
|
|
63
|
+
step: index,
|
|
64
|
+
t
|
|
65
|
+
});
|
|
66
|
+
const error = loading ? '' : getStepError(index);
|
|
67
|
+
if (error) {
|
|
68
|
+
labelProps.optional = /*#__PURE__*/_jsx(Typography, {
|
|
69
|
+
variant: "caption",
|
|
70
|
+
color: "error",
|
|
71
|
+
children: error
|
|
72
|
+
});
|
|
73
|
+
labelProps.error = true;
|
|
74
|
+
}
|
|
75
|
+
return /*#__PURE__*/_jsxs(Step, {
|
|
76
|
+
children: [/*#__PURE__*/_jsx(StepButton, {
|
|
77
|
+
icon: /*#__PURE__*/_jsx(StepIcon, {
|
|
78
|
+
error: error,
|
|
79
|
+
active: readOnly ? 99 : activeStep,
|
|
80
|
+
step: index,
|
|
81
|
+
ok: ok
|
|
82
|
+
}),
|
|
83
|
+
sx: {
|
|
84
|
+
cursor: 'pointer',
|
|
85
|
+
color: error ? 'error.main' : 'inherit'
|
|
86
|
+
},
|
|
87
|
+
disabled: false,
|
|
88
|
+
onClick: () => setActiveStep(index),
|
|
89
|
+
...labelProps,
|
|
90
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
91
|
+
fontSize: "14px",
|
|
92
|
+
fontWeight: "500",
|
|
93
|
+
color: error || !ok && activeStep > index ? 'error.main' : 'inherit',
|
|
94
|
+
children: step.label
|
|
95
|
+
})
|
|
96
|
+
}), /*#__PURE__*/_jsxs(StepContent, {
|
|
97
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
children: step.description
|
|
100
|
+
}), !readOnly && /*#__PURE__*/_jsx(Box, {
|
|
101
|
+
sx: {
|
|
102
|
+
mb: 2
|
|
103
|
+
},
|
|
104
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
105
|
+
children: [index < steps.length - 1 && /*#__PURE__*/_jsx(Button, {
|
|
106
|
+
variant: "contained",
|
|
107
|
+
onClick: handleNext,
|
|
108
|
+
sx: {
|
|
109
|
+
mt: 1,
|
|
110
|
+
mr: 1
|
|
111
|
+
},
|
|
112
|
+
disabled: error || !ok,
|
|
113
|
+
children: "Continue"
|
|
114
|
+
}), index > 0 && /*#__PURE__*/_jsx(Button, {
|
|
115
|
+
disabled: index === 0,
|
|
116
|
+
onClick: handleBack,
|
|
117
|
+
sx: {
|
|
118
|
+
mt: 1,
|
|
119
|
+
mr: 1
|
|
120
|
+
},
|
|
121
|
+
children: "Back"
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
}, step.label);
|
|
127
|
+
})
|
|
128
|
+
}), activeStep >= steps.length - 1 && /*#__PURE__*/_jsx(Paper, {
|
|
129
|
+
square: true,
|
|
130
|
+
elevation: 0,
|
|
131
|
+
sx: {
|
|
132
|
+
p: 3
|
|
133
|
+
},
|
|
134
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
135
|
+
fontSize: 12,
|
|
136
|
+
sx: {
|
|
137
|
+
opacity: 0.5
|
|
138
|
+
},
|
|
139
|
+
children: "Click right top button to release"
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
ReleaseStepper.propTypes = {
|
|
145
|
+
steps: PropTypes.array.isRequired,
|
|
146
|
+
activeStep: PropTypes.number.isRequired,
|
|
147
|
+
setActiveStep: PropTypes.func.isRequired,
|
|
148
|
+
params: PropTypes.object.isRequired,
|
|
149
|
+
viewMode: PropTypes.string.isRequired,
|
|
150
|
+
loading: PropTypes.bool.isRequired,
|
|
151
|
+
projectId: PropTypes.string.isRequired,
|
|
152
|
+
isSelectedResources: PropTypes.bool.isRequired,
|
|
153
|
+
paramsErrTip: PropTypes.shape({
|
|
154
|
+
projectId: PropTypes.string,
|
|
155
|
+
blockletVersion: PropTypes.string,
|
|
156
|
+
blockletTitle: PropTypes.string,
|
|
157
|
+
blockletDescription: PropTypes.string,
|
|
158
|
+
note: PropTypes.string,
|
|
159
|
+
blockletResources: PropTypes.string
|
|
160
|
+
}).isRequired
|
|
161
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
1
|
import styled from '@emotion/styled';
|
|
4
|
-
import joinUrl from 'url-join';
|
|
5
2
|
import classnames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { useEffect, useRef } from 'react';
|
|
6
5
|
import useSetState from 'react-use/lib/useSetState';
|
|
7
|
-
import
|
|
6
|
+
import joinUrl from 'url-join';
|
|
7
|
+
import { Box } from '@mui/material';
|
|
8
8
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
|
-
import Toast from '@arcblock/ux/lib/Toast';
|
|
10
|
-
import pAll from 'p-all';
|
|
11
9
|
import hasStartEngine from '@blocklet/meta/lib/has-start-engine';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
10
|
+
import pAll from 'p-all';
|
|
11
|
+
import Toast from '@arcblock/ux/lib/Toast/index';
|
|
12
|
+
import { EmptyIcon } from '@arcblock/icons';
|
|
13
|
+
import { useNodeContext } from '../../../contexts/node';
|
|
14
|
+
import { axios } from '../../../util/api';
|
|
15
15
|
import StopBox from './stop-box';
|
|
16
|
+
import Tree from './tree';
|
|
16
17
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const fillParent = (nodes, parentId) => {
|
|
18
19
|
nodes.forEach(node => {
|
|
@@ -88,17 +89,20 @@ const getNodeIdDependencies = (node, nodeIds) => {
|
|
|
88
89
|
};
|
|
89
90
|
return getDependencies(node, {});
|
|
90
91
|
};
|
|
91
|
-
export default function
|
|
92
|
+
export default function Resources({
|
|
92
93
|
app,
|
|
93
94
|
component,
|
|
94
95
|
projectId,
|
|
95
96
|
release,
|
|
97
|
+
loading,
|
|
96
98
|
error,
|
|
97
99
|
saveSelectedEventsRef,
|
|
98
100
|
readOnly,
|
|
99
101
|
componentDid,
|
|
100
102
|
initialResources = {},
|
|
101
103
|
setResourceComponentsMap,
|
|
104
|
+
selectedResourceIds,
|
|
105
|
+
setSelectedResourceIds,
|
|
102
106
|
initUrl
|
|
103
107
|
}) {
|
|
104
108
|
const {
|
|
@@ -109,7 +113,6 @@ export default function Resource({
|
|
|
109
113
|
api
|
|
110
114
|
} = useNodeContext();
|
|
111
115
|
const [resources, setResources] = useSetState({});
|
|
112
|
-
const [selectedResourceIds, setSelectedResourceIds] = useSetState({});
|
|
113
116
|
const refs = useRef({});
|
|
114
117
|
const loadedDataRef = useRef(false);
|
|
115
118
|
const releaseId = release.id;
|
|
@@ -216,8 +219,17 @@ export default function Resource({
|
|
|
216
219
|
}
|
|
217
220
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
221
|
}, [app, initialResources, readOnly]);
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
let Empty = null;
|
|
223
|
+
if (!component) {
|
|
224
|
+
Empty = /*#__PURE__*/_jsx(StopBox, {
|
|
225
|
+
Icon: EmptyIcon,
|
|
226
|
+
children: t('blocklet.publish.resourceEmptyTip', {
|
|
227
|
+
name: component.meta.title
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (component?.status !== 'running') {
|
|
232
|
+
Empty = /*#__PURE__*/_jsx(StopBox, {
|
|
221
233
|
children: t('blocklet.publish.componentNotRunning', {
|
|
222
234
|
name: component.meta.title
|
|
223
235
|
})
|
|
@@ -228,11 +240,12 @@ export default function Resource({
|
|
|
228
240
|
className: classnames(error && 'error'),
|
|
229
241
|
children: /*#__PURE__*/_jsx(Box, {
|
|
230
242
|
pb: 2,
|
|
231
|
-
|
|
243
|
+
width: "100%",
|
|
244
|
+
children: Empty || /*#__PURE__*/_jsx(Tree, {
|
|
232
245
|
data: resources[component.meta.did] || [],
|
|
233
246
|
value: selectedResourceIds[component.meta.did] || [],
|
|
234
247
|
onChange: handleTreeChange,
|
|
235
|
-
disabled: readOnly
|
|
248
|
+
disabled: loading || readOnly
|
|
236
249
|
})
|
|
237
250
|
})
|
|
238
251
|
}), !!error && /*#__PURE__*/_jsx(Box, {
|
|
@@ -243,13 +256,14 @@ export default function Resource({
|
|
|
243
256
|
})]
|
|
244
257
|
});
|
|
245
258
|
}
|
|
246
|
-
|
|
259
|
+
Resources.propTypes = {
|
|
247
260
|
component: PropTypes.object.isRequired,
|
|
248
261
|
app: PropTypes.object.isRequired,
|
|
249
262
|
projectId: PropTypes.string.isRequired,
|
|
250
263
|
error: PropTypes.string,
|
|
251
264
|
saveSelectedEventsRef: PropTypes.object.isRequired,
|
|
252
|
-
readOnly: PropTypes.bool,
|
|
265
|
+
readOnly: PropTypes.bool.isRequired,
|
|
266
|
+
loading: PropTypes.bool.isRequired,
|
|
253
267
|
release: PropTypes.shape({
|
|
254
268
|
id: PropTypes.string.isRequired,
|
|
255
269
|
status: PropTypes.string
|
|
@@ -257,11 +271,12 @@ Resource.propTypes = {
|
|
|
257
271
|
initialResources: PropTypes.object,
|
|
258
272
|
initUrl: PropTypes.object,
|
|
259
273
|
setResourceComponentsMap: PropTypes.func,
|
|
260
|
-
componentDid: PropTypes.string
|
|
274
|
+
componentDid: PropTypes.string,
|
|
275
|
+
selectedResourceIds: PropTypes.array.isRequired,
|
|
276
|
+
setSelectedResourceIds: PropTypes.func.isRequired
|
|
261
277
|
};
|
|
262
|
-
|
|
278
|
+
Resources.defaultProps = {
|
|
263
279
|
error: '',
|
|
264
|
-
readOnly: false,
|
|
265
280
|
release: {
|
|
266
281
|
id: ''
|
|
267
282
|
},
|
|
@@ -272,13 +287,14 @@ Resource.defaultProps = {
|
|
|
272
287
|
};
|
|
273
288
|
const Container = styled(Box)`
|
|
274
289
|
border: 1px solid #ccc;
|
|
290
|
+
max-height: 600px;
|
|
291
|
+
width: 100%;
|
|
275
292
|
&.error {
|
|
276
293
|
border-color: ${props => props.theme.palette.error.main};
|
|
277
294
|
}
|
|
278
295
|
border-radius: 4px;
|
|
279
296
|
padding: 16px;
|
|
280
297
|
padding-bottom: 0px;
|
|
281
|
-
max-height: 600px;
|
|
282
298
|
overflow-y: auto;
|
|
283
299
|
.footer {
|
|
284
300
|
border-top: 1px solid #ddd;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import DoneIcon from '@mui/icons-material/Done';
|
|
4
|
+
import PriorityHighIcon from '@mui/icons-material/PriorityHigh';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
function StepIcon({
|
|
7
|
+
step,
|
|
8
|
+
ok,
|
|
9
|
+
active,
|
|
10
|
+
error
|
|
11
|
+
}) {
|
|
12
|
+
let color = 'grey.500';
|
|
13
|
+
let content = step + 1;
|
|
14
|
+
if (ok) {
|
|
15
|
+
content = /*#__PURE__*/_jsx(DoneIcon, {
|
|
16
|
+
sx: {
|
|
17
|
+
fontSize: 18,
|
|
18
|
+
margin: 0
|
|
19
|
+
},
|
|
20
|
+
color: "white"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (error || !ok && active > step) {
|
|
24
|
+
color = 'error.main';
|
|
25
|
+
content = /*#__PURE__*/_jsx(PriorityHighIcon, {
|
|
26
|
+
sx: {
|
|
27
|
+
fontSize: 18,
|
|
28
|
+
margin: 0
|
|
29
|
+
},
|
|
30
|
+
color: "white"
|
|
31
|
+
});
|
|
32
|
+
} else if (active >= step) {
|
|
33
|
+
color = 'primary.main';
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24
|
|
38
|
+
// eslint-disable-next-line no-nested-ternary
|
|
39
|
+
,
|
|
40
|
+
bgcolor: color,
|
|
41
|
+
borderRadius: "100%",
|
|
42
|
+
color: "white",
|
|
43
|
+
display: "flex",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
fontWeight: "bold",
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
children: content
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
StepIcon.propTypes = {
|
|
52
|
+
step: PropTypes.number,
|
|
53
|
+
ok: PropTypes.bool,
|
|
54
|
+
active: PropTypes.number,
|
|
55
|
+
error: PropTypes.string
|
|
56
|
+
};
|
|
57
|
+
StepIcon.defaultProps = {
|
|
58
|
+
step: 0,
|
|
59
|
+
ok: false,
|
|
60
|
+
active: 0,
|
|
61
|
+
error: ''
|
|
62
|
+
};
|
|
63
|
+
export default StepIcon;
|
|
@@ -3,7 +3,8 @@ import { Box, Container } from '@mui/material';
|
|
|
3
3
|
import StopIcon from '@mui/icons-material/DoDisturbAlt';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
function StopBox({
|
|
6
|
-
children
|
|
6
|
+
children,
|
|
7
|
+
Icon
|
|
7
8
|
}) {
|
|
8
9
|
return /*#__PURE__*/_jsxs(Container, {
|
|
9
10
|
sx: {
|
|
@@ -11,17 +12,19 @@ function StopBox({
|
|
|
11
12
|
flexDirection: 'column',
|
|
12
13
|
justifyContent: 'center',
|
|
13
14
|
alignItems: 'center',
|
|
15
|
+
paddingTop: '10px',
|
|
14
16
|
margin: '10px 0px'
|
|
15
17
|
},
|
|
16
|
-
children: [/*#__PURE__*/_jsx(
|
|
18
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
17
19
|
sx: {
|
|
18
|
-
fontSize: 32,
|
|
19
20
|
opacity: 0.3,
|
|
20
|
-
|
|
21
|
-
}
|
|
21
|
+
fontSize: 32
|
|
22
|
+
},
|
|
23
|
+
children: /*#__PURE__*/_jsx(Icon, {})
|
|
22
24
|
}), /*#__PURE__*/_jsx(Box, {
|
|
23
25
|
sx: {
|
|
24
26
|
mb: 2,
|
|
27
|
+
opacity: 0.7,
|
|
25
28
|
fontSize: 'small',
|
|
26
29
|
color: 'action'
|
|
27
30
|
},
|
|
@@ -30,6 +33,10 @@ function StopBox({
|
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
StopBox.propTypes = {
|
|
33
|
-
children: PropTypes.node.isRequired
|
|
36
|
+
children: PropTypes.node.isRequired,
|
|
37
|
+
Icon: PropTypes.elementType
|
|
38
|
+
};
|
|
39
|
+
StopBox.defaultProps = {
|
|
40
|
+
Icon: StopIcon
|
|
34
41
|
};
|
|
35
42
|
export default StopBox;
|
|
@@ -11,7 +11,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
|
11
11
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
12
12
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
13
13
|
import { Icon } from '@iconify/react';
|
|
14
|
-
import Images from '
|
|
14
|
+
import Images from '../../../images';
|
|
15
15
|
|
|
16
16
|
// BFS algorithm to find node by his ID
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, TextField, InputAdornment } from '@mui/material';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { PROJECT } from '@blocklet/constant';
|
|
5
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Version({
|
|
8
|
+
readOnly,
|
|
9
|
+
params,
|
|
10
|
+
setParams,
|
|
11
|
+
paramsErrTip,
|
|
12
|
+
setParamsErrTip,
|
|
13
|
+
loading
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
t
|
|
17
|
+
} = useLocaleContext();
|
|
18
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
19
|
+
display: "flex",
|
|
20
|
+
mt: 3,
|
|
21
|
+
className: "section",
|
|
22
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
23
|
+
sx: {
|
|
24
|
+
flex: 1
|
|
25
|
+
},
|
|
26
|
+
children: [/*#__PURE__*/_jsx(TextField, {
|
|
27
|
+
required: true,
|
|
28
|
+
disabled: loading || readOnly,
|
|
29
|
+
label: `Blocklet ${t('common.version')}`,
|
|
30
|
+
placeholder: `Blocklet ${t('common.version')}`,
|
|
31
|
+
InputProps: {
|
|
32
|
+
'data-cy': 'blocklet-version',
|
|
33
|
+
readOnly
|
|
34
|
+
},
|
|
35
|
+
autoComplete: "off",
|
|
36
|
+
variant: "outlined",
|
|
37
|
+
fullWidth: true,
|
|
38
|
+
value: params.blockletVersion || '',
|
|
39
|
+
onChange: e => {
|
|
40
|
+
setParamsErrTip({
|
|
41
|
+
blockletVersion: ''
|
|
42
|
+
});
|
|
43
|
+
setParams({
|
|
44
|
+
blockletVersion: e.target.value
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
error: !!paramsErrTip.blockletVersion,
|
|
48
|
+
helperText: paramsErrTip.blockletVersion || ''
|
|
49
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
50
|
+
label: t('blocklet.publish.releaseNote'),
|
|
51
|
+
autoComplete: "off",
|
|
52
|
+
disabled: loading || readOnly,
|
|
53
|
+
variant: "outlined",
|
|
54
|
+
InputProps: {
|
|
55
|
+
'data-cy': 'release-note',
|
|
56
|
+
readOnly,
|
|
57
|
+
endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
|
|
58
|
+
position: "end",
|
|
59
|
+
children: [params?.note?.length || 0, " / ", PROJECT.MAX_NOTE_LENGTH]
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
fullWidth: true,
|
|
63
|
+
multiline: true,
|
|
64
|
+
minRows: 4,
|
|
65
|
+
required: true,
|
|
66
|
+
value: params.note || '',
|
|
67
|
+
onChange: e => {
|
|
68
|
+
setParamsErrTip({
|
|
69
|
+
note: ''
|
|
70
|
+
});
|
|
71
|
+
setParams({
|
|
72
|
+
note: e.target.value.slice(0, PROJECT.MAX_NOTE_LENGTH)
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
error: !!paramsErrTip.note,
|
|
76
|
+
helperText: paramsErrTip.note || '',
|
|
77
|
+
sx: {
|
|
78
|
+
mt: 3
|
|
79
|
+
}
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
Version.propTypes = {
|
|
85
|
+
readOnly: PropTypes.bool.isRequired,
|
|
86
|
+
params: PropTypes.object.isRequired,
|
|
87
|
+
setParams: PropTypes.func.isRequired,
|
|
88
|
+
paramsErrTip: PropTypes.object.isRequired,
|
|
89
|
+
setParamsErrTip: PropTypes.func.isRequired,
|
|
90
|
+
loading: PropTypes.bool.isRequired
|
|
91
|
+
};
|
|
92
|
+
Version.defaultProps = {};
|
|
93
|
+
export default Version;
|
|
@@ -51,7 +51,7 @@ export default function BlockletPublish({
|
|
|
51
51
|
path: "/:projectId",
|
|
52
52
|
element: /*#__PURE__*/_jsx(ReleasesList, {})
|
|
53
53
|
}), /*#__PURE__*/_jsx(Route, {
|
|
54
|
-
path: "/:projectId/:releaseId",
|
|
54
|
+
path: "/:projectId/:mode/:releaseId",
|
|
55
55
|
element: /*#__PURE__*/_jsx(CreateRelease, {
|
|
56
56
|
initUrl: initUrl
|
|
57
57
|
})
|
|
@@ -71,7 +71,7 @@ export default function ProjectList({
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
const handleNewBlocklet = () => {
|
|
74
|
-
navigate(`${UNOWNED_DID}/create`, {
|
|
74
|
+
navigate(`${UNOWNED_DID}/create/none`, {
|
|
75
75
|
replace: true
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -247,7 +247,7 @@ export default function ProjectList({
|
|
|
247
247
|
return /*#__PURE__*/_jsxs(Box, {
|
|
248
248
|
display: "flex",
|
|
249
249
|
children: [/*#__PURE__*/_jsx(Link, {
|
|
250
|
-
to: `${project.id}/create`,
|
|
250
|
+
to: `${project.id}/create/none`,
|
|
251
251
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
252
252
|
title: t('blocklet.publish.createRelease'),
|
|
253
253
|
placement: "top",
|
|
@@ -273,7 +273,7 @@ export default function ProjectList({
|
|
|
273
273
|
style: {
|
|
274
274
|
display: 'flex'
|
|
275
275
|
},
|
|
276
|
-
to: `${project.id}/${project.lastReleaseId}`,
|
|
276
|
+
to: `${project.id}/new-release/${project.lastReleaseId}`,
|
|
277
277
|
children: /*#__PURE__*/_jsx(VisibilityIcon, {
|
|
278
278
|
sx: {
|
|
279
279
|
fontSize: 18
|
|
@@ -172,7 +172,7 @@ export default function ReleaseList() {
|
|
|
172
172
|
customBodyRenderLite: rawIndex => {
|
|
173
173
|
const release = releases[rawIndex];
|
|
174
174
|
return /*#__PURE__*/_jsx(Link, {
|
|
175
|
-
to:
|
|
175
|
+
to: `view/${release.id}`,
|
|
176
176
|
children: release.blockletVersion || '/'
|
|
177
177
|
});
|
|
178
178
|
}
|
|
@@ -301,7 +301,7 @@ export default function ReleaseList() {
|
|
|
301
301
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
302
302
|
className: "header",
|
|
303
303
|
children: [breadcrumbs, /*#__PURE__*/_jsx(Link, {
|
|
304
|
-
to: "
|
|
304
|
+
to: "new-release/none",
|
|
305
305
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
306
306
|
variant: "contained",
|
|
307
307
|
children: [/*#__PURE__*/_jsx(AddIcon, {
|