@oomol-lab/open-flow 0.1.0-beta.2 → 0.1.0-beta.21
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/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
- package/dist/browser/carbon-Cn-DTyjG.js +54 -0
- package/dist/browser/createResourceDialog-CjuJryCv.js +110 -0
- package/dist/browser/dist-B_T-OpQp.js +4 -0
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CPuF50D9.js → dist-D1VYgicl.js} +426 -305
- package/dist/browser/dist-DSe6KRsr.js +1224 -0
- package/dist/browser/dist-DYjIVIZC.js +795 -0
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/{dist-CJpzJrLM.js → dist-DwvhuMxw.js} +894 -895
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-C46JByB-.js → dist-Dz6Nglsd.js} +61 -61
- package/dist/browser/{dist-DUzA0Ukh.js → dist-TJfrvoIQ.js} +141 -142
- package/dist/browser/{esm-B_PbUobB.js → esm-B7A42FzW.js} +68 -59
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +20 -6
- package/dist/browser/flow-authoring.d.ts +1 -1
- package/dist/browser/flow-authoring.js +5405 -286
- package/dist/browser/flow-change-schema.d.ts +6 -0
- package/dist/browser/flow-change.d.ts +173 -14
- package/dist/browser/flow-change.js +5271 -114
- package/dist/browser/flow-notifications.d.ts +5 -0
- package/dist/browser/flowChanges-Tg1duLry.js +11081 -0
- package/dist/browser/{flowRunInputEditorStore-BeyUSWpO.js → flowRunInputEditorStore-BBqQIOCR.js} +1020 -4104
- package/dist/browser/flowWorkspace-CoK10XHY.js +148497 -0
- package/dist/browser/host-conformance.d.ts +7 -0
- package/dist/browser/host-conformance.js +33 -0
- package/dist/browser/{diagnostics-giPSzyMo.js → i18n-CVBh0Ni1.js} +3390 -5715
- package/dist/browser/inputValues-CDiBMKu8.js +43 -0
- package/dist/browser/{languages-DgJehE1g.js → languages-C0zQ4GSo.js} +5 -25
- package/dist/browser/licenses.md +149 -700
- package/dist/browser/main-BDnNHhkU.js +50 -0
- package/dist/browser/{markdownContent-DdlIRN3_.js → markdownContent-BBgH9ZIV.js} +41 -41
- package/dist/browser/theme.css +461 -34
- package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-DnAmJCzu.js} +70 -71
- package/dist/browser/ui-input.d.ts +3 -0
- package/dist/browser/ui-label.d.ts +3 -0
- package/dist/browser/ui-textarea.d.ts +3 -0
- package/dist/browser/ui.css +2 -0
- package/dist/browser/ui.css.d.ts +1 -0
- package/dist/browser/ui.d.ts +12 -0
- package/dist/browser/ui.js +2598 -0
- package/dist/browser/useValueChanged-BY05Usw-.js +2944 -0
- package/dist/browser/workbench-contract.d.ts +8 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +2043 -1327
- package/dist/browser/workbenchSelect-DEmv7SLW.js +11666 -0
- package/dist/common/control-api-conformance.d.ts +7 -0
- package/dist/common/control-api-conformance.js +5629 -166
- package/dist/common/control-api-errors.d.ts +9 -0
- package/dist/common/control-api.d.ts +309 -38
- package/dist/common/control-api.js +5877 -575
- package/dist/common/control-requests.d.ts +68 -0
- package/dist/common/control-requests.js +4950 -0
- package/dist/common/engine-contract.d.ts +3 -1
- package/dist/common/flow-agent.d.ts +10 -0
- package/dist/common/flow-encoding.d.ts +11 -2
- package/dist/common/flow-encoding.js +4972 -66
- package/dist/common/flow-graph.d.ts +6 -0
- package/dist/common/flow-json.d.ts +2 -0
- package/dist/common/flow-modules.d.ts +20 -0
- package/dist/common/flow-notifications.d.ts +5 -0
- package/dist/common/flow-schema.d.ts +8 -0
- package/dist/common/flow-semantics.d.ts +10 -6
- package/dist/common/flow-semantics.js +10042 -1700
- package/dist/common/integration-trigger.d.ts +24 -1
- package/dist/common/integration-trigger.js +188 -52
- package/dist/common/mcp-conformance.d.ts +2 -0
- package/dist/common/mcp.d.ts +765 -0
- package/dist/common/mcp.js +6538 -0
- package/dist/common/provider-triggers.js +6057 -993
- package/dist/common/run-events.d.ts +2 -2
- package/dist/common/run-events.js +12 -17
- package/dist/common/run-lifecycle.d.ts +21 -2
- package/dist/common/run-lifecycle.js +83 -2
- package/dist/common/run-results.d.ts +57 -0
- package/dist/common/runtime-contract.d.ts +36 -3
- package/dist/common/runtime-contract.js +227 -19
- package/dist/common/scheduler.d.ts +77 -18
- package/dist/common/scheduler.js +8259 -248
- package/dist/index.d.ts +6 -5
- package/package.json +21 -1
- package/dist/browser/carbon-DMCVsjHo.js +0 -53
- package/dist/browser/createResourceDialog-BkZns-oZ.js +0 -504
- package/dist/browser/dist-BMqL-qR5.js +0 -1894
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
- package/dist/browser/flowWorkspace-DAMLVMcF.js +0 -47584
- package/dist/browser/getPseudoElementBounds-ESJExRFX.js +0 -7642
- package/dist/browser/main-DmjVyuWr.js +0 -76
- package/dist/browser/workbenchSelect-B2s1HV-Y.js +0 -1374
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { D as ee,
|
|
1
|
+
import { r as e } from "./rolldown-runtime-CEFd7nDs.js";
|
|
2
|
+
import { _ as t, a as n, c as r, f as i, g as a, h as o, i as s, l as c, m as l, p as u, s as d, t as f, u as p, v as m, w as h, y as g } from "./dist-Mecbzdl2.js";
|
|
3
|
+
import { D as _, S as v, a as y, b, m as x, n as S, o as ee, r as C, t as w } from "./dist-BKuSVKCC.js";
|
|
4
|
+
import { E as te, M as T } from "./dist-DxahK_I8.js";
|
|
4
5
|
//#region ../../node_modules/.bun/@codemirror+autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js
|
|
5
|
-
var
|
|
6
|
+
var ne = /* @__PURE__ */ e({
|
|
7
|
+
CompletionContext: () => E,
|
|
8
|
+
acceptCompletion: () => Me,
|
|
9
|
+
autocompletion: () => Dt,
|
|
10
|
+
clearSnippet: () => Je,
|
|
11
|
+
closeBrackets: () => dt,
|
|
12
|
+
closeBracketsKeymap: () => _t,
|
|
13
|
+
closeCompletion: () => Ne,
|
|
14
|
+
completeAnyWord: () => lt,
|
|
15
|
+
completeFromList: () => D,
|
|
16
|
+
completionKeymap: () => $,
|
|
17
|
+
completionStatus: () => kt,
|
|
18
|
+
currentCompletions: () => jt,
|
|
19
|
+
deleteBracketPair: () => gt,
|
|
20
|
+
hasNextSnippetField: () => Ze,
|
|
21
|
+
hasPrevSnippetField: () => Qe,
|
|
22
|
+
ifIn: () => ae,
|
|
23
|
+
ifNotIn: () => oe,
|
|
24
|
+
insertBracket: () => vt,
|
|
25
|
+
insertCompletionText: () => A,
|
|
26
|
+
moveCompletionSelection: () => B,
|
|
27
|
+
nextSnippetField: () => Ye,
|
|
28
|
+
pickedCompletion: () => k,
|
|
29
|
+
prevSnippetField: () => Xe,
|
|
30
|
+
selectedCompletion: () => Mt,
|
|
31
|
+
selectedCompletionIndex: () => Nt,
|
|
32
|
+
setSelectedCompletion: () => Pt,
|
|
33
|
+
snippet: () => K,
|
|
34
|
+
snippetCompletion: () => tt,
|
|
35
|
+
snippetKeymap: () => q,
|
|
36
|
+
startCompletion: () => V
|
|
37
|
+
}), E = class {
|
|
6
38
|
constructor(e, t, n, r) {
|
|
7
39
|
this.state = e, this.pos = t, this.explicit = n, this.view = r, this.abortListeners = [], this.abortOnDocChange = !1;
|
|
8
40
|
}
|
|
@@ -17,7 +49,7 @@ var E = class {
|
|
|
17
49
|
} : null;
|
|
18
50
|
}
|
|
19
51
|
matchBefore(e) {
|
|
20
|
-
let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(
|
|
52
|
+
let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(ce(e, !1));
|
|
21
53
|
return i < 0 ? null : {
|
|
22
54
|
from: n + i,
|
|
23
55
|
to: this.pos,
|
|
@@ -31,21 +63,21 @@ var E = class {
|
|
|
31
63
|
e == "abort" && this.abortListeners && (this.abortListeners.push(t), n && n.onDocChange && (this.abortOnDocChange = !0));
|
|
32
64
|
}
|
|
33
65
|
};
|
|
34
|
-
function
|
|
66
|
+
function re(e) {
|
|
35
67
|
let t = Object.keys(e).join(""), n = /\w/.test(t);
|
|
36
68
|
return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
|
|
37
69
|
}
|
|
38
|
-
function
|
|
70
|
+
function ie(e) {
|
|
39
71
|
let t = Object.create(null), n = Object.create(null);
|
|
40
72
|
for (let { label: r } of e) {
|
|
41
73
|
t[r[0]] = !0;
|
|
42
74
|
for (let e = 1; e < r.length; e++) n[r[e]] = !0;
|
|
43
75
|
}
|
|
44
|
-
let r =
|
|
76
|
+
let r = re(t) + re(n) + "*$";
|
|
45
77
|
return [RegExp("^" + r), new RegExp(r)];
|
|
46
78
|
}
|
|
47
|
-
function
|
|
48
|
-
let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] :
|
|
79
|
+
function D(e) {
|
|
80
|
+
let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : ie(t);
|
|
49
81
|
return (e) => {
|
|
50
82
|
let i = e.matchBefore(r);
|
|
51
83
|
return i || e.explicit ? {
|
|
@@ -55,7 +87,16 @@ function re(e) {
|
|
|
55
87
|
} : null;
|
|
56
88
|
};
|
|
57
89
|
}
|
|
58
|
-
function
|
|
90
|
+
function ae(e, t) {
|
|
91
|
+
return (n) => {
|
|
92
|
+
for (let r = T(n.state).resolveInner(n.pos, -1); r; r = r.parent) {
|
|
93
|
+
if (e.indexOf(r.name) > -1) return t(n);
|
|
94
|
+
if (r.type.isTop) break;
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function oe(e, t) {
|
|
59
100
|
return (n) => {
|
|
60
101
|
for (let t = T(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
|
|
61
102
|
if (e.indexOf(t.name) > -1) return null;
|
|
@@ -64,7 +105,7 @@ function ie(e, t) {
|
|
|
64
105
|
return t(n);
|
|
65
106
|
};
|
|
66
107
|
}
|
|
67
|
-
var
|
|
108
|
+
var se = class {
|
|
68
109
|
constructor(e, t, n, r) {
|
|
69
110
|
this.completion = e, this.source = t, this.match = n, this.score = r;
|
|
70
111
|
}
|
|
@@ -72,90 +113,90 @@ var D = class {
|
|
|
72
113
|
function O(e) {
|
|
73
114
|
return e.selection.main.from;
|
|
74
115
|
}
|
|
75
|
-
function
|
|
116
|
+
function ce(e, t) {
|
|
76
117
|
let { source: n } = e, r = t && n[0] != "^", i = n[n.length - 1] != "$";
|
|
77
118
|
return !r && !i ? e : RegExp(`${r ? "^" : ""}(?:${n})${i ? "$" : ""}`, e.flags ?? (e.ignoreCase ? "i" : ""));
|
|
78
119
|
}
|
|
79
|
-
var
|
|
80
|
-
function
|
|
120
|
+
var k = /*@__PURE__*/ f.define();
|
|
121
|
+
function A(e, t, r, i) {
|
|
81
122
|
let { main: a } = e.selection, o = r - a.from, s = i - a.from;
|
|
82
123
|
return {
|
|
83
124
|
...e.changeByRange((c) => {
|
|
84
125
|
if (c != a && r != i && e.sliceDoc(c.from + o, c.from + s) != e.sliceDoc(r, i)) return { range: c };
|
|
85
|
-
let l = e.toText(
|
|
126
|
+
let l = e.toText(t);
|
|
86
127
|
return {
|
|
87
128
|
changes: {
|
|
88
129
|
from: c.from + o,
|
|
89
130
|
to: i == a.from ? c.to : c.from + s,
|
|
90
131
|
insert: l
|
|
91
132
|
},
|
|
92
|
-
range:
|
|
133
|
+
range: n.cursor(c.from + o + l.length)
|
|
93
134
|
};
|
|
94
135
|
}),
|
|
95
136
|
scrollIntoView: !0,
|
|
96
137
|
userEvent: "input.complete"
|
|
97
138
|
};
|
|
98
139
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
140
|
+
var le = /*@__PURE__*/ new WeakMap();
|
|
141
|
+
function ue(e) {
|
|
101
142
|
if (!Array.isArray(e)) return e;
|
|
102
|
-
let t =
|
|
103
|
-
return t ||
|
|
143
|
+
let t = le.get(e);
|
|
144
|
+
return t || le.set(e, t = D(e)), t;
|
|
104
145
|
}
|
|
105
|
-
var j = /*@__PURE__*/
|
|
106
|
-
constructor(
|
|
107
|
-
this.pattern =
|
|
108
|
-
for (let n = 0; n <
|
|
109
|
-
let r = e
|
|
146
|
+
var j = /*@__PURE__*/ u.define(), M = /*@__PURE__*/ u.define(), de = class {
|
|
147
|
+
constructor(e) {
|
|
148
|
+
this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
|
|
149
|
+
for (let n = 0; n < e.length;) {
|
|
150
|
+
let r = t(e, n), i = m(r);
|
|
110
151
|
this.chars.push(r);
|
|
111
|
-
let a =
|
|
112
|
-
this.folded.push(
|
|
152
|
+
let a = e.slice(n, n + i), o = a.toUpperCase();
|
|
153
|
+
this.folded.push(t(o == a ? a.toLowerCase() : o, 0)), n += i;
|
|
113
154
|
}
|
|
114
|
-
this.astral =
|
|
155
|
+
this.astral = e.length != this.chars.length;
|
|
115
156
|
}
|
|
116
157
|
ret(e, t) {
|
|
117
158
|
return this.score = e, this.matched = t, this;
|
|
118
159
|
}
|
|
119
|
-
match(
|
|
160
|
+
match(e) {
|
|
120
161
|
if (this.pattern.length == 0) return this.ret(-100, []);
|
|
121
|
-
if (
|
|
162
|
+
if (e.length < this.pattern.length) return null;
|
|
122
163
|
let { chars: n, folded: r, any: i, precise: a, byWord: o } = this;
|
|
123
164
|
if (n.length == 1) {
|
|
124
|
-
let i = e
|
|
165
|
+
let i = t(e, 0), a = m(i), o = a == e.length ? 0 : -100;
|
|
125
166
|
if (i != n[0]) {
|
|
126
167
|
if (i == r[0]) o += -200;
|
|
127
168
|
else return null;
|
|
128
169
|
}
|
|
129
170
|
return this.ret(o, [0, a]);
|
|
130
171
|
}
|
|
131
|
-
let s =
|
|
132
|
-
if (s == 0) return this.ret(
|
|
172
|
+
let s = e.indexOf(this.pattern);
|
|
173
|
+
if (s == 0) return this.ret(e.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
|
|
133
174
|
let c = n.length, l = 0;
|
|
134
175
|
if (s < 0) {
|
|
135
|
-
for (let a = 0, o = Math.min(
|
|
136
|
-
let o = e
|
|
137
|
-
(o == n[l] || o == r[l]) && (i[l++] = a), a +=
|
|
176
|
+
for (let a = 0, o = Math.min(e.length, 200); a < o && l < c;) {
|
|
177
|
+
let o = t(e, a);
|
|
178
|
+
(o == n[l] || o == r[l]) && (i[l++] = a), a += m(o);
|
|
138
179
|
}
|
|
139
180
|
if (l < c) return null;
|
|
140
181
|
}
|
|
141
|
-
let u = 0, d = 0, f = !1,
|
|
142
|
-
for (let i = 0, l = Math.min(
|
|
143
|
-
let l = e
|
|
144
|
-
s < 0 && (u < c && l == n[u] && (a[u++] = i),
|
|
145
|
-
let x, S = l < 255 ? l >= 48 && l <= 57 || l >= 97 && l <= 122 ? 2 : +(l >= 65 && l <= 90) : (x =
|
|
146
|
-
(!i || S == 1 && v || b == 0 && S != 0) && (n[d] == l || r[d] == l && (f = !0) ? o[d++] = i : o.length && (y = !1)), b = S, i +=
|
|
182
|
+
let u = 0, d = 0, f = !1, p = 0, g = -1, _ = -1, v = /[a-z]/.test(e), y = !0;
|
|
183
|
+
for (let i = 0, l = Math.min(e.length, 200), b = 0; i < l && d < c;) {
|
|
184
|
+
let l = t(e, i);
|
|
185
|
+
s < 0 && (u < c && l == n[u] && (a[u++] = i), p < c && (l == n[p] || l == r[p] ? (p == 0 && (g = i), _ = i + 1, p++) : p = 0));
|
|
186
|
+
let x, S = l < 255 ? l >= 48 && l <= 57 || l >= 97 && l <= 122 ? 2 : +(l >= 65 && l <= 90) : (x = h(l)) == x.toLowerCase() ? x == x.toUpperCase() ? 0 : 2 : 1;
|
|
187
|
+
(!i || S == 1 && v || b == 0 && S != 0) && (n[d] == l || r[d] == l && (f = !0) ? o[d++] = i : o.length && (y = !1)), b = S, i += m(l);
|
|
147
188
|
}
|
|
148
|
-
return d == c && o[0] == 0 && y ? this.result(-100 + (f ? -200 : 0), o,
|
|
189
|
+
return d == c && o[0] == 0 && y ? this.result(-100 + (f ? -200 : 0), o, e) : p == c && g == 0 ? this.ret(-200 - e.length + (_ == e.length ? 0 : -100), [0, _]) : s > -1 ? this.ret(-700 - e.length, [s, s + this.pattern.length]) : p == c ? this.ret(-900 - e.length, [g, _]) : d == c ? this.result(-100 + (f ? -200 : 0) + -700 + (y ? 0 : -1100), o, e) : n.length == 2 ? null : this.result((i[0] ? -700 : 0) + -200 + -1100, i, e);
|
|
149
190
|
}
|
|
150
|
-
result(
|
|
191
|
+
result(e, n, r) {
|
|
151
192
|
let i = [], a = 0;
|
|
152
|
-
for (let
|
|
153
|
-
let n =
|
|
154
|
-
a && i[a - 1] ==
|
|
193
|
+
for (let e of n) {
|
|
194
|
+
let n = e + (this.astral ? m(t(r, e)) : 1);
|
|
195
|
+
a && i[a - 1] == e ? i[a - 1] = n : (i[a++] = e, i[a++] = n);
|
|
155
196
|
}
|
|
156
|
-
return this.ret(
|
|
197
|
+
return this.ret(e - r.length, i);
|
|
157
198
|
}
|
|
158
|
-
},
|
|
199
|
+
}, fe = class {
|
|
159
200
|
constructor(e) {
|
|
160
201
|
this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase();
|
|
161
202
|
}
|
|
@@ -164,8 +205,8 @@ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
|
|
|
164
205
|
let t = e.slice(0, this.pattern.length), n = t == this.pattern ? 0 : t.toLowerCase() == this.folded ? -200 : null;
|
|
165
206
|
return n == null ? null : (this.matched = [0, t.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this);
|
|
166
207
|
}
|
|
167
|
-
}, N = /*@__PURE__*/
|
|
168
|
-
return
|
|
208
|
+
}, N = /*@__PURE__*/ d.define({ combine(e) {
|
|
209
|
+
return g(e, {
|
|
169
210
|
activateOnTyping: !0,
|
|
170
211
|
activateOnCompletion: () => !1,
|
|
171
212
|
activateOnTypingDelay: 100,
|
|
@@ -179,7 +220,7 @@ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
|
|
|
179
220
|
aboveCursor: !1,
|
|
180
221
|
icons: !0,
|
|
181
222
|
addToOptions: [],
|
|
182
|
-
positionInfo:
|
|
223
|
+
positionInfo: me,
|
|
183
224
|
filterStrict: !1,
|
|
184
225
|
compareCompletions: (e, t) => (e.sortText || e.label).localeCompare(t.sortText || t.label),
|
|
185
226
|
interactionDelay: 75,
|
|
@@ -188,17 +229,17 @@ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
|
|
|
188
229
|
defaultKeymap: (e, t) => e && t,
|
|
189
230
|
closeOnBlur: (e, t) => e && t,
|
|
190
231
|
icons: (e, t) => e && t,
|
|
191
|
-
tooltipClass: (e, t) => (n) =>
|
|
192
|
-
optionClass: (e, t) => (n) =>
|
|
232
|
+
tooltipClass: (e, t) => (n) => pe(e(n), t(n)),
|
|
233
|
+
optionClass: (e, t) => (n) => pe(e(n), t(n)),
|
|
193
234
|
addToOptions: (e, t) => e.concat(t),
|
|
194
235
|
filterStrict: (e, t) => e || t
|
|
195
236
|
});
|
|
196
237
|
} });
|
|
197
|
-
function
|
|
238
|
+
function pe(e, t) {
|
|
198
239
|
return e ? t ? e + " " + t : e : t;
|
|
199
240
|
}
|
|
200
|
-
function
|
|
201
|
-
let o = e.textDirection ==
|
|
241
|
+
function me(e, t, n, r, i, a) {
|
|
242
|
+
let o = e.textDirection == S.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, h = r.bottom - r.top;
|
|
202
243
|
if (s && f < Math.min(m, p) ? s = !1 : !s && p < Math.min(m, f) && (s = !0), m <= (s ? f : p)) u = Math.max(i.top, Math.min(n.top, i.bottom - h)) - t.top, d = Math.min(400, s ? f : p);
|
|
203
244
|
else {
|
|
204
245
|
c = !0, d = Math.min(400, (o ? t.right : i.right - t.left) - 30);
|
|
@@ -211,8 +252,8 @@ function de(e, t, n, r, i, a) {
|
|
|
211
252
|
class: "cm-completionInfo-" + (c ? o ? "left-narrow" : "right-narrow" : s ? "left" : "right")
|
|
212
253
|
};
|
|
213
254
|
}
|
|
214
|
-
var P = /*@__PURE__*/
|
|
215
|
-
function
|
|
255
|
+
var P = /*@__PURE__*/ u.define();
|
|
256
|
+
function he(e) {
|
|
216
257
|
let t = e.addToOptions.slice();
|
|
217
258
|
return e.icons && t.push({
|
|
218
259
|
render(e) {
|
|
@@ -261,7 +302,7 @@ function F(e, t, n) {
|
|
|
261
302
|
to: e - (r - 1) * n
|
|
262
303
|
};
|
|
263
304
|
}
|
|
264
|
-
var
|
|
305
|
+
var ge = class {
|
|
265
306
|
constructor(e, t, n) {
|
|
266
307
|
this.view = e, this.stateField = t, this.applyCompletion = n, this.info = null, this.infoDestroy = null, this.placeInfoReq = {
|
|
267
308
|
read: () => this.measureInfo(),
|
|
@@ -269,7 +310,7 @@ var pe = class {
|
|
|
269
310
|
key: this
|
|
270
311
|
}, this.space = null, this.currentClass = "";
|
|
271
312
|
let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(N);
|
|
272
|
-
this.optionContent =
|
|
313
|
+
this.optionContent = he(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = F(i.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (n) => {
|
|
273
314
|
let { options: r } = e.state.field(t).open;
|
|
274
315
|
for (let t = n.target, i; t && t != this.dom; t = t.parentNode) if (t.nodeName == "LI" && (i = /-(\d+)$/.exec(t.id)) && +i[1] < r.length) {
|
|
275
316
|
this.applyCompletion(e, r[+i[1]]), n.preventDefault();
|
|
@@ -322,7 +363,7 @@ var pe = class {
|
|
|
322
363
|
if (!a) return;
|
|
323
364
|
"then" in a ? a.then((t) => {
|
|
324
365
|
t && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(t, r);
|
|
325
|
-
}).catch((e) =>
|
|
366
|
+
}).catch((e) => v(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
|
|
326
367
|
}
|
|
327
368
|
}
|
|
328
369
|
addInfoPane(e, t) {
|
|
@@ -338,7 +379,7 @@ var pe = class {
|
|
|
338
379
|
updateSelectedOption(e) {
|
|
339
380
|
let t = null;
|
|
340
381
|
for (let n = this.list.firstChild, r = this.range.from; n; n = n.nextSibling, r++) n.nodeName != "LI" || !n.id ? r-- : r == e ? n.hasAttribute("aria-selected") || (n.setAttribute("aria-selected", "true"), t = n) : n.hasAttribute("aria-selected") && (n.removeAttribute("aria-selected"), n.removeAttribute("aria-describedby"));
|
|
341
|
-
return t &&
|
|
382
|
+
return t && ve(this.list, t), t;
|
|
342
383
|
}
|
|
343
384
|
measureInfo() {
|
|
344
385
|
let e = this.dom.querySelector("[aria-selected]");
|
|
@@ -394,17 +435,17 @@ var pe = class {
|
|
|
394
435
|
this.destroyInfo();
|
|
395
436
|
}
|
|
396
437
|
};
|
|
397
|
-
function
|
|
398
|
-
return (n) => new
|
|
438
|
+
function _e(e, t) {
|
|
439
|
+
return (n) => new ge(n, e, t);
|
|
399
440
|
}
|
|
400
|
-
function
|
|
441
|
+
function ve(e, t) {
|
|
401
442
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.height / e.offsetHeight;
|
|
402
443
|
r.top < n.top ? e.scrollTop -= (n.top - r.top) / i : r.bottom > n.bottom && (e.scrollTop += (r.bottom - n.bottom) / i);
|
|
403
444
|
}
|
|
404
|
-
function
|
|
445
|
+
function ye(e) {
|
|
405
446
|
return (e.boost || 0) * 100 + (e.apply ? 10 : 0) + (e.info ? 5 : 0) + +!!e.type;
|
|
406
447
|
}
|
|
407
|
-
function
|
|
448
|
+
function be(e, t) {
|
|
408
449
|
let n = [], r = null, i = null, a = (e) => {
|
|
409
450
|
n.push(e);
|
|
410
451
|
let { section: t } = e.completion;
|
|
@@ -416,12 +457,12 @@ function ge(e, t) {
|
|
|
416
457
|
}, o = t.facet(N);
|
|
417
458
|
for (let r of e) if (r.hasResult()) {
|
|
418
459
|
let e = r.result.getMatch;
|
|
419
|
-
if (r.result.filter === !1) for (let t of r.result.options) a(new
|
|
460
|
+
if (r.result.filter === !1) for (let t of r.result.options) a(new se(t, r.source, e ? e(t) : [], 1e9 - n.length));
|
|
420
461
|
else {
|
|
421
|
-
let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new
|
|
462
|
+
let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new fe(n) : new de(n);
|
|
422
463
|
for (let t of r.result.options) if (s = c.match(t.label)) {
|
|
423
464
|
let n = t.displayLabel ? e ? e(t, s.matched) : [] : s.matched, o = s.score + (t.boost || 0);
|
|
424
|
-
if (a(new
|
|
465
|
+
if (a(new se(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
|
|
425
466
|
let { name: e } = t.section;
|
|
426
467
|
i ||= Object.create(null), i[e] = Math.max(o, i[e] || -1e9);
|
|
427
468
|
}
|
|
@@ -439,20 +480,20 @@ function ge(e, t) {
|
|
|
439
480
|
let s = [], c = null, l = o.compareCompletions;
|
|
440
481
|
for (let e of n.sort((e, t) => t.score - e.score || l(e.completion, t.completion))) {
|
|
441
482
|
let t = e.completion;
|
|
442
|
-
!c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) :
|
|
483
|
+
!c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) : ye(e.completion) > ye(c) && (s[s.length - 1] = e), c = e.completion;
|
|
443
484
|
}
|
|
444
485
|
return s;
|
|
445
486
|
}
|
|
446
|
-
var
|
|
487
|
+
var xe = class e {
|
|
447
488
|
constructor(e, t, n, r, i, a) {
|
|
448
489
|
this.options = e, this.attrs = t, this.tooltip = n, this.timestamp = r, this.selected = i, this.disabled = a;
|
|
449
490
|
}
|
|
450
491
|
setSelected(t, n) {
|
|
451
|
-
return t == this.selected || t >= this.options.length ? this : new e(this.options,
|
|
492
|
+
return t == this.selected || t >= this.options.length ? this : new e(this.options, Ee(n, t), this.tooltip, this.timestamp, t, this.disabled);
|
|
452
493
|
}
|
|
453
494
|
static build(t, n, r, i, a, o) {
|
|
454
495
|
if (i && !o && t.some((e) => e.isPending)) return i.setDisabled();
|
|
455
|
-
let s =
|
|
496
|
+
let s = be(t, n);
|
|
456
497
|
if (!s.length) return i && t.some((e) => e.isPending) ? i.setDisabled() : null;
|
|
457
498
|
let c = n.facet(N).selectOnOpen ? 0 : -1;
|
|
458
499
|
if (i && i.selected != c && i.selected != -1) {
|
|
@@ -462,9 +503,9 @@ var _e = class e {
|
|
|
462
503
|
break;
|
|
463
504
|
}
|
|
464
505
|
}
|
|
465
|
-
return new e(s,
|
|
506
|
+
return new e(s, Ee(r, c), {
|
|
466
507
|
pos: t.reduce((e, t) => t.hasResult() ? Math.min(e, t.from) : e, 1e8),
|
|
467
|
-
create:
|
|
508
|
+
create: je,
|
|
468
509
|
above: a.aboveCursor
|
|
469
510
|
}, i ? i.timestamp : Date.now(), c, !1);
|
|
470
511
|
}
|
|
@@ -477,18 +518,18 @@ var _e = class e {
|
|
|
477
518
|
setDisabled() {
|
|
478
519
|
return new e(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0);
|
|
479
520
|
}
|
|
480
|
-
},
|
|
521
|
+
}, Se = class e {
|
|
481
522
|
constructor(e, t, n) {
|
|
482
523
|
this.active = e, this.id = t, this.open = n;
|
|
483
524
|
}
|
|
484
525
|
static start() {
|
|
485
|
-
return new e(
|
|
526
|
+
return new e(De, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
|
|
486
527
|
}
|
|
487
528
|
update(t) {
|
|
488
|
-
let { state: n } = t, r = n.facet(N), i = (r.override || n.languageDataAt("autocomplete", O(n)).map(
|
|
529
|
+
let { state: n } = t, r = n.facet(N), i = (r.override || n.languageDataAt("autocomplete", O(n)).map(ue)).map((e) => (this.active.find((t) => t.source == e) || new I(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
|
|
489
530
|
i.length == this.active.length && i.every((e, t) => e == this.active[t]) && (i = this.active);
|
|
490
|
-
let a = this.open, o = t.effects.some((e) => e.is(
|
|
491
|
-
a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !
|
|
531
|
+
let a = this.open, o = t.effects.some((e) => e.is(L));
|
|
532
|
+
a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !Ce(i, this.active) || o ? a = xe.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new I(e.source, 0) : e));
|
|
492
533
|
for (let e of t.effects) e.is(P) && (a &&= a.setSelected(e.value, this.id));
|
|
493
534
|
return i == this.active && a == this.open ? this : new e(i, this.id, a);
|
|
494
535
|
}
|
|
@@ -496,10 +537,10 @@ var _e = class e {
|
|
|
496
537
|
return this.open ? this.open.tooltip : null;
|
|
497
538
|
}
|
|
498
539
|
get attrs() {
|
|
499
|
-
return this.open ? this.open.attrs : this.active.length ?
|
|
540
|
+
return this.open ? this.open.attrs : this.active.length ? we : Te;
|
|
500
541
|
}
|
|
501
542
|
};
|
|
502
|
-
function
|
|
543
|
+
function Ce(e, t) {
|
|
503
544
|
if (e == t) return !0;
|
|
504
545
|
for (let n = 0, r = 0;;) {
|
|
505
546
|
for (; n < e.length && !e[n].hasResult();) n++;
|
|
@@ -509,8 +550,8 @@ function ye(e, t) {
|
|
|
509
550
|
if (e[n++].result != t[r++].result) return !1;
|
|
510
551
|
}
|
|
511
552
|
}
|
|
512
|
-
var
|
|
513
|
-
function
|
|
553
|
+
var we = { "aria-autocomplete": "list" }, Te = {};
|
|
554
|
+
function Ee(e, t) {
|
|
514
555
|
let n = {
|
|
515
556
|
"aria-autocomplete": "list",
|
|
516
557
|
"aria-haspopup": "listbox",
|
|
@@ -518,16 +559,16 @@ function L(e, t) {
|
|
|
518
559
|
};
|
|
519
560
|
return t > -1 && (n["aria-activedescendant"] = e + "-" + t), n;
|
|
520
561
|
}
|
|
521
|
-
var
|
|
522
|
-
function
|
|
562
|
+
var De = [];
|
|
563
|
+
function Oe(e, t) {
|
|
523
564
|
if (e.isUserEvent("input.complete")) {
|
|
524
|
-
let n = e.annotation(
|
|
565
|
+
let n = e.annotation(k);
|
|
525
566
|
if (n && t.activateOnCompletion(n)) return 12;
|
|
526
567
|
}
|
|
527
568
|
let n = e.isUserEvent("input.type");
|
|
528
569
|
return n && t.activateOnTyping ? 5 : n ? 1 : e.isUserEvent("delete.backward") ? 2 : e.selection ? 8 : e.docChanged ? 16 : 0;
|
|
529
570
|
}
|
|
530
|
-
var
|
|
571
|
+
var I = class e {
|
|
531
572
|
constructor(e, t, n = !1) {
|
|
532
573
|
this.source = e, this.state = t, this.explicit = n;
|
|
533
574
|
}
|
|
@@ -538,11 +579,11 @@ var z = class e {
|
|
|
538
579
|
return this.state == 1;
|
|
539
580
|
}
|
|
540
581
|
update(t, n) {
|
|
541
|
-
let r =
|
|
582
|
+
let r = Oe(t, n), i = this;
|
|
542
583
|
(r & 8 || r & 16 && this.touches(t)) && (i = new e(i.source, 0)), r & 4 && i.state == 0 && (i = new e(this.source, 1)), i = i.updateFor(t, r);
|
|
543
584
|
for (let n of t.effects) if (n.is(j)) i = new e(i.source, 1, n.value);
|
|
544
585
|
else if (n.is(M)) i = new e(i.source, 0);
|
|
545
|
-
else if (n.is(
|
|
586
|
+
else if (n.is(L)) for (let e of n.value) e.source == i.source && (i = e);
|
|
546
587
|
return i;
|
|
547
588
|
}
|
|
548
589
|
updateFor(e, t) {
|
|
@@ -554,7 +595,7 @@ var z = class e {
|
|
|
554
595
|
touches(e) {
|
|
555
596
|
return e.changes.touchesRange(O(e.state));
|
|
556
597
|
}
|
|
557
|
-
},
|
|
598
|
+
}, ke = class e extends I {
|
|
558
599
|
constructor(e, t, n, r, i, a) {
|
|
559
600
|
super(e, 3, t), this.limit = n, this.result = r, this.from = i, this.to = a;
|
|
560
601
|
}
|
|
@@ -566,82 +607,82 @@ var z = class e {
|
|
|
566
607
|
let r = this.result;
|
|
567
608
|
r.map && !t.changes.empty && (r = r.map(r, t.changes));
|
|
568
609
|
let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = O(t.state);
|
|
569
|
-
if (o > a || !r || n & 2 && (O(t.startState) == this.from || o < this.limit)) return new
|
|
610
|
+
if (o > a || !r || n & 2 && (O(t.startState) == this.from || o < this.limit)) return new I(this.source, n & 4 ? 1 : 0);
|
|
570
611
|
let s = t.changes.mapPos(this.limit);
|
|
571
|
-
return
|
|
612
|
+
return Ae(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new E(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? O(t.state)) : new I(this.source, 1, this.explicit);
|
|
572
613
|
}
|
|
573
614
|
map(t) {
|
|
574
615
|
if (t.empty) return this;
|
|
575
616
|
let n = this.result.map ? this.result.map(this.result, t) : this.result;
|
|
576
|
-
return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new
|
|
617
|
+
return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new I(this.source, 0);
|
|
577
618
|
}
|
|
578
619
|
touches(e) {
|
|
579
620
|
return e.changes.touchesRange(this.from, this.to);
|
|
580
621
|
}
|
|
581
622
|
};
|
|
582
|
-
function
|
|
623
|
+
function Ae(e, t, n, r) {
|
|
583
624
|
if (!e) return !1;
|
|
584
625
|
let i = t.sliceDoc(n, r);
|
|
585
|
-
return typeof e == "function" ? e(i, n, r, t) :
|
|
626
|
+
return typeof e == "function" ? e(i, n, r, t) : ce(e, !0).test(i);
|
|
586
627
|
}
|
|
587
|
-
var
|
|
628
|
+
var L = /*@__PURE__*/ u.define({ map(e, t) {
|
|
588
629
|
return e.map((e) => e.map(t));
|
|
589
|
-
} }),
|
|
630
|
+
} }), R = /*@__PURE__*/ l.define({
|
|
590
631
|
create() {
|
|
591
|
-
return
|
|
632
|
+
return Se.start();
|
|
592
633
|
},
|
|
593
634
|
update(e, t) {
|
|
594
635
|
return e.update(t);
|
|
595
636
|
},
|
|
596
|
-
provide: (e) => [
|
|
637
|
+
provide: (e) => [_.from(e, (e) => e.tooltip), C.contentAttributes.from(e, (e) => e.attrs)]
|
|
597
638
|
});
|
|
598
|
-
function
|
|
599
|
-
let n = t.completion.apply || t.completion.label, r = e.state.field(
|
|
600
|
-
return r instanceof
|
|
601
|
-
...
|
|
602
|
-
annotations:
|
|
639
|
+
function z(e, t) {
|
|
640
|
+
let n = t.completion.apply || t.completion.label, r = e.state.field(R).active.find((e) => e.source == t.source);
|
|
641
|
+
return r instanceof ke && (typeof n == "string" ? e.dispatch({
|
|
642
|
+
...A(e.state, n, r.from, r.to),
|
|
643
|
+
annotations: k.of(t.completion)
|
|
603
644
|
}) : n(e, t.completion, r.from, r.to), !0);
|
|
604
645
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
646
|
+
var je = /*@__PURE__*/ _e(R, z);
|
|
647
|
+
function B(e, t = "option") {
|
|
607
648
|
return (n) => {
|
|
608
|
-
let r = n.state.field(
|
|
649
|
+
let r = n.state.field(R, !1);
|
|
609
650
|
if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(N).interactionDelay) return !1;
|
|
610
651
|
let i = 1, a;
|
|
611
|
-
t == "page" && (a =
|
|
652
|
+
t == "page" && (a = x(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
|
|
612
653
|
let { length: o } = r.open.options, s = r.open.selected > -1 ? r.open.selected + i * (e ? 1 : -1) : e ? 0 : o - 1;
|
|
613
654
|
return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: P.of(s) }), !0;
|
|
614
655
|
};
|
|
615
656
|
}
|
|
616
|
-
var
|
|
617
|
-
let t = e.state.field(
|
|
618
|
-
return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(N).interactionDelay ? !1 :
|
|
619
|
-
},
|
|
620
|
-
let t = e.state.field(
|
|
657
|
+
var Me = (e) => {
|
|
658
|
+
let t = e.state.field(R, !1);
|
|
659
|
+
return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(N).interactionDelay ? !1 : z(e, t.open.options[t.open.selected]);
|
|
660
|
+
}, V = (e) => e.state.field(R, !1) ? (e.dispatch({ effects: j.of(!0) }), !0) : !1, Ne = (e) => {
|
|
661
|
+
let t = e.state.field(R, !1);
|
|
621
662
|
return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: M.of(null) }), !0);
|
|
622
|
-
},
|
|
663
|
+
}, Pe = class {
|
|
623
664
|
constructor(e, t) {
|
|
624
665
|
this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
|
|
625
666
|
}
|
|
626
|
-
},
|
|
667
|
+
}, Fe = 50, Ie = 1e3, Le = /*@__PURE__*/ y.fromClass(class {
|
|
627
668
|
constructor(e) {
|
|
628
669
|
this.view = e, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
|
|
629
|
-
for (let t of e.state.field(
|
|
670
|
+
for (let t of e.state.field(R).active) t.isPending && this.startQuery(t);
|
|
630
671
|
}
|
|
631
672
|
update(e) {
|
|
632
|
-
let t = e.state.field(
|
|
633
|
-
if (!e.selectionSet && !e.docChanged && e.startState.field(
|
|
673
|
+
let t = e.state.field(R), n = e.state.facet(N);
|
|
674
|
+
if (!e.selectionSet && !e.docChanged && e.startState.field(R) == t) return;
|
|
634
675
|
let r = e.transactions.some((e) => {
|
|
635
|
-
let t =
|
|
676
|
+
let t = Oe(e, n);
|
|
636
677
|
return t & 8 || (e.selection || e.docChanged) && !(t & 3);
|
|
637
678
|
});
|
|
638
679
|
for (let t = 0; t < this.running.length; t++) {
|
|
639
680
|
let n = this.running[t];
|
|
640
|
-
if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length >
|
|
681
|
+
if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Fe && Date.now() - n.time > Ie) {
|
|
641
682
|
for (let e of n.context.abortListeners) try {
|
|
642
683
|
e();
|
|
643
684
|
} catch (e) {
|
|
644
|
-
|
|
685
|
+
v(this.view.state, e);
|
|
645
686
|
}
|
|
646
687
|
n.context.abortListeners = null, this.running.splice(t--, 1);
|
|
647
688
|
} else n.updates.push(...e.transactions);
|
|
@@ -652,16 +693,16 @@ var Te = (e) => {
|
|
|
652
693
|
}
|
|
653
694
|
startUpdate() {
|
|
654
695
|
this.debounceUpdate = -1, this.pendingStart = !1;
|
|
655
|
-
let { state: e } = this.view, t = e.field(
|
|
696
|
+
let { state: e } = this.view, t = e.field(R);
|
|
656
697
|
for (let e of t.active) e.isPending && !this.running.some((t) => t.active.source == e.source) && this.startQuery(e);
|
|
657
698
|
this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(N).updateSyncTime));
|
|
658
699
|
}
|
|
659
700
|
startQuery(e) {
|
|
660
|
-
let { state: t } = this.view, n = new E(t, O(t), e.explicit, this.view), r = new
|
|
701
|
+
let { state: t } = this.view, n = new E(t, O(t), e.explicit, this.view), r = new Pe(e, n);
|
|
661
702
|
this.running.push(r), Promise.resolve(e.source(n)).then((e) => {
|
|
662
703
|
r.context.aborted || (r.done = e || null, this.scheduleAccept());
|
|
663
704
|
}, (e) => {
|
|
664
|
-
this.view.dispatch({ effects: M.of(null) }),
|
|
705
|
+
this.view.dispatch({ effects: M.of(null) }), v(this.view.state, e);
|
|
665
706
|
});
|
|
666
707
|
}
|
|
667
708
|
scheduleAccept() {
|
|
@@ -669,12 +710,12 @@ var Te = (e) => {
|
|
|
669
710
|
}
|
|
670
711
|
accept() {
|
|
671
712
|
this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
|
|
672
|
-
let e = [], t = this.view.state.facet(N), n = this.view.state.field(
|
|
713
|
+
let e = [], t = this.view.state.facet(N), n = this.view.state.field(R);
|
|
673
714
|
for (let r = 0; r < this.running.length; r++) {
|
|
674
715
|
let i = this.running[r];
|
|
675
716
|
if (i.done === void 0) continue;
|
|
676
717
|
if (this.running.splice(r--, 1), i.done) {
|
|
677
|
-
let n = O(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new
|
|
718
|
+
let n = O(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new ke(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
|
|
678
719
|
for (let e of i.updates) a = a.update(e, t);
|
|
679
720
|
if (a.hasResult()) {
|
|
680
721
|
e.push(a);
|
|
@@ -684,19 +725,19 @@ var Te = (e) => {
|
|
|
684
725
|
let a = n.active.find((e) => e.source == i.active.source);
|
|
685
726
|
if (a && a.isPending) {
|
|
686
727
|
if (i.done == null) {
|
|
687
|
-
let n = new
|
|
728
|
+
let n = new I(i.active.source, 0);
|
|
688
729
|
for (let e of i.updates) n = n.update(e, t);
|
|
689
730
|
n.isPending || e.push(n);
|
|
690
731
|
} else this.startQuery(a);
|
|
691
732
|
}
|
|
692
733
|
}
|
|
693
|
-
(e.length || n.open && n.open.disabled) && this.view.dispatch({ effects:
|
|
734
|
+
(e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: L.of(e) });
|
|
694
735
|
}
|
|
695
736
|
}, { eventHandlers: {
|
|
696
737
|
blur(e) {
|
|
697
|
-
let t = this.view.state.field(
|
|
738
|
+
let t = this.view.state.field(R, !1);
|
|
698
739
|
if (t && t.tooltip && this.view.state.facet(N).closeOnBlur) {
|
|
699
|
-
let n = t.open &&
|
|
740
|
+
let n = t.open && x(this.view, t.open.tooltip);
|
|
700
741
|
(!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: M.of(null) }), 10);
|
|
701
742
|
}
|
|
702
743
|
},
|
|
@@ -706,12 +747,12 @@ var Te = (e) => {
|
|
|
706
747
|
compositionend() {
|
|
707
748
|
this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: j.of(!1) }), 20), this.composing = 0;
|
|
708
749
|
}
|
|
709
|
-
} }),
|
|
710
|
-
let n = t.state.field(
|
|
711
|
-
if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(
|
|
750
|
+
} }), Re = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), ze = /*@__PURE__*/ c.highest(/*@__PURE__*/ C.domEventHandlers({ keydown(e, t) {
|
|
751
|
+
let n = t.state.field(R, !1);
|
|
752
|
+
if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Re && e.altKey) || e.metaKey) return !1;
|
|
712
753
|
let r = n.open.options[n.open.selected], i = n.active.find((e) => e.source == r.source), a = r.completion.commitCharacters || i.result.commitCharacters;
|
|
713
|
-
return a && a.indexOf(e.key) > -1 &&
|
|
714
|
-
} })),
|
|
754
|
+
return a && a.indexOf(e.key) > -1 && z(t, r), !1;
|
|
755
|
+
} })), Be = /*@__PURE__*/ C.baseTheme({
|
|
715
756
|
".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
|
|
716
757
|
fontFamily: "monospace",
|
|
717
758
|
whiteSpace: "nowrap",
|
|
@@ -808,19 +849,19 @@ var Te = (e) => {
|
|
|
808
849
|
fontSize: "50%",
|
|
809
850
|
verticalAlign: "middle"
|
|
810
851
|
} }
|
|
811
|
-
}),
|
|
852
|
+
}), Ve = class {
|
|
812
853
|
constructor(e, t, n, r) {
|
|
813
854
|
this.field = e, this.line = t, this.from = n, this.to = r;
|
|
814
855
|
}
|
|
815
|
-
},
|
|
856
|
+
}, He = class e {
|
|
816
857
|
constructor(e, t, n) {
|
|
817
858
|
this.field = e, this.from = t, this.to = n;
|
|
818
859
|
}
|
|
819
860
|
map(t) {
|
|
820
|
-
let
|
|
821
|
-
return
|
|
861
|
+
let n = t.mapPos(this.from, -1, r.TrackDel), i = t.mapPos(this.to, 1, r.TrackDel);
|
|
862
|
+
return n == null || i == null ? null : new e(this.field, n, i);
|
|
822
863
|
}
|
|
823
|
-
},
|
|
864
|
+
}, Ue = class e {
|
|
824
865
|
constructor(e, t) {
|
|
825
866
|
this.lines = e, this.fieldPositions = t;
|
|
826
867
|
}
|
|
@@ -829,14 +870,14 @@ var Te = (e) => {
|
|
|
829
870
|
for (let i of this.lines) {
|
|
830
871
|
if (n.length) {
|
|
831
872
|
let n = a, o = /^\t*/.exec(i)[0].length;
|
|
832
|
-
for (let t = 0; t < o; t++) n += e.facet(
|
|
873
|
+
for (let t = 0; t < o; t++) n += e.facet(te);
|
|
833
874
|
r.push(t + n.length - o), i = n + i.slice(o);
|
|
834
875
|
}
|
|
835
876
|
n.push(i), t += i.length + 1;
|
|
836
877
|
}
|
|
837
878
|
return {
|
|
838
879
|
text: n,
|
|
839
|
-
ranges: this.fieldPositions.map((e) => new
|
|
880
|
+
ranges: this.fieldPositions.map((e) => new He(e.field, r[e.line] + e.from, r[e.line] + e.to))
|
|
840
881
|
};
|
|
841
882
|
}
|
|
842
883
|
static parse(t) {
|
|
@@ -860,7 +901,7 @@ var Te = (e) => {
|
|
|
860
901
|
let t = a[2] ? 3 + (a[1] || "").length : 2;
|
|
861
902
|
e.from -= t, e.to -= t;
|
|
862
903
|
}
|
|
863
|
-
i.push(new
|
|
904
|
+
i.push(new Ve(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
|
|
864
905
|
}
|
|
865
906
|
e = e.replace(/\\([{}])/g, (e, t, n) => {
|
|
866
907
|
for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
|
|
@@ -869,7 +910,7 @@ var Te = (e) => {
|
|
|
869
910
|
}
|
|
870
911
|
return new e(r, i);
|
|
871
912
|
}
|
|
872
|
-
},
|
|
913
|
+
}, We = /*@__PURE__*/ w.widget({ widget: /*@__PURE__*/ new class extends ee {
|
|
873
914
|
toDOM() {
|
|
874
915
|
let e = document.createElement("span");
|
|
875
916
|
return e.className = "cm-snippetFieldPosition", e;
|
|
@@ -877,9 +918,9 @@ var Te = (e) => {
|
|
|
877
918
|
ignoreEvent() {
|
|
878
919
|
return !1;
|
|
879
920
|
}
|
|
880
|
-
}() }),
|
|
921
|
+
}() }), Ge = /*@__PURE__*/ w.mark({ class: "cm-snippetField" }), H = class e {
|
|
881
922
|
constructor(e, t) {
|
|
882
|
-
this.ranges = e, this.active = t, this.deco = w.set(e.map((e) => (e.from == e.to ?
|
|
923
|
+
this.ranges = e, this.active = t, this.deco = w.set(e.map((e) => (e.from == e.to ? We : Ge).range(e.from, e.to)), !0);
|
|
883
924
|
}
|
|
884
925
|
map(t) {
|
|
885
926
|
let n = [];
|
|
@@ -893,89 +934,147 @@ var Te = (e) => {
|
|
|
893
934
|
selectionInsideField(e) {
|
|
894
935
|
return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
|
|
895
936
|
}
|
|
896
|
-
},
|
|
937
|
+
}, U = /*@__PURE__*/ u.define({ map(e, t) {
|
|
897
938
|
return e && e.map(t);
|
|
898
|
-
} }),
|
|
939
|
+
} }), Ke = /*@__PURE__*/ u.define(), W = /*@__PURE__*/ l.define({
|
|
899
940
|
create() {
|
|
900
941
|
return null;
|
|
901
942
|
},
|
|
902
943
|
update(e, t) {
|
|
903
944
|
for (let n of t.effects) {
|
|
904
|
-
if (n.is(
|
|
905
|
-
if (n.is(
|
|
945
|
+
if (n.is(U)) return n.value;
|
|
946
|
+
if (n.is(Ke) && e) return new H(e.ranges, n.value);
|
|
906
947
|
}
|
|
907
948
|
return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
|
|
908
949
|
},
|
|
909
950
|
provide: (e) => C.decorations.from(e, (e) => e ? e.deco : w.none)
|
|
910
951
|
});
|
|
911
|
-
function
|
|
912
|
-
return
|
|
952
|
+
function G(e, t) {
|
|
953
|
+
return n.create(e.filter((e) => e.field == t).map((e) => n.range(e.from, e.to)));
|
|
913
954
|
}
|
|
914
|
-
function
|
|
915
|
-
let t =
|
|
916
|
-
return (e, n, r,
|
|
917
|
-
let { text: s, ranges: c } = t.instantiate(e.state, r), { main:
|
|
955
|
+
function K(e) {
|
|
956
|
+
let t = Ue.parse(e);
|
|
957
|
+
return (e, n, r, i) => {
|
|
958
|
+
let { text: s, ranges: c } = t.instantiate(e.state, r), { main: l } = e.state.selection, d = {
|
|
918
959
|
changes: {
|
|
919
960
|
from: r,
|
|
920
|
-
to:
|
|
921
|
-
insert:
|
|
961
|
+
to: i == l.from ? l.to : i,
|
|
962
|
+
insert: o.of(s)
|
|
922
963
|
},
|
|
923
964
|
scrollIntoView: !0,
|
|
924
|
-
annotations: n ? [
|
|
965
|
+
annotations: n ? [k.of(n), a.userEvent.of("input.complete")] : void 0
|
|
925
966
|
};
|
|
926
|
-
if (c.length && (d.selection =
|
|
927
|
-
let t = new
|
|
928
|
-
e.state.field(
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
967
|
+
if (c.length && (d.selection = G(c, 0)), c.some((e) => e.field > 0)) {
|
|
968
|
+
let t = new H(c, 0), n = d.effects = [U.of(t)];
|
|
969
|
+
e.state.field(W, !1) === void 0 && n.push(u.appendConfig.of([
|
|
970
|
+
W,
|
|
971
|
+
et,
|
|
972
|
+
nt,
|
|
973
|
+
Be
|
|
933
974
|
]));
|
|
934
975
|
}
|
|
935
976
|
e.dispatch(e.state.update(d));
|
|
936
977
|
};
|
|
937
978
|
}
|
|
938
|
-
function
|
|
979
|
+
function qe(e) {
|
|
939
980
|
return ({ state: t, dispatch: n }) => {
|
|
940
|
-
let r = t.field(
|
|
981
|
+
let r = t.field(W, !1);
|
|
941
982
|
if (!r || e < 0 && r.active == 0) return !1;
|
|
942
983
|
let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
|
|
943
984
|
return n(t.update({
|
|
944
|
-
selection:
|
|
945
|
-
effects:
|
|
985
|
+
selection: G(r.ranges, i),
|
|
986
|
+
effects: U.of(a ? null : new H(r.ranges, i)),
|
|
946
987
|
scrollIntoView: !0
|
|
947
988
|
})), !0;
|
|
948
989
|
};
|
|
949
990
|
}
|
|
950
|
-
var
|
|
991
|
+
var Je = ({ state: e, dispatch: t }) => e.field(W, !1) ? (t(e.update({ effects: U.of(null) })), !0) : !1, Ye = /*@__PURE__*/ qe(1), Xe = /*@__PURE__*/ qe(-1);
|
|
992
|
+
function Ze(e) {
|
|
993
|
+
let t = e.field(W, !1);
|
|
994
|
+
return !!(t && t.ranges.some((e) => e.field == t.active + 1));
|
|
995
|
+
}
|
|
996
|
+
function Qe(e) {
|
|
997
|
+
let t = e.field(W, !1);
|
|
998
|
+
return !!(t && t.active > 0);
|
|
999
|
+
}
|
|
1000
|
+
var $e = [{
|
|
951
1001
|
key: "Tab",
|
|
952
|
-
run:
|
|
953
|
-
shift:
|
|
1002
|
+
run: Ye,
|
|
1003
|
+
shift: Xe
|
|
954
1004
|
}, {
|
|
955
1005
|
key: "Escape",
|
|
956
|
-
run:
|
|
957
|
-
}],
|
|
958
|
-
return e.length ? e[0] :
|
|
959
|
-
} }),
|
|
960
|
-
function
|
|
1006
|
+
run: Je
|
|
1007
|
+
}], q = /*@__PURE__*/ d.define({ combine(e) {
|
|
1008
|
+
return e.length ? e[0] : $e;
|
|
1009
|
+
} }), et = /*@__PURE__*/ c.highest(/*@__PURE__*/ b.compute([q], (e) => e.facet(q)));
|
|
1010
|
+
function tt(e, t) {
|
|
961
1011
|
return {
|
|
962
1012
|
...t,
|
|
963
|
-
apply:
|
|
1013
|
+
apply: K(e)
|
|
964
1014
|
};
|
|
965
1015
|
}
|
|
966
|
-
var
|
|
967
|
-
let n = t.state.field(
|
|
1016
|
+
var nt = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
|
|
1017
|
+
let n = t.state.field(W, !1), r;
|
|
968
1018
|
if (!n || (r = t.posAtCoords({
|
|
969
1019
|
x: e.clientX,
|
|
970
1020
|
y: e.clientY
|
|
971
1021
|
})) == null) return !1;
|
|
972
1022
|
let i = n.ranges.find((e) => e.from <= r && e.to >= r);
|
|
973
1023
|
return !i || i.field == n.active ? !1 : (t.dispatch({
|
|
974
|
-
selection:
|
|
975
|
-
effects:
|
|
1024
|
+
selection: G(n.ranges, i.field),
|
|
1025
|
+
effects: U.of(n.ranges.some((e) => e.field > i.field) ? new H(n.ranges, i.field) : null),
|
|
976
1026
|
scrollIntoView: !0
|
|
977
1027
|
}), !0);
|
|
978
|
-
} })
|
|
1028
|
+
} });
|
|
1029
|
+
function rt(e) {
|
|
1030
|
+
let t = e.replace(/[\]\-\\]/g, "\\$&");
|
|
1031
|
+
try {
|
|
1032
|
+
return RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`, "ug");
|
|
1033
|
+
} catch {
|
|
1034
|
+
return RegExp(`[\w${t}]`, "g");
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
function it(e, t) {
|
|
1038
|
+
return new RegExp(t(e.source), e.unicode ? "u" : "");
|
|
1039
|
+
}
|
|
1040
|
+
var at = /*@__PURE__*/ Object.create(null);
|
|
1041
|
+
function ot(e) {
|
|
1042
|
+
return at[e] || (at[e] = /* @__PURE__ */ new WeakMap());
|
|
1043
|
+
}
|
|
1044
|
+
function st(e, t, n, r, i) {
|
|
1045
|
+
for (let a = e.iterLines(), o = 0; !a.next().done;) {
|
|
1046
|
+
let { value: e } = a, s;
|
|
1047
|
+
for (t.lastIndex = 0; s = t.exec(e);) if (!r[s[0]] && o + s.index != i && (n.push({
|
|
1048
|
+
type: "text",
|
|
1049
|
+
label: s[0]
|
|
1050
|
+
}), r[s[0]] = !0, n.length >= 2e3)) return;
|
|
1051
|
+
o += e.length + 1;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
function ct(e, t, n, r, i) {
|
|
1055
|
+
let a = e.length >= 1e3, o = a && t.get(e);
|
|
1056
|
+
if (o) return o;
|
|
1057
|
+
let s = [], c = Object.create(null);
|
|
1058
|
+
if (e.children) {
|
|
1059
|
+
let a = 0;
|
|
1060
|
+
for (let o of e.children) {
|
|
1061
|
+
if (o.length >= 1e3) for (let e of ct(o, t, n, r - a, i - a)) c[e.label] || (c[e.label] = !0, s.push(e));
|
|
1062
|
+
else st(o, n, s, c, i - a);
|
|
1063
|
+
a += o.length + 1;
|
|
1064
|
+
}
|
|
1065
|
+
} else st(e, n, s, c, i);
|
|
1066
|
+
return a && s.length < 2e3 && t.set(e, s), s;
|
|
1067
|
+
}
|
|
1068
|
+
var lt = (e) => {
|
|
1069
|
+
let t = e.state.languageDataAt("wordChars", e.pos)[0] ?? "", n = rt(t), r = e.matchBefore(it(n, (e) => e + "$"));
|
|
1070
|
+
if (!r && !e.explicit) return null;
|
|
1071
|
+
let i = r ? r.from : e.pos;
|
|
1072
|
+
return {
|
|
1073
|
+
from: i,
|
|
1074
|
+
options: ct(e.state.doc, ot(t), n, 5e4, i),
|
|
1075
|
+
validFor: it(n, (e) => "^" + e)
|
|
1076
|
+
};
|
|
1077
|
+
}, J = {
|
|
979
1078
|
brackets: [
|
|
980
1079
|
"(",
|
|
981
1080
|
"[",
|
|
@@ -985,107 +1084,107 @@ var Ke = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
|
|
|
985
1084
|
],
|
|
986
1085
|
before: ")]}:;>",
|
|
987
1086
|
stringPrefixes: []
|
|
988
|
-
},
|
|
989
|
-
return t.mapPos(e, -1,
|
|
990
|
-
} }),
|
|
991
|
-
|
|
992
|
-
var
|
|
1087
|
+
}, Y = /*@__PURE__*/ u.define({ map(e, t) {
|
|
1088
|
+
return t.mapPos(e, -1, r.TrackAfter) ?? void 0;
|
|
1089
|
+
} }), X = /*@__PURE__*/ new class extends i {}();
|
|
1090
|
+
X.startSide = 1, X.endSide = -1;
|
|
1091
|
+
var ut = /*@__PURE__*/ l.define({
|
|
993
1092
|
create() {
|
|
994
|
-
return
|
|
1093
|
+
return p.empty;
|
|
995
1094
|
},
|
|
996
1095
|
update(e, t) {
|
|
997
1096
|
if (e = e.map(t.changes), t.selection) {
|
|
998
1097
|
let n = t.state.doc.lineAt(t.selection.main.head);
|
|
999
1098
|
e = e.update({ filter: (e) => e >= n.from && e <= n.to });
|
|
1000
1099
|
}
|
|
1001
|
-
for (let n of t.effects) n.is(
|
|
1100
|
+
for (let n of t.effects) n.is(Y) && (e = e.update({ add: [X.range(n.value, n.value + 1)] }));
|
|
1002
1101
|
return e;
|
|
1003
1102
|
}
|
|
1004
1103
|
});
|
|
1005
|
-
function
|
|
1006
|
-
return [
|
|
1104
|
+
function dt() {
|
|
1105
|
+
return [ht, ut];
|
|
1007
1106
|
}
|
|
1008
|
-
var
|
|
1009
|
-
function
|
|
1010
|
-
for (let t = 0; t < 16; t += 2) if (
|
|
1011
|
-
return
|
|
1107
|
+
var ft = "()[]{}<>«»»«[]{}";
|
|
1108
|
+
function pt(e) {
|
|
1109
|
+
for (let t = 0; t < 16; t += 2) if (ft.charCodeAt(t) == e) return ft.charAt(t + 1);
|
|
1110
|
+
return h(e < 128 ? e : e + 1);
|
|
1012
1111
|
}
|
|
1013
|
-
function
|
|
1014
|
-
return e.languageDataAt("closeBrackets", t)[0] ||
|
|
1112
|
+
function Z(e, t) {
|
|
1113
|
+
return e.languageDataAt("closeBrackets", t)[0] || J;
|
|
1015
1114
|
}
|
|
1016
|
-
var
|
|
1017
|
-
if ((
|
|
1018
|
-
let a =
|
|
1019
|
-
if (i.length > 2 || i.length == 2 &&
|
|
1020
|
-
let o =
|
|
1021
|
-
return o ? (
|
|
1022
|
-
}),
|
|
1115
|
+
var mt = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), ht = /*@__PURE__*/ C.inputHandler.of((e, n, r, i) => {
|
|
1116
|
+
if ((mt ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
|
|
1117
|
+
let a = e.state.selection.main;
|
|
1118
|
+
if (i.length > 2 || i.length == 2 && m(t(i, 0)) == 1 || n != a.from || r != a.to) return !1;
|
|
1119
|
+
let o = vt(e.state, i);
|
|
1120
|
+
return o ? (e.dispatch(o), !0) : !1;
|
|
1121
|
+
}), gt = ({ state: e, dispatch: r }) => {
|
|
1122
|
+
if (e.readOnly) return !1;
|
|
1123
|
+
let i = Z(e, e.selection.main.head).brackets || J.brackets, a = null, o = e.changeByRange((r) => {
|
|
1124
|
+
if (r.empty) {
|
|
1125
|
+
let a = bt(e.doc, r.head);
|
|
1126
|
+
for (let o of i) if (o == a && Q(e.doc, r.head) == pt(t(o, 0))) return {
|
|
1127
|
+
changes: {
|
|
1128
|
+
from: r.head - o.length,
|
|
1129
|
+
to: r.head + o.length
|
|
1130
|
+
},
|
|
1131
|
+
range: n.cursor(r.head - o.length)
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
return { range: a = r };
|
|
1135
|
+
});
|
|
1136
|
+
return a || r(e.update(o, {
|
|
1137
|
+
scrollIntoView: !0,
|
|
1138
|
+
userEvent: "delete.backward"
|
|
1139
|
+
})), !a;
|
|
1140
|
+
}, _t = [{
|
|
1023
1141
|
key: "Backspace",
|
|
1024
|
-
run:
|
|
1025
|
-
if (n.readOnly) return !1;
|
|
1026
|
-
let i = Ze(n, n.selection.main.head).brackets || X.brackets, a = null, o = n.changeByRange((r) => {
|
|
1027
|
-
if (r.empty) {
|
|
1028
|
-
let a = rt(n.doc, r.head);
|
|
1029
|
-
for (let o of i) if (o == a && $(n.doc, r.head) == Xe(e(o, 0))) return {
|
|
1030
|
-
changes: {
|
|
1031
|
-
from: r.head - o.length,
|
|
1032
|
-
to: r.head + o.length
|
|
1033
|
-
},
|
|
1034
|
-
range: t.cursor(r.head - o.length)
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
|
-
return { range: a = r };
|
|
1038
|
-
});
|
|
1039
|
-
return a || r(n.update(o, {
|
|
1040
|
-
scrollIntoView: !0,
|
|
1041
|
-
userEvent: "delete.backward"
|
|
1042
|
-
})), !a;
|
|
1043
|
-
}
|
|
1142
|
+
run: gt
|
|
1044
1143
|
}];
|
|
1045
|
-
function
|
|
1046
|
-
let r =
|
|
1144
|
+
function vt(e, n) {
|
|
1145
|
+
let r = Z(e, e.selection.main.head), i = r.brackets || J.brackets;
|
|
1047
1146
|
for (let a of i) {
|
|
1048
|
-
let o =
|
|
1049
|
-
if (n == a) return o == a ?
|
|
1050
|
-
if (n == o &&
|
|
1147
|
+
let o = pt(t(a, 0));
|
|
1148
|
+
if (n == a) return o == a ? Ct(e, a, i.indexOf(a + a + a) > -1, r) : xt(e, a, o, r.before || J.before);
|
|
1149
|
+
if (n == o && yt(e, e.selection.main.from)) return St(e, a, o);
|
|
1051
1150
|
}
|
|
1052
1151
|
return null;
|
|
1053
1152
|
}
|
|
1054
|
-
function
|
|
1153
|
+
function yt(e, t) {
|
|
1055
1154
|
let n = !1;
|
|
1056
|
-
return e.field(
|
|
1155
|
+
return e.field(ut).between(0, e.doc.length, (e) => {
|
|
1057
1156
|
e == t && (n = !0);
|
|
1058
1157
|
}), n;
|
|
1059
1158
|
}
|
|
1060
|
-
function
|
|
1061
|
-
let r =
|
|
1062
|
-
return r.slice(0,
|
|
1159
|
+
function Q(e, n) {
|
|
1160
|
+
let r = e.sliceString(n, n + 2);
|
|
1161
|
+
return r.slice(0, m(t(r, 0)));
|
|
1063
1162
|
}
|
|
1064
|
-
function
|
|
1065
|
-
let r =
|
|
1066
|
-
return
|
|
1163
|
+
function bt(e, n) {
|
|
1164
|
+
let r = e.sliceString(n - 2, n);
|
|
1165
|
+
return m(t(r, 0)) == r.length ? r : r.slice(1);
|
|
1067
1166
|
}
|
|
1068
|
-
function
|
|
1167
|
+
function xt(e, t, r, i) {
|
|
1069
1168
|
let a = null, o = e.changeByRange((o) => {
|
|
1070
1169
|
if (!o.empty) return {
|
|
1071
1170
|
changes: [{
|
|
1072
|
-
insert:
|
|
1171
|
+
insert: t,
|
|
1073
1172
|
from: o.from
|
|
1074
1173
|
}, {
|
|
1075
1174
|
insert: r,
|
|
1076
1175
|
from: o.to
|
|
1077
1176
|
}],
|
|
1078
|
-
effects:
|
|
1079
|
-
range:
|
|
1177
|
+
effects: Y.of(o.to + t.length),
|
|
1178
|
+
range: n.range(o.anchor + t.length, o.head + t.length)
|
|
1080
1179
|
};
|
|
1081
|
-
let s =
|
|
1180
|
+
let s = Q(e.doc, o.head);
|
|
1082
1181
|
return !s || /\s/.test(s) || i.indexOf(s) > -1 ? {
|
|
1083
1182
|
changes: {
|
|
1084
|
-
insert:
|
|
1183
|
+
insert: t + r,
|
|
1085
1184
|
from: o.head
|
|
1086
1185
|
},
|
|
1087
|
-
effects:
|
|
1088
|
-
range:
|
|
1186
|
+
effects: Y.of(o.head + t.length),
|
|
1187
|
+
range: n.cursor(o.head + t.length)
|
|
1089
1188
|
} : { range: a = o };
|
|
1090
1189
|
});
|
|
1091
1190
|
return a ? null : e.update(o, {
|
|
@@ -1093,82 +1192,82 @@ function it(e, n, r, i) {
|
|
|
1093
1192
|
userEvent: "input.type"
|
|
1094
1193
|
});
|
|
1095
1194
|
}
|
|
1096
|
-
function
|
|
1097
|
-
let i = null, a = e.changeByRange((
|
|
1195
|
+
function St(e, t, r) {
|
|
1196
|
+
let i = null, a = e.changeByRange((t) => t.empty && Q(e.doc, t.head) == r ? {
|
|
1098
1197
|
changes: {
|
|
1099
|
-
from:
|
|
1100
|
-
to:
|
|
1198
|
+
from: t.head,
|
|
1199
|
+
to: t.head + r.length,
|
|
1101
1200
|
insert: r
|
|
1102
1201
|
},
|
|
1103
|
-
range:
|
|
1104
|
-
} : i = { range:
|
|
1202
|
+
range: n.cursor(t.head + r.length)
|
|
1203
|
+
} : i = { range: t });
|
|
1105
1204
|
return i ? null : e.update(a, {
|
|
1106
1205
|
scrollIntoView: !0,
|
|
1107
1206
|
userEvent: "input.type"
|
|
1108
1207
|
});
|
|
1109
1208
|
}
|
|
1110
|
-
function
|
|
1111
|
-
let a = i.stringPrefixes ||
|
|
1209
|
+
function Ct(e, t, r, i) {
|
|
1210
|
+
let a = i.stringPrefixes || J.stringPrefixes, o = null, c = e.changeByRange((i) => {
|
|
1112
1211
|
if (!i.empty) return {
|
|
1113
1212
|
changes: [{
|
|
1114
|
-
insert:
|
|
1213
|
+
insert: t,
|
|
1115
1214
|
from: i.from
|
|
1116
1215
|
}, {
|
|
1117
|
-
insert:
|
|
1216
|
+
insert: t,
|
|
1118
1217
|
from: i.to
|
|
1119
1218
|
}],
|
|
1120
|
-
effects:
|
|
1121
|
-
range:
|
|
1219
|
+
effects: Y.of(i.to + t.length),
|
|
1220
|
+
range: n.range(i.anchor + t.length, i.head + t.length)
|
|
1122
1221
|
};
|
|
1123
|
-
let c = i.head, l =
|
|
1124
|
-
if (l ==
|
|
1125
|
-
if (
|
|
1222
|
+
let c = i.head, l = Q(e.doc, c), u;
|
|
1223
|
+
if (l == t) {
|
|
1224
|
+
if (wt(e, c)) return {
|
|
1126
1225
|
changes: {
|
|
1127
|
-
insert:
|
|
1226
|
+
insert: t + t,
|
|
1128
1227
|
from: c
|
|
1129
1228
|
},
|
|
1130
|
-
effects:
|
|
1131
|
-
range:
|
|
1229
|
+
effects: Y.of(c + t.length),
|
|
1230
|
+
range: n.cursor(c + t.length)
|
|
1132
1231
|
};
|
|
1133
|
-
if (
|
|
1134
|
-
let i = r && e.sliceDoc(c, c +
|
|
1232
|
+
if (yt(e, c)) {
|
|
1233
|
+
let i = r && e.sliceDoc(c, c + t.length * 3) == t + t + t ? t + t + t : t;
|
|
1135
1234
|
return {
|
|
1136
1235
|
changes: {
|
|
1137
1236
|
from: c,
|
|
1138
1237
|
to: c + i.length,
|
|
1139
1238
|
insert: i
|
|
1140
1239
|
},
|
|
1141
|
-
range:
|
|
1240
|
+
range: n.cursor(c + i.length)
|
|
1142
1241
|
};
|
|
1143
1242
|
}
|
|
1144
|
-
} else if (r && e.sliceDoc(c - 2 *
|
|
1243
|
+
} else if (r && e.sliceDoc(c - 2 * t.length, c) == t + t && (u = Et(e, c - 2 * t.length, a)) > -1 && wt(e, u)) return {
|
|
1145
1244
|
changes: {
|
|
1146
|
-
insert:
|
|
1245
|
+
insert: t + t + t + t,
|
|
1147
1246
|
from: c
|
|
1148
1247
|
},
|
|
1149
|
-
effects:
|
|
1150
|
-
range:
|
|
1248
|
+
effects: Y.of(c + t.length),
|
|
1249
|
+
range: n.cursor(c + t.length)
|
|
1151
1250
|
};
|
|
1152
|
-
else if (e.charCategorizer(c)(l) !=
|
|
1251
|
+
else if (e.charCategorizer(c)(l) != s.Word && Et(e, c, a) > -1 && !Tt(e, c, t, a)) return {
|
|
1153
1252
|
changes: {
|
|
1154
|
-
insert:
|
|
1253
|
+
insert: t + t,
|
|
1155
1254
|
from: c
|
|
1156
1255
|
},
|
|
1157
|
-
effects:
|
|
1158
|
-
range:
|
|
1256
|
+
effects: Y.of(c + t.length),
|
|
1257
|
+
range: n.cursor(c + t.length)
|
|
1159
1258
|
};
|
|
1160
|
-
return { range:
|
|
1259
|
+
return { range: o = i };
|
|
1161
1260
|
});
|
|
1162
|
-
return
|
|
1261
|
+
return o ? null : e.update(c, {
|
|
1163
1262
|
scrollIntoView: !0,
|
|
1164
1263
|
userEvent: "input.type"
|
|
1165
1264
|
});
|
|
1166
1265
|
}
|
|
1167
|
-
function
|
|
1266
|
+
function wt(e, t) {
|
|
1168
1267
|
let n = T(e).resolveInner(t + 1);
|
|
1169
1268
|
return n.parent && n.from == t;
|
|
1170
1269
|
}
|
|
1171
|
-
function
|
|
1270
|
+
function Tt(e, t, n, r) {
|
|
1172
1271
|
let i = T(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
|
|
1173
1272
|
for (let o = 0; o < 5; o++) {
|
|
1174
1273
|
let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
|
|
@@ -1186,62 +1285,84 @@ function ct(e, t, n, r) {
|
|
|
1186
1285
|
}
|
|
1187
1286
|
return !1;
|
|
1188
1287
|
}
|
|
1189
|
-
function
|
|
1288
|
+
function Et(e, t, n) {
|
|
1190
1289
|
let r = e.charCategorizer(t);
|
|
1191
|
-
if (r(e.sliceDoc(t - 1, t)) !=
|
|
1290
|
+
if (r(e.sliceDoc(t - 1, t)) != s.Word) return t;
|
|
1192
1291
|
for (let i of n) {
|
|
1193
1292
|
let n = t - i.length;
|
|
1194
|
-
if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) !=
|
|
1293
|
+
if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != s.Word) return n;
|
|
1195
1294
|
}
|
|
1196
1295
|
return -1;
|
|
1197
1296
|
}
|
|
1198
|
-
function
|
|
1297
|
+
function Dt(e = {}) {
|
|
1199
1298
|
return [
|
|
1200
|
-
|
|
1201
|
-
|
|
1299
|
+
ze,
|
|
1300
|
+
R,
|
|
1202
1301
|
N.of(e),
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1302
|
+
Le,
|
|
1303
|
+
Ot,
|
|
1304
|
+
Be
|
|
1206
1305
|
];
|
|
1207
1306
|
}
|
|
1208
|
-
var
|
|
1307
|
+
var $ = [
|
|
1209
1308
|
{
|
|
1210
1309
|
key: "Ctrl-Space",
|
|
1211
|
-
run:
|
|
1310
|
+
run: V
|
|
1212
1311
|
},
|
|
1213
1312
|
{
|
|
1214
1313
|
mac: "Alt-`",
|
|
1215
|
-
run:
|
|
1314
|
+
run: V
|
|
1216
1315
|
},
|
|
1217
1316
|
{
|
|
1218
1317
|
mac: "Alt-i",
|
|
1219
|
-
run:
|
|
1318
|
+
run: V
|
|
1220
1319
|
},
|
|
1221
1320
|
{
|
|
1222
1321
|
key: "Escape",
|
|
1223
|
-
run:
|
|
1322
|
+
run: Ne
|
|
1224
1323
|
},
|
|
1225
1324
|
{
|
|
1226
1325
|
key: "ArrowDown",
|
|
1227
|
-
run: /*@__PURE__*/
|
|
1326
|
+
run: /*@__PURE__*/ B(!0)
|
|
1228
1327
|
},
|
|
1229
1328
|
{
|
|
1230
1329
|
key: "ArrowUp",
|
|
1231
|
-
run: /*@__PURE__*/
|
|
1330
|
+
run: /*@__PURE__*/ B(!1)
|
|
1232
1331
|
},
|
|
1233
1332
|
{
|
|
1234
1333
|
key: "PageDown",
|
|
1235
|
-
run: /*@__PURE__*/
|
|
1334
|
+
run: /*@__PURE__*/ B(!0, "page")
|
|
1236
1335
|
},
|
|
1237
1336
|
{
|
|
1238
1337
|
key: "PageUp",
|
|
1239
|
-
run: /*@__PURE__*/
|
|
1338
|
+
run: /*@__PURE__*/ B(!1, "page")
|
|
1240
1339
|
},
|
|
1241
1340
|
{
|
|
1242
1341
|
key: "Enter",
|
|
1243
|
-
run:
|
|
1342
|
+
run: Me
|
|
1244
1343
|
}
|
|
1245
|
-
],
|
|
1344
|
+
], Ot = /*@__PURE__*/ c.highest(/*@__PURE__*/ b.computeN([N], (e) => e.facet(N).defaultKeymap ? [$] : []));
|
|
1345
|
+
function kt(e) {
|
|
1346
|
+
let t = e.field(R, !1);
|
|
1347
|
+
return t && t.active.some((e) => e.isPending) ? "pending" : t && t.active.some((e) => e.state != 0) ? "active" : null;
|
|
1348
|
+
}
|
|
1349
|
+
var At = /*@__PURE__*/ new WeakMap();
|
|
1350
|
+
function jt(e) {
|
|
1351
|
+
let t = e.field(R, !1)?.open;
|
|
1352
|
+
if (!t || t.disabled) return [];
|
|
1353
|
+
let n = At.get(t.options);
|
|
1354
|
+
return n || At.set(t.options, n = t.options.map((e) => e.completion)), n;
|
|
1355
|
+
}
|
|
1356
|
+
function Mt(e) {
|
|
1357
|
+
let t = e.field(R, !1)?.open;
|
|
1358
|
+
return t && !t.disabled && t.selected >= 0 ? t.options[t.selected].completion : null;
|
|
1359
|
+
}
|
|
1360
|
+
function Nt(e) {
|
|
1361
|
+
let t = e.field(R, !1)?.open;
|
|
1362
|
+
return t && !t.disabled && t.selected >= 0 ? t.selected : null;
|
|
1363
|
+
}
|
|
1364
|
+
function Pt(e) {
|
|
1365
|
+
return P.of(e);
|
|
1366
|
+
}
|
|
1246
1367
|
//#endregion
|
|
1247
|
-
export {
|
|
1368
|
+
export { D as a, oe as c, tt as d, _t as i, A as l, Dt as n, $ as o, dt as r, ne as s, E as t, K as u };
|