@burdenoff/microfe-technospam 2026.1101.5 → 2026.1102.2
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/generated/wspace-types.d.ts +7468 -141
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js +527 -0
- package/dist/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js +1108 -0
- package/dist/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js +206 -0
- package/dist/node_modules/@codemirror/lang-go/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js +321 -0
- package/dist/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js +265 -0
- package/dist/node_modules/@codemirror/lang-python/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/language/dist/index.js +957 -0
- package/dist/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js +164 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js.map +1 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js +109 -0
- package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
- package/dist/node_modules/@codemirror/state/dist/index.js +1739 -0
- package/dist/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js +70 -0
- package/dist/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/@codemirror/view/dist/index.js +5427 -0
- package/dist/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/common/dist/index.js +896 -0
- package/dist/node_modules/@lezer/common/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/go/dist/index.js +215 -0
- package/dist/node_modules/@lezer/go/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js +395 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js +437 -0
- package/dist/node_modules/@lezer/javascript/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/lr/dist/index.js +842 -0
- package/dist/node_modules/@lezer/lr/dist/index.js.map +1 -0
- package/dist/node_modules/@lezer/python/dist/index.js +352 -0
- package/dist/node_modules/@lezer/python/dist/index.js.map +1 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js +66 -0
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
- package/dist/node_modules/style-mod/src/style-mod.js +74 -0
- package/dist/node_modules/style-mod/src/style-mod.js.map +1 -0
- package/dist/node_modules/w3c-keyname/index.js +90 -0
- package/dist/node_modules/w3c-keyname/index.js.map +1 -0
- package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
- package/dist/stories/journeys/Problems.stories.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.d.ts +39 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +120 -86
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/components/CertificateVerifyLink.d.ts +11 -0
- package/dist/technospam/components/CertificateVerifyLink.d.ts.map +1 -0
- package/dist/technospam/components/CertificateVerifyLink.js +63 -0
- package/dist/technospam/components/CertificateVerifyLink.js.map +1 -0
- package/dist/technospam/components/SubmissionViews.d.ts +6 -2
- package/dist/technospam/components/SubmissionViews.d.ts.map +1 -1
- package/dist/technospam/components/SubmissionViews.js +6 -5
- package/dist/technospam/components/SubmissionViews.js.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts +6 -0
- package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts.map +1 -1
- package/dist/technospam/components/TechnoSpamErrorBoundary.js +2 -2
- package/dist/technospam/components/TechnoSpamErrorBoundary.js.map +1 -1
- package/dist/technospam/components/editor/CodeEditor.d.ts +26 -0
- package/dist/technospam/components/editor/CodeEditor.d.ts.map +1 -0
- package/dist/technospam/components/editor/CodeEditor.js +102 -0
- package/dist/technospam/components/editor/CodeEditor.js.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts +14 -0
- package/dist/technospam/components/editor/RunOutputPanel.d.ts.map +1 -0
- package/dist/technospam/components/editor/RunOutputPanel.js +127 -0
- package/dist/technospam/components/editor/RunOutputPanel.js.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts +11 -0
- package/dist/technospam/components/editor/editorLanguages.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorLanguages.js +30 -0
- package/dist/technospam/components/editor/editorLanguages.js.map +1 -0
- package/dist/technospam/components/editor/editorTheme.d.ts +11 -0
- package/dist/technospam/components/editor/editorTheme.d.ts.map +1 -0
- package/dist/technospam/components/editor/editorTheme.js +120 -0
- package/dist/technospam/components/editor/editorTheme.js.map +1 -0
- package/dist/technospam/components/index.d.ts +1 -0
- package/dist/technospam/components/index.d.ts.map +1 -1
- package/dist/technospam/components/index.js +1 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts +35 -0
- package/dist/technospam/hooks/useSolutionRunner.d.ts.map +1 -0
- package/dist/technospam/hooks/useSolutionRunner.js +66 -0
- package/dist/technospam/hooks/useSolutionRunner.js.map +1 -0
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts.map +1 -1
- package/dist/technospam/hooks/useTechnoSpamAnalytics.js.map +1 -1
- package/dist/technospam/index.d.ts +2 -0
- package/dist/technospam/index.d.ts.map +1 -1
- package/dist/technospam/index.js +2 -0
- package/dist/technospam/lib/certificateVerify.d.ts +71 -0
- package/dist/technospam/lib/certificateVerify.d.ts.map +1 -0
- package/dist/technospam/lib/certificateVerify.js +55 -0
- package/dist/technospam/lib/certificateVerify.js.map +1 -0
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +416 -263
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +236 -231
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesMyLearningPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/CoursesMyLearningPagePage.js +104 -96
- package/dist/technospam/pages/CoursesMyLearningPagePage.js.map +1 -1
- package/dist/technospam/pages/public/CertificateVerifyPage.d.ts +4 -0
- package/dist/technospam/pages/public/CertificateVerifyPage.d.ts.map +1 -0
- package/dist/technospam/pages/public/CertificateVerifyPage.js +257 -0
- package/dist/technospam/pages/public/CertificateVerifyPage.js.map +1 -0
- package/package.json +14 -4
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { EditorSelection as e } from "../../state/dist/index.js";
|
|
2
|
+
import { EditorView as t } from "../../view/dist/index.js";
|
|
3
|
+
import { IterMode as n, NodeWeakMap as r } from "../../../@lezer/common/dist/index.js";
|
|
4
|
+
import { LRLanguage as i, LanguageSupport as a, continuedIndent as o, defineLanguageFacet as s, delimitedIndent as c, flatIndent as l, foldInside as u, foldNodeProp as d, indentNodeProp as f, sublanguageProp as p, syntaxTree as m } from "../../language/dist/index.js";
|
|
5
|
+
import { completeFromList as h, ifNotIn as g, snippetCompletion as _ } from "../../autocomplete/dist/index.js";
|
|
6
|
+
import { parser as v } from "../../../@lezer/javascript/dist/index.js";
|
|
7
|
+
//#region node_modules/@codemirror/lang-javascript/dist/index.js
|
|
8
|
+
var y = [
|
|
9
|
+
/* @__PURE__ */ _("function ${name}(${params}) {\n ${}\n}", {
|
|
10
|
+
label: "function",
|
|
11
|
+
detail: "definition",
|
|
12
|
+
type: "keyword"
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ _("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}", {
|
|
15
|
+
label: "for",
|
|
16
|
+
detail: "loop",
|
|
17
|
+
type: "keyword"
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ _("for (let ${name} of ${collection}) {\n ${}\n}", {
|
|
20
|
+
label: "for",
|
|
21
|
+
detail: "of loop",
|
|
22
|
+
type: "keyword"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ _("do {\n ${}\n} while (${})", {
|
|
25
|
+
label: "do",
|
|
26
|
+
detail: "loop",
|
|
27
|
+
type: "keyword"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ _("while (${}) {\n ${}\n}", {
|
|
30
|
+
label: "while",
|
|
31
|
+
detail: "loop",
|
|
32
|
+
type: "keyword"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ _("try {\n ${}\n} catch (${error}) {\n ${}\n}", {
|
|
35
|
+
label: "try",
|
|
36
|
+
detail: "/ catch block",
|
|
37
|
+
type: "keyword"
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ _("if (${}) {\n ${}\n}", {
|
|
40
|
+
label: "if",
|
|
41
|
+
detail: "block",
|
|
42
|
+
type: "keyword"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ _("if (${}) {\n ${}\n} else {\n ${}\n}", {
|
|
45
|
+
label: "if",
|
|
46
|
+
detail: "/ else block",
|
|
47
|
+
type: "keyword"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ _("class ${name} {\n constructor(${params}) {\n ${}\n }\n}", {
|
|
50
|
+
label: "class",
|
|
51
|
+
detail: "definition",
|
|
52
|
+
type: "keyword"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ _("import {${names}} from \"${module}\"\n${}", {
|
|
55
|
+
label: "import",
|
|
56
|
+
detail: "named",
|
|
57
|
+
type: "keyword"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ _("import ${name} from \"${module}\"\n${}", {
|
|
60
|
+
label: "import",
|
|
61
|
+
detail: "default",
|
|
62
|
+
type: "keyword"
|
|
63
|
+
})
|
|
64
|
+
], b = /* @__PURE__ */ y.concat([
|
|
65
|
+
/* @__PURE__ */ _("interface ${name} {\n ${}\n}", {
|
|
66
|
+
label: "interface",
|
|
67
|
+
detail: "definition",
|
|
68
|
+
type: "keyword"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ _("type ${name} = ${type}", {
|
|
71
|
+
label: "type",
|
|
72
|
+
detail: "definition",
|
|
73
|
+
type: "keyword"
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ _("enum ${name} {\n ${}\n}", {
|
|
76
|
+
label: "enum",
|
|
77
|
+
detail: "definition",
|
|
78
|
+
type: "keyword"
|
|
79
|
+
})
|
|
80
|
+
]), x = /* @__PURE__ */ new r(), S = /* @__PURE__ */ new Set([
|
|
81
|
+
"Script",
|
|
82
|
+
"Block",
|
|
83
|
+
"FunctionExpression",
|
|
84
|
+
"FunctionDeclaration",
|
|
85
|
+
"ArrowFunction",
|
|
86
|
+
"MethodDeclaration",
|
|
87
|
+
"ForStatement"
|
|
88
|
+
]);
|
|
89
|
+
function C(e) {
|
|
90
|
+
return (t, n) => {
|
|
91
|
+
let r = t.node.getChild("VariableDefinition");
|
|
92
|
+
return r && n(r, e), !0;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
var w = ["FunctionDeclaration"], T = {
|
|
96
|
+
FunctionDeclaration: /* @__PURE__ */ C("function"),
|
|
97
|
+
ClassDeclaration: /* @__PURE__ */ C("class"),
|
|
98
|
+
ClassExpression: () => !0,
|
|
99
|
+
EnumDeclaration: /* @__PURE__ */ C("constant"),
|
|
100
|
+
TypeAliasDeclaration: /* @__PURE__ */ C("type"),
|
|
101
|
+
NamespaceDeclaration: /* @__PURE__ */ C("namespace"),
|
|
102
|
+
VariableDefinition(e, t) {
|
|
103
|
+
e.matchContext(w) || t(e, "variable");
|
|
104
|
+
},
|
|
105
|
+
TypeDefinition(e, t) {
|
|
106
|
+
t(e, "type");
|
|
107
|
+
},
|
|
108
|
+
__proto__: null
|
|
109
|
+
};
|
|
110
|
+
function E(e, t) {
|
|
111
|
+
let r = x.get(t);
|
|
112
|
+
if (r) return r;
|
|
113
|
+
let i = [], a = !0;
|
|
114
|
+
function o(t, n) {
|
|
115
|
+
let r = e.sliceString(t.from, t.to);
|
|
116
|
+
i.push({
|
|
117
|
+
label: r,
|
|
118
|
+
type: n
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return t.cursor(n.IncludeAnonymous).iterate((t) => {
|
|
122
|
+
if (a) a = !1;
|
|
123
|
+
else if (t.name) {
|
|
124
|
+
let e = T[t.name];
|
|
125
|
+
if (e && e(t, o) || S.has(t.name)) return !1;
|
|
126
|
+
} else if (t.to - t.from > 8192) {
|
|
127
|
+
for (let n of E(e, t.node)) i.push(n);
|
|
128
|
+
return !1;
|
|
129
|
+
}
|
|
130
|
+
}), x.set(t, i), i;
|
|
131
|
+
}
|
|
132
|
+
var D = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, O = [
|
|
133
|
+
"TemplateString",
|
|
134
|
+
"String",
|
|
135
|
+
"RegExp",
|
|
136
|
+
"LineComment",
|
|
137
|
+
"BlockComment",
|
|
138
|
+
"VariableDefinition",
|
|
139
|
+
"TypeDefinition",
|
|
140
|
+
"Label",
|
|
141
|
+
"PropertyDefinition",
|
|
142
|
+
"PropertyName",
|
|
143
|
+
"PrivatePropertyDefinition",
|
|
144
|
+
"PrivatePropertyName",
|
|
145
|
+
"JSXText",
|
|
146
|
+
"JSXAttributeValue",
|
|
147
|
+
"JSXOpenTag",
|
|
148
|
+
"JSXCloseTag",
|
|
149
|
+
"JSXSelfClosingTag",
|
|
150
|
+
".",
|
|
151
|
+
"?."
|
|
152
|
+
];
|
|
153
|
+
function k(e) {
|
|
154
|
+
let t = m(e.state).resolveInner(e.pos, -1);
|
|
155
|
+
if (O.indexOf(t.name) > -1) return null;
|
|
156
|
+
let n = t.name == "VariableName" || t.to - t.from < 20 && D.test(e.state.sliceDoc(t.from, t.to));
|
|
157
|
+
if (!n && !e.explicit) return null;
|
|
158
|
+
let r = [];
|
|
159
|
+
for (let n = t; n; n = n.parent) S.has(n.name) && (r = r.concat(E(e.state.doc, n)));
|
|
160
|
+
return {
|
|
161
|
+
options: r,
|
|
162
|
+
from: n ? t.from : e.pos,
|
|
163
|
+
validFor: D
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
var A = /* @__PURE__ */ i.define({
|
|
167
|
+
name: "javascript",
|
|
168
|
+
parser: /* @__PURE__ */ v.configure({ props: [/* @__PURE__ */ f.add({
|
|
169
|
+
IfStatement: /* @__PURE__ */ o({ except: /^\s*({|else\b)/ }),
|
|
170
|
+
TryStatement: /* @__PURE__ */ o({ except: /^\s*({|catch\b|finally\b)/ }),
|
|
171
|
+
LabeledStatement: l,
|
|
172
|
+
SwitchBody: (e) => {
|
|
173
|
+
let t = e.textAfter, n = /^\s*\}/.test(t), r = /^\s*(case|default)\b/.test(t);
|
|
174
|
+
return e.baseIndent + (n ? 0 : r ? 1 : 2) * e.unit;
|
|
175
|
+
},
|
|
176
|
+
Block: /* @__PURE__ */ c({ closing: "}" }),
|
|
177
|
+
ArrowFunction: (e) => e.baseIndent + e.unit,
|
|
178
|
+
"TemplateString BlockComment": () => null,
|
|
179
|
+
"Statement Property": /* @__PURE__ */ o({ except: /^\s*{/ }),
|
|
180
|
+
JSXElement(e) {
|
|
181
|
+
let t = /^\s*<\//.test(e.textAfter);
|
|
182
|
+
return e.lineIndent(e.node.from) + (t ? 0 : e.unit);
|
|
183
|
+
},
|
|
184
|
+
JSXEscape(e) {
|
|
185
|
+
let t = /\s*\}/.test(e.textAfter);
|
|
186
|
+
return e.lineIndent(e.node.from) + (t ? 0 : e.unit);
|
|
187
|
+
},
|
|
188
|
+
"JSXOpenTag JSXSelfClosingTag"(e) {
|
|
189
|
+
return e.column(e.node.from) + e.unit;
|
|
190
|
+
}
|
|
191
|
+
}), /* @__PURE__ */ d.add({
|
|
192
|
+
"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": u,
|
|
193
|
+
BlockComment(e) {
|
|
194
|
+
return {
|
|
195
|
+
from: e.from + 2,
|
|
196
|
+
to: e.to - 2
|
|
197
|
+
};
|
|
198
|
+
},
|
|
199
|
+
JSXElement(e) {
|
|
200
|
+
let t = e.firstChild;
|
|
201
|
+
if (!t || t.name == "JSXSelfClosingTag") return null;
|
|
202
|
+
let n = e.lastChild;
|
|
203
|
+
return {
|
|
204
|
+
from: t.to,
|
|
205
|
+
to: n.type.isError ? e.to : n.from
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
"JSXSelfClosingTag JSXOpenTag"(e) {
|
|
209
|
+
let t = e.firstChild?.nextSibling, n = e.lastChild;
|
|
210
|
+
return !t || t.type.isError ? null : {
|
|
211
|
+
from: t.to,
|
|
212
|
+
to: n.type.isError ? e.to : n.from
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
})] }),
|
|
216
|
+
languageData: {
|
|
217
|
+
closeBrackets: { brackets: [
|
|
218
|
+
"(",
|
|
219
|
+
"[",
|
|
220
|
+
"{",
|
|
221
|
+
"'",
|
|
222
|
+
"\"",
|
|
223
|
+
"`"
|
|
224
|
+
] },
|
|
225
|
+
commentTokens: {
|
|
226
|
+
line: "//",
|
|
227
|
+
block: {
|
|
228
|
+
open: "/*",
|
|
229
|
+
close: "*/"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/,
|
|
233
|
+
wordChars: "$"
|
|
234
|
+
}
|
|
235
|
+
}), j = {
|
|
236
|
+
test: (e) => /^JSX/.test(e.name),
|
|
237
|
+
facet: /* @__PURE__ */ s({ commentTokens: { block: {
|
|
238
|
+
open: "{/*",
|
|
239
|
+
close: "*/}"
|
|
240
|
+
} } })
|
|
241
|
+
}, M = /* @__PURE__ */ A.configure({ dialect: "ts" }, "typescript"), N = /* @__PURE__ */ A.configure({
|
|
242
|
+
dialect: "jsx",
|
|
243
|
+
props: [/* @__PURE__ */ p.add((e) => e.isTop ? [j] : void 0)]
|
|
244
|
+
}), P = /* @__PURE__ */ A.configure({
|
|
245
|
+
dialect: "jsx ts",
|
|
246
|
+
props: [/* @__PURE__ */ p.add((e) => e.isTop ? [j] : void 0)]
|
|
247
|
+
}, "typescript"), F = (e) => ({
|
|
248
|
+
label: e,
|
|
249
|
+
type: "keyword"
|
|
250
|
+
}), I = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(F), L = /* @__PURE__ */ I.concat(/* @__PURE__ */ [
|
|
251
|
+
"declare",
|
|
252
|
+
"implements",
|
|
253
|
+
"private",
|
|
254
|
+
"protected",
|
|
255
|
+
"public"
|
|
256
|
+
].map(F));
|
|
257
|
+
function R(e = {}) {
|
|
258
|
+
let t = e.jsx ? e.typescript ? P : N : e.typescript ? M : A, n = e.typescript ? b.concat(L) : y.concat(I);
|
|
259
|
+
return new a(t, [
|
|
260
|
+
A.data.of({ autocomplete: g(O, h(n)) }),
|
|
261
|
+
A.data.of({ autocomplete: k }),
|
|
262
|
+
e.jsx ? H : []
|
|
263
|
+
]);
|
|
264
|
+
}
|
|
265
|
+
function z(e) {
|
|
266
|
+
for (;;) {
|
|
267
|
+
if (e.name == "JSXOpenTag" || e.name == "JSXSelfClosingTag" || e.name == "JSXFragmentTag") return e;
|
|
268
|
+
if (e.name == "JSXEscape" || !e.parent) return null;
|
|
269
|
+
e = e.parent;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function B(e, t, n = e.length) {
|
|
273
|
+
for (let r = t?.firstChild; r; r = r.nextSibling) if (r.name == "JSXIdentifier" || r.name == "JSXBuiltin" || r.name == "JSXNamespacedName" || r.name == "JSXMemberExpression") return e.sliceString(r.from, Math.min(r.to, n));
|
|
274
|
+
return "";
|
|
275
|
+
}
|
|
276
|
+
var V = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), H = /* @__PURE__ */ t.inputHandler.of((t, n, r, i, a) => {
|
|
277
|
+
if ((V ? t.composing : t.compositionStarted) || t.state.readOnly || n != r || i != ">" && i != "/" || !A.isActiveAt(t.state, n, -1)) return !1;
|
|
278
|
+
let o = a(), { state: s } = o, c = s.changeByRange((t) => {
|
|
279
|
+
let { head: n } = t, r = m(s).resolveInner(n - 1, -1), a;
|
|
280
|
+
if (r.name == "JSXStartTag" && (r = r.parent), !(s.doc.sliceString(n - 1, n) != i || r.name == "JSXAttributeValue" && r.to > n)) {
|
|
281
|
+
if (i == ">" && r.name == "JSXFragmentTag") return {
|
|
282
|
+
range: t,
|
|
283
|
+
changes: {
|
|
284
|
+
from: n,
|
|
285
|
+
insert: "</>"
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
if (i == "/" && r.name == "JSXStartCloseTag") {
|
|
289
|
+
let t = r.parent, i = t.parent;
|
|
290
|
+
if (i && t.from == n - 2 && ((a = B(s.doc, i.firstChild, n)) || i.firstChild?.name == "JSXFragmentTag")) {
|
|
291
|
+
let t = `${a}>`;
|
|
292
|
+
return {
|
|
293
|
+
range: e.cursor(n + t.length, -1),
|
|
294
|
+
changes: {
|
|
295
|
+
from: n,
|
|
296
|
+
insert: t
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
} else if (i == ">") {
|
|
301
|
+
let e = z(r);
|
|
302
|
+
if (e && e.name == "JSXOpenTag" && !/^\/?>|^<\//.test(s.doc.sliceString(n, n + 2)) && (a = B(s.doc, e, n))) return {
|
|
303
|
+
range: t,
|
|
304
|
+
changes: {
|
|
305
|
+
from: n,
|
|
306
|
+
insert: `</${a}>`
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return { range: t };
|
|
312
|
+
});
|
|
313
|
+
return c.changes.empty ? !1 : (t.dispatch([o, s.update(c, {
|
|
314
|
+
userEvent: "input.complete",
|
|
315
|
+
scrollIntoView: !0
|
|
316
|
+
})]), !0);
|
|
317
|
+
});
|
|
318
|
+
//#endregion
|
|
319
|
+
export { R as javascript };
|
|
320
|
+
|
|
321
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@codemirror/lang-javascript/dist/index.js"],"sourcesContent":["import { parser } from '@lezer/javascript';\nimport { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, defineLanguageFacet, sublanguageProp, LanguageSupport } from '@codemirror/language';\nimport { EditorSelection } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { snippetCompletion, ifNotIn, completeFromList } from '@codemirror/autocomplete';\nimport { NodeWeakMap, IterMode } from '@lezer/common';\n\n/**\nA collection of JavaScript-related\n[snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).\n*/\nconst snippets = [\n /*@__PURE__*/snippetCompletion(\"function ${name}(${params}) {\\n\\t${}\\n}\", {\n label: \"function\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${name} of ${collection}) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"of loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"do {\\n\\t${}\\n} while (${})\", {\n label: \"do\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"while (${}) {\\n\\t${}\\n}\", {\n label: \"while\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"try {\\n\\t${}\\n} catch (${error}) {\\n\\t${}\\n}\", {\n label: \"try\",\n detail: \"/ catch block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n} else {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"/ else block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"class ${name} {\\n\\tconstructor(${params}) {\\n\\t\\t${}\\n\\t}\\n}\", {\n label: \"class\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import {${names}} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"named\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import ${name} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"default\",\n type: \"keyword\"\n })\n];\n/**\nA collection of snippet completions for TypeScript. Includes the\nJavaScript [snippets](https://codemirror.net/6/docs/ref/#lang-javascript.snippets).\n*/\nconst typescriptSnippets = /*@__PURE__*/snippets.concat([\n /*@__PURE__*/snippetCompletion(\"interface ${name} {\\n\\t${}\\n}\", {\n label: \"interface\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"type ${name} = ${type}\", {\n label: \"type\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"enum ${name} {\\n\\t${}\\n}\", {\n label: \"enum\",\n detail: \"definition\",\n type: \"keyword\"\n })\n]);\n\nconst cache = /*@__PURE__*/new NodeWeakMap();\nconst ScopeNodes = /*@__PURE__*/new Set([\n \"Script\", \"Block\",\n \"FunctionExpression\", \"FunctionDeclaration\", \"ArrowFunction\", \"MethodDeclaration\",\n \"ForStatement\"\n]);\nfunction defID(type) {\n return (node, def) => {\n let id = node.node.getChild(\"VariableDefinition\");\n if (id)\n def(id, type);\n return true;\n };\n}\nconst functionContext = [\"FunctionDeclaration\"];\nconst gatherCompletions = {\n FunctionDeclaration: /*@__PURE__*/defID(\"function\"),\n ClassDeclaration: /*@__PURE__*/defID(\"class\"),\n ClassExpression: () => true,\n EnumDeclaration: /*@__PURE__*/defID(\"constant\"),\n TypeAliasDeclaration: /*@__PURE__*/defID(\"type\"),\n NamespaceDeclaration: /*@__PURE__*/defID(\"namespace\"),\n VariableDefinition(node, def) { if (!node.matchContext(functionContext))\n def(node, \"variable\"); },\n TypeDefinition(node, def) { def(node, \"type\"); },\n __proto__: null\n};\nfunction getScope(doc, node) {\n let cached = cache.get(node);\n if (cached)\n return cached;\n let completions = [], top = true;\n function def(node, type) {\n let name = doc.sliceString(node.from, node.to);\n completions.push({ label: name, type });\n }\n node.cursor(IterMode.IncludeAnonymous).iterate(node => {\n if (top) {\n top = false;\n }\n else if (node.name) {\n let gather = gatherCompletions[node.name];\n if (gather && gather(node, def) || ScopeNodes.has(node.name))\n return false;\n }\n else if (node.to - node.from > 8192) {\n // Allow caching for bigger internal nodes\n for (let c of getScope(doc, node.node))\n completions.push(c);\n return false;\n }\n });\n cache.set(node, completions);\n return completions;\n}\nconst Identifier = /^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/;\nconst dontComplete = [\n \"TemplateString\", \"String\", \"RegExp\",\n \"LineComment\", \"BlockComment\",\n \"VariableDefinition\", \"TypeDefinition\", \"Label\",\n \"PropertyDefinition\", \"PropertyName\",\n \"PrivatePropertyDefinition\", \"PrivatePropertyName\",\n \"JSXText\", \"JSXAttributeValue\", \"JSXOpenTag\", \"JSXCloseTag\", \"JSXSelfClosingTag\",\n \".\", \"?.\"\n];\n/**\nCompletion source that looks up locally defined names in\nJavaScript code.\n*/\nfunction localCompletionSource(context) {\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (dontComplete.indexOf(inner.name) > -1)\n return null;\n let isWord = inner.name == \"VariableName\" ||\n inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));\n if (!isWord && !context.explicit)\n return null;\n let options = [];\n for (let pos = inner; pos; pos = pos.parent) {\n if (ScopeNodes.has(pos.name))\n options = options.concat(getScope(context.state.doc, pos));\n }\n return {\n options,\n from: isWord ? inner.from : context.pos,\n validFor: Identifier\n };\n}\nfunction pathFor(read, member, name) {\n var _a;\n let path = [];\n for (;;) {\n let obj = member.firstChild, prop;\n if ((obj === null || obj === void 0 ? void 0 : obj.name) == \"VariableName\") {\n path.push(read(obj));\n return { path: path.reverse(), name };\n }\n else if ((obj === null || obj === void 0 ? void 0 : obj.name) == \"MemberExpression\" && ((_a = (prop = obj.lastChild)) === null || _a === void 0 ? void 0 : _a.name) == \"PropertyName\") {\n path.push(read(prop));\n member = obj;\n }\n else {\n return null;\n }\n }\n}\n/**\nHelper function for defining JavaScript completion sources. It\nreturns the completable name and object path for a completion\ncontext, or null if no name/property completion should happen at\nthat position. For example, when completing after `a.b.c` it will\nreturn `{path: [\"a\", \"b\"], name: \"c\"}`. When completing after `x`\nit will return `{path: [], name: \"x\"}`. When not in a property or\nname, it will return null if `context.explicit` is false, and\n`{path: [], name: \"\"}` otherwise.\n*/\nfunction completionPath(context) {\n let read = (node) => context.state.doc.sliceString(node.from, node.to);\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (inner.name == \"PropertyName\") {\n return pathFor(read, inner.parent, read(inner));\n }\n else if ((inner.name == \".\" || inner.name == \"?.\") && inner.parent.name == \"MemberExpression\") {\n return pathFor(read, inner.parent, \"\");\n }\n else if (dontComplete.indexOf(inner.name) > -1) {\n return null;\n }\n else if (inner.name == \"VariableName\" || inner.to - inner.from < 20 && Identifier.test(read(inner))) {\n return { path: [], name: read(inner) };\n }\n else if (inner.name == \"MemberExpression\") {\n return pathFor(read, inner, \"\");\n }\n else {\n return context.explicit ? { path: [], name: \"\" } : null;\n }\n}\nfunction enumeratePropertyCompletions(obj, top) {\n let originalObj = obj;\n let options = [], seen = new Set;\n for (let depth = 0;; depth++) {\n for (let name of (Object.getOwnPropertyNames || Object.keys)(obj)) {\n if (!/^[a-zA-Z_$\\xaa-\\uffdc][\\w$\\xaa-\\uffdc]*$/.test(name) || seen.has(name))\n continue;\n seen.add(name);\n let value;\n try {\n value = originalObj[name];\n }\n catch (_) {\n continue;\n }\n options.push({\n label: name,\n type: typeof value == \"function\" ? (/^[A-Z]/.test(name) ? \"class\" : top ? \"function\" : \"method\")\n : top ? \"variable\" : \"property\",\n boost: -depth\n });\n }\n let next = Object.getPrototypeOf(obj);\n if (!next)\n return options;\n obj = next;\n }\n}\n/**\nDefines a [completion source](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) that\ncompletes from the given scope object (for example `globalThis`).\nWill enter properties of the object when completing properties on\na directly-named path.\n*/\nfunction scopeCompletionSource(scope) {\n let cache = new Map;\n return (context) => {\n let path = completionPath(context);\n if (!path)\n return null;\n let target = scope;\n for (let step of path.path) {\n target = target[step];\n if (!target)\n return null;\n }\n let options = cache.get(target);\n if (!options)\n cache.set(target, options = enumeratePropertyCompletions(target, !path.path.length));\n return {\n from: context.pos - path.name.length,\n options,\n validFor: Identifier\n };\n };\n}\n\n/**\nA language provider based on the [Lezer JavaScript\nparser](https://github.com/lezer-parser/javascript), extended with\nhighlighting and indentation information.\n*/\nconst javascriptLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"javascript\",\n parser: /*@__PURE__*/parser.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n TryStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|catch\\b|finally\\b)/ }),\n LabeledStatement: flatIndent,\n SwitchBody: context => {\n let after = context.textAfter, closed = /^\\s*\\}/.test(after), isCase = /^\\s*(case|default)\\b/.test(after);\n return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;\n },\n Block: /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n ArrowFunction: cx => cx.baseIndent + cx.unit,\n \"TemplateString BlockComment\": () => null,\n \"Statement Property\": /*@__PURE__*/continuedIndent({ except: /^\\s*{/ }),\n JSXElement(context) {\n let closed = /^\\s*<\\//.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n JSXEscape(context) {\n let closed = /\\s*\\}/.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n \"JSXOpenTag JSXSelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\": foldInside,\n BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; },\n JSXElement(tree) {\n let open = tree.firstChild;\n if (!open || open.name == \"JSXSelfClosingTag\")\n return null;\n let close = tree.lastChild;\n return { from: open.to, to: close.type.isError ? tree.to : close.from };\n },\n \"JSXSelfClosingTag JSXOpenTag\"(tree) {\n var _a;\n let name = (_a = tree.firstChild) === null || _a === void 0 ? void 0 : _a.nextSibling, close = tree.lastChild;\n if (!name || name.type.isError)\n return null;\n return { from: name.to, to: close.type.isError ? tree.to : close.from };\n }\n })\n ]\n }),\n languageData: {\n closeBrackets: { brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"`\"] },\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:case |default:|\\{|\\}|<\\/)$/,\n wordChars: \"$\"\n }\n});\nconst jsxSublanguage = {\n test: node => /^JSX/.test(node.name),\n facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"{/*\", close: \"*/}\" } } })\n};\n/**\nA language provider for TypeScript.\n*/\nconst typescriptLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: \"ts\" }, \"typescript\");\n/**\nLanguage provider for JSX.\n*/\nconst jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n});\n/**\nLanguage provider for JSX + TypeScript.\n*/\nconst tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx ts\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n}, \"typescript\");\nlet kwCompletion = (name) => ({ label: name, type: \"keyword\" });\nconst keywords = /*@__PURE__*/\"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield\".split(\" \").map(kwCompletion);\nconst typescriptKeywords = /*@__PURE__*/keywords.concat(/*@__PURE__*/[\"declare\", \"implements\", \"private\", \"protected\", \"public\"].map(kwCompletion));\n/**\nJavaScript support. Includes [snippet](https://codemirror.net/6/docs/ref/#lang-javascript.snippets)\nand local variable completion.\n*/\nfunction javascript(config = {}) {\n let lang = config.jsx ? (config.typescript ? tsxLanguage : jsxLanguage)\n : config.typescript ? typescriptLanguage : javascriptLanguage;\n let completions = config.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);\n return new LanguageSupport(lang, [\n javascriptLanguage.data.of({\n autocomplete: ifNotIn(dontComplete, completeFromList(completions))\n }),\n javascriptLanguage.data.of({\n autocomplete: localCompletionSource\n }),\n config.jsx ? autoCloseTags : [],\n ]);\n}\nfunction findOpenTag(node) {\n for (;;) {\n if (node.name == \"JSXOpenTag\" || node.name == \"JSXSelfClosingTag\" || node.name == \"JSXFragmentTag\")\n return node;\n if (node.name == \"JSXEscape\" || !node.parent)\n return null;\n node = node.parent;\n }\n}\nfunction elementName(doc, tree, max = doc.length) {\n for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {\n if (ch.name == \"JSXIdentifier\" || ch.name == \"JSXBuiltin\" || ch.name == \"JSXNamespacedName\" ||\n ch.name == \"JSXMemberExpression\")\n return doc.sliceString(ch.from, Math.min(ch.to, max));\n }\n return \"\";\n}\nconst android = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n/**\nExtension that will automatically insert JSX close tags when a `>` or\n`/` is typed.\n*/\nconst autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {\n if ((android ? view.composing : view.compositionStarted) || view.state.readOnly ||\n from != to || (text != \">\" && text != \"/\") ||\n !javascriptLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = defaultInsert(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a;\n let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name;\n if (around.name == \"JSXStartTag\")\n around = around.parent;\n if (state.doc.sliceString(head - 1, head) != text || around.name == \"JSXAttributeValue\" && around.to > head) ;\n else if (text == \">\" && around.name == \"JSXFragmentTag\") {\n return { range, changes: { from: head, insert: `</>` } };\n }\n else if (text == \"/\" && around.name == \"JSXStartCloseTag\") {\n let empty = around.parent, base = empty.parent;\n if (base && empty.from == head - 2 &&\n ((name = elementName(state.doc, base.firstChild, head)) || ((_a = base.firstChild) === null || _a === void 0 ? void 0 : _a.name) == \"JSXFragmentTag\")) {\n let insert = `${name}>`;\n return { range: EditorSelection.cursor(head + insert.length, -1), changes: { from: head, insert } };\n }\n }\n else if (text == \">\") {\n let openTag = findOpenTag(around);\n if (openTag && openTag.name == \"JSXOpenTag\" &&\n !/^\\/?>|^<\\//.test(state.doc.sliceString(head, head + 2)) &&\n (name = elementName(state.doc, openTag, head)))\n return { range, changes: { from: head, insert: `</${name}>` } };\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, { userEvent: \"input.complete\", scrollIntoView: true })\n ]);\n return true;\n});\n\n/**\nConnects an [ESLint](https://eslint.org/) linter to CodeMirror's\n[lint](https://codemirror.net/6/docs/ref/#lint) integration. `eslint` should be an instance of the\n[`Linter`](https://eslint.org/docs/developer-guide/nodejs-api#linter)\nclass, and `config` an optional ESLint configuration. The return\nvalue of this function can be passed to [`linter`](https://codemirror.net/6/docs/ref/#lint.linter)\nto create a JavaScript linting extension.\n\nNote that ESLint targets node, and is tricky to run in the\nbrowser. The\n[eslint-linter-browserify](https://github.com/UziTech/eslint-linter-browserify)\npackage may help with that (see\n[example](https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js)).\n*/\nfunction esLint(eslint, config) {\n if (!config) {\n config = {\n parserOptions: { ecmaVersion: 2019, sourceType: \"module\" },\n env: { browser: true, node: true, es6: true, es2015: true, es2017: true, es2020: true },\n rules: {}\n };\n eslint.getRules().forEach((desc, name) => {\n var _a;\n if ((_a = desc.meta.docs) === null || _a === void 0 ? void 0 : _a.recommended)\n config.rules[name] = 2;\n });\n }\n return (view) => {\n let { state } = view, found = [];\n for (let { from, to } of javascriptLanguage.findRegions(state)) {\n let fromLine = state.doc.lineAt(from), offset = { line: fromLine.number - 1, col: from - fromLine.from, pos: from };\n for (let d of eslint.verify(state.sliceDoc(from, to), config))\n found.push(translateDiagnostic(d, state.doc, offset));\n }\n return found;\n };\n}\nfunction mapPos(line, col, doc, offset) {\n return doc.line(line + offset.line).from + col + (line == 1 ? offset.col - 1 : -1);\n}\nfunction translateDiagnostic(input, doc, offset) {\n let start = mapPos(input.line, input.column, doc, offset);\n let result = {\n from: start,\n to: input.endLine != null && input.endColumn != 1 ? mapPos(input.endLine, input.endColumn, doc, offset) : start,\n message: input.message,\n source: input.ruleId ? \"eslint:\" + input.ruleId : \"eslint\",\n severity: input.severity == 1 ? \"warning\" : \"error\",\n };\n if (input.fix) {\n let { range, text } = input.fix, from = range[0] + offset.pos - start, to = range[1] + offset.pos - start;\n result.actions = [{\n name: \"fix\",\n apply(view, start) {\n view.dispatch({ changes: { from: start + from, to: start + to, insert: text }, scrollIntoView: true });\n }\n }];\n }\n return result;\n}\n\nexport { autoCloseTags, completionPath, esLint, javascript, javascriptLanguage, jsxLanguage, localCompletionSource, scopeCompletionSource, snippets, tsxLanguage, typescriptLanguage, typescriptSnippets };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAWA,IAAM,IAAW;CACA,kBAAkB,0CAA2C;EACtE,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,sEAAuE;EAClG,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,iDAAkD;EAC7E,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,6BAA8B;EACzD,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,0BAA2B;EACtD,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,8CAAgD;EAC3E,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,uBAAwB;EACnD,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,uCAAyC;EACpE,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,4DAAgE;EAC3F,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,6CAA6C;EACxE,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,0CAA0C;EACrE,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACL,EAKK,IAAkC,kBAAS,OAAO;CACvC,kBAAkB,gCAAiC;EAC5D,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,0BAA0B;EACrD,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACW,kBAAkB,2BAA4B;EACvD,OAAO;EACP,QAAQ;EACR,MAAM;EACT,CAAC;CACL,CAAC,EAEI,oBAAqB,IAAI,GAAa,EACtC,oBAA0B,IAAI,IAAI;CACpC;CAAU;CACV;CAAsB;CAAuB;CAAiB;CAC9D;CACH,CAAC;AACF,SAAS,EAAM,GAAM;AACjB,SAAQ,GA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AAM,IAAO,EAAE,CAAC,KACxD,IAAO,EAAY,EAAM,KAAK,GAAS,EAAK,EAC7C,QAAO;KAAE;KAAO,SAAS;MAAE,MAAM;MAAM,QAAQ,KAAK,EAAK;MAAI;KAAE;;;AAEvE,SAAO,EAAE,UAAO;GAClB;AAOF,QANI,EAAU,QAAQ,QACX,MACX,EAAK,SAAS,CACV,GACA,EAAM,OAAO,GAAW;EAAE,WAAW;EAAkB,gBAAgB;EAAM,CAAC,CACjF,CAAC,EACK;EACT"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { IterMode as e, NodeWeakMap as t } from "../../../@lezer/common/dist/index.js";
|
|
2
|
+
import { LRLanguage as n, LanguageSupport as r, delimitedIndent as i, foldInside as a, foldNodeProp as o, indentNodeProp as s, syntaxTree as c } from "../../language/dist/index.js";
|
|
3
|
+
import { completeFromList as l, ifNotIn as u, snippetCompletion as d } from "../../autocomplete/dist/index.js";
|
|
4
|
+
import { parser as f } from "../../../@lezer/python/dist/index.js";
|
|
5
|
+
//#region node_modules/@codemirror/lang-python/dist/index.js
|
|
6
|
+
var p = /* @__PURE__ */ new t(), m = /* @__PURE__ */ new Set([
|
|
7
|
+
"Script",
|
|
8
|
+
"Body",
|
|
9
|
+
"FunctionDefinition",
|
|
10
|
+
"ClassDefinition",
|
|
11
|
+
"LambdaExpression",
|
|
12
|
+
"ForStatement",
|
|
13
|
+
"MatchClause"
|
|
14
|
+
]);
|
|
15
|
+
function h(e) {
|
|
16
|
+
return (t, n, r) => {
|
|
17
|
+
if (r) return !1;
|
|
18
|
+
let i = t.node.getChild("VariableName");
|
|
19
|
+
return i && n(i, e), !0;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var g = {
|
|
23
|
+
FunctionDefinition: /* @__PURE__ */ h("function"),
|
|
24
|
+
ClassDefinition: /* @__PURE__ */ h("class"),
|
|
25
|
+
ForStatement(e, t, n) {
|
|
26
|
+
if (n) {
|
|
27
|
+
for (let n = e.node.firstChild; n; n = n.nextSibling) if (n.name == "VariableName") t(n, "variable");
|
|
28
|
+
else if (n.name == "in") break;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
ImportStatement(e, t) {
|
|
32
|
+
let { node: n } = e, r = n.firstChild?.name == "from";
|
|
33
|
+
for (let e = n.getChild("import"); e; e = e.nextSibling) e.name == "VariableName" && e.nextSibling?.name != "as" && t(e, r ? "variable" : "namespace");
|
|
34
|
+
},
|
|
35
|
+
AssignStatement(e, t) {
|
|
36
|
+
for (let n = e.node.firstChild; n; n = n.nextSibling) if (n.name == "VariableName") t(n, "variable");
|
|
37
|
+
else if (n.name == ":" || n.name == "AssignOp") break;
|
|
38
|
+
},
|
|
39
|
+
ParamList(e, t) {
|
|
40
|
+
for (let n = null, r = e.node.firstChild; r; r = r.nextSibling) r.name == "VariableName" && (!n || !/\*|AssignOp/.test(n.name)) && t(r, "variable"), n = r;
|
|
41
|
+
},
|
|
42
|
+
CapturePattern: /* @__PURE__ */ h("variable"),
|
|
43
|
+
AsPattern: /* @__PURE__ */ h("variable"),
|
|
44
|
+
__proto__: null
|
|
45
|
+
};
|
|
46
|
+
function _(t, n) {
|
|
47
|
+
let r = p.get(n);
|
|
48
|
+
if (r) return r;
|
|
49
|
+
let i = [], a = !0;
|
|
50
|
+
function o(e, n) {
|
|
51
|
+
let r = t.sliceString(e.from, e.to);
|
|
52
|
+
i.push({
|
|
53
|
+
label: r,
|
|
54
|
+
type: n
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return n.cursor(e.IncludeAnonymous).iterate((e) => {
|
|
58
|
+
if (e.name) {
|
|
59
|
+
let t = g[e.name];
|
|
60
|
+
if (t && t(e, o, a) || !a && m.has(e.name)) return !1;
|
|
61
|
+
a = !1;
|
|
62
|
+
} else if (e.to - e.from > 8192) {
|
|
63
|
+
for (let n of _(t, e.node)) i.push(n);
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
}), p.set(n, i), i;
|
|
67
|
+
}
|
|
68
|
+
var v = /^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/, y = [
|
|
69
|
+
"String",
|
|
70
|
+
"FormatString",
|
|
71
|
+
"Comment",
|
|
72
|
+
"PropertyName"
|
|
73
|
+
];
|
|
74
|
+
function b(e) {
|
|
75
|
+
let t = c(e.state).resolveInner(e.pos, -1);
|
|
76
|
+
if (y.indexOf(t.name) > -1) return null;
|
|
77
|
+
let n = t.name == "VariableName" || t.to - t.from < 20 && v.test(e.state.sliceDoc(t.from, t.to));
|
|
78
|
+
if (!n && !e.explicit) return null;
|
|
79
|
+
let r = [];
|
|
80
|
+
for (let n = t; n; n = n.parent) m.has(n.name) && (r = r.concat(_(e.state.doc, n)));
|
|
81
|
+
return {
|
|
82
|
+
options: r,
|
|
83
|
+
from: n ? t.from : e.pos,
|
|
84
|
+
validFor: v
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var x = /* @__PURE__ */ [
|
|
88
|
+
"__annotations__",
|
|
89
|
+
"__builtins__",
|
|
90
|
+
"__debug__",
|
|
91
|
+
"__doc__",
|
|
92
|
+
"__import__",
|
|
93
|
+
"__name__",
|
|
94
|
+
"__loader__",
|
|
95
|
+
"__package__",
|
|
96
|
+
"__spec__",
|
|
97
|
+
"False",
|
|
98
|
+
"None",
|
|
99
|
+
"True"
|
|
100
|
+
].map((e) => ({
|
|
101
|
+
label: e,
|
|
102
|
+
type: "constant"
|
|
103
|
+
})).concat(/* @__PURE__ */ (/* @__PURE__ */ "ArithmeticError.AssertionError.AttributeError.BaseException.BlockingIOError.BrokenPipeError.BufferError.BytesWarning.ChildProcessError.ConnectionAbortedError.ConnectionError.ConnectionRefusedError.ConnectionResetError.DeprecationWarning.EOFError.Ellipsis.EncodingWarning.EnvironmentError.Exception.FileExistsError.FileNotFoundError.FloatingPointError.FutureWarning.GeneratorExit.IOError.ImportError.ImportWarning.IndentationError.IndexError.InterruptedError.IsADirectoryError.KeyError.KeyboardInterrupt.LookupError.MemoryError.ModuleNotFoundError.NameError.NotADirectoryError.NotImplemented.NotImplementedError.OSError.OverflowError.PendingDeprecationWarning.PermissionError.ProcessLookupError.RecursionError.ReferenceError.ResourceWarning.RuntimeError.RuntimeWarning.StopAsyncIteration.StopIteration.SyntaxError.SyntaxWarning.SystemError.SystemExit.TabError.TimeoutError.TypeError.UnboundLocalError.UnicodeDecodeError.UnicodeEncodeError.UnicodeError.UnicodeTranslateError.UnicodeWarning.UserWarning.ValueError.Warning.ZeroDivisionError".split(".")).map((e) => ({
|
|
104
|
+
label: e,
|
|
105
|
+
type: "type"
|
|
106
|
+
}))).concat(/* @__PURE__ */ [
|
|
107
|
+
"bool",
|
|
108
|
+
"bytearray",
|
|
109
|
+
"bytes",
|
|
110
|
+
"classmethod",
|
|
111
|
+
"complex",
|
|
112
|
+
"float",
|
|
113
|
+
"frozenset",
|
|
114
|
+
"int",
|
|
115
|
+
"list",
|
|
116
|
+
"map",
|
|
117
|
+
"memoryview",
|
|
118
|
+
"object",
|
|
119
|
+
"range",
|
|
120
|
+
"set",
|
|
121
|
+
"staticmethod",
|
|
122
|
+
"str",
|
|
123
|
+
"super",
|
|
124
|
+
"tuple",
|
|
125
|
+
"type"
|
|
126
|
+
].map((e) => ({
|
|
127
|
+
label: e,
|
|
128
|
+
type: "class"
|
|
129
|
+
}))).concat(/* @__PURE__ */ (/* @__PURE__ */ "abs.aiter.all.anext.any.ascii.bin.breakpoint.callable.chr.compile.delattr.dict.dir.divmod.enumerate.eval.exec.exit.filter.format.getattr.globals.hasattr.hash.help.hex.id.input.isinstance.issubclass.iter.len.license.locals.max.min.next.oct.open.ord.pow.print.property.quit.repr.reversed.round.setattr.slice.sorted.sum.vars.zip".split(".")).map((e) => ({
|
|
130
|
+
label: e,
|
|
131
|
+
type: "function"
|
|
132
|
+
}))), S = [
|
|
133
|
+
/* @__PURE__ */ d("def ${name}(${params}):\n ${}", {
|
|
134
|
+
label: "def",
|
|
135
|
+
detail: "function",
|
|
136
|
+
type: "keyword"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ d("for ${name} in ${collection}:\n ${}", {
|
|
139
|
+
label: "for",
|
|
140
|
+
detail: "loop",
|
|
141
|
+
type: "keyword"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ d("while ${}:\n ${}", {
|
|
144
|
+
label: "while",
|
|
145
|
+
detail: "loop",
|
|
146
|
+
type: "keyword"
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ d("try:\n ${}\nexcept ${error}:\n ${}", {
|
|
149
|
+
label: "try",
|
|
150
|
+
detail: "/ except block",
|
|
151
|
+
type: "keyword"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ d("if ${}:\n \n", {
|
|
154
|
+
label: "if",
|
|
155
|
+
detail: "block",
|
|
156
|
+
type: "keyword"
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ d("if ${}:\n ${}\nelse:\n ${}", {
|
|
159
|
+
label: "if",
|
|
160
|
+
detail: "/ else block",
|
|
161
|
+
type: "keyword"
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ d("class ${name}:\n def __init__(self, ${params}):\n ${}", {
|
|
164
|
+
label: "class",
|
|
165
|
+
detail: "definition",
|
|
166
|
+
type: "keyword"
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ d("import ${module}", {
|
|
169
|
+
label: "import",
|
|
170
|
+
detail: "statement",
|
|
171
|
+
type: "keyword"
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ d("from ${module} import ${names}", {
|
|
174
|
+
label: "from",
|
|
175
|
+
detail: "import",
|
|
176
|
+
type: "keyword"
|
|
177
|
+
})
|
|
178
|
+
], C = /* @__PURE__ */ u(y, /* @__PURE__ */ l(/* @__PURE__ */ x.concat(S)));
|
|
179
|
+
function w(e) {
|
|
180
|
+
let { node: t, pos: n } = e, r = e.lineIndent(n, -1), i = null;
|
|
181
|
+
for (;;) {
|
|
182
|
+
let a = t.childBefore(n);
|
|
183
|
+
if (!a) break;
|
|
184
|
+
if (a.name == "Comment") n = a.from;
|
|
185
|
+
else if (a.name == "Body" || a.name == "MatchBody") e.baseIndentFor(a) + e.unit <= r && (i = a), t = a;
|
|
186
|
+
else if (a.name == "MatchClause") t = a;
|
|
187
|
+
else if (a.type.is("Statement")) t = a;
|
|
188
|
+
else break;
|
|
189
|
+
}
|
|
190
|
+
return i;
|
|
191
|
+
}
|
|
192
|
+
function T(e, t) {
|
|
193
|
+
let n = e.baseIndentFor(t), r = e.lineAt(e.pos, -1), i = r.from + r.text.length;
|
|
194
|
+
return /^\s*($|#)/.test(r.text) && e.node.to < i + 100 && !/\S/.test(e.state.sliceDoc(i, e.node.to)) && e.lineIndent(e.pos, -1) <= n || /^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(e.textAfter) && e.lineIndent(e.pos, -1) > n ? null : n + e.unit;
|
|
195
|
+
}
|
|
196
|
+
var E = /* @__PURE__ */ n.define({
|
|
197
|
+
name: "python",
|
|
198
|
+
parser: /* @__PURE__ */ f.configure({ props: [/* @__PURE__ */ s.add({
|
|
199
|
+
Body: (e) => T(e, /^\s*(#|$)/.test(e.textAfter) && w(e) || e.node) ?? e.continue(),
|
|
200
|
+
MatchBody: (e) => T(e, w(e) || e.node) ?? e.continue(),
|
|
201
|
+
IfStatement: (e) => /^\s*(else:|elif )/.test(e.textAfter) ? e.baseIndent : e.continue(),
|
|
202
|
+
"ForStatement WhileStatement": (e) => /^\s*else:/.test(e.textAfter) ? e.baseIndent : e.continue(),
|
|
203
|
+
TryStatement: (e) => /^\s*(except[ :]|finally:|else:)/.test(e.textAfter) ? e.baseIndent : e.continue(),
|
|
204
|
+
MatchStatement: (e) => /^\s*case /.test(e.textAfter) ? e.baseIndent + e.unit : e.continue(),
|
|
205
|
+
"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression": /* @__PURE__ */ i({ closing: ")" }),
|
|
206
|
+
"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression": /* @__PURE__ */ i({ closing: "}" }),
|
|
207
|
+
"ArrayExpression ArrayComprehensionExpression": /* @__PURE__ */ i({ closing: "]" }),
|
|
208
|
+
MemberExpression: (e) => e.baseIndent + e.unit,
|
|
209
|
+
"String FormatString": () => null,
|
|
210
|
+
Script: (e) => {
|
|
211
|
+
let t = w(e);
|
|
212
|
+
return (t && T(e, t)) ?? e.continue();
|
|
213
|
+
}
|
|
214
|
+
}), /* @__PURE__ */ o.add({
|
|
215
|
+
"ArrayExpression DictionaryExpression SetExpression TupleExpression": a,
|
|
216
|
+
Body: (e, t) => ({
|
|
217
|
+
from: e.from + 1,
|
|
218
|
+
to: e.to - (e.to == t.doc.length ? 0 : 1)
|
|
219
|
+
}),
|
|
220
|
+
"String FormatString": (e, t) => ({
|
|
221
|
+
from: t.doc.lineAt(e.from).to,
|
|
222
|
+
to: e.to
|
|
223
|
+
})
|
|
224
|
+
})] }),
|
|
225
|
+
languageData: {
|
|
226
|
+
closeBrackets: {
|
|
227
|
+
brackets: [
|
|
228
|
+
"(",
|
|
229
|
+
"[",
|
|
230
|
+
"{",
|
|
231
|
+
"'",
|
|
232
|
+
"\"",
|
|
233
|
+
"'''",
|
|
234
|
+
"\"\"\""
|
|
235
|
+
],
|
|
236
|
+
stringPrefixes: [
|
|
237
|
+
"f",
|
|
238
|
+
"fr",
|
|
239
|
+
"rf",
|
|
240
|
+
"r",
|
|
241
|
+
"u",
|
|
242
|
+
"b",
|
|
243
|
+
"br",
|
|
244
|
+
"rb",
|
|
245
|
+
"F",
|
|
246
|
+
"FR",
|
|
247
|
+
"RF",
|
|
248
|
+
"R",
|
|
249
|
+
"U",
|
|
250
|
+
"B",
|
|
251
|
+
"BR",
|
|
252
|
+
"RB"
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
commentTokens: { line: "#" },
|
|
256
|
+
indentOnInput: /^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
function D() {
|
|
260
|
+
return new r(E, [E.data.of({ autocomplete: b }), E.data.of({ autocomplete: C })]);
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
export { D as python };
|
|
264
|
+
|
|
265
|
+
//# sourceMappingURL=index.js.map
|