renusify 1.2.3 → 1.2.5

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.
@@ -1,453 +1,259 @@
1
- <template>
2
- <div :class="`${$r.prefix}code-editor`">
3
- <div class="code-action text-right">
4
- <r-btn text @click.prevent="$helper.copy($refs.codeView.innerText)" class="image-copy" icon>
5
- <r-icon v-html="$r.icons.copy"></r-icon>
6
- </r-btn>
7
- <r-btn v-if="show==='code'&&runnable" text @click="show='run'">
8
- run
9
- <r-icon v-html="$r.icons.play" exact></r-icon>
10
- </r-btn>
11
- <r-btn v-if="show==='run'" text @click="show='code'">
12
- <r-icon v-html="$r.icons.code_tags" exact></r-icon>
13
- </r-btn>
14
- </div>
15
- <div v-show="false" ref="codeSlot">
16
- <slot></slot>
17
- </div>
18
- <div v-if="show==='run'&&runnable" class="code-compile">
19
- <r-code-editor-run :template="template.outerHTML" :script="script"></r-code-editor-run>
20
- </div>
21
- <div v-show="show!=='run'" ref="codeView" class="code-wrapper">
22
- <div v-show="template">
23
- <span class="color-green" v-if="runnable">&lt;template&gt;</span>
24
- <div ref="codeViewTemplate" :contenteditable="runnable" @input="rebuildHtml" class="code-template"></div>
25
- <span class="color-green" v-if="runnable">&lt;/template&gt;</span>
26
- <br>
27
- </div>
28
- <div v-show="script">
29
- <span class="color-orange" v-if="runnable">&lt;script&gt;
30
- <br>
31
- export default {</span>
32
- <div ref="codeViewScript" :contenteditable="runnable" @input="rebuild" class="code-script"></div>
33
- <span class="color-orange" v-if="runnable">}<br>&lt;script&gt;</span>
34
- </div>
35
- </div>
36
- </div>
37
- </template>
38
- <script>
39
- import RCodeEditorRun from "./run";
40
-
41
- export default {
42
- name: 'r-code-editor',
43
- components: {RCodeEditorRun},
44
- props: {
45
- runnable: Boolean
46
- },
47
- data() {
48
- return {
49
- show: 'code',
50
- code: '',
51
- edited: false,
52
- template: null,
53
- script: null
54
- }
55
- },
56
- created() {
57
- if (!this.$r.icons.play) {
58
- this.$r.icons.play = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M8 5.14v14l11-7l-11-7Z"/></svg>'
59
- }
60
- if (!this.$r.icons.code_tags) {
61
- this.$r.icons.code_tags = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="m14.6 16.6l4.6-4.6l-4.6-4.6L16 6l6 6l-6 6l-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6l6 6l1.4-1.4Z"/></svg>'
62
- }
63
- },
64
- mounted() {
65
- this.get_code('codeSlot')
66
- },
67
- beforeUpdate() {
68
- if (this.show === 'code' && !this.edited) {
69
- this.get_code('codeSlot')
70
- }
71
- },
72
- methods: {
73
- node_walk(node, func) {
74
- let result = func(node);
75
- for (node = node.firstChild; result !== false && node; node = node.nextSibling)
76
- result = this.node_walk(node, func);
77
- return result;
78
- },
79
- getCaretPosition(elem) {
80
- let sel = window.getSelection();
81
- let cum_length = [0, 0];
82
-
83
- if (sel.anchorNode == elem)
84
- cum_length = [sel.anchorOffset, sel.extentOffset];
85
- else {
86
- let nodes_to_find = [sel.anchorNode, sel.extentNode];
87
- if (!elem.contains(sel.anchorNode) || !elem.contains(sel.extentNode))
88
- return undefined;
89
- else {
90
- let found = [0, 0];
91
- let i;
92
- this.node_walk(elem, function (node) {
93
- for (i = 0; i < 2; i++) {
94
- if (node == nodes_to_find[i]) {
95
- found[i] = true;
96
- if (found[i == 0 ? 1 : 0])
97
- return false; // all done
98
- }
99
- }
100
-
101
- if (node.textContent && !node.firstChild) {
102
- for (i = 0; i < 2; i++) {
103
- if (!found[i])
104
- cum_length[i] += node.textContent.length;
105
- }
106
- }
107
- });
108
- cum_length[0] += sel.anchorOffset;
109
- cum_length[1] += sel.extentOffset;
110
- }
111
- }
112
- if (cum_length[0] <= cum_length[1])
113
- return cum_length;
114
- return [cum_length[1], cum_length[0]];
115
- },
116
- createRange(node, chars, range) {
117
- if (!range) {
118
- range = document.createRange()
119
- range.selectNode(node);
120
- range.setStart(node, 0);
121
- }
122
-
123
- if (chars.count === 0) {
124
- range.setEnd(node, chars.count);
125
- } else if (node && chars.count > 0) {
126
- if (node.nodeType === Node.TEXT_NODE) {
127
- if (node.textContent.length < chars.count) {
128
- chars.count -= node.textContent.length;
129
- } else {
130
- range.setEnd(node, chars.count);
131
- chars.count = 0;
132
- }
133
- } else {
134
- const lng = node.childNodes.length
135
- for (let lp = 0; lp < lng; lp++) {
136
- range = this.createRange(node.childNodes[lp], chars, range);
137
-
138
- if (chars.count === 0) {
139
- break;
140
- }
141
- }
142
- }
143
- }
144
-
145
- return range;
146
- },
147
- rebuild(e) {
148
- this.edited = true
149
- const pos = this.getCaretPosition(this.$refs.codeViewScript)
150
- this.script = this.$refs.codeViewScript.innerText
151
- let selection = window.getSelection();
152
- this.$refs.codeViewScript.innerHTML = this.buildScript(this.script)
153
- let range = this.createRange(this.$refs.codeViewScript, {count: pos[0] + (e.inputType === 'insertParagraph' ? 1 : 0)});
154
- if (range) {
155
- range.collapse(false);
156
- selection.removeAllRanges();
157
- selection.addRange(range);
158
- }
159
-
160
- },
161
- rebuildHtml(e) {
162
- this.edited = true
163
- const pos = this.getCaretPosition(this.$refs.codeViewTemplate)
164
- this.template = this.toHTML(this.$refs.codeViewTemplate.innerText)
165
- let selection = window.getSelection();
166
- this.$refs.codeViewTemplate.innerHTML = this.buildHtml(this.template.children[0])
167
- let range = this.createRange(this.$refs.codeViewTemplate, {count: pos[0] + (e.inputType === 'insertParagraph' ? 1 : 0)});
168
-
169
- if (range) {
170
- range.collapse(false);
171
- selection.removeAllRanges();
172
- selection.addRange(range);
173
- }
174
-
175
- },
176
- toHTML(htmlString) {
177
- let div = document.createElement('div');
178
- div.innerHTML = htmlString;
179
- return div
180
- },
181
- get_code(slot = 'codeSlot') {
182
- if (!this.$refs[slot]) {
183
- setTimeout(() => {
184
- this.get_code(slot)
185
- }, 100)
186
- return
187
- }
188
-
189
- this.code = this.toHTML(this.$refs[slot].innerHTML)
190
- let temp = this.code.querySelector('.code-template')
191
-
192
- if (temp && temp.childNodes.length > 0) {
193
- for (let i = 0; i < temp.childNodes.length; i++) {
194
- if (temp.childNodes[i].nodeName === "#comment") {
195
- this.template = this.toHTML(temp.childNodes[i].nodeValue).children[0]
196
- break
197
- }
198
- }
199
- }
200
-
201
- let script = this.code.querySelector('.code-script')
202
- if (script && script.childNodes.length > 0) {
203
- for (let i = 0; i < script.childNodes.length; i++) {
204
- if (script.childNodes[i].nodeName === "#comment") {
205
- this.script = script.childNodes[i].nodeValue
206
- break
207
- }
208
- }
209
- }
210
-
211
-
212
- if (this.template || this.script) {
213
- this.$refs.codeViewTemplate.innerHTML = this.buildHtml(this.template)
214
- this.$refs.codeViewScript.innerHTML = this.buildScript(this.script)
215
- } else {
216
- this.$refs.codeView.innerHTML = this.$refs[slot].innerHTML
217
- }
218
- },
219
- strToObj(str) {
220
- str = this.$helper.replacer(str, ' ', '')
221
- str = this.$helper.replacer(str, "\n", '')
222
- str = this.$helper.replacer(str, "\r", '')
223
- let open = 0
224
- let pre = 0
225
- let to = 0
226
- let items = []
227
- const s = str
228
- s.split('').forEach((c, i) => {
229
- to++
230
- if (c === '{') {
231
- open++
232
- }
233
- if (c === '}') {
234
- open--
235
- }
236
- if (open === 0 && c === ',') {
237
- let new_str = str.substr(pre, to - 1)
238
- const o = new_str.indexOf(':')
239
- const f = new_str.indexOf('(')
240
- if ((f > 0 && f < o) || o < 0) {
241
- new_str = new_str.substr(0, f)
242
- } else {
243
- new_str = new_str.substr(0, o)
244
- }
245
- items.push(new_str)
246
- pre = i + 1
247
- to = 0
248
- }
249
- })
250
- let new_str = str.substr(pre, str.length)
251
- const o = new_str.indexOf(':')
252
- const f = new_str.indexOf('(')
253
- if ((f > 0 && f < o) || o < 0) {
254
- new_str = new_str.substr(0, f)
255
- } else {
256
- new_str = new_str.substr(0, o)
257
- }
258
- items.push(new_str)
259
- return items
260
- },
261
- buildHtml(template) {
262
- if (!template) {
263
- return ''
264
- }
265
- let data = template.outerHTML
266
- data = this.$helper.replacer(data, '<', '&lt;')
267
- data = this.$helper.replacer(data, '>', '&gt;')
268
- data = data.split('')
269
- let res = ''
270
- let in_quta = false
271
- data.forEach((c, i) => {
272
- if (c === '=') {
273
- res += '<span class="color-blue code-editor-span">=</span>'
274
- } else if ((c === '"' || c === "'") && !in_quta) {
275
- in_quta = c
276
- res += '<span class="color-green code-editor-span">' + c
277
- } else if (c === in_quta) {
278
- in_quta = false
279
- res += c + '</span>'
280
- } else {
281
- res += c
282
- }
283
- })
284
-
285
- res = this.$helper.replacer(res, '&lt;', '<span class="color-orange code-editor-span">&lt;')
286
- res = this.$helper.replacer(res, '&gt;', '&gt;</span>')
287
- res = this.$helper.replacer(res, '{{', '<span class="color-blue code-editor-span">{{')
288
- res = this.$helper.replacer(res, '}}', '}}</span>')
289
-
290
- let regex = /\+(.*?)\+/g
291
- let matched = res.matchAll(regex)
292
- for (const match of matched) {
293
- res = this.$helper.replacer(res, match[0], '<span class="color-blue code-editor-span">' + match[0] + '</span>')
294
- }
295
-
296
- res = this.re_words(res)
297
- res = this.re_comment(res)
298
- res = this.re_func(res)
299
-
300
- return res
301
- },
302
- buildScript() {
303
- if (!this.script) {
304
- return ''
305
- }
306
- let data = this.script.split('')
307
- let str = this.script.trim()
308
-
309
- if (str.substr(0, 1) === '{') {
310
- str = str.substr(1, str.length - 2)
311
- }
312
- let res = ''
313
-
314
- let in_quta = false
315
- data.forEach((c, i) => {
316
- if (['=', '&', '{', '}', '<', '>'].includes(c)) {
317
- res += '<span class="color-blue code-editor-span">' + c + '</span>'
318
- } else if ([',', ';', ':'].includes(c)) {
319
- res += '<span class="color-orange code-editor-span">' + c + '</span>'
320
- } else if (parseInt(c) > -1) {
321
- res += '<span class="color-number code-editor-span">' + c + '</span>'
322
- } else if ((c === '"' || c === "'" || c === "`") && !in_quta) {
323
- in_quta = c
324
- res += '<span class="color-green code-editor-span">' + c
325
- } else if (c === in_quta) {
326
- in_quta = false
327
- res += c + '</span>'
328
- } else {
329
- res += c
330
- }
331
- })
332
-
333
- res = this.re_words(res)
334
- res = this.re_comment(res)
335
- res = this.re_func(res)
336
-
337
- // main function vuejs methods created ,...
338
- this.strToObj(str).forEach((item) => {
339
- if (item) {
340
- res = this.$helper.replacer(res, item, '<span class="color-func code-editor-span">' + item + '</span>')
341
- }
342
- })
343
-
344
- return res
345
- },
346
- re_words(res) {
347
- res = this.$helper.replacer(res, 'import ', '<span class="color-orange code-editor-span">import</span> ')
348
- res = this.$helper.replacer(res, ' from ', ' <span class="color-orange code-editor-span">from</span> ')
349
- res = this.$helper.replacer(res, ' window.', ' <span class="color-orange code-editor-span">window</span>.')
350
- res = this.$helper.replacer(res, ' new ', ' <span class="color-orange code-editor-span">new</span> ')
351
- res = this.$helper.replacer(res, ' var ', ' <span class="color-orange code-editor-span">var</span> ')
352
- res = this.$helper.replacer(res, ' let ', ' <span class="color-orange code-editor-span">let</span> ')
353
- res = this.$helper.replacer(res, ' const ', ' <span class="color-orange code-editor-span">const</span> ')
354
- res = this.$helper.replacer(res, ' return ', ' <span class="color-orange code-editor-span">return</span> ')
355
- res = this.$helper.replacer(res, ' true', ' <span class="color-orange code-editor-span">true</span>')
356
- res = this.$helper.replacer(res, ' false', ' <span class="color-orange code-editor-span">false</span>')
357
- res = this.$helper.replacer(res, ' this.', ' <span class="color-orange code-editor-span">this</span>.')
358
-
359
- return res
360
- },
361
- re_comment(res) {
362
- let regex = /(\/\*[\w\'\s\r\n\*]*\*\/)|(\/\/[\w\s\']*)|(\<![\-\-\s\w\>\/]*\>)/g
363
- let matched = res.matchAll(regex)
364
- for (const match of matched) {
365
- res = this.$helper.replacer(res, match[0], '<span class="color-comment code-editor-span">' + match[0] + '</span>')
366
- }
367
- return res
368
- },
369
- re_func(res) {
370
- //function like Date()
371
- let regex = /([a-zA-Z_{1}][a-zA-Z0-9_]+)[ ]{0,1}(?=\()/g
372
- let matched = res.matchAll(regex)
373
- for (const match of matched) {
374
- res = this.$helper.replacer(res, match[0], '<span class="color-func2 code-editor-span">' + match[0] + '</span>')
375
- }
376
-
377
- //function like $r $d()
378
- regex = /(\$([a-zA-z0-9]*)[.|(])/g
379
- matched = res.matchAll(regex)
380
- for (const match of matched) {
381
- res = this.$helper.replacer(res, match[0].substr(0, match[0].length - 1), '<span class="color-func code-editor-span">' + match[0].substr(0, match[0].length - 1) + '</span>')
382
- }
383
- res = this.$helper.replacer(res, '(', '<span class="color-func2 code-editor-span">(</span>')
384
- res = this.$helper.replacer(res, ')', '<span class="color-func2 code-editor-span">)</span>')
385
- return res
386
- }
387
- }
388
- }
389
- </script>
390
- <style lang="scss">
391
- @import "../../style/include";
392
-
393
- .#{$prefix}code-editor {
394
- position: relative;
395
- white-space: break-spaces;
396
- caret-color: white;
397
- background-color: #15212e;
398
- color: #fff;
399
- padding: 10px;
400
-
401
- .code-script, .code-template {
402
- padding: 0 20px;
403
- }
404
-
405
- .code-wrapper {
406
- direction: ltr;
407
- text-align: left;
408
- padding: 10px;
409
- }
410
-
411
- .code-compile {
412
- background-color: #fafafa;
413
- min-height: 300px;
414
- padding: 10px;
415
- margin: 0 -10px -10px -10px;
416
- color: black;
417
- }
418
-
419
- .color-func {
420
- color: #db92e3;
421
- }
422
-
423
- .color-func2 {
424
- color: #deca10;
425
- }
426
-
427
- .color-orange {
428
- color: orange;
429
- }
430
-
431
-
432
- .color-green {
433
- color: #0cde27;
434
- }
435
-
436
-
437
- .color-blue {
438
- color: #3bb7ee;
439
- }
440
-
441
- .color-number {
442
- color: #7ad5ff;
443
- }
444
-
445
- .color-purple {
446
- color: #d2a8ee;
447
- }
448
-
449
- .color-comment {
450
- color: #898d8c;
451
- }
452
- }
453
- </style>
1
+ <template>
2
+ <div :class="`${$r.prefix}code-editor`">
3
+ <div class="code-action text-right">
4
+ <r-btn
5
+ class="image-copy"
6
+ icon
7
+ text
8
+ @click.prevent="$helper.copy($refs.codeView.innerText)"
9
+ >
10
+ <r-icon v-html="$r.icons.copy"></r-icon>
11
+ </r-btn>
12
+ <r-btn v-if="show === 'code' && runnable" text @click="show = 'run'">
13
+ run
14
+ <r-icon v-html="$r.icons.play" exact></r-icon>
15
+ </r-btn>
16
+ <r-btn v-if="show === 'run'" text @click="show = 'code'">
17
+ <r-icon v-html="$r.icons.code_tags" exact></r-icon>
18
+ </r-btn>
19
+ </div>
20
+ <div v-show="false" ref="codeSlot">
21
+ <slot></slot>
22
+ </div>
23
+ <div v-if="show === 'run' && runnable" class="code-compile">
24
+ <r-code-editor-run
25
+ :id="id"
26
+ :script="script"
27
+ :style="style"
28
+ :template="template"
29
+ ></r-code-editor-run>
30
+ </div>
31
+ <div v-show="show !== 'run'" ref="codeView" class="code-wrapper">
32
+ <div v-show="templateShow">
33
+ <span class="color-green">&lt;template&gt;</span>
34
+ <highlight-html v-model="temp"></highlight-html>
35
+ <span class="color-green">&lt;/template&gt;</span>
36
+ <br/>
37
+ </div>
38
+ <div v-show="scriptShow">
39
+ <span class="color-orange"
40
+ >&lt;script&gt;
41
+ <br/>
42
+ export default {</span
43
+ >
44
+ <highlight-script v-model="scr"></highlight-script>
45
+ <span class="color-orange">}<br/>&lt;script&gt;</span>
46
+ </div>
47
+ <div v-show="styleShow">
48
+ <span class="color-orange"
49
+ >&lt;style lang<span class="color-green">="css"</span>&gt;</span
50
+ >
51
+ <highlight-css v-model="sty"></highlight-css>
52
+ <span class="color-orange">&lt;style&gt;</span>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </template>
57
+
58
+ <script>
59
+ import RCodeEditorRun from "./run";
60
+ import highlightHtml from "./highlightHtml";
61
+ import HighlightScript from "./highlightJs";
62
+ import HighlightCss from "./highlightCss";
63
+
64
+ export default {
65
+ name: "r-code-editor",
66
+ components: {HighlightCss, HighlightScript, highlightHtml, RCodeEditorRun},
67
+ props: {
68
+ runnable: Boolean,
69
+ templateShow: {type: Boolean, default: true},
70
+ scriptShow: {type: Boolean, default: true},
71
+ styleShow: {type: Boolean, default: true},
72
+ template: String,
73
+ script: String,
74
+ style: String,
75
+ },
76
+ emits: ["update:template", "update:script", "update:style"],
77
+ data() {
78
+ return {
79
+ show: "code",
80
+ code: "",
81
+ edited: false,
82
+ temp: this.template,
83
+ scr: this.script,
84
+ sty: this.style,
85
+ id: this.$helper.uniqueId(),
86
+ };
87
+ },
88
+ created() {
89
+ if (!this.$r.icons.play) {
90
+ this.$r.icons.play =
91
+ '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M8 5.14v14l11-7l-11-7Z"/></svg>';
92
+ }
93
+ if (!this.$r.icons.code_tags) {
94
+ this.$r.icons.code_tags =
95
+ '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="m14.6 16.6l4.6-4.6l-4.6-4.6L16 6l6 6l-6 6l-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6l6 6l1.4-1.4Z"/></svg>';
96
+ }
97
+ },
98
+ mounted() {
99
+ this.get_code("codeSlot");
100
+ },
101
+ watch: {
102
+ temp: function () {
103
+ this.$emit("update:template", this.temp);
104
+ },
105
+ scr: function () {
106
+ this.$emit("update:script", this.scr);
107
+ },
108
+ sty: function () {
109
+ this.$emit("update:style", this.sty);
110
+ },
111
+ },
112
+ methods: {
113
+ toHTML(htmlString) {
114
+ let div = document.createElement("div");
115
+ div.innerHTML = htmlString;
116
+ return div;
117
+ },
118
+ get_code(slot = "codeSlot") {
119
+ if (!this.$refs[slot]) {
120
+ setTimeout(() => {
121
+ this.get_code(slot);
122
+ }, 100);
123
+ return;
124
+ }
125
+
126
+ this.code = this.toHTML(this.$refs[slot].innerHTML);
127
+ let temp = this.code.querySelector(".code-template");
128
+
129
+ if (temp && temp.childNodes.length > 0) {
130
+ for (let i = 0; i < temp.childNodes.length; i++) {
131
+ if (temp.childNodes[i].nodeName === "#comment") {
132
+ this.template = this.toHTML(temp.childNodes[i].nodeValue).innerHTML;
133
+ break;
134
+ }
135
+ }
136
+ }
137
+
138
+ let script = this.code.querySelector(".code-script");
139
+ if (script && script.childNodes.length > 0) {
140
+ for (let i = 0; i < script.childNodes.length; i++) {
141
+ if (script.childNodes[i].nodeName === "#comment") {
142
+ this.script = script.childNodes[i].nodeValue;
143
+ break;
144
+ }
145
+ }
146
+ }
147
+ },
148
+ },
149
+ };
150
+ </script>
151
+
152
+ <style lang="scss">
153
+ @import "~renusify/style/include";
154
+ .#{$prefix}code-editor {
155
+ position: relative;
156
+ white-space: break-spaces;
157
+ caret-color: white;
158
+ background-color: #15212e;
159
+ color: #fff;
160
+ padding: 10px;
161
+
162
+ .code-script,
163
+ .code-template {
164
+ padding: 0 20px;
165
+ }
166
+
167
+ .code-wrapper {
168
+ direction: ltr;
169
+ text-align: left;
170
+ padding: 10px;
171
+ }
172
+
173
+ .code-compile {
174
+ background-color: #fafafa;
175
+ min-height: 300px;
176
+ padding: 10px;
177
+ margin: 0 -10px -10px -10px;
178
+ color: black;
179
+ }
180
+
181
+ .color-func {
182
+ color: #db92e3;
183
+ }
184
+
185
+ .color-func2 {
186
+ color: #deca10;
187
+ }
188
+
189
+ .color-orange {
190
+ color: orange;
191
+ }
192
+
193
+ .color-green {
194
+ color: #0cde27;
195
+ }
196
+
197
+ .color-blue {
198
+ color: #3bb7ee;
199
+ }
200
+
201
+ .color-number {
202
+ color: #7ad5ff;
203
+ }
204
+
205
+ .color-purple {
206
+ color: #d2a8ee;
207
+ }
208
+
209
+ .color-comment {
210
+ color: #898d8c;
211
+ }
212
+
213
+ .code-editor-highlight {
214
+ position: relative;
215
+
216
+ .text-preview {
217
+ white-space: pre-wrap;
218
+ word-break: keep-all;
219
+ overflow-wrap: break-word;
220
+ min-height: 40px;
221
+ font-size: 14px;
222
+ letter-spacing: 2px;
223
+ line-height: 20px;
224
+ margin: 0;
225
+ border: 0;
226
+
227
+ padding: 12px;
228
+ }
229
+
230
+ textarea {
231
+ &::selection {
232
+ background-color: #fafafa;
233
+ -webkit-text-fill-color: #000;
234
+ color: #000;
235
+ }
236
+
237
+ padding: 12px;
238
+ margin: 0;
239
+ border: 0;
240
+ font-size: 14px;
241
+ letter-spacing: 2px;
242
+ line-height: 20px;
243
+ -webkit-font-smoothing: antialiased;
244
+ -webkit-text-fill-color: transparent;
245
+ outline: none;
246
+ width: 100%;
247
+ height: 100%;
248
+ min-height: 40px;
249
+ white-space: pre-wrap;
250
+ word-break: keep-all;
251
+ overflow-wrap: break-word;
252
+ position: absolute;
253
+ top: 0;
254
+ left: 0;
255
+ resize: none;
256
+ }
257
+ }
258
+ }
259
+ </style>