renusify 1.2.2 → 1.2.4
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/notify/notification.vue +13 -11
- package/components/button/style.scss +2 -3
- package/components/chat/MessageList.vue +6 -6
- package/components/chat/chatMsg.vue +2 -2
- package/components/chip/style.scss +1 -1
- package/components/codeEditor/highlightCss.vue +116 -0
- package/components/codeEditor/highlightHtml.vue +167 -66
- package/components/codeEditor/highlightJs.vue +242 -0
- package/components/codeEditor/index.vue +259 -453
- package/components/codeEditor/run.vue +46 -29
- package/components/cropper/index.vue +4 -3
- package/components/float/index.vue +14 -14
- package/components/form/checkbox.vue +1 -1
- package/components/form/colorPicker/picker.vue +1 -1
- package/components/form/input.vue +4 -4
- package/components/form/number.vue +1 -1
- package/components/form/radioInput.vue +1 -1
- package/components/html2pdf/index.vue +13 -13
- package/components/index.js +1 -1
- package/components/list/style.scss +5 -5
- package/components/menu/index.vue +1 -1
- package/components/skeleton/index.vue +1 -1
- package/directive/title/style.scss +1 -1
- package/package.json +1 -1
- package/style/app.scss +3 -3
- package/style/variables/base.scss +28 -8
- package/components/codeEditor/highlightScript.vue +0 -134
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component :is="page"></component>
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
import {defineAsyncComponent} from "vue/dist/vue.esm-bundler.js";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
name: "r-code-editor-run",
|
|
9
|
-
props: {
|
|
10
|
-
template: String,
|
|
11
|
-
script: String
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="page"></component>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import {defineAsyncComponent} from "vue/dist/vue.esm-bundler.js";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: "r-code-editor-run",
|
|
9
|
+
props: {
|
|
10
|
+
template: String,
|
|
11
|
+
script: String,
|
|
12
|
+
style: String,
|
|
13
|
+
id: String,
|
|
14
|
+
},
|
|
15
|
+
computed: {
|
|
16
|
+
page() {
|
|
17
|
+
if (this.style) {
|
|
18
|
+
let children = document.querySelectorAll(`[f='${this.id}']`);
|
|
19
|
+
if (children) {
|
|
20
|
+
let childArray = Array.prototype.slice.call(children);
|
|
21
|
+
|
|
22
|
+
childArray.forEach(function (child) {
|
|
23
|
+
child.parentNode.removeChild(child);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
let s = document.createElement("style");
|
|
27
|
+
s.innerText = this.style;
|
|
28
|
+
s.setAttribute("f", this.id);
|
|
29
|
+
s.setAttribute("type", "text/css");
|
|
30
|
+
window.document.head.append(s);
|
|
31
|
+
}
|
|
32
|
+
let temp = this.template || "";
|
|
33
|
+
let scr = this.script || 'name:"test"';
|
|
34
|
+
return defineAsyncComponent(
|
|
35
|
+
() =>
|
|
36
|
+
new Promise((resolve) => {
|
|
37
|
+
resolve({
|
|
38
|
+
template: temp,
|
|
39
|
+
...eval("Object({" + scr + "})"),
|
|
40
|
+
});
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
}
|
|
85
85
|
if (typeof this.imgSrc === "string") {
|
|
86
86
|
this.crop(this.imgSrc);
|
|
87
|
-
} else {
|
|
87
|
+
} else if (this.imgSrc) {
|
|
88
88
|
const that = this;
|
|
89
89
|
const reader = new FileReader();
|
|
90
90
|
reader.onload = function (e) {
|
|
@@ -132,6 +132,8 @@ export default {
|
|
|
132
132
|
this.cropped = this.getDataURL();
|
|
133
133
|
if (this.getBlob) {
|
|
134
134
|
this.$emit("cropped", this.get_blob());
|
|
135
|
+
} else {
|
|
136
|
+
this.$emit("cropped", this.cropped);
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
this.show = false;
|
|
@@ -222,8 +224,7 @@ export default {
|
|
|
222
224
|
return canvas.toDataURL("image/png");
|
|
223
225
|
},
|
|
224
226
|
get_blob() {
|
|
225
|
-
let
|
|
226
|
-
let b64 = imageData.replace("data:image/png;base64,", "");
|
|
227
|
+
let b64 = this.cropped.replace("data:image/png;base64,", "");
|
|
227
228
|
let binary = atob(b64);
|
|
228
229
|
let array = [];
|
|
229
230
|
for (let i = 0; i < binary.length; i++) {
|
|
@@ -441,23 +441,23 @@
|
|
|
441
441
|
@import "../../style/_include.scss";
|
|
442
442
|
|
|
443
443
|
.#{$prefix}float {
|
|
444
|
+
width: 100%;
|
|
445
|
+
max-width: 100%;
|
|
446
|
+
max-height: 100vh;
|
|
447
|
+
height: 100%;
|
|
448
|
+
overflow: hidden;
|
|
449
|
+
outline: none;
|
|
450
|
+
border-radius: map-get($borders, 'sm');
|
|
451
|
+
|
|
452
|
+
&.float-bordered {
|
|
453
|
+
border: 1px solid #3a3e3a;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.float-container {
|
|
444
457
|
width: 100%;
|
|
445
|
-
max-width: 100%;
|
|
446
|
-
max-height: 100vh;
|
|
447
458
|
height: 100%;
|
|
448
|
-
overflow: hidden;
|
|
449
|
-
outline: none;
|
|
450
|
-
border-radius: 4px;
|
|
451
459
|
|
|
452
|
-
&.
|
|
453
|
-
border: 1px solid #3a3e3a;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.float-container {
|
|
457
|
-
width: 100%;
|
|
458
|
-
height: 100%;
|
|
459
|
-
|
|
460
|
-
&.in-zoom {
|
|
460
|
+
&.in-zoom {
|
|
461
461
|
transition: all 0.5s ease-in-out;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
@@ -299,7 +299,7 @@ export default {
|
|
|
299
299
|
margin-top: 20px;
|
|
300
300
|
|
|
301
301
|
&.input-ltr {
|
|
302
|
-
input {
|
|
302
|
+
input, textarea {
|
|
303
303
|
direction: ltr;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
@@ -394,12 +394,12 @@ export default {
|
|
|
394
394
|
|
|
395
395
|
&:not(.input-tile) {
|
|
396
396
|
padding: 0 16px;
|
|
397
|
-
border-radius:
|
|
397
|
+
border-radius: map-get($borders, 'xl');
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
&.input-tile {
|
|
401
401
|
padding: 0 8px;
|
|
402
|
-
border-radius:
|
|
402
|
+
border-radius: map-get($borders, 'sm');
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -526,7 +526,7 @@ export default {
|
|
|
526
526
|
height: auto;
|
|
527
527
|
|
|
528
528
|
&:not(.input-tile) {
|
|
529
|
-
border-radius:
|
|
529
|
+
border-radius: map-get($borders, 'xl');
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
|
|
@@ -261,20 +261,20 @@ winPrint.close();
|
|
|
261
261
|
|
|
262
262
|
.#{$prefix}html2pdf {
|
|
263
263
|
.preview {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
264
|
+
position: fixed;
|
|
265
|
+
width: 65%;
|
|
266
|
+
min-width: 600px;
|
|
267
|
+
height: 80vh;
|
|
268
|
+
top: 100px;
|
|
269
|
+
z-index: 9999999;
|
|
270
|
+
left: 50%;
|
|
271
|
+
transform: translateX(-50%);
|
|
272
|
+
border-radius: map-get($borders, 'sm');
|
|
273
|
+
box-shadow: 0px 0px 10px #00000048;
|
|
274
274
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
iframe {
|
|
276
|
+
border: 0;
|
|
277
|
+
}
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
</style>
|
package/components/index.js
CHANGED
|
@@ -142,7 +142,7 @@ const list = {
|
|
|
142
142
|
'r-progress-line': {'p': 'progress/line.vue', 'c': [], 'd': []},
|
|
143
143
|
'r-search-box': {
|
|
144
144
|
'p': 'searchBox/index.vue',
|
|
145
|
-
'c': ['r-progress-line', 'r-card', 'r-list', 'r-btn', 'r-icon', 'r-select'],
|
|
145
|
+
'c': ['r-progress-line', 'r-card', 'r-list', 'r-btn', 'r-icon', 'r-select-input'],
|
|
146
146
|
'd': ['click-outside']
|
|
147
147
|
},
|
|
148
148
|
'r-skeleton': {'p': 'skeleton/index.vue', 'c': [], 'd': []},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
$item-height: 48px;
|
|
4
4
|
|
|
5
5
|
.#{$prefix}list {
|
|
6
|
-
border-radius:
|
|
6
|
+
border-radius: map-get($borders, 'sm');
|
|
7
7
|
display: block;
|
|
8
8
|
padding: 8px 0;
|
|
9
9
|
will-change: box-shadow;
|
|
@@ -11,9 +11,9 @@ $item-height: 48px;
|
|
|
11
11
|
position: relative;
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
.list-item {
|
|
15
|
+
&.list-item-active {
|
|
16
|
+
background-color: var(--color-table-active)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
&:hover {
|
|
@@ -65,7 +65,7 @@ $item-height: 48px;
|
|
|
65
65
|
|
|
66
66
|
&.list-rounded {
|
|
67
67
|
.list-item {
|
|
68
|
-
border-radius:
|
|
68
|
+
border-radius: map-get($borders, 'xl');
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
package/package.json
CHANGED
package/style/app.scss
CHANGED
|
@@ -29,12 +29,12 @@ body {
|
|
|
29
29
|
|
|
30
30
|
::-webkit-scrollbar-track:hover {
|
|
31
31
|
border: 1px solid rgba(100, 100, 100, 0.4);
|
|
32
|
-
border-radius:
|
|
32
|
+
border-radius: map-get($borders, 'sm');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
::-webkit-scrollbar-thumb {
|
|
36
36
|
background: rgba(100, 100, 100, 0.4);
|
|
37
|
-
border-radius:
|
|
37
|
+
border-radius: map-get($borders, 'sm');
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
::-webkit-scrollbar-thumb:hover {
|
|
@@ -265,7 +265,7 @@ $color-text: var(--color-two-text);
|
|
|
265
265
|
font-size: 17px;
|
|
266
266
|
line-height: 22px;
|
|
267
267
|
border: 2px solid grey;
|
|
268
|
-
border-radius:
|
|
268
|
+
border-radius: map-get($borders, 'sm');
|
|
269
269
|
background-color: #283739;
|
|
270
270
|
color: white;
|
|
271
271
|
padding: 0em 1em;
|
|
@@ -17,11 +17,11 @@ $negative-spacers: ();
|
|
|
17
17
|
|
|
18
18
|
$borders: (
|
|
19
19
|
'none': 0,
|
|
20
|
-
'xs':
|
|
21
|
-
'sm':
|
|
22
|
-
'md':
|
|
23
|
-
'lg':
|
|
24
|
-
'xl':
|
|
20
|
+
'xs': .125rem,
|
|
21
|
+
'sm': .25rem,
|
|
22
|
+
'md': .5rem,
|
|
23
|
+
'lg': 1rem,
|
|
24
|
+
'xl': 1.5rem,
|
|
25
25
|
'pill': 9999px,
|
|
26
26
|
'circle': 50%
|
|
27
27
|
) !default;
|
|
@@ -30,27 +30,47 @@ $cursor:('pointer','auto','grab','grabbing')!default;
|
|
|
30
30
|
|
|
31
31
|
$widths: (
|
|
32
32
|
'full': 100%,
|
|
33
|
+
'95': 95%,
|
|
33
34
|
'90': 90%,
|
|
35
|
+
'85': 85%,
|
|
34
36
|
'80': 80%,
|
|
37
|
+
'75': 75%,
|
|
35
38
|
'70': 70%,
|
|
39
|
+
'65': 65%,
|
|
36
40
|
'60': 60%,
|
|
41
|
+
'55': 55%,
|
|
37
42
|
'50': 50%,
|
|
43
|
+
'45': 45%,
|
|
38
44
|
'40': 40%,
|
|
45
|
+
'35': 35%,
|
|
39
46
|
'30': 30%,
|
|
47
|
+
'25': 25%,
|
|
40
48
|
'20': 20%,
|
|
41
|
-
'
|
|
49
|
+
'15': 15%,
|
|
50
|
+
'10': 10%,
|
|
51
|
+
'5': 5%
|
|
42
52
|
) !default;
|
|
43
53
|
$heights: (
|
|
44
54
|
'full': 100%,
|
|
55
|
+
'95': 95%,
|
|
45
56
|
'90': 90%,
|
|
57
|
+
'85': 85%,
|
|
46
58
|
'80': 80%,
|
|
59
|
+
'75': 75%,
|
|
47
60
|
'70': 70%,
|
|
61
|
+
'65': 65%,
|
|
48
62
|
'60': 60%,
|
|
63
|
+
'55': 55%,
|
|
49
64
|
'50': 50%,
|
|
65
|
+
'45': 45%,
|
|
50
66
|
'40': 40%,
|
|
67
|
+
'35': 35%,
|
|
51
68
|
'30': 30%,
|
|
69
|
+
'25': 25%,
|
|
52
70
|
'20': 20%,
|
|
53
|
-
'
|
|
71
|
+
'15': 15%,
|
|
72
|
+
'10': 10%,
|
|
73
|
+
'5': 5%
|
|
54
74
|
) !default;
|
|
55
75
|
|
|
56
76
|
$grid-breakpoints: (
|
|
@@ -239,7 +259,7 @@ $toolbar-content-padding-x: 16px !default;
|
|
|
239
259
|
$toolbar-height: 80px !default;
|
|
240
260
|
|
|
241
261
|
//modal
|
|
242
|
-
$border-modal:
|
|
262
|
+
$border-modal: map-get($borders, 'md') !default;
|
|
243
263
|
|
|
244
264
|
//bottom navigation
|
|
245
265
|
$bottom-nav-btn-min-width: 56px !default;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="`${$r.prefix}highlight-script`" v-html="build"></div>
|
|
3
|
-
</template>
|
|
4
|
-
<script>
|
|
5
|
-
export default {
|
|
6
|
-
name: 'highlightScript',
|
|
7
|
-
props: {
|
|
8
|
-
code: String,
|
|
9
|
-
runnable:Boolean
|
|
10
|
-
},
|
|
11
|
-
data() {
|
|
12
|
-
return {}
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
build() {
|
|
16
|
-
let data = this.code.split('')
|
|
17
|
-
let str = this.code.trim()
|
|
18
|
-
if (str.substr(0, 1) === '{') {
|
|
19
|
-
str = str.substr(1, str.length - 2)
|
|
20
|
-
}
|
|
21
|
-
let res = this.runnable?'<span class="color-orange"><script>\n export default{</span>':''
|
|
22
|
-
let in_quta = false
|
|
23
|
-
|
|
24
|
-
data.forEach((c, i) => {
|
|
25
|
-
if (['=', '$', '&', '{', '}', '(', ')', '<', '>'].includes(c)) {
|
|
26
|
-
res += '<span class="color-blue">' + c + '</span>'
|
|
27
|
-
} else if ([',', ';', ':'].includes(c)) {
|
|
28
|
-
res += '<span class="color-orange">' + c + '</span>'
|
|
29
|
-
} else if (parseInt(c) > -1) {
|
|
30
|
-
res += '<span class="color-number">' + c + '</span>'
|
|
31
|
-
} else if ((c === '"' || c === "'") && !in_quta) {
|
|
32
|
-
in_quta = c
|
|
33
|
-
res += '<span class="color-green">' + c
|
|
34
|
-
} else if (c === in_quta) {
|
|
35
|
-
in_quta = false
|
|
36
|
-
res += c + '</span>'
|
|
37
|
-
} else {
|
|
38
|
-
res += c
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
res += this.runnable?'\n<span class="color-orange">}\n</script></span>':''
|
|
42
|
-
res = this.$helper.replacer(res, ' var ', ' <span class="color-orange">var</span> ')
|
|
43
|
-
res = this.$helper.replacer(res, '<span class="color-blue">$</span>r.', '<span class="color-blue">$r.</span>')
|
|
44
|
-
res = this.$helper.replacer(res, ' let ', ' <span class="color-orange">let</span> ')
|
|
45
|
-
res = this.$helper.replacer(res, ' const ', ' <span class="color-orange">const</span> ')
|
|
46
|
-
res = this.$helper.replacer(res, ' return ', ' <span class="color-orange">return</span> ')
|
|
47
|
-
res = this.$helper.replacer(res, ' this.', ' <span class="color-orange">this.</span>')
|
|
48
|
-
let regex = /(\/\*[\w\'\s\r\n\*]*\*\/)|(\/\/[\w\s\']*)|(\<![\-\-\s\w\>\/]*\>)/g
|
|
49
|
-
let matched = res.matchAll(regex)
|
|
50
|
-
for (const match of matched) {
|
|
51
|
-
res = this.$helper.replacer(res, match[0], ' <span class="color-comment">' + match[0] + '</span>')
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
this.strToObj(str).forEach((item)=>{
|
|
55
|
-
res = this.$helper.replacer(res, item, ' <span class="color-purple">'+item+'</span>')
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
return res
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
methods: {
|
|
62
|
-
strToObj(str) {
|
|
63
|
-
str = this.$helper.replacer(str, ' ', '')
|
|
64
|
-
str = this.$helper.replacer(str, "\n", '')
|
|
65
|
-
str = this.$helper.replacer(str, "\r", '')
|
|
66
|
-
let open = 0
|
|
67
|
-
let pre = 0
|
|
68
|
-
let to = 0
|
|
69
|
-
let items = []
|
|
70
|
-
const s = str
|
|
71
|
-
s.split('').forEach((c, i) => {
|
|
72
|
-
to++
|
|
73
|
-
if (c === '{') {
|
|
74
|
-
open++
|
|
75
|
-
}
|
|
76
|
-
if (c === '}') {
|
|
77
|
-
open--
|
|
78
|
-
}
|
|
79
|
-
if (open === 0 && c === ',') {
|
|
80
|
-
let new_str = str.substr(pre, to - 1)
|
|
81
|
-
const o = new_str.indexOf(':')
|
|
82
|
-
const f = new_str.indexOf('(')
|
|
83
|
-
if ((f > 0 && f < o) || o < 0) {
|
|
84
|
-
new_str = new_str.substr(0, f)
|
|
85
|
-
} else {
|
|
86
|
-
new_str = new_str.substr(0, o)
|
|
87
|
-
}
|
|
88
|
-
items.push(new_str)
|
|
89
|
-
pre = i + 1
|
|
90
|
-
to = 0
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
let new_str = str.substr(pre, str.length)
|
|
94
|
-
const o = new_str.indexOf(':')
|
|
95
|
-
const f = new_str.indexOf('(')
|
|
96
|
-
if ((f > 0 && f < o) || o < 0) {
|
|
97
|
-
new_str = new_str.substr(0, f)
|
|
98
|
-
} else {
|
|
99
|
-
new_str = new_str.substr(0, o)
|
|
100
|
-
}
|
|
101
|
-
items.push(new_str)
|
|
102
|
-
return items
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</script>
|
|
107
|
-
<style lang="scss">
|
|
108
|
-
@import "../../style/include";
|
|
109
|
-
|
|
110
|
-
.#{$prefix}highlight-script {
|
|
111
|
-
.color-green {
|
|
112
|
-
color: #0cde27;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.color-orange {
|
|
116
|
-
color: orange;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.color-blue {
|
|
120
|
-
color: #0c9ddc;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.color-number {
|
|
124
|
-
color: #7ad5ff;
|
|
125
|
-
}
|
|
126
|
-
.color-purple {
|
|
127
|
-
color: #d2a8ee;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.color-comment{
|
|
131
|
-
color: #898d8c;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</style>
|