vue-codemirror6 1.6.1 → 1.6.2
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.ja.md +60 -67
- package/README.md +60 -67
- package/dist/index.d.ts +770 -719
- package/dist/index.es.js +17 -22
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +9 -498
- package/package.json +50 -64
- package/CHANGELOG.md +0 -332
- package/dist/index.cjs +0 -461
- package/dist/index.cjs.map +0 -1
- package/dist/index.umd.js.map +0 -1
package/README.ja.md
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
<img src="https://user-images.githubusercontent.com/480173/224358008-6ffad05d-1d97-4c18-8554-7d41b03f88ab.png" alt="logo" width="300" height="300" />
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
11
|
-
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
14
|
-
[](https://www.npmjs.com/package/@logue/vue-codemirror6)
|
|
10
|
+
[](https://www.npmjs.com/package/@logue/vue-codemirror6)
|
|
11
|
+
[](https://www.jsdelivr.com/package/npm/@logue/vue-codemirror6)
|
|
12
|
+
[](https://uiwjs.github.io/npm-unpkg/#/pkg/@logue/vue-codemirror6/file/README.md)
|
|
13
|
+
[](https://gitpod.io/#https://github.com/logue/@logue/vue-codemirror6)
|
|
14
|
+
[](https://x.com/logue256)
|
|
15
|
+
[](https://github.com/sponsors/logue)
|
|
15
16
|
|
|
16
17
|
Vueで[CodeMirror6](https://codemirror.net/6/)を使用するためのコンポーネントです。このコンポーネントはVue2とVue3の両方で動作します。
|
|
17
18
|
|
|
@@ -152,16 +153,16 @@ pnpm install vue-codemirror6 @vue/composition-api
|
|
|
152
153
|
</template>
|
|
153
154
|
|
|
154
155
|
<script>
|
|
155
|
-
import { ref, defineComponent } from
|
|
156
|
+
import { ref, defineComponent } from "vue";
|
|
156
157
|
|
|
157
|
-
import CodeMirror from
|
|
158
|
+
import CodeMirror from "vue-codemirror6";
|
|
158
159
|
|
|
159
160
|
export default defineComponent({
|
|
160
161
|
components: {
|
|
161
162
|
CodeMirror,
|
|
162
163
|
},
|
|
163
164
|
setup() {
|
|
164
|
-
const value = ref(
|
|
165
|
+
const value = ref("Cozy lummox gives smart squid who asks for job pen.");
|
|
165
166
|
|
|
166
167
|
return { value };
|
|
167
168
|
},
|
|
@@ -186,11 +187,11 @@ export default defineComponent({
|
|
|
186
187
|
</template>
|
|
187
188
|
|
|
188
189
|
<script>
|
|
189
|
-
import { ref, defineComponent } from
|
|
190
|
+
import { ref, defineComponent } from "vue";
|
|
190
191
|
|
|
191
|
-
import { json, jsonParseLinter } from
|
|
192
|
+
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
192
193
|
|
|
193
|
-
import CodeMirror from
|
|
194
|
+
import CodeMirror from "vue-codemirror6";
|
|
194
195
|
|
|
195
196
|
export default defineComponent({
|
|
196
197
|
components: {
|
|
@@ -217,9 +218,9 @@ Nuxt 3を使用している場合は、コンポーネントを直接使用で
|
|
|
217
218
|
</template>
|
|
218
219
|
|
|
219
220
|
<script setup lang="ts">
|
|
220
|
-
import { ref } from
|
|
221
|
-
import CodeMirror from
|
|
222
|
-
import { javascript } from
|
|
221
|
+
import { ref } from "vue";
|
|
222
|
+
import CodeMirror from "vue-codemirror6";
|
|
223
|
+
import { javascript } from "@codemirror/lang-javascript";
|
|
223
224
|
|
|
224
225
|
const value = ref('console.log("Hello, World!");');
|
|
225
226
|
const lang = javascript();
|
|
@@ -242,23 +243,23 @@ Nuxt 2を使用している場合や問題が発生した場合は、コンポ
|
|
|
242
243
|
|
|
243
244
|
```vue
|
|
244
245
|
<script lang="ts" setup>
|
|
245
|
-
import { ref, defineComponent, type Ref } from
|
|
246
|
+
import { ref, defineComponent, type Ref } from "vue";
|
|
246
247
|
|
|
247
248
|
// コンポーネントの読み込み
|
|
248
|
-
import CodeMirror from
|
|
249
|
+
import CodeMirror from "vue-codemirror6";
|
|
249
250
|
|
|
250
251
|
// CodeMirror拡張機能
|
|
251
|
-
import { markdown as md } from
|
|
252
|
-
import type { LanguageSupport } from
|
|
253
|
-
import type { Extension } from
|
|
254
|
-
import type { ViewUpdate } from
|
|
252
|
+
import { markdown as md } from "@codemirror/lang-markdown";
|
|
253
|
+
import type { LanguageSupport } from "@codemirror/language";
|
|
254
|
+
import type { Extension } from "@codemirror/state";
|
|
255
|
+
import type { ViewUpdate } from "@codemirror/view";
|
|
255
256
|
|
|
256
257
|
/** テキスト */
|
|
257
|
-
const value: Ref<string> = ref(
|
|
258
|
+
const value: Ref<string> = ref("");
|
|
258
259
|
|
|
259
260
|
/** ダークモード **/
|
|
260
261
|
const dark: Ref<boolean> = ref(
|
|
261
|
-
window.matchMedia(
|
|
262
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches,
|
|
262
263
|
);
|
|
263
264
|
|
|
264
265
|
/**
|
|
@@ -277,40 +278,40 @@ const lang: LanguageSupport = md();
|
|
|
277
278
|
*/
|
|
278
279
|
const phrases: Record<string, string> = {
|
|
279
280
|
// @codemirror/view
|
|
280
|
-
|
|
281
|
+
"Control character": "制御文字",
|
|
281
282
|
// @codemirror/commands
|
|
282
|
-
|
|
283
|
+
"Selection deleted": "選択を削除",
|
|
283
284
|
// @codemirror/language
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
to:
|
|
287
|
-
|
|
288
|
-
unfold:
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
"Folded lines": "折り畳まれた行",
|
|
286
|
+
"Unfolded lines": "折り畳める行",
|
|
287
|
+
to: "行き先",
|
|
288
|
+
"folded code": "折り畳まれたコード",
|
|
289
|
+
unfold: "折り畳みを解除",
|
|
290
|
+
"Fold line": "行を折り畳む",
|
|
291
|
+
"Unfold line": "行の折り畳む解除",
|
|
291
292
|
// @codemirror/search
|
|
292
|
-
|
|
293
|
-
go:
|
|
294
|
-
Find:
|
|
295
|
-
Replace:
|
|
296
|
-
next:
|
|
297
|
-
previous:
|
|
298
|
-
all:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
regexp:
|
|
302
|
-
replace:
|
|
303
|
-
|
|
304
|
-
close:
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
293
|
+
"Go to line": "行き先の行",
|
|
294
|
+
go: "OK",
|
|
295
|
+
Find: "検索",
|
|
296
|
+
Replace: "置き換え",
|
|
297
|
+
next: "▼",
|
|
298
|
+
previous: "▲",
|
|
299
|
+
all: "すべて",
|
|
300
|
+
"match case": "一致条件",
|
|
301
|
+
"by word": "全文検索",
|
|
302
|
+
regexp: "正規表現",
|
|
303
|
+
replace: "置き換え",
|
|
304
|
+
"replace all": "すべてを置き換え",
|
|
305
|
+
close: "閉じる",
|
|
306
|
+
"current match": "現在の一致",
|
|
307
|
+
"replaced $ matches": "$ 件の一致を置き換え",
|
|
308
|
+
"replaced match on line $": "$ 行の一致を置き換え",
|
|
309
|
+
"on line": "した行",
|
|
309
310
|
// @codemirror/autocomplete
|
|
310
|
-
Completions:
|
|
311
|
+
Completions: "自動補完",
|
|
311
312
|
// @codemirror/lint
|
|
312
|
-
Diagnostics:
|
|
313
|
-
|
|
313
|
+
Diagnostics: "エラー",
|
|
314
|
+
"No diagnostics": "エラーなし",
|
|
314
315
|
};
|
|
315
316
|
</script>
|
|
316
317
|
|
|
@@ -338,8 +339,8 @@ const phrases: Record<string, string> = {
|
|
|
338
339
|
|
|
339
340
|
```vue
|
|
340
341
|
<script setup lang="ts">
|
|
341
|
-
import { ref, onMounted, type Ref, type PropType } from
|
|
342
|
-
import CodeMirror from
|
|
342
|
+
import { ref, onMounted, type Ref, type PropType } from "vue";
|
|
343
|
+
import CodeMirror from "vue-codemirror6";
|
|
343
344
|
|
|
344
345
|
const cm: Ref<InstanceType<typeof CodeMirror> | undefined> = ref();
|
|
345
346
|
|
|
@@ -396,12 +397,12 @@ const config: UserConfig = {
|
|
|
396
397
|
output: {
|
|
397
398
|
manualChunks: {
|
|
398
399
|
// ...
|
|
399
|
-
codemirror: [
|
|
400
|
-
|
|
400
|
+
codemirror: ["vue-codemirror6"],
|
|
401
|
+
"codemirror-lang": [
|
|
401
402
|
// 必要に応じて以下を追加してください。
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
"@codemirror/lang-html",
|
|
404
|
+
"@codemirror/lang-javascript",
|
|
405
|
+
"@codemirror/lang-markdown",
|
|
405
406
|
],
|
|
406
407
|
// ...
|
|
407
408
|
},
|
|
@@ -443,11 +444,3 @@ pnpm test:coverage
|
|
|
443
444
|
|
|
444
445
|
©2022-2026 by Logue.
|
|
445
446
|
[MITライセンス](LICENSE)の下でライセンスされています。
|
|
446
|
-
|
|
447
|
-
## 🎨 開発者のために作られました
|
|
448
|
-
|
|
449
|
-
このライブラリは、**最新の開発者体験**に焦点を当てて構築されています。これを維持するには、すべてがシームレスに動作することを確認するための継続的なテストと更新が必要です。
|
|
450
|
-
|
|
451
|
-
このプロジェクトの細部へのこだわりを評価していただける場合は、Vue.jsとMetaverseエコシステム全体での私の仕事をサポートするために、小額のスポンサーシップをいただければ幸いです。
|
|
452
|
-
|
|
453
|
-
[](https://github.com/sponsors/logue)
|
package/README.md
CHANGED
|
@@ -6,12 +6,13 @@ English | [日本語](README.ja.md)
|
|
|
6
6
|
<img src="https://user-images.githubusercontent.com/480173/224358008-6ffad05d-1d97-4c18-8554-7d41b03f88ab.png" alt="logo" width="300" height="300" />
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
11
|
-
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
14
|
-
[](https://www.npmjs.com/package/@logue/vue-codemirror6)
|
|
10
|
+
[](https://www.npmjs.com/package/@logue/vue-codemirror6)
|
|
11
|
+
[](https://www.jsdelivr.com/package/npm/@logue/vue-codemirror6)
|
|
12
|
+
[](https://uiwjs.github.io/npm-unpkg/#/pkg/@logue/vue-codemirror6/file/README.md)
|
|
13
|
+
[](https://gitpod.io/#https://github.com/logue/@logue/vue-codemirror6)
|
|
14
|
+
[](https://twitter.com/logue256)
|
|
15
|
+
[](https://github.com/sponsors/logue)
|
|
15
16
|
|
|
16
17
|
A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. This component works in both Vue2 and Vue3.
|
|
17
18
|
|
|
@@ -151,16 +152,16 @@ Mark up as follows to make it work at a minimum.
|
|
|
151
152
|
</template>
|
|
152
153
|
|
|
153
154
|
<script>
|
|
154
|
-
import { ref, defineComponent } from
|
|
155
|
+
import { ref, defineComponent } from "vue";
|
|
155
156
|
|
|
156
|
-
import CodeMirror from
|
|
157
|
+
import CodeMirror from "vue-codemirror6";
|
|
157
158
|
|
|
158
159
|
export default defineComponent({
|
|
159
160
|
components: {
|
|
160
161
|
CodeMirror,
|
|
161
162
|
},
|
|
162
163
|
setup() {
|
|
163
|
-
const value = ref(
|
|
164
|
+
const value = ref("Cozy lummox gives smart squid who asks for job pen.");
|
|
164
165
|
|
|
165
166
|
return { value };
|
|
166
167
|
},
|
|
@@ -185,11 +186,11 @@ Also, insert a `<pre>` tag to prevent the text in the slot from being automatica
|
|
|
185
186
|
</template>
|
|
186
187
|
|
|
187
188
|
<script>
|
|
188
|
-
import { ref, defineComponent } from
|
|
189
|
+
import { ref, defineComponent } from "vue";
|
|
189
190
|
|
|
190
|
-
import { json, jsonParseLinter } from
|
|
191
|
+
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
191
192
|
|
|
192
|
-
import CodeMirror from
|
|
193
|
+
import CodeMirror from "vue-codemirror6";
|
|
193
194
|
|
|
194
195
|
export default defineComponent({
|
|
195
196
|
components: {
|
|
@@ -216,9 +217,9 @@ If you're using Nuxt 3, you can use the component directly:
|
|
|
216
217
|
</template>
|
|
217
218
|
|
|
218
219
|
<script setup lang="ts">
|
|
219
|
-
import { ref } from
|
|
220
|
-
import CodeMirror from
|
|
221
|
-
import { javascript } from
|
|
220
|
+
import { ref } from "vue";
|
|
221
|
+
import CodeMirror from "vue-codemirror6";
|
|
222
|
+
import { javascript } from "@codemirror/lang-javascript";
|
|
222
223
|
|
|
223
224
|
const value = ref('console.log("Hello, World!");');
|
|
224
225
|
const lang = javascript();
|
|
@@ -241,23 +242,23 @@ When using as a Markdown editor on [vite-vue3-ts-starter](https://github.com/log
|
|
|
241
242
|
|
|
242
243
|
```vue
|
|
243
244
|
<script lang="ts" setup>
|
|
244
|
-
import { ref, defineComponent, type Ref } from
|
|
245
|
+
import { ref, defineComponent, type Ref } from "vue";
|
|
245
246
|
|
|
246
247
|
// Load component
|
|
247
|
-
import CodeMirror from
|
|
248
|
+
import CodeMirror from "vue-codemirror6";
|
|
248
249
|
|
|
249
250
|
// CodeMirror extensions
|
|
250
|
-
import { markdown as md } from
|
|
251
|
-
import type { LanguageSupport } from
|
|
252
|
-
import type { Extension } from
|
|
253
|
-
import type { ViewUpdate } from
|
|
251
|
+
import { markdown as md } from "@codemirror/lang-markdown";
|
|
252
|
+
import type { LanguageSupport } from "@codemirror/language";
|
|
253
|
+
import type { Extension } from "@codemirror/state";
|
|
254
|
+
import type { ViewUpdate } from "@codemirror/view";
|
|
254
255
|
|
|
255
256
|
/** text */
|
|
256
|
-
const value: Ref<string> = ref(
|
|
257
|
+
const value: Ref<string> = ref("");
|
|
257
258
|
|
|
258
259
|
/** Dark mode **/
|
|
259
260
|
const dark: Ref<boolean> = ref(
|
|
260
|
-
window.matchMedia(
|
|
261
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches,
|
|
261
262
|
);
|
|
262
263
|
|
|
263
264
|
/**
|
|
@@ -276,40 +277,40 @@ const lang: LanguageSupport = md();
|
|
|
276
277
|
*/
|
|
277
278
|
const phrases: Record<string, string> = {
|
|
278
279
|
// @codemirror/view
|
|
279
|
-
|
|
280
|
+
"Control character": "制御文字",
|
|
280
281
|
// @codemirror/commands
|
|
281
|
-
|
|
282
|
+
"Selection deleted": "選択を削除",
|
|
282
283
|
// @codemirror/language
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
to:
|
|
286
|
-
|
|
287
|
-
unfold:
|
|
288
|
-
|
|
289
|
-
|
|
284
|
+
"Folded lines": "折り畳まれた行",
|
|
285
|
+
"Unfolded lines": "折り畳める行",
|
|
286
|
+
to: "行き先",
|
|
287
|
+
"folded code": "折り畳まれたコード",
|
|
288
|
+
unfold: "折り畳みを解除",
|
|
289
|
+
"Fold line": "行を折り畳む",
|
|
290
|
+
"Unfold line": "行の折り畳む解除",
|
|
290
291
|
// @codemirror/search
|
|
291
|
-
|
|
292
|
-
go:
|
|
293
|
-
Find:
|
|
294
|
-
Replace:
|
|
295
|
-
next:
|
|
296
|
-
previous:
|
|
297
|
-
all:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
regexp:
|
|
301
|
-
replace:
|
|
302
|
-
|
|
303
|
-
close:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
292
|
+
"Go to line": "行き先の行",
|
|
293
|
+
go: "OK",
|
|
294
|
+
Find: "検索",
|
|
295
|
+
Replace: "置き換え",
|
|
296
|
+
next: "▼",
|
|
297
|
+
previous: "▲",
|
|
298
|
+
all: "すべて",
|
|
299
|
+
"match case": "一致条件",
|
|
300
|
+
"by word": "全文検索",
|
|
301
|
+
regexp: "正規表現",
|
|
302
|
+
replace: "置き換え",
|
|
303
|
+
"replace all": "すべてを置き換え",
|
|
304
|
+
close: "閉じる",
|
|
305
|
+
"current match": "現在の一致",
|
|
306
|
+
"replaced $ matches": "$ 件の一致を置き換え",
|
|
307
|
+
"replaced match on line $": "$ 行の一致を置き換え",
|
|
308
|
+
"on line": "した行",
|
|
308
309
|
// @codemirror/autocomplete
|
|
309
|
-
Completions:
|
|
310
|
+
Completions: "自動補完",
|
|
310
311
|
// @codemirror/lint
|
|
311
|
-
Diagnostics:
|
|
312
|
-
|
|
312
|
+
Diagnostics: "エラー",
|
|
313
|
+
"No diagnostics": "エラーなし",
|
|
313
314
|
};
|
|
314
315
|
</script>
|
|
315
316
|
|
|
@@ -337,8 +338,8 @@ const phrases: Record<string, string> = {
|
|
|
337
338
|
|
|
338
339
|
```vue
|
|
339
340
|
<script setup lang="ts">
|
|
340
|
-
import { ref, onMounted, type Ref, type PropType } from
|
|
341
|
-
import CodeMirror from
|
|
341
|
+
import { ref, onMounted, type Ref, type PropType } from "vue";
|
|
342
|
+
import CodeMirror from "vue-codemirror6";
|
|
342
343
|
|
|
343
344
|
const cm: Ref<InstanceType<typeof CodeMirror> | undefined> = ref();
|
|
344
345
|
|
|
@@ -395,12 +396,12 @@ const config: UserConfig = {
|
|
|
395
396
|
output: {
|
|
396
397
|
manualChunks: {
|
|
397
398
|
// ...
|
|
398
|
-
codemirror: [
|
|
399
|
-
|
|
399
|
+
codemirror: ["vue-codemirror6"],
|
|
400
|
+
"codemirror-lang": [
|
|
400
401
|
// Add the following as needed.
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
"@codemirror/lang-html",
|
|
403
|
+
"@codemirror/lang-javascript",
|
|
404
|
+
"@codemirror/lang-markdown",
|
|
404
405
|
],
|
|
405
406
|
// ...
|
|
406
407
|
},
|
|
@@ -442,11 +443,3 @@ The test suite includes:
|
|
|
442
443
|
|
|
443
444
|
©2022-2026 by Logue.
|
|
444
445
|
Licensed under the [MIT License](LICENSE).
|
|
445
|
-
|
|
446
|
-
## 🎨 Crafted for Developers
|
|
447
|
-
|
|
448
|
-
This library is built with a focus **modern developer experience**. Maintaining it involves constant testing and updates to ensure everything works seamlessly.
|
|
449
|
-
|
|
450
|
-
If you appreciate the attention to detail in this project, a small sponsorship would go a long way in supporting my work across the Vue.js and Metaverse ecosystems.
|
|
451
|
-
|
|
452
|
-
[](https://github.com/sponsors/logue)
|