renusify 2.4.0 → 2.4.1
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/bar/scss/toolbar.scss +0 -1
- package/components/form/text-editor/index.vue +8 -1
- package/components/highlight/index.vue +16 -1
- package/components/highlight/mixin.js +27 -1
- package/components/highlight/style.scss +9 -5
- package/components/nestable/NestableItem.vue +6 -4
- package/package.json +1 -1
- package/style/variables/base.scss +10 -10
|
@@ -182,6 +182,7 @@
|
|
|
182
182
|
:closebtn="false">
|
|
183
183
|
<r-form v-model="valid2">
|
|
184
184
|
<r-container>
|
|
185
|
+
<r-text-input :label="$t('name','renusify')" v-model="code_name"></r-text-input>
|
|
185
186
|
<r-select-input v-model="lang" :items="langs"
|
|
186
187
|
:label="$t('lang','renusify')"
|
|
187
188
|
:rules="['required']"
|
|
@@ -251,6 +252,7 @@ export default {
|
|
|
251
252
|
preSelected: null,
|
|
252
253
|
currentPath: [],
|
|
253
254
|
selectElm: null,
|
|
255
|
+
code_name: null,
|
|
254
256
|
code: '',
|
|
255
257
|
lang: null,
|
|
256
258
|
showPre: false,
|
|
@@ -480,7 +482,12 @@ export default {
|
|
|
480
482
|
let sel = this.getSelection()
|
|
481
483
|
sel.removeAllRanges()
|
|
482
484
|
sel.addRange(this.preSelected)
|
|
483
|
-
let url = `<div class="${this.$r.prefix}highlight
|
|
485
|
+
let url = `<div class="${this.$r.prefix}highlight" >`
|
|
486
|
+
if (this.code_name) {
|
|
487
|
+
url += `<div class="highlight-name title-3 font-weight-bold mb-3">${this.code_name}</div>`
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
url += `<div class="highlight-code highlight-lang-${this.lang}">${await this.highlight(this.code, this.lang)}</div></div>`
|
|
484
491
|
document.execCommand('insertHTML', true, url)
|
|
485
492
|
this.showPre = false
|
|
486
493
|
},
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="`${$r.prefix}highlight
|
|
2
|
+
<div :class="`${$r.prefix}highlight`" >
|
|
3
|
+
<div class="title-3 font-weight-bold mb-3" :class="{'highlight-name':name}">
|
|
4
|
+
<div class="d-flex v-top">{{name}}
|
|
5
|
+
<r-spacer></r-spacer>
|
|
6
|
+
<r-btn
|
|
7
|
+
icon
|
|
8
|
+
text
|
|
9
|
+
@click.prevent="$helper.copy(src)"
|
|
10
|
+
>
|
|
11
|
+
<r-icon v-html="$r.icons.copy"></r-icon>
|
|
12
|
+
</r-btn>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div :class="`highlight-code highlight-lang-${lang}`" v-html='txt'></div>
|
|
16
|
+
</div>
|
|
3
17
|
</template>
|
|
4
18
|
<script>
|
|
5
19
|
import './style.scss'
|
|
@@ -9,6 +23,7 @@ export default {
|
|
|
9
23
|
name: 'highlight',
|
|
10
24
|
mixins: [mixin],
|
|
11
25
|
props: {
|
|
26
|
+
name: String,
|
|
12
27
|
src: String,
|
|
13
28
|
hideLineNumbers: Boolean,
|
|
14
29
|
lang: {
|
|
@@ -815,7 +815,7 @@ export default {
|
|
|
815
815
|
},
|
|
816
816
|
{
|
|
817
817
|
type: 'kwd',
|
|
818
|
-
match: /\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g
|
|
818
|
+
match: /\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield|await)\b/g
|
|
819
819
|
},
|
|
820
820
|
{
|
|
821
821
|
type: 'bool',
|
|
@@ -1036,6 +1036,32 @@ export default {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
]
|
|
1038
1038
|
}
|
|
1039
|
+
this.languages.http= {
|
|
1040
|
+
default: [
|
|
1041
|
+
{
|
|
1042
|
+
type: 'kwd',
|
|
1043
|
+
match: /^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
expand: 'str'
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
type: 'section',
|
|
1050
|
+
match: /\bHTTP\/[\d.]+\b/g
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
expand: 'num'
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
type: 'oper',
|
|
1057
|
+
match: /[,;:=]/g
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
type: 'var',
|
|
1061
|
+
match: /[a-zA-Z][\w-]*(?=:)/g
|
|
1062
|
+
}
|
|
1063
|
+
]
|
|
1064
|
+
}
|
|
1039
1065
|
},
|
|
1040
1066
|
methods: {
|
|
1041
1067
|
async highlight(code, lang, hideLineNumbers) {
|
|
@@ -4,25 +4,29 @@
|
|
|
4
4
|
direction: ltr;
|
|
5
5
|
text-align: left;
|
|
6
6
|
white-space: pre;
|
|
7
|
-
padding:
|
|
7
|
+
padding: 20px !important;
|
|
8
8
|
color: #f8f8f2;
|
|
9
9
|
background: #1a1a1c;
|
|
10
10
|
box-shadow: 0 0 5px #fff;
|
|
11
11
|
text-shadow: none;
|
|
12
12
|
font: normal 18px Consolas, "Courier New", Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
13
|
-
line-height: 24px;
|
|
13
|
+
line-height: 24px !important;
|
|
14
14
|
box-sizing: border-box;
|
|
15
15
|
|
|
16
16
|
&::selection {
|
|
17
17
|
background: #bdf5
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
.highlight-name {
|
|
21
|
+
border-bottom: 1px solid !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.highlight-code > div {
|
|
21
25
|
display: flex;
|
|
22
26
|
overflow: auto
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
> div :last-child {
|
|
29
|
+
.highlight-code > div :last-child {
|
|
26
30
|
flex: 1;
|
|
27
31
|
outline: none
|
|
28
32
|
}
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
&.highlight-lang-http .highlight-syn-kwd {
|
|
59
63
|
background: #25f;
|
|
60
64
|
color: #fff;
|
|
61
65
|
padding: 0px 5px;
|
|
@@ -23,10 +23,13 @@
|
|
|
23
23
|
>
|
|
24
24
|
<r-icon v-html="$r.icons.delete"></r-icon>
|
|
25
25
|
</r-btn-confirm>
|
|
26
|
+
<r-btn v-if="hasChildren" icon text @click="closed=!closed">
|
|
27
|
+
<r-icon v-html="closed?$r.icons.plus:$r.icons.minus"></r-icon>
|
|
28
|
+
</r-btn>
|
|
29
|
+
<r-btn v-else icon text></r-btn>
|
|
26
30
|
<slot :item="item">{{ item }}</slot>
|
|
27
31
|
</div>
|
|
28
|
-
|
|
29
|
-
<div v-if="hasChildren" class="nestable-list ms-5">
|
|
32
|
+
<div v-if="hasChildren&&!closed" class="nestable-list ms-5">
|
|
30
33
|
<template
|
|
31
34
|
v-for="(child, childIndex) in item[childrenProp]"
|
|
32
35
|
:key="childIndex"
|
|
@@ -90,9 +93,9 @@ export default {
|
|
|
90
93
|
return {
|
|
91
94
|
breakPoint: null,
|
|
92
95
|
moveDown: false,
|
|
96
|
+
closed:false
|
|
93
97
|
};
|
|
94
98
|
},
|
|
95
|
-
|
|
96
99
|
computed: {
|
|
97
100
|
isDragging() {
|
|
98
101
|
return (
|
|
@@ -116,7 +119,6 @@ export default {
|
|
|
116
119
|
];
|
|
117
120
|
},
|
|
118
121
|
},
|
|
119
|
-
|
|
120
122
|
methods: {
|
|
121
123
|
del(item) {
|
|
122
124
|
this.$emit("delete", item);
|
package/package.json
CHANGED
|
@@ -143,35 +143,35 @@ $headings: (
|
|
|
143
143
|
'display-1': (
|
|
144
144
|
'size': 4.75rem,
|
|
145
145
|
'weight': 400,
|
|
146
|
-
'line-height':
|
|
146
|
+
'line-height': 6rem,
|
|
147
147
|
'letter-spacing': -0.02rem,
|
|
148
148
|
'text-transform': false
|
|
149
149
|
),
|
|
150
150
|
'display-2': (
|
|
151
151
|
'size': 3.75rem,
|
|
152
152
|
'weight': 400,
|
|
153
|
-
'line-height':
|
|
153
|
+
'line-height': 5.3rem,
|
|
154
154
|
'letter-spacing': 0,
|
|
155
155
|
'text-transform': false
|
|
156
156
|
),
|
|
157
157
|
'display-3': (
|
|
158
158
|
'size': 3rem,
|
|
159
159
|
'weight': 400,
|
|
160
|
-
'line-height':
|
|
160
|
+
'line-height': 4.3rem,
|
|
161
161
|
'letter-spacing': 0,
|
|
162
162
|
'text-transform': false
|
|
163
163
|
),
|
|
164
164
|
'headline-1': (
|
|
165
165
|
'size': 2.66rem,
|
|
166
166
|
'weight': 400,
|
|
167
|
-
'line-height': 3.
|
|
167
|
+
'line-height': 3.6rem,
|
|
168
168
|
'letter-spacing': 0,
|
|
169
169
|
'text-transform': false
|
|
170
170
|
),
|
|
171
171
|
'headline-2': (
|
|
172
172
|
'size': 2.33rem,
|
|
173
173
|
'weight': 400,
|
|
174
|
-
'line-height':
|
|
174
|
+
'line-height': 3.2rem,
|
|
175
175
|
'letter-spacing': 0,
|
|
176
176
|
'text-transform': false
|
|
177
177
|
),
|
|
@@ -192,7 +192,7 @@ $headings: (
|
|
|
192
192
|
'title-2': (
|
|
193
193
|
'size': 1.33rem,
|
|
194
194
|
'weight': 500,
|
|
195
|
-
'line-height':
|
|
195
|
+
'line-height': 1.9rem,
|
|
196
196
|
'letter-spacing': 0.0125rem,
|
|
197
197
|
'text-transform': false
|
|
198
198
|
),
|
|
@@ -206,7 +206,7 @@ $headings: (
|
|
|
206
206
|
'body-1': (
|
|
207
207
|
'size': 1.33rem,
|
|
208
208
|
'weight': 400,
|
|
209
|
-
'line-height':
|
|
209
|
+
'line-height': 1.8rem,
|
|
210
210
|
'letter-spacing': 0.042rem,
|
|
211
211
|
'text-transform': false
|
|
212
212
|
),
|
|
@@ -227,21 +227,21 @@ $headings: (
|
|
|
227
227
|
'label-1': (
|
|
228
228
|
'size': 1.15rem,
|
|
229
229
|
'weight': 500,
|
|
230
|
-
'line-height': 1.
|
|
230
|
+
'line-height': 1.5rem,
|
|
231
231
|
'letter-spacing': 0.008rem,
|
|
232
232
|
'text-transform': uppercase
|
|
233
233
|
),
|
|
234
234
|
'label-2': (
|
|
235
235
|
'size':1rem,
|
|
236
236
|
'weight': 500,
|
|
237
|
-
'line-height': 1.
|
|
237
|
+
'line-height': 1.2rem,
|
|
238
238
|
'letter-spacing': 0.042rem,
|
|
239
239
|
'text-transform': uppercase
|
|
240
240
|
),
|
|
241
241
|
'label-3': (
|
|
242
242
|
'size': 0.85rem,
|
|
243
243
|
'weight': 500,
|
|
244
|
-
'line-height': 1.
|
|
244
|
+
'line-height': 1.1rem,
|
|
245
245
|
'letter-spacing': 0.042rem,
|
|
246
246
|
'text-transform': uppercase
|
|
247
247
|
)
|