@blocklet/launcher-layout 2.13.69 → 3.0.0
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/compact-layout.js +27 -78
- package/lib/content.js +16 -18
- package/lib/context/step.js +61 -126
- package/lib/header.js +107 -203
- package/lib/index.js +153 -219
- package/lib/info-list.js +54 -41
- package/lib/launch-result-message.js +39 -63
- package/lib/locale.js +9 -8
- package/lib/markdown-body.js +15 -19
- package/lib/nav.js +138 -190
- package/lib/page-header.js +22 -38
- package/lib/small-circle-progress.js +38 -45
- package/lib/theme-provider.js +21 -38
- package/lib/wizard/hotkey-submit.js +19 -35
- package/lib/wizard/server-eula.js +50 -65
- package/lib/wizard/wizard-desc.js +147 -240
- package/package.json +14 -24
- package/lib/LaunchResultMessage/demo/default.js +0 -82
- package/lib/LaunchResultMessage/result-message.stories.js +0 -27
- package/lib/Layout/demo/child-progress-in-memory-mode.js +0 -70
- package/lib/Layout/demo/child-progress.js +0 -54
- package/lib/Layout/demo/constants.js +0 -76
- package/lib/Layout/demo/default.js +0 -54
- package/lib/Layout/demo/extra-nav.js +0 -108
- package/lib/Layout/demo/logo-url.js +0 -31
- package/lib/Layout/demo/longest-steps-for-launch.js +0 -95
- package/lib/Layout/demo/memory-mode.js +0 -49
- package/lib/Layout/demo/old-code-compatible.js +0 -36
- package/lib/Layout/demo/optional-step.js +0 -61
- package/lib/Layout/demo/show-child.js +0 -93
- package/lib/Layout/demo/static-demo-data.json +0 -85
- package/lib/Layout/layout.stories.js +0 -28
|
@@ -1,64 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...props
|
|
12
|
-
}) {
|
|
13
|
-
let Icon;
|
|
14
|
-
switch (variant) {
|
|
15
|
-
case 'error':
|
|
16
|
-
Icon = Close;
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import c from "@emotion/styled";
|
|
4
|
+
import { Check as m, PriorityHigh as d, Close as h } from "@mui/icons-material";
|
|
5
|
+
import { CircularProgress as p } from "@mui/material";
|
|
6
|
+
function u({ variant: e = "success", title: i = "", subTitle: l = "", footer: s = null, ...n }) {
|
|
7
|
+
let r;
|
|
8
|
+
switch (e) {
|
|
9
|
+
case "error":
|
|
10
|
+
r = h;
|
|
17
11
|
break;
|
|
18
|
-
case
|
|
19
|
-
|
|
12
|
+
case "info":
|
|
13
|
+
r = d;
|
|
20
14
|
break;
|
|
21
|
-
case
|
|
22
|
-
|
|
15
|
+
case "loading":
|
|
16
|
+
r = p;
|
|
23
17
|
break;
|
|
24
18
|
default:
|
|
25
|
-
|
|
19
|
+
r = m;
|
|
26
20
|
}
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
className: `result-icon color-${variant}`,
|
|
34
|
-
children: /*#__PURE__*/_jsx(Icon, {})
|
|
35
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
36
|
-
className: `result-title color-${variant} ${title ? '' : 'ele-hide'}`,
|
|
37
|
-
children: title
|
|
38
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
39
|
-
className: `result-sub-title ${subTitle ? '' : 'ele-hide'}`,
|
|
40
|
-
children: subTitle
|
|
41
|
-
}), footer && /*#__PURE__*/_jsx("div", {
|
|
42
|
-
className: "result-footer",
|
|
43
|
-
children: footer
|
|
44
|
-
})]
|
|
45
|
-
})
|
|
46
|
-
});
|
|
21
|
+
return /* @__PURE__ */ t(g, { variant: e, ...n, children: /* @__PURE__ */ a("div", { className: "result-body", children: [
|
|
22
|
+
/* @__PURE__ */ t("span", { className: `result-icon color-${e}`, children: /* @__PURE__ */ t(r, {}) }),
|
|
23
|
+
/* @__PURE__ */ t("div", { className: `result-title color-${e} ${i ? "" : "ele-hide"}`, children: i }),
|
|
24
|
+
/* @__PURE__ */ t("div", { className: `result-sub-title ${l ? "" : "ele-hide"}`, children: l }),
|
|
25
|
+
s && /* @__PURE__ */ t("div", { className: "result-footer", children: s })
|
|
26
|
+
] }) });
|
|
47
27
|
}
|
|
48
|
-
|
|
49
|
-
variant:
|
|
50
|
-
title:
|
|
51
|
-
subTitle:
|
|
52
|
-
footer:
|
|
28
|
+
u.propTypes = {
|
|
29
|
+
variant: o.oneOf(["success", "error", "info", "loading"]),
|
|
30
|
+
title: o.string,
|
|
31
|
+
subTitle: o.any,
|
|
32
|
+
footer: o.any
|
|
53
33
|
};
|
|
54
|
-
|
|
55
|
-
variant: 'success',
|
|
56
|
-
title: '',
|
|
57
|
-
subTitle: '',
|
|
58
|
-
footer: null
|
|
59
|
-
};
|
|
60
|
-
export default LaunchResultMessage;
|
|
61
|
-
const Container = styled.div`
|
|
34
|
+
const g = c.div`
|
|
62
35
|
display: flex;
|
|
63
36
|
flex-direction: column;
|
|
64
37
|
align-items: center;
|
|
@@ -82,16 +55,16 @@ const Container = styled.div`
|
|
|
82
55
|
width: 48px;
|
|
83
56
|
height: 48px;
|
|
84
57
|
border-radius: 100%;
|
|
85
|
-
color: ${
|
|
58
|
+
color: ${(e) => e.theme.palette.common.white};
|
|
86
59
|
transition: all ease 0.3s;
|
|
87
60
|
&.color-success {
|
|
88
|
-
background-color: ${
|
|
61
|
+
background-color: ${(e) => e.theme.palette.success.main};
|
|
89
62
|
}
|
|
90
63
|
&.color-error {
|
|
91
|
-
background-color: ${
|
|
64
|
+
background-color: ${(e) => e.theme.palette.error.main};
|
|
92
65
|
}
|
|
93
66
|
&.color-info {
|
|
94
|
-
background-color: ${
|
|
67
|
+
background-color: ${(e) => e.theme.palette.primary.main};
|
|
95
68
|
}
|
|
96
69
|
}
|
|
97
70
|
|
|
@@ -103,13 +76,13 @@ const Container = styled.div`
|
|
|
103
76
|
transition: all ease 0.3s;
|
|
104
77
|
transition-delay: 0.2s;
|
|
105
78
|
&.color-success {
|
|
106
|
-
color: ${
|
|
79
|
+
color: ${(e) => e.theme.palette.success.main};
|
|
107
80
|
}
|
|
108
81
|
&.color-error {
|
|
109
|
-
color: ${
|
|
82
|
+
color: ${(e) => e.theme.palette.error.main};
|
|
110
83
|
}
|
|
111
84
|
&.color-info {
|
|
112
|
-
color: ${
|
|
85
|
+
color: ${(e) => e.theme.palette.primary.main};
|
|
113
86
|
}
|
|
114
87
|
&.ele-hide {
|
|
115
88
|
height: 0;
|
|
@@ -121,7 +94,7 @@ const Container = styled.div`
|
|
|
121
94
|
.result-sub-title {
|
|
122
95
|
margin: 0 auto;
|
|
123
96
|
min-height: 17px;
|
|
124
|
-
color: ${
|
|
97
|
+
color: ${(e) => e.theme.palette.grey[700]};
|
|
125
98
|
font-size: 14px;
|
|
126
99
|
line-height: 1.21em; // 0.01可以解决视网膜屏轻微偏移问题
|
|
127
100
|
transition: all ease 0.3s;
|
|
@@ -139,4 +112,7 @@ const Container = styled.div`
|
|
|
139
112
|
transition: all ease 0.3s;
|
|
140
113
|
transition-delay: 0.2s;
|
|
141
114
|
}
|
|
142
|
-
`;
|
|
115
|
+
`;
|
|
116
|
+
export {
|
|
117
|
+
u as default
|
|
118
|
+
};
|
package/lib/locale.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = {
|
|
2
2
|
en: {
|
|
3
|
-
optional:
|
|
4
|
-
defaultNavSubTitle:
|
|
3
|
+
optional: "Optional",
|
|
4
|
+
defaultNavSubTitle: "Launching"
|
|
5
5
|
},
|
|
6
6
|
zh: {
|
|
7
|
-
optional:
|
|
8
|
-
defaultNavSubTitle:
|
|
7
|
+
optional: "可选",
|
|
8
|
+
defaultNavSubTitle: "启动"
|
|
9
9
|
}
|
|
10
|
+
}, a = (n) => t[n] ? t[n] : t.en, i = (n) => n === "zh" ? "启动" : "Launching";
|
|
11
|
+
export {
|
|
12
|
+
i as getLaunchingText,
|
|
13
|
+
a as getTranslations
|
|
10
14
|
};
|
|
11
|
-
const getTranslations = locale => translations[locale] ? translations[locale] : translations.en;
|
|
12
|
-
const getLaunchingText = locale => locale === 'zh' ? '启动' : 'Launching';
|
|
13
|
-
export { getTranslations, getLaunchingText };
|
package/lib/markdown-body.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
children
|
|
7
|
-
}) {
|
|
8
|
-
return /*#__PURE__*/_jsx(Root, {
|
|
9
|
-
children: children
|
|
10
|
-
});
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import i from "@emotion/styled";
|
|
4
|
+
import { Box as n } from "@mui/material";
|
|
5
|
+
function p({ children: o }) {
|
|
6
|
+
return /* @__PURE__ */ t(a, { children: o });
|
|
11
7
|
}
|
|
12
|
-
const
|
|
13
|
-
const Root = styled(Box)`
|
|
8
|
+
const r = "source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important", a = i(n)`
|
|
14
9
|
.highlight pre,
|
|
15
10
|
pre {
|
|
16
11
|
border-radius: 5px;
|
|
17
12
|
}
|
|
18
13
|
code {
|
|
19
|
-
font-family: ${
|
|
14
|
+
font-family: ${r};
|
|
20
15
|
}
|
|
21
16
|
pre code {
|
|
22
17
|
font-size: 14px;
|
|
23
|
-
font-family: ${
|
|
18
|
+
font-family: ${r};
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
h1,
|
|
@@ -38,15 +33,16 @@ const Root = styled(Box)`
|
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
.CodeMirror pre {
|
|
41
|
-
background-color: ${
|
|
36
|
+
background-color: ${(o) => o.theme.palette.grey[50]} !important;
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
.anchor {
|
|
45
40
|
display: none;
|
|
46
41
|
}
|
|
47
42
|
`;
|
|
48
|
-
|
|
49
|
-
children:
|
|
43
|
+
p.propTypes = {
|
|
44
|
+
children: e.any.isRequired
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
p as default
|
|
50
48
|
};
|
|
51
|
-
MarkdownBody.defaultProps = {};
|
|
52
|
-
export default MarkdownBody;
|