@fonixtree/magic-design 2.0.27 → 2.0.29

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 (45) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/common/Field/index.js +20 -3
  3. package/es/common/ImageLazy/index.js +171 -0
  4. package/es/common/LinkModal/CatgTable/index.js +1 -1
  5. package/es/common/LinkModal/FilteredProductModal/index.js +2 -2
  6. package/es/common/LinkModal/ProductDetailPage/index.js +1 -1
  7. package/es/composite-comp/bol/components/Location/defaultJSON.js +22 -16
  8. package/es/composite-comp/bol/components/Location/index.js +20 -58
  9. package/es/composite-comp/bol/components/Location/index.less +15 -0
  10. package/es/composite-comp/bol/config-panels/LocationConfig/index.js +50 -23
  11. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +16 -12
  12. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +1 -1
  13. package/es/constants/component-types.js +6 -2
  14. package/es/constants/index.js +4 -0
  15. package/es/constants/layout.js +9 -1
  16. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +1 -1
  17. package/es/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +1 -1
  18. package/es/locale/en/en.json +2 -0
  19. package/es/locale/es/es.json +2 -0
  20. package/es/locale/id/id.json +2 -0
  21. package/es/meta-comp/components/Image/index.js +4 -5
  22. package/lib/assets/fonts/.DS_Store +0 -0
  23. package/lib/common/Field/index.js +20 -3
  24. package/lib/common/ImageLazy/index.js +171 -0
  25. package/lib/common/LinkModal/CatgTable/index.js +1 -1
  26. package/lib/common/LinkModal/FilteredProductModal/index.js +2 -2
  27. package/lib/common/LinkModal/ProductDetailPage/index.js +1 -1
  28. package/lib/composite-comp/bol/components/Location/defaultJSON.js +22 -16
  29. package/lib/composite-comp/bol/components/Location/index.js +20 -58
  30. package/lib/composite-comp/bol/components/Location/index.less +15 -0
  31. package/lib/composite-comp/bol/config-panels/LocationConfig/index.js +50 -23
  32. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +16 -12
  33. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +1 -1
  34. package/lib/constants/component-types.js +6 -2
  35. package/lib/constants/index.js +4 -0
  36. package/lib/constants/layout.js +9 -1
  37. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +1 -1
  38. package/lib/core/Designer/ToolBarModal/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +1 -1
  39. package/lib/locale/en/en.json +2 -0
  40. package/lib/locale/es/es.json +2 -0
  41. package/lib/locale/id/id.json +2 -0
  42. package/lib/meta-comp/components/Image/index.js +4 -5
  43. package/package.json +1 -1
  44. package/es/composite-comp/bol/config-panels/LocationConfig/MyEditor/index.js +0 -42
  45. package/lib/composite-comp/bol/config-panels/LocationConfig/MyEditor/index.js +0 -42
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.videoPCLayout = exports.videoH5Layout = exports.searchLayout = exports.recommendLayoutPc = exports.recommendLayoutMobile = exports.pcNavigationLayout = exports.newsletterLayout = exports.mobileNavigationLayout = exports.imageTextLayoutPc = exports.imageTextLayoutMobile = exports.imageGalleryLayout = exports.dividerLayout = exports.carouselLayout = exports.WalletLayout = void 0;
6
+ exports.videoPCLayout = exports.videoH5Layout = exports.searchLayout = exports.recommendLayoutPc = exports.recommendLayoutMobile = exports.pcNavigationLayout = exports.newsletterLayout = exports.mobileNavigationLayout = exports.locationLayout = exports.imageTextLayoutPc = exports.imageTextLayoutMobile = exports.imageGalleryLayout = exports.dividerLayout = exports.carouselLayout = exports.WalletLayout = void 0;
7
7
 
8
8
  var _dividerLayout = _interopRequireDefault(require("../assets/images/layout-icon/dividerLayout.svg"));
9
9
 
@@ -43,6 +43,8 @@ var _imageTextRight = _interopRequireDefault(require("../assets/images/layout-ic
43
43
 
44
44
  var _newsletter = _interopRequireDefault(require("../assets/images/layout-icon/newsletter.svg"));
45
45
 
46
+ var _locationLayout = _interopRequireDefault(require("../assets/images/layout-icon/locationLayout.png"));
47
+
46
48
  var _layoutRecommend = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-1.png"));
47
49
 
48
50
  var _layoutRecommend2 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-2.png"));
@@ -90,6 +92,12 @@ var searchLayout = [{
90
92
  image: _layoutSearch["default"]
91
93
  }];
92
94
  exports.searchLayout = searchLayout;
95
+ var locationLayout = [{
96
+ id: 'top',
97
+ name: 'top',
98
+ image: _locationLayout["default"]
99
+ }];
100
+ exports.locationLayout = locationLayout;
93
101
  var imageGalleryLayout = [{
94
102
  id: 'layout1',
95
103
  name: 'layout1',
@@ -89,7 +89,7 @@ function (_super) {
89
89
  }), /*#__PURE__*/_react["default"].createElement("span", {
90
90
  className: "commit-btn",
91
91
  onClick: this.onCommit
92
- }, "\u786E\u5B9A"))));
92
+ }, "Confirm"))));
93
93
  };
94
94
 
95
95
  return LinkInputPicker;
@@ -89,7 +89,7 @@ function (_super) {
89
89
  }), /*#__PURE__*/_react["default"].createElement("span", {
90
90
  className: "commit-btn",
91
91
  onClick: this.onCommit
92
- }, "\u786E\u5B9A"))));
92
+ }, "Confirm"))));
93
93
  };
94
94
 
95
95
  return LinkInputPicker;
@@ -1,4 +1,6 @@
1
1
  {
2
+ "ADDRESS": "Address",
3
+ "LOCATION_LOGO": "Location Logo",
2
4
  "MESSAGE_ICON": "Message icon",
3
5
  "CART_ICON": "Cart icon",
4
6
  "RECOMMENDED_SIZE": "Recommended Size",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "ADDRESS": "Address",
3
+ "LOCATION_LOGO": "Location Logo",
2
4
  "MESSAGE_ICON": "Message icon",
3
5
  "CART_ICON": "Cart icon",
4
6
  "RECOMMENDED_SIZE": "Recommended Size",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "ADDRESS": "Address",
3
+ "LOCATION_LOGO": "Location Logo",
2
4
  "MESSAGE_ICON": "Message icon",
3
5
  "CART_ICON": "Cart icon",
4
6
  "RECOMMENDED_SIZE": "Recommended Size",
@@ -21,8 +21,6 @@ var _commonUtil = require("../../../utils/commonUtil");
21
21
 
22
22
  var _decorator = require("../../../decorator");
23
23
 
24
- var _ImageLazy = _interopRequireDefault(require("../../../common/ImageLazy"));
25
-
26
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
25
 
28
26
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -192,9 +190,10 @@ function (_super) {
192
190
  onClick: function onClick() {
193
191
  (0, _coreUtil.clickUrl)(data.content.clickUrl);
194
192
  }
195
- }, srcImg && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_ImageLazy["default"], {
196
- onLoadFunc: function onLoadFunc(clientWidth) {
197
- var scale = clientWidth / 600;
193
+ }, srcImg && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
194
+ ref: this.imgRef,
195
+ onLoad: function onLoad() {
196
+ var scale = _this.imgRef.current.clientWidth / 600;
198
197
 
199
198
  _this.setState({
200
199
  scale: scale
Binary file
@@ -13,6 +13,8 @@ require("./index.less");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
16
18
  var __extends = void 0 && (void 0).__extends || function () {
17
19
  var _extendStatics = function extendStatics(d, b) {
18
20
  _extendStatics = Object.setPrototypeOf || {
@@ -39,6 +41,19 @@ var __extends = void 0 && (void 0).__extends || function () {
39
41
  };
40
42
  }();
41
43
 
44
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
45
+ var t = {};
46
+
47
+ for (var p in s) {
48
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
49
+ }
50
+
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
56
+
42
57
  var Field =
43
58
  /** @class */
44
59
  function (_super) {
@@ -53,13 +68,15 @@ function (_super) {
53
68
  title = _a.title,
54
69
  children = _a.children,
55
70
  layout = _a.layout,
56
- split = _a.split;
57
- return /*#__PURE__*/_react["default"].createElement("div", {
71
+ split = _a.split,
72
+ rest = __rest(_a, ["title", "children", "layout", "split"]);
73
+
74
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
58
75
  className: (0, _classnames["default"])('m-field', {
59
76
  split: split,
60
77
  bold: split === 'bold'
61
78
  })
62
- }, /*#__PURE__*/_react["default"].createElement("div", {
79
+ }, rest), /*#__PURE__*/_react["default"].createElement("div", {
63
80
  className: (0, _classnames["default"])('field-item', {
64
81
  horizontal: layout === 'horizontal'
65
82
  })
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _propTypes = _interopRequireDefault(require("prop-types"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+
24
+ var __extends = void 0 && (void 0).__extends || function () {
25
+ var _extendStatics = function extendStatics(d, b) {
26
+ _extendStatics = Object.setPrototypeOf || {
27
+ __proto__: []
28
+ } instanceof Array && function (d, b) {
29
+ d.__proto__ = b;
30
+ } || function (d, b) {
31
+ for (var p in b) {
32
+ if (b.hasOwnProperty(p)) d[p] = b[p];
33
+ }
34
+ };
35
+
36
+ return _extendStatics(d, b);
37
+ };
38
+
39
+ return function (d, b) {
40
+ _extendStatics(d, b);
41
+
42
+ function __() {
43
+ this.constructor = d;
44
+ }
45
+
46
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
47
+ };
48
+ }();
49
+
50
+ var __assign = void 0 && (void 0).__assign || function () {
51
+ __assign = Object.assign || function (t) {
52
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
53
+ s = arguments[i];
54
+
55
+ for (var p in s) {
56
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
57
+ }
58
+ }
59
+
60
+ return t;
61
+ };
62
+
63
+ return __assign.apply(this, arguments);
64
+ };
65
+
66
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
67
+ var t = {};
68
+
69
+ for (var p in s) {
70
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
71
+ }
72
+
73
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
74
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
75
+ }
76
+ return t;
77
+ };
78
+
79
+ // import styles from './index.less';
80
+ var ImageLazy =
81
+ /** @class */
82
+ function (_super) {
83
+ __extends(ImageLazy, _super);
84
+
85
+ function ImageLazy() {
86
+ var _this = _super !== null && _super.apply(this, arguments) || this;
87
+
88
+ _this.state = {
89
+ show: false
90
+ };
91
+ _this.imageRef = /*#__PURE__*/_react["default"].createRef();
92
+ _this.intersectionObserver = null;
93
+ return _this;
94
+ }
95
+
96
+ ImageLazy.prototype.componentDidMount = function () {
97
+ var _this = this;
98
+
99
+ var _a;
100
+
101
+ this.intersectionObserver = new IntersectionObserver(function (entries) {
102
+ if (entries[0].isIntersecting) {
103
+ _this.setState({
104
+ show: true
105
+ });
106
+ }
107
+ }, {
108
+ root: (_a = this.props) === null || _a === void 0 ? void 0 : _a.rootContainer(),
109
+ // threshold: 0.8,
110
+ rootMargin: '0px 0px 100px 0px'
111
+ });
112
+ this.intersectionObserver.observe(this.imageRef.current);
113
+ };
114
+
115
+ ImageLazy.prototype.componentWillUnmount = function () {
116
+ this.intersectionObserver.disconnect(this.imageRef.current);
117
+ };
118
+
119
+ ImageLazy.prototype.render = function () {
120
+ var _this = this;
121
+
122
+ var _a = this.props,
123
+ root = _a.root,
124
+ _b = _a.lazy,
125
+ lazy = _b === void 0 ? true : _b,
126
+ src = _a.src,
127
+ onLoadFunc = _a.onLoadFunc,
128
+ style = _a.style,
129
+ className = _a.className,
130
+ rest = __rest(_a, ["root", "lazy", "src", "onLoadFunc", "style", "className"]);
131
+
132
+ var show = this.state.show;
133
+ var isShow = lazy ? show : true;
134
+ return /*#__PURE__*/_react["default"].createElement("img", _extends({
135
+ ref: this.imageRef,
136
+ alt: "",
137
+ className: (0, _classnames["default"])(className),
138
+ onLoad: function onLoad() {
139
+ if (onLoadFunc) {
140
+ onLoadFunc(_this.imageRef.current.clientWidth);
141
+ }
142
+ },
143
+ src: isShow ? src : '',
144
+ style: __assign({
145
+ opacity: ~~isShow
146
+ }, style)
147
+ }, rest));
148
+ };
149
+
150
+ return ImageLazy;
151
+ }(_react.Component);
152
+
153
+ ImageLazy.propTypes = {
154
+ /** 外层容器 */
155
+ rootContainer: _propTypes["default"].func,
156
+
157
+ /** src */
158
+ src: _propTypes["default"].string,
159
+
160
+ /** 懒加载 */
161
+ lazy: _propTypes["default"].bool
162
+ };
163
+ ImageLazy.defaultProps = {
164
+ rootContainer: function rootContainer() {
165
+ return null;
166
+ },
167
+ lazy: true,
168
+ src: ''
169
+ };
170
+ var _default = ImageLazy;
171
+ exports["default"] = _default;
@@ -184,7 +184,7 @@ function CatgTable(props) {
184
184
  setLoading(true);
185
185
  return [4
186
186
  /*yield*/
187
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
187
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/offercatgs/list", {}, 'GET')];
188
188
 
189
189
  case 1:
190
190
  res = _a.sent();
@@ -346,7 +346,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
346
346
  case 0:
347
347
  return [4
348
348
  /*yield*/
349
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/contract/offercatgs", {}, 'GET')];
349
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/offercatgs/list", {}, 'GET')];
350
350
 
351
351
  case 1:
352
352
  res = _a.sent();
@@ -368,7 +368,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
368
368
  case 0:
369
369
  return [4
370
370
  /*yield*/
371
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands", {}, 'GET')];
371
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/brand/list", {}, 'GET')];
372
372
 
373
373
  case 1:
374
374
  res = _a.sent();
@@ -309,7 +309,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
309
309
  case 0:
310
310
  return [4
311
311
  /*yield*/
312
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
312
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/brand/list")];
313
313
 
314
314
  case 1:
315
315
  res = _a.sent();
@@ -8,21 +8,26 @@ exports.getDefaultJSON = void 0;
8
8
  var _uuid = require("uuid");
9
9
 
10
10
  var getDefaultJSON = function getDefaultJSON() {
11
+ var groupId = (0, _uuid.v4)();
11
12
  return {
12
- id: (0, _uuid.v4)(),
13
+ id: groupId,
13
14
  type: 'LOCATION',
14
- content: {
15
- logo: {
16
- open: true,
17
- color: '#fff'
18
- },
19
- address: {
20
- open: true
21
- },
22
- icon: {
23
- open: true,
24
- color: '#fff'
25
- }
15
+ logo: {
16
+ parentId: groupId,
17
+ id: (0, _uuid.v4)(),
18
+ open: true,
19
+ color: '#fff'
20
+ },
21
+ address: {
22
+ parentId: groupId,
23
+ id: (0, _uuid.v4)(),
24
+ open: true
25
+ },
26
+ icon: {
27
+ parentId: groupId,
28
+ id: (0, _uuid.v4)(),
29
+ open: true,
30
+ color: '#fff'
26
31
  },
27
32
  spacing: {
28
33
  pc: {
@@ -31,8 +36,9 @@ var getDefaultJSON = function getDefaultJSON() {
31
36
  marginBottom: 0
32
37
  },
33
38
  mobile: {
34
- paddingTop: 10,
35
- paddingBottom: 10,
39
+ paddingTop: 12,
40
+ paddingBottom: 12,
41
+ paddingLeft: 12,
36
42
  marginBottom: 0
37
43
  }
38
44
  },
@@ -44,7 +50,7 @@ var getDefaultJSON = function getDefaultJSON() {
44
50
  },
45
51
  background: {
46
52
  opacity: 100,
47
- color: '#fff',
53
+ color: '#597EF7',
48
54
  image: '',
49
55
  bgType: 'color'
50
56
  }
@@ -9,9 +9,11 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _defaultJSON = require("./defaultJSON");
11
11
 
12
+ var _common = require("../../../../common");
13
+
12
14
  var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
13
15
 
14
- var _coreUtil = require("../../../../utils/coreUtil");
16
+ require("./index.less");
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
@@ -63,68 +65,28 @@ function (_super) {
63
65
  __extends(CustomCode, _super);
64
66
 
65
67
  function CustomCode() {
66
- var _this = _super !== null && _super.apply(this, arguments) || this;
67
-
68
- _this.htmlTemp = ''; // createHtml = () => {
69
- // const { nodeData } = this.props;
70
- // const htmlCode = window.magicDesign.device === 'pc' ? nodeData.content.pcHtml : nodeData.content.h5Html;
71
- // this.htmlTemp = htmlCode;
72
- // if (document.getElementById('custom-wrap')) {
73
- // document.getElementById('custom-wrap').innerHTML = htmlCode;
74
- // }
75
- // }
76
-
77
- _this.handleClick = function (e) {
78
- console.log(e.target.getAttribute('href'));
79
- (0, _coreUtil.clickUrl)(e.target.getAttribute('href'));
80
- };
81
-
82
- return _this;
68
+ return _super !== null && _super.apply(this, arguments) || this;
83
69
  }
84
70
 
85
- CustomCode.prototype.componentDidMount = function () {
86
- var _this = this;
87
-
88
- var aElements = document.querySelectorAll('#custom-wrap a');
89
- aElements.forEach(function (element) {
90
- element.addEventListener('click', _this.handleClick);
91
- });
92
- };
93
-
94
- CustomCode.prototype.componentWillUnmount = function () {
95
- var _this = this;
96
-
97
- var aElements = document.querySelectorAll('#custom-wrap a');
98
- aElements.forEach(function (element) {
99
- element.removeEventListener('click', _this.handleClick);
100
- });
101
- }; // componentWillReceiveProps(prevProps) {
102
- // console.log('111111');
103
- // if (window.magicDesign.device === 'pc') {
104
- // console.log('22222222');
105
- // if (prevProps.nodeData.content.pcHtml != this.props.nodeData.content.pcHtml) {
106
- // console.log('4444444');
107
- // this.createHtml();
108
- // }
109
- // } else {
110
- // console.log('3333333333', this.htmlTemp, this.props.nodeData.content);
111
- // if (this.htmlTemp != this.props.nodeData.content.h5Html) {
112
- // console.log('5555555');
113
- // this.createHtml();
114
- // }
115
- // }
116
- // }
117
-
71
+ CustomCode.prototype.componentDidMount = function () {};
118
72
 
119
73
  CustomCode.prototype.render = function () {
120
74
  var nodeData = this.props.nodeData;
121
- return /*#__PURE__*/_react["default"].createElement("div", {
122
- id: "custom-wrap"
123
- }, /*#__PURE__*/_react["default"].createElement("div", {
124
- dangerouslySetInnerHTML: {
125
- __html: window.magicDesign.device === 'pc' ? nodeData.content.pcHtml : nodeData.content.h5Html
126
- }
127
- }));
75
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null) : /*#__PURE__*/_react["default"].createElement("div", {
76
+ className: "location-mobile"
77
+ }, nodeData.logo.open && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
78
+ className: "logo",
79
+ color: nodeData.logo.color,
80
+ size: 20,
81
+ type: "icon-MapPin"
82
+ }), nodeData.address.open && /*#__PURE__*/_react["default"].createElement("div", {
83
+ className: "address"
84
+ }, "Display Location Address"), nodeData.icon.open && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
85
+ className: "logo",
86
+ color: nodeData.icon.color,
87
+ size: 16,
88
+ type: "icon-outlined-right"
89
+ })));
128
90
  };
129
91
 
130
92
  CustomCode.defaultProps = {};
@@ -0,0 +1,15 @@
1
+ .location-mobile {
2
+ display: flex;
3
+ align-items: center;
4
+ .logo {
5
+ margin-right: 6px;
6
+ }
7
+ .address {
8
+ font-family: Open Sans;
9
+ font-size: 14px;
10
+ font-weight: 400;
11
+ line-height: 18px;
12
+ color: #fff;
13
+ }
14
+
15
+ }
@@ -7,7 +7,7 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _MyEditor = _interopRequireDefault(require("./MyEditor"));
10
+ var _common = require("../../../../common");
11
11
 
12
12
  var _coreUtil = require("../../../../utils/coreUtil");
13
13
 
@@ -53,32 +53,62 @@ var __extends = void 0 && (void 0).__extends || function () {
53
53
  };
54
54
  }();
55
55
 
56
- var CustomCodeConfig =
56
+ var LocationConfig =
57
57
  /** @class */
58
58
  function (_super) {
59
- __extends(CustomCodeConfig, _super);
59
+ __extends(LocationConfig, _super);
60
60
 
61
- function CustomCodeConfig() {
61
+ function LocationConfig() {
62
62
  var _this = _super !== null && _super.apply(this, arguments) || this;
63
63
 
64
- _this.changeVal = function (v) {
64
+ _this.getContentPanel = function () {
65
65
  var data = _this.props.data;
66
-
67
- if ((0, _coreUtil.isPc)()) {
68
- data.content.pcHtml = v;
69
- } else {
70
- data.content.h5Html = v;
71
- }
72
- };
73
-
74
- _this.blurArea = function () {
75
- _this.selfRender();
66
+ var source = [{
67
+ key: data.logo.id,
68
+ name: (0, _locale.i18n)('LOCATION_LOGO'),
69
+ value: /*#__PURE__*/_react["default"].createElement(_common.Field, null, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
70
+ colorType: "rgba",
71
+ onChange: function onChange(v) {
72
+ data.logo.color = v;
73
+
74
+ _this.selfRender();
75
+ },
76
+ value: data.logo.color
77
+ })),
78
+ metaOption: data.logo
79
+ }, {
80
+ key: data.address.id,
81
+ name: (0, _locale.i18n)('ADDRESS'),
82
+ metaOption: data.address
83
+ }, {
84
+ key: data.icon.id,
85
+ name: (0, _locale.i18n)('ICON'),
86
+ value: /*#__PURE__*/_react["default"].createElement(_common.Field, null, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
87
+ colorType: "rgba",
88
+ onChange: function onChange(v) {
89
+ data.icon.color = v;
90
+
91
+ _this.selfRender();
92
+ },
93
+ value: data.icon.color
94
+ })),
95
+ metaOption: data.icon
96
+ }];
97
+ return /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
98
+ headerSize: "middle",
99
+ onRefresh: function onRefresh() {
100
+ return (0, _coreUtil.renderPreview)();
101
+ },
102
+ showActiveColor: true,
103
+ source: source,
104
+ type: "switch"
105
+ });
76
106
  };
77
107
 
78
108
  return _this;
79
109
  }
80
110
 
81
- CustomCodeConfig.prototype.render = function () {
111
+ LocationConfig.prototype.render = function () {
82
112
  var data = this.props.data;
83
113
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
84
114
  divider: "bold",
@@ -86,11 +116,7 @@ function (_super) {
86
116
  source: [{
87
117
  key: 'content',
88
118
  name: (0, _locale.i18n)('CONTENT'),
89
- value: /*#__PURE__*/_react["default"].createElement(_MyEditor["default"], {
90
- blurArea: this.blurArea,
91
- changeVal: this.changeVal,
92
- value: (0, _coreUtil.isPc)() ? data.content.pcHtml : data.content.h5Html
93
- })
119
+ value: this.getContentPanel()
94
120
  }, {
95
121
  key: 'spacing',
96
122
  name: (0, _locale.i18n)('SPACING'),
@@ -102,6 +128,7 @@ function (_super) {
102
128
  name: (0, _locale.i18n)('CUSTOMIZE'),
103
129
  value: /*#__PURE__*/_react["default"].createElement(_CustomizeConfig["default"], {
104
130
  data: data.customize,
131
+ isHideAlign: true,
105
132
  layoutSource: _layout.locationLayout
106
133
  })
107
134
  }, {
@@ -115,8 +142,8 @@ function (_super) {
115
142
  }));
116
143
  };
117
144
 
118
- return CustomCodeConfig;
145
+ return LocationConfig;
119
146
  }(_BaseConfig["default"]);
120
147
 
121
- var _default = CustomCodeConfig;
148
+ var _default = LocationConfig;
122
149
  exports["default"] = _default;