@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.
Files changed (231) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/es/index.js +35 -0
  3. package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1371 -0
  4. package/dist/es/node_modules/@codemirror/commands/dist/index.js +838 -0
  5. package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +38 -0
  6. package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +300 -0
  7. package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +48 -0
  8. package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +399 -0
  9. package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +497 -0
  10. package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +216 -0
  11. package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +51 -0
  12. package/dist/es/node_modules/@codemirror/language/dist/index.js +1299 -0
  13. package/dist/es/node_modules/@codemirror/lint/dist/index.js +649 -0
  14. package/dist/es/node_modules/@codemirror/search/dist/index.js +872 -0
  15. package/dist/es/node_modules/@codemirror/state/dist/index.js +2639 -0
  16. package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +132 -0
  17. package/dist/es/node_modules/@codemirror/view/dist/index.js +7280 -0
  18. package/dist/es/node_modules/@lezer/common/dist/index.js +1430 -0
  19. package/dist/es/node_modules/@lezer/highlight/dist/index.js +637 -0
  20. package/dist/es/node_modules/@lezer/java/dist/index.js +62 -0
  21. package/dist/es/node_modules/@lezer/javascript/dist/index.js +161 -0
  22. package/dist/es/node_modules/@lezer/json/dist/index.js +34 -0
  23. package/dist/es/node_modules/@lezer/lr/dist/index.js +1307 -0
  24. package/dist/es/node_modules/@lezer/python/dist/index.js +221 -0
  25. package/dist/es/node_modules/@lezer/xml/dist/index.js +100 -0
  26. package/dist/es/node_modules/@lezer/yaml/dist/index.js +274 -0
  27. package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +69 -0
  28. package/dist/es/node_modules/@vueuse/core/dist/index.js +125 -0
  29. package/dist/es/node_modules/@vueuse/shared/dist/index.js +55 -0
  30. package/dist/es/node_modules/codemirror/dist/index.js +40 -0
  31. package/dist/es/node_modules/crelt/index.js +27 -0
  32. package/dist/es/node_modules/lodash-es/_Hash.js +20 -0
  33. package/dist/es/node_modules/lodash-es/_ListCache.js +20 -0
  34. package/dist/es/node_modules/lodash-es/_Map.js +6 -0
  35. package/dist/es/node_modules/lodash-es/_MapCache.js +20 -0
  36. package/dist/es/node_modules/lodash-es/_Symbol.js +5 -0
  37. package/dist/es/node_modules/lodash-es/_arrayMap.js +8 -0
  38. package/dist/es/node_modules/lodash-es/_assocIndexOf.js +10 -0
  39. package/dist/es/node_modules/lodash-es/_baseGet.js +11 -0
  40. package/dist/es/node_modules/lodash-es/_baseGetTag.js +10 -0
  41. package/dist/es/node_modules/lodash-es/_baseIsNative.js +16 -0
  42. package/dist/es/node_modules/lodash-es/_baseToString.js +18 -0
  43. package/dist/es/node_modules/lodash-es/_castPath.js +10 -0
  44. package/dist/es/node_modules/lodash-es/_coreJsData.js +5 -0
  45. package/dist/es/node_modules/lodash-es/_freeGlobal.js +4 -0
  46. package/dist/es/node_modules/lodash-es/_getMapData.js +8 -0
  47. package/dist/es/node_modules/lodash-es/_getNative.js +9 -0
  48. package/dist/es/node_modules/lodash-es/_getRawTag.js +15 -0
  49. package/dist/es/node_modules/lodash-es/_getValue.js +6 -0
  50. package/dist/es/node_modules/lodash-es/_hashClear.js +7 -0
  51. package/dist/es/node_modules/lodash-es/_hashDelete.js +7 -0
  52. package/dist/es/node_modules/lodash-es/_hashGet.js +13 -0
  53. package/dist/es/node_modules/lodash-es/_hashHas.js +9 -0
  54. package/dist/es/node_modules/lodash-es/_hashSet.js +9 -0
  55. package/dist/es/node_modules/lodash-es/_isKey.js +12 -0
  56. package/dist/es/node_modules/lodash-es/_isKeyable.js +7 -0
  57. package/dist/es/node_modules/lodash-es/_isMasked.js +11 -0
  58. package/dist/es/node_modules/lodash-es/_listCacheClear.js +6 -0
  59. package/dist/es/node_modules/lodash-es/_listCacheDelete.js +12 -0
  60. package/dist/es/node_modules/lodash-es/_listCacheGet.js +8 -0
  61. package/dist/es/node_modules/lodash-es/_listCacheHas.js +7 -0
  62. package/dist/es/node_modules/lodash-es/_listCacheSet.js +8 -0
  63. package/dist/es/node_modules/lodash-es/_mapCacheClear.js +13 -0
  64. package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  65. package/dist/es/node_modules/lodash-es/_mapCacheGet.js +7 -0
  66. package/dist/es/node_modules/lodash-es/_mapCacheHas.js +7 -0
  67. package/dist/es/node_modules/lodash-es/_mapCacheSet.js +8 -0
  68. package/dist/es/node_modules/lodash-es/_memoizeCapped.js +11 -0
  69. package/dist/es/node_modules/lodash-es/_nativeCreate.js +5 -0
  70. package/dist/es/node_modules/lodash-es/_objectToString.js +7 -0
  71. package/dist/es/node_modules/lodash-es/_root.js +5 -0
  72. package/dist/es/node_modules/lodash-es/_stringToPath.js +10 -0
  73. package/dist/es/node_modules/lodash-es/_toKey.js +10 -0
  74. package/dist/es/node_modules/lodash-es/_toSource.js +17 -0
  75. package/dist/es/node_modules/lodash-es/eq.js +6 -0
  76. package/dist/es/node_modules/lodash-es/get.js +8 -0
  77. package/dist/es/node_modules/lodash-es/isArray.js +4 -0
  78. package/dist/es/node_modules/lodash-es/isFunction.js +12 -0
  79. package/dist/es/node_modules/lodash-es/isNil.js +6 -0
  80. package/dist/es/node_modules/lodash-es/isObject.js +7 -0
  81. package/dist/es/node_modules/lodash-es/isObjectLike.js +6 -0
  82. package/dist/es/node_modules/lodash-es/isString.js +10 -0
  83. package/dist/es/node_modules/lodash-es/isSymbol.js +9 -0
  84. package/dist/es/node_modules/lodash-es/memoize.js +18 -0
  85. package/dist/es/node_modules/lodash-es/toString.js +7 -0
  86. package/dist/es/node_modules/style-mod/src/style-mod.js +109 -0
  87. package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +132 -0
  88. package/dist/es/node_modules/w3c-keyname/index.js +93 -0
  89. package/dist/es/src/CodeEditor/index.js +6 -0
  90. package/dist/es/src/CodeEditor/src/index.css +1 -0
  91. package/dist/es/src/CodeEditor/src/index.vue.js +128 -0
  92. package/dist/es/src/CodeEditor/src/index2.css +1 -0
  93. package/dist/es/src/ConfigProvider/index.js +7 -0
  94. package/dist/es/src/ConfigProvider/src/configProvider.js +14 -0
  95. package/dist/es/src/ConfigProvider/src/configProviderProps.js +22 -0
  96. package/dist/es/src/ConfigProvider/src/constants.js +9 -0
  97. package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +45 -0
  98. package/dist/es/src/ScaleScreen/index.js +6 -0
  99. package/dist/es/src/ScaleScreen/src/index.css +1 -0
  100. package/dist/es/src/ScaleScreen/src/index.vue.js +115 -0
  101. package/dist/es/src/ScaleScreen/src/index2.css +1 -0
  102. package/dist/es/src/VideoBackground/index.js +6 -0
  103. package/dist/es/src/VideoBackground/src/helper.js +29 -0
  104. package/dist/es/src/VideoBackground/src/index.css +1 -0
  105. package/dist/es/src/VideoBackground/src/index.vue.js +108 -0
  106. package/dist/es/src/VideoBackground/src/index2.css +1 -0
  107. package/dist/es/src/VideoBackground/src/index3.css +1 -0
  108. package/dist/es/src/VideoBackground/src/videoBackground.js +31 -0
  109. package/dist/es/src/hooks/useLocale.js +24 -0
  110. package/dist/es/src/hooks/useNamespace.js +8 -0
  111. package/dist/es/src/index.js +28 -0
  112. package/dist/es/src/locale/lang/en-US.js +32 -0
  113. package/dist/es/src/locale/lang/ja-JP.js +32 -0
  114. package/dist/es/src/locale/lang/zh-CN.js +32 -0
  115. package/dist/es/src/styles/tokens.css +1 -0
  116. package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
  117. package/dist/lib/index.js +1 -0
  118. package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +1 -0
  119. package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -0
  120. package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +1 -0
  121. package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +13 -0
  122. package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +1 -0
  123. package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +3 -0
  124. package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +2 -0
  125. package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +1 -0
  126. package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +1 -0
  127. package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -0
  128. package/dist/lib/node_modules/@codemirror/lint/dist/index.js +1 -0
  129. package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -0
  130. package/dist/lib/node_modules/@codemirror/state/dist/index.js +5 -0
  131. package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +1 -0
  132. package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -0
  133. package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -0
  134. package/dist/lib/node_modules/@lezer/highlight/dist/index.js +1 -0
  135. package/dist/lib/node_modules/@lezer/java/dist/index.js +1 -0
  136. package/dist/lib/node_modules/@lezer/javascript/dist/index.js +1 -0
  137. package/dist/lib/node_modules/@lezer/json/dist/index.js +1 -0
  138. package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -0
  139. package/dist/lib/node_modules/@lezer/python/dist/index.js +1 -0
  140. package/dist/lib/node_modules/@lezer/xml/dist/index.js +1 -0
  141. package/dist/lib/node_modules/@lezer/yaml/dist/index.js +1 -0
  142. package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +1 -0
  143. package/dist/lib/node_modules/@vueuse/core/dist/index.js +1 -0
  144. package/dist/lib/node_modules/@vueuse/shared/dist/index.js +1 -0
  145. package/dist/lib/node_modules/codemirror/dist/index.js +1 -0
  146. package/dist/lib/node_modules/crelt/index.js +1 -0
  147. package/dist/lib/node_modules/lodash-es/_Hash.js +1 -0
  148. package/dist/lib/node_modules/lodash-es/_ListCache.js +1 -0
  149. package/dist/lib/node_modules/lodash-es/_Map.js +1 -0
  150. package/dist/lib/node_modules/lodash-es/_MapCache.js +1 -0
  151. package/dist/lib/node_modules/lodash-es/_Symbol.js +1 -0
  152. package/dist/lib/node_modules/lodash-es/_arrayMap.js +1 -0
  153. package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +1 -0
  154. package/dist/lib/node_modules/lodash-es/_baseGet.js +1 -0
  155. package/dist/lib/node_modules/lodash-es/_baseGetTag.js +1 -0
  156. package/dist/lib/node_modules/lodash-es/_baseIsNative.js +1 -0
  157. package/dist/lib/node_modules/lodash-es/_baseToString.js +1 -0
  158. package/dist/lib/node_modules/lodash-es/_castPath.js +1 -0
  159. package/dist/lib/node_modules/lodash-es/_coreJsData.js +1 -0
  160. package/dist/lib/node_modules/lodash-es/_freeGlobal.js +1 -0
  161. package/dist/lib/node_modules/lodash-es/_getMapData.js +1 -0
  162. package/dist/lib/node_modules/lodash-es/_getNative.js +1 -0
  163. package/dist/lib/node_modules/lodash-es/_getRawTag.js +1 -0
  164. package/dist/lib/node_modules/lodash-es/_getValue.js +1 -0
  165. package/dist/lib/node_modules/lodash-es/_hashClear.js +1 -0
  166. package/dist/lib/node_modules/lodash-es/_hashDelete.js +1 -0
  167. package/dist/lib/node_modules/lodash-es/_hashGet.js +1 -0
  168. package/dist/lib/node_modules/lodash-es/_hashHas.js +1 -0
  169. package/dist/lib/node_modules/lodash-es/_hashSet.js +1 -0
  170. package/dist/lib/node_modules/lodash-es/_isKey.js +1 -0
  171. package/dist/lib/node_modules/lodash-es/_isKeyable.js +1 -0
  172. package/dist/lib/node_modules/lodash-es/_isMasked.js +1 -0
  173. package/dist/lib/node_modules/lodash-es/_listCacheClear.js +1 -0
  174. package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +1 -0
  175. package/dist/lib/node_modules/lodash-es/_listCacheGet.js +1 -0
  176. package/dist/lib/node_modules/lodash-es/_listCacheHas.js +1 -0
  177. package/dist/lib/node_modules/lodash-es/_listCacheSet.js +1 -0
  178. package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +1 -0
  179. package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +1 -0
  180. package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +1 -0
  181. package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +1 -0
  182. package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +1 -0
  183. package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +1 -0
  184. package/dist/lib/node_modules/lodash-es/_nativeCreate.js +1 -0
  185. package/dist/lib/node_modules/lodash-es/_objectToString.js +1 -0
  186. package/dist/lib/node_modules/lodash-es/_root.js +1 -0
  187. package/dist/lib/node_modules/lodash-es/_stringToPath.js +1 -0
  188. package/dist/lib/node_modules/lodash-es/_toKey.js +1 -0
  189. package/dist/lib/node_modules/lodash-es/_toSource.js +1 -0
  190. package/dist/lib/node_modules/lodash-es/eq.js +1 -0
  191. package/dist/lib/node_modules/lodash-es/get.js +1 -0
  192. package/dist/lib/node_modules/lodash-es/isArray.js +1 -0
  193. package/dist/lib/node_modules/lodash-es/isFunction.js +1 -0
  194. package/dist/lib/node_modules/lodash-es/isNil.js +1 -0
  195. package/dist/lib/node_modules/lodash-es/isObject.js +1 -0
  196. package/dist/lib/node_modules/lodash-es/isObjectLike.js +1 -0
  197. package/dist/lib/node_modules/lodash-es/isString.js +1 -0
  198. package/dist/lib/node_modules/lodash-es/isSymbol.js +1 -0
  199. package/dist/lib/node_modules/lodash-es/memoize.js +1 -0
  200. package/dist/lib/node_modules/lodash-es/toString.js +1 -0
  201. package/dist/lib/node_modules/style-mod/src/style-mod.js +3 -0
  202. package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +1 -0
  203. package/dist/lib/node_modules/w3c-keyname/index.js +1 -0
  204. package/dist/lib/src/CodeEditor/index.js +1 -0
  205. package/dist/lib/src/CodeEditor/src/index.css +1 -0
  206. package/dist/lib/src/CodeEditor/src/index.vue.js +1 -0
  207. package/dist/lib/src/CodeEditor/src/index2.css +1 -0
  208. package/dist/lib/src/ConfigProvider/index.js +1 -0
  209. package/dist/lib/src/ConfigProvider/src/configProvider.js +1 -0
  210. package/dist/lib/src/ConfigProvider/src/configProviderProps.js +1 -0
  211. package/dist/lib/src/ConfigProvider/src/constants.js +1 -0
  212. package/dist/lib/src/ConfigProvider/src/useGlobalConfig.js +1 -0
  213. package/dist/lib/src/ScaleScreen/index.js +1 -0
  214. package/dist/lib/src/ScaleScreen/src/index.css +1 -0
  215. package/dist/lib/src/ScaleScreen/src/index.vue.js +1 -0
  216. package/dist/lib/src/ScaleScreen/src/index2.css +1 -0
  217. package/dist/lib/src/VideoBackground/index.js +1 -0
  218. package/dist/lib/src/VideoBackground/src/helper.js +1 -0
  219. package/dist/lib/src/VideoBackground/src/index.css +1 -0
  220. package/dist/lib/src/VideoBackground/src/index.vue.js +1 -0
  221. package/dist/lib/src/VideoBackground/src/index2.css +1 -0
  222. package/dist/lib/src/VideoBackground/src/index3.css +1 -0
  223. package/dist/lib/src/VideoBackground/src/videoBackground.js +1 -0
  224. package/dist/lib/src/hooks/useLocale.js +1 -0
  225. package/dist/lib/src/hooks/useNamespace.js +1 -0
  226. package/dist/lib/src/index.js +1 -0
  227. package/dist/lib/src/locale/lang/en-US.js +1 -0
  228. package/dist/lib/src/locale/lang/ja-JP.js +1 -0
  229. package/dist/lib/src/locale/lang/zh-CN.js +1 -0
  230. package/dist/lib/src/styles/tokens.css +1 -0
  231. 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
+ };