@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.
@@ -1,64 +1,37 @@
1
- import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
- import { Check, Close, PriorityHigh } from '@mui/icons-material';
4
- import { CircularProgress } from '@mui/material';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- function LaunchResultMessage({
7
- variant,
8
- title,
9
- subTitle,
10
- footer,
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 'info':
19
- Icon = PriorityHigh;
12
+ case "info":
13
+ r = d;
20
14
  break;
21
- case 'loading':
22
- Icon = CircularProgress;
15
+ case "loading":
16
+ r = p;
23
17
  break;
24
18
  default:
25
- Icon = Check;
19
+ r = m;
26
20
  }
27
- return /*#__PURE__*/_jsx(Container, {
28
- variant: variant,
29
- ...props,
30
- children: /*#__PURE__*/_jsxs("div", {
31
- className: "result-body",
32
- children: [/*#__PURE__*/_jsx("span", {
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
- LaunchResultMessage.propTypes = {
49
- variant: PropTypes.oneOf(['success', 'error', 'info', 'loading']),
50
- title: PropTypes.string,
51
- subTitle: PropTypes.any,
52
- footer: PropTypes.any
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
- LaunchResultMessage.defaultProps = {
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: ${props => props.theme.palette.common.white};
58
+ color: ${(e) => e.theme.palette.common.white};
86
59
  transition: all ease 0.3s;
87
60
  &.color-success {
88
- background-color: ${props => props.theme.palette.success.main};
61
+ background-color: ${(e) => e.theme.palette.success.main};
89
62
  }
90
63
  &.color-error {
91
- background-color: ${props => props.theme.palette.error.main};
64
+ background-color: ${(e) => e.theme.palette.error.main};
92
65
  }
93
66
  &.color-info {
94
- background-color: ${props => props.theme.palette.primary.main};
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: ${props => props.theme.palette.success.main};
79
+ color: ${(e) => e.theme.palette.success.main};
107
80
  }
108
81
  &.color-error {
109
- color: ${props => props.theme.palette.error.main};
82
+ color: ${(e) => e.theme.palette.error.main};
110
83
  }
111
84
  &.color-info {
112
- color: ${props => props.theme.palette.primary.main};
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: ${props => props.theme.palette.grey[700]};
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 translations = {
1
+ const t = {
2
2
  en: {
3
- optional: 'Optional',
4
- defaultNavSubTitle: 'Launching'
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 };
@@ -1,26 +1,21 @@
1
- import PropTypes from 'prop-types';
2
- import styled from '@emotion/styled';
3
- import { Box } from '@mui/material';
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- function MarkdownBody({
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 codeFont = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important';
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: ${codeFont};
14
+ font-family: ${r};
20
15
  }
21
16
  pre code {
22
17
  font-size: 14px;
23
- font-family: ${codeFont};
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: ${props => props.theme.palette.grey[50]} !important;
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
- MarkdownBody.propTypes = {
49
- children: PropTypes.any.isRequired
43
+ p.propTypes = {
44
+ children: e.any.isRequired
45
+ };
46
+ export {
47
+ p as default
50
48
  };
51
- MarkdownBody.defaultProps = {};
52
- export default MarkdownBody;