@blocklet/launcher-layout 2.10.58 → 2.10.60
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 +1 -1
- package/lib/index.js +3 -3
- package/lib/small-circle-progress.js +57 -0
- package/lib/wizard/hotkey-submit.js +39 -0
- package/lib/wizard/server-eula.js +1 -1
- package/package.json +3 -5
package/lib/header.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Img from '@arcblock/ux/lib/Img';
|
|
2
|
-
import { getBlockletDisplayName } from '@blocklet/launcher-util/es/util';
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
3
|
import { Skeleton, useMediaQuery } from '@mui/material';
|
|
5
4
|
import isEmpty from 'is-empty';
|
|
@@ -9,6 +8,7 @@ import joinUrl from 'url-join';
|
|
|
9
8
|
import defaultBlockletLogo from './assets/blocklet-default-logo.png';
|
|
10
9
|
import { getLaunchingText } from './locale';
|
|
11
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const getBlockletDisplayName = blocklet => blocklet?.title || blocklet?.name || '';
|
|
12
12
|
function AppHeader({
|
|
13
13
|
blockletMeta,
|
|
14
14
|
subTitle,
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import Center from '@arcblock/ux/lib/Center';
|
|
2
2
|
import { create } from '@arcblock/ux/lib/Theme';
|
|
3
|
-
import SmallCircleProgress from '@blocklet/launcher-ux/lib/small-circle-progress';
|
|
4
|
-
import styled from '@emotion/styled';
|
|
5
3
|
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
|
6
|
-
import
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
import { CircularProgress, Hidden, StyledEngineProvider, ThemeProvider, Typography, useMediaQuery } from '@mui/material';
|
|
7
6
|
import isObject from 'lodash/isObject';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { Suspense, isValidElement } from 'react';
|
|
@@ -11,6 +10,7 @@ import { useStepContext } from './context/step';
|
|
|
11
10
|
import AppHeader from './header';
|
|
12
11
|
import { getTranslations } from './locale';
|
|
13
12
|
import Nav from './nav';
|
|
13
|
+
import SmallCircleProgress from './small-circle-progress';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
15
|
const HEADER_HEIGHT_MD = '72px';
|
|
16
16
|
const MobileContent = styled.div`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default function SmallCircleProgress({
|
|
6
|
+
value,
|
|
7
|
+
size,
|
|
8
|
+
style,
|
|
9
|
+
...rest
|
|
10
|
+
}) {
|
|
11
|
+
return /*#__PURE__*/_jsxs(Content, {
|
|
12
|
+
style: {
|
|
13
|
+
width: size,
|
|
14
|
+
height: size,
|
|
15
|
+
...style
|
|
16
|
+
},
|
|
17
|
+
...rest,
|
|
18
|
+
children: [/*#__PURE__*/_jsx(CircularProgress, {
|
|
19
|
+
variant: "determinate",
|
|
20
|
+
role: "progressbar",
|
|
21
|
+
value: 100,
|
|
22
|
+
size: size,
|
|
23
|
+
"aria-label": "decorative progress bar",
|
|
24
|
+
thickness: 10,
|
|
25
|
+
style: {
|
|
26
|
+
color: '#dddddd'
|
|
27
|
+
}
|
|
28
|
+
}), /*#__PURE__*/_jsx(CircularProgress, {
|
|
29
|
+
variant: "determinate",
|
|
30
|
+
value: value,
|
|
31
|
+
role: "progressbar",
|
|
32
|
+
size: size,
|
|
33
|
+
thickness: 10,
|
|
34
|
+
"aria-label": "main progress bar"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
SmallCircleProgress.propTypes = {
|
|
39
|
+
value: PropTypes.number.isRequired,
|
|
40
|
+
size: PropTypes.number,
|
|
41
|
+
style: PropTypes.object
|
|
42
|
+
};
|
|
43
|
+
SmallCircleProgress.defaultProps = {
|
|
44
|
+
size: 10,
|
|
45
|
+
style: {}
|
|
46
|
+
};
|
|
47
|
+
const Content = styled.span`
|
|
48
|
+
display: inline-block;
|
|
49
|
+
position: relative;
|
|
50
|
+
> * {
|
|
51
|
+
position: absolute;
|
|
52
|
+
left: 0;
|
|
53
|
+
top: 0;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This component should be used only once in each page,
|
|
6
|
+
* otherwise all registered events will be triggered when the user presses the Meta(Ctrl)+Enter key combination,
|
|
7
|
+
* which may not be consistent with the actual business logic.
|
|
8
|
+
*/
|
|
9
|
+
export default function SubmitHotKey({
|
|
10
|
+
disabled,
|
|
11
|
+
children,
|
|
12
|
+
onConfirm
|
|
13
|
+
}) {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return () => {};
|
|
17
|
+
}
|
|
18
|
+
const listener = event => {
|
|
19
|
+
if (event.code === 'Enter' && (event.metaKey === true || event.ctrlKey === true)) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
onConfirm();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
document.addEventListener('keydown', listener);
|
|
26
|
+
return () => {
|
|
27
|
+
document.removeEventListener('keydown', listener);
|
|
28
|
+
};
|
|
29
|
+
}, [disabled, onConfirm]);
|
|
30
|
+
return children;
|
|
31
|
+
}
|
|
32
|
+
SubmitHotKey.propTypes = {
|
|
33
|
+
disabled: PropTypes.bool,
|
|
34
|
+
children: PropTypes.any.isRequired,
|
|
35
|
+
onConfirm: PropTypes.func.isRequired
|
|
36
|
+
};
|
|
37
|
+
SubmitHotKey.defaultProps = {
|
|
38
|
+
disabled: false
|
|
39
|
+
};
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { CircularProgress } from '@mui/material';
|
|
6
6
|
import Button from '@arcblock/ux/lib/Button';
|
|
7
7
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
8
|
-
import SubmitHotKey from '
|
|
8
|
+
import SubmitHotKey from './hotkey-submit';
|
|
9
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
function ServerEula({
|
|
11
11
|
onContinue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/launcher-layout",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.60",
|
|
4
4
|
"description": "Common ux components of launcher",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -44,9 +44,7 @@
|
|
|
44
44
|
"react": "^18.2.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@arcblock/icons": "^2.10.
|
|
48
|
-
"@blocklet/launcher-util": "2.3.45",
|
|
49
|
-
"@blocklet/launcher-ux": "2.3.45",
|
|
47
|
+
"@arcblock/icons": "^2.10.60",
|
|
50
48
|
"@blocklet/meta": "1.16.29",
|
|
51
49
|
"@emotion/react": "^11.13.0",
|
|
52
50
|
"@emotion/styled": "^11.13.0",
|
|
@@ -67,5 +65,5 @@
|
|
|
67
65
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
68
66
|
"glob": "^10.4.5"
|
|
69
67
|
},
|
|
70
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "fb4ccbae5428593bc9d7555e832f7743fbd9c71b"
|
|
71
69
|
}
|