@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,216 @@
|
|
|
1
|
+
import { parser as I } from "../../../@lezer/xml/dist/index.js";
|
|
2
|
+
import { LRLanguage as F, LanguageSupport as L, indentNodeProp as _, foldNodeProp as w, bracketMatchingHandle as x, syntaxTree as $ } from "../../language/dist/index.js";
|
|
3
|
+
import { EditorSelection as M } from "../../state/dist/index.js";
|
|
4
|
+
import { EditorView as k } from "../../view/dist/index.js";
|
|
5
|
+
function v(e, t) {
|
|
6
|
+
let i = t && t.getChild("TagName");
|
|
7
|
+
return i ? e.sliceString(i.from, i.to) : "";
|
|
8
|
+
}
|
|
9
|
+
function O(e, t) {
|
|
10
|
+
let i = t && t.firstChild;
|
|
11
|
+
return !i || i.name != "OpenTag" ? "" : v(e, i);
|
|
12
|
+
}
|
|
13
|
+
function D(e, t, i) {
|
|
14
|
+
let n = t && t.getChildren("Attribute").find((o) => o.from <= i && o.to >= i), a = n && n.getChild("AttributeName");
|
|
15
|
+
return a ? e.sliceString(a.from, a.to) : "";
|
|
16
|
+
}
|
|
17
|
+
function N(e) {
|
|
18
|
+
for (let t = e && e.parent; t; t = t.parent)
|
|
19
|
+
if (t.name == "Element")
|
|
20
|
+
return t;
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function P(e, t) {
|
|
24
|
+
var i;
|
|
25
|
+
let n = $(e).resolveInner(t, -1), a = null;
|
|
26
|
+
for (let o = n; !a && o.parent; o = o.parent)
|
|
27
|
+
(o.name == "OpenTag" || o.name == "CloseTag" || o.name == "SelfClosingTag" || o.name == "MismatchedCloseTag") && (a = o);
|
|
28
|
+
if (a && (a.to > t || a.lastChild.type.isError)) {
|
|
29
|
+
let o = a.parent;
|
|
30
|
+
if (n.name == "TagName")
|
|
31
|
+
return a.name == "CloseTag" || a.name == "MismatchedCloseTag" ? { type: "closeTag", from: n.from, context: o } : { type: "openTag", from: n.from, context: N(o) };
|
|
32
|
+
if (n.name == "AttributeName")
|
|
33
|
+
return { type: "attrName", from: n.from, context: a };
|
|
34
|
+
if (n.name == "AttributeValue")
|
|
35
|
+
return { type: "attrValue", from: n.from, context: a };
|
|
36
|
+
let s = n == a || n.name == "Attribute" ? n.childBefore(t) : n;
|
|
37
|
+
return s?.name == "StartTag" ? { type: "openTag", from: t, context: N(o) } : s?.name == "StartCloseTag" && s.to <= t ? { type: "closeTag", from: t, context: o } : s?.name == "Is" ? { type: "attrValue", from: t, context: a } : s ? { type: "attrName", from: t, context: a } : null;
|
|
38
|
+
} else if (n.name == "StartCloseTag")
|
|
39
|
+
return { type: "closeTag", from: t, context: n.parent };
|
|
40
|
+
for (; n.parent && n.to == t && !(!((i = n.lastChild) === null || i === void 0) && i.type.isError); )
|
|
41
|
+
n = n.parent;
|
|
42
|
+
return n.name == "Element" || n.name == "Text" || n.name == "Document" ? { type: "tag", from: t, context: n.name == "Element" ? n : N(n) } : null;
|
|
43
|
+
}
|
|
44
|
+
class B {
|
|
45
|
+
constructor(t, i, n) {
|
|
46
|
+
this.attrs = i, this.attrValues = n, this.children = [], this.name = t.name, this.completion = Object.assign(Object.assign({ type: "type" }, t.completion || {}), { label: this.name }), this.openCompletion = Object.assign(Object.assign({}, this.completion), { label: "<" + this.name }), this.closeCompletion = Object.assign(Object.assign({}, this.completion), { label: "</" + this.name + ">", boost: 2 }), this.closeNameCompletion = Object.assign(Object.assign({}, this.completion), { label: this.name + ">" }), this.text = t.textContent ? t.textContent.map((a) => ({ label: a, type: "text" })) : [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const S = /^[:\-\.\w\u00b7-\uffff]*$/;
|
|
50
|
+
function E(e) {
|
|
51
|
+
return Object.assign(Object.assign({ type: "property" }, e.completion || {}), { label: e.name });
|
|
52
|
+
}
|
|
53
|
+
function A(e) {
|
|
54
|
+
return typeof e == "string" ? { label: `"${e}"`, type: "constant" } : /^"/.test(e.label) ? e : Object.assign(Object.assign({}, e), { label: `"${e.label}"` });
|
|
55
|
+
}
|
|
56
|
+
function H(e, t) {
|
|
57
|
+
let i = [], n = [], a = /* @__PURE__ */ Object.create(null);
|
|
58
|
+
for (let l of t) {
|
|
59
|
+
let p = E(l);
|
|
60
|
+
i.push(p), l.global && n.push(p), l.values && (a[l.name] = l.values.map(A));
|
|
61
|
+
}
|
|
62
|
+
let o = [], s = [], h = /* @__PURE__ */ Object.create(null);
|
|
63
|
+
for (let l of e) {
|
|
64
|
+
let p = n, u = a;
|
|
65
|
+
l.attributes && (p = p.concat(l.attributes.map((r) => typeof r == "string" ? i.find((b) => b.label == r) || { label: r, type: "property" } : (r.values && (u == a && (u = Object.create(u)), u[r.name] = r.values.map(A)), E(r)))));
|
|
66
|
+
let d = new B(l, p, u);
|
|
67
|
+
h[d.name] = d, o.push(d), l.top && s.push(d);
|
|
68
|
+
}
|
|
69
|
+
s.length || (s = o);
|
|
70
|
+
for (let l = 0; l < o.length; l++) {
|
|
71
|
+
let p = e[l], u = o[l];
|
|
72
|
+
if (p.children)
|
|
73
|
+
for (let d of p.children)
|
|
74
|
+
h[d] && u.children.push(h[d]);
|
|
75
|
+
else
|
|
76
|
+
u.children = o;
|
|
77
|
+
}
|
|
78
|
+
return (l) => {
|
|
79
|
+
var p;
|
|
80
|
+
let { doc: u } = l.state, d = P(l.state, l.pos);
|
|
81
|
+
if (!d || d.type == "tag" && !l.explicit)
|
|
82
|
+
return null;
|
|
83
|
+
let { type: r, from: b, context: c } = d;
|
|
84
|
+
if (r == "openTag") {
|
|
85
|
+
let m = s, f = O(u, c);
|
|
86
|
+
if (f) {
|
|
87
|
+
let g = h[f];
|
|
88
|
+
m = g?.children || o;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
from: b,
|
|
92
|
+
options: m.map((g) => g.completion),
|
|
93
|
+
validFor: S
|
|
94
|
+
};
|
|
95
|
+
} else if (r == "closeTag") {
|
|
96
|
+
let m = O(u, c);
|
|
97
|
+
return m ? {
|
|
98
|
+
from: b,
|
|
99
|
+
to: l.pos + (u.sliceString(l.pos, l.pos + 1) == ">" ? 1 : 0),
|
|
100
|
+
options: [((p = h[m]) === null || p === void 0 ? void 0 : p.closeNameCompletion) || { label: m + ">", type: "type" }],
|
|
101
|
+
validFor: S
|
|
102
|
+
} : null;
|
|
103
|
+
} else if (r == "attrName") {
|
|
104
|
+
let m = h[v(u, c)];
|
|
105
|
+
return {
|
|
106
|
+
from: b,
|
|
107
|
+
options: m?.attrs || n,
|
|
108
|
+
validFor: S
|
|
109
|
+
};
|
|
110
|
+
} else if (r == "attrValue") {
|
|
111
|
+
let m = D(u, c, b);
|
|
112
|
+
if (!m)
|
|
113
|
+
return null;
|
|
114
|
+
let f = h[v(u, c)], g = (f?.attrValues || a)[m];
|
|
115
|
+
return !g || !g.length ? null : {
|
|
116
|
+
from: b,
|
|
117
|
+
to: l.pos + (u.sliceString(l.pos, l.pos + 1) == '"' ? 1 : 0),
|
|
118
|
+
options: g,
|
|
119
|
+
validFor: /^"[^"]*"?$/
|
|
120
|
+
};
|
|
121
|
+
} else if (r == "tag") {
|
|
122
|
+
let m = O(u, c), f = h[m], g = [], C = c && c.lastChild;
|
|
123
|
+
m && (!C || C.name != "CloseTag" || v(u, C) != m) && g.push(f ? f.closeCompletion : { label: "</" + m + ">", type: "type", boost: 2 });
|
|
124
|
+
let y = g.concat((f?.children || (c ? o : s)).map((T) => T.openCompletion));
|
|
125
|
+
if (c && f?.text.length) {
|
|
126
|
+
let T = c.firstChild;
|
|
127
|
+
T.to > l.pos - 20 && !/\S/.test(l.state.sliceDoc(T.to, l.pos)) && (y = y.concat(f.text));
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
from: b,
|
|
131
|
+
options: y,
|
|
132
|
+
validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/
|
|
133
|
+
};
|
|
134
|
+
} else
|
|
135
|
+
return null;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const j = /* @__PURE__ */ F.define({
|
|
139
|
+
name: "xml",
|
|
140
|
+
parser: /* @__PURE__ */ I.configure({
|
|
141
|
+
props: [
|
|
142
|
+
/* @__PURE__ */ _.add({
|
|
143
|
+
Element(e) {
|
|
144
|
+
let t = /^\s*<\//.test(e.textAfter);
|
|
145
|
+
return e.lineIndent(e.node.from) + (t ? 0 : e.unit);
|
|
146
|
+
},
|
|
147
|
+
"OpenTag CloseTag SelfClosingTag"(e) {
|
|
148
|
+
return e.column(e.node.from) + e.unit;
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ w.add({
|
|
152
|
+
Element(e) {
|
|
153
|
+
let t = e.firstChild, i = e.lastChild;
|
|
154
|
+
return !t || t.name != "OpenTag" ? null : { from: t.to, to: i.name == "CloseTag" ? i.from : e.to };
|
|
155
|
+
}
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ x.add({
|
|
158
|
+
"OpenTag CloseTag": (e) => e.getChild("TagName")
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
languageData: {
|
|
163
|
+
commentTokens: { block: { open: "<!--", close: "-->" } },
|
|
164
|
+
indentOnInput: /^\s*<\/$/
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
function K(e = {}) {
|
|
168
|
+
let t = [j.data.of({
|
|
169
|
+
autocomplete: H(e.elements || [], e.attributes || [])
|
|
170
|
+
})];
|
|
171
|
+
return e.autoCloseTags !== !1 && t.push(R), new L(j, t);
|
|
172
|
+
}
|
|
173
|
+
function V(e, t, i = e.length) {
|
|
174
|
+
if (!t)
|
|
175
|
+
return "";
|
|
176
|
+
let n = t.firstChild, a = n && n.getChild("TagName");
|
|
177
|
+
return a ? e.sliceString(a.from, Math.min(a.to, i)) : "";
|
|
178
|
+
}
|
|
179
|
+
const R = /* @__PURE__ */ k.inputHandler.of((e, t, i, n, a) => {
|
|
180
|
+
if (e.composing || e.state.readOnly || t != i || n != ">" && n != "/" || !j.isActiveAt(e.state, t, -1))
|
|
181
|
+
return !1;
|
|
182
|
+
let o = a(), { state: s } = o, h = s.changeByRange((l) => {
|
|
183
|
+
var p, u, d;
|
|
184
|
+
let { head: r } = l, b = s.doc.sliceString(r - 1, r) == n, c = $(s).resolveInner(r, -1), m;
|
|
185
|
+
if (b && n == ">" && c.name == "EndTag") {
|
|
186
|
+
let f = c.parent;
|
|
187
|
+
if (((u = (p = f.parent) === null || p === void 0 ? void 0 : p.lastChild) === null || u === void 0 ? void 0 : u.name) != "CloseTag" && (m = V(s.doc, f.parent, r))) {
|
|
188
|
+
let g = r + (s.doc.sliceString(r, r + 1) === ">" ? 1 : 0), C = `</${m}>`;
|
|
189
|
+
return { range: l, changes: { from: r, to: g, insert: C } };
|
|
190
|
+
}
|
|
191
|
+
} else if (b && n == "/" && c.name == "StartCloseTag") {
|
|
192
|
+
let f = c.parent;
|
|
193
|
+
if (c.from == r - 2 && ((d = f.lastChild) === null || d === void 0 ? void 0 : d.name) != "CloseTag" && (m = V(s.doc, f, r))) {
|
|
194
|
+
let g = r + (s.doc.sliceString(r, r + 1) === ">" ? 1 : 0), C = `${m}>`;
|
|
195
|
+
return {
|
|
196
|
+
range: M.cursor(r + C.length, -1),
|
|
197
|
+
changes: { from: r, to: g, insert: C }
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return { range: l };
|
|
202
|
+
});
|
|
203
|
+
return h.changes.empty ? !1 : (e.dispatch([
|
|
204
|
+
o,
|
|
205
|
+
s.update(h, {
|
|
206
|
+
userEvent: "input.complete",
|
|
207
|
+
scrollIntoView: !0
|
|
208
|
+
})
|
|
209
|
+
]), !0);
|
|
210
|
+
});
|
|
211
|
+
export {
|
|
212
|
+
R as autoCloseTags,
|
|
213
|
+
H as completeFromSchema,
|
|
214
|
+
K as xml,
|
|
215
|
+
j as xmlLanguage
|
|
216
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { parser as t } from "../../../@lezer/yaml/dist/index.js";
|
|
2
|
+
import { LanguageSupport as l, LRLanguage as a, indentNodeProp as i, foldNodeProp as m, delimitedIndent as r, foldInside as u } from "../../language/dist/index.js";
|
|
3
|
+
import "../../../@lezer/common/dist/index.js";
|
|
4
|
+
import "../../../@lezer/highlight/dist/index.js";
|
|
5
|
+
import "../../../@lezer/lr/dist/index.js";
|
|
6
|
+
const p = /* @__PURE__ */ a.define({
|
|
7
|
+
name: "yaml",
|
|
8
|
+
parser: /* @__PURE__ */ t.configure({
|
|
9
|
+
props: [
|
|
10
|
+
/* @__PURE__ */ i.add({
|
|
11
|
+
Stream: (n) => {
|
|
12
|
+
for (let e = n.node.resolve(n.pos, -1); e && e.to >= n.pos; e = e.parent) {
|
|
13
|
+
if (e.name == "BlockLiteralContent" && e.from < e.to)
|
|
14
|
+
return n.baseIndentFor(e);
|
|
15
|
+
if (e.name == "BlockLiteral")
|
|
16
|
+
return n.baseIndentFor(e) + n.unit;
|
|
17
|
+
if (e.name == "BlockSequence" || e.name == "BlockMapping")
|
|
18
|
+
return n.column(e.from, 1);
|
|
19
|
+
if (e.name == "QuotedLiteral")
|
|
20
|
+
return null;
|
|
21
|
+
if (e.name == "Literal") {
|
|
22
|
+
let o = n.column(e.from, 1);
|
|
23
|
+
if (o == n.lineIndent(e.from, 1))
|
|
24
|
+
return o;
|
|
25
|
+
if (e.to > n.pos)
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
},
|
|
31
|
+
FlowMapping: /* @__PURE__ */ r({ closing: "}" }),
|
|
32
|
+
FlowSequence: /* @__PURE__ */ r({ closing: "]" })
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ m.add({
|
|
35
|
+
"FlowMapping FlowSequence": u,
|
|
36
|
+
"Item Pair BlockLiteral": (n, e) => ({ from: e.doc.lineAt(n.from).to, to: n.to })
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
languageData: {
|
|
41
|
+
commentTokens: { line: "#" },
|
|
42
|
+
indentOnInput: /^\s*[\]\}]$/
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
function L() {
|
|
46
|
+
return new l(p);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
L as yaml,
|
|
50
|
+
p as yamlLanguage
|
|
51
|
+
};
|