@scalar/use-codemirror 0.11.3 → 0.11.5
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/CHANGELOG.md +12 -0
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts +12 -12
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts.map +1 -1
- package/dist/hooks/useCodeMirror.d.ts +2 -0
- package/dist/hooks/useCodeMirror.d.ts.map +1 -1
- package/dist/hooks/useCodeMirror.js +119 -88
- package/dist/hooks/variables.d.ts.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { CodeMirrorLanguage } from '../../types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
3
3
|
content: string | undefined;
|
|
4
|
-
readOnly?: boolean
|
|
5
|
-
language?: CodeMirrorLanguage
|
|
6
|
-
withVariables?: boolean
|
|
7
|
-
lineNumbers?: boolean
|
|
8
|
-
withoutTheme?: boolean
|
|
9
|
-
disableEnter?: boolean
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
language?: CodeMirrorLanguage;
|
|
6
|
+
withVariables?: boolean;
|
|
7
|
+
lineNumbers?: boolean;
|
|
8
|
+
withoutTheme?: boolean;
|
|
9
|
+
disableEnter?: boolean;
|
|
10
10
|
}>, {
|
|
11
11
|
disableEnter: boolean;
|
|
12
12
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
13
|
change: (value: string) => void;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
15
15
|
content: string | undefined;
|
|
16
|
-
readOnly?: boolean
|
|
17
|
-
language?: CodeMirrorLanguage
|
|
18
|
-
withVariables?: boolean
|
|
19
|
-
lineNumbers?: boolean
|
|
20
|
-
withoutTheme?: boolean
|
|
21
|
-
disableEnter?: boolean
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
language?: CodeMirrorLanguage;
|
|
18
|
+
withVariables?: boolean;
|
|
19
|
+
lineNumbers?: boolean;
|
|
20
|
+
withoutTheme?: boolean;
|
|
21
|
+
disableEnter?: boolean;
|
|
22
22
|
}>, {
|
|
23
23
|
disableEnter: boolean;
|
|
24
24
|
}>>> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirror.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeMirror/CodeMirror.vue"],"names":[],"mappings":"AAkFA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA
|
|
1
|
+
{"version":3,"file":"CodeMirror.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeMirror/CodeMirror.vue"],"names":[],"mappings":"AAkFA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;;aAKxC,MAAM,GAAG,SAAS;eAChB,OAAO;eACP,kBAAkB;oBACb,OAAO;kBACT,OAAO;mBACN,OAAO;mBACP,OAAO;;;;+BA4Le,IAAI;;aAlMhC,MAAM,GAAG,SAAS;eAChB,OAAO;eACP,kBAAkB;oBACb,OAAO;kBACT,OAAO;mBACN,OAAO;mBACP,OAAO;;;;;;kBAAP,OAAO;;AA6E1B,wBAOG;AAEH,eAAO,MAAM,sBAAsB,IAAK,CAAC;AACzC,OAAO,CAAC,MAAM,CAAC;IAEd,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,OAAO,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAE1K,KAAK,aAAa,GAAG,gBAAgB,CAAC,OAAO,iBAAiB,EAAE,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC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,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -19,6 +19,8 @@ type BaseParameters = {
|
|
|
19
19
|
lineNumbers?: MaybeRefOrGetter<boolean | undefined>;
|
|
20
20
|
withVariables?: MaybeRefOrGetter<boolean | undefined>;
|
|
21
21
|
disableEnter?: MaybeRefOrGetter<boolean | undefined>;
|
|
22
|
+
/** Option to lint and show error in the editor */
|
|
23
|
+
lint?: MaybeRefOrGetter<boolean | undefined>;
|
|
22
24
|
onBlur?: (v: string) => void;
|
|
23
25
|
onFocus?: (v: string) => void;
|
|
24
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeMirror.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeMirror.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,UAAU,EAKX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,GAAG,EAMT,MAAM,KAAK,CAAA;AAGZ,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAGlD,KAAK,cAAc,GAAG;I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;IAC5C,OAAO,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAC,CAAA;AAsBN,sCAAsC;AACtC,eAAO,MAAM,aAAa,WAChB,uBAAuB,KAC9B;IACD,oBAAoB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;CAgInC,CAAA"}
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
import { autocompletion as
|
|
2
|
-
import { indentWithTab as
|
|
3
|
-
import { css as
|
|
4
|
-
import { html as
|
|
5
|
-
import { json as
|
|
6
|
-
import { yaml as
|
|
7
|
-
import { syntaxHighlighting as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { autocompletion as C, closeBrackets as w, completionKeymap as H, closeBracketsKeymap as N } from "@codemirror/autocomplete";
|
|
2
|
+
import { indentWithTab as j } from "@codemirror/commands";
|
|
3
|
+
import { css as O } from "@codemirror/lang-css";
|
|
4
|
+
import { html as T } from "@codemirror/lang-html";
|
|
5
|
+
import { json as V } from "@codemirror/lang-json";
|
|
6
|
+
import { yaml as K } from "@codemirror/lang-yaml";
|
|
7
|
+
import { syntaxHighlighting as L, defaultHighlightStyle as R, indentOnInput as A, bracketMatching as B } from "@codemirror/language";
|
|
8
|
+
import { linter as I } from "@codemirror/lint";
|
|
9
|
+
import { StateEffect as z } from "@codemirror/state";
|
|
10
|
+
import { EditorView as d, highlightSpecialChars as J, keymap as v, lineNumbers as P } from "@codemirror/view";
|
|
11
|
+
import { ref as U, watch as m, onBeforeUnmount as W, toValue as r, computed as q } from "vue";
|
|
12
|
+
import { customTheme as D } from "../themes/index.js";
|
|
13
|
+
import { variables as G } from "./variables.js";
|
|
14
|
+
const u = (e) => "provider" in e && !!r(e.provider), Q = {
|
|
14
15
|
key: "Mod-a",
|
|
15
16
|
run: (e) => (e.dispatch({
|
|
16
17
|
selection: { anchor: 0, head: e.state.doc.length },
|
|
17
18
|
scrollIntoView: !1
|
|
18
19
|
}), !0)
|
|
19
|
-
},
|
|
20
|
-
const o =
|
|
21
|
-
|
|
20
|
+
}, le = (e) => {
|
|
21
|
+
const o = U(null);
|
|
22
|
+
m(
|
|
22
23
|
e.codeMirrorRef,
|
|
23
24
|
() => {
|
|
24
25
|
var t;
|
|
25
|
-
(t = o.value) == null || t.destroy(),
|
|
26
|
+
(t = o.value) == null || t.destroy(), s();
|
|
26
27
|
},
|
|
27
28
|
{ immediate: !0 }
|
|
28
|
-
),
|
|
29
|
+
), W(() => {
|
|
29
30
|
var t;
|
|
30
31
|
return (t = o.value) == null ? void 0 : t.destroy();
|
|
31
32
|
});
|
|
32
|
-
function
|
|
33
|
+
function s() {
|
|
33
34
|
if (e.codeMirrorRef.value) {
|
|
34
|
-
const t = u(e) ?
|
|
35
|
-
...
|
|
35
|
+
const t = u(e) ? r(e.provider) : null, h = b({
|
|
36
|
+
...l.value,
|
|
36
37
|
provider: t
|
|
37
38
|
});
|
|
38
|
-
o.value = new
|
|
39
|
+
o.value = new d({
|
|
39
40
|
parent: e.codeMirrorRef.value,
|
|
40
|
-
extensions:
|
|
41
|
-
}), u(e) || r(
|
|
41
|
+
extensions: h
|
|
42
|
+
}), u(e) || n(r(e.content));
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
+
const l = q(() => ({
|
|
45
46
|
onChange: e.onChange,
|
|
46
47
|
onBlur: e.onBlur,
|
|
47
48
|
onFocus: e.onFocus,
|
|
48
|
-
language:
|
|
49
|
-
classes:
|
|
50
|
-
readOnly:
|
|
51
|
-
lineNumbers:
|
|
52
|
-
withVariables:
|
|
53
|
-
disableEnter:
|
|
54
|
-
withoutTheme:
|
|
55
|
-
|
|
49
|
+
language: r(e.language),
|
|
50
|
+
classes: r(e.classes),
|
|
51
|
+
readOnly: r(e.readOnly),
|
|
52
|
+
lineNumbers: r(e.lineNumbers),
|
|
53
|
+
withVariables: r(e.withVariables),
|
|
54
|
+
disableEnter: r(e.withVariables),
|
|
55
|
+
withoutTheme: r(e.withoutTheme),
|
|
56
|
+
lint: r(e.lint),
|
|
57
|
+
additionalExtensions: r(e.extensions)
|
|
56
58
|
}));
|
|
57
|
-
|
|
58
|
-
() => u(e) ?
|
|
59
|
+
m(
|
|
60
|
+
() => u(e) ? r(e.provider) : null,
|
|
59
61
|
() => {
|
|
60
62
|
var t;
|
|
61
|
-
u(e) && ((t = o.value) == null || t.destroy(),
|
|
63
|
+
u(e) && ((t = o.value) == null || t.destroy(), s());
|
|
62
64
|
}
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
+
), m(
|
|
66
|
+
l,
|
|
65
67
|
() => {
|
|
66
68
|
if (o.value) {
|
|
67
|
-
const t = u(e) ?
|
|
68
|
-
...
|
|
69
|
+
const t = u(e) ? r(e.provider) : null, h = b({
|
|
70
|
+
...l.value,
|
|
69
71
|
provider: t
|
|
70
72
|
});
|
|
71
73
|
o.value.dispatch({
|
|
72
|
-
effects:
|
|
74
|
+
effects: z.reconfigure.of(h)
|
|
73
75
|
});
|
|
74
76
|
} else
|
|
75
77
|
return;
|
|
76
78
|
},
|
|
77
79
|
{ immediate: !0 }
|
|
78
80
|
);
|
|
79
|
-
const
|
|
81
|
+
const n = (t = "") => {
|
|
80
82
|
o.value && o.value.state.doc.toString() !== t && o.value.dispatch({
|
|
81
83
|
changes: {
|
|
82
84
|
from: 0,
|
|
@@ -91,78 +93,107 @@ const u = (e) => "provider" in e && !!i(e.provider), z = {
|
|
|
91
93
|
}
|
|
92
94
|
});
|
|
93
95
|
};
|
|
94
|
-
return
|
|
95
|
-
() =>
|
|
96
|
+
return m(
|
|
97
|
+
() => r(e.content),
|
|
96
98
|
() => {
|
|
97
|
-
u(e) || r(
|
|
99
|
+
u(e) || n(r(e.content));
|
|
98
100
|
},
|
|
99
101
|
{ immediate: !0 }
|
|
100
102
|
), {
|
|
101
103
|
/** Replaces the current content with the given value. */
|
|
102
|
-
setCodeMirrorContent:
|
|
104
|
+
setCodeMirrorContent: n,
|
|
103
105
|
/** Codemirror instance */
|
|
104
106
|
codeMirror: o
|
|
105
107
|
};
|
|
106
|
-
},
|
|
107
|
-
html:
|
|
108
|
-
json:
|
|
109
|
-
yaml:
|
|
110
|
-
css:
|
|
108
|
+
}, p = {
|
|
109
|
+
html: T,
|
|
110
|
+
json: V,
|
|
111
|
+
yaml: K,
|
|
112
|
+
css: O
|
|
111
113
|
};
|
|
112
|
-
function
|
|
114
|
+
function b({
|
|
113
115
|
onChange: e,
|
|
114
116
|
onBlur: o,
|
|
115
|
-
onFocus:
|
|
116
|
-
provider:
|
|
117
|
-
language:
|
|
117
|
+
onFocus: s,
|
|
118
|
+
provider: l,
|
|
119
|
+
language: n,
|
|
118
120
|
classes: t = [],
|
|
119
|
-
readOnly:
|
|
120
|
-
lineNumbers:
|
|
121
|
-
withVariables:
|
|
122
|
-
disableEnter:
|
|
123
|
-
withoutTheme:
|
|
124
|
-
|
|
121
|
+
readOnly: h = !1,
|
|
122
|
+
lineNumbers: y = !1,
|
|
123
|
+
withVariables: x = !1,
|
|
124
|
+
disableEnter: E = !1,
|
|
125
|
+
withoutTheme: M = !1,
|
|
126
|
+
lint: S = !1,
|
|
127
|
+
additionalExtensions: k = []
|
|
125
128
|
}) {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
const i = [
|
|
130
|
+
J(),
|
|
131
|
+
L(R, { fallback: !0 }),
|
|
132
|
+
d.theme({
|
|
130
133
|
".cm-line": {
|
|
131
134
|
lineHeight: "20px"
|
|
132
135
|
},
|
|
133
136
|
".cm-gutterElement": {
|
|
134
137
|
lineHeight: "20px"
|
|
138
|
+
},
|
|
139
|
+
".cm-tooltip": {
|
|
140
|
+
border: "1px solid #f5c6cb",
|
|
141
|
+
fontSize: "12px"
|
|
142
|
+
},
|
|
143
|
+
".cm-tooltip-lint": {
|
|
144
|
+
backgroundColor: "#ffffff"
|
|
145
|
+
},
|
|
146
|
+
".cm-diagnostic-error": {
|
|
147
|
+
borderLeft: "0",
|
|
148
|
+
color: "#dc1b19"
|
|
135
149
|
}
|
|
136
150
|
}),
|
|
137
151
|
// Listen to updates
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
d.updateListener.of((c) => {
|
|
153
|
+
c.docChanged && (e == null || e(c.state.doc.toString()));
|
|
140
154
|
}),
|
|
141
|
-
|
|
142
|
-
blur: (
|
|
143
|
-
o == null || o(
|
|
155
|
+
d.domEventHandlers({
|
|
156
|
+
blur: (c, f) => {
|
|
157
|
+
o == null || o(f.state.doc.toString());
|
|
144
158
|
},
|
|
145
|
-
focus: (
|
|
146
|
-
|
|
159
|
+
focus: (c, f) => {
|
|
160
|
+
s == null || s(f.state.doc.toString());
|
|
147
161
|
}
|
|
148
162
|
}),
|
|
149
163
|
// Add Classes
|
|
150
|
-
|
|
151
|
-
...
|
|
164
|
+
d.editorAttributes.of({ class: t.join(" ") }),
|
|
165
|
+
...k
|
|
152
166
|
];
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
if (l && i.push(l), M || i.push(D), h ? i.push(d.editable.of(!1)) : i.push(
|
|
168
|
+
A(),
|
|
169
|
+
B(),
|
|
170
|
+
C(),
|
|
171
|
+
w(),
|
|
172
|
+
v.of([
|
|
173
|
+
...H,
|
|
174
|
+
...N,
|
|
175
|
+
j,
|
|
176
|
+
Q
|
|
163
177
|
])
|
|
164
|
-
),
|
|
165
|
-
|
|
178
|
+
), n && p[n] && i.push(p[n]()), S && n === "json") {
|
|
179
|
+
const c = I((f) => {
|
|
180
|
+
const a = [];
|
|
181
|
+
try {
|
|
182
|
+
JSON.parse(f.state.doc.toString());
|
|
183
|
+
} catch (g) {
|
|
184
|
+
g instanceof Error && a.push({
|
|
185
|
+
from: 0,
|
|
186
|
+
to: f.state.doc.length,
|
|
187
|
+
severity: "error",
|
|
188
|
+
message: g.message
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return a;
|
|
192
|
+
});
|
|
193
|
+
i.push(c);
|
|
194
|
+
}
|
|
195
|
+
return y && i.push(P()), x && i.push(G()), E && i.push(
|
|
196
|
+
v.of([
|
|
166
197
|
{
|
|
167
198
|
key: "Enter",
|
|
168
199
|
run: () => !0
|
|
@@ -177,8 +208,8 @@ function v({
|
|
|
177
208
|
run: () => !0
|
|
178
209
|
}
|
|
179
210
|
])
|
|
180
|
-
),
|
|
211
|
+
), i;
|
|
181
212
|
}
|
|
182
213
|
export {
|
|
183
|
-
|
|
214
|
+
le as useCodeMirror
|
|
184
215
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/hooks/variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAGlB,UAAU,EACV,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAYzB,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/hooks/variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAGlB,UAAU,EACV,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAYzB,eAAO,MAAM,SAAS;eAGL,aAAa;mBAIT,UAAU;EAc5B,CAAA"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"vue",
|
|
17
17
|
"vue3"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.11.
|
|
19
|
+
"version": "0.11.5",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"module": "dist/index.js",
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"y-codemirror.next": "^0.3.2",
|
|
35
|
+
"yjs": "^13.6.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@codemirror/autocomplete": "^6.12.0",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@codemirror/lang-json": "^6.0.0",
|
|
43
43
|
"@codemirror/lang-yaml": "^6.0.0",
|
|
44
44
|
"@codemirror/language": "^6.10.1",
|
|
45
|
+
"@codemirror/lint": "^6.8.1",
|
|
45
46
|
"@codemirror/state": "^6.4.0",
|
|
46
47
|
"@codemirror/view": "^6.23.1",
|
|
47
48
|
"@lezer/common": "^1.2.1",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"vue-tsc": "^2.0.13",
|
|
63
64
|
"y-codemirror.next": "^0.3.2",
|
|
64
65
|
"yjs": "^13.6.0",
|
|
65
|
-
"@scalar/build-tooling": "0.1.
|
|
66
|
+
"@scalar/build-tooling": "0.1.9"
|
|
66
67
|
},
|
|
67
68
|
"scripts": {
|
|
68
69
|
"build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
|