renusify 2.3.2 → 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.
@@ -125,7 +125,6 @@
125
125
  .toolbar-item {
126
126
  padding: 20px 5px;
127
127
  font-size: 1.125rem;
128
- font-weight: bold;
129
128
  position: relative;
130
129
 
131
130
  .toolbar-childs {
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div class="d-flex flex-wrap">
2
+ <div class="d-flex flex-wrap h-space-around">
3
3
  <r-btn v-for="i in ls"
4
4
  :key="i"
5
5
  outlined
6
- class="w-30 ma-2"
6
+ class="w-25 ma-1"
7
7
  :class="{'color-one':i===modelValue}"
8
8
  @click.prevent="emit(i)">
9
9
  {{
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div class="calendar-year-tab d-flex flex-wrap">
2
+ <div class="calendar-year-tab d-flex flex-wrap h-space-around">
3
3
  <r-btn v-for="i in 200"
4
4
  :key="i"
5
- class="w-30 ma-2"
5
+ class="w-25 ma-1"
6
6
  :class="{'color-one year-select':modelValue+i-100===modelValue}"
7
7
  outlined
8
8
  @click.prevent="emit(modelValue+i-100)">
@@ -8,55 +8,43 @@
8
8
  spellcheck="false"
9
9
  @keydown="setTab"
10
10
  ></textarea>
11
- <div class="text-preview" v-html="build"></div>
11
+ <div class="text-preview" v-html="code"></div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import mixin from './mixin.js'
17
+ import mixin_h from '../highlight/mixin.js'
17
18
 
18
19
  export default {
19
20
  name: "highlight-css",
20
21
  props: {
21
22
  modelValue: String,
22
23
  },
23
- mixins: [mixin],
24
+ mixins: [mixin, mixin_h],
24
25
  data() {
25
26
  return {
26
27
  d: this.modelValue,
27
- runnable: false,
28
28
  code: "",
29
29
  };
30
30
  },
31
+ async created() {
32
+ if (this.modelValue) {
33
+ await this.build_code()
34
+ }
35
+ },
31
36
  watch: {
32
37
  modelValue: function () {
33
38
  this.d = this.modelValue;
34
39
  },
35
- d: function () {
40
+ d: async function () {
41
+ await this.build_code()
36
42
  this.$emit("update:modelValue", this.d);
37
43
  },
38
44
  },
39
- computed: {
40
- build() {
41
- if (!this.d) {
42
- return "";
43
- }
44
- let res = this.d
45
- res = this.re_quote(res);
46
- res = this.re_func(res);
47
- res = this.re_class(res);
48
- res = this.re_id(res);
49
- res = this.re_comment(res);
50
- res = this.re_special(res, /([{};,:])/g, 'color-func2');
51
- return res;
52
- },
53
- },
54
45
  methods: {
55
- re_class(res) {
56
- return res = res.replace(/(\.+[_a-zA-Z0-9-:#{}$].*)\{/g, '<span class="color-func2 code-editor-span">$1</span>{')
57
- },
58
- re_id(res) {
59
- return res = res.replace(/(#+[_a-zA-Z0-9-:#{}$].*)\{/g, '<span class="color-func2 code-editor-span">$1</span>{')
46
+ async build_code() {
47
+ this.code = await this.highlight(this.d, "css", true)
60
48
  }
61
49
  },
62
50
  };
@@ -8,55 +8,44 @@
8
8
  spellcheck="false"
9
9
  @keydown="setKey"
10
10
  ></textarea>
11
- <div class="text-preview" v-html="build"></div>
11
+ <div class="text-preview" v-html="code"></div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import mixin from './mixin.js'
17
+ import mixin_h from '../highlight/mixin.js'
17
18
 
18
19
  export default {
19
20
  name: "highlight-html",
20
21
  props: {
21
22
  modelValue: String,
22
23
  },
23
- mixins: [mixin],
24
+ mixins: [mixin, mixin_h],
24
25
  data() {
25
26
  return {
26
27
  d: this.modelValue,
27
- runnable: false,
28
- code: "",
29
- openTag: null
28
+ code: ""
30
29
  };
31
30
  },
31
+ async created() {
32
+ if (this.modelValue) {
33
+ await this.build_code()
34
+ }
35
+ },
32
36
  watch: {
33
37
  modelValue: function () {
34
38
  this.d = this.modelValue;
35
39
  },
36
- d: function () {
40
+ d: async function () {
41
+ await this.build_code()
37
42
  this.$emit("update:modelValue", this.d);
38
43
  },
39
44
  },
40
- computed: {
41
- build() {
42
- if (!this.d) {
43
- return "";
44
- }
45
- let data = this.d;
46
- data = this.$helper.replacer(data, "<", "&lt;");
47
- data = this.$helper.replacer(data, ">", "&gt;");
48
- let res = data;
49
- res = this.re_quote(res)
50
-
51
- res = this.re_comment(res);
52
- res = this.re_func(res);
53
-
54
- res = res.replace(/(&lt;+[\s\S]+&gt;)/g, '<span class="color-orange code-editor-span">$1</span>')
55
- res = res.replace(/\{\{([^}]+)}}/g, '<span class="color-blue code-editor-span">{{$1}}</span>')
56
- return res;
57
- },
58
- },
59
45
  methods: {
46
+ async build_code() {
47
+ this.code = await this.highlight(this.d, "html", true)
48
+ },
60
49
  setKey(event) {
61
50
  if (event.key === "<") {
62
51
  this.openTag = event.target.selectionEnd
@@ -82,10 +71,6 @@ export default {
82
71
  return false;
83
72
  }
84
73
  return this.setTab(event)
85
- },
86
- re_comment(res) {
87
- let regex = /(&lt;!--+[\s\S]+--&gt;)/g;
88
- return res.replace(regex, '<span class="color-comment code-editor-span">$1</span>')
89
74
  }
90
75
  },
91
76
  };
@@ -8,55 +8,44 @@
8
8
  spellcheck="false"
9
9
  @keydown="setTab"
10
10
  ></textarea>
11
- <div class="text-preview" v-html="build"></div>
11
+ <div class="text-preview" v-html="code"></div>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import mixin from './mixin.js'
17
+ import mixin_h from '../highlight/mixin.js'
17
18
 
18
19
  export default {
19
20
  name: "highlight-script",
20
21
  props: {
21
22
  modelValue: String,
22
23
  },
23
- mixins: [mixin],
24
+ mixins: [mixin, mixin_h],
24
25
  data() {
25
26
  return {
26
27
  d: this.modelValue,
27
- runnable: false,
28
28
  code: "",
29
29
  };
30
30
  },
31
+ async created() {
32
+ if (this.modelValue) {
33
+ await this.build_code()
34
+ }
35
+ },
31
36
  watch: {
32
37
  modelValue: function () {
33
38
  this.d = this.modelValue;
34
39
  },
35
- d: function () {
40
+ d: async function () {
41
+ await this.build_code()
36
42
  this.$emit("update:modelValue", this.d);
37
43
  },
38
44
  },
39
- computed: {
40
- build() {
41
- if (!this.d) {
42
- return "";
43
- }
44
-
45
- let res = this.d;
46
- res = this.$helper.replacer(res, "<", "&lt;");
47
- res = this.$helper.replacer(res, ">", "&gt;");
48
- res = this.re_quote(res);
49
- res = this.re_special(res, /([{}\[\]])/g);
50
- res = this.re_words(res, ['import', 'from', 'delete', 'window', 'new', 'var', 'let', 'const', 'return', 'true', 'false', 'this', 'null', 'String', 'Boolean', 'Object']);
51
- res = this.re_comment(res);
52
- res = this.re_func(res);
53
- res = this.re_number(res);
54
- res = this.re_special(res, /([(),])/g, 'color-func2');
55
- res = res.replace(/(&lt;)/g, '<span class="color-orange code-editor-span">$1</span>')
56
- res = res.replace(/(&gt;)/g, '<span class="color-orange code-editor-span">$1</span>')
57
-
58
- return res;
59
- },
45
+ methods: {
46
+ async build_code() {
47
+ this.code = await this.highlight(this.d, "js", true)
48
+ }
60
49
  }
61
50
  };
62
51
  </script>