@fonixtree/magic-design 1.0.199 → 1.0.202

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.
@@ -31,6 +31,8 @@ var _mobx = require("../../../../../mobx");
31
31
 
32
32
  var _locale = require("../../../../../locale");
33
33
 
34
+ var _androidUtil = require("../../../../../utils/androidUtil");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  var __extends = void 0 && (void 0).__extends || function () {
@@ -151,10 +153,13 @@ function (_super) {
151
153
  autoplay = false;
152
154
  }
153
155
 
156
+ var hasAppBack = (0, _androidUtil.browserVersion)().isDitoApp && (0, _androidUtil.browserVersion)().isDitoMain || window.magicDesign.designMode;
154
157
  return /*#__PURE__*/_react["default"].createElement("div", {
155
158
  className: "m-search-banner-mobile"
156
159
  }, /*#__PURE__*/_react["default"].createElement("div", {
157
- className: "search-bar"
160
+ className: (0, _classnames["default"])('search-bar', {
161
+ with_app_back: hasAppBack
162
+ })
158
163
  }, /*#__PURE__*/_react["default"].createElement("div", {
159
164
  className: "right"
160
165
  }, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -9,9 +9,13 @@
9
9
  flex-direction: row-reverse;
10
10
  align-items: center;
11
11
  justify-content: space-between;
12
- width: 100%;
13
12
  position: absolute;
14
13
  z-index: 2;
14
+ width: 100%;
15
+ }
16
+ .m-search-banner-mobile .search-bar.with_app_back {
17
+ width: calc(100% - 0.7rem);
18
+ margin-left: 0.7rem;
15
19
  }
16
20
  .m-search-banner-mobile .search-bar .right {
17
21
  display: flex;
@@ -5,6 +5,7 @@
5
5
  flex-direction: row-reverse;
6
6
  align-items: center;
7
7
  justify-content: space-between;
8
+ width: 100%;
8
9
  }
9
10
  .m-search-bar .right {
10
11
  display: flex;
@@ -167,7 +167,7 @@ function (_super) {
167
167
  style: {
168
168
  background: pageBackground
169
169
  }
170
- }, this.filterCompFloor(pageData).length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
170
+ }, this.filterCompFloor(pageData).length > 0 && device === 'mobile' && /*#__PURE__*/_react["default"].createElement("div", {
171
171
  className: "btn_app_back"
172
172
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
173
173
  color: "#fff",
@@ -66,9 +66,7 @@
66
66
  position: relative;
67
67
 
68
68
  .btn_app_back {
69
- position: sticky;
70
- top: 8px;
71
- left: 13px;
69
+ position: fixed;
72
70
  background: #7C7C7C;
73
71
  width: 32px;
74
72
  height: 32px;
@@ -78,8 +76,8 @@
78
76
  display: flex;
79
77
  align-items: center;
80
78
  justify-content: center;
81
- float: left;
82
- // margin: 8px 0 0 13px;
79
+ margin-left: 13px;
80
+ margin-top: 8px;
83
81
  }
84
82
  }
85
83
  }
@@ -102,9 +100,5 @@
102
100
  overflow: scroll;
103
101
  box-sizing: content-box;
104
102
  }
105
-
106
- .btn_app_back {
107
- display: none;
108
- }
109
103
  }
110
104
  }
@@ -77,7 +77,8 @@ var Renderer = function Renderer(props) {
77
77
  var pageData = props.pageData,
78
78
  outputType = props.outputType,
79
79
  noSetWindow = props.noSetWindow,
80
- isPreview = props.isPreview;
80
+ isPreview = props.isPreview,
81
+ device = props.device;
81
82
 
82
83
  var _a = (0, _react.useState)([]),
83
84
  floors = _a[0],
@@ -200,13 +201,14 @@ var Renderer = function Renderer(props) {
200
201
  };
201
202
  };
202
203
 
204
+ console.log('window.magicDesign.designMode', window.magicDesign.designMode);
203
205
  return /*#__PURE__*/_react["default"].createElement("div", {
204
206
  className: "render_wrap",
205
207
  magic_design: "",
206
208
  style: __assign({
207
209
  background: pageBackground
208
210
  }, getRestStyle())
209
- }, floors.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
211
+ }, floors.length > 0 && device === 'mobile' && window.magicDesign.designMode && /*#__PURE__*/_react["default"].createElement("div", {
210
212
  className: "btn_app_back"
211
213
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
212
214
  color: "#fff",
@@ -1,8 +1,9 @@
1
1
  .render_wrap {
2
2
  .btn_app_back {
3
- position: sticky;
4
- top: 8px;
5
- left: 13px;
3
+ position: fixed;
4
+ top: 28px;
5
+ left: unset;
6
+ margin-left: 13px;
6
7
  background: #7C7C7C;
7
8
  width: 32px;
8
9
  height: 32px;
@@ -12,7 +13,5 @@
12
13
  display: flex;
13
14
  align-items: center;
14
15
  justify-content: center;
15
- float: left;
16
- // margin: 8px 0 0 13px;
17
16
  }
18
17
  }
@@ -27,7 +27,8 @@ var browserVersion = function browserVersion() {
27
27
  isDitoApp: u.indexOf('mydito') > -1,
28
28
  ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
29
29
  ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
30
- isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
30
+ isAshitaApp: u.indexOf('app/ASHITA-APP') > -1,
31
+ isDitoMain: ['/', '/main/home'].includes(window.location.pathname)
31
32
  };
32
33
  };
33
34
 
@@ -31,6 +31,8 @@ var _mobx = require("../../../../../mobx");
31
31
 
32
32
  var _locale = require("../../../../../locale");
33
33
 
34
+ var _androidUtil = require("../../../../../utils/androidUtil");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  var __extends = void 0 && (void 0).__extends || function () {
@@ -151,10 +153,13 @@ function (_super) {
151
153
  autoplay = false;
152
154
  }
153
155
 
156
+ var hasAppBack = (0, _androidUtil.browserVersion)().isDitoApp && (0, _androidUtil.browserVersion)().isDitoMain || window.magicDesign.designMode;
154
157
  return /*#__PURE__*/_react["default"].createElement("div", {
155
158
  className: "m-search-banner-mobile"
156
159
  }, /*#__PURE__*/_react["default"].createElement("div", {
157
- className: "search-bar"
160
+ className: (0, _classnames["default"])('search-bar', {
161
+ with_app_back: hasAppBack
162
+ })
158
163
  }, /*#__PURE__*/_react["default"].createElement("div", {
159
164
  className: "right"
160
165
  }, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -9,9 +9,13 @@
9
9
  flex-direction: row-reverse;
10
10
  align-items: center;
11
11
  justify-content: space-between;
12
- width: 100%;
13
12
  position: absolute;
14
13
  z-index: 2;
14
+ width: 100%;
15
+ }
16
+ .m-search-banner-mobile .search-bar.with_app_back {
17
+ width: calc(100% - 0.7rem);
18
+ margin-left: 0.7rem;
15
19
  }
16
20
  .m-search-banner-mobile .search-bar .right {
17
21
  display: flex;
@@ -5,6 +5,7 @@
5
5
  flex-direction: row-reverse;
6
6
  align-items: center;
7
7
  justify-content: space-between;
8
+ width: 100%;
8
9
  }
9
10
  .m-search-bar .right {
10
11
  display: flex;
@@ -167,7 +167,7 @@ function (_super) {
167
167
  style: {
168
168
  background: pageBackground
169
169
  }
170
- }, this.filterCompFloor(pageData).length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
170
+ }, this.filterCompFloor(pageData).length > 0 && device === 'mobile' && /*#__PURE__*/_react["default"].createElement("div", {
171
171
  className: "btn_app_back"
172
172
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
173
173
  color: "#fff",
@@ -66,9 +66,7 @@
66
66
  position: relative;
67
67
 
68
68
  .btn_app_back {
69
- position: sticky;
70
- top: 8px;
71
- left: 13px;
69
+ position: fixed;
72
70
  background: #7C7C7C;
73
71
  width: 32px;
74
72
  height: 32px;
@@ -78,8 +76,8 @@
78
76
  display: flex;
79
77
  align-items: center;
80
78
  justify-content: center;
81
- float: left;
82
- // margin: 8px 0 0 13px;
79
+ margin-left: 13px;
80
+ margin-top: 8px;
83
81
  }
84
82
  }
85
83
  }
@@ -102,9 +100,5 @@
102
100
  overflow: scroll;
103
101
  box-sizing: content-box;
104
102
  }
105
-
106
- .btn_app_back {
107
- display: none;
108
- }
109
103
  }
110
104
  }
@@ -77,7 +77,8 @@ var Renderer = function Renderer(props) {
77
77
  var pageData = props.pageData,
78
78
  outputType = props.outputType,
79
79
  noSetWindow = props.noSetWindow,
80
- isPreview = props.isPreview;
80
+ isPreview = props.isPreview,
81
+ device = props.device;
81
82
 
82
83
  var _a = (0, _react.useState)([]),
83
84
  floors = _a[0],
@@ -200,13 +201,14 @@ var Renderer = function Renderer(props) {
200
201
  };
201
202
  };
202
203
 
204
+ console.log('window.magicDesign.designMode', window.magicDesign.designMode);
203
205
  return /*#__PURE__*/_react["default"].createElement("div", {
204
206
  className: "render_wrap",
205
207
  magic_design: "",
206
208
  style: __assign({
207
209
  background: pageBackground
208
210
  }, getRestStyle())
209
- }, floors.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
211
+ }, floors.length > 0 && device === 'mobile' && window.magicDesign.designMode && /*#__PURE__*/_react["default"].createElement("div", {
210
212
  className: "btn_app_back"
211
213
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
212
214
  color: "#fff",
@@ -1,8 +1,9 @@
1
1
  .render_wrap {
2
2
  .btn_app_back {
3
- position: sticky;
4
- top: 8px;
5
- left: 13px;
3
+ position: fixed;
4
+ top: 28px;
5
+ left: unset;
6
+ margin-left: 13px;
6
7
  background: #7C7C7C;
7
8
  width: 32px;
8
9
  height: 32px;
@@ -12,7 +13,5 @@
12
13
  display: flex;
13
14
  align-items: center;
14
15
  justify-content: center;
15
- float: left;
16
- // margin: 8px 0 0 13px;
17
16
  }
18
17
  }
@@ -27,7 +27,8 @@ var browserVersion = function browserVersion() {
27
27
  isDitoApp: u.indexOf('mydito') > -1,
28
28
  ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
29
29
  ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
30
- isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
30
+ isAshitaApp: u.indexOf('app/ASHITA-APP') > -1,
31
+ isDitoMain: ['/', '/main/home'].includes(window.location.pathname)
31
32
  };
32
33
  };
33
34
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.199",
4
+ "version": "1.0.202",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",