renusify 2.5.1 → 3.0.0
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/components/app/index.vue +74 -22
- package/components/app/toast/index.vue +76 -71
- package/components/app/toast/toast.vue +62 -44
- package/components/avatar/index.vue +208 -84
- package/components/button/buttonConfirm.vue +53 -26
- package/components/button/buttonGroup.js +0 -2
- package/components/button/buttonGroup.vue +310 -62
- package/components/button/index.vue +584 -100
- package/components/calendar/index.js +0 -2
- package/components/calendar/index.vue +326 -262
- package/components/calendar/month.vue +64 -55
- package/components/calendar/year.vue +30 -25
- package/components/card/index.vue +139 -59
- package/components/codeEditor/highlightCss.vue +38 -39
- package/components/codeEditor/highlightHtml.vue +64 -64
- package/components/codeEditor/highlightJs.vue +37 -38
- package/components/codeEditor/index.vue +129 -79
- package/components/codeEditor/run.vue +225 -39
- package/components/codeEditor/useCodeFormatter.js +150 -0
- package/components/confirm/index.vue +140 -81
- package/components/container/col.vue +5 -4
- package/components/container/divider.vue +28 -19
- package/components/container/index.vue +34 -15
- package/components/container/row.vue +26 -9
- package/components/container/spacer.vue +2 -4
- package/components/container/style.scss +3 -0
- package/components/content/index.vue +49 -32
- package/components/cropper/index.vue +401 -244
- package/components/float/index.vue +542 -415
- package/components/form/addressInput/index.vue +184 -109
- package/components/form/camInput/index.vue +370 -244
- package/components/form/checkInput/index.vue +138 -71
- package/components/form/checkboxInput/index.vue +87 -47
- package/components/form/colorInput/Alpha.vue +81 -83
- package/components/form/colorInput/Hue.vue +91 -68
- package/components/form/colorInput/Preview.vue +43 -47
- package/components/form/colorInput/Saturation.vue +101 -86
- package/components/form/colorInput/index.vue +72 -40
- package/components/form/colorInput/picker.vue +111 -106
- package/components/form/colorInput/useColor.js +153 -0
- package/components/form/dateInput/index.vue +691 -356
- package/components/form/dateInput/month.vue +63 -54
- package/components/form/dateInput/year.vue +35 -25
- package/components/form/fileInput/index.js +0 -1
- package/components/form/fileInput/index.vue +263 -106
- package/components/form/fileInput/single.vue +323 -164
- package/components/form/groupInput/index.vue +199 -101
- package/components/form/index.vue +189 -83
- package/components/form/input/index.vue +416 -377
- package/components/form/jsonInput/JsonView.vue +54 -56
- package/components/form/jsonInput/index.vue +247 -165
- package/components/form/maskInput/index.vue +252 -132
- package/components/form/numberInput/index.js +0 -1
- package/components/form/numberInput/index.vue +226 -117
- package/components/form/passwordInput/index.js +2 -1
- package/components/form/passwordInput/index.vue +269 -102
- package/components/form/radioInput/index.vue +143 -72
- package/components/form/rangeInput/index.vue +280 -167
- package/components/form/ratingInput/index.vue +57 -57
- package/components/form/selectInput/index.js +1 -3
- package/components/form/selectInput/index.vue +584 -296
- package/components/form/switchInput/index.vue +73 -59
- package/components/form/telInput/index.js +0 -1
- package/components/form/telInput/index.vue +238 -135
- package/components/form/textArea/index.vue +72 -35
- package/components/form/textEditor/index.vue +739 -0
- package/components/form/{text-editor → textEditor}/style.scss +8 -16
- package/components/form/textInput/index.vue +54 -32
- package/components/form/timeInput/index.vue +83 -56
- package/components/form/timeInput/range.vue +116 -95
- package/components/form/timeInput/timepicker.vue +382 -449
- package/components/form/uniqueInput/index.vue +105 -48
- package/components/form/unitInput/index.vue +139 -84
- package/components/formCreator/index.js +0 -1
- package/components/formCreator/index.vue +314 -148
- package/components/highlight/index.vue +41 -25
- package/components/highlight/style.scss +2 -2
- package/components/highlight/{mixin.js → useHighlight.js} +181 -160
- package/components/icon/index.vue +79 -33
- package/components/img/index.vue +249 -147
- package/components/img/preview.vue +180 -198
- package/components/img/svgImg.vue +42 -39
- package/components/index.js +5 -20
- package/components/infinite/index.js +1 -2
- package/components/infinite/index.vue +248 -66
- package/components/map/index.vue +428 -261
- package/components/map/route.vue +794 -487
- package/components/map/select.vue +118 -58
- package/components/menu/index.vue +201 -91
- package/components/meta/meta.js +26 -3
- package/components/modal/index.vue +383 -158
- package/components/notify/index.vue +204 -86
- package/components/notify/notification.vue +38 -55
- package/components/progress/circle.vue +189 -70
- package/components/progress/line.vue +266 -46
- package/components/searchBox/index.js +1 -3
- package/components/searchBox/index.vue +194 -101
- package/components/skeleton/index.vue +45 -20
- package/components/slider/index.vue +318 -156
- package/components/swiper/index.vue +254 -106
- package/components/table/crud/footer.vue +77 -53
- package/components/table/crud/header.vue +71 -72
- package/components/table/crud/index.vue +631 -401
- package/components/table/index.vue +721 -278
- package/components/timeAgo/index.vue +145 -96
- package/components/tour/index.vue +338 -235
- package/components/tree/index.vue +235 -89
- package/components/tree/tree-element.vue +107 -106
- package/directive/animate/index.js +77 -0
- package/directive/clickOutSide/index.js +98 -0
- package/directive/drag/index.js +153 -0
- package/directive/index.js +11 -13
- package/directive/intersect/index.js +263 -0
- package/directive/mask/index.js +67 -0
- package/directive/parallax/index.js +78 -0
- package/directive/ripple/index.js +14 -0
- package/directive/scroll/index.js +244 -0
- package/directive/sortable/index.js +274 -0
- package/directive/title/index.js +75 -0
- package/directive/touch/index.js +268 -0
- package/index.js +10 -8
- package/package.json +5 -2
- package/plugins/validation/Validate.js +88 -79
- package/scripts/generate-docs.mjs +226 -0
- package/scripts/menu.mjs +240 -0
- package/scripts/parser.mjs +1086 -0
- package/style/_index.scss +7 -0
- package/style/app.scss +13 -65
- package/style/colors.scss +5 -22
- package/style/functions/index.scss +8 -0
- package/style/mixins/index.scss +17 -5
- package/style/variables/base.scss +154 -175
- package/style/variables/color.scss +0 -12
- package/style/variables/utilities.scss +0 -180
- package/tools/helper.js +0 -8
- package/tools/icons.js +6 -1
- package/tools/root.js +71 -0
- package/components/app/style.scss +0 -41
- package/components/app/toast/style.scss +0 -20
- package/components/avatar/style.scss +0 -32
- package/components/bar/bottomNav.js +0 -1
- package/components/bar/bottomNav.vue +0 -28
- package/components/bar/bottomNavigationCircle.js +0 -2
- package/components/bar/bottomNavigationCircle.vue +0 -99
- package/components/bar/scss/bottomNav.scss +0 -67
- package/components/bar/scss/toolbar.scss +0 -174
- package/components/bar/toolbar/index.js +0 -8
- package/components/bar/toolbar/index.vue +0 -35
- package/components/bar/toolbar/laptop.vue +0 -33
- package/components/bar/toolbar/menuChilds.vue +0 -41
- package/components/bar/toolbar/menuLaptop.vue +0 -41
- package/components/bar/toolbar/menuMob.vue +0 -39
- package/components/bar/toolbar/mixin.js +0 -43
- package/components/bar/toolbar/mobile.vue +0 -34
- package/components/breadcrumb/bredcrumbItem.vue +0 -39
- package/components/breadcrumb/index.js +0 -3
- package/components/breadcrumb/index.vue +0 -71
- package/components/breadcrumb/style.scss +0 -51
- package/components/button/style.scss +0 -411
- package/components/card/style.scss +0 -86
- package/components/chart/chart.js +0 -1
- package/components/chart/chart.vue +0 -69
- package/components/chart/worldMap.js +0 -2
- package/components/chart/worldMap.vue +0 -1112
- package/components/chat/MessageList.vue +0 -163
- package/components/chat/chatInput.vue +0 -150
- package/components/chat/chatMsg.vue +0 -276
- package/components/chat/index.js +0 -11
- package/components/chat/index.vue +0 -113
- package/components/chip/index.js +0 -3
- package/components/chip/index.vue +0 -77
- package/components/chip/style.scss +0 -199
- package/components/codeEditor/mixin.js +0 -145
- package/components/countdown/index.js +0 -1
- package/components/countdown/index.vue +0 -105
- package/components/form/colorInput/mixin.js +0 -132
- package/components/form/fileInput/file.js +0 -148
- package/components/form/telInput/assets/flags.png +0 -0
- package/components/form/telInput/assets/flags@2x.png +0 -0
- package/components/form/text-editor/index.vue +0 -710
- package/components/icon/style.scss +0 -17
- package/components/infinite/div.js +0 -6
- package/components/infinite/div.vue +0 -193
- package/components/infinite/page.js +0 -3
- package/components/infinite/page.vue +0 -105
- package/components/list/index.js +0 -3
- package/components/list/index.vue +0 -122
- package/components/list/style.scss +0 -66
- package/components/message/index.js +0 -4
- package/components/message/index.vue +0 -40
- package/components/modal/style.scss +0 -146
- package/components/nestable/NestableItem.vue +0 -307
- package/components/nestable/editable.js +0 -44
- package/components/nestable/index.js +0 -1
- package/components/nestable/index.vue +0 -226
- package/components/nestable/methods.js +0 -416
- package/components/progress/style.scss +0 -229
- package/components/table/style.scss +0 -338
- package/components/tabs/index.js +0 -3
- package/components/tabs/index.vue +0 -151
- package/components/timeline/index.js +0 -6
- package/components/timeline/index.vue +0 -76
- package/directive/resize/index.js +0 -30
- package/directive/skeleton/index.js +0 -27
- package/directive/skeleton/style.scss +0 -37
- package/plugins/request/Request.js +0 -68
- package/style/animation.scss +0 -94
- package/style/style.scss +0 -8
- package/tools/rootable.js +0 -75
- /package/components/form/{text-editor → textEditor}/index.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.js +0 -0
- /package/components/form/{text-editor → textEditor}/preview.vue +0 -0
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
match: /"((?!")[^\r\n\\]|\\[^])*"?/g
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
languages: {}
|
|
1
|
+
import {ref} from 'vue'
|
|
2
|
+
|
|
3
|
+
export function useHighlight() {
|
|
4
|
+
const expandData = {
|
|
5
|
+
num: {
|
|
6
|
+
type: 'num',
|
|
7
|
+
match: /(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g
|
|
8
|
+
},
|
|
9
|
+
str: {
|
|
10
|
+
type: 'str',
|
|
11
|
+
match: /(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g
|
|
12
|
+
},
|
|
13
|
+
strDouble: {
|
|
14
|
+
type: 'str',
|
|
15
|
+
match: /"((?!")[^\r\n\\]|\\[^])*"?/g
|
|
20
16
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const languages = ref({})
|
|
20
|
+
|
|
21
|
+
const initLanguages = () => {
|
|
22
|
+
languages.value.asm = {
|
|
24
23
|
default: [
|
|
25
24
|
{
|
|
26
25
|
type: 'cmnt',
|
|
@@ -33,24 +32,20 @@ export default {
|
|
|
33
32
|
expand: 'num'
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
|
-
// value (ex: "$0x1")
|
|
37
35
|
type: 'num',
|
|
38
36
|
match: /\$[\da-fA-F]*\b/g
|
|
39
37
|
},
|
|
40
38
|
{
|
|
41
39
|
type: 'kwd',
|
|
42
|
-
// ex: "section .data"
|
|
43
40
|
match: /^[a-z]+\s+[a-z.]+\b/gm,
|
|
44
41
|
sub: [
|
|
45
42
|
{
|
|
46
|
-
// keyword (ex: "section")
|
|
47
43
|
type: 'func',
|
|
48
44
|
match: /^[a-z]+/g
|
|
49
45
|
}
|
|
50
46
|
]
|
|
51
47
|
},
|
|
52
48
|
{
|
|
53
|
-
// instruction (ex: "mov")
|
|
54
49
|
type: 'kwd',
|
|
55
50
|
match: /^\t*[a-z][a-z\d]*\b/gm
|
|
56
51
|
},
|
|
@@ -60,7 +55,7 @@ export default {
|
|
|
60
55
|
}
|
|
61
56
|
]
|
|
62
57
|
}
|
|
63
|
-
|
|
58
|
+
languages.value.bash = {
|
|
64
59
|
default: [
|
|
65
60
|
{
|
|
66
61
|
sub: 'todo',
|
|
@@ -75,7 +70,6 @@ export default {
|
|
|
75
70
|
}]
|
|
76
71
|
},
|
|
77
72
|
{
|
|
78
|
-
// relative or absolute path
|
|
79
73
|
type: 'oper',
|
|
80
74
|
match: /(?<=\s|^)\.*\/[a-z/_.-]+/gi
|
|
81
75
|
},
|
|
@@ -87,7 +81,6 @@ export default {
|
|
|
87
81
|
expand: 'num'
|
|
88
82
|
},
|
|
89
83
|
{
|
|
90
|
-
// command
|
|
91
84
|
type: 'func',
|
|
92
85
|
match: /(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gmi
|
|
93
86
|
},
|
|
@@ -109,7 +102,7 @@ export default {
|
|
|
109
102
|
}
|
|
110
103
|
]
|
|
111
104
|
}
|
|
112
|
-
|
|
105
|
+
languages.value.bf = {
|
|
113
106
|
default: [
|
|
114
107
|
{
|
|
115
108
|
match: /[^\[\->+.<\]\s].*/g,
|
|
@@ -129,7 +122,7 @@ export default {
|
|
|
129
122
|
}
|
|
130
123
|
]
|
|
131
124
|
}
|
|
132
|
-
|
|
125
|
+
languages.value.c = {
|
|
133
126
|
default: [
|
|
134
127
|
{
|
|
135
128
|
match: /\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -159,7 +152,6 @@ export default {
|
|
|
159
152
|
match: /^asm/g
|
|
160
153
|
},
|
|
161
154
|
{
|
|
162
|
-
//type: 'str',
|
|
163
155
|
match: /[^{}]*(?=}$)/g,
|
|
164
156
|
sub: 'asm'
|
|
165
157
|
}
|
|
@@ -183,7 +175,7 @@ export default {
|
|
|
183
175
|
}
|
|
184
176
|
]
|
|
185
177
|
}
|
|
186
|
-
|
|
178
|
+
languages.value.css = {
|
|
187
179
|
default: [
|
|
188
180
|
{
|
|
189
181
|
match: /\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -241,7 +233,7 @@ export default {
|
|
|
241
233
|
}
|
|
242
234
|
]
|
|
243
235
|
}
|
|
244
|
-
|
|
236
|
+
languages.value.csv = {
|
|
245
237
|
default: [
|
|
246
238
|
{
|
|
247
239
|
expand: 'strDouble'
|
|
@@ -252,7 +244,7 @@ export default {
|
|
|
252
244
|
}
|
|
253
245
|
]
|
|
254
246
|
}
|
|
255
|
-
|
|
247
|
+
languages.value.diff = {
|
|
256
248
|
default: [
|
|
257
249
|
{
|
|
258
250
|
type: 'deleted',
|
|
@@ -272,16 +264,16 @@ export default {
|
|
|
272
264
|
}
|
|
273
265
|
]
|
|
274
266
|
}
|
|
275
|
-
|
|
267
|
+
languages.value.docker = {
|
|
276
268
|
default: [
|
|
277
269
|
{
|
|
278
270
|
type: 'kwd',
|
|
279
271
|
match: /^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gmi
|
|
280
272
|
},
|
|
281
|
-
...
|
|
273
|
+
...languages.value.bash.default
|
|
282
274
|
]
|
|
283
275
|
}
|
|
284
|
-
|
|
276
|
+
languages.value.git = {
|
|
285
277
|
default: [
|
|
286
278
|
{
|
|
287
279
|
match: /^#.*/gm,
|
|
@@ -290,7 +282,7 @@ export default {
|
|
|
290
282
|
{
|
|
291
283
|
expand: 'str'
|
|
292
284
|
},
|
|
293
|
-
...
|
|
285
|
+
...languages.value.diff.default,
|
|
294
286
|
{
|
|
295
287
|
type: 'func',
|
|
296
288
|
match: /^(\$ )?git(\s.*)?$/gm
|
|
@@ -301,7 +293,7 @@ export default {
|
|
|
301
293
|
}
|
|
302
294
|
]
|
|
303
295
|
}
|
|
304
|
-
|
|
296
|
+
languages.value.go = {
|
|
305
297
|
default: [
|
|
306
298
|
{
|
|
307
299
|
match: /\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -331,42 +323,44 @@ export default {
|
|
|
331
323
|
}
|
|
332
324
|
]
|
|
333
325
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
326
|
+
|
|
327
|
+
const name = `[:A-Z_a-z@#\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}][:A-Z_a-z@#\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\\-\\.0-9\u{B7}\u{0300}-\u{036F}\u{203F}-\u{2040}]*`
|
|
328
|
+
const properties = `\\s*(\\s+${name}\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`
|
|
329
|
+
const xmlElement = {
|
|
330
|
+
match: RegExp(`<[\/!?]?${name}${properties}[\/!?]?>`, 'g'),
|
|
331
|
+
sub: [
|
|
332
|
+
{
|
|
333
|
+
type: 'var',
|
|
334
|
+
match: RegExp(`^<[\/!?]?${name}`, 'g'),
|
|
335
|
+
sub: [
|
|
336
|
+
{
|
|
337
|
+
type: 'oper',
|
|
338
|
+
match: /^<[\/!?]?/g
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'str',
|
|
344
|
+
match: /=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,
|
|
345
|
+
sub: [
|
|
346
|
+
{
|
|
347
|
+
type: 'oper',
|
|
348
|
+
match: /^=/g
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
type: 'oper',
|
|
354
|
+
match: /[\/!?]?>/g
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
type: 'class',
|
|
358
|
+
match: RegExp(name, 'g')
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
languages.value.xml = {
|
|
370
364
|
default: [
|
|
371
365
|
{
|
|
372
366
|
match: /<!--((?!-->)[^])*-->/g,
|
|
@@ -403,7 +397,7 @@ export default {
|
|
|
403
397
|
}
|
|
404
398
|
]
|
|
405
399
|
}
|
|
406
|
-
|
|
400
|
+
languages.value.html = {
|
|
407
401
|
default: [
|
|
408
402
|
{
|
|
409
403
|
type: 'class',
|
|
@@ -451,10 +445,10 @@ export default {
|
|
|
451
445
|
xmlElement
|
|
452
446
|
]
|
|
453
447
|
},
|
|
454
|
-
...
|
|
448
|
+
...languages.value.xml.default
|
|
455
449
|
]
|
|
456
450
|
}
|
|
457
|
-
|
|
451
|
+
languages.value.ini = {
|
|
458
452
|
default: [
|
|
459
453
|
{
|
|
460
454
|
match: /(^[ \f\t\v]*)[#;].*/gm,
|
|
@@ -478,7 +472,7 @@ export default {
|
|
|
478
472
|
}
|
|
479
473
|
]
|
|
480
474
|
}
|
|
481
|
-
|
|
475
|
+
languages.value.todo = {
|
|
482
476
|
type: 'cmnt', default: [
|
|
483
477
|
{
|
|
484
478
|
type: 'err',
|
|
@@ -498,7 +492,7 @@ export default {
|
|
|
498
492
|
}
|
|
499
493
|
]
|
|
500
494
|
}
|
|
501
|
-
|
|
495
|
+
languages.value.java = {
|
|
502
496
|
default: [
|
|
503
497
|
{
|
|
504
498
|
match: /\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -528,7 +522,8 @@ export default {
|
|
|
528
522
|
}
|
|
529
523
|
]
|
|
530
524
|
}
|
|
531
|
-
|
|
525
|
+
|
|
526
|
+
languages.value.js_template_literals = {
|
|
532
527
|
type: 'str', default: [
|
|
533
528
|
{
|
|
534
529
|
match: new class {
|
|
@@ -563,7 +558,8 @@ export default {
|
|
|
563
558
|
}
|
|
564
559
|
]
|
|
565
560
|
}
|
|
566
|
-
|
|
561
|
+
|
|
562
|
+
languages.value.js = {
|
|
567
563
|
default: [
|
|
568
564
|
{
|
|
569
565
|
match: /\/\*\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -613,7 +609,8 @@ export default {
|
|
|
613
609
|
}
|
|
614
610
|
]
|
|
615
611
|
}
|
|
616
|
-
|
|
612
|
+
|
|
613
|
+
languages.value.jsdoc = {
|
|
617
614
|
type: 'cmnt', default: [
|
|
618
615
|
{
|
|
619
616
|
type: 'kwd',
|
|
@@ -627,10 +624,11 @@ export default {
|
|
|
627
624
|
type: 'var',
|
|
628
625
|
match: /\[[\w\s="']+\]/g
|
|
629
626
|
},
|
|
630
|
-
...
|
|
627
|
+
...languages.value.todo.default
|
|
631
628
|
]
|
|
632
629
|
}
|
|
633
|
-
|
|
630
|
+
|
|
631
|
+
languages.value.json = {
|
|
634
632
|
default: [
|
|
635
633
|
{
|
|
636
634
|
type: 'var',
|
|
@@ -652,7 +650,8 @@ export default {
|
|
|
652
650
|
}
|
|
653
651
|
]
|
|
654
652
|
}
|
|
655
|
-
|
|
653
|
+
|
|
654
|
+
languages.value.log = {
|
|
656
655
|
default: [
|
|
657
656
|
{
|
|
658
657
|
type: 'cmnt',
|
|
@@ -682,7 +681,8 @@ export default {
|
|
|
682
681
|
}
|
|
683
682
|
]
|
|
684
683
|
}
|
|
685
|
-
|
|
684
|
+
|
|
685
|
+
languages.value.lua = {
|
|
686
686
|
default: [
|
|
687
687
|
{
|
|
688
688
|
match: /^#!.*|--(\[(=*)\[((?!--\]\2\])[^])*--\]\2\]|.*)/g,
|
|
@@ -712,7 +712,8 @@ export default {
|
|
|
712
712
|
}
|
|
713
713
|
]
|
|
714
714
|
}
|
|
715
|
-
|
|
715
|
+
|
|
716
|
+
languages.value.make = {
|
|
716
717
|
default: [
|
|
717
718
|
{
|
|
718
719
|
match: /^\s*#.*/gm,
|
|
@@ -750,7 +751,8 @@ export default {
|
|
|
750
751
|
}
|
|
751
752
|
]
|
|
752
753
|
}
|
|
753
|
-
|
|
754
|
+
|
|
755
|
+
languages.value.pl = {
|
|
754
756
|
default: [
|
|
755
757
|
{
|
|
756
758
|
match: /#.*/g,
|
|
@@ -777,14 +779,16 @@ export default {
|
|
|
777
779
|
}
|
|
778
780
|
]
|
|
779
781
|
}
|
|
780
|
-
|
|
782
|
+
|
|
783
|
+
languages.value.plain = {
|
|
781
784
|
default: [
|
|
782
785
|
{
|
|
783
786
|
expand: 'strDouble'
|
|
784
787
|
}
|
|
785
788
|
]
|
|
786
789
|
}
|
|
787
|
-
|
|
790
|
+
|
|
791
|
+
languages.value.py = {
|
|
788
792
|
default: [
|
|
789
793
|
{
|
|
790
794
|
match: /#.*/g,
|
|
@@ -838,7 +842,8 @@ export default {
|
|
|
838
842
|
}
|
|
839
843
|
]
|
|
840
844
|
}
|
|
841
|
-
|
|
845
|
+
|
|
846
|
+
languages.value.regex = {
|
|
842
847
|
type: 'oper', default: [
|
|
843
848
|
{
|
|
844
849
|
match: /^(?!\/).*/gm,
|
|
@@ -858,7 +863,8 @@ export default {
|
|
|
858
863
|
}
|
|
859
864
|
]
|
|
860
865
|
}
|
|
861
|
-
|
|
866
|
+
|
|
867
|
+
languages.value.rs = {
|
|
862
868
|
default: [
|
|
863
869
|
{
|
|
864
870
|
match: /\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -888,7 +894,8 @@ export default {
|
|
|
888
894
|
}
|
|
889
895
|
]
|
|
890
896
|
}
|
|
891
|
-
|
|
897
|
+
|
|
898
|
+
languages.value.sql = {
|
|
892
899
|
default: [
|
|
893
900
|
{
|
|
894
901
|
match: /--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,
|
|
@@ -923,7 +930,8 @@ export default {
|
|
|
923
930
|
}
|
|
924
931
|
]
|
|
925
932
|
}
|
|
926
|
-
|
|
933
|
+
|
|
934
|
+
languages.value.toml = {
|
|
927
935
|
default: [
|
|
928
936
|
{
|
|
929
937
|
match: /#.*/g,
|
|
@@ -961,7 +969,8 @@ export default {
|
|
|
961
969
|
}
|
|
962
970
|
]
|
|
963
971
|
}
|
|
964
|
-
|
|
972
|
+
|
|
973
|
+
languages.value.ts = {
|
|
965
974
|
default: [
|
|
966
975
|
{
|
|
967
976
|
type: 'type',
|
|
@@ -971,10 +980,11 @@ export default {
|
|
|
971
980
|
type: 'kwd',
|
|
972
981
|
match: /\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g
|
|
973
982
|
},
|
|
974
|
-
...
|
|
983
|
+
...languages.value.js.default
|
|
975
984
|
]
|
|
976
985
|
}
|
|
977
|
-
|
|
986
|
+
|
|
987
|
+
languages.value.uri = {
|
|
978
988
|
default: [
|
|
979
989
|
{
|
|
980
990
|
match: /^#.*/gm,
|
|
@@ -1002,7 +1012,8 @@ export default {
|
|
|
1002
1012
|
}
|
|
1003
1013
|
]
|
|
1004
1014
|
}
|
|
1005
|
-
|
|
1015
|
+
|
|
1016
|
+
languages.value.yaml = {
|
|
1006
1017
|
default: [
|
|
1007
1018
|
{
|
|
1008
1019
|
match: /#.*/g,
|
|
@@ -1036,7 +1047,8 @@ export default {
|
|
|
1036
1047
|
}
|
|
1037
1048
|
]
|
|
1038
1049
|
}
|
|
1039
|
-
|
|
1050
|
+
|
|
1051
|
+
languages.value.http = {
|
|
1040
1052
|
default: [
|
|
1041
1053
|
{
|
|
1042
1054
|
type: 'kwd',
|
|
@@ -1062,71 +1074,80 @@ export default {
|
|
|
1062
1074
|
}
|
|
1063
1075
|
]
|
|
1064
1076
|
}
|
|
1065
|
-
}
|
|
1066
|
-
methods: {
|
|
1067
|
-
async highlight(code, lang, hideLineNumbers) {
|
|
1068
|
-
let tmp = ''
|
|
1069
|
-
await this.tokenize(code, lang, (str, type) => tmp += this.toSpan(this.sanitize(str), type))
|
|
1077
|
+
}
|
|
1070
1078
|
|
|
1071
|
-
|
|
1079
|
+
const highlight = async (code, lang, hideLineNumbers) => {
|
|
1080
|
+
let tmp = ''
|
|
1081
|
+
await tokenize(code, lang, (str, type) => tmp += toSpan(sanitize(str), type))
|
|
1072
1082
|
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
try {
|
|
1076
|
-
let m,
|
|
1077
|
-
part,
|
|
1078
|
-
first = {},
|
|
1079
|
-
match,
|
|
1080
|
-
cache = [],
|
|
1081
|
-
i = 0,
|
|
1082
|
-
data = typeof lang === 'string' ? this.languages[lang] : lang,
|
|
1083
|
-
arr = [...typeof lang === 'string' ? data.default : lang.sub]
|
|
1083
|
+
return `<div><div class="highlight-numbers">${'<div></div>'.repeat(!hideLineNumbers && code.split('\n').length)}</div><div>${tmp}</div></div>`
|
|
1084
|
+
}
|
|
1084
1085
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1086
|
+
const tokenize = async (src, lang, token) => {
|
|
1087
|
+
try {
|
|
1088
|
+
let m,
|
|
1089
|
+
part,
|
|
1090
|
+
first = {},
|
|
1091
|
+
match,
|
|
1092
|
+
cache = [],
|
|
1093
|
+
i = 0,
|
|
1094
|
+
data = typeof lang === 'string' ? languages.value[lang] : lang,
|
|
1095
|
+
arr = [...typeof lang === 'string' ? data.default : lang.sub]
|
|
1096
|
+
|
|
1097
|
+
while (i < src.length) {
|
|
1098
|
+
first.index = null
|
|
1099
|
+
for (m = arr.length; m-- > 0;) {
|
|
1100
|
+
part = arr[m].expand ? expandData[arr[m].expand] : arr[m]
|
|
1101
|
+
if (cache[m] === undefined || cache[m].match.index < i) {
|
|
1102
|
+
part.match.lastIndex = i
|
|
1103
|
+
match = part.match.exec(src)
|
|
1104
|
+
if (match === null) {
|
|
1105
|
+
arr.splice(m, 1)
|
|
1106
|
+
cache.splice(m, 1)
|
|
1107
|
+
continue
|
|
1101
1108
|
}
|
|
1102
|
-
|
|
1103
|
-
if (cache[m].match[0] && (cache[m].match.index <= first.index || first.index === null))
|
|
1104
|
-
first = {
|
|
1105
|
-
part: part,
|
|
1106
|
-
index: cache[m].match.index,
|
|
1107
|
-
match: cache[m].match[0],
|
|
1108
|
-
end: cache[m].lastIndex
|
|
1109
|
-
}
|
|
1109
|
+
cache[m] = {match, lastIndex: part.match.lastIndex}
|
|
1110
1110
|
}
|
|
1111
|
-
if (first.index === null)
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
token(first.match, first.part.type)
|
|
1111
|
+
if (cache[m].match[0] && (cache[m].match.index <= first.index || first.index === null))
|
|
1112
|
+
first = {
|
|
1113
|
+
part: part,
|
|
1114
|
+
index: cache[m].match.index,
|
|
1115
|
+
match: cache[m].match[0],
|
|
1116
|
+
end: cache[m].lastIndex
|
|
1117
|
+
}
|
|
1119
1118
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
token(src)
|
|
1119
|
+
if (first.index === null)
|
|
1120
|
+
break
|
|
1121
|
+
token(src.slice(i, first.index), data.type)
|
|
1122
|
+
i = first.end
|
|
1123
|
+
if (first.part.sub)
|
|
1124
|
+
await tokenize(first.match, typeof first.part.sub === 'string' ? first.part.sub : (typeof first.part.sub === 'function' ? first.part.sub(first.match) : first.part), token)
|
|
1125
|
+
else
|
|
1126
|
+
token(first.match, first.part.type)
|
|
1123
1127
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1128
|
-
sanitize(str = '') {
|
|
1129
|
-
return str.replaceAll('&', '&').replaceAll?.('<', '<').replaceAll?.('>', '>')
|
|
1128
|
+
token(src.slice(i, src.length), data.type)
|
|
1129
|
+
} catch {
|
|
1130
|
+
token(src)
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
1132
|
-
|
|
1133
|
+
|
|
1134
|
+
const toSpan = (str, token) => {
|
|
1135
|
+
return token ? `<span class="highlight-syn-${token}">${str}</span>` : str
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
const sanitize = (str = '') => {
|
|
1139
|
+
return str.replaceAll('&', '&').replaceAll?.('<', '<').replaceAll?.('>', '>')
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
initLanguages()
|
|
1143
|
+
|
|
1144
|
+
return {
|
|
1145
|
+
expandData,
|
|
1146
|
+
languages,
|
|
1147
|
+
highlight,
|
|
1148
|
+
tokenize,
|
|
1149
|
+
toSpan,
|
|
1150
|
+
sanitize,
|
|
1151
|
+
initLanguages
|
|
1152
|
+
}
|
|
1153
|
+
}
|