@oomol-lab/open-flow 0.1.0-beta.39 → 0.1.0-beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/browser/codeDiagnostics-BtH_YuXu.js +44 -0
  2. package/dist/browser/{createResourceDialog-DnlKSqIs.js → createResourceDialog-BOrW62JW.js} +1 -1
  3. package/dist/browser/{dist-DYjIVIZC.js → dist-Cdna4VV_.js} +1 -1
  4. package/dist/browser/{dist-CeSZ2xSM.js → dist-DINmJ4Gr.js} +171 -112
  5. package/dist/browser/{editorComponent-T-GmTa-C.js → editorComponent-0skblWYk.js} +190 -107
  6. package/dist/browser/flow-authoring-node.d.ts +2 -5
  7. package/dist/browser/flow-authoring.js +111 -83
  8. package/dist/browser/flow-change-schema.d.ts +1 -1
  9. package/dist/browser/flow-change.d.ts +16 -5
  10. package/dist/browser/flow-change.js +196 -143
  11. package/dist/browser/{flowChanges-BXqN4jyH.js → flowChanges-3o9Vs_1I.js} +2479 -3906
  12. package/dist/browser/{flowWorkspace-a5QLISui.js → flowWorkspace-DJzQVVtZ.js} +12035 -10159
  13. package/dist/browser/{inputValues-Do4FrC_6.js → inputValues-DkDT6u0o.js} +1 -1
  14. package/dist/browser/{typeScriptSession-vC9uPDVV.js → typeScriptSession-v9Pb3G6d.js} +136 -136
  15. package/dist/browser/ui.css +1 -1
  16. package/dist/browser/workbench.css +1 -1
  17. package/dist/browser/workbench.d.ts +0 -3
  18. package/dist/browser/workbench.js +1046 -1025
  19. package/dist/browser/{workbenchSelect-Dx2Y46cD.js → workbenchSelect-B5zXyaaX.js} +1116 -1063
  20. package/dist/common/connectorDecoders.d.ts +2 -1
  21. package/dist/common/control-api-conformance.js +1589 -1518
  22. package/dist/common/control-api.d.ts +18 -6
  23. package/dist/common/control-api.js +1470 -1392
  24. package/dist/common/control-requests.js +1550 -1535
  25. package/dist/common/draftOperations.d.ts +0 -1
  26. package/dist/common/flow-connectionUsage.d.ts +1 -1
  27. package/dist/common/flow-encoding.js +1092 -1060
  28. package/dist/common/flow-semantics.d.ts +1 -0
  29. package/dist/common/flow-semantics.js +2777 -2699
  30. package/dist/common/flowInspection.d.ts +1 -1
  31. package/dist/common/integration-trigger.js +350 -328
  32. package/dist/common/mcp.d.ts +27 -0
  33. package/dist/common/mcp.js +807 -728
  34. package/dist/common/poll-trigger.js +993 -971
  35. package/dist/common/provider-triggers.js +1521 -1203
  36. package/dist/common/runtime-contract.js +13 -6
  37. package/dist/common/scheduler.js +1430 -1408
  38. package/dist/common/trigger-catalog.d.ts +2 -1
  39. package/dist/common/webhook-trigger.js +221 -199
  40. package/dist/common/{zh-CN-D2od3TNw.js → zh-CN-CxZ3yYfR.js} +2 -2
  41. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ import { m as e, p as t } from "./dist-Mecbzdl2.js";
2
+ import { r as n } from "./dist-BKuSVKCC.js";
3
+ import { r, t as i } from "./dist-DINmJ4Gr.js";
4
+ //#region src/ui/browser/codeDiagnostics.ts
5
+ var a = t.define();
6
+ function o(e) {
7
+ let t = e.field(s).invalid === !0;
8
+ return i(e, (e) => {
9
+ e.severity == "error" && (t = !0);
10
+ }), t;
11
+ }
12
+ var s = e.define({
13
+ create: () => ({}),
14
+ update(e, t) {
15
+ for (let n of t.effects) n.is(a) && (e = {
16
+ ...e,
17
+ ...n.value
18
+ });
19
+ return e;
20
+ }
21
+ });
22
+ function c(e) {
23
+ let t = e.field(s).diagnostics;
24
+ return t == null || t.source != e.doc.toString() ? [] : t.items.map((t) => {
25
+ let n = e.doc.line(Math.min(Math.max(t.line, 1), e.doc.lines)), r = Math.min(n.from + Math.max(t.column, 0), n.to);
26
+ return {
27
+ from: r,
28
+ to: Math.min(r + 1, n.to),
29
+ severity: "error",
30
+ message: t.message
31
+ };
32
+ });
33
+ }
34
+ var l = [
35
+ s,
36
+ n.editorAttributes.of((e) => ({ "data-invalid": String(o(e.state)) })),
37
+ n.contentAttributes.of((e) => ({ "aria-invalid": String(o(e.state)) })),
38
+ r((e) => c(e.state), {
39
+ delay: 300,
40
+ needsRefresh: (e) => e.startState.field(s).diagnostics !== e.state.field(s).diagnostics
41
+ })
42
+ ];
43
+ //#endregion
44
+ export { c as codeDiagnostics, l as codeDiagnosticsExtension, o as codeEditorInvalid, a as updateCodeFeedback };
@@ -1,6 +1,6 @@
1
1
  import { i as e } from "./main-BDnNHhkU.js";
2
2
  import { Bn as t, kt as n } from "./lite-BA96NG4M.js";
3
- import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, p, r as m, s as h, t as g } from "./workbenchSelect-Dx2Y46cD.js";
3
+ import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, p, r as m, s as h, t as g } from "./workbenchSelect-B5zXyaaX.js";
4
4
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
5
5
  import { useEffect as b, useRef as x, useState as S } from "react";
6
6
  //#region src/workbench/browser/runtime/shell/createResourceDialog.tsx
@@ -3,7 +3,7 @@ import { C as p, E as m, O as h, T as ee, _ as te, a as ne, b as g, c as re, d a
3
3
  import { _ as ue, c as de, d as fe, h as pe, j as me, w as he } from "./dist-DxahK_I8.js";
4
4
  import { i as ge, n as _e, o as ve, r as ye } from "./dist-D1VYgicl.js";
5
5
  import { defaultKeymap as be, history as b, historyKeymap as x } from "./dist-DSe6KRsr.js";
6
- import { t as xe } from "./dist-CeSZ2xSM.js";
6
+ import { n as xe } from "./dist-DINmJ4Gr.js";
7
7
  //#region ../../node_modules/.bun/@codemirror+search@6.7.1/node_modules/@codemirror/search/dist/index.js
8
8
  var S = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, C = class {
9
9
  constructor(e, t, n = 0, r = e.length, i, a) {
@@ -1,25 +1,25 @@
1
- import { d as e, m as t, p as n, s as r, y as i } from "./dist-Mecbzdl2.js";
2
- import { E as a, O as o, o as s, p as c, r as l, s as u, t as d, y as f } from "./dist-BKuSVKCC.js";
1
+ import { d as e, m as t, p as n, s as r, u as i, y as a } from "./dist-Mecbzdl2.js";
2
+ import { E as o, O as s, S as c, a as l, o as u, p as d, r as f, s as p, t as m, y as h } from "./dist-BKuSVKCC.js";
3
3
  //#region ../../node_modules/.bun/@codemirror+lint@6.9.7/node_modules/@codemirror/lint/dist/index.js
4
- var p = class {
4
+ var g = class {
5
5
  constructor(e, t, n) {
6
6
  this.from = e, this.to = t, this.diagnostic = n;
7
7
  }
8
- }, m = class t {
8
+ }, _ = class t {
9
9
  constructor(e, t, n) {
10
10
  this.diagnostics = e, this.panel = t, this.selected = n;
11
11
  }
12
12
  static init(n, r, i) {
13
- let a = i.facet(k).markerFilter;
13
+ let a = i.facet(P).markerFilter;
14
14
  a && (n = a(n, i));
15
- let o = n.slice().sort((e, t) => e.from - t.from || e.to - t.to), s = new e(), c = [], l = 0, u = i.doc.iter(), f = 0, p = i.doc.length;
15
+ let o = n.slice().sort((e, t) => e.from - t.from || e.to - t.to), s = new e(), c = [], l = 0, u = i.doc.iter(), d = 0, f = i.doc.length;
16
16
  for (let e = 0;;) {
17
17
  let t = e == o.length ? null : o[e];
18
18
  if (!t && !c.length) break;
19
19
  let n, r;
20
20
  if (c.length) n = l, r = c.reduce((e, t) => Math.min(e, t.to), t && t.from > n ? t.from : 1e8);
21
21
  else {
22
- if (n = t.from, n > p) break;
22
+ if (n = t.from, n > f) break;
23
23
  r = t.to, c.push(t), e++;
24
24
  }
25
25
  for (; e < o.length;) {
@@ -30,134 +30,171 @@ var p = class {
30
30
  break;
31
31
  }
32
32
  }
33
- r = Math.min(r, p);
33
+ r = Math.min(r, f);
34
34
  let i = !1;
35
- if (c.some((e) => e.from == n && (e.to == r || r == p)) && (i = n == r, !i && r - n < 10)) {
36
- let e = n - (f + u.value.length);
37
- e > 0 && (u.next(e), f = n);
35
+ if (c.some((e) => e.from == n && (e.to == r || r == f)) && (i = n == r, !i && r - n < 10)) {
36
+ let e = n - (d + u.value.length);
37
+ e > 0 && (u.next(e), d = n);
38
38
  for (let e = n;;) {
39
39
  if (e >= r) {
40
40
  i = !0;
41
41
  break;
42
42
  }
43
- if (!u.lineBreak && f + u.value.length > e) break;
44
- e = f + u.value.length, f += u.value.length, u.next();
43
+ if (!u.lineBreak && d + u.value.length > e) break;
44
+ e = d + u.value.length, d += u.value.length, u.next();
45
45
  }
46
46
  }
47
- let a = B(c);
48
- if (i) s.add(n, n, d.widget({
49
- widget: new N(a),
47
+ let a = K(c);
48
+ if (i) s.add(n, n, m.widget({
49
+ widget: new z(a),
50
50
  diagnostics: c.slice()
51
51
  }));
52
52
  else {
53
53
  let e = c.reduce((e, t) => t.markClass ? e + " " + t.markClass : e, "");
54
- s.add(n, r, d.mark({
54
+ s.add(n, r, m.mark({
55
55
  class: "cm-lintRange cm-lintRange-" + a + e,
56
56
  diagnostics: c.slice(),
57
57
  inclusiveEnd: c.some((e) => e.to > r)
58
58
  }));
59
59
  }
60
- if (l = r, l == p) break;
60
+ if (l = r, l == f) break;
61
61
  for (let e = 0; e < c.length; e++) c[e].to <= l && c.splice(e--, 1);
62
62
  }
63
- let m = s.finish();
64
- return new t(m, r, h(m));
63
+ let p = s.finish();
64
+ return new t(p, r, v(p));
65
65
  }
66
66
  };
67
- function h(e, t = null, n = 0) {
67
+ function v(e, t = null, n = 0) {
68
68
  let r = null;
69
69
  return e.between(n, 1e9, (e, n, { spec: i }) => {
70
70
  if (!(t && i.diagnostics.indexOf(t) < 0)) {
71
- if (!r) r = new p(e, n, t || i.diagnostics[0]);
71
+ if (!r) r = new g(e, n, t || i.diagnostics[0]);
72
72
  else if (i.diagnostics.indexOf(r.diagnostic) < 0) return !1;
73
- else r = new p(r.from, n, r.diagnostic);
73
+ else r = new g(r.from, n, r.diagnostic);
74
74
  }
75
75
  }), r;
76
76
  }
77
- function g(e, t) {
78
- let n = t.pos, r = t.end || n, i = e.state.facet(k).hideOn(e, n, r);
77
+ function y(e, t) {
78
+ let n = t.pos, r = t.end || n, i = e.state.facet(P).hideOn(e, n, r);
79
79
  if (i != null) return i;
80
80
  let a = e.startState.doc.lineAt(t.pos);
81
- return !!(e.effects.some((e) => e.is(y)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
81
+ return !!(e.effects.some((e) => e.is(S)) || e.changes.touchesRange(a.from, Math.max(a.to, r)));
82
82
  }
83
- function _(e, t) {
84
- return e.field(S, !1) ? t : t.concat(n.appendConfig.of(H));
83
+ function b(e, t) {
84
+ return e.field(T, !1) ? t : t.concat(n.appendConfig.of(J));
85
85
  }
86
- function v(e, t) {
87
- return { effects: _(e, [y.of(t)]) };
86
+ function x(e, t) {
87
+ return { effects: b(e, [S.of(t)]) };
88
88
  }
89
- var y = /*@__PURE__*/ n.define(), b = /*@__PURE__*/ n.define(), x = /*@__PURE__*/ n.define(), S = /*@__PURE__*/ t.define({
89
+ var S = /*@__PURE__*/ n.define(), C = /*@__PURE__*/ n.define(), w = /*@__PURE__*/ n.define(), T = /*@__PURE__*/ t.define({
90
90
  create() {
91
- return new m(d.none, null, null);
91
+ return new _(m.none, null, null);
92
92
  },
93
93
  update(e, t) {
94
94
  if (t.docChanged && e.diagnostics.size) {
95
95
  let n = e.diagnostics.map(t.changes), r = null, i = e.panel;
96
96
  if (e.selected) {
97
97
  let i = t.changes.mapPos(e.selected.from, 1);
98
- r = h(n, e.selected.diagnostic, i) || h(n, null, i);
98
+ r = v(n, e.selected.diagnostic, i) || v(n, null, i);
99
99
  }
100
- !n.size && i && t.state.facet(k).autoPanel && (i = null), e = new m(n, i, r);
100
+ !n.size && i && t.state.facet(P).autoPanel && (i = null), e = new _(n, i, r);
101
101
  }
102
- for (let n of t.effects) if (n.is(y)) {
103
- let r = t.state.facet(k).autoPanel ? n.value.length ? F.open : null : e.panel;
104
- e = m.init(n.value, r, t.state);
105
- } else n.is(b) ? e = new m(e.diagnostics, n.value ? F.open : null, e.selected) : n.is(x) && (e = new m(e.diagnostics, e.panel, n.value));
102
+ for (let n of t.effects) if (n.is(S)) {
103
+ let r = t.state.facet(P).autoPanel ? n.value.length ? V.open : null : e.panel;
104
+ e = _.init(n.value, r, t.state);
105
+ } else n.is(C) ? e = new _(e.diagnostics, n.value ? V.open : null, e.selected) : n.is(w) && (e = new _(e.diagnostics, e.panel, n.value));
106
106
  return e;
107
107
  },
108
- provide: (e) => [a.from(e, (e) => e.panel), l.decorations.from(e, (e) => e.diagnostics)]
109
- }), C = /*@__PURE__*/ d.mark({ class: "cm-lintRange cm-lintRange-active" });
110
- function w(e, t, n) {
111
- let { diagnostics: r } = e.state.field(S), i, a = -1, o = -1;
108
+ provide: (e) => [o.from(e, (e) => e.panel), f.decorations.from(e, (e) => e.diagnostics)]
109
+ }), E = /*@__PURE__*/ m.mark({ class: "cm-lintRange cm-lintRange-active" });
110
+ function D(e, t, n) {
111
+ let { diagnostics: r } = e.state.field(T), i, a = -1, o = -1;
112
112
  r.between(t - +(n < 0), t + +(n > 0), (e, r, { spec: s }) => {
113
113
  if (t >= e && t <= r && (e == r || (t > e || n > 0) && (t < r || n < 0))) return i = s.diagnostics, a = e, o = r, !1;
114
114
  });
115
- let s = e.state.facet(k).tooltipFilter;
115
+ let s = e.state.facet(P).tooltipFilter;
116
116
  return i && s && (i = s(i, e.state)), i ? {
117
117
  pos: a,
118
118
  end: o,
119
119
  above: !0,
120
120
  create() {
121
- return { dom: T(e, i) };
121
+ return { dom: O(e, i) };
122
122
  }
123
123
  } : null;
124
124
  }
125
- function T(e, t) {
126
- return o("ul", { class: "cm-tooltip-lint" }, t.map((t) => M(e, t, !1)));
125
+ function O(e, t) {
126
+ return s("ul", { class: "cm-tooltip-lint" }, t.map((t) => R(e, t, !1)));
127
127
  }
128
- var E = (e) => {
129
- let t = e.state.field(S, !1);
130
- (!t || !t.panel) && e.dispatch({ effects: _(e.state, [b.of(!0)]) });
131
- let n = c(e, F.open);
128
+ var k = (e) => {
129
+ let t = e.state.field(T, !1);
130
+ (!t || !t.panel) && e.dispatch({ effects: b(e.state, [C.of(!0)]) });
131
+ let n = d(e, V.open);
132
132
  return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
133
- }, D = (e) => {
134
- let t = e.state.field(S, !1);
135
- return !t || !t.panel ? !1 : (e.dispatch({ effects: b.of(!1) }), !0);
136
- }, O = [{
133
+ }, A = (e) => {
134
+ let t = e.state.field(T, !1);
135
+ return !t || !t.panel ? !1 : (e.dispatch({ effects: C.of(!1) }), !0);
136
+ }, j = [{
137
137
  key: "Mod-Shift-m",
138
- run: E,
138
+ run: k,
139
139
  preventDefault: !0
140
140
  }, {
141
141
  key: "F8",
142
142
  run: (e) => {
143
- let t = e.state.field(S, !1);
143
+ let t = e.state.field(T, !1);
144
144
  if (!t) return !1;
145
- let n = e.state.selection.main, r = h(t.diagnostics, null, n.to + 1);
146
- return !r && (r = h(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
145
+ let n = e.state.selection.main, r = v(t.diagnostics, null, n.to + 1);
146
+ return !r && (r = v(t.diagnostics, null, 0), !r || r.from == n.from && r.to == n.to) ? !1 : (e.dispatch({
147
147
  selection: {
148
148
  anchor: r.from,
149
149
  head: r.to
150
150
  },
151
151
  scrollIntoView: !0
152
- }), u(e, r.from, 1, {
153
- tooltip: V,
152
+ }), p(e, r.from, 1, {
153
+ tooltip: q,
154
154
  until: (e) => e.docChanged || e.newSelection.main.head < r.from || e.newSelection.main.head > r.to
155
155
  }), !0);
156
156
  }
157
- }], k = /*@__PURE__*/ r.define({ combine(e) {
157
+ }], M = /*@__PURE__*/ l.fromClass(class {
158
+ constructor(e) {
159
+ this.view = e, this.timeout = -1, this.set = !0;
160
+ let { delay: t } = e.state.facet(P);
161
+ this.lintTime = Date.now() + t, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, t);
162
+ }
163
+ run() {
164
+ clearTimeout(this.timeout);
165
+ let e = Date.now();
166
+ if (e < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e);
167
+ else {
168
+ this.set = !1;
169
+ let { state: e } = this.view, { sources: t } = e.facet(P);
170
+ t.length && N(t.map((e) => Promise.resolve(e(this.view))), (t) => {
171
+ this.view.state.doc == e.doc && this.view.dispatch(x(this.view.state, t.reduce((e, t) => e.concat(t))));
172
+ }, (e) => {
173
+ c(this.view.state, e);
174
+ });
175
+ }
176
+ }
177
+ update(e) {
178
+ let t = e.state.facet(P);
179
+ (e.docChanged || t != e.startState.facet(P) || t.needsRefresh && t.needsRefresh(e)) && (this.lintTime = Date.now() + t.delay, this.set || (this.set = !0, this.timeout = setTimeout(this.run, t.delay)));
180
+ }
181
+ force() {
182
+ this.set && (this.lintTime = Date.now(), this.run());
183
+ }
184
+ destroy() {
185
+ clearTimeout(this.timeout);
186
+ }
187
+ });
188
+ function N(e, t, n) {
189
+ let r = [], i = -1;
190
+ for (let a of e) a.then((n) => {
191
+ r.push(n), clearTimeout(i), r.length == e.length ? t(r) : i = setTimeout(() => t(r), 200);
192
+ }, n);
193
+ }
194
+ var P = /*@__PURE__*/ r.define({ combine(e) {
158
195
  return {
159
196
  sources: e.map((e) => e.source).filter((e) => e != null),
160
- ...i(e.map((e) => e.config), {
197
+ ...a(e.map((e) => e.config), {
161
198
  delay: 750,
162
199
  markerFilter: null,
163
200
  tooltipFilter: null,
@@ -165,18 +202,28 @@ var E = (e) => {
165
202
  hideOn: () => null
166
203
  }, {
167
204
  delay: Math.max,
168
- markerFilter: A,
169
- tooltipFilter: A,
205
+ markerFilter: F,
206
+ tooltipFilter: F,
170
207
  needsRefresh: (e, t) => e ? t ? (n) => e(n) || t(n) : e : t,
171
208
  hideOn: (e, t) => e ? t ? (n, r, i) => e(n, r, i) || t(n, r, i) : e : t,
172
209
  autoPanel: (e, t) => e || t
173
210
  })
174
211
  };
175
212
  } });
176
- function A(e, t) {
213
+ function F(e, t) {
177
214
  return e ? t ? (n, r) => t(e(n, r), r) : e : t;
178
215
  }
179
- function j(e) {
216
+ function I(e, t = {}) {
217
+ return [
218
+ P.of({
219
+ source: e,
220
+ config: t
221
+ }),
222
+ M,
223
+ J
224
+ ];
225
+ }
226
+ function L(e) {
180
227
  let t = [];
181
228
  if (e) actions: for (let { name: n } of e) {
182
229
  for (let e = 0; e < n.length; e++) {
@@ -190,29 +237,29 @@ function j(e) {
190
237
  }
191
238
  return t;
192
239
  }
193
- function M(e, t, n) {
194
- let r = n ? j(t.actions) : [];
195
- return o("li", { class: "cm-diagnostic cm-diagnostic-" + t.severity }, o("span", { class: "cm-diagnosticText" }, t.renderMessage ? t.renderMessage(e) : t.message), t.actions?.map((n, i) => {
196
- let a = !1, s = (r) => {
240
+ function R(e, t, n) {
241
+ let r = n ? L(t.actions) : [];
242
+ return s("li", { class: "cm-diagnostic cm-diagnostic-" + t.severity }, s("span", { class: "cm-diagnosticText" }, t.renderMessage ? t.renderMessage(e) : t.message), t.actions?.map((n, i) => {
243
+ let a = !1, o = (r) => {
197
244
  if (r.preventDefault(), a) return;
198
245
  a = !0;
199
- let i = h(e.state.field(S).diagnostics, t);
246
+ let i = v(e.state.field(T).diagnostics, t);
200
247
  i && n.apply(e, i.from, i.to);
201
248
  }, { name: c } = n, l = r[i] ? c.indexOf(r[i]) : -1, u = l < 0 ? c : [
202
249
  c.slice(0, l),
203
- o("u", c.slice(l, l + 1)),
250
+ s("u", c.slice(l, l + 1)),
204
251
  c.slice(l + 1)
205
252
  ], d = n.markClass ? " " + n.markClass : "";
206
- return o("button", {
253
+ return s("button", {
207
254
  type: "button",
208
255
  class: "cm-diagnosticAction" + d,
209
- onclick: s,
210
- onmousedown: s,
256
+ onclick: o,
257
+ onmousedown: o,
211
258
  "aria-label": ` Action: ${c}${l < 0 ? "" : ` (access key "${r[i]})"`}.`
212
259
  }, u);
213
- }), t.source && o("div", { class: "cm-diagnosticSource" }, t.source));
260
+ }), t.source && s("div", { class: "cm-diagnosticSource" }, t.source));
214
261
  }
215
- var N = class extends s {
262
+ var z = class extends u {
216
263
  constructor(e) {
217
264
  super(), this.sev = e;
218
265
  }
@@ -220,27 +267,27 @@ var N = class extends s {
220
267
  return e.sev == this.sev;
221
268
  }
222
269
  toDOM() {
223
- return o("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
270
+ return s("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
224
271
  }
225
- }, P = class {
272
+ }, B = class {
226
273
  constructor(e, t) {
227
- this.diagnostic = t, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = M(e, t, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
274
+ this.diagnostic = t, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = R(e, t, !0), this.dom.id = this.id, this.dom.setAttribute("role", "option");
228
275
  }
229
- }, F = class e {
276
+ }, V = class e {
230
277
  constructor(e) {
231
278
  this.view = e, this.items = [];
232
279
  let t = (t) => {
233
280
  if (!(t.ctrlKey || t.altKey || t.metaKey)) {
234
- if (t.keyCode == 27) D(this.view), this.view.focus();
281
+ if (t.keyCode == 27) A(this.view), this.view.focus();
235
282
  else if (t.keyCode == 38 || t.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
236
283
  else if (t.keyCode == 40 || t.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
237
284
  else if (t.keyCode == 36) this.moveSelection(0);
238
285
  else if (t.keyCode == 35) this.moveSelection(this.items.length - 1);
239
286
  else if (t.keyCode == 13) this.view.focus();
240
287
  else if (t.keyCode >= 65 && t.keyCode <= 90 && this.selectedIndex >= 0) {
241
- let { diagnostic: n } = this.items[this.selectedIndex], r = j(n.actions);
288
+ let { diagnostic: n } = this.items[this.selectedIndex], r = L(n.actions);
242
289
  for (let i = 0; i < r.length; i++) if (r[i].toUpperCase().charCodeAt(0) == t.keyCode) {
243
- let t = h(this.view.state.field(S).diagnostics, n);
290
+ let t = v(this.view.state.field(T).diagnostics, n);
244
291
  t && n.actions[i].apply(e, t.from, t.to);
245
292
  }
246
293
  } else return;
@@ -249,27 +296,27 @@ var N = class extends s {
249
296
  }, n = (e) => {
250
297
  for (let t = 0; t < this.items.length; t++) this.items[t].dom.contains(e.target) && this.moveSelection(t);
251
298
  };
252
- this.list = o("ul", {
299
+ this.list = s("ul", {
253
300
  tabIndex: 0,
254
301
  role: "listbox",
255
302
  "aria-label": this.view.state.phrase("Diagnostics"),
256
303
  onkeydown: t,
257
304
  onclick: n
258
- }), this.dom = o("div", { class: "cm-panel-lint" }, this.list, o("button", {
305
+ }), this.dom = s("div", { class: "cm-panel-lint" }, this.list, s("button", {
259
306
  type: "button",
260
307
  name: "close",
261
308
  "aria-label": this.view.state.phrase("close"),
262
- onclick: () => D(this.view)
309
+ onclick: () => A(this.view)
263
310
  }, "×")), this.update();
264
311
  }
265
312
  get selectedIndex() {
266
- let e = this.view.state.field(S).selected;
313
+ let e = this.view.state.field(T).selected;
267
314
  if (!e) return -1;
268
315
  for (let t = 0; t < this.items.length; t++) if (this.items[t].diagnostic == e.diagnostic) return t;
269
316
  return -1;
270
317
  }
271
318
  update() {
272
- let { diagnostics: e, selected: t } = this.view.state.field(S), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
319
+ let { diagnostics: e, selected: t } = this.view.state.field(T), n = 0, r = !1, i = null, a = /* @__PURE__ */ new Set();
273
320
  for (e.between(0, this.view.state.doc.length, (e, o, { spec: s }) => {
274
321
  for (let e of s.diagnostics) {
275
322
  if (a.has(e)) continue;
@@ -279,10 +326,10 @@ var N = class extends s {
279
326
  o = t;
280
327
  break;
281
328
  }
282
- o < 0 ? (s = new P(this.view, e), this.items.splice(n, 0, s), r = !0) : (s = this.items[o], o > n && (this.items.splice(n, o - n), r = !0)), t && s.diagnostic == t.diagnostic ? s.dom.hasAttribute("aria-selected") || (s.dom.setAttribute("aria-selected", "true"), i = s) : s.dom.hasAttribute("aria-selected") && s.dom.removeAttribute("aria-selected"), n++;
329
+ o < 0 ? (s = new B(this.view, e), this.items.splice(n, 0, s), r = !0) : (s = this.items[o], o > n && (this.items.splice(n, o - n), r = !0)), t && s.diagnostic == t.diagnostic ? s.dom.hasAttribute("aria-selected") || (s.dom.setAttribute("aria-selected", "true"), i = s) : s.dom.hasAttribute("aria-selected") && s.dom.removeAttribute("aria-selected"), n++;
283
330
  }
284
331
  }); n < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0);) r = !0, this.items.pop();
285
- this.items.length == 0 && (this.items.push(new P(this.view, {
332
+ this.items.length == 0 && (this.items.push(new B(this.view, {
286
333
  from: -1,
287
334
  to: -1,
288
335
  severity: "info",
@@ -313,27 +360,27 @@ var N = class extends s {
313
360
  }
314
361
  moveSelection(e) {
315
362
  if (this.selectedIndex < 0) return;
316
- let t = h(this.view.state.field(S).diagnostics, this.items[e].diagnostic);
363
+ let t = v(this.view.state.field(T).diagnostics, this.items[e].diagnostic);
317
364
  t && this.view.dispatch({
318
365
  selection: {
319
366
  anchor: t.from,
320
367
  head: t.to
321
368
  },
322
369
  scrollIntoView: !0,
323
- effects: x.of(t)
370
+ effects: w.of(t)
324
371
  });
325
372
  }
326
373
  static open(t) {
327
374
  return new e(t);
328
375
  }
329
376
  };
330
- function I(e, t = "viewBox=\"0 0 40 40\"") {
377
+ function H(e, t = "viewBox=\"0 0 40 40\"") {
331
378
  return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`;
332
379
  }
333
- function L(e) {
334
- return I(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`, "width=\"6\" height=\"3\"");
380
+ function U(e) {
381
+ return H(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`, "width=\"6\" height=\"3\"");
335
382
  }
336
- var R = /*@__PURE__*/ l.baseTheme({
383
+ var W = /*@__PURE__*/ f.baseTheme({
337
384
  ".cm-diagnostic": {
338
385
  padding: "3px 6px 3px 8px",
339
386
  marginLeft: "-1px",
@@ -363,10 +410,10 @@ var R = /*@__PURE__*/ l.baseTheme({
363
410
  backgroundRepeat: "repeat-x",
364
411
  paddingBottom: "0.7px"
365
412
  },
366
- ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ L("#f11") },
367
- ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ L("orange") },
368
- ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ L("#999") },
369
- ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ L("#66d") },
413
+ ".cm-lintRange-error": { backgroundImage: /*@__PURE__*/ U("#f11") },
414
+ ".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/ U("orange") },
415
+ ".cm-lintRange-info": { backgroundImage: /*@__PURE__*/ U("#999") },
416
+ ".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/ U("#66d") },
370
417
  ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
371
418
  ".cm-tooltip-lint": {
372
419
  padding: 0,
@@ -420,25 +467,37 @@ var R = /*@__PURE__*/ l.baseTheme({
420
467
  "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
421
468
  "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
422
469
  });
423
- function z(e) {
470
+ function G(e) {
424
471
  return e == "error" ? 4 : e == "warning" ? 3 : e == "info" ? 2 : 1;
425
472
  }
426
- function B(e) {
473
+ function K(e) {
427
474
  let t = "hint", n = 1;
428
475
  for (let r of e) {
429
- let e = z(r.severity);
476
+ let e = G(r.severity);
430
477
  e > n && (n = e, t = r.severity);
431
478
  }
432
479
  return t;
433
480
  }
434
- var V = /*@__PURE__*/ f(w, { hideOn: g }), H = [
435
- S,
436
- /*@__PURE__*/ l.decorations.compute([S], (e) => {
437
- let { selected: t, panel: n } = e.field(S);
438
- return !t || !n || t.from == t.to ? d.none : d.set([C.range(t.from, t.to)]);
481
+ var q = /*@__PURE__*/ h(D, { hideOn: y }), J = [
482
+ T,
483
+ /*@__PURE__*/ f.decorations.compute([T], (e) => {
484
+ let { selected: t, panel: n } = e.field(T);
485
+ return !t || !n || t.from == t.to ? m.none : m.set([E.range(t.from, t.to)]);
439
486
  }),
440
- V,
441
- R
487
+ q,
488
+ W
442
489
  ];
490
+ function Y(e, t) {
491
+ let n = e.field(T, !1);
492
+ if (n && n.diagnostics.size) {
493
+ let e = [], r = [], a = -1;
494
+ for (let o = i.iter([n.diagnostics]);; o.next()) {
495
+ for (let n = 0; n < e.length; n++) (!o.value || o.value.spec.diagnostics.indexOf(e[n]) < 0) && (t(e[n], r[n], a), e.splice(n, 1), r.splice(n--, 1));
496
+ if (!o.value) break;
497
+ for (let t of o.value.spec.diagnostics) e.indexOf(t) < 0 && (e.push(t), r.push(o.from));
498
+ a = o.to;
499
+ }
500
+ }
501
+ }
443
502
  //#endregion
444
- export { v as n, O as t };
503
+ export { x as i, j as n, I as r, Y as t };