@fonixtree/magic-design 0.0.53 → 0.0.55

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 (110) hide show
  1. package/README.md +320 -0
  2. package/es/common/ImageModal/index.js +27 -22
  3. package/es/common/ImgArea/components/Crop.js +267 -0
  4. package/es/common/ImgArea/components/Icons.js +44 -0
  5. package/es/common/ImgArea/index.js +11 -0
  6. package/es/common/index.js +8 -0
  7. package/es/composite-comp/bol/components/Banner/defaultJSON.js +8 -8
  8. package/es/composite-comp/bol/components/Banner/mobile/index.js +1 -5
  9. package/es/composite-comp/bol/components/Banner/pc/index.js +1 -5
  10. package/es/composite-comp/bol/components/Button/defaultJSON.js +2 -2
  11. package/es/composite-comp/bol/components/Button/index.js +1 -5
  12. package/es/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
  13. package/es/composite-comp/bol/components/Carousel/index.js +1 -6
  14. package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
  15. package/es/composite-comp/bol/components/ImageText/defaultJSON.js +17 -17
  16. package/es/composite-comp/bol/components/ImageText/mobile/index.js +1 -3
  17. package/es/composite-comp/bol/components/ImageText/pc/index.js +1 -1
  18. package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
  19. package/es/composite-comp/bol/components/Newsletter/index.js +1 -6
  20. package/es/composite-comp/bol/components/Tag/defaultJSON.js +2 -2
  21. package/es/composite-comp/bol/components/Tag/index.js +1 -5
  22. package/es/composite-comp/bol/components/Text/defaultJSON.js +3 -3
  23. package/es/composite-comp/bol/components/Text/index.js +1 -5
  24. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +5 -3
  25. package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +6 -4
  26. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +1 -1
  27. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +5 -2
  28. package/es/composite-comp/dito/components/FlashDeal/index.js +5 -1
  29. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
  30. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  31. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  32. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
  33. package/es/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
  34. package/es/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
  35. package/es/composite-comp/dito/components/MobileNavigation/defaultJSON.js +3 -3
  36. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +2 -2
  37. package/es/composite-comp/dito/components/Recommend/index.js +1 -6
  38. package/es/composite-comp/dito/components/Recommend/pc/index.js +2 -2
  39. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +1 -1
  40. package/es/core/Designer/index.js +0 -2
  41. package/es/decorator/compositeDecorator.js +45 -12
  42. package/es/locale/en/en.json +3 -0
  43. package/es/locale/es/es.json +3 -0
  44. package/es/locale/id/id.json +3 -0
  45. package/es/meta-comp/components/Button/index.js +1 -4
  46. package/es/meta-comp/components/Button/index.less +1 -1
  47. package/es/meta-comp/components/Image/index.js +31 -3
  48. package/es/meta-comp/components/Image/index.less +1 -0
  49. package/es/meta-comp/components/Text/index.js +1 -4
  50. package/es/meta-comp/config-panels/ButtonConfig/index.js +2 -2
  51. package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
  52. package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
  53. package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +130 -0
  54. package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
  55. package/es/meta-comp/config-panels/ImageConfig/index.js +13 -4
  56. package/lib/common/ImageModal/index.js +27 -22
  57. package/lib/common/ImgArea/components/Crop.js +267 -0
  58. package/lib/common/ImgArea/components/Icons.js +44 -0
  59. package/lib/common/ImgArea/index.js +11 -0
  60. package/lib/common/index.js +8 -0
  61. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +8 -8
  62. package/lib/composite-comp/bol/components/Banner/mobile/index.js +1 -5
  63. package/lib/composite-comp/bol/components/Banner/pc/index.js +1 -5
  64. package/lib/composite-comp/bol/components/Button/defaultJSON.js +2 -2
  65. package/lib/composite-comp/bol/components/Button/index.js +1 -5
  66. package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
  67. package/lib/composite-comp/bol/components/Carousel/index.js +1 -6
  68. package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
  69. package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +17 -17
  70. package/lib/composite-comp/bol/components/ImageText/mobile/index.js +1 -3
  71. package/lib/composite-comp/bol/components/ImageText/pc/index.js +1 -1
  72. package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
  73. package/lib/composite-comp/bol/components/Newsletter/index.js +1 -6
  74. package/lib/composite-comp/bol/components/Tag/defaultJSON.js +2 -2
  75. package/lib/composite-comp/bol/components/Tag/index.js +1 -5
  76. package/lib/composite-comp/bol/components/Text/defaultJSON.js +3 -3
  77. package/lib/composite-comp/bol/components/Text/index.js +1 -5
  78. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +5 -3
  79. package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +6 -4
  80. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +1 -1
  81. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +5 -2
  82. package/lib/composite-comp/dito/components/FlashDeal/index.js +5 -1
  83. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
  84. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  85. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  86. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
  87. package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
  88. package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
  89. package/lib/composite-comp/dito/components/MobileNavigation/defaultJSON.js +3 -3
  90. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +2 -2
  91. package/lib/composite-comp/dito/components/Recommend/index.js +1 -6
  92. package/lib/composite-comp/dito/components/Recommend/pc/index.js +2 -2
  93. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +1 -1
  94. package/lib/core/Designer/index.js +0 -2
  95. package/lib/decorator/compositeDecorator.js +45 -12
  96. package/lib/locale/en/en.json +3 -0
  97. package/lib/locale/es/es.json +3 -0
  98. package/lib/locale/id/id.json +3 -0
  99. package/lib/meta-comp/components/Button/index.js +1 -4
  100. package/lib/meta-comp/components/Button/index.less +1 -1
  101. package/lib/meta-comp/components/Image/index.js +31 -3
  102. package/lib/meta-comp/components/Image/index.less +1 -0
  103. package/lib/meta-comp/components/Text/index.js +1 -4
  104. package/lib/meta-comp/config-panels/ButtonConfig/index.js +2 -2
  105. package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
  106. package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
  107. package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +130 -0
  108. package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
  109. package/lib/meta-comp/config-panels/ImageConfig/index.js +13 -4
  110. package/package.json +90 -3
@@ -0,0 +1,121 @@
1
+ .m-flash-deal-pc {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 16px 16px 28px 16px;
5
+
6
+ .flash-deal-title {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+
11
+ .left {
12
+ display: flex;
13
+ align-items: center;
14
+
15
+ .icon {
16
+ height: 18px;
17
+ margin-right: 10px;
18
+ }
19
+
20
+ .title {
21
+ font-family: 'Montserrat';
22
+ font-style: normal;
23
+ font-weight: 600;
24
+ font-size: 14px;
25
+ line-height: 18px;
26
+ color: #2C2C2C;
27
+ margin-right: 10px;
28
+ }
29
+
30
+ .sub-title {
31
+ font-family: 'Montserrat';
32
+ font-style: normal;
33
+ font-weight: 600;
34
+ font-size: 10px;
35
+ line-height: 18px;
36
+ color: #2C2C2C;
37
+ margin-right: 6px;
38
+ align-self: end;
39
+ }
40
+ }
41
+
42
+ .right {
43
+ display: flex;
44
+ align-items: center;
45
+
46
+ .text {
47
+ font-family: 'Montserrat';
48
+ font-style: normal;
49
+ font-weight: 600;
50
+ font-size: 12px;
51
+ line-height: 15px;
52
+ color: #0038A8;
53
+ margin-right: 5px;
54
+ }
55
+
56
+ .btn {
57
+ white-space: nowrap;
58
+ }
59
+ }
60
+ }
61
+
62
+ .flash-deal-content {
63
+ display: flex;
64
+ align-items: center;
65
+ flex-direction: row;
66
+
67
+ .arrow-icon {
68
+ display: block;
69
+ width: 36px;
70
+ height: 36px;
71
+ line-height: 42px;
72
+ text-align: center;
73
+ background: #FFFFFF;
74
+ box-shadow: -1px -1px 4px rgba(45, 48, 64, 0.08), 1px 1px 4px rgba(45, 48, 64, 0.08);
75
+ border-radius: 100px;
76
+ cursor: pointer;
77
+
78
+ &.left {
79
+ margin-right: 30px;
80
+ }
81
+
82
+ &.right {
83
+ margin-left: 30px;
84
+ }
85
+ }
86
+ }
87
+
88
+ .flash-deal-list {
89
+ margin-top: 16px;
90
+ overflow-x: auto;
91
+ overflow-y: hidden;
92
+ white-space: nowrap;
93
+ display: flex;
94
+ align-items: flex-start;
95
+ position: relative;
96
+ flex: 1;
97
+
98
+ .loading-wrap {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ padding: 30px;
103
+ position: absolute;
104
+ top: 0;
105
+ bottom: 0;
106
+ left: 0;
107
+ right: 0;
108
+ margin: auto;
109
+ }
110
+
111
+ // 秒杀特有样式
112
+ .m-product-item-wrap {
113
+ width: 142px;
114
+ margin-right: 24px;
115
+
116
+ .product-name {
117
+ height: 36px;
118
+ }
119
+ }
120
+ }
121
+ }
@@ -39,7 +39,7 @@ var MobileNavGroupSourceJSON = function MobileNavGroupSourceJSON() {
39
39
  specialContent: [],
40
40
  text: 'name',
41
41
  content: {
42
- sizeType: 'Headline 1',
42
+ sizeType: 'Customize font styles',
43
43
  fontFamily: 'Open Sans',
44
44
  fontWeight: 600,
45
45
  fontSize: 12,
@@ -66,12 +66,12 @@ var getDefaultJSON = function getDefaultJSON() {
66
66
  pc: {
67
67
  paddingTop: 10,
68
68
  paddingBottom: 10,
69
- marginBottom: 0
69
+ marginBottom: window.magicDesign.compSpacing * 1.5
70
70
  },
71
71
  mobile: {
72
72
  paddingTop: 10,
73
73
  paddingBottom: 10,
74
- marginBottom: 0
74
+ marginBottom: window.magicDesign.compSpacing
75
75
  }
76
76
  },
77
77
  customize: {
@@ -268,14 +268,14 @@ var getDefaultJSON = function getDefaultJSON() {
268
268
  paddingBottom: 0,
269
269
  paddingLeft: 0,
270
270
  paddingRight: 0,
271
- marginBottom: 0
271
+ marginBottom: window.magicDesign.compSpacing * 1.5
272
272
  },
273
273
  mobile: {
274
274
  paddingTop: 0,
275
275
  paddingBottom: 0,
276
276
  paddingLeft: 0,
277
277
  paddingRight: 0,
278
- marginBottom: 0
278
+ marginBottom: window.magicDesign.compSpacing
279
279
  }
280
280
  },
281
281
  customize: {
@@ -17,8 +17,6 @@ var _coreUtil = require("../../../../utils/coreUtil");
17
17
 
18
18
  var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
19
19
 
20
- var _businessUtil = require("../../../../utils/businessUtil");
21
-
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
21
 
24
22
  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); }
@@ -74,10 +72,7 @@ function (_super) {
74
72
 
75
73
  Recommend.prototype.render = function () {
76
74
  var nodeData = this.props.nodeData;
77
- var wrapStyle = (0, _businessUtil.computeStyle)(nodeData, window.magicDesign.device);
78
- return /*#__PURE__*/_react["default"].createElement("div", {
79
- style: wrapStyle
80
- }, (0, _coreUtil.isPc)() ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
75
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
81
76
  panelProps: nodeData
82
77
  }) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
83
78
  panelProps: nodeData
@@ -700,7 +700,7 @@ function (_super) {
700
700
  imgHeight: imgHeight,
701
701
  imgWidth: imgWidth,
702
702
  onItemClick: function onItemClick() {
703
- return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId + "?productId=" + (item.sppProductId || item.productId || ''));
703
+ return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId);
704
704
  },
705
705
  panelProps: panelProps.content,
706
706
  showProgress: false
@@ -726,7 +726,7 @@ function (_super) {
726
726
  imgHeight: imgHeight,
727
727
  imgWidth: imgWidth,
728
728
  onItemClick: function onItemClick() {
729
- return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId + "?productId=" + (item.sppProductId || item.productId || ''));
729
+ return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId);
730
730
  },
731
731
  panelProps: panelProps.content,
732
732
  showProgress: false
@@ -48,7 +48,7 @@ function FlashDealConfig(props) {
48
48
  isHideAlign: true,
49
49
  layoutSource: [{
50
50
  id: 'layout1',
51
- name: 'left',
51
+ name: 'layout1',
52
52
  image: _layout["default"]
53
53
  }]
54
54
  })
@@ -335,8 +335,6 @@ function (_super) {
335
335
 
336
336
  break;
337
337
  }
338
-
339
- console.log(JSON.stringify(handleParams.pageData));
340
338
  };
341
339
 
342
340
  _this.renderHeader = function () {
@@ -41,6 +41,22 @@ var __extends = void 0 && (void 0).__extends || function () {
41
41
  };
42
42
  }();
43
43
 
44
+ var __assign = void 0 && (void 0).__assign || function () {
45
+ __assign = Object.assign || function (t) {
46
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
47
+ s = arguments[i];
48
+
49
+ for (var p in s) {
50
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
51
+ }
52
+ }
53
+
54
+ return t;
55
+ };
56
+
57
+ return __assign.apply(this, arguments);
58
+ };
59
+
44
60
  function compositeDecorator(WrappedComponent) {
45
61
  var Wrapper =
46
62
  /** @class */
@@ -74,26 +90,43 @@ function compositeDecorator(WrappedComponent) {
74
90
  };
75
91
 
76
92
  _this.getStyle = function () {
77
- var style = {
93
+ var wrapStyle = {
78
94
  border: 'none'
79
- }; // 处理复合组件的选中状态
80
-
81
- if (window.magicDesign.mode === 'designer') {
95
+ };
96
+ var _a = window.magicDesign,
97
+ device = _a.device,
98
+ mode = _a.mode;
99
+ var nodeData = _this.props.nodeData;
100
+ var spacing = nodeData.spacing,
101
+ background = nodeData.background; // 处理复合组件的选中状态
102
+
103
+ if (mode === 'designer') {
82
104
  // style.border = '1px solid transparent';
83
- style.border = 'none';
105
+ wrapStyle.border = 'none';
84
106
 
85
- if (_this.props.nodeData.id === _this.state.clickedFloor) {
86
- style.border = '1px dashed red';
107
+ if (nodeData.id === _this.state.clickedFloor) {
108
+ wrapStyle.border = '1px dashed red';
87
109
  }
88
- } // 处理复合组件的下边距
110
+ } // 边距
111
+
89
112
 
113
+ if (spacing && spacing[device]) {
114
+ wrapStyle = __assign(__assign({}, wrapStyle), spacing[device]);
115
+ } // 背景
90
116
 
91
- if (Wrapper.type !== 'DIVIDER') {
92
- var rate = window.magicDesign.device === 'pc' ? 1.5 : 1;
93
- style.marginBottom = Number(window.magicDesign.compSpacing) * rate + "px";
117
+
118
+ if (background) {
119
+ if (background.bgType === 'color') {
120
+ wrapStyle.backgroundColor = background.color;
121
+ wrapStyle.opacity = background.opacity ? background.opacity : 1;
122
+ } else {
123
+ wrapStyle.backgroundImage = "url(" + background.image + ")";
124
+ wrapStyle.backgroundPosition = 'center';
125
+ wrapStyle.backgroundSize = 'cover';
126
+ }
94
127
  }
95
128
 
96
- return style;
129
+ return wrapStyle;
97
130
  };
98
131
 
99
132
  return _this;
@@ -1,4 +1,7 @@
1
1
  {
2
+ "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
+ "ADD_AREA": "Add Area",
4
+ "CLICKABLE_AREA": "Clickable Area",
2
5
  "NAVIGATION_NAME": "Navigation Name",
3
6
  "ADD_NAVIGATION": "Add Navigation",
4
7
  "SAVE": "Save",
@@ -1,4 +1,7 @@
1
1
  {
2
+ "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
+ "ADD_AREA": "Add Area",
4
+ "CLICKABLE_AREA": "Clickable Area",
2
5
  "NAVIGATION_NAME": "Navigation Name",
3
6
  "ADD_NAVIGATION": "Add Navigation",
4
7
  "SAVE": "Guardar",
@@ -1,4 +1,7 @@
1
1
  {
2
+ "ADD_CLICKABLE_AREA": "Add Clickable Area",
3
+ "ADD_AREA": "Add Area",
4
+ "CLICKABLE_AREA": "Clickable Area",
2
5
  "NAVIGATION_NAME": "Navigation Name",
3
6
  "ADD_NAVIGATION": "Add Navigation",
4
7
  "SAVE": "Save",
@@ -11,8 +11,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  require("./index.less");
13
13
 
14
- var _businessUtil = require("../../../utils/businessUtil");
15
-
16
14
  var _coreUtil = require("../../../utils/coreUtil");
17
15
 
18
16
  var _decorator = require("../../../decorator");
@@ -152,7 +150,6 @@ function (_super) {
152
150
  suppressContentEditableWarning: true
153
151
  }, data.text);
154
152
 
155
- var wrapStyle = (0, _businessUtil.computeStyle)(data, window.magicDesign.device);
156
153
  return /*#__PURE__*/_react["default"].createElement("div", {
157
154
  className: (0, _classnames["default"])('m-meta-button', className),
158
155
  onClick: function onClick() {
@@ -168,7 +165,7 @@ function (_super) {
168
165
  hover: false
169
166
  });
170
167
  },
171
- style: __assign(__assign({}, style), wrapStyle)
168
+ style: __assign({}, style)
172
169
  }, /*#__PURE__*/_react["default"].createElement("div", {
173
170
  className: (0, _classnames["default"])('btnContent', {
174
171
  horizontal: iconLayout === 'left' || iconLayout === 'right'
@@ -14,7 +14,7 @@
14
14
 
15
15
  img {
16
16
  height: 20px;
17
- margin-right: 5px;
17
+ margin: 0 5px;
18
18
  }
19
19
  }
20
20
  }
@@ -65,9 +65,11 @@ function (_super) {
65
65
  function Image() {
66
66
  var _this = _super !== null && _super.apply(this, arguments) || this;
67
67
 
68
+ _this.imgRef = /*#__PURE__*/_react["default"].createRef();
68
69
  _this.state = {
69
70
  // 当仅作为一个图片时,鼠标移上去,hover状态
70
- hoverImgSrc: false
71
+ hoverImgSrc: false,
72
+ scale: 1
71
73
  };
72
74
 
73
75
  _this.getStyle = function () {
@@ -146,6 +148,8 @@ function (_super) {
146
148
  }
147
149
 
148
150
  Image.prototype.render = function () {
151
+ var _this = this;
152
+
149
153
  var _a, _b;
150
154
 
151
155
  var _c = this.props,
@@ -176,12 +180,36 @@ function (_super) {
176
180
  onClick: function onClick() {
177
181
  (0, _coreUtil.clickUrl)(data.content.clickUrl);
178
182
  }
179
- }, srcImg && /*#__PURE__*/_react["default"].createElement("img", {
183
+ }, srcImg && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
184
+ ref: this.imgRef,
185
+ onLoad: function onLoad() {
186
+ var scale = _this.imgRef.current.clientWidth / 600;
187
+
188
+ _this.setState({
189
+ scale: scale
190
+ });
191
+ },
180
192
  onMouseEnter: this.mouseEnterImg,
181
193
  onMouseLeave: this.mouseLeaveImg,
182
194
  src: srcImg,
183
195
  style: this.getStyle()
184
- }));
196
+ }), data.content.areas && data.content.areas.length > 0 && data.content.areas.map(function (v, i) {
197
+ var aStyle = {
198
+ position: 'absolute',
199
+ top: parseInt(v.y * _this.state.scale),
200
+ left: parseInt(v.x * _this.state.scale),
201
+ width: parseInt(v.width * _this.state.scale),
202
+ height: parseInt(v.height * _this.state.scale)
203
+ };
204
+ return /*#__PURE__*/_react["default"].createElement("a", {
205
+ key: i,
206
+ onClick: function onClick(e) {
207
+ e.stopPropagation();
208
+ (0, _coreUtil.clickUrl)(v.inputVal);
209
+ },
210
+ style: aStyle
211
+ });
212
+ })));
185
213
  };
186
214
 
187
215
  Image.defaultProps = {
@@ -1,4 +1,5 @@
1
1
  .m-meta-image {
2
+ position: relative;
2
3
  width: 100%;
3
4
  height: 100%;
4
5
  display: flex;
@@ -17,8 +17,6 @@ var _Iconfont = require("../../../common/Iconfont");
17
17
 
18
18
  var _decorator = require("../../../decorator");
19
19
 
20
- var _businessUtil = require("../../../utils/businessUtil");
21
-
22
20
  var _coreUtil = require("../../../utils/coreUtil");
23
21
 
24
22
  var _mobx = require("../../../mobx");
@@ -438,7 +436,6 @@ function (_super) {
438
436
  textDecorationStyle: data.underline.textDecorationStyle
439
437
  });
440
438
 
441
- var wrapStyle = (0, _businessUtil.computeStyle)(data, window.magicDesign.device);
442
439
  return /*#__PURE__*/_react["default"].createElement("div", {
443
440
  ref: this.textRef,
444
441
  className: (0, _classnames["default"])('m-meta-text', className),
@@ -461,7 +458,7 @@ function (_super) {
461
458
  onKeyDown: function onKeyDown(e) {
462
459
  e.stopPropagation();
463
460
  },
464
- style: __assign(__assign({}, style), wrapStyle),
461
+ style: __assign({}, style),
465
462
  suppressContentEditableWarning: true
466
463
  });
467
464
  };
@@ -157,7 +157,7 @@ function (_super) {
157
157
  return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
158
158
  value: sizeType.key
159
159
  }, sizeType.key);
160
- }))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
160
+ }))), data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
161
161
  title: (0, _locale.i18n)('FONT_FAMILY')
162
162
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
163
163
  onChange: function onChange(v) {
@@ -191,7 +191,7 @@ function (_super) {
191
191
  value: {
192
192
  count: data[fontSizeKey]
193
193
  }
194
- })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
194
+ }))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
195
195
  title: ""
196
196
  }, /*#__PURE__*/_react["default"].createElement(_common.FontStyles, {
197
197
  onChange: function onChange(value) {
@@ -0,0 +1,164 @@
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 _antd = require("antd");
13
+
14
+ var _common = require("../../../../common");
15
+
16
+ require("./index.less");
17
+
18
+ var _locale = require("../../../../locale");
19
+
20
+ 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); }
21
+
22
+ 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; }
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 __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
51
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
52
+ s += arguments[i].length;
53
+ }
54
+
55
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) {
56
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
57
+ r[k] = a[j];
58
+ }
59
+ }
60
+
61
+ return r;
62
+ };
63
+
64
+ var AreaConfigModal =
65
+ /** @class */
66
+ function (_super) {
67
+ __extends(AreaConfigModal, _super);
68
+
69
+ function AreaConfigModal() {
70
+ var _this = _super !== null && _super.apply(this, arguments) || this;
71
+
72
+ _this.state = {
73
+ drawCoordinates: _this.props.value || []
74
+ };
75
+
76
+ _this.setCoordinate = function (coordinate, index, coordinates) {
77
+ _this.setState({
78
+ drawCoordinates: coordinates
79
+ });
80
+ };
81
+
82
+ _this.addArea = function () {
83
+ var drawCoordinates = _this.state.drawCoordinates;
84
+
85
+ var newCoordinates = __spreadArrays(drawCoordinates, [{
86
+ height: 50,
87
+ id: "Hyp_dBIiD" + drawCoordinates.length,
88
+ inputVal: '',
89
+ width: 100,
90
+ x: 54 + drawCoordinates.length * 10,
91
+ y: 38 + drawCoordinates.length * 10
92
+ }]);
93
+
94
+ _this.setState({
95
+ drawCoordinates: newCoordinates
96
+ });
97
+ };
98
+
99
+ _this.onOkClick = function () {
100
+ var onOk = _this.props.onOk;
101
+ var drawCoordinates = _this.state.drawCoordinates;
102
+ onOk(drawCoordinates);
103
+ };
104
+
105
+ return _this;
106
+ }
107
+
108
+ AreaConfigModal.prototype.render = function () {
109
+ var _this = this;
110
+
111
+ var _a = this.props,
112
+ visible = _a.visible,
113
+ onCancel = _a.onCancel;
114
+ var drawCoordinates = this.state.drawCoordinates;
115
+ return /*#__PURE__*/_react["default"].createElement(_antd.Modal, {
116
+ centered: true,
117
+ draggable: false,
118
+ onCancel: onCancel,
119
+ onOk: this.onOkClick,
120
+ title: "clickable Area",
121
+ visible: visible,
122
+ width: "auto"
123
+ }, /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: "body_wrap"
125
+ }, /*#__PURE__*/_react["default"].createElement(_common.ImgArea, {
126
+ coordinates: drawCoordinates,
127
+ onChange: this.setCoordinate,
128
+ onDelete: this.setCoordinate,
129
+ onSave: this.setCoordinate,
130
+ src: this.props.imgUrl,
131
+ width: "100%"
132
+ }), /*#__PURE__*/_react["default"].createElement("div", {
133
+ className: "area_config_wrap"
134
+ }, /*#__PURE__*/_react["default"].createElement("span", {
135
+ className: "btn_wrap",
136
+ onClick: this.addArea
137
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
138
+ size: 20,
139
+ type: "icon-add"
140
+ }), /*#__PURE__*/_react["default"].createElement("span", null, (0, _locale.i18n)('ADD_CLICKABLE_AREA'))), /*#__PURE__*/_react["default"].createElement("div", {
141
+ className: "list_wrap"
142
+ }, drawCoordinates.map(function (v, i) {
143
+ return /*#__PURE__*/_react["default"].createElement("div", {
144
+ className: "add_item"
145
+ }, /*#__PURE__*/_react["default"].createElement("div", {
146
+ className: "title"
147
+ }, "Clickable Area ", i + 1), /*#__PURE__*/_react["default"].createElement(_common.UrlPicker, {
148
+ onChange: function onChange(data) {
149
+ v.inputVal = data;
150
+
151
+ _this.setState({
152
+ drawCoordinates: __spreadArrays(drawCoordinates)
153
+ });
154
+ },
155
+ value: v.inputVal
156
+ }));
157
+ })))));
158
+ };
159
+
160
+ return AreaConfigModal;
161
+ }(_react.Component);
162
+
163
+ var _default = AreaConfigModal;
164
+ exports["default"] = _default;
@@ -0,0 +1,26 @@
1
+
2
+ .body_wrap {
3
+ display: flex;
4
+
5
+ .area_config_wrap {
6
+ margin-left: 23px;
7
+ width: 259px;
8
+ max-height: 480px;
9
+ padding-right: 10px;
10
+ .list_wrap {
11
+ height: calc(100% - 30px);
12
+ overflow: auto;
13
+ .add_item {
14
+ margin-top: 18px;
15
+ }
16
+ }
17
+
18
+ .btn_wrap {
19
+ cursor: pointer;
20
+ display: flex;
21
+ align-items: center;
22
+ color: #2F54EB;
23
+ margin-top: 10px;
24
+ }
25
+ }
26
+ }