@fonixtree/magic-design 0.0.58 → 0.0.61
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/README.md +320 -0
- package/es/assets/fonts/magic-box-iconfont.css +20 -8
- package/es/assets/fonts/magic-box-iconfont.css.bak +20 -8
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/common/Button/index.js +2 -1
- package/es/common/Button/index.less +5 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/es/composite-comp/common/components/ProductItem/index.less +3 -3
- package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +13 -9
- package/es/composite-comp/dito/components/PcNavigation/pc/index.js +46 -14
- package/es/composite-comp/dito/components/PcNavigation/pc/index.less +8 -5
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
- package/es/composite-comp/dito/components/Recommend/pc/index.less +1 -1
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
- package/es/composite-comp/dito/components/SearchBar/index.js +5 -1
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/es/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +15 -2
- package/es/core/Designer/CompListPanel/index.js +8 -33
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/es/core/Designer/ConfigPanel/index.js +28 -7
- package/es/core/Designer/ConfigPanel/index.less +4 -0
- package/es/core/Designer/History/index.js +0 -2
- package/es/core/Designer/PageCompList/index.js +9 -1
- package/es/core/Designer/ViewArea/index.js +20 -6
- package/es/core/Designer/index.js +22 -26
- package/es/core/Renderer/index.js +17 -2
- package/es/decorator/compositeDecorator.js +0 -1
- package/es/decorator/updateConfigDecorator.js +2 -2
- package/es/locale/en/en.json +2 -0
- package/es/locale/es/es.json +2 -0
- package/es/locale/id/id.json +2 -0
- package/es/meta-comp/components/Button/index.js +1 -1
- package/es/meta-comp/components/Button/index.less +5 -0
- package/es/mobx/Store.js +4 -0
- package/es/utils/coreUtil.js +8 -1
- package/lib/assets/fonts/magic-box-iconfont.css +20 -8
- package/lib/assets/fonts/magic-box-iconfont.css.bak +20 -8
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/common/Button/index.js +2 -1
- package/lib/common/Button/index.less +5 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +3 -3
- package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +13 -9
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +46 -14
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +8 -5
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +1 -1
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +1 -1
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -2
- package/lib/composite-comp/dito/components/SearchBar/index.js +5 -1
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +23 -24
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/lib/composite-comp/dito/components/SearchBar/pc/index.less +57 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +15 -2
- package/lib/core/Designer/CompListPanel/index.js +8 -33
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/lib/core/Designer/ConfigPanel/index.js +28 -7
- package/lib/core/Designer/ConfigPanel/index.less +4 -0
- package/lib/core/Designer/History/index.js +0 -2
- package/lib/core/Designer/PageCompList/index.js +9 -1
- package/lib/core/Designer/ViewArea/index.js +20 -6
- package/lib/core/Designer/index.js +22 -26
- package/lib/core/Renderer/index.js +17 -2
- package/lib/decorator/compositeDecorator.js +0 -1
- package/lib/decorator/updateConfigDecorator.js +2 -2
- package/lib/locale/en/en.json +2 -0
- package/lib/locale/es/es.json +2 -0
- package/lib/locale/id/id.json +2 -0
- package/lib/meta-comp/components/Button/index.js +1 -1
- package/lib/meta-comp/components/Button/index.less +5 -0
- package/lib/mobx/Store.js +4 -0
- package/lib/utils/coreUtil.js +8 -1
- package/package.json +86 -1
package/README.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# 快捷指令使用
|
|
2
|
+
|
|
3
|
+
## 1、发布 -- npm run pub
|
|
4
|
+
|
|
5
|
+
## 2、新增国际化 -- npm run cl "Hello world"
|
|
6
|
+
|
|
7
|
+
## 3、更新iconfont -- npm run iconfont
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# 设计器二期
|
|
11
|
+
|
|
12
|
+
## 1、基本概念
|
|
13
|
+
|
|
14
|
+
### 1.1、元组件:构成复合组件的最小单位
|
|
15
|
+
|
|
16
|
+
Text、Image、Button、Divider、Video 等
|
|
17
|
+
|
|
18
|
+
### 1.2、复合组件:由若干个元组件构成的一个大组件
|
|
19
|
+
|
|
20
|
+
Text、Banner、Image Gallery、Image and Text、Carousel、Reward、Newsletter 等
|
|
21
|
+
|
|
22
|
+
### 1.3、业务公共组件:项目中复用的公共组件
|
|
23
|
+
|
|
24
|
+
所有的公共组件需要开放 value 和 onChange Api(除 Button、Iconfont)
|
|
25
|
+
|
|
26
|
+
Button、Iconfont、AlignSelecter、Collapse、ColorPicker、ImagePicker、LayoutSelecter、Slider、UrlPicker
|
|
27
|
+
|
|
28
|
+
## 2、元组件
|
|
29
|
+
|
|
30
|
+
### 2.1
|
|
31
|
+
|
|
32
|
+
元组件类型:
|
|
33
|
+
|
|
34
|
+
TEXT、IMAGE、BUTTON、DIVIDER、VIDEO
|
|
35
|
+
|
|
36
|
+
元组件报文格式:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
id:'xxxx' //元组件key
|
|
41
|
+
type: 'TYPE', //元组件类型
|
|
42
|
+
style:{
|
|
43
|
+
fontFamily:'xxx', //字体
|
|
44
|
+
...css //属性名称尽量使用标准css名称
|
|
45
|
+
},
|
|
46
|
+
hoverStyle:{
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
动态设置 hover 效果
|
|
53
|
+
|
|
54
|
+
onMouseEnter={e => { e.target.style.color = 'red'; }}
|
|
55
|
+
|
|
56
|
+
onMouseLeave={e => { e.target.style.color = 'white'; }}
|
|
57
|
+
|
|
58
|
+
文本可编辑
|
|
59
|
+
|
|
60
|
+
contenteditable="true"
|
|
61
|
+
|
|
62
|
+
### 2.2 、元组件报文
|
|
63
|
+
|
|
64
|
+
#### Text
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
id:'xxxx' //元组件key
|
|
69
|
+
type: 'TYPE', //元组件类型
|
|
70
|
+
content:'this is text',
|
|
71
|
+
style:{
|
|
72
|
+
fontFamily:'xxx', //字体
|
|
73
|
+
fontSize: '14px',
|
|
74
|
+
width: '200px',
|
|
75
|
+
...css
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Image
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
id:'xxxx' //元组件key
|
|
85
|
+
type: 'IMAGE', //元组件类型
|
|
86
|
+
name:'123.png',
|
|
87
|
+
src:'../image.png', //图片地址
|
|
88
|
+
url:'www.baidu.com', //图片跳转地址
|
|
89
|
+
style:{
|
|
90
|
+
width: '200px',
|
|
91
|
+
...css
|
|
92
|
+
},
|
|
93
|
+
hoverStyle:{ //hover 类型为new时保存src,类型为enlarge时保存scale
|
|
94
|
+
scale: '2',
|
|
95
|
+
src:'../image1.png',
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Button
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
id:'xxxx' //元组件key
|
|
105
|
+
type: 'BUTTON', //元组件类型
|
|
106
|
+
name:'Submit',
|
|
107
|
+
url: 'www.baidu.com',
|
|
108
|
+
style:{
|
|
109
|
+
buttonIconSrc:'../img.png',
|
|
110
|
+
buttonIconPlace: 'left',
|
|
111
|
+
color:'#FEFEFE',
|
|
112
|
+
border: '1px solid red',
|
|
113
|
+
borderRadius:'10px',
|
|
114
|
+
fontFamily:'xxx', //字体
|
|
115
|
+
fontSize: '14px',
|
|
116
|
+
...css
|
|
117
|
+
},
|
|
118
|
+
hoverStyle {
|
|
119
|
+
color:'#FEFEFE',
|
|
120
|
+
border: '1px solid red',
|
|
121
|
+
fontFamily:'xxx', //字体
|
|
122
|
+
fontSize: '14px',
|
|
123
|
+
...css
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 2、复合组件
|
|
129
|
+
|
|
130
|
+
### 2.1
|
|
131
|
+
|
|
132
|
+
元组件类型:
|
|
133
|
+
|
|
134
|
+
TEXT、BANNER、IMAGE_GALLERT、IMAGE_TEXT、CAROUSEL、REWARD、NEWSLETTER
|
|
135
|
+
|
|
136
|
+
复合组件报文格式:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
id:'xxxx' //复合组件key
|
|
141
|
+
type: 'TYPE', //复合组件类型
|
|
142
|
+
setting:{ //开关类型的配置及属性配置放在这里
|
|
143
|
+
autoplays: 3, //3秒轮播
|
|
144
|
+
},
|
|
145
|
+
groupSource:[], //元组件集合组数据放在这里
|
|
146
|
+
metas:{
|
|
147
|
+
title:{
|
|
148
|
+
open:false,
|
|
149
|
+
type:'IMAGE'
|
|
150
|
+
...metaCompJson
|
|
151
|
+
},
|
|
152
|
+
subTitle:{
|
|
153
|
+
open:false,
|
|
154
|
+
type:'IMAGE'
|
|
155
|
+
...metaCompJson
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
customize:{
|
|
159
|
+
layout:'',
|
|
160
|
+
background:{
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Text
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
{
|
|
171
|
+
id: 'xxxx', //复合组件key
|
|
172
|
+
type: 'TEXT', //复合组件类型
|
|
173
|
+
setting:{
|
|
174
|
+
layout:'left', // 模块布局 left/center/right ,每一个layout可能都是一个不同的组件
|
|
175
|
+
title:{
|
|
176
|
+
type:'TEXT'
|
|
177
|
+
...metaCompJson
|
|
178
|
+
},
|
|
179
|
+
subtitle:{
|
|
180
|
+
type:'TEXT'
|
|
181
|
+
...metaCompJson
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
source:[
|
|
185
|
+
{ //此处可以抽出业务组件
|
|
186
|
+
title:{
|
|
187
|
+
type:'TEXT'
|
|
188
|
+
...metaCompJson
|
|
189
|
+
},
|
|
190
|
+
content:{
|
|
191
|
+
type:'TEXT'
|
|
192
|
+
...metaCompJson
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
style:{
|
|
197
|
+
align:'left', //文本布局 left/center/right
|
|
198
|
+
backgroundColor: 'red',
|
|
199
|
+
backgroundImage:'../image.png'
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Banner
|
|
205
|
+
|
|
206
|
+
modifySetting
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"comositeId": "1111",
|
|
211
|
+
|
|
212
|
+
"value": {
|
|
213
|
+
"autoplays": 4
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
```json
|
|
219
|
+
{
|
|
220
|
+
id: 'xxxx',
|
|
221
|
+
type: 'BANNER',
|
|
222
|
+
setting:{
|
|
223
|
+
open:false
|
|
224
|
+
autoplays: 3, //3秒轮播
|
|
225
|
+
arrows:{ // 滚动箭头
|
|
226
|
+
open:false,
|
|
227
|
+
color:'red',
|
|
228
|
+
size:'',
|
|
229
|
+
hoverSize:'',
|
|
230
|
+
hoverColor:'green',
|
|
231
|
+
},
|
|
232
|
+
dots:{ //面板指示点
|
|
233
|
+
open:false,
|
|
234
|
+
color: 'red',
|
|
235
|
+
size:'',
|
|
236
|
+
hoverSize:''
|
|
237
|
+
hoverColor:'green',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
groupSource:[
|
|
241
|
+
{ //此处可以作为一个业务组件
|
|
242
|
+
id:'xxxxx',
|
|
243
|
+
image:{
|
|
244
|
+
open:false,
|
|
245
|
+
type:'IMAGE'
|
|
246
|
+
...metaCompJson
|
|
247
|
+
},
|
|
248
|
+
title:{
|
|
249
|
+
open:false,
|
|
250
|
+
type:'TEXT',
|
|
251
|
+
...metaCompJson
|
|
252
|
+
},
|
|
253
|
+
content:{
|
|
254
|
+
open:false,
|
|
255
|
+
type:'TEXT',
|
|
256
|
+
...metaCompJson
|
|
257
|
+
},
|
|
258
|
+
button:{
|
|
259
|
+
type:'BUTTON',
|
|
260
|
+
...metaCompJson
|
|
261
|
+
},
|
|
262
|
+
secondaryButton:{
|
|
263
|
+
type:'BUTTON',
|
|
264
|
+
...metaCompJson
|
|
265
|
+
},
|
|
266
|
+
layout:'center',
|
|
267
|
+
align:'left',
|
|
268
|
+
//文本布局 left/center/right
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
#### Image Gallery
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### Image and Text
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
id:'xxxx'
|
|
285
|
+
type: 'IMAGE_TEXT',
|
|
286
|
+
setting:{
|
|
287
|
+
layout:'left',
|
|
288
|
+
title:{},
|
|
289
|
+
subtitle:{},
|
|
290
|
+
button:{},
|
|
291
|
+
secondaryButton:{}
|
|
292
|
+
},
|
|
293
|
+
source:[
|
|
294
|
+
|
|
295
|
+
],
|
|
296
|
+
style:{
|
|
297
|
+
align:'left',
|
|
298
|
+
backgroundColor:'red',
|
|
299
|
+
backgroundImage:'./img.png'
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
疑问:
|
|
305
|
+
|
|
306
|
+
Text 元组件
|
|
307
|
+
|
|
308
|
+
文字链接配置好之后,怎么删除
|
|
309
|
+
|
|
310
|
+
链接配置的规则,按单词还是字符
|
|
311
|
+
|
|
312
|
+
image 元组件
|
|
313
|
+
|
|
314
|
+
属性控制进度条和输入框是否要限制最大最小值
|
|
315
|
+
|
|
316
|
+
button 元组件
|
|
317
|
+
|
|
318
|
+
是否需要 icon 的 hover 效果
|
|
319
|
+
|
|
320
|
+
banner 中的 text Align 放在元组件里?
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1668396278684') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1668396278684') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1668396278684') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,22 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.magic-box-icon-edit:before {
|
|
17
|
+
content: "\e72e";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.magic-box-icon-ChatDots:before {
|
|
21
|
+
content: "\e641";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.magic-box-icon-ShoppingCartSimple:before {
|
|
25
|
+
content: "\e640";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.magic-box-icon-select:before {
|
|
29
|
+
content: "\e65b";
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
.magic-box-icon-message:before {
|
|
17
33
|
content: "\e7b0";
|
|
18
34
|
}
|
|
@@ -21,7 +37,7 @@
|
|
|
21
37
|
content: "\e63f";
|
|
22
38
|
}
|
|
23
39
|
|
|
24
|
-
.magic-box-icon-
|
|
40
|
+
.magic-box-icon-mobile:before {
|
|
25
41
|
content: "\e63e";
|
|
26
42
|
}
|
|
27
43
|
|
|
@@ -233,10 +249,6 @@
|
|
|
233
249
|
content: "\e609";
|
|
234
250
|
}
|
|
235
251
|
|
|
236
|
-
.magic-box-icon-mobile:before {
|
|
237
|
-
content: "\e60a";
|
|
238
|
-
}
|
|
239
|
-
|
|
240
252
|
.magic-box-icon-menu:before {
|
|
241
253
|
content: "\e60b";
|
|
242
254
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1668396278684') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1668396278684') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1668396278684') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,22 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-edit:before {
|
|
17
|
+
content: "\e72e";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon-ChatDots:before {
|
|
21
|
+
content: "\e641";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-ShoppingCartSimple:before {
|
|
25
|
+
content: "\e640";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-select:before {
|
|
29
|
+
content: "\e65b";
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
.icon-message:before {
|
|
17
33
|
content: "\e7b0";
|
|
18
34
|
}
|
|
@@ -21,7 +37,7 @@
|
|
|
21
37
|
content: "\e63f";
|
|
22
38
|
}
|
|
23
39
|
|
|
24
|
-
.icon-
|
|
40
|
+
.icon-mobile:before {
|
|
25
41
|
content: "\e63e";
|
|
26
42
|
}
|
|
27
43
|
|
|
@@ -233,10 +249,6 @@
|
|
|
233
249
|
content: "\e609";
|
|
234
250
|
}
|
|
235
251
|
|
|
236
|
-
.icon-mobile:before {
|
|
237
|
-
content: "\e60a";
|
|
238
|
-
}
|
|
239
|
-
|
|
240
252
|
.icon-menu:before {
|
|
241
253
|
content: "\e60b";
|
|
242
254
|
}
|