@fonixtree/magic-design 2.0.64 → 2.0.67

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.
@@ -6,7 +6,6 @@
6
6
  &.img {
7
7
  max-width: 75%;
8
8
  max-height: 30px;
9
- height: 28px;
10
9
 
11
10
  &.small {
12
11
  // max-width: 30px;
@@ -63,7 +63,8 @@ function PageCompList(_a) {
63
63
  pageData = _a.pageData,
64
64
  onAdd = _a.onAdd,
65
65
  renderPagesManage = _a.renderPagesManage,
66
- pageName = _a.pageName;
66
+ pageName = _a.pageName,
67
+ pageType = _a.pageType;
67
68
 
68
69
  var _b = (0, _react.useState)(pageData || []),
69
70
  components = _b[0],
@@ -315,7 +316,7 @@ function PageCompList(_a) {
315
316
  className: "page-comp-list"
316
317
  }, /*#__PURE__*/_react["default"].createElement("div", {
317
318
  className: "title mb16"
318
- }, pageName), /*#__PURE__*/_react["default"].createElement(_common.Button, {
319
+ }, pageName), pageType !== 'Menu' && /*#__PURE__*/_react["default"].createElement(_common.Button, {
319
320
  icon: "icon-add",
320
321
  onClick: onAdd,
321
322
  size: "large",
@@ -116,7 +116,8 @@ function (_super) {
116
116
  language = _a.language,
117
117
  outputType = _a.outputType,
118
118
  onHtmlSave = _a.onHtmlSave,
119
- onHtmlBack = _a.onHtmlBack;
119
+ onHtmlBack = _a.onHtmlBack,
120
+ pageType = _a.pageType;
120
121
  var languageTemp = langBook[language] || {};
121
122
  return /*#__PURE__*/_react["default"].createElement("div", {
122
123
  className: "quick_menu_wrap"
@@ -138,7 +139,7 @@ function (_super) {
138
139
  className: "menu_center"
139
140
  }, /*#__PURE__*/_react["default"].createElement("div", {
140
141
  className: "device_group"
141
- }, /*#__PURE__*/_react["default"].createElement("div", {
142
+ }, pageType !== 'Menu' && /*#__PURE__*/_react["default"].createElement("div", {
142
143
  className: (0, _classnames["default"])('device_pc', {
143
144
  active: device === _constants.deviceTypeMap.PC
144
145
  }),
@@ -150,7 +151,8 @@ function (_super) {
150
151
  type: "icon-pc"
151
152
  })), /*#__PURE__*/_react["default"].createElement("div", {
152
153
  className: (0, _classnames["default"])('device_phone', {
153
- active: device === _constants.deviceTypeMap.PHONE
154
+ active: device === _constants.deviceTypeMap.PHONE,
155
+ only_mobile: pageType === 'Menu'
154
156
  }),
155
157
  "data-code": _constants.quickMenuCode.MODE_PHONE,
156
158
  onClick: this.onBtnClick
@@ -61,6 +61,10 @@
61
61
  align-items: center;
62
62
  justify-content: center;
63
63
  }
64
+ .only_mobile {
65
+ border-top-left-radius: 8px;
66
+ border-bottom-left-radius: 8px;
67
+ }
64
68
 
65
69
  .active {
66
70
  background: #E9F0FF;
@@ -594,6 +594,7 @@ function (_super) {
594
594
  onHtmlBack: _this.onHtmlBack,
595
595
  onHtmlSave: _this.onHtmlSave,
596
596
  outputType: _this.props.outputType,
597
+ pageType: _this.props.pageType,
597
598
  redoDisable: !_this.history.redoAble(),
598
599
  undoDisable: !_this.history.undoAble()
599
600
  });
@@ -752,7 +753,8 @@ function (_super) {
752
753
  pageName = _b.pageName,
753
754
  onCancelPublish = _b.onCancelPublish,
754
755
  leftTitle = _b.leftTitle,
755
- outputType = _b.outputType;
756
+ outputType = _b.outputType,
757
+ pageType = _b.pageType;
756
758
  var renderPagesManage = pagesManager;
757
759
 
758
760
  if (outputType == 'html') {
@@ -776,6 +778,7 @@ function (_super) {
776
778
  onAdd: this.onAdd,
777
779
  pageData: MPageData,
778
780
  pageName: pageName,
781
+ pageType: pageType,
779
782
  renderPagesManage: renderPagesManage,
780
783
  setPageData: this.setPageData
781
784
  }), /*#__PURE__*/_react["default"].createElement(_CompListPanel["default"], {
@@ -286,6 +286,17 @@ var getCoupon = function getCoupon(couponId) {
286
286
  });
287
287
  };
288
288
 
289
+ function isUrl(string) {
290
+ var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
291
+ '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
292
+ '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
293
+ '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
294
+ '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
295
+ '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
296
+
297
+ return !!pattern.test(string);
298
+ }
299
+
289
300
  var clickUrl = function clickUrl(url) {
290
301
  if (url === void 0) {
291
302
  url = '';
@@ -342,9 +353,28 @@ var clickUrl = function clickUrl(url) {
342
353
  }
343
354
 
344
355
  return;
356
+ } // 输入的是完整的跳转地址
357
+
358
+
359
+ if (isUrl(link)) {
360
+ if (!link.includes(window.location.host)) {
361
+ // 跳转外链
362
+ if (localStorage.getItem('isLogin') === 'Y') {
363
+ // 登录情况下 需要把token带上
364
+ if (link.includes('?')) {
365
+ var a = link + "&token=" + localStorage.getItem('h5Token');
366
+ window.open(a);
367
+ } else {
368
+ var a = link + "?token=" + localStorage.getItem('h5Token');
369
+ window.open(a);
370
+ }
371
+ } else {
372
+ window.open(link);
373
+ }
374
+ }
375
+ } else {
376
+ (0, _commonUtil.navigateTo)(link);
345
377
  }
346
-
347
- (0, _commonUtil.navigateTo)(link);
348
378
  }
349
379
  };
350
380
 
@@ -6,7 +6,6 @@
6
6
  &.img {
7
7
  max-width: 75%;
8
8
  max-height: 30px;
9
- height: 28px;
10
9
 
11
10
  &.small {
12
11
  // max-width: 30px;
@@ -63,7 +63,8 @@ function PageCompList(_a) {
63
63
  pageData = _a.pageData,
64
64
  onAdd = _a.onAdd,
65
65
  renderPagesManage = _a.renderPagesManage,
66
- pageName = _a.pageName;
66
+ pageName = _a.pageName,
67
+ pageType = _a.pageType;
67
68
 
68
69
  var _b = (0, _react.useState)(pageData || []),
69
70
  components = _b[0],
@@ -315,7 +316,7 @@ function PageCompList(_a) {
315
316
  className: "page-comp-list"
316
317
  }, /*#__PURE__*/_react["default"].createElement("div", {
317
318
  className: "title mb16"
318
- }, pageName), /*#__PURE__*/_react["default"].createElement(_common.Button, {
319
+ }, pageName), pageType !== 'Menu' && /*#__PURE__*/_react["default"].createElement(_common.Button, {
319
320
  icon: "icon-add",
320
321
  onClick: onAdd,
321
322
  size: "large",
@@ -116,7 +116,8 @@ function (_super) {
116
116
  language = _a.language,
117
117
  outputType = _a.outputType,
118
118
  onHtmlSave = _a.onHtmlSave,
119
- onHtmlBack = _a.onHtmlBack;
119
+ onHtmlBack = _a.onHtmlBack,
120
+ pageType = _a.pageType;
120
121
  var languageTemp = langBook[language] || {};
121
122
  return /*#__PURE__*/_react["default"].createElement("div", {
122
123
  className: "quick_menu_wrap"
@@ -138,7 +139,7 @@ function (_super) {
138
139
  className: "menu_center"
139
140
  }, /*#__PURE__*/_react["default"].createElement("div", {
140
141
  className: "device_group"
141
- }, /*#__PURE__*/_react["default"].createElement("div", {
142
+ }, pageType !== 'Menu' && /*#__PURE__*/_react["default"].createElement("div", {
142
143
  className: (0, _classnames["default"])('device_pc', {
143
144
  active: device === _constants.deviceTypeMap.PC
144
145
  }),
@@ -150,7 +151,8 @@ function (_super) {
150
151
  type: "icon-pc"
151
152
  })), /*#__PURE__*/_react["default"].createElement("div", {
152
153
  className: (0, _classnames["default"])('device_phone', {
153
- active: device === _constants.deviceTypeMap.PHONE
154
+ active: device === _constants.deviceTypeMap.PHONE,
155
+ only_mobile: pageType === 'Menu'
154
156
  }),
155
157
  "data-code": _constants.quickMenuCode.MODE_PHONE,
156
158
  onClick: this.onBtnClick
@@ -61,6 +61,10 @@
61
61
  align-items: center;
62
62
  justify-content: center;
63
63
  }
64
+ .only_mobile {
65
+ border-top-left-radius: 8px;
66
+ border-bottom-left-radius: 8px;
67
+ }
64
68
 
65
69
  .active {
66
70
  background: #E9F0FF;
@@ -594,6 +594,7 @@ function (_super) {
594
594
  onHtmlBack: _this.onHtmlBack,
595
595
  onHtmlSave: _this.onHtmlSave,
596
596
  outputType: _this.props.outputType,
597
+ pageType: _this.props.pageType,
597
598
  redoDisable: !_this.history.redoAble(),
598
599
  undoDisable: !_this.history.undoAble()
599
600
  });
@@ -752,7 +753,8 @@ function (_super) {
752
753
  pageName = _b.pageName,
753
754
  onCancelPublish = _b.onCancelPublish,
754
755
  leftTitle = _b.leftTitle,
755
- outputType = _b.outputType;
756
+ outputType = _b.outputType,
757
+ pageType = _b.pageType;
756
758
  var renderPagesManage = pagesManager;
757
759
 
758
760
  if (outputType == 'html') {
@@ -776,6 +778,7 @@ function (_super) {
776
778
  onAdd: this.onAdd,
777
779
  pageData: MPageData,
778
780
  pageName: pageName,
781
+ pageType: pageType,
779
782
  renderPagesManage: renderPagesManage,
780
783
  setPageData: this.setPageData
781
784
  }), /*#__PURE__*/_react["default"].createElement(_CompListPanel["default"], {
@@ -286,6 +286,17 @@ var getCoupon = function getCoupon(couponId) {
286
286
  });
287
287
  };
288
288
 
289
+ function isUrl(string) {
290
+ var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
291
+ '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
292
+ '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
293
+ '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
294
+ '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
295
+ '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
296
+
297
+ return !!pattern.test(string);
298
+ }
299
+
289
300
  var clickUrl = function clickUrl(url) {
290
301
  if (url === void 0) {
291
302
  url = '';
@@ -342,9 +353,28 @@ var clickUrl = function clickUrl(url) {
342
353
  }
343
354
 
344
355
  return;
356
+ } // 输入的是完整的跳转地址
357
+
358
+
359
+ if (isUrl(link)) {
360
+ if (!link.includes(window.location.host)) {
361
+ // 跳转外链
362
+ if (localStorage.getItem('isLogin') === 'Y') {
363
+ // 登录情况下 需要把token带上
364
+ if (link.includes('?')) {
365
+ var a = link + "&token=" + localStorage.getItem('h5Token');
366
+ window.open(a);
367
+ } else {
368
+ var a = link + "?token=" + localStorage.getItem('h5Token');
369
+ window.open(a);
370
+ }
371
+ } else {
372
+ window.open(link);
373
+ }
374
+ }
375
+ } else {
376
+ (0, _commonUtil.navigateTo)(link);
345
377
  }
346
-
347
- (0, _commonUtil.navigateTo)(link);
348
378
  }
349
379
  };
350
380
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.64",
4
+ "version": "2.0.67",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",