@blocklet/launcher-layout 1.5.68 → 1.5.71
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/index.js +9 -4
- package/lib/launch-result-message.js +89 -0
- package/lib/nav.js +2 -2
- package/lib/page-header.js +42 -0
- package/lib/wizard/server-eula.js +78 -0
- package/lib/wizard/wizard-desc.js +184 -0
- package/package.json +7 -5
package/lib/index.js
CHANGED
|
@@ -53,7 +53,8 @@ function Layout(_ref) {
|
|
|
53
53
|
locale,
|
|
54
54
|
headerEndAddons,
|
|
55
55
|
pcWidth,
|
|
56
|
-
pcHeight
|
|
56
|
+
pcHeight,
|
|
57
|
+
navLogo
|
|
57
58
|
} = _ref;
|
|
58
59
|
const [openNav, setOpenNav] = (0, _react.useState)(false);
|
|
59
60
|
const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('sm'));
|
|
@@ -86,7 +87,9 @@ function Layout(_ref) {
|
|
|
86
87
|
logoUrl: logoUrl,
|
|
87
88
|
did: blockletMeta.did,
|
|
88
89
|
locale: locale
|
|
89
|
-
}))),
|
|
90
|
+
}))), navLogo && !isMobile && /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
+
className: "left"
|
|
92
|
+
}, navLogo), headerEndAddons && /*#__PURE__*/_react.default.createElement("div", {
|
|
90
93
|
className: "right"
|
|
91
94
|
}, headerEndAddons)), /*#__PURE__*/_react.default.createElement(_Hidden.default, {
|
|
92
95
|
mdUp: true
|
|
@@ -119,14 +122,16 @@ Layout.propTypes = {
|
|
|
119
122
|
locale: _propTypes.default.oneOf(['en', 'zh']),
|
|
120
123
|
headerEndAddons: _propTypes.default.any,
|
|
121
124
|
pcWidth: _propTypes.default.any,
|
|
122
|
-
pcHeight: _propTypes.default.any
|
|
125
|
+
pcHeight: _propTypes.default.any,
|
|
126
|
+
navLogo: _propTypes.default.any
|
|
123
127
|
};
|
|
124
128
|
Layout.defaultProps = {
|
|
125
129
|
logoUrl: '',
|
|
126
130
|
locale: 'en',
|
|
127
131
|
headerEndAddons: null,
|
|
128
132
|
pcWidth: '80%',
|
|
129
|
-
pcHeight: '80%'
|
|
133
|
+
pcHeight: '80%',
|
|
134
|
+
navLogo: ''
|
|
130
135
|
}; // 针对 safari 下的 chrome 适配
|
|
131
136
|
|
|
132
137
|
const ua = navigator.userAgent.toLocaleLowerCase();
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = LaunchResultMessage;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
15
|
+
|
|
16
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
17
|
+
|
|
18
|
+
var _Spinner = _interopRequireDefault(require("@arcblock/ux/lib/Spinner"));
|
|
19
|
+
|
|
20
|
+
var _PriorityHigh = _interopRequireDefault(require("@material-ui/icons/PriorityHigh"));
|
|
21
|
+
|
|
22
|
+
const _excluded = ["variant", "title", "subTitle", "footer"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
+
|
|
30
|
+
function LaunchResultMessage(_ref) {
|
|
31
|
+
let {
|
|
32
|
+
variant,
|
|
33
|
+
title,
|
|
34
|
+
subTitle,
|
|
35
|
+
footer
|
|
36
|
+
} = _ref,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
|
|
39
|
+
let Icon;
|
|
40
|
+
|
|
41
|
+
switch (variant) {
|
|
42
|
+
case 'error':
|
|
43
|
+
Icon = _Close.default;
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case 'info':
|
|
47
|
+
Icon = _PriorityHigh.default;
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
case 'loading':
|
|
51
|
+
Icon = _Spinner.default;
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
Icon = _Check.default;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(Container, Object.assign({
|
|
59
|
+
variant: variant
|
|
60
|
+
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: "result-body"
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
63
|
+
className: "result-icon color-".concat(variant)
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
className: "result-title color-".concat(variant, " ").concat(title ? '' : 'ele-hide')
|
|
66
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
className: "result-sub-title ".concat(subTitle ? '' : 'ele-hide')
|
|
68
|
+
}, subTitle), /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
className: "result-footer ".concat(footer ? '' : 'ele-hide')
|
|
70
|
+
}, footer)));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
LaunchResultMessage.propTypes = {
|
|
74
|
+
variant: _propTypes.default.oneOf(['success', 'error', 'info', 'loading']),
|
|
75
|
+
title: _propTypes.default.string,
|
|
76
|
+
subTitle: _propTypes.default.string,
|
|
77
|
+
footer: _propTypes.default.any
|
|
78
|
+
};
|
|
79
|
+
LaunchResultMessage.defaultProps = {
|
|
80
|
+
variant: 'success',
|
|
81
|
+
title: '',
|
|
82
|
+
subTitle: '',
|
|
83
|
+
footer: null
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const Container = _styledComponents.default.div.withConfig({
|
|
87
|
+
displayName: "launch-result-message__Container",
|
|
88
|
+
componentId: "sc-msneii-0"
|
|
89
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;.result-body{max-width:500px;text-align:center;margin-top:-64px;}.result-icon{display:inline-flex;justify-content:center;align-items:center;margin-bottom:24px;width:48px;height:48px;border-radius:100%;color:", ";transition:all ease 0.3s;&.color-success{background-color:", ";}&.color-error{background-color:", ";}&.color-info{background-color:", ";}}.result-title{height:34px;font-size:24px;margin-bottom:8px;font-weight:bolder;transition:all ease 0.3s;&.ele-hide{height:0;opacity:0;margin-bottom:0;}&.color-success{color:", ";}&.color-error{color:", ";}&.color-info{color:", ";}&.ele-hide{line-height:0;opacity:0;}}.result-sub-title{margin:0 auto;max-width:90%;color:", ";font-size:14px;line-height:1.21em;transition:all ease 0.3s;&.ele-hide{line-height:0;opacity:0;}}.result-footer{margin-top:38px;height:70px;overflow:hidden;transition:all ease 0.3s;&.ele-hide{margin-top:0;height:0;opacity:0;}}"], props => props.theme.palette.common.white, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.grey[700]);
|
package/lib/nav.js
CHANGED
|
@@ -89,7 +89,7 @@ function Nav(_ref) {
|
|
|
89
89
|
const AppLink = _styledComponents.default.a.withConfig({
|
|
90
90
|
displayName: "nav__AppLink",
|
|
91
91
|
componentId: "sc-1qwhj4c-0"
|
|
92
|
-
})(["color:", ";text-decoration:none;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-family:'Roboto,
|
|
92
|
+
})(["color:", ";text-decoration:none;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-family:Lato,Avenir,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';text-decoration:none;font-weight:700;-webkit-font-smoothing:antialiased;", "{display:block;max-width:calc(100vw - 150px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}"], props => props.theme.palette.common.black, props => props.theme.breakpoints.down('sm'));
|
|
93
93
|
|
|
94
94
|
const Div = _styledComponents.default.div.withConfig({
|
|
95
95
|
displayName: "nav__Div",
|
|
@@ -99,7 +99,7 @@ const Div = _styledComponents.default.div.withConfig({
|
|
|
99
99
|
const StepContainer = _styledComponents.default.div.withConfig({
|
|
100
100
|
displayName: "nav__StepContainer",
|
|
101
101
|
componentId: "sc-1qwhj4c-2"
|
|
102
|
-
})(["display:flex;flex-direction:column;margin-top:60px;", "{margin-top:30px;}.step-line{display:block;position:absolute;z-index:1;left:11px;top:12px;width:2px;height:100%;background-color:", ";}.step-icon{position:relative;z-index:2;display:flex;flex-shrink:0;justify-content:center;align-items:center;width:24px;height:24px;border-radius:13px;background-color:", ";color:", ";transition:all ease 0.3s;&:before{position:absolute;left:4px;top:4px;z-index:3;display:block;background-color:", ";width:16px;height:16px;border-radius:10px;content:'';transform:scale(0);transition:all ease 0.3s;}& > *{transform:scale(0);transition:all ease 0.2s;}}.step-name{position:relative;flex:1;padding-top:1px;margin-left:22px;font-size:16px;color:", ";}.step-name-content{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;text-overflow:ellipsis;}.step-block{position:relative;display:flex;height:70px;overflow:hidden;transition:all ease 0.2s;&.step-optional{height:0;opacity:0;}&.step-checked{
|
|
102
|
+
})(["display:flex;flex-direction:column;margin-top:60px;", "{margin-top:30px;}.step-line{display:block;position:absolute;z-index:1;left:11px;top:12px;width:2px;height:100%;opacity:0.5;background-color:", ";transition:all ease 0.2s;}.step-icon{position:relative;z-index:2;display:flex;flex-shrink:0;justify-content:center;align-items:center;width:24px;height:24px;border-radius:13px;background-color:", ";color:", ";transition:all ease 0.3s;&:before{position:absolute;left:4px;top:4px;z-index:3;display:block;background-color:", ";width:16px;height:16px;border-radius:10px;content:'';transform:scale(0);transition:all ease 0.3s;}& > *{transform:scale(0);transition:all ease 0.2s;}}.step-name{position:relative;flex:1;padding-top:1px;margin-left:22px;font-size:16px;color:", ";white-space:nowrap;}", "{.step-name-content{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;text-overflow:ellipsis;}}.step-block{position:relative;display:flex;height:70px;opacity:0.5;overflow:hidden;transition:all ease 0.2s;&.step-optional{height:0;opacity:0;}&.step-checked{opacity:1;.step-icon{color:", ";background-color:", ";& > *{transform:scale(1);}}.step-line{background-color:", ";opacity:1;}}&.step-active{opacity:1;.step-icon{background-color:", ";}.step-icon:before{transform:scale(1);}.step-name{color:", ";}}&:last-child{.step-line{display:none;}}}"], props => props.theme.breakpoints.down('sm'), props => props.theme.palette.grey[400], props => props.theme.palette.grey[400], props => props.theme.palette.common.white, props => props.theme.palette.common.white, props => props.theme.palette.grey[700], props => props.theme.breakpoints.up('md'), props => props.theme.palette.common.white, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main);
|
|
103
103
|
|
|
104
104
|
Nav.propTypes = {
|
|
105
105
|
blockletMeta: _propTypes.default.object.isRequired,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function PageHeader(_ref) {
|
|
17
|
+
let {
|
|
18
|
+
title,
|
|
19
|
+
subTitle
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(Content, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: "title"
|
|
23
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: "sub-title"
|
|
25
|
+
}, subTitle));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const Content = _styledComponents.default.div.withConfig({
|
|
29
|
+
displayName: "page-header__Content",
|
|
30
|
+
componentId: "sc-1j6254k-0"
|
|
31
|
+
})(["width:100%;text-align:center;.title{font-size:24px;font-weight:700;color:", ";}.sub-title{font-size:14px;color:", ";padding:0 14px;font-weight:400;}"], props => props.theme.palette.common.black, props => props.theme.palette.grey[600]);
|
|
32
|
+
|
|
33
|
+
var _default = PageHeader;
|
|
34
|
+
exports.default = _default;
|
|
35
|
+
PageHeader.propTypes = {
|
|
36
|
+
title: _propTypes.default.string,
|
|
37
|
+
subTitle: _propTypes.default.string
|
|
38
|
+
};
|
|
39
|
+
PageHeader.defaultProps = {
|
|
40
|
+
title: '',
|
|
41
|
+
subTitle: ''
|
|
42
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ServerEula;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _Spinner = _interopRequireDefault(require("@arcblock/ux/lib/Spinner"));
|
|
15
|
+
|
|
16
|
+
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
17
|
+
|
|
18
|
+
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
/* eslint-disable react/jsx-wrap-multilines */
|
|
27
|
+
function ServerEula(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
onContinue,
|
|
30
|
+
nextDisabled,
|
|
31
|
+
launching,
|
|
32
|
+
texts,
|
|
33
|
+
description
|
|
34
|
+
} = _ref;
|
|
35
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
36
|
+
|
|
37
|
+
const handleOpen = () => setOpen(x => !x);
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Div, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: "eula-trigger",
|
|
41
|
+
onClick: handleOpen
|
|
42
|
+
}, texts.listenName), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
43
|
+
disabled: nextDisabled,
|
|
44
|
+
color: "primary",
|
|
45
|
+
variant: "contained",
|
|
46
|
+
className: "next-button",
|
|
47
|
+
onClick: onContinue
|
|
48
|
+
}, launching ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Spinner.default, {
|
|
49
|
+
size: 14
|
|
50
|
+
}), texts.launchingText) : texts.buttonNext)), /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
51
|
+
open: open,
|
|
52
|
+
title: texts.listenName,
|
|
53
|
+
onClose: () => setOpen(false)
|
|
54
|
+
}, description));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ServerEula.propTypes = {
|
|
58
|
+
onContinue: _propTypes.default.func.isRequired,
|
|
59
|
+
nextDisabled: _propTypes.default.bool,
|
|
60
|
+
launching: _propTypes.default.bool,
|
|
61
|
+
description: _propTypes.default.any,
|
|
62
|
+
texts: _propTypes.default.object
|
|
63
|
+
};
|
|
64
|
+
ServerEula.defaultProps = {
|
|
65
|
+
nextDisabled: false,
|
|
66
|
+
launching: false,
|
|
67
|
+
description: '',
|
|
68
|
+
texts: {
|
|
69
|
+
listenName: '',
|
|
70
|
+
launchingText: '',
|
|
71
|
+
buttonNext: ''
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const Div = _styledComponents.default.div.withConfig({
|
|
76
|
+
displayName: "server-eula__Div",
|
|
77
|
+
componentId: "sc-66fg47-0"
|
|
78
|
+
})(["margin:0 auto;display:flex;justify-content:space-between;align-items:center;@media (max-width:", "px){flex-direction:column;}.eula-trigger{cursor:pointer;", "{padding-right:24px;}", "{padding-top:16px;padding-bottom:16px;}font-size:14px;white-space:nowrap;&:hover{color:", ";}}.next-button{min-width:200px;}"], props => props.theme.breakpoints.values.sm, props => props.theme.breakpoints.up('md'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.primary.main);
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _util = require("@blocklet/meta/lib/util");
|
|
13
|
+
|
|
14
|
+
var _lodash = _interopRequireDefault(require("lodash.get"));
|
|
15
|
+
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
|
|
18
|
+
var _rehypeReact = _interopRequireDefault(require("rehype-react"));
|
|
19
|
+
|
|
20
|
+
var _Table = _interopRequireDefault(require("@material-ui/core/Table"));
|
|
21
|
+
|
|
22
|
+
var _TableBody = _interopRequireDefault(require("@material-ui/core/TableBody"));
|
|
23
|
+
|
|
24
|
+
var _TableCell = _interopRequireDefault(require("@material-ui/core/TableCell"));
|
|
25
|
+
|
|
26
|
+
var _TableContainer = _interopRequireDefault(require("@material-ui/core/TableContainer"));
|
|
27
|
+
|
|
28
|
+
var _TableRow = _interopRequireDefault(require("@material-ui/core/TableRow"));
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
36
|
+
const isFreeBlocklet = meta => {
|
|
37
|
+
if (!meta.payment) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const priceList = (meta.payment.price || []).map(x => x.value || 0);
|
|
42
|
+
return priceList.every(x => x === 0);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const renderAst = new _rehypeReact.default({
|
|
46
|
+
createElement: _react.createElement
|
|
47
|
+
}).Compiler;
|
|
48
|
+
const localeData = {
|
|
49
|
+
zh: {
|
|
50
|
+
appinfo: {
|
|
51
|
+
name: '应用名',
|
|
52
|
+
version: '版本号',
|
|
53
|
+
author: '开发者',
|
|
54
|
+
description: '描述',
|
|
55
|
+
community: '社区地址',
|
|
56
|
+
documentation: '文档手册',
|
|
57
|
+
support: '服务支持',
|
|
58
|
+
overview: '概述'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
en: {
|
|
62
|
+
appinfo: {
|
|
63
|
+
name: 'Name',
|
|
64
|
+
version: 'Version',
|
|
65
|
+
author: 'Author',
|
|
66
|
+
description: 'Description',
|
|
67
|
+
community: 'Community',
|
|
68
|
+
documentation: 'Documentation',
|
|
69
|
+
support: 'Support',
|
|
70
|
+
overview: 'Overview'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function WizardDesc(_ref) {
|
|
76
|
+
let {
|
|
77
|
+
blockletMeta,
|
|
78
|
+
locale
|
|
79
|
+
} = _ref;
|
|
80
|
+
const {
|
|
81
|
+
data
|
|
82
|
+
} = blockletMeta;
|
|
83
|
+
const name = (0, _util.getDisplayName)({
|
|
84
|
+
meta: data
|
|
85
|
+
});
|
|
86
|
+
const blockletDesc = data && data.htmlAst ? renderAst(data.htmlAst) : '';
|
|
87
|
+
const isFree = isFreeBlocklet(data);
|
|
88
|
+
const infos = [{
|
|
89
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.name'),
|
|
90
|
+
value: (0, _util.getDisplayName)({
|
|
91
|
+
meta: data
|
|
92
|
+
})
|
|
93
|
+
}, {
|
|
94
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.version'),
|
|
95
|
+
value: data.version
|
|
96
|
+
}, {
|
|
97
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.author'),
|
|
98
|
+
value: (0, _lodash.default)(data, 'author.name')
|
|
99
|
+
}, {
|
|
100
|
+
type: 'description',
|
|
101
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.description'),
|
|
102
|
+
value: data.description
|
|
103
|
+
}];
|
|
104
|
+
|
|
105
|
+
if (data.community) {
|
|
106
|
+
infos.push({
|
|
107
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.community'),
|
|
108
|
+
value: /*#__PURE__*/_react.default.createElement("a", {
|
|
109
|
+
href: data.community,
|
|
110
|
+
target: "_blank",
|
|
111
|
+
rel: "noreferrer"
|
|
112
|
+
}, data.community)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (data.documentation) {
|
|
117
|
+
infos.push({
|
|
118
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.documentation'),
|
|
119
|
+
value: /*#__PURE__*/_react.default.createElement("a", {
|
|
120
|
+
href: data.documentation,
|
|
121
|
+
target: "_blank",
|
|
122
|
+
rel: "noreferrer"
|
|
123
|
+
}, data.documentation)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (data.support) {
|
|
128
|
+
infos.push({
|
|
129
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.support'),
|
|
130
|
+
value: /*#__PURE__*/_react.default.createElement("a", {
|
|
131
|
+
href: "mailto:".concat(data.support),
|
|
132
|
+
target: "_blank",
|
|
133
|
+
rel: "noreferrer"
|
|
134
|
+
}, data.support)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
infos.push({
|
|
139
|
+
key: (0, _lodash.default)(localeData[locale], 'appinfo.overview'),
|
|
140
|
+
value: ''
|
|
141
|
+
});
|
|
142
|
+
let descEle;
|
|
143
|
+
|
|
144
|
+
if (locale === 'zh') {
|
|
145
|
+
descEle = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isFree ? /*#__PURE__*/_react.default.createElement("p", null, "\u60A8\u53EF\u4EE5\u514D\u8D39\u4F7F\u7528 ", /*#__PURE__*/_react.default.createElement("b", null, name), "\uFF1B") : /*#__PURE__*/_react.default.createElement("p", null, "\u60A8\u9700\u8981\u8D2D\u4E70\u624D\u80FD\u4F7F\u7528 ", /*#__PURE__*/_react.default.createElement("b", null, name), "\uFF1B"), /*#__PURE__*/_react.default.createElement("p", null, "\u5728\u5E94\u7528\u542F\u52A8\u524D\uFF0C\u9700\u8981\u9009\u62E9\u60A8\u7684\u8282\u70B9\uFF1B"), /*#__PURE__*/_react.default.createElement("p", null, "\u5982\u679C\u60A8\u6CA1\u6709\u8282\u70B9\uFF0C\u6211\u4EEC\u4F1A\u5F15\u5BFC\u60A8\u521B\u5EFA\u65B0\u7684\u8282\u70B9\uFF1B"), /*#__PURE__*/_react.default.createElement("p", null, "\u4E0B\u9762\u4E3A\u8BE5\u5E94\u7528\u7684\u4FE1\u606F\uFF1A"));
|
|
146
|
+
} else {
|
|
147
|
+
descEle = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isFree ? /*#__PURE__*/_react.default.createElement("p", null, "You can use ", /*#__PURE__*/_react.default.createElement("b", null, name), " for free;") : /*#__PURE__*/_react.default.createElement("p", null, "You need to purchase before launch ", /*#__PURE__*/_react.default.createElement("b", null, name), ";"), /*#__PURE__*/_react.default.createElement("p", null, "Before the blocklet starts, you need to select your Blocklet Server; "), /*#__PURE__*/_react.default.createElement("p", null, "If you do not have any Blocklet Server, we will guide you to create a new one; "), /*#__PURE__*/_react.default.createElement("p", null, "Below is the information for the blocklet: "));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(Container, null, descEle, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
+
className: "info-table"
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_TableContainer.default, null, /*#__PURE__*/_react.default.createElement(_Table.default, {
|
|
153
|
+
size: "small"
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(_TableBody.default, null, infos.map(e => {
|
|
155
|
+
return /*#__PURE__*/_react.default.createElement(_TableRow.default, {
|
|
156
|
+
key: e.key
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
158
|
+
component: "th",
|
|
159
|
+
scope: "row",
|
|
160
|
+
style: {
|
|
161
|
+
width: 100
|
|
162
|
+
}
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
style: {
|
|
165
|
+
fontWeight: 'bold',
|
|
166
|
+
whiteSpace: 'nowrap'
|
|
167
|
+
}
|
|
168
|
+
}, e.key)), /*#__PURE__*/_react.default.createElement(_TableCell.default, null, e.value));
|
|
169
|
+
}))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
className: "app-overview"
|
|
171
|
+
}, blockletDesc));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const Container = _styledComponents.default.div.withConfig({
|
|
175
|
+
displayName: "wizard-desc__Container",
|
|
176
|
+
componentId: "sc-1it5wg8-0"
|
|
177
|
+
})([".info-table{a{word-break:break-all;}}.app-overview{font-size:16px;margin:16px 0 0 16px;h1{margin:8px 0;font-size:20px;}h2{margin:8px 0;font-size:18px;}ul{display:block;list-style-type:disc;padding-left:2em;li{display:list-item;list-style:disc;}}blockquote{margin-left:2em;}}"]);
|
|
178
|
+
|
|
179
|
+
var _default = WizardDesc;
|
|
180
|
+
exports.default = _default;
|
|
181
|
+
WizardDesc.propTypes = {
|
|
182
|
+
blockletMeta: _propTypes.default.object.isRequired,
|
|
183
|
+
locale: _propTypes.default.string.isRequired
|
|
184
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-layout",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.71",
|
|
4
4
|
"description": "Common ux components of launcher",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -37,14 +37,16 @@
|
|
|
37
37
|
"react": ">=16.12.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@arcblock/did-connect": "^1.16.
|
|
41
|
-
"@arcblock/icons": "^1.16.
|
|
42
|
-
"@arcblock/ux": "^1.16.
|
|
40
|
+
"@arcblock/did-connect": "^1.16.56",
|
|
41
|
+
"@arcblock/icons": "^1.16.56",
|
|
42
|
+
"@arcblock/ux": "^1.16.56",
|
|
43
|
+
"@blocklet/meta": "^1.7.0",
|
|
43
44
|
"@material-ui/core": "^4.12.3",
|
|
44
45
|
"@material-ui/icons": "^4.11.2",
|
|
45
46
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
46
47
|
"lodash.get": "^4.4.2",
|
|
47
48
|
"prop-types": "^15.8.1",
|
|
49
|
+
"rehype-react": "^7.0.4",
|
|
48
50
|
"styled-components": "^5.3.3",
|
|
49
51
|
"url-join": "^4.0.1"
|
|
50
52
|
},
|
|
@@ -56,5 +58,5 @@
|
|
|
56
58
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
57
59
|
"babel-plugin-styled-components": "^1.10.7"
|
|
58
60
|
},
|
|
59
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "13be06599d8749b5bd40e7ba10ee36fbc4838f0e"
|
|
60
62
|
}
|