@blocklet/launcher-layout 1.5.89 → 1.5.92
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/header.js +21 -14
- package/lib/index.js +24 -31
- package/lib/wizard/server-eula.js +1 -1
- package/package.json +2 -2
package/lib/header.js
CHANGED
|
@@ -33,29 +33,33 @@ function AppHeader(_ref) {
|
|
|
33
33
|
subTitle,
|
|
34
34
|
logoUrl,
|
|
35
35
|
did,
|
|
36
|
-
locale
|
|
36
|
+
locale,
|
|
37
|
+
navLogo
|
|
37
38
|
} = _ref;
|
|
38
39
|
const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('sm'));
|
|
39
|
-
const
|
|
40
|
+
const blockletSize = isMobile ? 18 : 48;
|
|
40
41
|
const appNameRef = (0, _react.useRef)(null);
|
|
41
42
|
const [appNameSize, setAppNameSize] = (0, _react.useState)('');
|
|
42
43
|
|
|
43
|
-
let
|
|
44
|
+
let blockletIcon = /*#__PURE__*/_react.default.createElement(_Skeleton.default, {
|
|
44
45
|
variant: "rect",
|
|
45
|
-
width:
|
|
46
|
-
height:
|
|
46
|
+
width: blockletSize,
|
|
47
|
+
height: blockletSize
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
if (logoUrl) {
|
|
50
|
-
|
|
51
|
-
width:
|
|
51
|
+
blockletIcon = /*#__PURE__*/_react.default.createElement(_Img.default, {
|
|
52
|
+
width: blockletSize,
|
|
52
53
|
src: logoUrl,
|
|
53
|
-
size: "contain"
|
|
54
|
+
size: "contain",
|
|
55
|
+
style: {
|
|
56
|
+
verticalAlign: 'text-bottom'
|
|
57
|
+
}
|
|
54
58
|
});
|
|
55
59
|
} else if (did) {
|
|
56
|
-
|
|
60
|
+
blockletIcon = /*#__PURE__*/_react.default.createElement(_Avatar.default, {
|
|
57
61
|
did: did,
|
|
58
|
-
size:
|
|
62
|
+
size: blockletSize
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -70,9 +74,11 @@ function AppHeader(_ref) {
|
|
|
70
74
|
}, [appNameSize, title]);
|
|
71
75
|
return /*#__PURE__*/_react.default.createElement(Container, {
|
|
72
76
|
className: appNameSize === 'small' ? 'center-mode' : ''
|
|
73
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
}, isMobile ? /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "app-icon"
|
|
79
|
+
}, navLogo) : /*#__PURE__*/_react.default.createElement("div", {
|
|
74
80
|
className: "app-icon"
|
|
75
|
-
},
|
|
81
|
+
}, blockletIcon), /*#__PURE__*/_react.default.createElement("div", {
|
|
76
82
|
className: "header-title"
|
|
77
83
|
}, subTitle && /*#__PURE__*/_react.default.createElement("div", {
|
|
78
84
|
className: "header-title-sub"
|
|
@@ -83,7 +89,7 @@ function AppHeader(_ref) {
|
|
|
83
89
|
}, (0, _locale.getLaunchingText)(locale)), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
84
90
|
className: "header-title-name ".concat(appNameSize === 'middle' || appNameSize === 'small' ? 'middle-size' : ''),
|
|
85
91
|
ref: appNameRef
|
|
86
|
-
}, title))));
|
|
92
|
+
}, isMobile ? blockletIcon : '', " ", title))));
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
AppHeader.propTypes = {
|
|
@@ -91,7 +97,8 @@ AppHeader.propTypes = {
|
|
|
91
97
|
subTitle: _propTypes.default.any,
|
|
92
98
|
logoUrl: _propTypes.default.string,
|
|
93
99
|
did: _propTypes.default.string,
|
|
94
|
-
locale: _propTypes.default.string
|
|
100
|
+
locale: _propTypes.default.string,
|
|
101
|
+
navLogo: _propTypes.default.any.isRequired
|
|
95
102
|
};
|
|
96
103
|
AppHeader.defaultProps = {
|
|
97
104
|
title: '',
|
package/lib/index.js
CHANGED
|
@@ -5,20 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Center = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
-
var _icons = require("@material-ui/icons");
|
|
15
|
-
|
|
16
|
-
var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer"));
|
|
17
|
-
|
|
18
14
|
var _Hidden = _interopRequireDefault(require("@material-ui/core/Hidden"));
|
|
19
15
|
|
|
20
16
|
var _useMediaQuery = _interopRequireDefault(require("@material-ui/core/useMediaQuery"));
|
|
21
17
|
|
|
18
|
+
var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
|
|
19
|
+
|
|
22
20
|
var _Skeleton = _interopRequireDefault(require("@material-ui/lab/Skeleton"));
|
|
23
21
|
|
|
24
22
|
var _step = require("./context/step");
|
|
@@ -31,10 +29,6 @@ var _nav = _interopRequireDefault(require("./nav"));
|
|
|
31
29
|
|
|
32
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
31
|
|
|
34
|
-
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); }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
32
|
const MobileContent = _styledComponents.default.div.withConfig({
|
|
39
33
|
displayName: "src__MobileContent",
|
|
40
34
|
componentId: "sc-11nbl7p-0"
|
|
@@ -43,7 +37,7 @@ const MobileContent = _styledComponents.default.div.withConfig({
|
|
|
43
37
|
const PcContent = _styledComponents.default.div.withConfig({
|
|
44
38
|
displayName: "src__PcContent",
|
|
45
39
|
componentId: "sc-11nbl7p-1"
|
|
46
|
-
})(["display:flex;
|
|
40
|
+
})(["display:flex;max-width:1245px;min-width:930px;max-height:880px;border-radius:8px;background-color:#fff;"]);
|
|
47
41
|
|
|
48
42
|
function Layout(_ref) {
|
|
49
43
|
let {
|
|
@@ -56,16 +50,12 @@ function Layout(_ref) {
|
|
|
56
50
|
pcHeight,
|
|
57
51
|
navLogo
|
|
58
52
|
} = _ref;
|
|
59
|
-
const [openNav, setOpenNav] = (0, _react.useState)(false);
|
|
60
53
|
const isMobile = (0, _useMediaQuery.default)(theme => theme.breakpoints.down('sm'));
|
|
61
54
|
const {
|
|
62
55
|
activeStep,
|
|
63
56
|
totalStepsCount
|
|
64
57
|
} = (0, _step.useStepContext)();
|
|
65
58
|
const Container = isMobile ? MobileContent : PcContent;
|
|
66
|
-
|
|
67
|
-
const toggleNav = value => setOpenNav(value);
|
|
68
|
-
|
|
69
59
|
const translations = (0, _locale.getTranslations)(locale);
|
|
70
60
|
return /*#__PURE__*/_react.default.createElement(Root, null, /*#__PURE__*/_react.default.createElement("header", {
|
|
71
61
|
className: "root-header"
|
|
@@ -73,17 +63,30 @@ function Layout(_ref) {
|
|
|
73
63
|
mdUp: true
|
|
74
64
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
65
|
className: "left"
|
|
76
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
77
|
-
onClick: () => toggleNav(true),
|
|
78
|
-
className: "menu__icon"
|
|
79
|
-
}), /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
80
67
|
title: blockletMeta.title ? /*#__PURE__*/_react.default.createElement("span", {
|
|
81
68
|
className: "ellipsis-title"
|
|
82
69
|
}, blockletMeta.title) : /*#__PURE__*/_react.default.createElement(_Skeleton.default, {
|
|
83
70
|
variant: "text",
|
|
84
71
|
width: 100
|
|
85
72
|
}),
|
|
86
|
-
|
|
73
|
+
navLogo: navLogo,
|
|
74
|
+
subTitle: /*#__PURE__*/_react.default.createElement("span", null, "".concat(translations.stepTip, " ").concat(activeStep + 1, "/").concat(totalStepsCount), /*#__PURE__*/_react.default.createElement("span", {
|
|
75
|
+
className: "circular"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
77
|
+
variant: "determinate",
|
|
78
|
+
value: 100,
|
|
79
|
+
size: 10,
|
|
80
|
+
thickness: 10,
|
|
81
|
+
style: {
|
|
82
|
+
color: '#dddddd'
|
|
83
|
+
}
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
85
|
+
variant: "determinate",
|
|
86
|
+
value: (activeStep + 1) / totalStepsCount * 100,
|
|
87
|
+
size: 10,
|
|
88
|
+
thickness: 10
|
|
89
|
+
}))),
|
|
87
90
|
logoUrl: logoUrl,
|
|
88
91
|
did: blockletMeta.did,
|
|
89
92
|
locale: locale
|
|
@@ -91,17 +94,7 @@ function Layout(_ref) {
|
|
|
91
94
|
className: "left"
|
|
92
95
|
}, navLogo), headerEndAddons && /*#__PURE__*/_react.default.createElement("div", {
|
|
93
96
|
className: "right"
|
|
94
|
-
}, headerEndAddons)), /*#__PURE__*/_react.default.createElement(
|
|
95
|
-
mdUp: true
|
|
96
|
-
}, /*#__PURE__*/_react.default.createElement(_Drawer.default, {
|
|
97
|
-
anchor: "left",
|
|
98
|
-
open: openNav,
|
|
99
|
-
onClose: () => toggleNav(false)
|
|
100
|
-
}, /*#__PURE__*/_react.default.createElement(_nav.default, {
|
|
101
|
-
locale: locale,
|
|
102
|
-
blockletMeta: blockletMeta,
|
|
103
|
-
logoUrl: logoUrl
|
|
104
|
-
}))), /*#__PURE__*/_react.default.createElement(Container, {
|
|
97
|
+
}, headerEndAddons)), /*#__PURE__*/_react.default.createElement(Container, {
|
|
105
98
|
style: !isMobile ? {
|
|
106
99
|
width: pcWidth,
|
|
107
100
|
height: pcHeight
|
|
@@ -144,7 +137,7 @@ if (ua.includes('iphone os') && ua.includes('crios')) {
|
|
|
144
137
|
const Root = _styledComponents.default.div.withConfig({
|
|
145
138
|
displayName: "src__Root",
|
|
146
139
|
componentId: "sc-11nbl7p-2"
|
|
147
|
-
})(["display:flex;flex-direction:column;justify-content:center;align-items:center;height:100vh;", " .ellipsis-title{flex:1;position:absolute;left:0;top:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}", "{background:#f6f8fa;}", "{background:", ";}.root-header{position:fixed;z-index:200;top:0;display:flex;width:100%;height:56px;align-items:center;box-shadow:0px 1px 1px 0px rgba(168,180,197,0.12);", "{padding:24px;justify-content:flex-end;}", "{padding:14px 16px;justify-content:space-between;background:#f6f8fa;}.left{flex:1;display:flex;align-items:center
|
|
140
|
+
})(["display:flex;flex-direction:column;justify-content:center;align-items:center;height:100vh;", " .circular{display:inline-block;position:relative;width:15px;height:12px;> *{position:absolute;left:3px;top:2px;width:100%;height:100%;}}.ellipsis-title{flex:1;position:absolute;left:0;top:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;", "{left:26px;width:calc(100% - 26px);}}", "{background:#f6f8fa;}", "{background:", ";}.root-header{position:fixed;z-index:200;top:0;display:flex;width:100%;height:56px;align-items:center;box-shadow:0px 1px 1px 0px rgba(168,180,197,0.12);", "{padding:24px;justify-content:flex-end;}", "{padding:14px 16px;justify-content:space-between;background:#f6f8fa;}.left{flex:1;display:flex;align-items:center;}.right{display:flex;align-items:center;", "{button,a{padding-left:8px;padding-right:8px;}}}}"], injectStyle, props => props.theme.breakpoints.down('sm'), props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.common.white, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.breakpoints.down('sm'));
|
|
148
141
|
|
|
149
142
|
const Center = _styledComponents.default.div.withConfig({
|
|
150
143
|
displayName: "src__Center",
|
|
@@ -75,4 +75,4 @@ ServerEula.defaultProps = {
|
|
|
75
75
|
const Div = _styledComponents.default.div.withConfig({
|
|
76
76
|
displayName: "server-eula__Div",
|
|
77
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
|
|
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: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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-layout",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.92",
|
|
4
4
|
"description": "Common ux components of launcher",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
59
59
|
"babel-plugin-styled-components": "^1.10.7"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "7f8786ddeec49da7f356d22c3fbebbab9fce7c8d"
|
|
62
62
|
}
|