@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
package/lib/theme-provider.js
CHANGED
|
@@ -1,41 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ThemeProvider as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
const [theme, setTheme] = useState(defaultTheme);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (_theme && typeof _theme === 'object') setTheme(_theme);
|
|
15
|
-
}, [_theme]);
|
|
16
|
-
if (theme) {
|
|
17
|
-
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
18
|
-
value: theme,
|
|
19
|
-
children: /*#__PURE__*/_jsx(ThemeContext.Consumer, {
|
|
20
|
-
children: themeValue => {
|
|
21
|
-
return /*#__PURE__*/_jsx(UxThemeProvider, {
|
|
22
|
-
theme: themeValue,
|
|
23
|
-
children: /*#__PURE__*/_jsx(EmotionThemeProvider, {
|
|
24
|
-
theme: themeValue,
|
|
25
|
-
children: children
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return children;
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useState as f, useEffect as c, use as h } from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { ThemeProvider as d } from "@emotion/react";
|
|
5
|
+
import { create as p, ThemeProvider as T } from "@arcblock/ux/lib/Theme";
|
|
6
|
+
const a = p({}), t = u({});
|
|
7
|
+
function v({ children: o, theme: e } = {}) {
|
|
8
|
+
const [i, s] = f(a);
|
|
9
|
+
return c(() => {
|
|
10
|
+
e && typeof e == "object" && s(e);
|
|
11
|
+
}, [e]), i ? /* @__PURE__ */ r(t, { value: i, children: /* @__PURE__ */ r(t.Consumer, { children: (m) => /* @__PURE__ */ r(T, { theme: m, children: /* @__PURE__ */ r(d, { theme: m, children: o }) }) }) }) : o;
|
|
33
12
|
}
|
|
34
|
-
|
|
35
|
-
children:
|
|
36
|
-
theme:
|
|
13
|
+
v.propTypes = {
|
|
14
|
+
children: n.any.isRequired,
|
|
15
|
+
theme: n.object.isRequired
|
|
37
16
|
};
|
|
38
|
-
function
|
|
39
|
-
return
|
|
17
|
+
function j() {
|
|
18
|
+
return h(t);
|
|
40
19
|
}
|
|
41
|
-
export {
|
|
20
|
+
export {
|
|
21
|
+
v as ThemeProvider,
|
|
22
|
+
v as default,
|
|
23
|
+
j as useThemeContext
|
|
24
|
+
};
|
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
import { useEffect } from
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
}
|
|
1
|
+
import { useEffect as u } from "react";
|
|
2
|
+
import r from "prop-types";
|
|
3
|
+
function s({ disabled: t = !1, children: i, onConfirm: o }) {
|
|
4
|
+
return u(() => {
|
|
5
|
+
if (t)
|
|
6
|
+
return () => {
|
|
7
|
+
};
|
|
8
|
+
const n = (e) => {
|
|
9
|
+
e.code === "Enter" && (e.metaKey === !0 || e.ctrlKey === !0) && (e.preventDefault(), e.stopPropagation(), o());
|
|
24
10
|
};
|
|
25
|
-
document.addEventListener(
|
|
26
|
-
|
|
27
|
-
document.removeEventListener('keydown', listener);
|
|
11
|
+
return document.addEventListener("keydown", n), () => {
|
|
12
|
+
document.removeEventListener("keydown", n);
|
|
28
13
|
};
|
|
29
|
-
}, [
|
|
30
|
-
return children;
|
|
14
|
+
}, [t, o]), i;
|
|
31
15
|
}
|
|
32
|
-
|
|
33
|
-
disabled:
|
|
34
|
-
children:
|
|
35
|
-
onConfirm:
|
|
16
|
+
s.propTypes = {
|
|
17
|
+
disabled: r.bool,
|
|
18
|
+
children: r.any.isRequired,
|
|
19
|
+
onConfirm: r.func.isRequired
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
s as default
|
|
36
23
|
};
|
|
37
|
-
SubmitHotKey.defaultProps = {
|
|
38
|
-
disabled: false
|
|
39
|
-
};
|
|
@@ -1,91 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
import { useState } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { CircularProgress } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as o, Fragment as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import u from "@emotion/styled";
|
|
4
|
+
import n from "prop-types";
|
|
5
|
+
import { CircularProgress as h } from "@mui/material";
|
|
6
|
+
import f from "@arcblock/ux/lib/Button";
|
|
7
|
+
import x from "@arcblock/ux/lib/Dialog";
|
|
8
|
+
import g from "./hotkey-submit.js";
|
|
9
|
+
function b({
|
|
10
|
+
onContinue: e,
|
|
11
|
+
nextDisabled: r = !1,
|
|
12
|
+
launching: s = !1,
|
|
13
|
+
texts: i = {
|
|
14
|
+
listenName: "",
|
|
15
|
+
launchingText: "",
|
|
16
|
+
buttonNext: ""
|
|
17
|
+
},
|
|
18
|
+
description: m = ""
|
|
16
19
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
className: "eula-trigger",
|
|
26
|
-
onClick: handleOpen,
|
|
27
|
-
children: texts.listenName
|
|
28
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
29
|
-
disabled: nextDisabled,
|
|
20
|
+
const [p, a] = c(!1);
|
|
21
|
+
return /* @__PURE__ */ o(l, { children: [
|
|
22
|
+
/* @__PURE__ */ t(y, { children: /* @__PURE__ */ o(g, { disabled: r, onConfirm: e, children: [
|
|
23
|
+
/* @__PURE__ */ t("div", { className: "eula-trigger", onClick: () => a((d) => !d), children: i.listenName }),
|
|
24
|
+
/* @__PURE__ */ t(
|
|
25
|
+
f,
|
|
26
|
+
{
|
|
27
|
+
disabled: r,
|
|
30
28
|
color: "primary",
|
|
31
29
|
variant: "contained",
|
|
32
30
|
className: "next-button",
|
|
33
|
-
onClick:
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
title: texts.listenName,
|
|
44
|
-
onClose: () => setOpen(false),
|
|
45
|
-
children: description
|
|
46
|
-
})]
|
|
47
|
-
});
|
|
31
|
+
onClick: e,
|
|
32
|
+
children: s ? /* @__PURE__ */ o(l, { children: [
|
|
33
|
+
/* @__PURE__ */ t(h, { size: 14 }),
|
|
34
|
+
i.launchingText
|
|
35
|
+
] }) : i.buttonNext
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] }) }),
|
|
39
|
+
/* @__PURE__ */ t(x, { open: p, title: i.listenName, onClose: () => a(!1), children: m })
|
|
40
|
+
] });
|
|
48
41
|
}
|
|
49
|
-
|
|
50
|
-
onContinue:
|
|
51
|
-
nextDisabled:
|
|
52
|
-
launching:
|
|
53
|
-
description:
|
|
54
|
-
texts:
|
|
42
|
+
b.propTypes = {
|
|
43
|
+
onContinue: n.func.isRequired,
|
|
44
|
+
nextDisabled: n.bool,
|
|
45
|
+
launching: n.bool,
|
|
46
|
+
description: n.any,
|
|
47
|
+
texts: n.object
|
|
55
48
|
};
|
|
56
|
-
|
|
57
|
-
nextDisabled: false,
|
|
58
|
-
launching: false,
|
|
59
|
-
description: '',
|
|
60
|
-
texts: {
|
|
61
|
-
listenName: '',
|
|
62
|
-
launchingText: '',
|
|
63
|
-
buttonNext: ''
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const Div = styled.div`
|
|
49
|
+
const y = u.div`
|
|
67
50
|
margin: 0 auto;
|
|
68
51
|
display: flex;
|
|
69
52
|
justify-content: space-between;
|
|
70
53
|
align-items: center;
|
|
71
54
|
|
|
72
|
-
@media (max-width: ${
|
|
55
|
+
@media (max-width: ${(e) => e.theme.breakpoints.values.sm}px) {
|
|
73
56
|
flex-direction: column;
|
|
74
57
|
}
|
|
75
58
|
|
|
76
59
|
.eula-trigger {
|
|
77
60
|
cursor: pointer;
|
|
78
61
|
text-decoration: underline;
|
|
79
|
-
${
|
|
62
|
+
${(e) => e.theme.breakpoints.up("md")} {
|
|
80
63
|
padding-right: 24px;
|
|
81
64
|
}
|
|
82
|
-
${
|
|
65
|
+
${(e) => e.theme.breakpoints.down("md")} {
|
|
83
66
|
padding: 16px;
|
|
84
67
|
}
|
|
85
68
|
font-size: 14px;
|
|
86
69
|
white-space: nowrap;
|
|
87
70
|
&:hover {
|
|
88
|
-
color: ${
|
|
71
|
+
color: ${(e) => e.theme.palette.primary.main};
|
|
89
72
|
}
|
|
90
73
|
}
|
|
91
74
|
|
|
@@ -93,4 +76,6 @@ const Div = styled.div`
|
|
|
93
76
|
min-width: 200px;
|
|
94
77
|
}
|
|
95
78
|
`;
|
|
96
|
-
export
|
|
79
|
+
export {
|
|
80
|
+
b as default
|
|
81
|
+
};
|