@cloudbase/weda-ui 0.2.7 → 0.2.8

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 (114) hide show
  1. package/package.json +1 -3
  2. package/src/configs/components/container.json +2 -1
  3. package/src/configs/components/form/richText.json +2 -1
  4. package/src/configs/components/form/uploader.json +4 -4
  5. package/src/configs/components/image.json +2 -1
  6. package/src/configs/components/link.json +2 -1
  7. package/src/configs/components/richtextview.json +2 -1
  8. package/src/configs/components/scrollVeiw.json +2 -1
  9. package/src/configs/components/swiper.json +2 -1
  10. package/src/configs/components/tabs.json +2 -1
  11. package/src/configs/components/text.json +2 -1
  12. package/src/configs/index.js +3 -5
  13. package/src/mp/components/form/uploader/index.js +15 -8
  14. package/src/mp/components/form/uploader/index.wxml +1 -1
  15. package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
  16. package/src/web/components/form/select/region/index.js +3 -3
  17. package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
  18. package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
  19. package/src/web/components/form/switch/index.jsx +1 -0
  20. package/src/web/components/form/uploader/uploader.h5.jsx +42 -16
  21. package/src/web/components/form/uploader/uploader.pc.jsx +1 -1
  22. package/src/web/components/image/image.jsx +0 -1
  23. package/src/web/components/index.js +0 -1
  24. package/src/configs/components/markdown.json +0 -17
  25. package/src/mp/components/markdown/index.js +0 -27
  26. package/src/mp/components/markdown/index.json +0 -6
  27. package/src/mp/components/markdown/index.wxml +0 -1
  28. package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
  29. package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
  30. package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
  31. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
  32. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
  33. package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
  34. package/src/mp/components/markdown/towxml/config.js +0 -285
  35. package/src/mp/components/markdown/towxml/decode.js +0 -26
  36. package/src/mp/components/markdown/towxml/decode.json +0 -12
  37. package/src/mp/components/markdown/towxml/decode.wxml +0 -1
  38. package/src/mp/components/markdown/towxml/decode.wxss +0 -0
  39. package/src/mp/components/markdown/towxml/img/img.js +0 -98
  40. package/src/mp/components/markdown/towxml/img/img.json +0 -3
  41. package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
  42. package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
  43. package/src/mp/components/markdown/towxml/index.js +0 -19
  44. package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
  45. package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
  46. package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
  47. package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
  48. package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
  49. package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
  50. package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
  51. package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
  52. package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
  53. package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
  54. package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
  55. package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
  56. package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
  57. package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
  58. package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
  59. package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
  60. package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
  61. package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
  62. package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
  63. package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
  64. package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
  65. package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
  66. package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
  67. package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
  68. package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
  69. package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
  70. package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
  71. package/src/mp/components/markdown/towxml/parse/index.js +0 -106
  72. package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
  73. package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
  74. package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
  75. package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
  76. package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
  77. package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
  78. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
  79. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
  80. package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
  81. package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
  82. package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
  83. package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
  84. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
  85. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
  86. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
  87. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
  88. package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
  89. package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
  90. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
  91. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
  92. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
  93. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
  94. package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
  95. package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
  96. package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
  97. package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
  98. package/src/mp/components/markdown/towxml/table/table.js +0 -11
  99. package/src/mp/components/markdown/towxml/table/table.json +0 -6
  100. package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
  101. package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
  102. package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
  103. package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
  104. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
  105. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
  106. package/src/mp/components/markdown/towxml/towxml.js +0 -17
  107. package/src/mp/components/markdown/towxml/towxml.json +0 -6
  108. package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
  109. package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
  110. package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
  111. package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
  112. package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
  113. package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
  114. package/src/web/components/markdown/index.jsx +0 -40
@@ -1,98 +0,0 @@
1
- const config = require('../config');
2
- Component({
3
- options: {
4
- styleIsolation: 'shared',
5
- },
6
- properties: {
7
- data: {
8
- type: Object,
9
- value: {},
10
- },
11
- },
12
- data: {
13
- attr: {
14
- src: '',
15
- class: '',
16
- style: '',
17
- },
18
- size: {
19
- w: 0,
20
- h: 0,
21
- },
22
- styleObj: {},
23
- },
24
- lifetimes: {
25
- attached() {
26
- const _ts = this;
27
- const dataAttr = this.data.data.attr;
28
-
29
- // 将图片大小处理到对象中
30
- if (dataAttr.width) {
31
- _ts.data.size.w = +dataAttr.width / config.dpr;
32
- }
33
-
34
- if (dataAttr.height) {
35
- _ts.data.size.h = +dataAttr.height / config.dpr;
36
- }
37
-
38
- // 将样式合并到样式对象中
39
- if (dataAttr.style) {
40
- const re = /;\s{0,}/gi;
41
- dataAttr.style = dataAttr.style.replace(re, ';');
42
- dataAttr.style.split(';').forEach((item) => {
43
- const itemArr = item.split(':');
44
- if (/^(width|height)$/i.test(itemArr[0])) {
45
- const num = parseInt(itemArr[1]) || 0;
46
- let key = '';
47
- // itemArr[1] = num / config.dpr + itemArr[1].replace(num,'');
48
- switch (itemArr[0].toLocaleLowerCase()) {
49
- case 'width':
50
- key = 'w';
51
- break;
52
- case 'height':
53
- key = 'h';
54
- break;
55
- }
56
- _ts.data.size[key] = num / config.dpr;
57
- } else {
58
- _ts.data.styleObj[itemArr[0]] = itemArr[1];
59
- }
60
- });
61
- }
62
-
63
- // 设置公式图片
64
- _ts.setData({
65
- attr: {
66
- src: dataAttr.src,
67
- class: dataAttr.class,
68
- style: _ts.setStyle(_ts.data.styleObj),
69
- },
70
- size: _ts.data.size,
71
- });
72
- },
73
- },
74
- methods: {
75
- // 设置图片样式
76
- setStyle(o) {
77
- let str = ``;
78
- for (const key in o) {
79
- str += `${key}:${o[key]};`;
80
- }
81
- return str;
82
- },
83
-
84
- // 图片加载完成设置图片大小
85
- load(e) {
86
- const _ts = this;
87
-
88
- if (!_ts.data.size.w || !_ts.data.size.h) {
89
- _ts.setData({
90
- size: {
91
- w: e.detail.width / config.dpr,
92
- h: e.detail.height / config.dpr,
93
- },
94
- });
95
- }
96
- },
97
- },
98
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1 +0,0 @@
1
- <image class="{{attr.class}}" lazy-load="true" mode="{{attr.mode || 'widthFix'}}" src="{{attr.src}}" style="{{attr.style}} width:{{size.w}}px;height:{{size.h}}px;" bindload="load"></image>
File without changes
@@ -1,19 +0,0 @@
1
- const md = require('./parse/markdown/index');
2
- const parse = require('./parse/index');
3
-
4
- module.exports = (str, type, option) => {
5
- option = option || {};
6
- let result;
7
- switch (type) {
8
- case 'markdown':
9
- result = parse(md(str), option);
10
- break;
11
- case 'html':
12
- result = parse(str, option);
13
- break;
14
- default:
15
- throw new Error('Invalid type, only markdown and html are supported');
16
- break;
17
- }
18
- return result;
19
- };
@@ -1,53 +0,0 @@
1
- const config = require('../config');
2
- Component({
3
- options: {
4
- styleIsolation: 'shared',
5
- },
6
- properties: {
7
- data: {
8
- type: Object,
9
- value: {},
10
- },
11
- },
12
- data: {
13
- attr: {
14
- src: '',
15
- class: '',
16
- },
17
- size: {
18
- w: 0,
19
- h: 0,
20
- },
21
- },
22
- lifetimes: {
23
- attached() {
24
- const _ts = this;
25
- const dataAttr = this.data.data.attr;
26
-
27
- // 设置公式图片
28
- _ts.setData({
29
- attr: {
30
- src: `${config.latex.api}=${dataAttr.value}&theme=${global._theme}`,
31
- class: `${dataAttr.class} ${dataAttr.class}--${dataAttr.type}`,
32
- },
33
- });
34
- },
35
- },
36
- methods: {
37
- load(e) {
38
- const _ts = this;
39
-
40
- // 公式图片加载完成则根据其图片大小、类型计算其显示的合适大小
41
- const scale = 20;
42
- const w = e.detail.width / scale;
43
- const h = e.detail.height / scale;
44
-
45
- _ts.setData({
46
- size: {
47
- w,
48
- h,
49
- },
50
- });
51
- },
52
- },
53
- });
@@ -1,5 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- }
5
- }
@@ -1 +0,0 @@
1
- <image class="{{attr.class}}" lazy-load="true" src="{{attr.src}}" style="width:{{size.w}}em; height:{{size.h}}em;" bindload="load"></image>