@cloudbase/weda-ui 0.2.5 → 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.
- package/package.json +4 -4
- package/src/.DS_Store +0 -0
- package/src/configs/components/container.json +2 -1
- package/src/configs/components/form/input.json +6 -0
- package/src/configs/components/form/richText.json +2 -1
- package/src/configs/components/form/uploader.json +10 -5
- package/src/configs/components/image.json +2 -1
- package/src/configs/components/link.json +2 -1
- package/src/configs/components/richtextview.json +2 -1
- package/src/configs/components/scrollVeiw.json +2 -1
- package/src/configs/components/swiper.json +2 -1
- package/src/configs/components/tabs.json +31 -86
- package/src/configs/components/text.json +2 -1
- package/src/configs/index.js +3 -5
- package/src/index.js +2 -3
- package/src/mp/components/form/input/index.js +5 -1
- package/src/mp/components/form/input/index.wxml +2 -1
- package/src/mp/components/form/select/index.js +2 -2
- package/src/mp/components/form/textarea/index.wxml +1 -0
- package/src/mp/components/form/uploader/index.js +50 -13
- package/src/mp/components/form/uploader/index.wxml +11 -1
- package/src/mp/components/image/index.js +57 -8
- package/src/mp/components/image/index.json +4 -1
- package/src/mp/components/image/index.wxml +4 -2
- package/src/mp/components/image/index.wxss +15 -0
- package/src/mp/components/richText/index.wxml +3 -1
- package/src/mp/components/tabs/index.js +22 -6
- package/src/mp/utils/deepEqual.js +42 -0
- package/src/web/actions/index.js +2 -4
- package/src/web/components/form/checkbox/index.jsx +8 -10
- package/src/web/components/form/formcell/index.jsx +1 -1
- package/src/web/components/form/input/index.jsx +16 -18
- package/src/web/components/form/radio/index.jsx +7 -7
- package/src/web/components/form/select/h5.jsx +1 -1
- package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
- package/src/web/components/form/select/region/index.js +3 -3
- package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
- package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
- package/src/web/components/form/switch/index.jsx +4 -9
- package/src/web/components/form/textarea/index.jsx +4 -12
- package/src/web/components/form/uploader/index.css +15 -0
- package/src/web/components/form/uploader/index.jsx +2 -2
- package/src/web/components/form/uploader/uploader.h5.jsx +237 -0
- package/src/web/components/form/uploader/{uploaderPc.jsx → uploader.pc.jsx} +76 -58
- package/src/web/components/image/image.jsx +79 -5
- package/src/web/components/image/index.css +18 -0
- package/src/web/components/image/index.jsx +1 -0
- package/src/web/components/index.js +26 -58
- package/src/web/components/richTextView/index.css +0 -10
- package/src/web/components/richTextView/index.jsx +1 -12
- package/src/web/components/tabs/{index.js → index.jsx} +3 -3
- package/src/web/components/tabs/{tabsH5.js → tabs.h5.jsx} +9 -47
- package/src/web/components/tabs/{tabsPc.js → tabs.pc.jsx} +13 -47
- package/src/web/components/uploaderView/index.jsx +1 -1
- package/src/web/index.js +2 -3
- package/src/web/utils/isObjectEqual.js +10 -1
- package/src/web/utils/useSyncValue.js +14 -0
- package/src/web/weda-ui.css +8 -0
- package/src/configs/components/markdown.json +0 -17
- package/src/mp/components/markdown/index.js +0 -27
- package/src/mp/components/markdown/index.json +0 -6
- package/src/mp/components/markdown/index.wxml +0 -1
- package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
- package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
- package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
- package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
- package/src/mp/components/markdown/towxml/config.js +0 -285
- package/src/mp/components/markdown/towxml/decode.js +0 -26
- package/src/mp/components/markdown/towxml/decode.json +0 -12
- package/src/mp/components/markdown/towxml/decode.wxml +0 -1
- package/src/mp/components/markdown/towxml/decode.wxss +0 -0
- package/src/mp/components/markdown/towxml/img/img.js +0 -98
- package/src/mp/components/markdown/towxml/img/img.json +0 -3
- package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
- package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
- package/src/mp/components/markdown/towxml/index.js +0 -19
- package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
- package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
- package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
- package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
- package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
- package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
- package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
- package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
- package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
- package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
- package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
- package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
- package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
- package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
- package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
- package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
- package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
- package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
- package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
- package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
- package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
- package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
- package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
- package/src/mp/components/markdown/towxml/parse/index.js +0 -106
- package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
- package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
- package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
- package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
- package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
- package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
- package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
- package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
- package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
- package/src/mp/components/markdown/towxml/table/table.js +0 -11
- package/src/mp/components/markdown/towxml/table/table.json +0 -6
- package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
- package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
- package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
- package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
- package/src/mp/components/markdown/towxml/towxml.js +0 -17
- package/src/mp/components/markdown/towxml/towxml.json +0 -6
- package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
- package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
- package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
- package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
- package/src/web/components/form/uploader/uploaderH5.jsx +0 -192
- package/src/web/components/markdown/index.jsx +0 -40
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/*音频播放器样式*/
|
|
2
|
-
.h2w__audio {
|
|
3
|
-
height: 136rpx;
|
|
4
|
-
margin:16rpx 0;
|
|
5
|
-
background: #f1f1f1;
|
|
6
|
-
position: relative;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.h2w__audio--error .h2w__audioIcon,
|
|
10
|
-
.h2w__audio--loading .h2w__audioIcon {
|
|
11
|
-
display:none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.h2w__audio--readyed .h2w__audioLoading,
|
|
15
|
-
.h2w__audio--end .h2w__audioLoading,
|
|
16
|
-
.h2w__audio--play .h2w__audioIcon,
|
|
17
|
-
.h2w__audio--pause .h2w__audioLoading,
|
|
18
|
-
.h2w__audio--play .h2w__audioLoading {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.h2w__audio--play .h2w__audioCover image {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.h2w__audio--readyed .h2w__audioTips,
|
|
27
|
-
.h2w__audio--end .h2w__audioTips,
|
|
28
|
-
.h2w__audio--stop .h2w__audioTips,
|
|
29
|
-
.h2w__audio--pause .h2w__audioTips,
|
|
30
|
-
.h2w__audio--play .h2w__audioTips {
|
|
31
|
-
opacity:0.4;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.h2w__audio--error {
|
|
35
|
-
background:red;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* .h2w__audio--end .h2w__audio__icon {width:20rpx; height:20rpx; background:white; border:0; left:24rpx; top:24rpx; border-radius:2rpx;} */
|
|
39
|
-
.h2w__audioCover {
|
|
40
|
-
width: 136rpx;
|
|
41
|
-
height: 136rpx;
|
|
42
|
-
background: black;
|
|
43
|
-
float: left;
|
|
44
|
-
position: relative;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.h2w__audioCover image {
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
opacity: 0.6;
|
|
51
|
-
margin:0;
|
|
52
|
-
transition: all 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.h2w__audioCover .h2w__audioLoading {
|
|
56
|
-
width:80rpx;
|
|
57
|
-
height:80rpx;
|
|
58
|
-
position:absolute;
|
|
59
|
-
left:50%;
|
|
60
|
-
top:50%;
|
|
61
|
-
margin:-40rpx 0 0 -40rpx;
|
|
62
|
-
z-index:1;
|
|
63
|
-
opacity:1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.h2w__audioInfo {
|
|
67
|
-
padding-left: 20rpx;
|
|
68
|
-
padding-top: 16rpx;
|
|
69
|
-
position: absolute;
|
|
70
|
-
left: 136rpx;
|
|
71
|
-
right: 0;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.h2w__audioSchedule {
|
|
75
|
-
position: absolute;
|
|
76
|
-
left: 0;
|
|
77
|
-
top: 0;
|
|
78
|
-
background: rgba(0, 255, 0, 0.1);
|
|
79
|
-
height: 136rpx;
|
|
80
|
-
width: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.h2w__audioTips {
|
|
84
|
-
position:absolute;
|
|
85
|
-
right:0;
|
|
86
|
-
top:0;
|
|
87
|
-
height: 32rpx;
|
|
88
|
-
line-height: 32rpx;
|
|
89
|
-
padding:10rpx 20rpx;
|
|
90
|
-
font-size:20rpx;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.h2w__audio--error .h2w__audioTips {
|
|
94
|
-
color:red;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.h2w__audioTitle {
|
|
98
|
-
display: block;
|
|
99
|
-
font-size: 24rpx;
|
|
100
|
-
height: 40rpx;
|
|
101
|
-
line-height: 40rpx;
|
|
102
|
-
font-weight: bold;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.h2w__audioAuthor {
|
|
106
|
-
display: block;
|
|
107
|
-
font-size: 20rpx;
|
|
108
|
-
height: 32rpx;
|
|
109
|
-
line-height: 32rpx;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.h2w__audioTime {
|
|
113
|
-
display: block;
|
|
114
|
-
font-size: 20rpx;
|
|
115
|
-
height: 32rpx;
|
|
116
|
-
line-height: 32rpx;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.h2w__audioIcon {
|
|
120
|
-
width: 0;
|
|
121
|
-
height: 0;
|
|
122
|
-
position: absolute;
|
|
123
|
-
left: 60rpx;
|
|
124
|
-
top: 48rpx;
|
|
125
|
-
border-width: 20rpx 0 20rpx 20rpx;
|
|
126
|
-
border-style: solid;
|
|
127
|
-
border-color: transparent transparent transparent #fff;
|
|
128
|
-
z-index: 1;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* 深色主题 */
|
|
132
|
-
.h2w-dark .h2w__audio {
|
|
133
|
-
background: #1f1f1f;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.h2w-dark .h2w__audio--error {
|
|
137
|
-
background:rgba(255,0,0,0.1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.h2w-dark .h2w__audioCover {
|
|
141
|
-
background: black;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.h2w-dark .h2w__audioSchedule {
|
|
145
|
-
background: rgba(0, 255, 0, 0.2);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.h2w-dark .h2w__audioIcon {
|
|
149
|
-
border-color: transparent transparent transparent #fff;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/* 浅色主题 */
|
|
155
|
-
.h2w-light .h2w__audio {
|
|
156
|
-
background: #f1f1f1;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.h2w-light .h2w__audio--error {
|
|
160
|
-
background:rgba(255,0,0,0.1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.h2w-light .h2w__audioCover {
|
|
164
|
-
background: black;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.h2w-light .h2w__audioSchedule {
|
|
168
|
-
background: rgba(0, 255, 0, 0.1);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.h2w-light .h2w__audioIcon {
|
|
172
|
-
border-color: transparent transparent transparent #fff;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg width='200px' height='200px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(0 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-1s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(30 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.9166666666666666s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(60 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.8333333333333334s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(90 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.75s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(120 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.6666666666666666s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(150 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.5833333333333334s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(180 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.5s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(210 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.4166666666666667s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(240 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.3333333333333333s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(270 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.25s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(300 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.16666666666666666s' repeatCount='indefinite'/></rect><rect x='46.5' y='40' width='7' height='20' rx='5' ry='5' fill='#1ed600' transform='rotate(330 50 50) translate(0 -30)'> <animate attributeName='opacity' from='1' to='0' dur='1s' begin='-0.08333333333333333s' repeatCount='indefinite'/></rect></svg>
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// LaTex公式、yuml解析服务架设参见 https://github.com/sbfkcel/markdown-server
|
|
3
|
-
|
|
4
|
-
// 数学公式解析API
|
|
5
|
-
latex: {
|
|
6
|
-
api: 'http://towxml.vvadd.com/?tex',
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
// yuml图解析APPI
|
|
10
|
-
yuml: {
|
|
11
|
-
api: 'http://towxml.vvadd.com/?yuml',
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
// markdown解析配置,保留需要的选项即可
|
|
15
|
-
markdown: [
|
|
16
|
-
'sub', // 下标支持
|
|
17
|
-
'sup', // 上标支持
|
|
18
|
-
'ins', // 文本删除线支持
|
|
19
|
-
'mark', // 文本高亮支持
|
|
20
|
-
'emoji', // emoji表情支持
|
|
21
|
-
'todo', // todo支持
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
// 代码高亮配置,保留需要的选项即可(尽量越少越好,不要随意调整顺序。部分高亮有顺序依赖)
|
|
25
|
-
highlight: [
|
|
26
|
-
'c-like',
|
|
27
|
-
'c',
|
|
28
|
-
'bash',
|
|
29
|
-
'css',
|
|
30
|
-
'dart',
|
|
31
|
-
'go',
|
|
32
|
-
'java',
|
|
33
|
-
'javascript',
|
|
34
|
-
'json',
|
|
35
|
-
'less',
|
|
36
|
-
'scss',
|
|
37
|
-
'shell',
|
|
38
|
-
'xml',
|
|
39
|
-
'htmlbars',
|
|
40
|
-
'nginx',
|
|
41
|
-
'php',
|
|
42
|
-
'python',
|
|
43
|
-
'python-repl',
|
|
44
|
-
'typescript',
|
|
45
|
-
|
|
46
|
-
// 'csharp',
|
|
47
|
-
// 'http',
|
|
48
|
-
// 'swift',
|
|
49
|
-
// 'yaml',
|
|
50
|
-
// 'markdown',
|
|
51
|
-
// 'powershell',
|
|
52
|
-
// 'ruby',
|
|
53
|
-
// 'makefile',
|
|
54
|
-
// 'lua',
|
|
55
|
-
// 'stylus',
|
|
56
|
-
// 'basic',
|
|
57
|
-
// '1c',
|
|
58
|
-
// 'abnf',
|
|
59
|
-
// 'accesslog',
|
|
60
|
-
// 'actionscript',
|
|
61
|
-
// 'ada',
|
|
62
|
-
// 'angelscript',
|
|
63
|
-
// 'apache',
|
|
64
|
-
// 'applescript',
|
|
65
|
-
// 'arcade',
|
|
66
|
-
// 'cpp',
|
|
67
|
-
// 'arduino',
|
|
68
|
-
// 'armasm',
|
|
69
|
-
// 'asciidoc',
|
|
70
|
-
// 'aspectj',
|
|
71
|
-
// 'autohotkey',
|
|
72
|
-
// 'autoit',
|
|
73
|
-
// 'avrasm',
|
|
74
|
-
// 'awk',
|
|
75
|
-
// 'axapta',
|
|
76
|
-
// 'bnf',
|
|
77
|
-
// 'brainfuck',
|
|
78
|
-
// 'cal',
|
|
79
|
-
// 'capnproto',
|
|
80
|
-
// 'ceylon',
|
|
81
|
-
// 'clean',
|
|
82
|
-
// 'clojure-repl',
|
|
83
|
-
// 'clojure',
|
|
84
|
-
// 'cmake',
|
|
85
|
-
// 'coffeescript',
|
|
86
|
-
// 'coq',
|
|
87
|
-
// 'cos',
|
|
88
|
-
// 'crmsh',
|
|
89
|
-
// 'crystal',
|
|
90
|
-
// 'csp',
|
|
91
|
-
// 'd',
|
|
92
|
-
// 'delphi',
|
|
93
|
-
// 'diff',
|
|
94
|
-
// 'django',
|
|
95
|
-
// 'dns',
|
|
96
|
-
// 'dockerfile',
|
|
97
|
-
// 'dos',
|
|
98
|
-
// 'dsconfig',
|
|
99
|
-
// 'dts',
|
|
100
|
-
// 'dust',
|
|
101
|
-
// 'ebnf',
|
|
102
|
-
// 'elixir',
|
|
103
|
-
// 'elm',
|
|
104
|
-
// 'erb',
|
|
105
|
-
// 'erlang-repl',
|
|
106
|
-
// 'erlang',
|
|
107
|
-
// 'excel',
|
|
108
|
-
// 'fix',
|
|
109
|
-
// 'flix',
|
|
110
|
-
// 'fortran',
|
|
111
|
-
// 'fsharp',
|
|
112
|
-
// 'gams',
|
|
113
|
-
// 'gauss',
|
|
114
|
-
// 'gcode',
|
|
115
|
-
// 'gherkin',
|
|
116
|
-
// 'glsl',
|
|
117
|
-
// 'gml',
|
|
118
|
-
// 'golo',
|
|
119
|
-
// 'gradle',
|
|
120
|
-
// 'groovy',
|
|
121
|
-
// 'haml',
|
|
122
|
-
// 'handlebars',
|
|
123
|
-
// 'haskell',
|
|
124
|
-
// 'haxe',
|
|
125
|
-
// 'hsp',
|
|
126
|
-
// 'hy',
|
|
127
|
-
// 'inform7',
|
|
128
|
-
// 'ini',
|
|
129
|
-
// 'irpf90',
|
|
130
|
-
// 'isbl',
|
|
131
|
-
// 'jboss-cli',
|
|
132
|
-
// 'julia-repl',
|
|
133
|
-
// 'julia',
|
|
134
|
-
// 'kotlin',
|
|
135
|
-
// 'lasso',
|
|
136
|
-
// 'latex',
|
|
137
|
-
// 'ldif',
|
|
138
|
-
// 'leaf',
|
|
139
|
-
// 'lisp',
|
|
140
|
-
// 'livecodeserver',
|
|
141
|
-
// 'livescript',
|
|
142
|
-
// 'llvm',
|
|
143
|
-
// 'lsl',
|
|
144
|
-
// 'mathematica',
|
|
145
|
-
// 'matlab',
|
|
146
|
-
// 'maxima',
|
|
147
|
-
// 'mel',
|
|
148
|
-
// 'mercury',
|
|
149
|
-
// 'mipsasm',
|
|
150
|
-
// 'mizar',
|
|
151
|
-
// 'mojolicious',
|
|
152
|
-
// 'monkey',
|
|
153
|
-
// 'moonscript',
|
|
154
|
-
// 'n1ql',
|
|
155
|
-
// 'nim',
|
|
156
|
-
// 'nix',
|
|
157
|
-
// 'nsis',
|
|
158
|
-
// 'objectivec',
|
|
159
|
-
// 'ocaml',
|
|
160
|
-
// 'openscad',
|
|
161
|
-
// 'oxygene',
|
|
162
|
-
// 'parser3',
|
|
163
|
-
// 'perl',
|
|
164
|
-
// 'pf',
|
|
165
|
-
// 'pgsql',
|
|
166
|
-
// 'php-template',
|
|
167
|
-
// 'plaintext',
|
|
168
|
-
// 'pony',
|
|
169
|
-
// 'processing',
|
|
170
|
-
// 'profile',
|
|
171
|
-
// 'prolog',
|
|
172
|
-
// 'properties',
|
|
173
|
-
// 'protobuf',
|
|
174
|
-
// 'puppet',
|
|
175
|
-
// 'purebasic',
|
|
176
|
-
// 'q',
|
|
177
|
-
// 'qml',
|
|
178
|
-
// 'r',
|
|
179
|
-
// 'reasonml',
|
|
180
|
-
// 'rib',
|
|
181
|
-
// 'roboconf',
|
|
182
|
-
// 'routeros',
|
|
183
|
-
// 'rsl',
|
|
184
|
-
// 'ruleslanguage',
|
|
185
|
-
// 'rust',
|
|
186
|
-
// 'sas',
|
|
187
|
-
// 'scala',
|
|
188
|
-
// 'scheme',
|
|
189
|
-
// 'scilab',
|
|
190
|
-
// 'smali',
|
|
191
|
-
// 'smalltalk',
|
|
192
|
-
// 'sml',
|
|
193
|
-
// 'sqf',
|
|
194
|
-
// 'sql',
|
|
195
|
-
// 'stan',
|
|
196
|
-
// 'stata',
|
|
197
|
-
// 'step21',
|
|
198
|
-
// 'subunit',
|
|
199
|
-
// 'taggerscript',
|
|
200
|
-
// 'tap',
|
|
201
|
-
// 'tcl',
|
|
202
|
-
// 'thrift',
|
|
203
|
-
// 'tp',
|
|
204
|
-
// 'twig',
|
|
205
|
-
// 'vala',
|
|
206
|
-
// 'vbnet',
|
|
207
|
-
// 'vbscript-html',
|
|
208
|
-
// 'vbscript',
|
|
209
|
-
// 'verilog',
|
|
210
|
-
// 'vhdl',
|
|
211
|
-
// 'vim',
|
|
212
|
-
// 'x86asm',
|
|
213
|
-
// 'xl',
|
|
214
|
-
// 'xquery',
|
|
215
|
-
// 'zephir'
|
|
216
|
-
],
|
|
217
|
-
|
|
218
|
-
// wxml原生标签,该系列标签将不会被转换
|
|
219
|
-
wxml: [
|
|
220
|
-
'view',
|
|
221
|
-
'video',
|
|
222
|
-
'text',
|
|
223
|
-
'image',
|
|
224
|
-
'navigator',
|
|
225
|
-
'swiper',
|
|
226
|
-
'swiper-item',
|
|
227
|
-
'block',
|
|
228
|
-
'form',
|
|
229
|
-
'input',
|
|
230
|
-
'textarea',
|
|
231
|
-
'button',
|
|
232
|
-
'checkbox-group',
|
|
233
|
-
'checkbox',
|
|
234
|
-
'radio-group',
|
|
235
|
-
'radio',
|
|
236
|
-
|
|
237
|
-
// 可以解析的标签(html或markdown中会很少使用)
|
|
238
|
-
// 'canvas',
|
|
239
|
-
// 'map',
|
|
240
|
-
// 'slider',
|
|
241
|
-
// 'scroll-view',
|
|
242
|
-
// 'movable-area',
|
|
243
|
-
// 'movable-view',
|
|
244
|
-
// 'progress',
|
|
245
|
-
// 'label',
|
|
246
|
-
// 'switch',
|
|
247
|
-
// 'picker',
|
|
248
|
-
// 'picker-view',
|
|
249
|
-
// 'switch',
|
|
250
|
-
// 'contact-button'
|
|
251
|
-
],
|
|
252
|
-
|
|
253
|
-
// 自定义组件
|
|
254
|
-
components: [
|
|
255
|
-
'audio-player', // 音频组件,建议保留,由于小程序原生audio存在诸多问题,towxml解决了原生音频播放器的相关问题
|
|
256
|
-
// 'echarts', // echarts图表支持
|
|
257
|
-
'latex', // 数学公式支持
|
|
258
|
-
'table', // 表格支持
|
|
259
|
-
'todogroup', // todo支持
|
|
260
|
-
'yuml', // yuml图表支持
|
|
261
|
-
'img', // 图片解析组件
|
|
262
|
-
],
|
|
263
|
-
|
|
264
|
-
// 保留原本的元素属性(建议不要变动)
|
|
265
|
-
attrs: ['class', 'data', 'id', 'style'],
|
|
266
|
-
|
|
267
|
-
// 事件绑定方式(catch或bind),catch 会阻止事件向上冒泡。更多请参考:https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html
|
|
268
|
-
bindType: 'catch',
|
|
269
|
-
|
|
270
|
-
// 需要激活的事件
|
|
271
|
-
events: [
|
|
272
|
-
// 'touchstart',
|
|
273
|
-
// 'touchmove',
|
|
274
|
-
// 'touchcancel',
|
|
275
|
-
// 'touchend',
|
|
276
|
-
'tap', // 用于元素的点击事件
|
|
277
|
-
'change', // 用于todoList的change事件
|
|
278
|
-
],
|
|
279
|
-
|
|
280
|
-
// 图片倍数
|
|
281
|
-
dpr: 1,
|
|
282
|
-
|
|
283
|
-
// 代码块显示行号
|
|
284
|
-
showLineNumber: true,
|
|
285
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const config = require('./config');
|
|
2
|
-
|
|
3
|
-
Component({
|
|
4
|
-
options: {
|
|
5
|
-
styleIsolation: 'apply-shared',
|
|
6
|
-
},
|
|
7
|
-
properties: {
|
|
8
|
-
nodes: {
|
|
9
|
-
type: Object,
|
|
10
|
-
value: {},
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
lifetimes: {
|
|
14
|
-
attached() {
|
|
15
|
-
const _ts = this;
|
|
16
|
-
|
|
17
|
-
config.events.forEach((item) => {
|
|
18
|
-
_ts[`_${item}`] = function (...arg) {
|
|
19
|
-
if (global._events && typeof global._events[item] === 'function') {
|
|
20
|
-
global._events[item](...arg);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {
|
|
4
|
-
"decode": "./decode",
|
|
5
|
-
"audio-player": "./audio-player/audio-player",
|
|
6
|
-
"latex": "./latex/latex",
|
|
7
|
-
"table": "./table/table",
|
|
8
|
-
"todogroup": "./todogroup/todogroup",
|
|
9
|
-
"yuml": "./yuml/yuml",
|
|
10
|
-
"img": "./img/img"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<block wx:for="{{nodes.child}}" wx:for-index="i" wx:for-item="item" wx:key="i"><block wx:if="{{item.tag===undefined}}">{{item.text}}</block><view wx:if="{{item.tag==='view'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></view><video wx:if="{{item.tag==='video'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" poster="{{item.attr.poster}}" src="{{item.attr.src}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></video><text wx:if="{{item.tag==='text'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></text><image wx:if="{{item.tag==='image'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" src="{{item.attr.src}}" mode="{{item.attr.mode ? item.attr.mode : 'widthFix'}}" lazy-load="{{item.attr['lazy-load']}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></image><navigator wx:if="{{item.tag==='navigator'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" url="{{item.attr.href}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></navigator><swiper wx:if="{{item.tag==='swiper'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></swiper><swiper-item wx:if="{{item.tag==='swiper-item'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></swiper-item><block wx:if="{{item.tag==='block'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></block><form wx:if="{{item.tag==='form'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></form><input wx:if="{{item.tag==='input'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></input><textarea wx:if="{{item.tag==='textarea'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></textarea><button wx:if="{{item.tag==='button'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></button><checkbox-group wx:if="{{item.tag==='checkbox-group'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" catch:change="_change" bindchange="{{item.attr.bindchange}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></checkbox-group><checkbox wx:if="{{item.tag==='checkbox'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" checked="{{item.attr.checked}}" value="{{item.attr.value}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></checkbox><radio-group wx:if="{{item.tag==='radio-group'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap"><decode wx:if="{{item.child}}" nodes="{{item}}"/></radio-group><radio wx:if="{{item.tag==='radio'}}" data-data="{{item}}" class="{{item.attr.class}}" data="{{item.attr.data}}" id="{{item.attr.id}}" style="{{item.attr.style}}" catch:tap="_tap" checked="{{item.attr.checked}}"><decode wx:if="{{item.child}}" nodes="{{item}}"/></radio><block wx:if="{{item.tag==='audio-player'}}"><audio-player data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block><block wx:if="{{item.tag==='latex'}}"><latex data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block><block wx:if="{{item.tag==='table'}}"><table data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block><block wx:if="{{item.tag==='todogroup'}}"><todogroup data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block><block wx:if="{{item.tag==='yuml'}}"><yuml data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block><block wx:if="{{item.tag==='img'}}"><img data="{{item}}" data-data="{{item}}" catch:tap="_tap"/></block></block>
|
|
File without changes
|
|
@@ -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 +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
|
-
};
|