@coldsmirk/inkstone-codemirror 0.8.2 → 0.9.0
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/README.md +2 -2
- package/dist/context-D86o2jK3.js +382 -0
- package/dist/index.d.ts +241 -46
- package/dist/index.js +162 -16
- package/dist/{minijinja-HpehSBbW.js → minijinja-D_5erBa7.js} +81 -18
- package/package.json +7 -12
- package/dist/context-BDibyUwD.cjs +0 -270
- package/dist/context-Dx6bPnKq.js +0 -235
- package/dist/index.cjs +0 -166
- package/dist/index.d.cts +0 -362
- package/dist/minijinja-DN9iLNbL.cjs +0 -357
package/dist/context-Dx6bPnKq.js
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { StateEffect, StateField } from "@codemirror/state";
|
|
2
|
-
//#region src/context.ts
|
|
3
|
-
const ANY = { kind: "any" };
|
|
4
|
-
const NULL = { kind: "null" };
|
|
5
|
-
const MAX_DEREF = 100;
|
|
6
|
-
const setMinijinjaContext = StateEffect.define();
|
|
7
|
-
const minijinjaContextField = StateField.define({
|
|
8
|
-
create() {
|
|
9
|
-
return null;
|
|
10
|
-
},
|
|
11
|
-
update(value, transaction) {
|
|
12
|
-
let next = value;
|
|
13
|
-
for (const effect of transaction.effects) if (effect.is(setMinijinjaContext)) next = effect.value;
|
|
14
|
-
return next;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
function normalizeContext(input) {
|
|
18
|
-
if ("schema" in input) return fromJsonSchema(input.schema);
|
|
19
|
-
return {
|
|
20
|
-
root: fromSample(input.sample),
|
|
21
|
-
defs: {}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function resolveMembers(ir, path, scope) {
|
|
25
|
-
const [first, ...rest] = path;
|
|
26
|
-
if (first === void 0) {
|
|
27
|
-
const top = membersOf(ir, ir.root);
|
|
28
|
-
if (!scope || scope.size === 0) return top;
|
|
29
|
-
return [...[...scope].map(([name, type]) => {
|
|
30
|
-
return {
|
|
31
|
-
name,
|
|
32
|
-
type,
|
|
33
|
-
required: true,
|
|
34
|
-
nullable: false
|
|
35
|
-
};
|
|
36
|
-
}), ...top];
|
|
37
|
-
}
|
|
38
|
-
let type = scope?.get(first) ?? stepInto(ir, ir.root, first);
|
|
39
|
-
for (const key of rest) {
|
|
40
|
-
if (!type) break;
|
|
41
|
-
type = stepInto(ir, type, key);
|
|
42
|
-
}
|
|
43
|
-
return type ? membersOf(ir, type) : [];
|
|
44
|
-
}
|
|
45
|
-
function typeAtPath(ir, path) {
|
|
46
|
-
let type = ir.root;
|
|
47
|
-
for (const key of path) {
|
|
48
|
-
const next = stepInto(ir, type, key);
|
|
49
|
-
if (next === null) return null;
|
|
50
|
-
type = next;
|
|
51
|
-
}
|
|
52
|
-
return deref(ir, type);
|
|
53
|
-
}
|
|
54
|
-
function elementType(ir, type) {
|
|
55
|
-
const resolved = deref(ir, type);
|
|
56
|
-
return resolved.kind === "array" ? deref(ir, resolved.element) : null;
|
|
57
|
-
}
|
|
58
|
-
function deref(ir, type) {
|
|
59
|
-
let current = type;
|
|
60
|
-
for (let i = 0; i < MAX_DEREF && current.kind === "ref"; i++) {
|
|
61
|
-
const next = ir.defs[current.name];
|
|
62
|
-
if (!next) return ANY;
|
|
63
|
-
current = next;
|
|
64
|
-
}
|
|
65
|
-
return current;
|
|
66
|
-
}
|
|
67
|
-
function stepInto(ir, type, key) {
|
|
68
|
-
const resolved = deref(ir, type);
|
|
69
|
-
if (resolved.kind !== "object") return null;
|
|
70
|
-
const field = resolved.fields[key];
|
|
71
|
-
return field ? field.type : null;
|
|
72
|
-
}
|
|
73
|
-
function membersOf(ir, type) {
|
|
74
|
-
const resolved = deref(ir, type);
|
|
75
|
-
if (resolved.kind !== "object") return [];
|
|
76
|
-
return Object.entries(resolved.fields).map(([name, field]) => {
|
|
77
|
-
return {
|
|
78
|
-
name,
|
|
79
|
-
type: field.type,
|
|
80
|
-
required: field.required,
|
|
81
|
-
nullable: field.nullable,
|
|
82
|
-
doc: field.doc
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const REF_PREFIXES = ["#/$defs/", "#/definitions/"];
|
|
87
|
-
function fromJsonSchema(schema) {
|
|
88
|
-
if (!isObject(schema)) return {
|
|
89
|
-
root: ANY,
|
|
90
|
-
defs: {}
|
|
91
|
-
};
|
|
92
|
-
const defsSource = {
|
|
93
|
-
...asObject(schema.definitions),
|
|
94
|
-
...asObject(schema.$defs)
|
|
95
|
-
};
|
|
96
|
-
const defs = {};
|
|
97
|
-
for (const [name, sub] of Object.entries(defsSource)) defs[name] = convert(sub);
|
|
98
|
-
return {
|
|
99
|
-
root: convert(schema),
|
|
100
|
-
defs
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function convert(node) {
|
|
104
|
-
if (typeof node === "boolean" || !isObject(node)) return ANY;
|
|
105
|
-
const ref = refName(node.$ref);
|
|
106
|
-
if (ref !== null) return {
|
|
107
|
-
kind: "ref",
|
|
108
|
-
name: ref
|
|
109
|
-
};
|
|
110
|
-
if (Array.isArray(node.allOf)) return mergeAll(node.allOf.map((entry) => convert(entry)));
|
|
111
|
-
const union = node.anyOf ?? node.oneOf;
|
|
112
|
-
if (Array.isArray(union)) {
|
|
113
|
-
const nonNull = union.filter((branch) => !isNullBranch(branch));
|
|
114
|
-
if (nonNull.length === 0) return NULL;
|
|
115
|
-
return nonNull.length === 1 ? convert(nonNull[0]) : mergeAll(nonNull.map((entry) => convert(entry)));
|
|
116
|
-
}
|
|
117
|
-
if (Array.isArray(node.enum)) return {
|
|
118
|
-
kind: "enum",
|
|
119
|
-
values: node.enum.filter(isLiteral)
|
|
120
|
-
};
|
|
121
|
-
if ("const" in node && isLiteral(node.const)) return {
|
|
122
|
-
kind: "enum",
|
|
123
|
-
values: [node.const]
|
|
124
|
-
};
|
|
125
|
-
const type = primaryType(node);
|
|
126
|
-
if (type === "object" || isObject(node.properties)) return objectType(node);
|
|
127
|
-
if (type === "array") return {
|
|
128
|
-
kind: "array",
|
|
129
|
-
element: convert(Array.isArray(node.items) ? node.items[0] : node.items)
|
|
130
|
-
};
|
|
131
|
-
if (type === "string") return { kind: "string" };
|
|
132
|
-
if (type === "integer" || type === "number") return { kind: "number" };
|
|
133
|
-
if (type === "boolean") return { kind: "boolean" };
|
|
134
|
-
if (type === "null") return NULL;
|
|
135
|
-
return ANY;
|
|
136
|
-
}
|
|
137
|
-
function objectType(node) {
|
|
138
|
-
const properties = asObject(node.properties);
|
|
139
|
-
const required = new Set(Array.isArray(node.required) ? node.required.filter((name) => typeof name === "string") : []);
|
|
140
|
-
const fields = {};
|
|
141
|
-
for (const [name, sub] of Object.entries(properties)) fields[name] = {
|
|
142
|
-
type: convert(sub),
|
|
143
|
-
required: required.has(name),
|
|
144
|
-
nullable: isNullable(sub),
|
|
145
|
-
doc: description(sub)
|
|
146
|
-
};
|
|
147
|
-
return {
|
|
148
|
-
kind: "object",
|
|
149
|
-
fields
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function mergeAll(types) {
|
|
153
|
-
const objects = types.filter((type) => type.kind === "object");
|
|
154
|
-
if (objects.length > 0) {
|
|
155
|
-
const fields = {};
|
|
156
|
-
for (const object of objects) Object.assign(fields, object.fields);
|
|
157
|
-
return {
|
|
158
|
-
kind: "object",
|
|
159
|
-
fields
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
return types.find((type) => type.kind !== "any") ?? ANY;
|
|
163
|
-
}
|
|
164
|
-
function fromSample(value, ancestors = /* @__PURE__ */ new WeakSet()) {
|
|
165
|
-
if (value === null || value === void 0) return ANY;
|
|
166
|
-
if (typeof value === "object") {
|
|
167
|
-
if (ancestors.has(value)) return ANY;
|
|
168
|
-
ancestors.add(value);
|
|
169
|
-
const type = Array.isArray(value) ? sampleArrayType(value, ancestors) : sampleObjectType(value, ancestors);
|
|
170
|
-
ancestors.delete(value);
|
|
171
|
-
return type;
|
|
172
|
-
}
|
|
173
|
-
if (typeof value === "string") return { kind: "string" };
|
|
174
|
-
if (typeof value === "number") return { kind: "number" };
|
|
175
|
-
if (typeof value === "boolean") return { kind: "boolean" };
|
|
176
|
-
return ANY;
|
|
177
|
-
}
|
|
178
|
-
function sampleArrayType(value, ancestors) {
|
|
179
|
-
return {
|
|
180
|
-
kind: "array",
|
|
181
|
-
element: value.length > 0 ? fromSample(value[0], ancestors) : ANY
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
function sampleObjectType(value, ancestors) {
|
|
185
|
-
const fields = {};
|
|
186
|
-
for (const [name, member] of Object.entries(value)) fields[name] = {
|
|
187
|
-
type: fromSample(member, ancestors),
|
|
188
|
-
required: true,
|
|
189
|
-
nullable: member === null
|
|
190
|
-
};
|
|
191
|
-
return {
|
|
192
|
-
kind: "object",
|
|
193
|
-
fields
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function refName(ref) {
|
|
197
|
-
if (typeof ref !== "string") return null;
|
|
198
|
-
for (const prefix of REF_PREFIXES) if (ref.startsWith(prefix)) return decodeURIComponent(ref.slice(prefix.length));
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
function primaryType(node) {
|
|
202
|
-
const { type } = node;
|
|
203
|
-
if (typeof type === "string") return type;
|
|
204
|
-
if (Array.isArray(type)) {
|
|
205
|
-
const nonNull = type.find((entry) => typeof entry === "string" && entry !== "null");
|
|
206
|
-
if (typeof nonNull === "string") return nonNull;
|
|
207
|
-
return type.includes("null") ? "null" : null;
|
|
208
|
-
}
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
function isNullable(node) {
|
|
212
|
-
if (!isObject(node)) return false;
|
|
213
|
-
const { type } = node;
|
|
214
|
-
if (type === "null" || Array.isArray(type) && type.includes("null")) return true;
|
|
215
|
-
const union = node.anyOf ?? node.oneOf;
|
|
216
|
-
return Array.isArray(union) && union.some((branch) => isNullBranch(branch));
|
|
217
|
-
}
|
|
218
|
-
function isNullBranch(branch) {
|
|
219
|
-
if (!isObject(branch)) return false;
|
|
220
|
-
return branch.type === "null" || Array.isArray(branch.type) && branch.type.length === 1 && branch.type[0] === "null";
|
|
221
|
-
}
|
|
222
|
-
function description(node) {
|
|
223
|
-
return isObject(node) && typeof node.description === "string" ? node.description : void 0;
|
|
224
|
-
}
|
|
225
|
-
function isObject(value) {
|
|
226
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
227
|
-
}
|
|
228
|
-
function asObject(value) {
|
|
229
|
-
return isObject(value) ? value : {};
|
|
230
|
-
}
|
|
231
|
-
function isLiteral(value) {
|
|
232
|
-
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
233
|
-
}
|
|
234
|
-
//#endregion
|
|
235
|
-
export { setMinijinjaContext as a, resolveMembers as i, minijinjaContextField as n, typeAtPath as o, normalizeContext as r, elementType as t };
|
package/dist/index.cjs
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-BDibyUwD.cjs");
|
|
3
|
-
let _codemirror_state = require("@codemirror/state");
|
|
4
|
-
let _codemirror_view = require("@codemirror/view");
|
|
5
|
-
let _codemirror_autocomplete = require("@codemirror/autocomplete");
|
|
6
|
-
let _codemirror_commands = require("@codemirror/commands");
|
|
7
|
-
let _codemirror_language = require("@codemirror/language");
|
|
8
|
-
let _codemirror_search = require("@codemirror/search");
|
|
9
|
-
//#region src/controlled-host.ts
|
|
10
|
-
var ControlledEditorHost = class {
|
|
11
|
-
compartment = new _codemirror_state.Compartment();
|
|
12
|
-
silent = false;
|
|
13
|
-
view;
|
|
14
|
-
constructor({ parent, doc, onChange, extensions = [], dynamicExtensions = [] }) {
|
|
15
|
-
this.view = new _codemirror_view.EditorView({
|
|
16
|
-
parent,
|
|
17
|
-
state: _codemirror_state.EditorState.create({
|
|
18
|
-
doc,
|
|
19
|
-
extensions: [
|
|
20
|
-
...extensions,
|
|
21
|
-
this.compartment.of(dynamicExtensions),
|
|
22
|
-
_codemirror_view.EditorView.updateListener.of((update) => {
|
|
23
|
-
if (update.docChanged && !this.silent) onChange(update.state.doc.toString());
|
|
24
|
-
})
|
|
25
|
-
]
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
setValue(value) {
|
|
30
|
-
const current = this.view.state.doc.toString();
|
|
31
|
-
if (value === current) return;
|
|
32
|
-
const shorter = Math.min(current.length, value.length);
|
|
33
|
-
let from = 0;
|
|
34
|
-
while (from < shorter && current.codePointAt(from) === value.codePointAt(from)) from += 1;
|
|
35
|
-
let currentEnd = current.length;
|
|
36
|
-
let valueEnd = value.length;
|
|
37
|
-
while (currentEnd > from && valueEnd > from && current.codePointAt(currentEnd - 1) === value.codePointAt(valueEnd - 1)) {
|
|
38
|
-
currentEnd -= 1;
|
|
39
|
-
valueEnd -= 1;
|
|
40
|
-
}
|
|
41
|
-
this.silent = true;
|
|
42
|
-
try {
|
|
43
|
-
this.view.dispatch({ changes: {
|
|
44
|
-
from,
|
|
45
|
-
to: currentEnd,
|
|
46
|
-
insert: value.slice(from, valueEnd)
|
|
47
|
-
} });
|
|
48
|
-
} finally {
|
|
49
|
-
this.silent = false;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
reconfigure(dynamicExtensions) {
|
|
53
|
-
this.view.dispatch({ effects: this.compartment.reconfigure(dynamicExtensions) });
|
|
54
|
-
}
|
|
55
|
-
destroy() {
|
|
56
|
-
this.view.destroy();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const searchPhrasesZhCn = _codemirror_state.EditorState.phrases.of({
|
|
60
|
-
Find: "查找",
|
|
61
|
-
Replace: "替换",
|
|
62
|
-
next: "下一个",
|
|
63
|
-
previous: "上一个",
|
|
64
|
-
all: "全部",
|
|
65
|
-
"match case": "区分大小写",
|
|
66
|
-
regexp: "正则表达式",
|
|
67
|
-
"by word": "全字匹配",
|
|
68
|
-
replace: "替换",
|
|
69
|
-
"replace all": "全部替换",
|
|
70
|
-
close: "关闭",
|
|
71
|
-
"current match": "当前匹配",
|
|
72
|
-
"on line": "所在行",
|
|
73
|
-
"Go to line": "跳转到行",
|
|
74
|
-
go: "跳转"
|
|
75
|
-
});
|
|
76
|
-
function documentExtensions({ placeholder, lineWrapping = false, showLineNumbers = false, folding = false, spellcheck = false, search = false } = {}) {
|
|
77
|
-
return [
|
|
78
|
-
...showLineNumbers ? [(0, _codemirror_view.lineNumbers)()] : [],
|
|
79
|
-
...folding ? [
|
|
80
|
-
(0, _codemirror_language.codeFolding)(),
|
|
81
|
-
(0, _codemirror_language.foldGutter)(),
|
|
82
|
-
_codemirror_view.keymap.of(_codemirror_language.foldKeymap)
|
|
83
|
-
] : [],
|
|
84
|
-
(0, _codemirror_commands.history)(),
|
|
85
|
-
(0, _codemirror_view.drawSelection)(),
|
|
86
|
-
(0, _codemirror_view.highlightActiveLine)(),
|
|
87
|
-
(0, _codemirror_language.indentOnInput)(),
|
|
88
|
-
(0, _codemirror_language.bracketMatching)(),
|
|
89
|
-
(0, _codemirror_autocomplete.closeBrackets)(),
|
|
90
|
-
(0, _codemirror_autocomplete.autocompletion)(),
|
|
91
|
-
...lineWrapping ? [_codemirror_view.EditorView.lineWrapping] : [],
|
|
92
|
-
...search ? [(0, _codemirror_search.highlightSelectionMatches)(), _codemirror_view.keymap.of(_codemirror_search.searchKeymap)] : [],
|
|
93
|
-
_codemirror_view.keymap.of([
|
|
94
|
-
..._codemirror_autocomplete.closeBracketsKeymap,
|
|
95
|
-
..._codemirror_commands.defaultKeymap,
|
|
96
|
-
..._codemirror_commands.historyKeymap,
|
|
97
|
-
..._codemirror_autocomplete.completionKeymap,
|
|
98
|
-
_codemirror_commands.indentWithTab
|
|
99
|
-
]),
|
|
100
|
-
(0, _codemirror_view.placeholder)(placeholder ?? ""),
|
|
101
|
-
...spellcheck ? [_codemirror_view.EditorView.contentAttributes.of({ spellcheck: "true" })] : []
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/languages.ts
|
|
106
|
-
const loaders = {
|
|
107
|
-
javascript: () => import("@codemirror/lang-javascript").then((mod) => mod.javascript()),
|
|
108
|
-
typescript: () => import("@codemirror/lang-javascript").then((mod) => mod.javascript({ typescript: true })),
|
|
109
|
-
jsx: () => import("@codemirror/lang-javascript").then((mod) => mod.javascript({ jsx: true })),
|
|
110
|
-
tsx: () => import("@codemirror/lang-javascript").then((mod) => mod.javascript({
|
|
111
|
-
jsx: true,
|
|
112
|
-
typescript: true
|
|
113
|
-
})),
|
|
114
|
-
json: () => import("@codemirror/lang-json").then((mod) => mod.json()),
|
|
115
|
-
html: () => import("@codemirror/lang-html").then((mod) => mod.html()),
|
|
116
|
-
css: () => import("@codemirror/lang-css").then((mod) => mod.css()),
|
|
117
|
-
scss: () => import("@codemirror/lang-sass").then((mod) => mod.sass()),
|
|
118
|
-
sass: () => import("@codemirror/lang-sass").then((mod) => mod.sass({ indented: true })),
|
|
119
|
-
less: () => import("@codemirror/lang-less").then((mod) => mod.less()),
|
|
120
|
-
python: () => import("@codemirror/lang-python").then((mod) => mod.python()),
|
|
121
|
-
java: () => import("@codemirror/lang-java").then((mod) => mod.java()),
|
|
122
|
-
markdown: () => import("@codemirror/lang-markdown").then((mod) => mod.markdown()),
|
|
123
|
-
xml: () => import("@codemirror/lang-xml").then((mod) => mod.xml()),
|
|
124
|
-
rust: () => import("@codemirror/lang-rust").then((mod) => mod.rust()),
|
|
125
|
-
php: () => import("@codemirror/lang-php").then((mod) => mod.php()),
|
|
126
|
-
yaml: () => import("@codemirror/lang-yaml").then((mod) => mod.yaml()),
|
|
127
|
-
go: () => import("@codemirror/lang-go").then((mod) => mod.go()),
|
|
128
|
-
cpp: () => import("@codemirror/lang-cpp").then((mod) => mod.cpp()),
|
|
129
|
-
c: () => import("@codemirror/lang-cpp").then((mod) => mod.cpp()),
|
|
130
|
-
vue: () => import("@codemirror/lang-vue").then((mod) => mod.vue()),
|
|
131
|
-
liquid: () => import("@codemirror/lang-liquid").then((mod) => mod.liquid()),
|
|
132
|
-
wast: () => import("@codemirror/lang-wast").then((mod) => mod.wast()),
|
|
133
|
-
sql: () => import("@codemirror/lang-sql").then((mod) => mod.sql()),
|
|
134
|
-
mysql: () => import("@codemirror/lang-sql").then((mod) => mod.sql({ dialect: mod.MySQL })),
|
|
135
|
-
pgsql: () => import("@codemirror/lang-sql").then((mod) => mod.sql({ dialect: mod.PostgreSQL })),
|
|
136
|
-
sqlite: () => import("@codemirror/lang-sql").then((mod) => mod.sql({ dialect: mod.SQLite })),
|
|
137
|
-
minijinja: () => Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")).then((mod) => mod.minijinja()),
|
|
138
|
-
"minijinja-html": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-html")]).then(([mj, mod]) => mj.minijinja({ base: mod.html() })),
|
|
139
|
-
"minijinja-xml": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-xml")]).then(([mj, mod]) => mj.minijinja({ base: mod.xml() })),
|
|
140
|
-
"minijinja-json": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-json")]).then(([mj, mod]) => mj.minijinja({ base: mod.json() })),
|
|
141
|
-
"minijinja-yaml": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-yaml")]).then(([mj, mod]) => mj.minijinja({ base: mod.yaml() })),
|
|
142
|
-
"minijinja-css": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-css")]).then(([mj, mod]) => mj.minijinja({ base: mod.css() })),
|
|
143
|
-
"minijinja-scss": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sass")]).then(([mj, mod]) => mj.minijinja({ base: mod.sass() })),
|
|
144
|
-
"minijinja-sass": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sass")]).then(([mj, mod]) => mj.minijinja({ base: mod.sass({ indented: true }) })),
|
|
145
|
-
"minijinja-less": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-less")]).then(([mj, mod]) => mj.minijinja({ base: mod.less() })),
|
|
146
|
-
"minijinja-markdown": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-markdown")]).then(([mj, mod]) => mj.minijinja({ base: mod.markdown() })),
|
|
147
|
-
"minijinja-sql": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sql")]).then(([mj, mod]) => mj.minijinja({ base: mod.sql() })),
|
|
148
|
-
"minijinja-mysql": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sql")]).then(([mj, mod]) => mj.minijinja({ base: mod.sql({ dialect: mod.MySQL }) })),
|
|
149
|
-
"minijinja-pgsql": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sql")]).then(([mj, mod]) => mj.minijinja({ base: mod.sql({ dialect: mod.PostgreSQL }) })),
|
|
150
|
-
"minijinja-sqlite": () => Promise.all([Promise.resolve().then(() => require("./minijinja-DN9iLNbL.cjs")), import("@codemirror/lang-sql")]).then(([mj, mod]) => mj.minijinja({ base: mod.sql({ dialect: mod.SQLite }) }))
|
|
151
|
-
};
|
|
152
|
-
const codeMirrorLanguages = Object.keys(loaders).toSorted();
|
|
153
|
-
function loadLanguage(language) {
|
|
154
|
-
return loaders[language]();
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
157
|
-
exports.ControlledEditorHost = ControlledEditorHost;
|
|
158
|
-
exports.codeMirrorLanguages = codeMirrorLanguages;
|
|
159
|
-
exports.documentExtensions = documentExtensions;
|
|
160
|
-
exports.loadLanguage = loadLanguage;
|
|
161
|
-
exports.minijinjaContextField = require_context.minijinjaContextField;
|
|
162
|
-
exports.normalizeContext = require_context.normalizeContext;
|
|
163
|
-
exports.resolveMembers = require_context.resolveMembers;
|
|
164
|
-
exports.searchPhrasesZhCn = searchPhrasesZhCn;
|
|
165
|
-
exports.setMinijinjaContext = require_context.setMinijinjaContext;
|
|
166
|
-
exports.typeAtPath = require_context.typeAtPath;
|