@fonixtree/magic-design 0.0.92 → 0.0.93
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.
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +2 -4
- package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +1 -1
- package/es/composite-comp/bol/components/Text/defaultJSON.js +1 -1
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +4 -4
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +3 -3
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +5 -3
- package/es/decorator/metaDecorator.js +37 -5
- package/es/meta-comp/components/Text/index.js +1 -3
- package/es/meta-comp/components/Text/index.less +0 -1
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +2 -4
- package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +1 -1
- package/lib/composite-comp/bol/components/Text/defaultJSON.js +1 -1
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +4 -4
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +3 -3
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +5 -3
- package/lib/decorator/metaDecorator.js +37 -5
- package/lib/meta-comp/components/Text/index.js +1 -3
- package/lib/meta-comp/components/Text/index.less +0 -1
- package/package.json +1 -1
|
@@ -48,8 +48,7 @@ var ImageTextGroupSourceJSON = function ImageTextGroupSourceJSON() {
|
|
|
48
48
|
fontFamily: 'Open Sans',
|
|
49
49
|
fontWeight: 600,
|
|
50
50
|
fontSize: 12,
|
|
51
|
-
color: '#232F46'
|
|
52
|
-
width: 0
|
|
51
|
+
color: '#232F46'
|
|
53
52
|
},
|
|
54
53
|
underline: {
|
|
55
54
|
open: false,
|
|
@@ -70,8 +69,7 @@ var ImageTextGroupSourceJSON = function ImageTextGroupSourceJSON() {
|
|
|
70
69
|
fontFamily: 'Open Sans',
|
|
71
70
|
fontWeight: 400,
|
|
72
71
|
fontSize: 10,
|
|
73
|
-
color: '#8493AF'
|
|
74
|
-
width: 0
|
|
72
|
+
color: '#8493AF'
|
|
75
73
|
},
|
|
76
74
|
underline: {},
|
|
77
75
|
vertical: {}
|
|
@@ -21,7 +21,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
21
21
|
headline: {
|
|
22
22
|
id: (0, _uuid.v4)(),
|
|
23
23
|
open: true,
|
|
24
|
-
type: '
|
|
24
|
+
type: 'TEXT',
|
|
25
25
|
specialContent: [],
|
|
26
26
|
text: 'Flash Deal',
|
|
27
27
|
content: {
|
|
@@ -135,7 +135,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
135
135
|
id: (0, _uuid.v4)(),
|
|
136
136
|
contentId: contentId,
|
|
137
137
|
open: true,
|
|
138
|
-
type: '
|
|
138
|
+
type: 'TEXT',
|
|
139
139
|
specialContent: [],
|
|
140
140
|
text: 'Flash Deal',
|
|
141
141
|
content: {
|
|
@@ -159,7 +159,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
159
159
|
id: (0, _uuid.v4)(),
|
|
160
160
|
contentId: contentId,
|
|
161
161
|
open: true,
|
|
162
|
-
type: '
|
|
162
|
+
type: 'TEXT',
|
|
163
163
|
specialContent: [],
|
|
164
164
|
text: 'Flash Deal',
|
|
165
165
|
content: {
|
|
@@ -183,7 +183,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
183
183
|
id: (0, _uuid.v4)(),
|
|
184
184
|
contentId: contentId,
|
|
185
185
|
open: true,
|
|
186
|
-
type: '
|
|
186
|
+
type: 'TEXT',
|
|
187
187
|
specialContent: [],
|
|
188
188
|
text: 'Flash Deal',
|
|
189
189
|
content: {
|
|
@@ -204,7 +204,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
204
204
|
productName: {
|
|
205
205
|
id: (0, _uuid.v4)(),
|
|
206
206
|
open: true,
|
|
207
|
-
type: '
|
|
207
|
+
type: 'TEXT',
|
|
208
208
|
specialContent: [],
|
|
209
209
|
text: 'Flash Deal',
|
|
210
210
|
content: {
|
|
@@ -227,7 +227,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
227
227
|
activityPrice: {
|
|
228
228
|
id: (0, _uuid.v4)(),
|
|
229
229
|
open: true,
|
|
230
|
-
type: '
|
|
230
|
+
type: 'TEXT',
|
|
231
231
|
specialContent: [],
|
|
232
232
|
text: 'Flash Deal',
|
|
233
233
|
content: {
|
|
@@ -250,7 +250,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
250
250
|
salesPrice: {
|
|
251
251
|
id: (0, _uuid.v4)(),
|
|
252
252
|
open: true,
|
|
253
|
-
type: '
|
|
253
|
+
type: 'TEXT',
|
|
254
254
|
specialContent: [],
|
|
255
255
|
text: 'Flash Deal',
|
|
256
256
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.m-search-bar {
|
|
2
2
|
height: 48px;
|
|
3
|
-
padding: 8px
|
|
3
|
+
padding: 8px 0;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: row-reverse;
|
|
6
6
|
align-items: center;
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
.right {
|
|
11
11
|
display: flex;
|
|
12
|
+
flex: 1;
|
|
13
|
+
margin-left: 15px;
|
|
12
14
|
align-items: center;
|
|
13
15
|
justify-content: space-between;
|
|
14
16
|
|
|
15
17
|
.search-input-wrap {
|
|
16
|
-
|
|
18
|
+
flex: 1;
|
|
17
19
|
background: #fff;
|
|
18
20
|
border-radius: 4px;
|
|
19
21
|
border: 1px solid #D2D9E5;
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
|
|
25
27
|
.message-wrap {
|
|
26
28
|
position: relative;
|
|
27
|
-
margin-left:
|
|
29
|
+
margin-left: 10px;
|
|
28
30
|
|
|
29
31
|
.num {
|
|
30
32
|
position: absolute;
|
|
@@ -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
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
45
61
|
var t = {};
|
|
46
62
|
|
|
@@ -133,7 +149,7 @@ function metaDecorator(WrappedComponent) {
|
|
|
133
149
|
return false;
|
|
134
150
|
};
|
|
135
151
|
|
|
136
|
-
_this.
|
|
152
|
+
_this.getInteractStyle = function () {
|
|
137
153
|
var _a = _this.state,
|
|
138
154
|
hoveredMeta = _a.hoveredMeta,
|
|
139
155
|
clickedMeta = _a.clickedMeta;
|
|
@@ -154,6 +170,22 @@ function metaDecorator(WrappedComponent) {
|
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
return style;
|
|
173
|
+
}; // text元组件在选中或悬浮时 需要实时展示其宽度
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
_this.getStyle = function () {
|
|
177
|
+
var _a = _this.props,
|
|
178
|
+
style = _a.style,
|
|
179
|
+
rest = __rest(_a, ["style"]);
|
|
180
|
+
|
|
181
|
+
var newStyle = __assign({}, style);
|
|
182
|
+
|
|
183
|
+
if (rest.data.type === 'TEXT') {
|
|
184
|
+
var width = window.magicDesign.device === 'pc' ? rest.data.content.pcWidth : rest.data.content.width;
|
|
185
|
+
newStyle.width = (width || 100) + "%";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return newStyle;
|
|
157
189
|
};
|
|
158
190
|
|
|
159
191
|
return _this;
|
|
@@ -177,13 +209,13 @@ function metaDecorator(WrappedComponent) {
|
|
|
177
209
|
Wrapper.prototype.render = function () {
|
|
178
210
|
var _a = this.props,
|
|
179
211
|
className = _a.className,
|
|
180
|
-
|
|
181
|
-
rest = __rest(_a, ["className", "style"]);
|
|
212
|
+
rest = __rest(_a, ["className"]);
|
|
182
213
|
|
|
183
|
-
var hoverStyle = this.
|
|
214
|
+
var hoverStyle = this.getInteractStyle();
|
|
215
|
+
console.log(rest);
|
|
184
216
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
217
|
className: className,
|
|
186
|
-
style:
|
|
218
|
+
style: this.getStyle()
|
|
187
219
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
188
220
|
className: "meta_wrap",
|
|
189
221
|
onClick: this.onMetaClick,
|
|
@@ -94,7 +94,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
var contentStyle = function contentStyle(content) {
|
|
97
|
-
var baseWidth = (window.magicDesign.device == 'pc' ? content.pcWidth : content.width) || 100;
|
|
98
97
|
return {
|
|
99
98
|
fontSize: window.magicDesign.device == 'pc' ? content.pcFontSize : content.fontSize,
|
|
100
99
|
fontFamily: content.fontFamily,
|
|
@@ -103,8 +102,7 @@ var contentStyle = function contentStyle(content) {
|
|
|
103
102
|
color: content.color,
|
|
104
103
|
backgroundColor: content.backgroundColor,
|
|
105
104
|
textAlign: content.textAlign,
|
|
106
|
-
|
|
107
|
-
width: Math.min(baseWidth, 100) + "%"
|
|
105
|
+
width: '100%'
|
|
108
106
|
};
|
|
109
107
|
};
|
|
110
108
|
/** 从父级数组中 分离出 片段数组 */
|
|
@@ -48,8 +48,7 @@ var ImageTextGroupSourceJSON = function ImageTextGroupSourceJSON() {
|
|
|
48
48
|
fontFamily: 'Open Sans',
|
|
49
49
|
fontWeight: 600,
|
|
50
50
|
fontSize: 12,
|
|
51
|
-
color: '#232F46'
|
|
52
|
-
width: 0
|
|
51
|
+
color: '#232F46'
|
|
53
52
|
},
|
|
54
53
|
underline: {
|
|
55
54
|
open: false,
|
|
@@ -70,8 +69,7 @@ var ImageTextGroupSourceJSON = function ImageTextGroupSourceJSON() {
|
|
|
70
69
|
fontFamily: 'Open Sans',
|
|
71
70
|
fontWeight: 400,
|
|
72
71
|
fontSize: 10,
|
|
73
|
-
color: '#8493AF'
|
|
74
|
-
width: 0
|
|
72
|
+
color: '#8493AF'
|
|
75
73
|
},
|
|
76
74
|
underline: {},
|
|
77
75
|
vertical: {}
|
|
@@ -21,7 +21,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
21
21
|
headline: {
|
|
22
22
|
id: (0, _uuid.v4)(),
|
|
23
23
|
open: true,
|
|
24
|
-
type: '
|
|
24
|
+
type: 'TEXT',
|
|
25
25
|
specialContent: [],
|
|
26
26
|
text: 'Flash Deal',
|
|
27
27
|
content: {
|
|
@@ -135,7 +135,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
135
135
|
id: (0, _uuid.v4)(),
|
|
136
136
|
contentId: contentId,
|
|
137
137
|
open: true,
|
|
138
|
-
type: '
|
|
138
|
+
type: 'TEXT',
|
|
139
139
|
specialContent: [],
|
|
140
140
|
text: 'Flash Deal',
|
|
141
141
|
content: {
|
|
@@ -159,7 +159,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
159
159
|
id: (0, _uuid.v4)(),
|
|
160
160
|
contentId: contentId,
|
|
161
161
|
open: true,
|
|
162
|
-
type: '
|
|
162
|
+
type: 'TEXT',
|
|
163
163
|
specialContent: [],
|
|
164
164
|
text: 'Flash Deal',
|
|
165
165
|
content: {
|
|
@@ -183,7 +183,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
183
183
|
id: (0, _uuid.v4)(),
|
|
184
184
|
contentId: contentId,
|
|
185
185
|
open: true,
|
|
186
|
-
type: '
|
|
186
|
+
type: 'TEXT',
|
|
187
187
|
specialContent: [],
|
|
188
188
|
text: 'Flash Deal',
|
|
189
189
|
content: {
|
|
@@ -204,7 +204,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
204
204
|
productName: {
|
|
205
205
|
id: (0, _uuid.v4)(),
|
|
206
206
|
open: true,
|
|
207
|
-
type: '
|
|
207
|
+
type: 'TEXT',
|
|
208
208
|
specialContent: [],
|
|
209
209
|
text: 'Flash Deal',
|
|
210
210
|
content: {
|
|
@@ -227,7 +227,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
227
227
|
activityPrice: {
|
|
228
228
|
id: (0, _uuid.v4)(),
|
|
229
229
|
open: true,
|
|
230
|
-
type: '
|
|
230
|
+
type: 'TEXT',
|
|
231
231
|
specialContent: [],
|
|
232
232
|
text: 'Flash Deal',
|
|
233
233
|
content: {
|
|
@@ -250,7 +250,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
250
250
|
salesPrice: {
|
|
251
251
|
id: (0, _uuid.v4)(),
|
|
252
252
|
open: true,
|
|
253
|
-
type: '
|
|
253
|
+
type: 'TEXT',
|
|
254
254
|
specialContent: [],
|
|
255
255
|
text: 'Flash Deal',
|
|
256
256
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.m-search-bar {
|
|
2
2
|
height: 48px;
|
|
3
|
-
padding: 8px
|
|
3
|
+
padding: 8px 0;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: row-reverse;
|
|
6
6
|
align-items: center;
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
.right {
|
|
11
11
|
display: flex;
|
|
12
|
+
flex: 1;
|
|
13
|
+
margin-left: 15px;
|
|
12
14
|
align-items: center;
|
|
13
15
|
justify-content: space-between;
|
|
14
16
|
|
|
15
17
|
.search-input-wrap {
|
|
16
|
-
|
|
18
|
+
flex: 1;
|
|
17
19
|
background: #fff;
|
|
18
20
|
border-radius: 4px;
|
|
19
21
|
border: 1px solid #D2D9E5;
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
|
|
25
27
|
.message-wrap {
|
|
26
28
|
position: relative;
|
|
27
|
-
margin-left:
|
|
29
|
+
margin-left: 10px;
|
|
28
30
|
|
|
29
31
|
.num {
|
|
30
32
|
position: absolute;
|
|
@@ -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
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
45
61
|
var t = {};
|
|
46
62
|
|
|
@@ -133,7 +149,7 @@ function metaDecorator(WrappedComponent) {
|
|
|
133
149
|
return false;
|
|
134
150
|
};
|
|
135
151
|
|
|
136
|
-
_this.
|
|
152
|
+
_this.getInteractStyle = function () {
|
|
137
153
|
var _a = _this.state,
|
|
138
154
|
hoveredMeta = _a.hoveredMeta,
|
|
139
155
|
clickedMeta = _a.clickedMeta;
|
|
@@ -154,6 +170,22 @@ function metaDecorator(WrappedComponent) {
|
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
return style;
|
|
173
|
+
}; // text元组件在选中或悬浮时 需要实时展示其宽度
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
_this.getStyle = function () {
|
|
177
|
+
var _a = _this.props,
|
|
178
|
+
style = _a.style,
|
|
179
|
+
rest = __rest(_a, ["style"]);
|
|
180
|
+
|
|
181
|
+
var newStyle = __assign({}, style);
|
|
182
|
+
|
|
183
|
+
if (rest.data.type === 'TEXT') {
|
|
184
|
+
var width = window.magicDesign.device === 'pc' ? rest.data.content.pcWidth : rest.data.content.width;
|
|
185
|
+
newStyle.width = (width || 100) + "%";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return newStyle;
|
|
157
189
|
};
|
|
158
190
|
|
|
159
191
|
return _this;
|
|
@@ -177,13 +209,13 @@ function metaDecorator(WrappedComponent) {
|
|
|
177
209
|
Wrapper.prototype.render = function () {
|
|
178
210
|
var _a = this.props,
|
|
179
211
|
className = _a.className,
|
|
180
|
-
|
|
181
|
-
rest = __rest(_a, ["className", "style"]);
|
|
212
|
+
rest = __rest(_a, ["className"]);
|
|
182
213
|
|
|
183
|
-
var hoverStyle = this.
|
|
214
|
+
var hoverStyle = this.getInteractStyle();
|
|
215
|
+
console.log(rest);
|
|
184
216
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
217
|
className: className,
|
|
186
|
-
style:
|
|
218
|
+
style: this.getStyle()
|
|
187
219
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
188
220
|
className: "meta_wrap",
|
|
189
221
|
onClick: this.onMetaClick,
|
|
@@ -94,7 +94,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
var contentStyle = function contentStyle(content) {
|
|
97
|
-
var baseWidth = (window.magicDesign.device == 'pc' ? content.pcWidth : content.width) || 100;
|
|
98
97
|
return {
|
|
99
98
|
fontSize: window.magicDesign.device == 'pc' ? content.pcFontSize : content.fontSize,
|
|
100
99
|
fontFamily: content.fontFamily,
|
|
@@ -103,8 +102,7 @@ var contentStyle = function contentStyle(content) {
|
|
|
103
102
|
color: content.color,
|
|
104
103
|
backgroundColor: content.backgroundColor,
|
|
105
104
|
textAlign: content.textAlign,
|
|
106
|
-
|
|
107
|
-
width: Math.min(baseWidth, 100) + "%"
|
|
105
|
+
width: '100%'
|
|
108
106
|
};
|
|
109
107
|
};
|
|
110
108
|
/** 从父级数组中 分离出 片段数组 */
|