vue-codemirror6 0.3.2 → 0.3.3
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/README.md +219 -219
- package/dist/components/CodeMirror.vue.d.ts +1 -1
- package/package.json +24 -23
package/README.md
CHANGED
|
@@ -1,219 +1,219 @@
|
|
|
1
|
-
# vue-codemirror6
|
|
2
|
-
|
|
3
|
-
[](https://www.jsdelivr.com/package/npm/vue-codemirror6)
|
|
4
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
5
|
-
[](https://uiwjs.github.io/npm-unpkg/#/pkg/vue-codemirror6/file/README.md)
|
|
6
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
7
|
-
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
8
|
-
|
|
9
|
-
A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. Unrelated to [surmon-china's vue-codemirror](https://github.com/surmon-china/vue-codemirror), it is for CodeMirror6.
|
|
10
|
-
|
|
11
|
-
If you are using Vue2, please use `0.1.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
This component can handle bidirectional binding by `v-model` like a general Vue component.
|
|
16
|
-
When using with Vue2, [@vue/composition-api](https://www.npmjs.com/package/@vue/composition-api) is required separately.
|
|
17
|
-
|
|
18
|
-
### Props
|
|
19
|
-
|
|
20
|
-
| Props | Type | Information |
|
|
21
|
-
| ---------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
-
| dark | boolean | Toggle Darkmode. If you use Vuetify, I recommend that you enter `$vuetify.theme.dark`. |
|
|
23
|
-
| theme | { [selector: string]: StyleSpec } | Specify the theme. For example, if you use [@codemirror/theme-one-dark](https://github.com/codemirror/theme-one-dark), import `oneDark` and put it in this prop. |
|
|
24
|
-
| readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
|
|
25
|
-
| editable | boolean | When this is set to false, it is similar to `readonly`, except that the cursor is not displayed like the normal pre tag. |
|
|
26
|
-
| lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
|
|
27
|
-
| phrases | Record<string, string> | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
|
|
28
|
-
| extensions | Extension[] | Includes enhancements to extend CodeMirror. Such as [@codemirror/basic-setup](https://github.com/codemirror/basic-setup). |
|
|
29
|
-
| linter | Diagnostic[] | Set Linter. see example <https://codesandbox.io/s/f6nb0?file=/src/index.js> |
|
|
30
|
-
|
|
31
|
-
Notice: `lang` and `linter` can also be set together in `extensions`. This is defined for usability compatibility with past CodeMirrors.
|
|
32
|
-
|
|
33
|
-
### Supported Languages
|
|
34
|
-
|
|
35
|
-
- [`@codemirror/lang-cpp`](https://www.npmjs.com/package/@codemirror/lang-cpp)
|
|
36
|
-
- [`@codemirror/lang-html`](https://www.npmjs.com/package/@codemirror/lang-html)
|
|
37
|
-
- [`@codemirror/lang-java`](https://www.npmjs.com/package/@codemirror/lang-java)
|
|
38
|
-
- [`@codemirror/lang-javascript`](https://www.npmjs.com/package/@codemirror/lang-javascript)
|
|
39
|
-
- [`@codemirror/lang-json`](https://www.npmjs.com/package/@codemirror/lang-json)
|
|
40
|
-
- [`@codemirror/lang-lezer`](https://www.npmjs.com/package/@codemirror/lang-lezer)
|
|
41
|
-
- [`@codemirror/lang-markdown`](https://www.npmjs.com/package/@codemirror/lang-markdown)
|
|
42
|
-
- [`@codemirror/lang-php`](https://www.npmjs.com/package/@codemirror/lang-php)
|
|
43
|
-
- [`@codemirror/lang-python`](https://www.npmjs.com/package/@codemirror/lang-python)
|
|
44
|
-
- [`@codemirror/lang-rust`](https://www.npmjs.com/package/@codemirror/lang-rust)
|
|
45
|
-
- [`@codemirror/lang-sql`](https://www.npmjs.com/package/@codemirror/lang-sql)
|
|
46
|
-
- [`@codemirror/lang-xml`](https://www.npmjs.com/package/@codemirror/lang-xml)
|
|
47
|
-
|
|
48
|
-
### Supported Themes
|
|
49
|
-
|
|
50
|
-
- [`@codemirror/theme-one-dark`](https://github.com/codemirror/theme-one-dark)
|
|
51
|
-
- [`upleveled/theme-vs-code-dark-plus`](https://github.com/upleveled/theme-vs-code-dark-plus)
|
|
52
|
-
|
|
53
|
-
## Example
|
|
54
|
-
|
|
55
|
-
Mark up as follows to make it work at a minimum.
|
|
56
|
-
|
|
57
|
-
```vue
|
|
58
|
-
<template>
|
|
59
|
-
<code-mirror v-model="value" />
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<script>
|
|
63
|
-
import { ref, defineComponent } from 'vue';
|
|
64
|
-
|
|
65
|
-
import CodeMirror from 'vue-codemirror6';
|
|
66
|
-
|
|
67
|
-
export default defineComponent({
|
|
68
|
-
components: {
|
|
69
|
-
CodeMirror,
|
|
70
|
-
},
|
|
71
|
-
setup() {
|
|
72
|
-
const value = ref('Cozy lummox gives smart squid who asks for job pen.');
|
|
73
|
-
|
|
74
|
-
return { value };
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
</script>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Example using Slots
|
|
81
|
-
|
|
82
|
-
The contents of the slot will overwrite the existing `v-model`. For this reason, it is recommended to use it when simply displaying with a `readonly` prop without using `v-model`.
|
|
83
|
-
|
|
84
|
-
Also, insert a `<pre>` tag to prevent the text in the slot from being automatically formatted.
|
|
85
|
-
|
|
86
|
-
```vue
|
|
87
|
-
<template>
|
|
88
|
-
<code-mirror :lang="lang" :editable="false">
|
|
89
|
-
<pre>
|
|
90
|
-
{
|
|
91
|
-
"key": "value"
|
|
92
|
-
}</pre
|
|
93
|
-
>
|
|
94
|
-
</code-mirror>
|
|
95
|
-
</template>
|
|
96
|
-
|
|
97
|
-
<script>
|
|
98
|
-
import { ref, defineComponent } from 'vue';
|
|
99
|
-
|
|
100
|
-
import { json } from '@codemirror/lang-json';
|
|
101
|
-
|
|
102
|
-
import CodeMirror from 'vue-codemirror6';
|
|
103
|
-
|
|
104
|
-
export default defineComponent({
|
|
105
|
-
components: {
|
|
106
|
-
CodeMirror,
|
|
107
|
-
},
|
|
108
|
-
setup() {
|
|
109
|
-
const lang = ref(json());
|
|
110
|
-
return { lang };
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
</script>
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Full Example
|
|
117
|
-
|
|
118
|
-
When using as a Markdown editor on [Vuetify](https://vuetifyjs.com/).
|
|
119
|
-
|
|
120
|
-
```vue
|
|
121
|
-
<template>
|
|
122
|
-
<code-mirror
|
|
123
|
-
v-model="value"
|
|
124
|
-
:lang="lang"
|
|
125
|
-
:phrases="phreses"
|
|
126
|
-
:extensions="extensions"
|
|
127
|
-
:dark="$vuetify.theme.dark"
|
|
128
|
-
/>
|
|
129
|
-
</template>
|
|
130
|
-
|
|
131
|
-
<script lang="ts">
|
|
132
|
-
import { ref, type Ref, defineComponent } from 'vue';
|
|
133
|
-
|
|
134
|
-
// Load component
|
|
135
|
-
import CodeMirror from 'vue-codemirror6';
|
|
136
|
-
|
|
137
|
-
// CodeMirror extensions
|
|
138
|
-
import type { LanguageSupport } from '@codemirror/language';
|
|
139
|
-
import { markdown } from '@codemirror/lang-markdown';
|
|
140
|
-
import { basicSetup } from '@codemirror/basic-setup';
|
|
141
|
-
import type { Extension } from '@codemirror/state';
|
|
142
|
-
import type { ViewUpdate } from '@codemirror/view';
|
|
143
|
-
|
|
144
|
-
export default defineComponent({
|
|
145
|
-
components: {
|
|
146
|
-
CodeMirror,
|
|
147
|
-
},
|
|
148
|
-
setup() {
|
|
149
|
-
/** text */
|
|
150
|
-
const value: Ref<string> = ref('');
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* CodeMirror Language
|
|
154
|
-
*
|
|
155
|
-
* @see {@link https://codemirror.net/6/docs/ref/#language | @codemirror/language}
|
|
156
|
-
*/
|
|
157
|
-
const lang: Ref<LanguageSupport> = ref(markdown());
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Internationalization Config.
|
|
161
|
-
* In this example, the display language to Japanese.
|
|
162
|
-
*
|
|
163
|
-
* @see {@link https://codemirror.net/6/examples/translate/ | Example: Internationalization}
|
|
164
|
-
*/
|
|
165
|
-
const phrases: Ref<Record<string, string>> = ref({
|
|
166
|
-
// @codemirror/view
|
|
167
|
-
'Control character': '制御文字',
|
|
168
|
-
// @codemirror/fold
|
|
169
|
-
'Folded lines': '折り畳まれた行',
|
|
170
|
-
'Unfolded lines': '折り畳める行',
|
|
171
|
-
to: '行き先',
|
|
172
|
-
'folded code': '折り畳まれたコード',
|
|
173
|
-
unfold: '折り畳む解除',
|
|
174
|
-
'Fold line': '行を折り畳む',
|
|
175
|
-
'Unfold line': '行の折り畳む解除',
|
|
176
|
-
// @codemirror/search
|
|
177
|
-
'Go to line': '行き先の行',
|
|
178
|
-
go: 'OK',
|
|
179
|
-
Find: '検索',
|
|
180
|
-
Replace: '置き換え',
|
|
181
|
-
next: '▼',
|
|
182
|
-
previous: '▲',
|
|
183
|
-
all: 'すべて',
|
|
184
|
-
'match case': '一致条件',
|
|
185
|
-
regexp: '正規表現',
|
|
186
|
-
replace: '置き換え',
|
|
187
|
-
'replace all': 'すべてを置き換え',
|
|
188
|
-
close: '閉じる',
|
|
189
|
-
'current match': '現在の一致',
|
|
190
|
-
'on line': 'した行',
|
|
191
|
-
// @codemirror/lint
|
|
192
|
-
Diagnostics: 'エラー',
|
|
193
|
-
'No diagnostics': 'エラーなし',
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* CodeMirror Extensions
|
|
198
|
-
*
|
|
199
|
-
* @see {@link:https://codemirror.net/6/docs/ref/#state.Extension | Extending Editor State}
|
|
200
|
-
*/
|
|
201
|
-
const extensions: Ref<Extension[]> = ref([
|
|
202
|
-
/** @see {@link:https://codemirror.net/6/docs/ref/#basic-setup | basic-setup} */
|
|
203
|
-
basicSetup,
|
|
204
|
-
]);
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
value,
|
|
208
|
-
lang,
|
|
209
|
-
phrases,
|
|
210
|
-
extensions,
|
|
211
|
-
};
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
</script>
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## LICENSE
|
|
218
|
-
|
|
219
|
-
[MIT](LICENSE)
|
|
1
|
+
# vue-codemirror6
|
|
2
|
+
|
|
3
|
+
[](https://www.jsdelivr.com/package/npm/vue-codemirror6)
|
|
4
|
+
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
5
|
+
[](https://uiwjs.github.io/npm-unpkg/#/pkg/vue-codemirror6/file/README.md)
|
|
6
|
+
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
7
|
+
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
8
|
+
|
|
9
|
+
A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. Unrelated to [surmon-china's vue-codemirror](https://github.com/surmon-china/vue-codemirror), it is for CodeMirror6.
|
|
10
|
+
|
|
11
|
+
If you are using Vue2, please use `0.1.x`. (The component itself supports both, but the script generated by vue-demi can only output one)
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
This component can handle bidirectional binding by `v-model` like a general Vue component.
|
|
16
|
+
When using with Vue2, [@vue/composition-api](https://www.npmjs.com/package/@vue/composition-api) is required separately.
|
|
17
|
+
|
|
18
|
+
### Props
|
|
19
|
+
|
|
20
|
+
| Props | Type | Information |
|
|
21
|
+
| ---------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| dark | boolean | Toggle Darkmode. If you use Vuetify, I recommend that you enter `$vuetify.theme.dark`. |
|
|
23
|
+
| theme | { [selector: string]: StyleSpec } | Specify the theme. For example, if you use [@codemirror/theme-one-dark](https://github.com/codemirror/theme-one-dark), import `oneDark` and put it in this prop. |
|
|
24
|
+
| readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
|
|
25
|
+
| editable | boolean | When this is set to false, it is similar to `readonly`, except that the cursor is not displayed like the normal pre tag. |
|
|
26
|
+
| lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
|
|
27
|
+
| phrases | Record<string, string> | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
|
|
28
|
+
| extensions | Extension[] | Includes enhancements to extend CodeMirror. Such as [@codemirror/basic-setup](https://github.com/codemirror/basic-setup). |
|
|
29
|
+
| linter | Diagnostic[] | Set Linter. see example <https://codesandbox.io/s/f6nb0?file=/src/index.js> |
|
|
30
|
+
|
|
31
|
+
Notice: `lang` and `linter` can also be set together in `extensions`. This is defined for usability compatibility with past CodeMirrors.
|
|
32
|
+
|
|
33
|
+
### Supported Languages
|
|
34
|
+
|
|
35
|
+
- [`@codemirror/lang-cpp`](https://www.npmjs.com/package/@codemirror/lang-cpp)
|
|
36
|
+
- [`@codemirror/lang-html`](https://www.npmjs.com/package/@codemirror/lang-html)
|
|
37
|
+
- [`@codemirror/lang-java`](https://www.npmjs.com/package/@codemirror/lang-java)
|
|
38
|
+
- [`@codemirror/lang-javascript`](https://www.npmjs.com/package/@codemirror/lang-javascript)
|
|
39
|
+
- [`@codemirror/lang-json`](https://www.npmjs.com/package/@codemirror/lang-json)
|
|
40
|
+
- [`@codemirror/lang-lezer`](https://www.npmjs.com/package/@codemirror/lang-lezer)
|
|
41
|
+
- [`@codemirror/lang-markdown`](https://www.npmjs.com/package/@codemirror/lang-markdown)
|
|
42
|
+
- [`@codemirror/lang-php`](https://www.npmjs.com/package/@codemirror/lang-php)
|
|
43
|
+
- [`@codemirror/lang-python`](https://www.npmjs.com/package/@codemirror/lang-python)
|
|
44
|
+
- [`@codemirror/lang-rust`](https://www.npmjs.com/package/@codemirror/lang-rust)
|
|
45
|
+
- [`@codemirror/lang-sql`](https://www.npmjs.com/package/@codemirror/lang-sql)
|
|
46
|
+
- [`@codemirror/lang-xml`](https://www.npmjs.com/package/@codemirror/lang-xml)
|
|
47
|
+
|
|
48
|
+
### Supported Themes
|
|
49
|
+
|
|
50
|
+
- [`@codemirror/theme-one-dark`](https://github.com/codemirror/theme-one-dark)
|
|
51
|
+
- [`upleveled/theme-vs-code-dark-plus`](https://github.com/upleveled/theme-vs-code-dark-plus)
|
|
52
|
+
|
|
53
|
+
## Example
|
|
54
|
+
|
|
55
|
+
Mark up as follows to make it work at a minimum.
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<template>
|
|
59
|
+
<code-mirror v-model="value" />
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
import { ref, defineComponent } from 'vue';
|
|
64
|
+
|
|
65
|
+
import CodeMirror from 'vue-codemirror6';
|
|
66
|
+
|
|
67
|
+
export default defineComponent({
|
|
68
|
+
components: {
|
|
69
|
+
CodeMirror,
|
|
70
|
+
},
|
|
71
|
+
setup() {
|
|
72
|
+
const value = ref('Cozy lummox gives smart squid who asks for job pen.');
|
|
73
|
+
|
|
74
|
+
return { value };
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
</script>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Example using Slots
|
|
81
|
+
|
|
82
|
+
The contents of the slot will overwrite the existing `v-model`. For this reason, it is recommended to use it when simply displaying with a `readonly` prop without using `v-model`.
|
|
83
|
+
|
|
84
|
+
Also, insert a `<pre>` tag to prevent the text in the slot from being automatically formatted.
|
|
85
|
+
|
|
86
|
+
```vue
|
|
87
|
+
<template>
|
|
88
|
+
<code-mirror :lang="lang" :editable="false">
|
|
89
|
+
<pre>
|
|
90
|
+
{
|
|
91
|
+
"key": "value"
|
|
92
|
+
}</pre
|
|
93
|
+
>
|
|
94
|
+
</code-mirror>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<script>
|
|
98
|
+
import { ref, defineComponent } from 'vue';
|
|
99
|
+
|
|
100
|
+
import { json } from '@codemirror/lang-json';
|
|
101
|
+
|
|
102
|
+
import CodeMirror from 'vue-codemirror6';
|
|
103
|
+
|
|
104
|
+
export default defineComponent({
|
|
105
|
+
components: {
|
|
106
|
+
CodeMirror,
|
|
107
|
+
},
|
|
108
|
+
setup() {
|
|
109
|
+
const lang = ref(json());
|
|
110
|
+
return { lang };
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Full Example
|
|
117
|
+
|
|
118
|
+
When using as a Markdown editor on [Vuetify](https://vuetifyjs.com/).
|
|
119
|
+
|
|
120
|
+
```vue
|
|
121
|
+
<template>
|
|
122
|
+
<code-mirror
|
|
123
|
+
v-model="value"
|
|
124
|
+
:lang="lang"
|
|
125
|
+
:phrases="phreses"
|
|
126
|
+
:extensions="extensions"
|
|
127
|
+
:dark="$vuetify.theme.dark"
|
|
128
|
+
/>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<script lang="ts">
|
|
132
|
+
import { ref, type Ref, defineComponent } from 'vue';
|
|
133
|
+
|
|
134
|
+
// Load component
|
|
135
|
+
import CodeMirror from 'vue-codemirror6';
|
|
136
|
+
|
|
137
|
+
// CodeMirror extensions
|
|
138
|
+
import type { LanguageSupport } from '@codemirror/language';
|
|
139
|
+
import { markdown } from '@codemirror/lang-markdown';
|
|
140
|
+
import { basicSetup } from '@codemirror/basic-setup';
|
|
141
|
+
import type { Extension } from '@codemirror/state';
|
|
142
|
+
import type { ViewUpdate } from '@codemirror/view';
|
|
143
|
+
|
|
144
|
+
export default defineComponent({
|
|
145
|
+
components: {
|
|
146
|
+
CodeMirror,
|
|
147
|
+
},
|
|
148
|
+
setup() {
|
|
149
|
+
/** text */
|
|
150
|
+
const value: Ref<string> = ref('');
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* CodeMirror Language
|
|
154
|
+
*
|
|
155
|
+
* @see {@link https://codemirror.net/6/docs/ref/#language | @codemirror/language}
|
|
156
|
+
*/
|
|
157
|
+
const lang: Ref<LanguageSupport> = ref(markdown());
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Internationalization Config.
|
|
161
|
+
* In this example, the display language to Japanese.
|
|
162
|
+
*
|
|
163
|
+
* @see {@link https://codemirror.net/6/examples/translate/ | Example: Internationalization}
|
|
164
|
+
*/
|
|
165
|
+
const phrases: Ref<Record<string, string>> = ref({
|
|
166
|
+
// @codemirror/view
|
|
167
|
+
'Control character': '制御文字',
|
|
168
|
+
// @codemirror/fold
|
|
169
|
+
'Folded lines': '折り畳まれた行',
|
|
170
|
+
'Unfolded lines': '折り畳める行',
|
|
171
|
+
to: '行き先',
|
|
172
|
+
'folded code': '折り畳まれたコード',
|
|
173
|
+
unfold: '折り畳む解除',
|
|
174
|
+
'Fold line': '行を折り畳む',
|
|
175
|
+
'Unfold line': '行の折り畳む解除',
|
|
176
|
+
// @codemirror/search
|
|
177
|
+
'Go to line': '行き先の行',
|
|
178
|
+
go: 'OK',
|
|
179
|
+
Find: '検索',
|
|
180
|
+
Replace: '置き換え',
|
|
181
|
+
next: '▼',
|
|
182
|
+
previous: '▲',
|
|
183
|
+
all: 'すべて',
|
|
184
|
+
'match case': '一致条件',
|
|
185
|
+
regexp: '正規表現',
|
|
186
|
+
replace: '置き換え',
|
|
187
|
+
'replace all': 'すべてを置き換え',
|
|
188
|
+
close: '閉じる',
|
|
189
|
+
'current match': '現在の一致',
|
|
190
|
+
'on line': 'した行',
|
|
191
|
+
// @codemirror/lint
|
|
192
|
+
Diagnostics: 'エラー',
|
|
193
|
+
'No diagnostics': 'エラーなし',
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* CodeMirror Extensions
|
|
198
|
+
*
|
|
199
|
+
* @see {@link:https://codemirror.net/6/docs/ref/#state.Extension | Extending Editor State}
|
|
200
|
+
*/
|
|
201
|
+
const extensions: Ref<Extension[]> = ref([
|
|
202
|
+
/** @see {@link:https://codemirror.net/6/docs/ref/#basic-setup | basic-setup} */
|
|
203
|
+
basicSetup,
|
|
204
|
+
]);
|
|
205
|
+
|
|
206
|
+
return {
|
|
207
|
+
value,
|
|
208
|
+
lang,
|
|
209
|
+
phrases,
|
|
210
|
+
extensions,
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
</script>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## LICENSE
|
|
218
|
+
|
|
219
|
+
[MIT](LICENSE)
|
|
@@ -159,12 +159,12 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
159
159
|
default: undefined;
|
|
160
160
|
};
|
|
161
161
|
}>>, {
|
|
162
|
+
readonly: boolean;
|
|
162
163
|
modelValue: string;
|
|
163
164
|
theme: {
|
|
164
165
|
[selector: string]: StyleSpec;
|
|
165
166
|
};
|
|
166
167
|
dark: boolean;
|
|
167
|
-
readonly: boolean;
|
|
168
168
|
editable: boolean;
|
|
169
169
|
extensions: Extension[];
|
|
170
170
|
phrases: Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "vue-codemirror6",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"description": "CodeMirror6 Component for vue3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vuejs",
|
|
@@ -56,9 +56,10 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"dev": "vite",
|
|
58
58
|
"clean": "rimraf node_modules/.vite",
|
|
59
|
-
"build": "vite build & vue-tsc",
|
|
59
|
+
"build": "vite build & vue-tsc --declaration --emitDeclarationOnly",
|
|
60
60
|
"build:clean": "rimraf dist",
|
|
61
61
|
"lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . --write",
|
|
62
|
+
"lint:markup": "vue-tsc --noEmit",
|
|
62
63
|
"switch:2": "vue-demi-switch 2 & npx vue-demi-fix",
|
|
63
64
|
"switch:3": "vue-demi-switch 3 vue3 & npx vue-demi-fix",
|
|
64
65
|
"prepare": "husky install",
|
|
@@ -68,10 +69,10 @@
|
|
|
68
69
|
"vue-demi": "latest"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
|
-
"@codemirror/state": "
|
|
72
|
-
"@codemirror/view": "
|
|
73
|
-
"@vue/composition-api": "
|
|
74
|
-
"vue": "^2.6.14 || ^3.2.
|
|
72
|
+
"@codemirror/state": "latest",
|
|
73
|
+
"@codemirror/view": "latest",
|
|
74
|
+
"@vue/composition-api": "latest",
|
|
75
|
+
"vue": "^2.6.14 || ^3.2.33"
|
|
75
76
|
},
|
|
76
77
|
"peerDependenciesMeta": {
|
|
77
78
|
"@vue/composition-api": {
|
|
@@ -79,18 +80,18 @@
|
|
|
79
80
|
}
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@codemirror/basic-setup": "^0.
|
|
83
|
-
"@codemirror/lang-markdown": "^0.
|
|
84
|
-
"@codemirror/language": "^0.
|
|
85
|
-
"@codemirror/lint": "^0.
|
|
86
|
-
"@modyqyw/vite-plugin-eslint": "^1.
|
|
87
|
-
"@types/lodash": "^4.14.
|
|
88
|
-
"@types/node": "^17.0.
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
90
|
-
"@typescript-eslint/parser": "^5.
|
|
83
|
+
"@codemirror/basic-setup": "^0.20.0",
|
|
84
|
+
"@codemirror/lang-markdown": "^0.20.0",
|
|
85
|
+
"@codemirror/language": "^0.20.0",
|
|
86
|
+
"@codemirror/lint": "^0.20.1",
|
|
87
|
+
"@modyqyw/vite-plugin-eslint": "^1.3.0",
|
|
88
|
+
"@types/lodash": "^4.14.182",
|
|
89
|
+
"@types/node": "^17.0.27",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
91
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
91
92
|
"@vitejs/plugin-vue": "^2.3.1",
|
|
92
93
|
"@vue/eslint-config-typescript": "^10.0.0",
|
|
93
|
-
"eslint": "^8.
|
|
94
|
+
"eslint": "^8.14.0",
|
|
94
95
|
"eslint-config-google": "^0.14.0",
|
|
95
96
|
"eslint-config-prettier": "^8.5.0",
|
|
96
97
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
@@ -98,23 +99,23 @@
|
|
|
98
99
|
"eslint-plugin-import": "^2.26.0",
|
|
99
100
|
"eslint-plugin-prettier": "^4.0.0",
|
|
100
101
|
"eslint-plugin-prettier-vue": "^3.1.0",
|
|
101
|
-
"eslint-plugin-tsdoc": "^0.2.
|
|
102
|
-
"eslint-plugin-vue": "^8.
|
|
102
|
+
"eslint-plugin-tsdoc": "^0.2.16",
|
|
103
|
+
"eslint-plugin-vue": "^8.7.1",
|
|
103
104
|
"eslint-plugin-vuejs-accessibility": "^1.1.1",
|
|
104
105
|
"husky": "^7.0.4",
|
|
105
|
-
"lint-staged": "^12.
|
|
106
|
+
"lint-staged": "^12.4.0",
|
|
106
107
|
"lodash": "^4.17.21",
|
|
107
108
|
"prettier": "^2.6.2",
|
|
108
|
-
"prettier-plugin-jsdoc": "^0.3.
|
|
109
|
+
"prettier-plugin-jsdoc": "^0.3.38",
|
|
109
110
|
"prettier-plugin-md-nocjsp": "^1.2.0",
|
|
110
111
|
"prettier-plugin-sort-imports": "^1.6.0",
|
|
111
112
|
"rimraf": "^3.0.2",
|
|
112
113
|
"typescript": "^4.6.3",
|
|
113
|
-
"vite": "^2.9.
|
|
114
|
-
"vue": "^3.2.
|
|
114
|
+
"vite": "^2.9.5",
|
|
115
|
+
"vue": "^3.2.33",
|
|
115
116
|
"vue-eslint-parser": "^8.3.0",
|
|
116
117
|
"vue-template-compiler": "^2.6.14",
|
|
117
|
-
"vue-tsc": "^0.
|
|
118
|
+
"vue-tsc": "^0.34.10"
|
|
118
119
|
},
|
|
119
120
|
"husky": {
|
|
120
121
|
"hooks": {
|