@blocklet/launcher-layout 1.5.84 → 1.5.87

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.
@@ -21,7 +21,6 @@ function CompactLayout(_ref) {
21
21
  let {
22
22
  children,
23
23
  bottom,
24
- fixBottomMaxWidth,
25
24
  onBottomFix
26
25
  } = _ref;
27
26
  const mainCon = (0, _react.useRef)(null);
@@ -30,22 +29,35 @@ function CompactLayout(_ref) {
30
29
  const isFix = (0, _react.useRef)(null);
31
30
  const [scrollMode, setScrollMode] = (0, _react.useState)(false);
32
31
  (0, _react.useEffect)(() => {
32
+ let inTimer;
33
+
33
34
  const fixSize = () => {
34
- if (childsCon.current.scrollHeight > mainCon.current.clientHeight - compactCon.current.clientHeight || fixBottomMaxWidth && fixBottomMaxWidth > compactCon.current.clientWidth) {
35
- if (isFix.current !== 'fix') {
36
- onBottomFix('fix');
37
- isFix.current = 'fix';
38
- }
35
+ if (inTimer) {
36
+ return;
37
+ }
39
38
 
40
- setScrollMode(true);
41
- } else {
42
- if (isFix.current !== 'scroll') {
43
- onBottomFix('scroll');
44
- isFix.current = 'scroll';
39
+ inTimer = 1;
40
+ setTimeout(() => {
41
+ if (childsCon.current) {
42
+ if (childsCon.current.scrollHeight > mainCon.current.clientHeight - compactCon.current.clientHeight) {
43
+ if (isFix.current !== 'fix') {
44
+ onBottomFix('fix');
45
+ isFix.current = 'fix';
46
+ }
47
+
48
+ setScrollMode(true);
49
+ } else {
50
+ if (isFix.current !== 'scroll') {
51
+ onBottomFix('scroll');
52
+ isFix.current = 'scroll';
53
+ }
54
+
55
+ setScrollMode(false);
56
+ }
45
57
  }
46
58
 
47
- setScrollMode(false);
48
- }
59
+ inTimer = null;
60
+ }, 100);
49
61
  };
50
62
 
51
63
  let resizeObs;
@@ -57,6 +69,7 @@ function CompactLayout(_ref) {
57
69
  }
58
70
 
59
71
  resizeObs.observe(mainCon.current);
72
+ resizeObs.observe(childsCon.current);
60
73
  return () => {
61
74
  if (resizeObs) {
62
75
  resizeObs.disconnect();
@@ -85,11 +98,9 @@ const Container = _styledComponents.default.div.withConfig({
85
98
  CompactLayout.propTypes = {
86
99
  children: _propTypes.default.any,
87
100
  bottom: _propTypes.default.element.isRequired,
88
- fixBottomMaxWidth: _propTypes.default.number,
89
101
  onBottomFix: _propTypes.default.func
90
102
  };
91
103
  CompactLayout.defaultProps = {
92
104
  children: [],
93
- fixBottomMaxWidth: 0,
94
105
  onBottomFix: () => {}
95
106
  };
package/lib/index.js CHANGED
@@ -144,7 +144,7 @@ if (ua.includes('iphone os') && ua.includes('crios')) {
144
144
  const Root = _styledComponents.default.div.withConfig({
145
145
  displayName: "src__Root",
146
146
  componentId: "sc-11nbl7p-2"
147
- })(["display:flex;flex-direction:column;justify-content:center;align-items:center;height:100vh;", " .ellipsis-title{flex:1;position:absolute;left:0;top:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}", "{background:#e7ebea;}", "{background:", ";}.root-header{position:fixed;z-index:200;top:0;display:flex;width:100%;height:56px;align-items:center;", "{box-shadow:0px 1px 1px 0px rgba(168,180,197,0.12);}", "{padding:24px;justify-content:flex-end;}", "{padding:14px 16px;justify-content:space-between;background:", ";}.left{flex:1;display:flex;align-items:center;.menu__icon{margin-right:16px;color:", ";}}.right{display:flex;align-items:center;", "{button,a{padding-left:8px;padding-right:8px;}}}}"], injectStyle, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.common.white, props => props.theme.breakpoints.down('sm'), props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.common.white, props => props.theme.palette.grey[500], props => props.theme.breakpoints.down('sm'));
147
+ })(["display:flex;flex-direction:column;justify-content:center;align-items:center;height:100vh;", " .ellipsis-title{flex:1;position:absolute;left:0;top:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}", "{background:#f6f8fa;}", "{background:", ";}.root-header{position:fixed;z-index:200;top:0;display:flex;width:100%;height:56px;align-items:center;box-shadow:0px 1px 1px 0px rgba(168,180,197,0.12);", "{padding:24px;justify-content:flex-end;}", "{padding:14px 16px;justify-content:space-between;background:#f6f8fa;}.left{flex:1;display:flex;align-items:center;.menu__icon{margin-right:16px;color:", ";}}.right{display:flex;align-items:center;", "{button,a{padding-left:8px;padding-right:8px;}}}}"], injectStyle, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.common.white, props => props.theme.breakpoints.up('sm'), props => props.theme.breakpoints.down('sm'), props => props.theme.palette.grey[500], props => props.theme.breakpoints.down('sm'));
148
148
 
149
149
  const Center = _styledComponents.default.div.withConfig({
150
150
  displayName: "src__Center",
@@ -73,7 +73,7 @@ function LaunchResultMessage(_ref) {
73
73
  LaunchResultMessage.propTypes = {
74
74
  variant: _propTypes.default.oneOf(['success', 'error', 'info', 'loading']),
75
75
  title: _propTypes.default.string,
76
- subTitle: _propTypes.default.string,
76
+ subTitle: _propTypes.default.any,
77
77
  footer: _propTypes.default.any
78
78
  };
79
79
  LaunchResultMessage.defaultProps = {
@@ -86,4 +86,4 @@ LaunchResultMessage.defaultProps = {
86
86
  const Container = _styledComponents.default.div.withConfig({
87
87
  displayName: "launch-result-message__Container",
88
88
  componentId: "sc-msneii-0"
89
- })(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;.result-body{max-width:500px;text-align:center;margin-top:-64px;}.result-icon{display:inline-flex;justify-content:center;align-items:center;margin-bottom:24px;width:48px;height:48px;border-radius:100%;color:", ";transition:all ease 0.3s;&.color-success{background-color:", ";}&.color-error{background-color:", ";}&.color-info{background-color:", ";}}.result-title{height:34px;font-size:24px;margin-bottom:8px;font-weight:bolder;transition:all ease 0.3s;&.ele-hide{height:0;opacity:0;margin-bottom:0;}&.color-success{color:", ";}&.color-error{color:", ";}&.color-info{color:", ";}&.ele-hide{line-height:0;opacity:0;}}.result-sub-title{margin:0 auto;max-width:90%;color:", ";font-size:14px;line-height:1.21em;transition:all ease 0.3s;&.ele-hide{line-height:0;opacity:0;}}.result-footer{margin-top:38px;height:70px;overflow:hidden;transition:all ease 0.3s;&.ele-hide{margin-top:0;height:0;opacity:0;}}"], props => props.theme.palette.common.white, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.grey[700]);
89
+ })(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;.result-body{padding:0 14px;max-width:500px;text-align:center;margin-top:-64px;}.result-icon{display:inline-flex;justify-content:center;align-items:center;margin-bottom:24px;width:48px;height:48px;border-radius:100%;color:", ";transition:all ease 0.3s;&.color-success{background-color:", ";}&.color-error{background-color:", ";}&.color-info{background-color:", ";}}.result-title{height:34px;font-size:24px;margin-bottom:8px;font-weight:bolder;transition:all ease 0.3s;transition-delay:0.2s;&.color-success{color:", ";}&.color-error{color:", ";}&.color-info{color:", ";}&.ele-hide{height:0;opacity:0;margin-bottom:0;}}.result-sub-title{margin:0 auto;min-height:17px;color:", ";font-size:14px;line-height:1.21em;transition:all ease 0.3s;transition-delay:0.2s;&.ele-hide{line-height:0;opacity:0;min-height:0;}}.result-footer{margin-top:24px;height:70px;overflow:hidden;transition:all ease 0.3s;transition-delay:0.2s;&.ele-hide{margin-top:0;height:0;opacity:0;}}"], props => props.theme.palette.common.white, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.success.main, props => props.theme.palette.error.main, props => props.theme.palette.primary.main, props => props.theme.palette.grey[700]);
@@ -11,14 +11,22 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
+ const _excluded = ["title", "subTitle"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
18
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
+
20
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
+
16
22
  function PageHeader(_ref) {
17
23
  let {
18
24
  title,
19
25
  subTitle
20
- } = _ref;
21
- return /*#__PURE__*/_react.default.createElement(Content, null, /*#__PURE__*/_react.default.createElement("div", {
26
+ } = _ref,
27
+ rest = _objectWithoutProperties(_ref, _excluded);
28
+
29
+ return /*#__PURE__*/_react.default.createElement(Content, rest, /*#__PURE__*/_react.default.createElement("div", {
22
30
  className: "title"
23
31
  }, title), /*#__PURE__*/_react.default.createElement("div", {
24
32
  className: "sub-title"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-layout",
3
- "version": "1.5.84",
3
+ "version": "1.5.87",
4
4
  "description": "Common ux components of launcher",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,10 +37,10 @@
37
37
  "react": ">=16.12.0"
38
38
  },
39
39
  "dependencies": {
40
- "@arcblock/did-connect": "^1.16.61",
41
- "@arcblock/icons": "^1.16.61",
42
- "@arcblock/ux": "^1.16.61",
43
- "@blocklet/meta": "^1.7.0",
40
+ "@arcblock/did-connect": "^1.16.67",
41
+ "@arcblock/icons": "^1.16.67",
42
+ "@arcblock/ux": "^1.16.67",
43
+ "@blocklet/meta": "^1.7.4",
44
44
  "@material-ui/core": "^4.12.3",
45
45
  "@material-ui/icons": "^4.11.2",
46
46
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -58,5 +58,5 @@
58
58
  "babel-plugin-inline-react-svg": "^2.0.1",
59
59
  "babel-plugin-styled-components": "^1.10.7"
60
60
  },
61
- "gitHead": "f9a7cef8d56f8face6b97afdaaf6dfcb909150bf"
61
+ "gitHead": "4192a7665a034de566a84ae7a6f741290923afbe"
62
62
  }