@blocklet/launcher-layout 2.1.66 → 2.1.68

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.
Files changed (2) hide show
  1. package/lib/index.js +33 -29
  2. package/package.json +4 -4
package/lib/index.js CHANGED
@@ -19,7 +19,7 @@ var _header = _interopRequireDefault(require("./header"));
19
19
  var _locale = require("./locale");
20
20
  var _nav = _interopRequireDefault(require("./nav"));
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
- const _excluded = ["blockletMeta", "children", "logoUrl", "locale", "headerEndAddons", "pcWidth", "pcHeight", "navLogo", "useOfSkeleton", "stepTip", "contentMaxWidth"];
22
+ const _excluded = ["blockletMeta", "children", "logoUrl", "locale", "header", "headerEndAddons", "pcWidth", "pcHeight", "navLogo", "useOfSkeleton", "stepTip", "contentMaxWidth"];
23
23
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -39,6 +39,7 @@ function Layout(_ref) {
39
39
  children,
40
40
  logoUrl,
41
41
  locale,
42
+ header,
42
43
  headerEndAddons,
43
44
  pcWidth,
44
45
  pcHeight,
@@ -68,35 +69,36 @@ function Layout(_ref) {
68
69
  }
69
70
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, _objectSpread(_objectSpread({}, rest), {}, {
70
71
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Header, {
71
- className: "root-header",
72
72
  maxWidth: contentMaxWidth,
73
73
  width: pcWidth,
74
- children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
75
- className: "left",
76
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
77
- title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
78
- className: "ellipsis-title",
79
- children: (0, _launcherUtil.getBlockletDisplayName)(blockletMeta)
80
- }),
81
- navLogo: navLogo,
82
- subTitle: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
83
- children: ["".concat(stepTip || translations.stepTip, " ").concat(activeStep + 1, "/").concat(totalStepsCount), /*#__PURE__*/(0, _jsxRuntime.jsx)(_smallCircleProgress.default, {
84
- value: (activeStep + 1) / totalStepsCount * 100,
85
- style: {
86
- marginLeft: 3
87
- }
88
- })]
89
- }),
90
- logoUrl: logoUrl,
91
- did: blockletMeta.did,
92
- locale: locale
93
- })
94
- }), navLogo && !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
95
- className: "left",
96
- children: navLogo
97
- }), headerEndAddons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
98
- className: "right",
99
- children: headerEndAddons
74
+ children: [header && header, !header && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
75
+ children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
+ className: "left",
77
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
78
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
79
+ className: "ellipsis-title",
80
+ children: (0, _launcherUtil.getBlockletDisplayName)(blockletMeta)
81
+ }),
82
+ navLogo: navLogo,
83
+ subTitle: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
84
+ children: ["".concat(stepTip || translations.stepTip, " ").concat(activeStep + 1, "/").concat(totalStepsCount), /*#__PURE__*/(0, _jsxRuntime.jsx)(_smallCircleProgress.default, {
85
+ value: (activeStep + 1) / totalStepsCount * 100,
86
+ style: {
87
+ marginLeft: 3
88
+ }
89
+ })]
90
+ }),
91
+ logoUrl: logoUrl,
92
+ did: blockletMeta.did,
93
+ locale: locale
94
+ })
95
+ }), navLogo && !isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
96
+ className: "left",
97
+ children: navLogo
98
+ }), headerEndAddons && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
99
+ className: "right",
100
+ children: headerEndAddons
101
+ })]
100
102
  })]
101
103
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
102
104
  contentMaxWidth: contentMaxWidth,
@@ -129,6 +131,7 @@ Layout.propTypes = {
129
131
  children: _propTypes.default.object.isRequired,
130
132
  logoUrl: _propTypes.default.string,
131
133
  locale: _propTypes.default.oneOf(['en', 'zh']),
134
+ header: _propTypes.default.any,
132
135
  headerEndAddons: _propTypes.default.any,
133
136
  pcWidth: _propTypes.default.any,
134
137
  pcHeight: _propTypes.default.any,
@@ -140,6 +143,7 @@ Layout.propTypes = {
140
143
  Layout.defaultProps = {
141
144
  logoUrl: '',
142
145
  locale: 'en',
146
+ header: null,
143
147
  headerEndAddons: null,
144
148
  pcWidth: '80%',
145
149
  pcHeight: '80%',
@@ -155,7 +159,7 @@ let injectStyle = '';
155
159
  if (ua.includes('iphone os') && ua.includes('crios')) {
156
160
  injectStyle = 'height: calc(100vh - 60px);';
157
161
  }
158
- const Header = _styled.default.header(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n min-width: 900px;\n box-sizing: border-box;\n position: absolute;\n z-index: 200;\n top: 0;\n display: flex;\n max-width: ", ";\n height: 68px;\n align-items: center;\n padding: 24px;\n\n @media (max-height: 900px) {\n width: 100%;\n }\n\n ", " and (min-height: 900px) {\n justify-content: flex-end;\n }\n\n ", " {\n min-width: 360px;\n width: 100%;\n height: ", ";\n padding: 14px 16px;\n justify-content: space-between;\n background: #f6f8fa;\n }\n\n .left {\n flex: 1;\n display: flex;\n align-items: center;\n }\n\n .right {\n display: flex;\n align-items: center;\n ", " {\n button,\n a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n }\n\n .ellipsis-title {\n flex: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n ", " {\n left: 26px;\n width: calc(100% - 26px);\n }\n }\n"])), props => props.width || '80%', props => props.maxWidth, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('md'), HEADER_HEIGHT_MD, props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'));
162
+ const Header = _styled.default.header(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n min-width: 900px;\n box-sizing: border-box;\n position: absolute;\n z-index: 200;\n top: 0;\n display: flex;\n max-width: ", ";\n height: 68px;\n align-items: center;\n\n @media (max-height: 900px) {\n width: 100%;\n }\n\n ", " and (min-height: 900px) {\n justify-content: flex-end;\n }\n\n ", " {\n min-width: 360px;\n width: 100%;\n height: ", ";\n padding: 14px 16px;\n justify-content: space-between;\n background: #f6f8fa;\n }\n\n .left {\n flex: 1;\n display: flex;\n align-items: center;\n }\n\n .right {\n display: flex;\n align-items: center;\n ", " {\n button,\n a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n }\n\n .ellipsis-title {\n flex: 1;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n ", " {\n left: 26px;\n width: calc(100% - 26px);\n }\n }\n"])), props => props.width || '80%', props => props.maxWidth, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('md'), HEADER_HEIGHT_MD, props => props.theme.breakpoints.down('md'), props => props.theme.breakpoints.down('md'));
159
163
  const Root = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n letter-spacing: normal;\n ", "\n\n .circular {\n display: inline-block;\n position: relative;\n width: 15px;\n height: 12px;\n > * {\n position: absolute;\n left: 3px;\n top: 2px;\n width: 100%;\n height: 100%;\n }\n }\n\n ", " {\n background: #f6f8fa;\n }\n\n ", " {\n background: ", ";\n }\n"])), injectStyle, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('md'), props => props.theme.palette.common.white);
160
164
  const LogoContainer = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: block;\n margin-top: 4px;\n"])));
161
165
  var _default = Layout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-layout",
3
- "version": "2.1.66",
3
+ "version": "2.1.68",
4
4
  "description": "Common ux components of launcher",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,8 +39,8 @@
39
39
  "@arcblock/did-connect": "^2.5.68",
40
40
  "@arcblock/icons": "^2.5.68",
41
41
  "@arcblock/ux": "^2.5.68",
42
- "@blocklet/launcher-util": "2.1.66",
43
- "@blocklet/launcher-ux": "2.1.66",
42
+ "@blocklet/launcher-util": "2.1.68",
43
+ "@blocklet/launcher-ux": "2.1.68",
44
44
  "@blocklet/meta": "^1.16.13",
45
45
  "@emotion/react": "^11.11.1",
46
46
  "@emotion/styled": "^11.11.0",
@@ -59,5 +59,5 @@
59
59
  "@storybook/react": "^6.5.16",
60
60
  "babel-plugin-inline-react-svg": "^2.0.2"
61
61
  },
62
- "gitHead": "b219e7db895e39a1b9521a62c3ed321bfc840c2c"
62
+ "gitHead": "91823bd20469757d7bec8a22443040f0bb4e893f"
63
63
  }