@gsc-basic/components 1.0.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/dist/es/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/es/index.js +35 -0
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1371 -0
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +838 -0
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +38 -0
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +300 -0
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +48 -0
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +399 -0
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +497 -0
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +216 -0
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +51 -0
- package/dist/es/node_modules/@codemirror/language/dist/index.js +1299 -0
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +649 -0
- package/dist/es/node_modules/@codemirror/search/dist/index.js +872 -0
- package/dist/es/node_modules/@codemirror/state/dist/index.js +2639 -0
- package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +132 -0
- package/dist/es/node_modules/@codemirror/view/dist/index.js +7280 -0
- package/dist/es/node_modules/@lezer/common/dist/index.js +1430 -0
- package/dist/es/node_modules/@lezer/highlight/dist/index.js +637 -0
- package/dist/es/node_modules/@lezer/java/dist/index.js +62 -0
- package/dist/es/node_modules/@lezer/javascript/dist/index.js +161 -0
- package/dist/es/node_modules/@lezer/json/dist/index.js +34 -0
- package/dist/es/node_modules/@lezer/lr/dist/index.js +1307 -0
- package/dist/es/node_modules/@lezer/python/dist/index.js +221 -0
- package/dist/es/node_modules/@lezer/xml/dist/index.js +100 -0
- package/dist/es/node_modules/@lezer/yaml/dist/index.js +274 -0
- package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +69 -0
- package/dist/es/node_modules/@vueuse/core/dist/index.js +125 -0
- package/dist/es/node_modules/@vueuse/shared/dist/index.js +55 -0
- package/dist/es/node_modules/codemirror/dist/index.js +40 -0
- package/dist/es/node_modules/crelt/index.js +27 -0
- package/dist/es/node_modules/lodash-es/_Hash.js +20 -0
- package/dist/es/node_modules/lodash-es/_ListCache.js +20 -0
- package/dist/es/node_modules/lodash-es/_Map.js +6 -0
- package/dist/es/node_modules/lodash-es/_MapCache.js +20 -0
- package/dist/es/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/es/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/es/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/dist/es/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/es/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/es/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/dist/es/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/es/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/es/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/es/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/es/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/es/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/es/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/es/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/es/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/es/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/es/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/es/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/es/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/es/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/es/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/es/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/es/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/es/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/dist/es/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/es/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/es/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/es/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/es/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/es/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/es/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/es/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/es/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/es/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/es/node_modules/lodash-es/_root.js +5 -0
- package/dist/es/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/es/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/es/node_modules/lodash-es/_toSource.js +17 -0
- package/dist/es/node_modules/lodash-es/eq.js +6 -0
- package/dist/es/node_modules/lodash-es/get.js +8 -0
- package/dist/es/node_modules/lodash-es/isArray.js +4 -0
- package/dist/es/node_modules/lodash-es/isFunction.js +12 -0
- package/dist/es/node_modules/lodash-es/isNil.js +6 -0
- package/dist/es/node_modules/lodash-es/isObject.js +7 -0
- package/dist/es/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/es/node_modules/lodash-es/isString.js +10 -0
- package/dist/es/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/es/node_modules/lodash-es/memoize.js +18 -0
- package/dist/es/node_modules/lodash-es/toString.js +7 -0
- package/dist/es/node_modules/style-mod/src/style-mod.js +109 -0
- package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +132 -0
- package/dist/es/node_modules/w3c-keyname/index.js +93 -0
- package/dist/es/src/CodeEditor/index.js +6 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -0
- package/dist/es/src/CodeEditor/src/index.vue.js +128 -0
- package/dist/es/src/CodeEditor/src/index2.css +1 -0
- package/dist/es/src/ConfigProvider/index.js +7 -0
- package/dist/es/src/ConfigProvider/src/configProvider.js +14 -0
- package/dist/es/src/ConfigProvider/src/configProviderProps.js +22 -0
- package/dist/es/src/ConfigProvider/src/constants.js +9 -0
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +45 -0
- package/dist/es/src/ScaleScreen/index.js +6 -0
- package/dist/es/src/ScaleScreen/src/index.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +115 -0
- package/dist/es/src/ScaleScreen/src/index2.css +1 -0
- package/dist/es/src/VideoBackground/index.js +6 -0
- package/dist/es/src/VideoBackground/src/helper.js +29 -0
- package/dist/es/src/VideoBackground/src/index.css +1 -0
- package/dist/es/src/VideoBackground/src/index.vue.js +108 -0
- package/dist/es/src/VideoBackground/src/index2.css +1 -0
- package/dist/es/src/VideoBackground/src/index3.css +1 -0
- package/dist/es/src/VideoBackground/src/videoBackground.js +31 -0
- package/dist/es/src/hooks/useLocale.js +24 -0
- package/dist/es/src/hooks/useNamespace.js +8 -0
- package/dist/es/src/index.js +28 -0
- package/dist/es/src/locale/lang/en-US.js +32 -0
- package/dist/es/src/locale/lang/ja-JP.js +32 -0
- package/dist/es/src/locale/lang/zh-CN.js +32 -0
- package/dist/es/src/styles/tokens.css +1 -0
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +13 -0
- package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +3 -0
- package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +2 -0
- package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/lint/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -0
- package/dist/lib/node_modules/@codemirror/state/dist/index.js +5 -0
- package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -0
- package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -0
- package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/highlight/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/java/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/javascript/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/json/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/python/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/xml/dist/index.js +1 -0
- package/dist/lib/node_modules/@lezer/yaml/dist/index.js +1 -0
- package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +1 -0
- package/dist/lib/node_modules/@vueuse/core/dist/index.js +1 -0
- package/dist/lib/node_modules/@vueuse/shared/dist/index.js +1 -0
- package/dist/lib/node_modules/codemirror/dist/index.js +1 -0
- package/dist/lib/node_modules/crelt/index.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Hash.js +1 -0
- package/dist/lib/node_modules/lodash-es/_ListCache.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Map.js +1 -0
- package/dist/lib/node_modules/lodash-es/_MapCache.js +1 -0
- package/dist/lib/node_modules/lodash-es/_Symbol.js +1 -0
- package/dist/lib/node_modules/lodash-es/_arrayMap.js +1 -0
- package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseGetTag.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseIsNative.js +1 -0
- package/dist/lib/node_modules/lodash-es/_baseToString.js +1 -0
- package/dist/lib/node_modules/lodash-es/_castPath.js +1 -0
- package/dist/lib/node_modules/lodash-es/_coreJsData.js +1 -0
- package/dist/lib/node_modules/lodash-es/_freeGlobal.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getMapData.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getNative.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getRawTag.js +1 -0
- package/dist/lib/node_modules/lodash-es/_getValue.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_hashSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isKey.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isKeyable.js +1 -0
- package/dist/lib/node_modules/lodash-es/_isMasked.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_listCacheSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +1 -0
- package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +1 -0
- package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +1 -0
- package/dist/lib/node_modules/lodash-es/_nativeCreate.js +1 -0
- package/dist/lib/node_modules/lodash-es/_objectToString.js +1 -0
- package/dist/lib/node_modules/lodash-es/_root.js +1 -0
- package/dist/lib/node_modules/lodash-es/_stringToPath.js +1 -0
- package/dist/lib/node_modules/lodash-es/_toKey.js +1 -0
- package/dist/lib/node_modules/lodash-es/_toSource.js +1 -0
- package/dist/lib/node_modules/lodash-es/eq.js +1 -0
- package/dist/lib/node_modules/lodash-es/get.js +1 -0
- package/dist/lib/node_modules/lodash-es/isArray.js +1 -0
- package/dist/lib/node_modules/lodash-es/isFunction.js +1 -0
- package/dist/lib/node_modules/lodash-es/isNil.js +1 -0
- package/dist/lib/node_modules/lodash-es/isObject.js +1 -0
- package/dist/lib/node_modules/lodash-es/isObjectLike.js +1 -0
- package/dist/lib/node_modules/lodash-es/isString.js +1 -0
- package/dist/lib/node_modules/lodash-es/isSymbol.js +1 -0
- package/dist/lib/node_modules/lodash-es/memoize.js +1 -0
- package/dist/lib/node_modules/lodash-es/toString.js +1 -0
- package/dist/lib/node_modules/style-mod/src/style-mod.js +3 -0
- package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +1 -0
- package/dist/lib/node_modules/w3c-keyname/index.js +1 -0
- package/dist/lib/src/CodeEditor/index.js +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -0
- package/dist/lib/src/CodeEditor/src/index2.css +1 -0
- package/dist/lib/src/ConfigProvider/index.js +1 -0
- package/dist/lib/src/ConfigProvider/src/configProvider.js +1 -0
- package/dist/lib/src/ConfigProvider/src/configProviderProps.js +1 -0
- package/dist/lib/src/ConfigProvider/src/constants.js +1 -0
- package/dist/lib/src/ConfigProvider/src/useGlobalConfig.js +1 -0
- package/dist/lib/src/ScaleScreen/index.js +1 -0
- package/dist/lib/src/ScaleScreen/src/index.css +1 -0
- package/dist/lib/src/ScaleScreen/src/index.vue.js +1 -0
- package/dist/lib/src/ScaleScreen/src/index2.css +1 -0
- package/dist/lib/src/VideoBackground/index.js +1 -0
- package/dist/lib/src/VideoBackground/src/helper.js +1 -0
- package/dist/lib/src/VideoBackground/src/index.css +1 -0
- package/dist/lib/src/VideoBackground/src/index.vue.js +1 -0
- package/dist/lib/src/VideoBackground/src/index2.css +1 -0
- package/dist/lib/src/VideoBackground/src/index3.css +1 -0
- package/dist/lib/src/VideoBackground/src/videoBackground.js +1 -0
- package/dist/lib/src/hooks/useLocale.js +1 -0
- package/dist/lib/src/hooks/useNamespace.js +1 -0
- package/dist/lib/src/index.js +1 -0
- package/dist/lib/src/locale/lang/en-US.js +1 -0
- package/dist/lib/src/locale/lang/ja-JP.js +1 -0
- package/dist/lib/src/locale/lang/zh-CN.js +1 -0
- package/dist/lib/src/styles/tokens.css +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
import { ViewPlugin as ie, EditorView as D, hoverTooltip as ne, gutter as se, Decoration as C, showPanel as oe, showTooltip as le, WidgetType as re, GutterMarker as ae, getPanel as ce, logException as de } from "../../view/dist/index.js";
|
|
2
|
+
import { Facet as V, StateField as B, combineConfig as Y, StateEffect as S, RangeSet as _, RangeSetBuilder as fe } from "../../state/dist/index.js";
|
|
3
|
+
import x from "../../../crelt/index.js";
|
|
4
|
+
class $ {
|
|
5
|
+
constructor(e, n, i) {
|
|
6
|
+
this.from = e, this.to = n, this.diagnostic = i;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
class y {
|
|
10
|
+
constructor(e, n, i) {
|
|
11
|
+
this.diagnostics = e, this.panel = n, this.selected = i;
|
|
12
|
+
}
|
|
13
|
+
static init(e, n, i) {
|
|
14
|
+
let s = i.facet(v).markerFilter;
|
|
15
|
+
s && (e = s(e, i));
|
|
16
|
+
let o = e.slice().sort((u, p) => u.from - p.from || u.to - p.to), r = new fe(), l = [], c = 0, a = i.doc.iter(), f = 0, b = i.doc.length;
|
|
17
|
+
for (let u = 0; ; ) {
|
|
18
|
+
let p = u == o.length ? null : o[u];
|
|
19
|
+
if (!p && !l.length)
|
|
20
|
+
break;
|
|
21
|
+
let h, m;
|
|
22
|
+
if (l.length)
|
|
23
|
+
h = c, m = l.reduce((d, k) => Math.min(d, k.to), p && p.from > h ? p.from : 1e8);
|
|
24
|
+
else {
|
|
25
|
+
if (h = p.from, h > b)
|
|
26
|
+
break;
|
|
27
|
+
m = p.to, l.push(p), u++;
|
|
28
|
+
}
|
|
29
|
+
for (; u < o.length; ) {
|
|
30
|
+
let d = o[u];
|
|
31
|
+
if (d.from == h && (d.to > d.from || d.to == h))
|
|
32
|
+
l.push(d), u++, m = Math.min(d.to, m);
|
|
33
|
+
else {
|
|
34
|
+
m = Math.min(d.from, m);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
m = Math.min(m, b);
|
|
39
|
+
let R = !1;
|
|
40
|
+
if (l.some((d) => d.from == h && (d.to == m || m == b)) && (R = h == m, !R && m - h < 10)) {
|
|
41
|
+
let d = h - (f + a.value.length);
|
|
42
|
+
d > 0 && (a.next(d), f = h);
|
|
43
|
+
for (let k = h; ; ) {
|
|
44
|
+
if (k >= m) {
|
|
45
|
+
R = !0;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (!a.lineBreak && f + a.value.length > k)
|
|
49
|
+
break;
|
|
50
|
+
k = f + a.value.length, f += a.value.length, a.next();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let G = J(l);
|
|
54
|
+
if (R)
|
|
55
|
+
r.add(h, h, C.widget({
|
|
56
|
+
widget: new ke(G),
|
|
57
|
+
diagnostics: l.slice()
|
|
58
|
+
}));
|
|
59
|
+
else {
|
|
60
|
+
let d = l.reduce((k, H) => H.markClass ? k + " " + H.markClass : k, "");
|
|
61
|
+
r.add(h, m, C.mark({
|
|
62
|
+
class: "cm-lintRange cm-lintRange-" + G + d,
|
|
63
|
+
diagnostics: l.slice(),
|
|
64
|
+
inclusiveEnd: l.some((k) => k.to > m)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
if (c = m, c == b)
|
|
68
|
+
break;
|
|
69
|
+
for (let d = 0; d < l.length; d++)
|
|
70
|
+
l[d].to <= c && l.splice(d--, 1);
|
|
71
|
+
}
|
|
72
|
+
let g = r.finish();
|
|
73
|
+
return new y(g, n, T(g));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function T(t, e = null, n = 0) {
|
|
77
|
+
let i = null;
|
|
78
|
+
return t.between(n, 1e9, (s, o, { spec: r }) => {
|
|
79
|
+
if (!(e && r.diagnostics.indexOf(e) < 0))
|
|
80
|
+
if (!i)
|
|
81
|
+
i = new $(s, o, e || r.diagnostics[0]);
|
|
82
|
+
else {
|
|
83
|
+
if (r.diagnostics.indexOf(i.diagnostic) < 0)
|
|
84
|
+
return !1;
|
|
85
|
+
i = new $(i.from, o, i.diagnostic);
|
|
86
|
+
}
|
|
87
|
+
}), i;
|
|
88
|
+
}
|
|
89
|
+
function q(t, e) {
|
|
90
|
+
let n = e.pos, i = e.end || n, s = t.state.facet(v).hideOn(t, n, i);
|
|
91
|
+
if (s != null)
|
|
92
|
+
return s;
|
|
93
|
+
let o = t.startState.doc.lineAt(e.pos);
|
|
94
|
+
return !!(t.effects.some((r) => r.is(F)) || t.changes.touchesRange(o.from, Math.max(o.to, i)));
|
|
95
|
+
}
|
|
96
|
+
function W(t, e) {
|
|
97
|
+
return t.field(w, !1) ? e : e.concat(S.appendConfig.of(te));
|
|
98
|
+
}
|
|
99
|
+
function ue(t, e) {
|
|
100
|
+
return {
|
|
101
|
+
effects: W(t, [F.of(e)])
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const F = /* @__PURE__ */ S.define(), E = /* @__PURE__ */ S.define(), Z = /* @__PURE__ */ S.define(), w = /* @__PURE__ */ B.define({
|
|
105
|
+
create() {
|
|
106
|
+
return new y(C.none, null, null);
|
|
107
|
+
},
|
|
108
|
+
update(t, e) {
|
|
109
|
+
if (e.docChanged && t.diagnostics.size) {
|
|
110
|
+
let n = t.diagnostics.map(e.changes), i = null, s = t.panel;
|
|
111
|
+
if (t.selected) {
|
|
112
|
+
let o = e.changes.mapPos(t.selected.from, 1);
|
|
113
|
+
i = T(n, t.selected.diagnostic, o) || T(n, null, o);
|
|
114
|
+
}
|
|
115
|
+
!n.size && s && e.state.facet(v).autoPanel && (s = null), t = new y(n, s, i);
|
|
116
|
+
}
|
|
117
|
+
for (let n of e.effects)
|
|
118
|
+
if (n.is(F)) {
|
|
119
|
+
let i = e.state.facet(v).autoPanel ? n.value.length ? P.open : null : t.panel;
|
|
120
|
+
t = y.init(n.value, i, e.state);
|
|
121
|
+
} else n.is(E) ? t = new y(t.diagnostics, n.value ? P.open : null, t.selected) : n.is(Z) && (t = new y(t.diagnostics, t.panel, n.value));
|
|
122
|
+
return t;
|
|
123
|
+
},
|
|
124
|
+
provide: (t) => [
|
|
125
|
+
oe.from(t, (e) => e.panel),
|
|
126
|
+
D.decorations.from(t, (e) => e.diagnostics)
|
|
127
|
+
]
|
|
128
|
+
}), me = /* @__PURE__ */ C.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
129
|
+
function he(t, e, n) {
|
|
130
|
+
let { diagnostics: i } = t.state.field(w), s, o = -1, r = -1;
|
|
131
|
+
i.between(e - (n < 0 ? 1 : 0), e + (n > 0 ? 1 : 0), (c, a, { spec: f }) => {
|
|
132
|
+
if (e >= c && e <= a && (c == a || (e > c || n > 0) && (e < a || n < 0)))
|
|
133
|
+
return s = f.diagnostics, o = c, r = a, !1;
|
|
134
|
+
});
|
|
135
|
+
let l = t.state.facet(v).tooltipFilter;
|
|
136
|
+
return s && l && (s = l(s, t.state)), s ? {
|
|
137
|
+
pos: o,
|
|
138
|
+
end: r,
|
|
139
|
+
above: t.state.doc.lineAt(o).to < r,
|
|
140
|
+
create() {
|
|
141
|
+
return { dom: K(t, s) };
|
|
142
|
+
}
|
|
143
|
+
} : null;
|
|
144
|
+
}
|
|
145
|
+
function K(t, e) {
|
|
146
|
+
return x("ul", { class: "cm-tooltip-lint" }, e.map((n) => X(t, n, !1)));
|
|
147
|
+
}
|
|
148
|
+
const ge = (t) => {
|
|
149
|
+
let e = t.state.field(w, !1);
|
|
150
|
+
(!e || !e.panel) && t.dispatch({ effects: W(t.state, [E.of(!0)]) });
|
|
151
|
+
let n = ce(t, P.open);
|
|
152
|
+
return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
|
|
153
|
+
}, j = (t) => {
|
|
154
|
+
let e = t.state.field(w, !1);
|
|
155
|
+
return !e || !e.panel ? !1 : (t.dispatch({ effects: E.of(!1) }), !0);
|
|
156
|
+
}, pe = (t) => {
|
|
157
|
+
let e = t.state.field(w, !1);
|
|
158
|
+
if (!e)
|
|
159
|
+
return !1;
|
|
160
|
+
let n = t.state.selection.main, i = e.diagnostics.iter(n.to + 1);
|
|
161
|
+
return !i.value && (i = e.diagnostics.iter(0), !i.value || i.from == n.from && i.to == n.to) ? !1 : (t.dispatch({ selection: { anchor: i.from, head: i.to }, scrollIntoView: !0 }), !0);
|
|
162
|
+
}, De = [
|
|
163
|
+
{ key: "Mod-Shift-m", run: ge, preventDefault: !0 },
|
|
164
|
+
{ key: "F8", run: pe }
|
|
165
|
+
], we = /* @__PURE__ */ ie.fromClass(class {
|
|
166
|
+
constructor(t) {
|
|
167
|
+
this.view = t, this.timeout = -1, this.set = !0;
|
|
168
|
+
let { delay: e } = t.state.facet(v);
|
|
169
|
+
this.lintTime = Date.now() + e, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, e);
|
|
170
|
+
}
|
|
171
|
+
run() {
|
|
172
|
+
clearTimeout(this.timeout);
|
|
173
|
+
let t = Date.now();
|
|
174
|
+
if (t < this.lintTime - 10)
|
|
175
|
+
this.timeout = setTimeout(this.run, this.lintTime - t);
|
|
176
|
+
else {
|
|
177
|
+
this.set = !1;
|
|
178
|
+
let { state: e } = this.view, { sources: n } = e.facet(v);
|
|
179
|
+
n.length && be(n.map((i) => Promise.resolve(i(this.view))), (i) => {
|
|
180
|
+
this.view.state.doc == e.doc && this.view.dispatch(ue(this.view.state, i.reduce((s, o) => s.concat(o))));
|
|
181
|
+
}, (i) => {
|
|
182
|
+
de(this.view.state, i);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
update(t) {
|
|
187
|
+
let e = t.state.facet(v);
|
|
188
|
+
(t.docChanged || e != t.startState.facet(v) || e.needsRefresh && e.needsRefresh(t)) && (this.lintTime = Date.now() + e.delay, this.set || (this.set = !0, this.timeout = setTimeout(this.run, e.delay)));
|
|
189
|
+
}
|
|
190
|
+
force() {
|
|
191
|
+
this.set && (this.lintTime = Date.now(), this.run());
|
|
192
|
+
}
|
|
193
|
+
destroy() {
|
|
194
|
+
clearTimeout(this.timeout);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
function be(t, e, n) {
|
|
198
|
+
let i = [], s = -1;
|
|
199
|
+
for (let o of t)
|
|
200
|
+
o.then((r) => {
|
|
201
|
+
i.push(r), clearTimeout(s), i.length == t.length ? e(i) : s = setTimeout(() => e(i), 200);
|
|
202
|
+
}, n);
|
|
203
|
+
}
|
|
204
|
+
const v = /* @__PURE__ */ V.define({
|
|
205
|
+
combine(t) {
|
|
206
|
+
return {
|
|
207
|
+
sources: t.map((e) => e.source).filter((e) => e != null),
|
|
208
|
+
...Y(t.map((e) => e.config), {
|
|
209
|
+
delay: 750,
|
|
210
|
+
markerFilter: null,
|
|
211
|
+
tooltipFilter: null,
|
|
212
|
+
needsRefresh: null,
|
|
213
|
+
hideOn: () => null
|
|
214
|
+
}, {
|
|
215
|
+
delay: Math.max,
|
|
216
|
+
markerFilter: z,
|
|
217
|
+
tooltipFilter: z,
|
|
218
|
+
needsRefresh: (e, n) => e ? n ? (i) => e(i) || n(i) : e : n,
|
|
219
|
+
hideOn: (e, n) => e ? n ? (i, s, o) => e(i, s, o) || n(i, s, o) : e : n,
|
|
220
|
+
autoPanel: (e, n) => e || n
|
|
221
|
+
})
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
function z(t, e) {
|
|
226
|
+
return t ? e ? (n, i) => e(t(n, i), i) : t : e;
|
|
227
|
+
}
|
|
228
|
+
function Fe(t, e = {}) {
|
|
229
|
+
return [
|
|
230
|
+
v.of({ source: t, config: e }),
|
|
231
|
+
we,
|
|
232
|
+
te
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
function U(t) {
|
|
236
|
+
let e = [];
|
|
237
|
+
if (t)
|
|
238
|
+
e: for (let { name: n } of t) {
|
|
239
|
+
for (let i = 0; i < n.length; i++) {
|
|
240
|
+
let s = n[i];
|
|
241
|
+
if (/[a-zA-Z]/.test(s) && !e.some((o) => o.toLowerCase() == s.toLowerCase())) {
|
|
242
|
+
e.push(s);
|
|
243
|
+
continue e;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
e.push("");
|
|
247
|
+
}
|
|
248
|
+
return e;
|
|
249
|
+
}
|
|
250
|
+
function X(t, e, n) {
|
|
251
|
+
var i;
|
|
252
|
+
let s = n ? U(e.actions) : [];
|
|
253
|
+
return x("li", { class: "cm-diagnostic cm-diagnostic-" + e.severity }, x("span", { class: "cm-diagnosticText" }, e.renderMessage ? e.renderMessage(t) : e.message), (i = e.actions) === null || i === void 0 ? void 0 : i.map((o, r) => {
|
|
254
|
+
let l = !1, c = (u) => {
|
|
255
|
+
if (u.preventDefault(), l)
|
|
256
|
+
return;
|
|
257
|
+
l = !0;
|
|
258
|
+
let p = T(t.state.field(w).diagnostics, e);
|
|
259
|
+
p && o.apply(t, p.from, p.to);
|
|
260
|
+
}, { name: a } = o, f = s[r] ? a.indexOf(s[r]) : -1, b = f < 0 ? a : [
|
|
261
|
+
a.slice(0, f),
|
|
262
|
+
x("u", a.slice(f, f + 1)),
|
|
263
|
+
a.slice(f + 1)
|
|
264
|
+
], g = o.markClass ? " " + o.markClass : "";
|
|
265
|
+
return x("button", {
|
|
266
|
+
type: "button",
|
|
267
|
+
class: "cm-diagnosticAction" + g,
|
|
268
|
+
onclick: c,
|
|
269
|
+
onmousedown: c,
|
|
270
|
+
"aria-label": ` Action: ${a}${f < 0 ? "" : ` (access key "${s[r]})"`}.`
|
|
271
|
+
}, b);
|
|
272
|
+
}), e.source && x("div", { class: "cm-diagnosticSource" }, e.source));
|
|
273
|
+
}
|
|
274
|
+
class ke extends re {
|
|
275
|
+
constructor(e) {
|
|
276
|
+
super(), this.sev = e;
|
|
277
|
+
}
|
|
278
|
+
eq(e) {
|
|
279
|
+
return e.sev == this.sev;
|
|
280
|
+
}
|
|
281
|
+
toDOM() {
|
|
282
|
+
return x("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
class N {
|
|
286
|
+
constructor(e, n) {
|
|
287
|
+
this.diagnostic = n, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = X(e, n, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
class P {
|
|
291
|
+
constructor(e) {
|
|
292
|
+
this.view = e, this.items = [];
|
|
293
|
+
let n = (s) => {
|
|
294
|
+
if (s.keyCode == 27)
|
|
295
|
+
j(this.view), this.view.focus();
|
|
296
|
+
else if (s.keyCode == 38 || s.keyCode == 33)
|
|
297
|
+
this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
|
|
298
|
+
else if (s.keyCode == 40 || s.keyCode == 34)
|
|
299
|
+
this.moveSelection((this.selectedIndex + 1) % this.items.length);
|
|
300
|
+
else if (s.keyCode == 36)
|
|
301
|
+
this.moveSelection(0);
|
|
302
|
+
else if (s.keyCode == 35)
|
|
303
|
+
this.moveSelection(this.items.length - 1);
|
|
304
|
+
else if (s.keyCode == 13)
|
|
305
|
+
this.view.focus();
|
|
306
|
+
else if (s.keyCode >= 65 && s.keyCode <= 90 && this.selectedIndex >= 0) {
|
|
307
|
+
let { diagnostic: o } = this.items[this.selectedIndex], r = U(o.actions);
|
|
308
|
+
for (let l = 0; l < r.length; l++)
|
|
309
|
+
if (r[l].toUpperCase().charCodeAt(0) == s.keyCode) {
|
|
310
|
+
let c = T(this.view.state.field(w).diagnostics, o);
|
|
311
|
+
c && o.actions[l].apply(e, c.from, c.to);
|
|
312
|
+
}
|
|
313
|
+
} else
|
|
314
|
+
return;
|
|
315
|
+
s.preventDefault();
|
|
316
|
+
}, i = (s) => {
|
|
317
|
+
for (let o = 0; o < this.items.length; o++)
|
|
318
|
+
this.items[o].dom.contains(s.target) && this.moveSelection(o);
|
|
319
|
+
};
|
|
320
|
+
this.list = x("ul", {
|
|
321
|
+
tabIndex: 0,
|
|
322
|
+
role: "listbox",
|
|
323
|
+
"aria-label": this.view.state.phrase("Diagnostics"),
|
|
324
|
+
onkeydown: n,
|
|
325
|
+
onclick: i
|
|
326
|
+
}), this.dom = x("div", { class: "cm-panel-lint" }, this.list, x("button", {
|
|
327
|
+
type: "button",
|
|
328
|
+
name: "close",
|
|
329
|
+
"aria-label": this.view.state.phrase("close"),
|
|
330
|
+
onclick: () => j(this.view)
|
|
331
|
+
}, "×")), this.update();
|
|
332
|
+
}
|
|
333
|
+
get selectedIndex() {
|
|
334
|
+
let e = this.view.state.field(w).selected;
|
|
335
|
+
if (!e)
|
|
336
|
+
return -1;
|
|
337
|
+
for (let n = 0; n < this.items.length; n++)
|
|
338
|
+
if (this.items[n].diagnostic == e.diagnostic)
|
|
339
|
+
return n;
|
|
340
|
+
return -1;
|
|
341
|
+
}
|
|
342
|
+
update() {
|
|
343
|
+
let { diagnostics: e, selected: n } = this.view.state.field(w), i = 0, s = !1, o = null, r = /* @__PURE__ */ new Set();
|
|
344
|
+
for (e.between(0, this.view.state.doc.length, (l, c, { spec: a }) => {
|
|
345
|
+
for (let f of a.diagnostics) {
|
|
346
|
+
if (r.has(f))
|
|
347
|
+
continue;
|
|
348
|
+
r.add(f);
|
|
349
|
+
let b = -1, g;
|
|
350
|
+
for (let u = i; u < this.items.length; u++)
|
|
351
|
+
if (this.items[u].diagnostic == f) {
|
|
352
|
+
b = u;
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
b < 0 ? (g = new N(this.view, f), this.items.splice(i, 0, g), s = !0) : (g = this.items[b], b > i && (this.items.splice(i, b - i), s = !0)), n && g.diagnostic == n.diagnostic ? g.dom.hasAttribute("aria-selected") || (g.dom.setAttribute("aria-selected", "true"), o = g) : g.dom.hasAttribute("aria-selected") && g.dom.removeAttribute("aria-selected"), i++;
|
|
356
|
+
}
|
|
357
|
+
}); i < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); )
|
|
358
|
+
s = !0, this.items.pop();
|
|
359
|
+
this.items.length == 0 && (this.items.push(new N(this.view, {
|
|
360
|
+
from: -1,
|
|
361
|
+
to: -1,
|
|
362
|
+
severity: "info",
|
|
363
|
+
message: this.view.state.phrase("No diagnostics")
|
|
364
|
+
})), s = !0), o ? (this.list.setAttribute("aria-activedescendant", o.id), this.view.requestMeasure({
|
|
365
|
+
key: this,
|
|
366
|
+
read: () => ({ sel: o.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
|
|
367
|
+
write: ({ sel: l, panel: c }) => {
|
|
368
|
+
let a = c.height / this.list.offsetHeight;
|
|
369
|
+
l.top < c.top ? this.list.scrollTop -= (c.top - l.top) / a : l.bottom > c.bottom && (this.list.scrollTop += (l.bottom - c.bottom) / a);
|
|
370
|
+
}
|
|
371
|
+
})) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), s && this.sync();
|
|
372
|
+
}
|
|
373
|
+
sync() {
|
|
374
|
+
let e = this.list.firstChild;
|
|
375
|
+
function n() {
|
|
376
|
+
let i = e;
|
|
377
|
+
e = i.nextSibling, i.remove();
|
|
378
|
+
}
|
|
379
|
+
for (let i of this.items)
|
|
380
|
+
if (i.dom.parentNode == this.list) {
|
|
381
|
+
for (; e != i.dom; )
|
|
382
|
+
n();
|
|
383
|
+
e = i.dom.nextSibling;
|
|
384
|
+
} else
|
|
385
|
+
this.list.insertBefore(i.dom, e);
|
|
386
|
+
for (; e; )
|
|
387
|
+
n();
|
|
388
|
+
}
|
|
389
|
+
moveSelection(e) {
|
|
390
|
+
if (this.selectedIndex < 0)
|
|
391
|
+
return;
|
|
392
|
+
let n = this.view.state.field(w), i = T(n.diagnostics, this.items[e].diagnostic);
|
|
393
|
+
i && this.view.dispatch({
|
|
394
|
+
selection: { anchor: i.from, head: i.to },
|
|
395
|
+
scrollIntoView: !0,
|
|
396
|
+
effects: Z.of(i)
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
static open(e) {
|
|
400
|
+
return new P(e);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function M(t, e = 'viewBox="0 0 40 40"') {
|
|
404
|
+
return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`;
|
|
405
|
+
}
|
|
406
|
+
function L(t) {
|
|
407
|
+
return M(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
|
|
408
|
+
}
|
|
409
|
+
const xe = /* @__PURE__ */ D.baseTheme({
|
|
410
|
+
".cm-diagnostic": {
|
|
411
|
+
padding: "3px 6px 3px 8px",
|
|
412
|
+
marginLeft: "-1px",
|
|
413
|
+
display: "block",
|
|
414
|
+
whiteSpace: "pre-wrap"
|
|
415
|
+
},
|
|
416
|
+
".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
|
|
417
|
+
".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
|
|
418
|
+
".cm-diagnostic-info": { borderLeft: "5px solid #999" },
|
|
419
|
+
".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
|
|
420
|
+
".cm-diagnosticAction": {
|
|
421
|
+
font: "inherit",
|
|
422
|
+
border: "none",
|
|
423
|
+
padding: "2px 4px",
|
|
424
|
+
backgroundColor: "#444",
|
|
425
|
+
color: "white",
|
|
426
|
+
borderRadius: "3px",
|
|
427
|
+
marginLeft: "8px",
|
|
428
|
+
cursor: "pointer"
|
|
429
|
+
},
|
|
430
|
+
".cm-diagnosticSource": {
|
|
431
|
+
fontSize: "70%",
|
|
432
|
+
opacity: 0.7
|
|
433
|
+
},
|
|
434
|
+
".cm-lintRange": {
|
|
435
|
+
backgroundPosition: "left bottom",
|
|
436
|
+
backgroundRepeat: "repeat-x",
|
|
437
|
+
paddingBottom: "0.7px"
|
|
438
|
+
},
|
|
439
|
+
".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ L("#d11") },
|
|
440
|
+
".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ L("orange") },
|
|
441
|
+
".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ L("#999") },
|
|
442
|
+
".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ L("#66d") },
|
|
443
|
+
".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
|
|
444
|
+
".cm-tooltip-lint": {
|
|
445
|
+
padding: 0,
|
|
446
|
+
margin: 0
|
|
447
|
+
},
|
|
448
|
+
".cm-lintPoint": {
|
|
449
|
+
position: "relative",
|
|
450
|
+
"&:after": {
|
|
451
|
+
content: '""',
|
|
452
|
+
position: "absolute",
|
|
453
|
+
bottom: 0,
|
|
454
|
+
left: "-2px",
|
|
455
|
+
borderLeft: "3px solid transparent",
|
|
456
|
+
borderRight: "3px solid transparent",
|
|
457
|
+
borderBottom: "4px solid #d11"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
".cm-lintPoint-warning": {
|
|
461
|
+
"&:after": { borderBottomColor: "orange" }
|
|
462
|
+
},
|
|
463
|
+
".cm-lintPoint-info": {
|
|
464
|
+
"&:after": { borderBottomColor: "#999" }
|
|
465
|
+
},
|
|
466
|
+
".cm-lintPoint-hint": {
|
|
467
|
+
"&:after": { borderBottomColor: "#66d" }
|
|
468
|
+
},
|
|
469
|
+
".cm-panel.cm-panel-lint": {
|
|
470
|
+
position: "relative",
|
|
471
|
+
"& ul": {
|
|
472
|
+
maxHeight: "100px",
|
|
473
|
+
overflowY: "auto",
|
|
474
|
+
"& [aria-selected]": {
|
|
475
|
+
backgroundColor: "#ddd",
|
|
476
|
+
"& u": { textDecoration: "underline" }
|
|
477
|
+
},
|
|
478
|
+
"&:focus [aria-selected]": {
|
|
479
|
+
background_fallback: "#bdf",
|
|
480
|
+
backgroundColor: "Highlight",
|
|
481
|
+
color_fallback: "white",
|
|
482
|
+
color: "HighlightText"
|
|
483
|
+
},
|
|
484
|
+
"& u": { textDecoration: "none" },
|
|
485
|
+
padding: 0,
|
|
486
|
+
margin: 0
|
|
487
|
+
},
|
|
488
|
+
"& [name=close]": {
|
|
489
|
+
position: "absolute",
|
|
490
|
+
top: "0",
|
|
491
|
+
right: "2px",
|
|
492
|
+
background: "inherit",
|
|
493
|
+
border: "none",
|
|
494
|
+
font: "inherit",
|
|
495
|
+
padding: 0,
|
|
496
|
+
margin: 0
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
function ve(t) {
|
|
501
|
+
return t == "error" ? 4 : t == "warning" ? 3 : t == "info" ? 2 : 1;
|
|
502
|
+
}
|
|
503
|
+
function J(t) {
|
|
504
|
+
let e = "hint", n = 1;
|
|
505
|
+
for (let i of t) {
|
|
506
|
+
let s = ve(i.severity);
|
|
507
|
+
s > n && (n = s, e = i.severity);
|
|
508
|
+
}
|
|
509
|
+
return e;
|
|
510
|
+
}
|
|
511
|
+
class Q extends ae {
|
|
512
|
+
constructor(e) {
|
|
513
|
+
super(), this.diagnostics = e, this.severity = J(e);
|
|
514
|
+
}
|
|
515
|
+
toDOM(e) {
|
|
516
|
+
let n = document.createElement("div");
|
|
517
|
+
n.className = "cm-lint-marker cm-lint-marker-" + this.severity;
|
|
518
|
+
let i = this.diagnostics, s = e.state.facet(I).tooltipFilter;
|
|
519
|
+
return s && (i = s(i, e.state)), i.length && (n.onmouseover = () => Ce(e, n, i)), n;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
function ye(t, e) {
|
|
523
|
+
let n = (i) => {
|
|
524
|
+
let s = e.getBoundingClientRect();
|
|
525
|
+
if (!(i.clientX > s.left - 10 && i.clientX < s.right + 10 && i.clientY > s.top - 10 && i.clientY < s.bottom + 10)) {
|
|
526
|
+
for (let o = i.target; o; o = o.parentNode)
|
|
527
|
+
if (o.nodeType == 1 && o.classList.contains("cm-tooltip-lint"))
|
|
528
|
+
return;
|
|
529
|
+
window.removeEventListener("mousemove", n), t.state.field(ee) && t.dispatch({ effects: O.of(null) });
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
window.addEventListener("mousemove", n);
|
|
533
|
+
}
|
|
534
|
+
function Ce(t, e, n) {
|
|
535
|
+
function i() {
|
|
536
|
+
let r = t.elementAtHeight(e.getBoundingClientRect().top + 5 - t.documentTop);
|
|
537
|
+
t.coordsAtPos(r.from) && t.dispatch({ effects: O.of({
|
|
538
|
+
pos: r.from,
|
|
539
|
+
above: !1,
|
|
540
|
+
clip: !1,
|
|
541
|
+
create() {
|
|
542
|
+
return {
|
|
543
|
+
dom: K(t, n),
|
|
544
|
+
getCoords: () => e.getBoundingClientRect()
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
}) }), e.onmouseout = e.onmousemove = null, ye(t, e);
|
|
548
|
+
}
|
|
549
|
+
let { hoverTime: s } = t.state.facet(I), o = setTimeout(i, s);
|
|
550
|
+
e.onmouseout = () => {
|
|
551
|
+
clearTimeout(o), e.onmouseout = e.onmousemove = null;
|
|
552
|
+
}, e.onmousemove = () => {
|
|
553
|
+
clearTimeout(o), o = setTimeout(i, s);
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
function Te(t, e) {
|
|
557
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
558
|
+
for (let s of e) {
|
|
559
|
+
let o = t.lineAt(s.from);
|
|
560
|
+
(n[o.from] || (n[o.from] = [])).push(s);
|
|
561
|
+
}
|
|
562
|
+
let i = [];
|
|
563
|
+
for (let s in n)
|
|
564
|
+
i.push(new Q(n[s]).range(+s));
|
|
565
|
+
return _.of(i, !0);
|
|
566
|
+
}
|
|
567
|
+
const Pe = /* @__PURE__ */ se({
|
|
568
|
+
class: "cm-gutter-lint",
|
|
569
|
+
markers: (t) => t.state.field(A),
|
|
570
|
+
widgetMarker: (t, e, n) => {
|
|
571
|
+
let i = [];
|
|
572
|
+
return t.state.field(A).between(n.from, n.to, (s, o, r) => {
|
|
573
|
+
s > n.from && s < n.to && i.push(...r.diagnostics);
|
|
574
|
+
}), i.length ? new Q(i) : null;
|
|
575
|
+
}
|
|
576
|
+
}), A = /* @__PURE__ */ B.define({
|
|
577
|
+
create() {
|
|
578
|
+
return _.empty;
|
|
579
|
+
},
|
|
580
|
+
update(t, e) {
|
|
581
|
+
t = t.map(e.changes);
|
|
582
|
+
let n = e.state.facet(I).markerFilter;
|
|
583
|
+
for (let i of e.effects)
|
|
584
|
+
if (i.is(F)) {
|
|
585
|
+
let s = i.value;
|
|
586
|
+
n && (s = n(s || [], e.state)), t = Te(e.state.doc, s.slice(0));
|
|
587
|
+
}
|
|
588
|
+
return t;
|
|
589
|
+
}
|
|
590
|
+
}), O = /* @__PURE__ */ S.define(), ee = /* @__PURE__ */ B.define({
|
|
591
|
+
create() {
|
|
592
|
+
return null;
|
|
593
|
+
},
|
|
594
|
+
update(t, e) {
|
|
595
|
+
return t && e.docChanged && (t = q(e, t) ? null : { ...t, pos: e.changes.mapPos(t.pos) }), e.effects.reduce((n, i) => i.is(O) ? i.value : n, t);
|
|
596
|
+
},
|
|
597
|
+
provide: (t) => le.from(t)
|
|
598
|
+
}), Se = /* @__PURE__ */ D.baseTheme({
|
|
599
|
+
".cm-gutter-lint": {
|
|
600
|
+
width: "1.4em",
|
|
601
|
+
"& .cm-gutterElement": {
|
|
602
|
+
padding: ".2em"
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
".cm-lint-marker": {
|
|
606
|
+
width: "1em",
|
|
607
|
+
height: "1em"
|
|
608
|
+
},
|
|
609
|
+
".cm-lint-marker-info": {
|
|
610
|
+
content: /* @__PURE__ */ M('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')
|
|
611
|
+
},
|
|
612
|
+
".cm-lint-marker-warning": {
|
|
613
|
+
content: /* @__PURE__ */ M('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')
|
|
614
|
+
},
|
|
615
|
+
".cm-lint-marker-error": {
|
|
616
|
+
content: /* @__PURE__ */ M('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')
|
|
617
|
+
}
|
|
618
|
+
}), te = [
|
|
619
|
+
w,
|
|
620
|
+
/* @__PURE__ */ D.decorations.compute([w], (t) => {
|
|
621
|
+
let { selected: e, panel: n } = t.field(w);
|
|
622
|
+
return !e || !n || e.from == e.to ? C.none : C.set([
|
|
623
|
+
me.range(e.from, e.to)
|
|
624
|
+
]);
|
|
625
|
+
}),
|
|
626
|
+
/* @__PURE__ */ ne(he, { hideOn: q }),
|
|
627
|
+
xe
|
|
628
|
+
], I = /* @__PURE__ */ V.define({
|
|
629
|
+
combine(t) {
|
|
630
|
+
return Y(t, {
|
|
631
|
+
hoverTime: 300,
|
|
632
|
+
markerFilter: null,
|
|
633
|
+
tooltipFilter: null
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
function Ie(t = {}) {
|
|
638
|
+
return [I.of(t), A, Pe, Se, ee];
|
|
639
|
+
}
|
|
640
|
+
export {
|
|
641
|
+
j as closeLintPanel,
|
|
642
|
+
Ie as lintGutter,
|
|
643
|
+
De as lintKeymap,
|
|
644
|
+
Fe as linter,
|
|
645
|
+
pe as nextDiagnostic,
|
|
646
|
+
ge as openLintPanel,
|
|
647
|
+
ue as setDiagnostics,
|
|
648
|
+
F as setDiagnosticsEffect
|
|
649
|
+
};
|