nuxt-codemirror 0.0.16 → 0.0.18
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/dist/module.d.mts +2 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/NuxtCodeMirror.d.vue.ts +0 -0
- package/dist/runtime/components/NuxtCodeMirror.vue +77 -73
- package/dist/runtime/components/NuxtCodeMirror.vue.d.ts +0 -0
- package/dist/types.d.mts +3 -1
- package/package.json +28 -30
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/types.d.ts +0 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addComponent, addImports, addTypeTemplate, extendViteConfig } from '@nuxt/kit';
|
|
2
2
|
|
|
3
|
-
const module = defineNuxtModule({
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
4
|
meta: {
|
|
5
5
|
name: "nuxt-codemirror",
|
|
6
6
|
configKey: "nuxtCodemirror"
|
|
@@ -33,4 +33,4 @@ const module = defineNuxtModule({
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
export { module as default };
|
|
36
|
+
export { module$1 as default };
|
|
File without changes
|
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useNuxtCodeMirror } from "../composables/useNuxtCodeMirror";
|
|
3
|
+
import { onMounted, ref, watch, computed, onBeforeUnmount } from "#imports";
|
|
4
|
+
const editor = ref(null);
|
|
5
|
+
const container = ref(null);
|
|
6
|
+
const view = ref();
|
|
7
|
+
const state = ref();
|
|
8
|
+
const modelValue = defineModel({ type: String, ...{ default: "" } });
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
height: { type: String, required: false },
|
|
11
|
+
minHeight: { type: String, required: false },
|
|
12
|
+
maxHeight: { type: String, required: false },
|
|
13
|
+
width: { type: String, required: false },
|
|
14
|
+
minWidth: { type: String, required: false },
|
|
15
|
+
maxWidth: { type: String, required: false },
|
|
16
|
+
autoFocus: { type: Boolean, required: false },
|
|
17
|
+
placeholder: { type: null, required: false },
|
|
18
|
+
theme: { type: [String, Object, Array], required: false, default: "light" },
|
|
19
|
+
basicSetup: { type: Boolean, required: false, skipCheck: true },
|
|
20
|
+
editable: { type: Boolean, required: false },
|
|
21
|
+
readOnly: { type: Boolean, required: false },
|
|
22
|
+
indentWithTab: { type: Boolean, required: false },
|
|
23
|
+
onChange: { type: Function, required: false },
|
|
24
|
+
onStatistics: { type: Function, required: false },
|
|
25
|
+
onUpdate: { type: Function, required: false },
|
|
26
|
+
onCreateEditor: { type: Function, required: false },
|
|
27
|
+
onFocus: { type: Function, required: false },
|
|
28
|
+
onBlur: { type: Function, required: false },
|
|
29
|
+
extensions: { type: Array, required: false, default: () => [] },
|
|
30
|
+
root: { type: null, required: false },
|
|
31
|
+
initialState: { type: Object, required: false },
|
|
32
|
+
selection: { type: Object, required: false }
|
|
33
|
+
});
|
|
34
|
+
defineExpose({
|
|
35
|
+
container,
|
|
36
|
+
view,
|
|
37
|
+
state,
|
|
38
|
+
editor
|
|
39
|
+
});
|
|
40
|
+
const emit = defineEmits(["onChange", "onStatistics", "onCreateEditor", "onUpdate", "onFocus", "onBlur"]);
|
|
41
|
+
onMounted(() => {
|
|
42
|
+
useNuxtCodeMirror({
|
|
43
|
+
...props,
|
|
44
|
+
modelValue,
|
|
45
|
+
onChange: (value, viewUpdate) => {
|
|
46
|
+
modelValue.value = value;
|
|
47
|
+
emit("onChange", value, viewUpdate);
|
|
48
|
+
},
|
|
49
|
+
onStatistics: (data) => emit("onStatistics", data),
|
|
50
|
+
onCreateEditor: (view2, state2) => emit("onCreateEditor", { view: view2, state: state2 }),
|
|
51
|
+
onUpdate: (viewUpdate) => emit("onUpdate", viewUpdate),
|
|
52
|
+
onFocus: (viewUpdate) => emit("onFocus", viewUpdate),
|
|
53
|
+
onBlur: (viewUpdate) => emit("onBlur", viewUpdate),
|
|
54
|
+
container: editor.value,
|
|
55
|
+
viewRef: view,
|
|
56
|
+
stateRef: state,
|
|
57
|
+
containerRef: container
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
onBeforeUnmount(() => {
|
|
61
|
+
if (view.value) {
|
|
62
|
+
view.value?.destroy();
|
|
63
|
+
view.value = void 0;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
watch(() => modelValue, (newValue) => {
|
|
67
|
+
if (typeof newValue !== "string") {
|
|
68
|
+
console.error(`value must be typeof string but got ${typeof newValue}`);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const defaultClassNames = computed(
|
|
72
|
+
() => typeof props.theme === "string" ? `cm-theme-${props.theme}` : "cm-theme"
|
|
73
|
+
);
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
73
77
|
<div
|
|
74
78
|
ref="editor"
|
|
75
79
|
:class="`${defaultClassNames}${$attrs.class ? ` ${$attrs.class}` : ''}`"
|
|
76
80
|
v-bind="$attrs"
|
|
77
81
|
/>
|
|
78
|
-
</template>
|
|
82
|
+
</template>
|
|
File without changes
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-codemirror",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "Nuxt codemirror module",
|
|
5
5
|
"repository": "https://github.com/ThimoDEV/nuxt-codemirror",
|
|
6
6
|
"homepage": "https://github.com/ThimoDEV/nuxt-codemirror#readme",
|
|
@@ -12,13 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"types": "./dist/types.d.
|
|
16
|
-
"import": "./dist/module.mjs"
|
|
17
|
-
"require": "./dist/module.cjs"
|
|
15
|
+
"types": "./dist/types.d.mts",
|
|
16
|
+
"import": "./dist/module.mjs"
|
|
18
17
|
}
|
|
19
18
|
},
|
|
20
|
-
"main": "./dist/module.
|
|
21
|
-
"types": "./dist/types.d.ts",
|
|
19
|
+
"main": "./dist/module.mjs",
|
|
22
20
|
"files": [
|
|
23
21
|
"dist"
|
|
24
22
|
],
|
|
@@ -43,31 +41,31 @@
|
|
|
43
41
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
|
-
"@babel/runtime": "^7.
|
|
47
|
-
"@codemirror/autocomplete": "^6.
|
|
48
|
-
"@codemirror/commands": "^6.
|
|
49
|
-
"@codemirror/language": "^6.
|
|
50
|
-
"@codemirror/lint": "^6.
|
|
51
|
-
"@codemirror/search": "^6.
|
|
52
|
-
"@codemirror/state": "6.5.
|
|
53
|
-
"@codemirror/theme-one-dark": "^6.1.
|
|
54
|
-
"@codemirror/view": "6.
|
|
55
|
-
"@nuxt/kit": "^3.
|
|
44
|
+
"@babel/runtime": "^7.28.6",
|
|
45
|
+
"@codemirror/autocomplete": "^6.20.0",
|
|
46
|
+
"@codemirror/commands": "^6.10.2",
|
|
47
|
+
"@codemirror/language": "^6.12.2",
|
|
48
|
+
"@codemirror/lint": "^6.9.4",
|
|
49
|
+
"@codemirror/search": "^6.6.0",
|
|
50
|
+
"@codemirror/state": "6.5.4",
|
|
51
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
52
|
+
"@codemirror/view": "6.39.15",
|
|
53
|
+
"@nuxt/kit": "^4.3.1"
|
|
56
54
|
},
|
|
57
55
|
"devDependencies": {
|
|
58
|
-
"@nuxt/devtools": "^2.2
|
|
59
|
-
"@nuxt/devtools-ui-kit": "^
|
|
60
|
-
"@nuxt/eslint-config": "^1.2
|
|
61
|
-
"@nuxt/module-builder": "^0.
|
|
62
|
-
"@nuxt/schema": "^3.
|
|
63
|
-
"@nuxt/test-utils": "^
|
|
64
|
-
"@types/node": "^
|
|
65
|
-
"changelogen": "^0.6.
|
|
66
|
-
"eslint": "^
|
|
67
|
-
"nuxt": "^3.
|
|
68
|
-
"typescript": "5.3
|
|
69
|
-
"vitest": "^
|
|
70
|
-
"vue-tsc": "2.
|
|
56
|
+
"@nuxt/devtools": "^3.2.2",
|
|
57
|
+
"@nuxt/devtools-ui-kit": "^3.2.2",
|
|
58
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
59
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
60
|
+
"@nuxt/schema": "^4.3.1",
|
|
61
|
+
"@nuxt/test-utils": "^4.0.0",
|
|
62
|
+
"@types/node": "^25.3.2",
|
|
63
|
+
"changelogen": "^0.6.2",
|
|
64
|
+
"eslint": "^10.0.2",
|
|
65
|
+
"nuxt": "^4.3.1",
|
|
66
|
+
"typescript": "5.9.3",
|
|
67
|
+
"vitest": "^4.0.18",
|
|
68
|
+
"vue-tsc": "3.2.5"
|
|
71
69
|
},
|
|
72
70
|
"resolutions": {
|
|
73
71
|
"vue-tsc": "2.2.2"
|
|
@@ -78,4 +76,4 @@
|
|
|
78
76
|
"vue"
|
|
79
77
|
],
|
|
80
78
|
"packageManager": "pnpm@10.6.5"
|
|
81
|
-
}
|
|
79
|
+
}
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
devtools?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
|
|
7
|
-
|
|
8
|
-
export { type ModuleOptions, _default as default };
|
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|