@10yun/cv-mobile-ui 0.5.19 → 0.5.20

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 (69) hide show
  1. package/other/mpvue-picker/mpvuePicker.vue +402 -0
  2. package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
  3. package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
  4. package/other/uParse/components/style.css +1 -0
  5. package/other/uParse/components/wxParseAudio.vue +1 -0
  6. package/other/uParse/components/wxParseImg.vue +86 -0
  7. package/other/uParse/components/wxParseTable.vue +54 -0
  8. package/other/uParse/components/wxParseTemplate0.vue +98 -0
  9. package/other/uParse/components/wxParseTemplate1.vue +81 -0
  10. package/other/uParse/components/wxParseTemplate10.vue +81 -0
  11. package/other/uParse/components/wxParseTemplate11.vue +79 -0
  12. package/other/uParse/components/wxParseTemplate2.vue +81 -0
  13. package/other/uParse/components/wxParseTemplate3.vue +81 -0
  14. package/other/uParse/components/wxParseTemplate4.vue +81 -0
  15. package/other/uParse/components/wxParseTemplate5.vue +81 -0
  16. package/other/uParse/components/wxParseTemplate6.vue +81 -0
  17. package/other/uParse/components/wxParseTemplate7.vue +81 -0
  18. package/other/uParse/components/wxParseTemplate8.vue +81 -0
  19. package/other/uParse/components/wxParseTemplate9.vue +81 -0
  20. package/other/uParse/components/wxParseVideo.vue +14 -0
  21. package/other/uParse/editor.css +495 -0
  22. package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
  23. package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
  24. package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
  25. package/other/uParse/wxParse.vue +196 -0
  26. package/package.json +1 -1
  27. package/plugins/map/amqp-wx.js +173 -0
  28. package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
  29. package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
  30. package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
  31. package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
  32. package/uni-ui/lib/amap-wx/js/util.js +0 -181
  33. package/uni-ui/lib/marked/index.js +0 -1
  34. package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
  35. package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
  36. package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
  37. package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
  38. package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
  39. package/uni-ui/lib/uParse/src/components/style.css +0 -2
  40. package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
  41. package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
  42. package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
  43. package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
  44. package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
  45. package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
  46. package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
  47. package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
  48. package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
  49. package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
  50. package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
  51. package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
  52. package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
  53. package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
  54. package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
  55. package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
  56. package/uni-ui/lib/uParse/src/editor.css +0 -495
  57. package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
  58. /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
  59. /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
  60. /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
  61. /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
  62. /package/{uni-ui/lib → other}/product.vue +0 -0
  63. /package/{uni-ui/lib → other}/style.css +0 -0
  64. /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
  65. /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
  66. /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
  67. /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
  68. /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
  69. /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
@@ -0,0 +1,495 @@
1
+ .ql-container {
2
+ display: block;
3
+ position: relative;
4
+ box-sizing: border-box;
5
+ -webkit-user-select: text;
6
+ user-select: text;
7
+ outline: none;
8
+ overflow: hidden;
9
+ width: 100%;
10
+ height: auto;
11
+ min-height: 30px;
12
+ }
13
+
14
+ .ql-container[hidden] {
15
+ display: none;
16
+ }
17
+
18
+ .ql-container .ql-editor {
19
+ position: relative;
20
+ font-size: inherit;
21
+ line-height: inherit;
22
+ font-family: inherit;
23
+ min-height: inherit;
24
+ width: 100%;
25
+ height: 100%;
26
+ padding: 0;
27
+ overflow-x: hidden;
28
+ overflow-y: auto;
29
+ -webkit-tap-highlight-color: transparent;
30
+ -webkit-touch-callout: none;
31
+ -webkit-overflow-scrolling: touch;
32
+ }
33
+
34
+ .ql-container .ql-editor::-webkit-scrollbar {
35
+ width: 0 !important;
36
+ }
37
+
38
+ .ql-container .ql-editor.scroll-disabled {
39
+ overflow: hidden;
40
+ }
41
+
42
+ .ql-container .ql-image-overlay {
43
+ display: flex;
44
+ position: absolute;
45
+ box-sizing: border-box;
46
+ border: 1px dashed #ccc;
47
+ justify-content: center;
48
+ align-items: center;
49
+ -webkit-user-select: none;
50
+ user-select: none;
51
+ }
52
+
53
+ .ql-container .ql-image-overlay .ql-image-size {
54
+ position: absolute;
55
+ padding: 4px 8px;
56
+ text-align: center;
57
+ background-color: #fff;
58
+ color: #888;
59
+ border: 1px solid #ccc;
60
+ box-sizing: border-box;
61
+ opacity: 0.8;
62
+ right: 4px;
63
+ top: 4px;
64
+ font-size: 12px;
65
+ display: inline-block;
66
+ width: auto;
67
+ }
68
+
69
+ .ql-container .ql-image-overlay .ql-image-toolbar {
70
+ position: relative;
71
+ text-align: center;
72
+ box-sizing: border-box;
73
+ background: #000;
74
+ border-radius: 5px;
75
+ color: #fff;
76
+ font-size: 0;
77
+ min-height: 24px;
78
+ z-index: 100;
79
+ }
80
+
81
+ .ql-container .ql-image-overlay .ql-image-toolbar span {
82
+ display: inline-block;
83
+ cursor: pointer;
84
+ padding: 5px;
85
+ font-size: 12px;
86
+ border-right: 1px solid #fff;
87
+ }
88
+
89
+ .ql-container .ql-image-overlay .ql-image-toolbar span:last-child {
90
+ border-right: 0;
91
+ }
92
+
93
+ .ql-container .ql-image-overlay .ql-image-toolbar span.triangle-up {
94
+ padding: 0;
95
+ position: absolute;
96
+ top: -12px;
97
+ left: 50%;
98
+ transform: translatex(-50%);
99
+ width: 0;
100
+ height: 0;
101
+ border-width: 6px;
102
+ border-style: solid;
103
+ border-color: transparent transparent black transparent;
104
+ }
105
+
106
+ .ql-container .ql-image-overlay .ql-image-handle {
107
+ position: absolute;
108
+ height: 12px;
109
+ width: 12px;
110
+ border-radius: 50%;
111
+ border: 1px solid #ccc;
112
+ box-sizing: border-box;
113
+ background: #fff;
114
+ }
115
+
116
+ .ql-container img {
117
+ display: inline-block;
118
+ max-width: 100%;
119
+ }
120
+
121
+ .ql-container .img {
122
+ display: inline-block;
123
+ max-width: 100%;
124
+ }
125
+
126
+ .ql-clipboard p {
127
+ margin: 0;
128
+ padding: 0;
129
+ }
130
+
131
+ .ql-editor {
132
+ box-sizing: border-box;
133
+ height: 100%;
134
+ outline: none;
135
+ overflow-y: auto;
136
+ tab-size: 4;
137
+ -moz-tab-size: 4;
138
+ text-align: left;
139
+ white-space: pre-wrap;
140
+ word-wrap: break-word;
141
+ }
142
+
143
+ .ql-editor > * {
144
+ cursor: text;
145
+ }
146
+
147
+ .ql-editor p,
148
+ .ql-editor ol,
149
+ .ql-editor ul,
150
+ .ql-editor pre,
151
+ .ql-editor blockquote,
152
+ .ql-editor h1,
153
+ .ql-editor h2,
154
+ .ql-editor h3,
155
+ .ql-editor h4,
156
+ .ql-editor h5,
157
+ .ql-editor h6 {
158
+ margin: 0;
159
+ padding: 0;
160
+ counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
161
+ }
162
+
163
+ .ql-editor ol > li,
164
+ .ql-editor ul > li {
165
+ list-style-type: none;
166
+ }
167
+
168
+ .ql-editor ul > li::before {
169
+ content: '\2022';
170
+ }
171
+
172
+ .ql-editor ul[data-checked='true'],
173
+ .ql-editor ul[data-checked='false'] {
174
+ pointer-events: none;
175
+ }
176
+
177
+ .ql-editor ul[data-checked='true'] > li *,
178
+ .ql-editor ul[data-checked='false'] > li * {
179
+ pointer-events: all;
180
+ }
181
+
182
+ .ql-editor ul[data-checked='true'] > li::before,
183
+ .ql-editor ul[data-checked='false'] > li::before {
184
+ color: #777;
185
+ cursor: pointer;
186
+ pointer-events: all;
187
+ }
188
+
189
+ .ql-editor ul[data-checked='true'] > li::before {
190
+ content: '\2611';
191
+ }
192
+
193
+ .ql-editor ul[data-checked='false'] > li::before {
194
+ content: '\2610';
195
+ }
196
+
197
+ .ql-editor li::before {
198
+ display: inline-block;
199
+ white-space: nowrap;
200
+ width: 2em;
201
+ }
202
+
203
+ .ql-editor ol li {
204
+ counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
205
+ counter-increment: list-0;
206
+ }
207
+
208
+ .ql-editor ol li:before {
209
+ content: counter(list-0, decimal) '. ';
210
+ }
211
+
212
+ .ql-editor ol li.ql-indent-1 {
213
+ counter-increment: list-1;
214
+ }
215
+
216
+ .ql-editor ol li.ql-indent-1:before {
217
+ content: counter(list-1, lower-alpha) '. ';
218
+ }
219
+
220
+ .ql-editor ol li.ql-indent-1 {
221
+ counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
222
+ }
223
+
224
+ .ql-editor ol li.ql-indent-2 {
225
+ counter-increment: list-2;
226
+ }
227
+
228
+ .ql-editor ol li.ql-indent-2:before {
229
+ content: counter(list-2, lower-roman) '. ';
230
+ }
231
+
232
+ .ql-editor ol li.ql-indent-2 {
233
+ counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
234
+ }
235
+
236
+ .ql-editor ol li.ql-indent-3 {
237
+ counter-increment: list-3;
238
+ }
239
+
240
+ .ql-editor ol li.ql-indent-3:before {
241
+ content: counter(list-3, decimal) '. ';
242
+ }
243
+
244
+ .ql-editor ol li.ql-indent-3 {
245
+ counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
246
+ }
247
+
248
+ .ql-editor ol li.ql-indent-4 {
249
+ counter-increment: list-4;
250
+ }
251
+
252
+ .ql-editor ol li.ql-indent-4:before {
253
+ content: counter(list-4, lower-alpha) '. ';
254
+ }
255
+
256
+ .ql-editor ol li.ql-indent-4 {
257
+ counter-reset: list-5 list-6 list-7 list-8 list-9;
258
+ }
259
+
260
+ .ql-editor ol li.ql-indent-5 {
261
+ counter-increment: list-5;
262
+ }
263
+
264
+ .ql-editor ol li.ql-indent-5:before {
265
+ content: counter(list-5, lower-roman) '. ';
266
+ }
267
+
268
+ .ql-editor ol li.ql-indent-5 {
269
+ counter-reset: list-6 list-7 list-8 list-9;
270
+ }
271
+
272
+ .ql-editor ol li.ql-indent-6 {
273
+ counter-increment: list-6;
274
+ }
275
+
276
+ .ql-editor ol li.ql-indent-6:before {
277
+ content: counter(list-6, decimal) '. ';
278
+ }
279
+
280
+ .ql-editor ol li.ql-indent-6 {
281
+ counter-reset: list-7 list-8 list-9;
282
+ }
283
+
284
+ .ql-editor ol li.ql-indent-7 {
285
+ counter-increment: list-7;
286
+ }
287
+
288
+ .ql-editor ol li.ql-indent-7:before {
289
+ content: counter(list-7, lower-alpha) '. ';
290
+ }
291
+
292
+ .ql-editor ol li.ql-indent-7 {
293
+ counter-reset: list-8 list-9;
294
+ }
295
+
296
+ .ql-editor ol li.ql-indent-8 {
297
+ counter-increment: list-8;
298
+ }
299
+
300
+ .ql-editor ol li.ql-indent-8:before {
301
+ content: counter(list-8, lower-roman) '. ';
302
+ }
303
+
304
+ .ql-editor ol li.ql-indent-8 {
305
+ counter-reset: list-9;
306
+ }
307
+
308
+ .ql-editor ol li.ql-indent-9 {
309
+ counter-increment: list-9;
310
+ }
311
+
312
+ .ql-editor ol li.ql-indent-9:before {
313
+ content: counter(list-9, decimal) '. ';
314
+ }
315
+
316
+ .ql-editor .ql-indent-1:not(.ql-direction-rtl) {
317
+ padding-left: 2em;
318
+ }
319
+
320
+ .ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
321
+ padding-left: 2em;
322
+ }
323
+
324
+ .ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
325
+ padding-right: 2em;
326
+ }
327
+
328
+ .ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
329
+ padding-right: 2em;
330
+ }
331
+
332
+ .ql-editor .ql-indent-2:not(.ql-direction-rtl) {
333
+ padding-left: 4em;
334
+ }
335
+
336
+ .ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
337
+ padding-left: 4em;
338
+ }
339
+
340
+ .ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
341
+ padding-right: 4em;
342
+ }
343
+
344
+ .ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
345
+ padding-right: 4em;
346
+ }
347
+
348
+ .ql-editor .ql-indent-3:not(.ql-direction-rtl) {
349
+ padding-left: 6em;
350
+ }
351
+
352
+ .ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
353
+ padding-left: 6em;
354
+ }
355
+
356
+ .ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
357
+ padding-right: 6em;
358
+ }
359
+
360
+ .ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
361
+ padding-right: 6em;
362
+ }
363
+
364
+ .ql-editor .ql-indent-4:not(.ql-direction-rtl) {
365
+ padding-left: 8em;
366
+ }
367
+
368
+ .ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
369
+ padding-left: 8em;
370
+ }
371
+
372
+ .ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
373
+ padding-right: 8em;
374
+ }
375
+
376
+ .ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
377
+ padding-right: 8em;
378
+ }
379
+
380
+ .ql-editor .ql-indent-5:not(.ql-direction-rtl) {
381
+ padding-left: 10em;
382
+ }
383
+
384
+ .ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
385
+ padding-left: 10em;
386
+ }
387
+
388
+ .ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
389
+ padding-right: 10em;
390
+ }
391
+
392
+ .ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
393
+ padding-right: 10em;
394
+ }
395
+
396
+ .ql-editor .ql-indent-6:not(.ql-direction-rtl) {
397
+ padding-left: 12em;
398
+ }
399
+
400
+ .ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
401
+ padding-left: 12em;
402
+ }
403
+
404
+ .ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
405
+ padding-right: 12em;
406
+ }
407
+
408
+ .ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
409
+ padding-right: 12em;
410
+ }
411
+
412
+ .ql-editor .ql-indent-7:not(.ql-direction-rtl) {
413
+ padding-left: 14em;
414
+ }
415
+
416
+ .ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
417
+ padding-left: 14em;
418
+ }
419
+
420
+ .ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
421
+ padding-right: 14em;
422
+ }
423
+
424
+ .ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
425
+ padding-right: 14em;
426
+ }
427
+
428
+ .ql-editor .ql-indent-8:not(.ql-direction-rtl) {
429
+ padding-left: 16em;
430
+ }
431
+
432
+ .ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
433
+ padding-left: 16em;
434
+ }
435
+
436
+ .ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
437
+ padding-right: 16em;
438
+ }
439
+
440
+ .ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
441
+ padding-right: 16em;
442
+ }
443
+
444
+ .ql-editor .ql-indent-9:not(.ql-direction-rtl) {
445
+ padding-left: 18em;
446
+ }
447
+
448
+ .ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
449
+ padding-left: 18em;
450
+ }
451
+
452
+ .ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
453
+ padding-right: 18em;
454
+ }
455
+
456
+ .ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
457
+ padding-right: 18em;
458
+ }
459
+
460
+ .ql-editor .ql-direction-rtl {
461
+ direction: rtl;
462
+ text-align: inherit;
463
+ }
464
+
465
+ .ql-editor .ql-align-center {
466
+ text-align: center;
467
+ }
468
+
469
+ .ql-editor .ql-align-justify {
470
+ text-align: justify;
471
+ }
472
+
473
+ .ql-editor .ql-align-right {
474
+ text-align: right;
475
+ }
476
+
477
+ .ql-editor.ql-blank::before {
478
+ color: rgba(0, 0, 0, 0.6);
479
+ content: attr(data-placeholder);
480
+ font-style: italic;
481
+ pointer-events: none;
482
+ position: absolute;
483
+ }
484
+
485
+ .ql-container.ql-disabled .ql-editor ul[data-checked] > li::before {
486
+ pointer-events: none;
487
+ }
488
+
489
+ .ql-clipboard {
490
+ left: -100000px;
491
+ height: 1px;
492
+ overflow-y: hidden;
493
+ position: absolute;
494
+ top: 50%;
495
+ }
@@ -23,10 +23,14 @@ function makeMap(str) {
23
23
  }
24
24
 
25
25
  // Block Elements - HTML 5
26
- const block = makeMap('br,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
26
+ const block = makeMap(
27
+ 'br,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'
28
+ );
27
29
 
28
30
  // Inline Elements - HTML 5
29
- const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
31
+ const inline = makeMap(
32
+ 'a,abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'
33
+ );
30
34
 
31
35
  // Elements that you can, intentionally, leave open
32
36
  // (and which close themselves)
@@ -48,11 +52,12 @@ function trimHtml(html) {
48
52
 
49
53
  function getScreenInfo() {
50
54
  const screen = {};
51
- wx.getSystemInfo({
55
+ uni.getSystemInfo({
52
56
  success: (res) => {
53
- screen.width = res.windowWidth;
57
+ // screen.width = res.windowWidth;
58
+ screen.width = (res.windowWidth * 710) / 750;
54
59
  screen.height = res.windowHeight;
55
- },
60
+ }
56
61
  });
57
62
  return screen;
58
63
  }
@@ -66,15 +71,15 @@ function html2json(html, customHandler, imageProp, host) {
66
71
  const bufArray = [];
67
72
  const results = {
68
73
  nodes: [],
69
- imageUrls: [],
74
+ imageUrls: []
70
75
  };
71
76
 
72
- const screen = getScreenInfo();
77
+ const screen = getScreenInfo();
73
78
  function Node(tag) {
74
79
  this.node = 'element';
75
80
  this.tag = tag;
76
-
77
- this.$screen = screen;
81
+
82
+ this.$screen = screen;
78
83
  }
79
84
 
80
85
  HTMLParser(html, {
@@ -145,7 +150,7 @@ function html2json(html, customHandler, imageProp, host) {
145
150
  let imgUrl = node.attr.src;
146
151
  imgUrl = wxDiscode.urlToHttpUrl(imgUrl, imageProp.domain);
147
152
  Object.assign(node.attr, imageProp, {
148
- src: imgUrl || '',
153
+ src: imgUrl || ''
149
154
  });
150
155
  if (imgUrl) {
151
156
  results.imageUrls.push(imgUrl);
@@ -159,19 +164,11 @@ function html2json(html, customHandler, imageProp, host) {
159
164
 
160
165
  // 处理font标签样式属性
161
166
  if (node.tag === 'font') {
162
- const fontSize = [
163
- 'x-small',
164
- 'small',
165
- 'medium',
166
- 'large',
167
- 'x-large',
168
- 'xx-large',
169
- '-webkit-xxx-large',
170
- ];
167
+ const fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
171
168
  const styleAttrs = {
172
169
  color: 'color',
173
170
  face: 'font-family',
174
- size: 'font-size',
171
+ size: 'font-size'
175
172
  };
176
173
  if (!node.styleStr) node.styleStr = '';
177
174
  Object.keys(styleAttrs).forEach((key) => {
@@ -236,7 +233,7 @@ function html2json(html, customHandler, imageProp, host) {
236
233
 
237
234
  const node = {
238
235
  node: 'text',
239
- text,
236
+ text
240
237
  };
241
238
 
242
239
  if (customHandler.chars) {
@@ -252,7 +249,7 @@ function html2json(html, customHandler, imageProp, host) {
252
249
  }
253
250
  parent.nodes.push(node);
254
251
  }
255
- },
252
+ }
256
253
  });
257
254
 
258
255
  return results;
@@ -13,7 +13,8 @@
13
13
  */
14
14
  // Regular Expressions for parsing tags and attributes
15
15
 
16
- const startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z0-9_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
16
+ const startTag =
17
+ /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z0-9_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
17
18
  const endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
18
19
  const attr = /([a-zA-Z0-9_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
19
20
 
@@ -28,17 +29,23 @@ function makeMap(str) {
28
29
  const empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr');
29
30
 
30
31
  // Block Elements - HTML 5
31
- const block = makeMap('address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
32
+ const block = makeMap(
33
+ 'address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'
34
+ );
32
35
 
33
36
  // Inline Elements - HTML 5
34
- const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
37
+ const inline = makeMap(
38
+ 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'
39
+ );
35
40
 
36
41
  // Elements that you can, intentionally, leave open
37
42
  // (and which close themselves)
38
43
  const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr');
39
44
 
40
45
  // Attributes that have their values filled in disabled="disabled"
41
- const fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected');
46
+ const fillAttrs = makeMap(
47
+ 'checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'
48
+ );
42
49
 
43
50
  function HTMLParser(html, handler) {
44
51
  let index;
@@ -98,7 +105,7 @@ function HTMLParser(html, handler) {
98
105
  attrs.push({
99
106
  name,
100
107
  value,
101
- escaped: value.replace(/(^|[^\\])"/g, '$1\\"'), // "
108
+ escaped: value.replace(/(^|[^\\])"/g, '$1\\"') // "
102
109
  });
103
110
  });
104
111
 
@@ -109,7 +109,7 @@ function strcharacterDiscode(str) {
109
109
  str = str.replace(/&lt;/g, '<');
110
110
  str = str.replace(/&gt;/g, '>');
111
111
  str = str.replace(/&#8226;/g, '•');
112
-
112
+ str = str.replace(/&nbsp;/g, ' ');
113
113
  return str;
114
114
  }
115
115
 
@@ -191,5 +191,5 @@ function urlToHttpUrl(url, domain) {
191
191
 
192
192
  export default {
193
193
  strDiscode,
194
- urlToHttpUrl,
194
+ urlToHttpUrl
195
195
  };