vue-codemirror6 0.6.2 → 0.6.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/dist/components/CodeMirror.d.ts +290 -0
- package/dist/components/CodeMirror.d.ts.map +1 -0
- package/dist/helpers/h-demi.d.ts +15 -0
- package/dist/helpers/h-demi.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/stats.html +0 -2689
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { type PropType, type Ref, type SetupContext } from 'vue-demi';
|
|
2
|
+
import { EditorSelection } from '@codemirror/state';
|
|
3
|
+
import type { Extension, SelectionRange, Text } from '@codemirror/state';
|
|
4
|
+
import type { LanguageSupport } from '@codemirror/language';
|
|
5
|
+
import type { ViewUpdate } from '@codemirror/view';
|
|
6
|
+
import type { LintSource } from '@codemirror/lint';
|
|
7
|
+
import type { StyleSpec } from 'style-mod';
|
|
8
|
+
/** Emit Interface */
|
|
9
|
+
export interface CodeMirrorEmitsInterface {
|
|
10
|
+
/** Model Update */
|
|
11
|
+
(e: 'update:modelValue', value: string | Text): void;
|
|
12
|
+
/** CodeMirror ViewUpdate */
|
|
13
|
+
(e: 'update', value: ViewUpdate): void;
|
|
14
|
+
}
|
|
15
|
+
/** CodeMirror Component */
|
|
16
|
+
declare const _default: import("vue-demi").DefineComponent<{
|
|
17
|
+
/** Model value */
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: PropType<string | Text>;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Theme
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://codemirror.net/6/examples/styling/ | Example: Styling}
|
|
26
|
+
*/
|
|
27
|
+
theme: {
|
|
28
|
+
type: PropType<{
|
|
29
|
+
[selector: string]: StyleSpec;
|
|
30
|
+
}>;
|
|
31
|
+
default: () => {};
|
|
32
|
+
};
|
|
33
|
+
/** Dark Mode */
|
|
34
|
+
dark: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Use Basic Setup
|
|
40
|
+
*
|
|
41
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup | basicSetup}
|
|
42
|
+
*/
|
|
43
|
+
basic: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Use Minimal Setup (The basic setting has priority.)
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup | minimalSetup}
|
|
51
|
+
*/
|
|
52
|
+
minimal: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Line wrapping
|
|
58
|
+
*
|
|
59
|
+
* @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5ElineWrapping | LineWrapping}
|
|
60
|
+
*/
|
|
61
|
+
wrap: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Tab handling
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://codemirror.net/6/examples/tab/ | Tab Handling}
|
|
69
|
+
*/
|
|
70
|
+
tab: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Readonly
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://codemirror.net/6/docs/ref/#state.EditorState%5EreadOnly | readOnly}
|
|
78
|
+
*/
|
|
79
|
+
readonly: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Editable
|
|
85
|
+
*
|
|
86
|
+
* @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable | editable}
|
|
87
|
+
*/
|
|
88
|
+
editable: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Additional Extension
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://codemirror.net/6/docs/ref/#state.Extension | Extending Editor State}
|
|
96
|
+
*/
|
|
97
|
+
extensions: {
|
|
98
|
+
type: PropType<Extension[]>;
|
|
99
|
+
default: () => never[];
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Language Phreses
|
|
103
|
+
*
|
|
104
|
+
* @see {@link https://codemirror.net/6/examples/translate/ | Example: Internationalization}
|
|
105
|
+
*/
|
|
106
|
+
phrases: {
|
|
107
|
+
type: PropType<Record<string, string>>;
|
|
108
|
+
default: () => undefined;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* CodeMirror Language
|
|
112
|
+
*
|
|
113
|
+
* @see {@link https://codemirror.net/6/docs/ref/#language | @codemirror/language}
|
|
114
|
+
*/
|
|
115
|
+
lang: {
|
|
116
|
+
type: PropType<LanguageSupport>;
|
|
117
|
+
default: () => undefined;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* CodeMirror Linter
|
|
121
|
+
*
|
|
122
|
+
* @see {@link https://codemirror.net/6/docs/ref/#lint | @codemirror/lint}
|
|
123
|
+
*/
|
|
124
|
+
linter: {
|
|
125
|
+
type: PropType<LintSource>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
/** Show Gutter */
|
|
129
|
+
lintGutter: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
defalt: boolean;
|
|
132
|
+
};
|
|
133
|
+
}, {
|
|
134
|
+
context: SetupContext<import("vue-demi").EmitsOptions>;
|
|
135
|
+
editor: Ref<Element | undefined>;
|
|
136
|
+
cursor: Ref<number>;
|
|
137
|
+
selection: () => EditorSelection;
|
|
138
|
+
getRange: (from?: number, to?: number) => string;
|
|
139
|
+
getLine: (number: number) => string;
|
|
140
|
+
lineCount: () => number;
|
|
141
|
+
getCursor: () => number;
|
|
142
|
+
listSelections: () => readonly SelectionRange[];
|
|
143
|
+
getSelection: () => string;
|
|
144
|
+
getSelections: () => string[];
|
|
145
|
+
somethingSelected: () => boolean;
|
|
146
|
+
replaceRange: (replacement: string | Text, from: number, to: number) => void;
|
|
147
|
+
replaceSelection: (replacement: string | Text) => void;
|
|
148
|
+
setCursor: (position: number) => number;
|
|
149
|
+
setSelection: (anchor: number, head?: number) => void;
|
|
150
|
+
setSelections: (ranges: readonly SelectionRange[], primary?: number) => void;
|
|
151
|
+
extendSelectionsBy: (f: Function) => void;
|
|
152
|
+
focus: () => void;
|
|
153
|
+
hasFocus: () => boolean;
|
|
154
|
+
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, import("vue-demi").EmitsOptions, "update:modelValue" | "update", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
155
|
+
/** Model value */
|
|
156
|
+
modelValue: {
|
|
157
|
+
type: PropType<string | Text>;
|
|
158
|
+
default: string;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Theme
|
|
162
|
+
*
|
|
163
|
+
* @see {@link https://codemirror.net/6/examples/styling/ | Example: Styling}
|
|
164
|
+
*/
|
|
165
|
+
theme: {
|
|
166
|
+
type: PropType<{
|
|
167
|
+
[selector: string]: StyleSpec;
|
|
168
|
+
}>;
|
|
169
|
+
default: () => {};
|
|
170
|
+
};
|
|
171
|
+
/** Dark Mode */
|
|
172
|
+
dark: {
|
|
173
|
+
type: BooleanConstructor;
|
|
174
|
+
default: boolean;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Use Basic Setup
|
|
178
|
+
*
|
|
179
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.basicSetup | basicSetup}
|
|
180
|
+
*/
|
|
181
|
+
basic: {
|
|
182
|
+
type: BooleanConstructor;
|
|
183
|
+
default: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Use Minimal Setup (The basic setting has priority.)
|
|
187
|
+
*
|
|
188
|
+
* @see {@link https://codemirror.net/docs/ref/#codemirror.minimalSetup | minimalSetup}
|
|
189
|
+
*/
|
|
190
|
+
minimal: {
|
|
191
|
+
type: BooleanConstructor;
|
|
192
|
+
default: boolean;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Line wrapping
|
|
196
|
+
*
|
|
197
|
+
* @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5ElineWrapping | LineWrapping}
|
|
198
|
+
*/
|
|
199
|
+
wrap: {
|
|
200
|
+
type: BooleanConstructor;
|
|
201
|
+
default: boolean;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Tab handling
|
|
205
|
+
*
|
|
206
|
+
* @see {@link https://codemirror.net/6/examples/tab/ | Tab Handling}
|
|
207
|
+
*/
|
|
208
|
+
tab: {
|
|
209
|
+
type: BooleanConstructor;
|
|
210
|
+
default: boolean;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Readonly
|
|
214
|
+
*
|
|
215
|
+
* @see {@link https://codemirror.net/6/docs/ref/#state.EditorState%5EreadOnly | readOnly}
|
|
216
|
+
*/
|
|
217
|
+
readonly: {
|
|
218
|
+
type: BooleanConstructor;
|
|
219
|
+
default: boolean;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Editable
|
|
223
|
+
*
|
|
224
|
+
* @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable | editable}
|
|
225
|
+
*/
|
|
226
|
+
editable: {
|
|
227
|
+
type: BooleanConstructor;
|
|
228
|
+
default: boolean;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Additional Extension
|
|
232
|
+
*
|
|
233
|
+
* @see {@link https://codemirror.net/6/docs/ref/#state.Extension | Extending Editor State}
|
|
234
|
+
*/
|
|
235
|
+
extensions: {
|
|
236
|
+
type: PropType<Extension[]>;
|
|
237
|
+
default: () => never[];
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Language Phreses
|
|
241
|
+
*
|
|
242
|
+
* @see {@link https://codemirror.net/6/examples/translate/ | Example: Internationalization}
|
|
243
|
+
*/
|
|
244
|
+
phrases: {
|
|
245
|
+
type: PropType<Record<string, string>>;
|
|
246
|
+
default: () => undefined;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* CodeMirror Language
|
|
250
|
+
*
|
|
251
|
+
* @see {@link https://codemirror.net/6/docs/ref/#language | @codemirror/language}
|
|
252
|
+
*/
|
|
253
|
+
lang: {
|
|
254
|
+
type: PropType<LanguageSupport>;
|
|
255
|
+
default: () => undefined;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* CodeMirror Linter
|
|
259
|
+
*
|
|
260
|
+
* @see {@link https://codemirror.net/6/docs/ref/#lint | @codemirror/lint}
|
|
261
|
+
*/
|
|
262
|
+
linter: {
|
|
263
|
+
type: PropType<LintSource>;
|
|
264
|
+
default: undefined;
|
|
265
|
+
};
|
|
266
|
+
/** Show Gutter */
|
|
267
|
+
lintGutter: {
|
|
268
|
+
type: BooleanConstructor;
|
|
269
|
+
defalt: boolean;
|
|
270
|
+
};
|
|
271
|
+
}>>, {
|
|
272
|
+
modelValue: string | Text;
|
|
273
|
+
theme: {
|
|
274
|
+
[selector: string]: StyleSpec;
|
|
275
|
+
};
|
|
276
|
+
dark: boolean;
|
|
277
|
+
basic: boolean;
|
|
278
|
+
minimal: boolean;
|
|
279
|
+
wrap: boolean;
|
|
280
|
+
tab: boolean;
|
|
281
|
+
readonly: boolean;
|
|
282
|
+
editable: boolean;
|
|
283
|
+
extensions: Extension[];
|
|
284
|
+
phrases: Record<string, string>;
|
|
285
|
+
lang: LanguageSupport;
|
|
286
|
+
linter: LintSource;
|
|
287
|
+
lintGutter: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
export default _default;
|
|
290
|
+
//# sourceMappingURL=CodeMirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeMirror.d.ts","sourceRoot":"","sources":["../../src/components/CodeMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAA4B,MAAM,mBAAmB,CAAC;AAU9E,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,IAAI,EAEL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,qBAAqB;AACrB,MAAM,WAAW,wBAAwB;IACvC,mBAAmB;IACnB,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD,4BAA4B;IAC5B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC;AAED,2BAA2B;;IAWvB,kBAAkB;;;;;IAKlB;;;;OAIG;;;;;;;IAOH,gBAAgB;;;;;IAKhB;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH,kBAAkB;;;;;;;;;qBA6II,eAAe;sBAUZ,MAAM,OAAO,MAAM,KAAG,MAAM;sBAO5B,MAAM,KAAG,MAAM;qBAGlB,MAAM;qBAEN,MAAM;0BAED,SAAS,cAAc,EAAE;wBAE3B,MAAM;yBAML,MAAM,EAAE;6BAGJ,OAAO;gCAWtB,MAAM,GAAG,IAAI,QACpB,MAAM,MACR,MAAM;oCAW2B,MAAM,GAAG,IAAI;0BAOvB,MAAM;2BAOL,MAAM,SAAS,MAAM;4BASzC,SAAS,cAAc,EAAE,YACvB,MAAM;4BAUa,QAAQ;;oBAUlB,OAAO;;IArW5B,kBAAkB;;;;;IAKlB;;;;OAIG;;;;;;;IAOH,gBAAgB;;;;;IAKhB;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH;;;;OAIG;;;;;IAKH,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;AA3HtB,wBA8ZG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Options {
|
|
2
|
+
class?: string;
|
|
3
|
+
domProps?: Record<any, any>;
|
|
4
|
+
on?: Record<any, any>;
|
|
5
|
+
props?: Record<any, any>;
|
|
6
|
+
ref?: string;
|
|
7
|
+
style?: string;
|
|
8
|
+
'aria-hidden'?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const h: (type: string | Record<any, any>, options?: Options, chidren?: any) => import("vue-demi").VNode<import("vue-demi").RendererNode, import("vue-demi").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>;
|
|
13
|
+
declare const slot: (defaultSlots: any) => any;
|
|
14
|
+
export { slot, h as default };
|
|
15
|
+
//# sourceMappingURL=h-demi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h-demi.d.ts","sourceRoot":"","sources":["../../src/helpers/h-demi.ts"],"names":[],"mappings":"AAEA,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD,QAAA,MAAM,CAAC,SACC,MAAM,GAAG,OAAO,GAAG,EAAE,GAAG,CAAC,YACtB,OAAO,YACN,GAAG;;EAWd,CAAC;AAEF,QAAA,MAAM,IAAI,iBAAkB,GAAG,QACoC,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue CodeMirror6 Component
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @author Logue {@link logue@hotmail.co.jp}
|
|
6
|
+
* @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
|
|
7
|
+
* @see {@link https://github.com/logue/vue-codemirror6}
|
|
8
|
+
*/
|
|
9
|
+
import CodeMirror from './components/CodeMirror';
|
|
10
|
+
declare const installCodeMirror: (app: any) => any;
|
|
11
|
+
export { CodeMirror as default, installCodeMirror as install };
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,QAAA,MAAM,iBAAiB,mBAAiD,CAAC;AAEzE,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,CAAC"}
|
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.6.
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"description": "CodeMirror6 Component for vue2 and vue3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vuejs",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dev": "vite",
|
|
56
56
|
"clean": "rimraf node_modules/.vite && npx vue-demi-fix",
|
|
57
57
|
"build": "vite build & vue-tsc --declaration --emitDeclarationOnly",
|
|
58
|
-
"build:analyze": "vue-tsc --noEmit
|
|
58
|
+
"build:analyze": "vue-tsc --noEmit & vue-tsc --declaration --emitDeclarationOnly & vite build --mode analyze",
|
|
59
59
|
"build:docs": "vite build --config vite.config.docs.ts",
|
|
60
60
|
"build:clean": "rimraf dist",
|
|
61
61
|
"lint": "eslint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . -w -u",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"vite": "^2.9.12",
|
|
109
109
|
"vite-plugin-checker": "^0.4.6",
|
|
110
110
|
"vue": "^3.2.37",
|
|
111
|
-
"vue-eslint-parser": "^9.0.
|
|
111
|
+
"vue-eslint-parser": "^9.0.3",
|
|
112
112
|
"vue-tsc": "^0.38.1"
|
|
113
113
|
},
|
|
114
114
|
"husky": {
|