@scalar/use-codemirror 0.10.5 → 0.11.1
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 +17 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts +12 -11
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts.map +1 -1
- package/dist/components/CodeMirror/CodeMirror.vue.js +8 -0
- package/dist/components/CodeMirror/CodeMirror.vue2.js +37 -0
- package/dist/components/CodeMirror/CodeMirror.vue3.js +4 -0
- package/dist/components/CodeMirror/CodeMirror.vue4.js +4 -0
- package/dist/components/CodeMirror/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCodeMirror.js +184 -0
- package/dist/hooks/variables.js +37 -0
- package/dist/index.js +8 -23461
- package/dist/style.css +1 -25
- package/dist/themes/index.js +92 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @scalar/use-codemirror
|
|
2
2
|
|
|
3
|
+
## 0.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e0fc110: chore: patch bump all package
|
|
8
|
+
|
|
9
|
+
## 0.11.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7f8ef74: chore: remove aliasing
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- b38c7ed: Update build configs to a standardized format
|
|
18
|
+
- 6fbb57e: feat: release all the packages
|
|
19
|
+
|
|
3
20
|
## 0.10.5
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeMirrorLanguage } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
3
3
|
content: string | undefined;
|
|
4
4
|
readOnly?: boolean | undefined;
|
|
5
5
|
language?: CodeMirrorLanguage | undefined;
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
11
11
|
disableEnter: boolean;
|
|
12
12
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
13
|
change: (value: string) => void;
|
|
14
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
15
15
|
content: string | undefined;
|
|
16
16
|
readOnly?: boolean | undefined;
|
|
17
17
|
language?: CodeMirrorLanguage | undefined;
|
|
@@ -27,15 +27,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
27
27
|
disableEnter: boolean;
|
|
28
28
|
}, {}>;
|
|
29
29
|
export default _default;
|
|
30
|
-
|
|
31
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
32
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
-
} : {
|
|
35
|
-
type: import('vue').PropType<T[K]>;
|
|
36
|
-
required: true;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
30
|
+
|
|
39
31
|
type __VLS_WithDefaults<P, D> = {
|
|
40
32
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
41
33
|
default: D[K];
|
|
@@ -44,4 +36,13 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
44
36
|
type __VLS_Prettify<T> = {
|
|
45
37
|
[K in keyof T]: T[K];
|
|
46
38
|
} & {};
|
|
39
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
40
|
+
type __VLS_TypePropsToOption<T> = {
|
|
41
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
42
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
43
|
+
} : {
|
|
44
|
+
type: import('vue').PropType<T[K]>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
47
48
|
//# sourceMappingURL=CodeMirror.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirror.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeMirror/CodeMirror.vue
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFrD,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,OAAO,CAAC,CAAC;IAErG,KAAK,sBAAsB,GAAG,gBAAgB,CAAC,OAAO,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,OAAO,mBAAmB,EAAE,gBAAgB,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,OAAO,kBAAkB,EAAE,gBAAgB,EAAE,EAAE,CAAC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AAC,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import o from "./CodeMirror.vue2.js";
|
|
2
|
+
import "./CodeMirror.vue3.js";
|
|
3
|
+
import "./CodeMirror.vue4.js";
|
|
4
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f74951d5"]]);
|
|
6
|
+
export {
|
|
7
|
+
i as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as i, ref as s, toRef as o, openBlock as c, createElementBlock as m } from "vue";
|
|
2
|
+
import { useCodeMirror as u } from "../../hooks/useCodeMirror.js";
|
|
3
|
+
const h = /* @__PURE__ */ i({
|
|
4
|
+
__name: "CodeMirror",
|
|
5
|
+
props: {
|
|
6
|
+
content: {},
|
|
7
|
+
readOnly: { type: Boolean },
|
|
8
|
+
language: {},
|
|
9
|
+
withVariables: { type: Boolean },
|
|
10
|
+
lineNumbers: { type: Boolean },
|
|
11
|
+
withoutTheme: { type: Boolean },
|
|
12
|
+
disableEnter: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["change"],
|
|
15
|
+
setup(t, { emit: a }) {
|
|
16
|
+
const e = t, l = a, r = s(null);
|
|
17
|
+
return u({
|
|
18
|
+
content: o(() => e.content),
|
|
19
|
+
readOnly: o(() => e.readOnly),
|
|
20
|
+
language: o(() => e.language),
|
|
21
|
+
withVariables: o(() => e.withVariables),
|
|
22
|
+
lineNumbers: o(() => e.lineNumbers),
|
|
23
|
+
withoutTheme: o(() => e.withoutTheme),
|
|
24
|
+
disableEnter: o(() => e.disableEnter),
|
|
25
|
+
onChange: (n) => l("change", n || ""),
|
|
26
|
+
codeMirrorRef: r,
|
|
27
|
+
classes: ["codemirror"]
|
|
28
|
+
}), (n, d) => (c(), m("div", {
|
|
29
|
+
ref_key: "codeMirrorRef",
|
|
30
|
+
ref: r,
|
|
31
|
+
class: "codemirror-container"
|
|
32
|
+
}, null, 512));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
h as default
|
|
37
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CodeMirror } from './CodeMirror.vue';
|
|
1
|
+
export { default as CodeMirror } from './CodeMirror.vue.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './useCodeMirror';
|
|
1
|
+
export * from './useCodeMirror.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { autocompletion as M, closeBrackets as k, completionKeymap as C, closeBracketsKeymap as S } from "@codemirror/autocomplete";
|
|
2
|
+
import { indentWithTab as w } from "@codemirror/commands";
|
|
3
|
+
import { css as H } from "@codemirror/lang-css";
|
|
4
|
+
import { html as N } from "@codemirror/lang-html";
|
|
5
|
+
import { json as T } from "@codemirror/lang-json";
|
|
6
|
+
import { yaml as V } from "@codemirror/lang-yaml";
|
|
7
|
+
import { syntaxHighlighting as K, defaultHighlightStyle as O, indentOnInput as R, bracketMatching as j } from "@codemirror/language";
|
|
8
|
+
import { StateEffect as A } from "@codemirror/state";
|
|
9
|
+
import { EditorView as c, highlightSpecialChars as B, keymap as a, lineNumbers as I } from "@codemirror/view";
|
|
10
|
+
import { ref as L, watch as h, onBeforeUnmount as P, toValue as i, computed as U } from "vue";
|
|
11
|
+
import { customTheme as W } from "../themes/index.js";
|
|
12
|
+
import { variables as q } from "./variables.js";
|
|
13
|
+
const u = (e) => "provider" in e && !!i(e.provider), z = {
|
|
14
|
+
key: "Mod-a",
|
|
15
|
+
run: (e) => (e.dispatch({
|
|
16
|
+
selection: { anchor: 0, head: e.state.doc.length },
|
|
17
|
+
scrollIntoView: !1
|
|
18
|
+
}), !0)
|
|
19
|
+
}, oe = (e) => {
|
|
20
|
+
const o = L(null);
|
|
21
|
+
h(
|
|
22
|
+
e.codeMirrorRef,
|
|
23
|
+
() => {
|
|
24
|
+
var t;
|
|
25
|
+
(t = o.value) == null || t.destroy(), l();
|
|
26
|
+
},
|
|
27
|
+
{ immediate: !0 }
|
|
28
|
+
), P(() => {
|
|
29
|
+
var t;
|
|
30
|
+
return (t = o.value) == null ? void 0 : t.destroy();
|
|
31
|
+
});
|
|
32
|
+
function l() {
|
|
33
|
+
if (e.codeMirrorRef.value) {
|
|
34
|
+
const t = u(e) ? i(e.provider) : null, f = v({
|
|
35
|
+
...s.value,
|
|
36
|
+
provider: t
|
|
37
|
+
});
|
|
38
|
+
o.value = new c({
|
|
39
|
+
parent: e.codeMirrorRef.value,
|
|
40
|
+
extensions: f
|
|
41
|
+
}), u(e) || r(i(e.content));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const s = U(() => ({
|
|
45
|
+
onChange: e.onChange,
|
|
46
|
+
onBlur: e.onBlur,
|
|
47
|
+
onFocus: e.onFocus,
|
|
48
|
+
language: i(e.language),
|
|
49
|
+
classes: i(e.classes),
|
|
50
|
+
readOnly: i(e.readOnly),
|
|
51
|
+
lineNumbers: i(e.lineNumbers),
|
|
52
|
+
withVariables: i(e.withVariables),
|
|
53
|
+
disableEnter: i(e.withVariables),
|
|
54
|
+
withoutTheme: i(e.withoutTheme),
|
|
55
|
+
additionalExtensions: i(e.extensions)
|
|
56
|
+
}));
|
|
57
|
+
h(
|
|
58
|
+
() => u(e) ? i(e.provider) : null,
|
|
59
|
+
() => {
|
|
60
|
+
var t;
|
|
61
|
+
u(e) && ((t = o.value) == null || t.destroy(), l());
|
|
62
|
+
}
|
|
63
|
+
), h(
|
|
64
|
+
s,
|
|
65
|
+
() => {
|
|
66
|
+
if (o.value) {
|
|
67
|
+
const t = u(e) ? i(e.provider) : null, f = v({
|
|
68
|
+
...s.value,
|
|
69
|
+
provider: t
|
|
70
|
+
});
|
|
71
|
+
o.value.dispatch({
|
|
72
|
+
effects: A.reconfigure.of(f)
|
|
73
|
+
});
|
|
74
|
+
} else
|
|
75
|
+
return;
|
|
76
|
+
},
|
|
77
|
+
{ immediate: !0 }
|
|
78
|
+
);
|
|
79
|
+
const r = (t = "") => {
|
|
80
|
+
o.value && o.value.state.doc.toString() !== t && o.value.dispatch({
|
|
81
|
+
changes: {
|
|
82
|
+
from: 0,
|
|
83
|
+
to: o.value.state.doc.length,
|
|
84
|
+
insert: t
|
|
85
|
+
},
|
|
86
|
+
selection: {
|
|
87
|
+
anchor: Math.min(
|
|
88
|
+
o.value.state.selection.main.anchor,
|
|
89
|
+
t.length
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return h(
|
|
95
|
+
() => i(e.content),
|
|
96
|
+
() => {
|
|
97
|
+
u(e) || r(i(e.content));
|
|
98
|
+
},
|
|
99
|
+
{ immediate: !0 }
|
|
100
|
+
), {
|
|
101
|
+
/** Replaces the current content with the given value. */
|
|
102
|
+
setCodeMirrorContent: r,
|
|
103
|
+
/** Codemirror instance */
|
|
104
|
+
codeMirror: o
|
|
105
|
+
};
|
|
106
|
+
}, g = {
|
|
107
|
+
html: N,
|
|
108
|
+
json: T,
|
|
109
|
+
yaml: V,
|
|
110
|
+
css: H
|
|
111
|
+
};
|
|
112
|
+
function v({
|
|
113
|
+
onChange: e,
|
|
114
|
+
onBlur: o,
|
|
115
|
+
onFocus: l,
|
|
116
|
+
provider: s,
|
|
117
|
+
language: r,
|
|
118
|
+
classes: t = [],
|
|
119
|
+
readOnly: f = !1,
|
|
120
|
+
lineNumbers: p = !1,
|
|
121
|
+
withVariables: y = !1,
|
|
122
|
+
disableEnter: b = !1,
|
|
123
|
+
withoutTheme: x = !1,
|
|
124
|
+
additionalExtensions: E = []
|
|
125
|
+
}) {
|
|
126
|
+
const n = [
|
|
127
|
+
B(),
|
|
128
|
+
K(O, { fallback: !0 }),
|
|
129
|
+
c.theme({
|
|
130
|
+
".cm-line": {
|
|
131
|
+
lineHeight: "20px"
|
|
132
|
+
},
|
|
133
|
+
".cm-gutterElement": {
|
|
134
|
+
lineHeight: "20px"
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
// Listen to updates
|
|
138
|
+
c.updateListener.of((d) => {
|
|
139
|
+
d.docChanged && (e == null || e(d.state.doc.toString()));
|
|
140
|
+
}),
|
|
141
|
+
c.domEventHandlers({
|
|
142
|
+
blur: (d, m) => {
|
|
143
|
+
o == null || o(m.state.doc.toString());
|
|
144
|
+
},
|
|
145
|
+
focus: (d, m) => {
|
|
146
|
+
l == null || l(m.state.doc.toString());
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
// Add Classes
|
|
150
|
+
c.editorAttributes.of({ class: t.join(" ") }),
|
|
151
|
+
...E
|
|
152
|
+
];
|
|
153
|
+
return s && n.push(s), x || n.push(W), f ? n.push(c.editable.of(!1)) : n.push(
|
|
154
|
+
R(),
|
|
155
|
+
j(),
|
|
156
|
+
M(),
|
|
157
|
+
k(),
|
|
158
|
+
a.of([
|
|
159
|
+
...C,
|
|
160
|
+
...S,
|
|
161
|
+
w,
|
|
162
|
+
z
|
|
163
|
+
])
|
|
164
|
+
), r && g[r] && n.push(g[r]()), p && n.push(I()), y && n.push(q()), b && n.push(
|
|
165
|
+
a.of([
|
|
166
|
+
{
|
|
167
|
+
key: "Enter",
|
|
168
|
+
run: () => !0
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
key: "Ctrl-Enter",
|
|
172
|
+
mac: "Cmd-Enter",
|
|
173
|
+
run: () => !0
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: "Shift-Enter",
|
|
177
|
+
run: () => !0
|
|
178
|
+
}
|
|
179
|
+
])
|
|
180
|
+
), n;
|
|
181
|
+
}
|
|
182
|
+
export {
|
|
183
|
+
oe as useCodeMirror
|
|
184
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var c = (a, e, i) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[e] = i;
|
|
3
|
+
var r = (a, e, i) => (c(a, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
import { MatchDecorator as l, Decoration as t, ViewPlugin as n, EditorView as b } from "@codemirror/view";
|
|
5
|
+
const o = new l({
|
|
6
|
+
regexp: /(\{[^}]+\})/g,
|
|
7
|
+
decoration: () => t.mark({
|
|
8
|
+
attributes: {
|
|
9
|
+
class: "api-client-url-variable"
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
}), g = () => n.fromClass(
|
|
13
|
+
class {
|
|
14
|
+
constructor(a) {
|
|
15
|
+
r(this, "variables");
|
|
16
|
+
this.variables = o.createDeco(a);
|
|
17
|
+
}
|
|
18
|
+
update(a) {
|
|
19
|
+
this.variables = o.updateDeco(
|
|
20
|
+
a,
|
|
21
|
+
this.variables
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
decorations: (a) => a.variables,
|
|
27
|
+
provide: (a) => b.atomicRanges.of(
|
|
28
|
+
(e) => {
|
|
29
|
+
var i;
|
|
30
|
+
return ((i = e.plugin(a)) == null ? void 0 : i.variables) || t.none;
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
g as variables
|
|
37
|
+
};
|