@marimo-team/islands 0.24.3-dev39 → 0.24.3-dev40
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/{ConnectedDataExplorerComponent-DeiKXaGB.js → ConnectedDataExplorerComponent-KVhjDMSe.js} +1062 -1062
- package/dist/ErrorBoundary-CacTZz7K.js +200 -0
- package/dist/{abnfDiagram-VCTEODGH-DKNGRyhn.js → abnfDiagram-VCTEODGH-CpN0FRda.js} +2 -2
- package/dist/{any-language-editor-BdvsE_1G.js → any-language-editor-CycIVIeP.js} +13 -13
- package/dist/{architectureDiagram-5GKGNRK7-C9oCEyV-.js → architectureDiagram-5GKGNRK7-DDyj5SRB.js} +1 -1
- package/dist/{html-to-image-CZm_DMIE.js → cells-BSgNCBZ8.js} +5177 -8831
- package/dist/{chat-ui-D15itIKJ.js → chat-ui-CygzVJ9s.js} +1345 -1394
- package/dist/{check-mcQyZmFG.js → check-B7cIK6gb.js} +1 -1
- package/dist/{chunk-IMKFNOWR-ByL0a1rh.js → chunk-IMKFNOWR-BfwTebD0.js} +1 -1
- package/dist/{chunk-SHT3W25Y-D1Nb5X1c.js → chunk-SHT3W25Y-BspJEJ5H.js} +1 -1
- package/dist/{chunk-SVP7TREG-BShKxcfD.js → chunk-SVP7TREG-DX3rFNTe.js} +1 -1
- package/dist/{chunk-TICWLB2K-zpDbKPt8.js → chunk-TICWLB2K-fVF7Uujg.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-qcsoIIQw.js → classDiagram-ZZMXUADV-Fe-V14Sc.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-CAgMct5x.js → classDiagram-v2-VYDZK3BY-xTDg7lOs.js} +2 -2
- package/dist/code-visibility-BBNwvBcV.js +138 -0
- package/dist/{common-eNTtBSo2.js → common-DM3lblo7.js} +5531 -5730
- package/dist/copy-icon-CLdENY__.js +190 -0
- package/dist/{cynefinDiagram-5FMLGOSQ-BzBXigwN.js → cynefinDiagram-5FMLGOSQ-CFQrqzSX.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-B-75J283.js → dagre-GXQ25YYZ-xHNAUTyG.js} +1 -1
- package/dist/{data-grid-overlay-editor-DMu5X3F1.js → data-grid-overlay-editor-DjRvSwGI.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-Bzr5oWc0.js → diagram-S7CK7UJ4-Bt1rPbAx.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CVIH_HJ_.js → diagram-UQ7AKVKN-D1sq5FoZ.js} +1 -1
- package/dist/{diagram-VX7I27RA-BmoMwYLC.js → diagram-VX7I27RA-BMwGFVD6.js} +1 -1
- package/dist/{diagram-Z3DM3KII-BW1w6mnj.js → diagram-Z3DM3KII--KLDR9Pl.js} +1 -1
- package/dist/dialog-CgNq6y9-.js +94 -0
- package/dist/{objectWithoutPropertiesLoose-BbiTb8zy.js → dist-CO1AwwG_.js} +516 -572
- package/dist/{dropdown-menu-WMrB1UnI.js → dropdown-menu-CZgjYSAh.js} +1437 -2793
- package/dist/{ebnfDiagram-PWID7BFC-90Q6gkC0.js → ebnfDiagram-PWID7BFC-WnG4cvSQ.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-BZkLy3TR.js → erDiagram-RLTQ6QDP-DhzKiYHc.js} +1 -1
- package/dist/error-banner-B94dcDmP.js +391 -0
- package/dist/error-entries-iJn-Nryx.js +56 -0
- package/dist/{esm-qM9GvHZi.js → esm-h8f7-1CJ.js} +316 -315
- package/dist/feedback-button-BkFFL-wb.js +380 -0
- package/dist/{flowDiagram-HODETNUW-CD1F_wj5.js → flowDiagram-HODETNUW-6dMdB8pR.js} +2 -2
- package/dist/{formats-B-gajYGs.js → formats-BR5iGb4s.js} +1 -1
- package/dist/{glide-data-editor-DzFEatOq.js → glide-data-editor-CeAOHG6x.js} +117 -116
- package/dist/{glide-utils-4WmLlefP.js → glide-utils-B3rUT5PI.js} +2 -2
- package/dist/globals-C74RodJy.js +19 -0
- package/dist/html-to-image-kpuRfdfZ.js +3253 -0
- package/dist/{infoDiagram-27XIBGKW-t0zIIRVa.js → infoDiagram-27XIBGKW-BagtCX_5.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DtQUIYgx.js → ishikawaDiagram-5VMMS53U-DByDehYy.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CUMmwuNB.js → kanban-definition-UXKFOSKX-BxwkbBI_.js} +1 -1
- package/dist/{label-e37ixur5.js → label-BJ49YTvk.js} +1 -1
- package/dist/main.js +4717 -4728
- package/dist/{mermaid-CMLxoJ0m.js → mermaid-DPNuhemn.js} +35 -35
- package/dist/{mindmap-definition-YA3MSWOX-DnbkiQla.js → mindmap-definition-YA3MSWOX-Cgvojw3y.js} +1 -1
- package/dist/{number-overlay-editor-lGqRHkFt.js → number-overlay-editor-DDyIkEk3.js} +1 -1
- package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
- package/dist/{pegDiagram-XKGWAZYB-qgqAYMdv.js → pegDiagram-XKGWAZYB-DahHhYyN.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-DJUB6w6B.js → pieDiagram-E7YTZNPT-CCtX0oCK.js} +1 -1
- package/dist/{process-output-DuupNR0m.js → process-output-DFe2tVIY.js} +7 -6
- package/dist/{railroadDiagram-O6MQD6OU-C0dtw4sR.js → railroadDiagram-O6MQD6OU-Du5NsPUb.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DqaTsUuC.js → requirementDiagram-BXWQKSXE-0pmmxL6_.js} +1 -1
- package/dist/{reveal-component-CNqmC7b6.js → reveal-component-CRy68FxJ.js} +625 -625
- package/dist/{select-UMOSCa3W.js → select-C6plhmZr.js} +308 -553
- package/dist/{sequenceDiagram-WJ2MYXX4-D2NyWGuu.js → sequenceDiagram-WJ2MYXX4-DB-ChWwU.js} +1 -1
- package/dist/{spec-BiD5y7ft.js → spec-CAYwFeV6.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-JChw35bc.js → stateDiagram-D77RDMKH-orN6AwMx.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-BfVY7OxA.js → stateDiagram-v2-MP3YSRHH-o05_rJN8.js} +2 -2
- package/dist/{swimlanes-42K2YHIH-eAB6utyY.js → swimlanes-42K2YHIH-BkSDcqDT.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-Cnpd2YtA.js → swimlanesDiagram-VR7AAH4N-D_nFQfRc.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-DlnODX3U.js → timeline-definition-24CTP7MA-BuqJUIRZ.js} +1 -1
- package/dist/{toDate-0cxDmdsp.js → toDate-WXg1yLcI.js} +2 -2
- package/dist/toast-DvY70eFX.js +1834 -0
- package/dist/tooltip-qB8NlSqV.js +1742 -0
- package/dist/{schemas-BDZr-nP0.js → use-restore-focus-D5D9xEjZ.js} +1385 -1166
- package/dist/{useAsyncData-DCIhDLCe.js → useAsyncData-BD6AStMt.js} +1 -1
- package/dist/{useDateFormatter-BKpQHt-W.js → useDateFormatter-BRTPsUK7.js} +2 -2
- package/dist/{useDeepCompareMemoize-CLaZB7Gc.js → useDeepCompareMemoize-D_HNdyvI.js} +1 -1
- package/dist/{useLifecycle-C1ViBACC.js → useLifecycle-DPgiiwwU.js} +2 -2
- package/dist/useNumberFormatter-BfDpa21j.js +251 -0
- package/dist/{useTheme-Da9LJvrQ.js → useTheme-DzXmYZ5V.js} +83 -83
- package/dist/{vega-component-Bt6d8B4Q.js → vega-component-D0QXopU8.js} +27 -27
- package/dist/{vennDiagram-4TSXK5OY-B_m5KxUg.js → vennDiagram-4TSXK5OY-CTUlJ2PK.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-Dw-Lgv3D.js → wardleyDiagram-VM6X3IG4-3evLUb0M.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-BjfRms1e.js → xychartDiagram-S5SC5T6Z-DL2E3K8-.js} +1 -1
- package/package.json +1 -1
- package/src/components/editor/boundary/ErrorBoundary.tsx +38 -16
- package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +311 -0
- package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +94 -0
- package/src/components/editor/chrome/components/feedback-button.tsx +53 -33
- package/src/components/ui/use-toast.ts +8 -0
- package/dist/ErrorBoundary-B3IKS4qY.js +0 -125
- package/dist/copy-C0N4m1lm.js +0 -141
- package/dist/dist-6ChWbo8z.js +0 -1360
- package/dist/error-banner-hCaH06e3.js +0 -611
- package/dist/tooltip-CdE8k0pS.js +0 -390
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
2
|
import { t } from "./react-ofJbxM4x.js";
|
|
3
3
|
import { t as n } from "./jsx-runtime-DgDPJV9S.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
4
|
+
import { $ as r, At as i, C as a, Ct as o, Dt as s, F as c, Ft as l, Gt as u, H as d, Ht as f, Kt as p, Lt as m, Nt as h, Rt as g, Ut as _, Vt as v, Z as y, _t as ee, a as te, at as b, bt as x, dt as S, ft as C, g as w, ht as T, it as E, j as D, jt as O, k, kt as A, mt as j, ot as M, p as ne, st as N, tt as re, ut as P, vt as ie, wt as F, x as ae, xt as oe, yt as I } from "./dist-Kxgjxakw.js";
|
|
5
|
+
import { a as L, c as R, l as z, n as B, o as V } from "./dist-CO1AwwG_.js";
|
|
6
|
+
import { a as H, c as se, i as ce, r as le } from "./dist-B1vYLK28.js";
|
|
7
|
+
import { n as U, t as ue } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
|
|
7
8
|
//#region ../node_modules/.pnpm/@codemirror+search@6.7.1/node_modules/@codemirror/search/dist/index.js
|
|
8
|
-
var
|
|
9
|
+
var W = /* @__PURE__ */ e(t()), de = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, G = class {
|
|
9
10
|
constructor(e, t, n = 0, r = e.length, i, a) {
|
|
10
11
|
this.test = a, this.value = {
|
|
11
12
|
from: 0,
|
|
12
13
|
to: 0,
|
|
13
14
|
precise: !1
|
|
14
|
-
}, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(
|
|
15
|
+
}, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(de(e)) : de, this.query = this.normalize(t);
|
|
15
16
|
}
|
|
16
17
|
peek() {
|
|
17
18
|
if (this.bufferPos == this.buffer.length) {
|
|
18
19
|
if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done) return -1;
|
|
19
20
|
this.bufferPos = 0, this.buffer = this.iter.value;
|
|
20
21
|
}
|
|
21
|
-
return
|
|
22
|
+
return v(this.buffer, this.bufferPos);
|
|
22
23
|
}
|
|
23
24
|
next() {
|
|
24
25
|
for (; this.matches.length;) this.matches.pop();
|
|
@@ -28,8 +29,8 @@ var U = /* @__PURE__ */ e(t()), fe = typeof String.prototype.normalize == "funct
|
|
|
28
29
|
for (;;) {
|
|
29
30
|
let e = this.peek();
|
|
30
31
|
if (e < 0) return this.done = !0, this;
|
|
31
|
-
let t =
|
|
32
|
-
this.bufferPos +=
|
|
32
|
+
let t = p(e), n = this.bufferStart + this.bufferPos;
|
|
33
|
+
this.bufferPos += f(e);
|
|
33
34
|
let r = this.normalize(t);
|
|
34
35
|
if (r.length) for (let e = 0, i = n, a = !0;; e++) {
|
|
35
36
|
let n = r.charCodeAt(e), o = this.match(n, i, a, this.bufferPos + this.bufferStart, e == r.length - 1);
|
|
@@ -60,20 +61,20 @@ var U = /* @__PURE__ */ e(t()), fe = typeof String.prototype.normalize == "funct
|
|
|
60
61
|
})), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
typeof Symbol < "u" && (
|
|
64
|
+
typeof Symbol < "u" && (G.prototype[Symbol.iterator] = function() {
|
|
64
65
|
return this;
|
|
65
66
|
});
|
|
66
|
-
var
|
|
67
|
+
var fe = {
|
|
67
68
|
from: -1,
|
|
68
69
|
to: -1,
|
|
69
70
|
match: /*@__PURE__*/ /.*/.exec(""),
|
|
70
71
|
precise: !0
|
|
71
|
-
},
|
|
72
|
+
}, pe = "gm" + (/x/.unicode == null ? "" : "u"), me = class {
|
|
72
73
|
constructor(e, t, n, r = 0, i = e.length) {
|
|
73
|
-
if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value =
|
|
74
|
-
this.re = new RegExp(t,
|
|
74
|
+
if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = fe, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new _e(e, t, n, r, i);
|
|
75
|
+
this.re = new RegExp(t, pe + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
|
|
75
76
|
let a = e.lineAt(r);
|
|
76
|
-
this.curLineStart = a.from, this.matchPos =
|
|
77
|
+
this.curLineStart = a.from, this.matchPos = K(e, r), this.getLine(this.curLineStart);
|
|
77
78
|
}
|
|
78
79
|
getLine(e) {
|
|
79
80
|
this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
|
|
@@ -87,7 +88,7 @@ var pe = {
|
|
|
87
88
|
let t = this.matchPos <= this.to && this.re.exec(this.curLine);
|
|
88
89
|
if (t) {
|
|
89
90
|
let n = this.curLineStart + t.index, r = n + t[0].length;
|
|
90
|
-
if (this.matchPos =
|
|
91
|
+
if (this.matchPos = K(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
|
|
91
92
|
from: n,
|
|
92
93
|
to: r,
|
|
93
94
|
precise: !0,
|
|
@@ -98,7 +99,7 @@ var pe = {
|
|
|
98
99
|
else return this.done = !0, this;
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
|
-
},
|
|
102
|
+
}, he = /*@__PURE__*/ new WeakMap(), ge = class e {
|
|
102
103
|
constructor(e, t) {
|
|
103
104
|
this.from = e, this.text = t;
|
|
104
105
|
}
|
|
@@ -106,18 +107,18 @@ var pe = {
|
|
|
106
107
|
return this.from + this.text.length;
|
|
107
108
|
}
|
|
108
109
|
static get(t, n, r) {
|
|
109
|
-
let i =
|
|
110
|
+
let i = he.get(t);
|
|
110
111
|
if (!i || i.from >= r || i.to <= n) {
|
|
111
112
|
let i = new e(n, t.sliceString(n, r));
|
|
112
|
-
return
|
|
113
|
+
return he.set(t, i), i;
|
|
113
114
|
}
|
|
114
115
|
if (i.from == n && i.to == r) return i;
|
|
115
116
|
let { text: a, from: o } = i;
|
|
116
|
-
return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)),
|
|
117
|
+
return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), he.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
|
|
117
118
|
}
|
|
118
|
-
},
|
|
119
|
+
}, _e = class {
|
|
119
120
|
constructor(e, t, n, r, i) {
|
|
120
|
-
this.text = e, this.to = i, this.done = !1, this.value =
|
|
121
|
+
this.text = e, this.to = i, this.done = !1, this.value = fe, this.matchPos = K(e, r), this.re = new RegExp(t, pe + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = ge.get(e, r, this.chunkEnd(r + 5e3));
|
|
121
122
|
}
|
|
122
123
|
chunkEnd(e) {
|
|
123
124
|
return e >= this.to ? this.to : this.text.lineAt(e).to;
|
|
@@ -132,31 +133,31 @@ var pe = {
|
|
|
132
133
|
to: n,
|
|
133
134
|
precise: !0,
|
|
134
135
|
match: t
|
|
135
|
-
}, this.matchPos =
|
|
136
|
+
}, this.matchPos = K(this.text, n + +(e == n)), this;
|
|
136
137
|
}
|
|
137
138
|
if (this.flat.to == this.to) return this.done = !0, this;
|
|
138
|
-
this.flat =
|
|
139
|
+
this.flat = ge.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
|
-
typeof Symbol < "u" && (
|
|
143
|
+
typeof Symbol < "u" && (me.prototype[Symbol.iterator] = _e.prototype[Symbol.iterator] = function() {
|
|
143
144
|
return this;
|
|
144
145
|
});
|
|
145
|
-
function
|
|
146
|
+
function ve(e) {
|
|
146
147
|
try {
|
|
147
|
-
return new RegExp(e,
|
|
148
|
+
return new RegExp(e, pe), !0;
|
|
148
149
|
} catch {
|
|
149
150
|
return !1;
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
+
function K(e, t) {
|
|
153
154
|
if (t >= e.length) return t;
|
|
154
155
|
let n = e.lineAt(t), r;
|
|
155
156
|
for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
|
|
156
157
|
return t;
|
|
157
158
|
}
|
|
158
|
-
var
|
|
159
|
-
let { state: t } = e, n = String(t.doc.lineAt(e.state.selection.main.head).number), { close:
|
|
159
|
+
var ye = (e) => {
|
|
160
|
+
let { state: t } = e, n = String(t.doc.lineAt(e.state.selection.main.head).number), { close: i, result: a } = x(e, {
|
|
160
161
|
label: t.phrase("Go to line"),
|
|
161
162
|
input: {
|
|
162
163
|
type: "text",
|
|
@@ -166,47 +167,47 @@ var be = (e) => {
|
|
|
166
167
|
focus: !0,
|
|
167
168
|
submitLabel: t.phrase("go")
|
|
168
169
|
});
|
|
169
|
-
return
|
|
170
|
-
let
|
|
171
|
-
if (!
|
|
172
|
-
e.dispatch({ effects:
|
|
170
|
+
return a.then((n) => {
|
|
171
|
+
let a = n && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);
|
|
172
|
+
if (!a) {
|
|
173
|
+
e.dispatch({ effects: i });
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
|
-
let
|
|
176
|
-
if (
|
|
176
|
+
let o = t.doc.lineAt(t.selection.main.head), [, s, c, l, u] = a, d = l ? +l.slice(1) : 0, f = c ? +c : o.number;
|
|
177
|
+
if (c && u) {
|
|
177
178
|
let e = f / 100;
|
|
178
|
-
|
|
179
|
-
} else
|
|
180
|
-
let p = t.doc.line(Math.max(1, Math.min(t.doc.lines, f))), m =
|
|
179
|
+
s && (e = e * (s == "-" ? -1 : 1) + o.number / t.doc.lines), f = Math.round(t.doc.lines * e);
|
|
180
|
+
} else c && s && (f = f * (s == "-" ? -1 : 1) + o.number);
|
|
181
|
+
let p = t.doc.line(Math.max(1, Math.min(t.doc.lines, f))), m = A.cursor(p.from + Math.max(0, Math.min(d, p.length)));
|
|
181
182
|
e.dispatch({
|
|
182
|
-
effects: [
|
|
183
|
+
effects: [i, r.scrollIntoView(m.from, { y: "center" })],
|
|
183
184
|
selection: m
|
|
184
185
|
});
|
|
185
186
|
}), !0;
|
|
186
|
-
},
|
|
187
|
+
}, be = {
|
|
187
188
|
highlightWordAroundCursor: !1,
|
|
188
189
|
minSelectionLength: 1,
|
|
189
190
|
maxMatches: 100,
|
|
190
191
|
wholeWords: !1
|
|
191
|
-
},
|
|
192
|
-
return
|
|
192
|
+
}, xe = /*@__PURE__*/ O.define({ combine(e) {
|
|
193
|
+
return _(e, be, {
|
|
193
194
|
highlightWordAroundCursor: (e, t) => e || t,
|
|
194
195
|
minSelectionLength: Math.min,
|
|
195
196
|
maxMatches: Math.min
|
|
196
197
|
});
|
|
197
198
|
} });
|
|
198
|
-
function
|
|
199
|
-
let t = [
|
|
200
|
-
return e && t.push(
|
|
199
|
+
function Se(e) {
|
|
200
|
+
let t = [Oe, De];
|
|
201
|
+
return e && t.push(xe.of(e)), t;
|
|
201
202
|
}
|
|
202
|
-
var
|
|
203
|
-
function
|
|
204
|
-
return (n == 0 || e(t.sliceDoc(n - 1, n)) !=
|
|
203
|
+
var Ce = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch" }), we = /*@__PURE__*/ y.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
|
|
204
|
+
function Te(e, t, n, r) {
|
|
205
|
+
return (n == 0 || e(t.sliceDoc(n - 1, n)) != s.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != s.Word);
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
-
return e(t.sliceDoc(n, n + 1)) ==
|
|
207
|
+
function Ee(e, t, n, r) {
|
|
208
|
+
return e(t.sliceDoc(n, n + 1)) == s.Word && e(t.sliceDoc(r - 1, r)) == s.Word;
|
|
208
209
|
}
|
|
209
|
-
var
|
|
210
|
+
var De = /*@__PURE__*/ re.fromClass(class {
|
|
210
211
|
constructor(e) {
|
|
211
212
|
this.decorations = this.getDeco(e);
|
|
212
213
|
}
|
|
@@ -214,43 +215,43 @@ var Oe = /*@__PURE__*/ L.fromClass(class {
|
|
|
214
215
|
(e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
|
|
215
216
|
}
|
|
216
217
|
getDeco(e) {
|
|
217
|
-
let t = e.state.facet(
|
|
218
|
-
if (r.ranges.length > 1) return
|
|
218
|
+
let t = e.state.facet(xe), { state: n } = e, r = n.selection;
|
|
219
|
+
if (r.ranges.length > 1) return y.none;
|
|
219
220
|
let i = r.main, a, o = null;
|
|
220
221
|
if (i.empty) {
|
|
221
|
-
if (!t.highlightWordAroundCursor) return
|
|
222
|
+
if (!t.highlightWordAroundCursor) return y.none;
|
|
222
223
|
let e = n.wordAt(i.head);
|
|
223
|
-
if (!e) return
|
|
224
|
+
if (!e) return y.none;
|
|
224
225
|
o = n.charCategorizer(i.head), a = n.sliceDoc(e.from, e.to);
|
|
225
226
|
} else {
|
|
226
227
|
let e = i.to - i.from;
|
|
227
|
-
if (e < t.minSelectionLength || e > 200) return
|
|
228
|
+
if (e < t.minSelectionLength || e > 200) return y.none;
|
|
228
229
|
if (t.wholeWords) {
|
|
229
|
-
if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(
|
|
230
|
-
} else if (a = n.sliceDoc(i.from, i.to), !a) return
|
|
230
|
+
if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(Te(o, n, i.from, i.to) && Ee(o, n, i.from, i.to))) return y.none;
|
|
231
|
+
} else if (a = n.sliceDoc(i.from, i.to), !a) return y.none;
|
|
231
232
|
}
|
|
232
233
|
let s = [];
|
|
233
234
|
for (let r of e.visibleRanges) {
|
|
234
|
-
let e = new
|
|
235
|
+
let e = new G(n.doc, a, r.from, r.to);
|
|
235
236
|
for (; !e.next().done;) {
|
|
236
237
|
let { from: r, to: a } = e.value;
|
|
237
|
-
if ((!o ||
|
|
238
|
+
if ((!o || Te(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(we.range(r, a)) : (r >= i.to || a <= i.from) && s.push(Ce.range(r, a)), s.length > t.maxMatches)) return y.none;
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
return
|
|
241
|
+
return y.set(s);
|
|
241
242
|
}
|
|
242
|
-
}, { decorations: (e) => e.decorations }),
|
|
243
|
+
}, { decorations: (e) => e.decorations }), Oe = /*@__PURE__*/ r.baseTheme({
|
|
243
244
|
".cm-selectionMatch": { backgroundColor: "#99ff7780" },
|
|
244
245
|
".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
|
|
245
|
-
}),
|
|
246
|
-
let { selection: n } = e, r =
|
|
246
|
+
}), ke = ({ state: e, dispatch: t }) => {
|
|
247
|
+
let { selection: n } = e, r = A.create(n.ranges.map((t) => e.wordAt(t.head) || A.cursor(t.head)), n.mainIndex);
|
|
247
248
|
return !r.eq(n) && (t(e.update({ selection: r })), !0);
|
|
248
249
|
};
|
|
249
|
-
function
|
|
250
|
+
function Ae(e, t) {
|
|
250
251
|
let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
|
|
251
|
-
for (let n = !1, i = new
|
|
252
|
+
for (let n = !1, i = new G(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
|
|
252
253
|
if (n) return null;
|
|
253
|
-
i = new
|
|
254
|
+
i = new G(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
|
|
254
255
|
} else {
|
|
255
256
|
if (n && r.some((e) => e.from == i.value.from)) continue;
|
|
256
257
|
if (a) {
|
|
@@ -260,32 +261,32 @@ function je(e, t) {
|
|
|
260
261
|
return i.value;
|
|
261
262
|
}
|
|
262
263
|
}
|
|
263
|
-
var
|
|
264
|
+
var je = ({ state: e, dispatch: t }) => {
|
|
264
265
|
let { ranges: n } = e.selection;
|
|
265
|
-
if (n.some((e) => e.from === e.to)) return
|
|
266
|
+
if (n.some((e) => e.from === e.to)) return ke({
|
|
266
267
|
state: e,
|
|
267
268
|
dispatch: t
|
|
268
269
|
});
|
|
269
|
-
let
|
|
270
|
-
if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) !=
|
|
271
|
-
let
|
|
272
|
-
return
|
|
273
|
-
selection: e.selection.addRange(
|
|
274
|
-
effects:
|
|
270
|
+
let i = e.sliceDoc(n[0].from, n[0].to);
|
|
271
|
+
if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != i)) return !1;
|
|
272
|
+
let a = Ae(e, i);
|
|
273
|
+
return a ? (t(e.update({
|
|
274
|
+
selection: e.selection.addRange(A.range(a.from, a.to), !1),
|
|
275
|
+
effects: r.scrollIntoView(a.to)
|
|
275
276
|
})), !0) : !1;
|
|
276
|
-
},
|
|
277
|
-
return
|
|
277
|
+
}, q = /*@__PURE__*/ O.define({ combine(e) {
|
|
278
|
+
return _(e, {
|
|
278
279
|
top: !1,
|
|
279
280
|
caseSensitive: !1,
|
|
280
281
|
literal: !1,
|
|
281
282
|
regexp: !1,
|
|
282
283
|
wholeWord: !1,
|
|
283
284
|
createPanel: (e) => new ot(e),
|
|
284
|
-
scrollToMatch: (e) =>
|
|
285
|
+
scrollToMatch: (e) => r.scrollIntoView(e)
|
|
285
286
|
});
|
|
286
|
-
} }),
|
|
287
|
+
} }), Me = class {
|
|
287
288
|
constructor(e) {
|
|
288
|
-
this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp ||
|
|
289
|
+
this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || ve(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
|
|
289
290
|
}
|
|
290
291
|
unquote(e) {
|
|
291
292
|
return this.literal ? e : e.replace(/\\([nrt\\])/g, (e, t) => t == "n" ? "\n" : t == "r" ? "\r" : t == "t" ? " " : "\\");
|
|
@@ -294,42 +295,42 @@ var Me = ({ state: e, dispatch: t }) => {
|
|
|
294
295
|
return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord && this.test == e.test;
|
|
295
296
|
}
|
|
296
297
|
create() {
|
|
297
|
-
return this.regexp ? new Ve(this) : new
|
|
298
|
+
return this.regexp ? new Ve(this) : new Ie(this);
|
|
298
299
|
}
|
|
299
300
|
getCursor(e, t = 0, n) {
|
|
300
|
-
let r = e.doc ? e :
|
|
301
|
-
return n ??= r.doc.length, this.regexp ?
|
|
301
|
+
let r = e.doc ? e : i.create({ doc: e });
|
|
302
|
+
return n ??= r.doc.length, this.regexp ? Y(this, r, t, n) : J(this, r, t, n);
|
|
302
303
|
}
|
|
303
|
-
},
|
|
304
|
+
}, Ne = class {
|
|
304
305
|
constructor(e) {
|
|
305
306
|
this.spec = e;
|
|
306
307
|
}
|
|
307
308
|
};
|
|
308
|
-
function
|
|
309
|
+
function Pe(e, t, n) {
|
|
309
310
|
return (r, i, a, o) => n && !n(r, i, a, o) ? !1 : e(r >= o && i <= o + a.length ? a.slice(r - o, i - o) : t.doc.sliceString(r, i), t, r, i);
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function J(e, t, n, r) {
|
|
312
313
|
let i;
|
|
313
|
-
return e.wholeWord && (i =
|
|
314
|
+
return e.wholeWord && (i = Fe(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Pe(e.test, t, i)), new G(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
-
return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(
|
|
316
|
+
function Fe(e, t) {
|
|
317
|
+
return (n, r, i, a) => ((a > n || a + i.length < r) && (a = Math.max(0, n - 2), i = e.sliceString(a, Math.min(e.length, r + 2))), (t(Re(i, n - a)) != s.Word || t(ze(i, n - a)) != s.Word) && (t(ze(i, r - a)) != s.Word || t(Re(i, r - a)) != s.Word));
|
|
317
318
|
}
|
|
318
|
-
var
|
|
319
|
+
var Ie = class extends Ne {
|
|
319
320
|
constructor(e) {
|
|
320
321
|
super(e);
|
|
321
322
|
}
|
|
322
323
|
nextMatch(e, t, n) {
|
|
323
|
-
let r =
|
|
324
|
+
let r = J(this.spec, e, n, e.doc.length).nextOverlapping();
|
|
324
325
|
if (r.done) {
|
|
325
326
|
let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
|
|
326
|
-
r =
|
|
327
|
+
r = J(this.spec, e, 0, n).nextOverlapping();
|
|
327
328
|
}
|
|
328
329
|
return r.done || r.value.from == t && r.value.to == n ? null : r.value;
|
|
329
330
|
}
|
|
330
331
|
prevMatchInRange(e, t, n) {
|
|
331
332
|
for (let r = n;;) {
|
|
332
|
-
let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i =
|
|
333
|
+
let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = J(this.spec, e, n, r), a = null;
|
|
333
334
|
for (; !i.nextOverlapping().done;) a = i.value;
|
|
334
335
|
if (a) return a;
|
|
335
336
|
if (n == t) return null;
|
|
@@ -344,7 +345,7 @@ var Le = class extends Pe {
|
|
|
344
345
|
return this.spec.unquote(this.spec.replace);
|
|
345
346
|
}
|
|
346
347
|
matchAll(e, t) {
|
|
347
|
-
let n =
|
|
348
|
+
let n = J(this.spec, e, 0, e.doc.length), r = [];
|
|
348
349
|
for (; !n.next().done;) {
|
|
349
350
|
if (r.length >= t) return null;
|
|
350
351
|
r.push(n.value);
|
|
@@ -352,37 +353,37 @@ var Le = class extends Pe {
|
|
|
352
353
|
return r;
|
|
353
354
|
}
|
|
354
355
|
highlight(e, t, n, r) {
|
|
355
|
-
let i =
|
|
356
|
+
let i = J(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
|
|
356
357
|
for (; !i.next().done;) r(i.value.from, i.value.to);
|
|
357
358
|
}
|
|
358
359
|
};
|
|
359
|
-
function
|
|
360
|
+
function Le(e, t, n) {
|
|
360
361
|
return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function Y(e, t, n, r) {
|
|
363
364
|
let i;
|
|
364
|
-
return e.wholeWord && (i = Be(t.charCategorizer(t.selection.main.head))), e.test && (i =
|
|
365
|
+
return e.wholeWord && (i = Be(t.charCategorizer(t.selection.main.head))), e.test && (i = Le(e.test, t, i)), new me(t.doc, e.search, {
|
|
365
366
|
ignoreCase: !e.caseSensitive,
|
|
366
367
|
test: i
|
|
367
368
|
}, n, r);
|
|
368
369
|
}
|
|
369
|
-
function
|
|
370
|
-
return e.slice(
|
|
370
|
+
function Re(e, t) {
|
|
371
|
+
return e.slice(u(e, t, !1), t);
|
|
371
372
|
}
|
|
372
373
|
function ze(e, t) {
|
|
373
|
-
return e.slice(t,
|
|
374
|
+
return e.slice(t, u(e, t));
|
|
374
375
|
}
|
|
375
376
|
function Be(e) {
|
|
376
|
-
return (t, n, r) => !r[0].length || (e(
|
|
377
|
+
return (t, n, r) => !r[0].length || (e(Re(r.input, r.index)) != s.Word || e(ze(r.input, r.index)) != s.Word) && (e(ze(r.input, r.index + r[0].length)) != s.Word || e(Re(r.input, r.index + r[0].length)) != s.Word);
|
|
377
378
|
}
|
|
378
|
-
var Ve = class extends
|
|
379
|
+
var Ve = class extends Ne {
|
|
379
380
|
nextMatch(e, t, n) {
|
|
380
|
-
let r =
|
|
381
|
-
return r.done && (r =
|
|
381
|
+
let r = Y(this.spec, e, n, e.doc.length).next();
|
|
382
|
+
return r.done && (r = Y(this.spec, e, 0, t).next()), r.done ? null : r.value;
|
|
382
383
|
}
|
|
383
384
|
prevMatchInRange(e, t, n) {
|
|
384
385
|
for (let r = 1;; r++) {
|
|
385
|
-
let i = Math.max(t, n - r * 1e4), a =
|
|
386
|
+
let i = Math.max(t, n - r * 1e4), a = Y(this.spec, e, i, n), o = null;
|
|
386
387
|
for (; !a.next().done;) o = a.value;
|
|
387
388
|
if (o && (i == t || o.from > i + 10)) return o;
|
|
388
389
|
if (i == t) return null;
|
|
@@ -403,7 +404,7 @@ var Ve = class extends Pe {
|
|
|
403
404
|
});
|
|
404
405
|
}
|
|
405
406
|
matchAll(e, t) {
|
|
406
|
-
let n =
|
|
407
|
+
let n = Y(this.spec, e, 0, e.doc.length), r = [];
|
|
407
408
|
for (; !n.next().done;) {
|
|
408
409
|
if (r.length >= t) return null;
|
|
409
410
|
r.push(n.value);
|
|
@@ -411,10 +412,10 @@ var Ve = class extends Pe {
|
|
|
411
412
|
return r;
|
|
412
413
|
}
|
|
413
414
|
highlight(e, t, n, r) {
|
|
414
|
-
let i =
|
|
415
|
+
let i = Y(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
|
|
415
416
|
for (; !i.next().done;) r(i.value.from, i.value.to);
|
|
416
417
|
}
|
|
417
|
-
}, X = /*@__PURE__*/
|
|
418
|
+
}, X = /*@__PURE__*/ m.define(), He = /*@__PURE__*/ m.define(), Z = /*@__PURE__*/ g.define({
|
|
418
419
|
create(e) {
|
|
419
420
|
return new Ue(et(e).create(), null);
|
|
420
421
|
},
|
|
@@ -422,12 +423,12 @@ var Ve = class extends Pe {
|
|
|
422
423
|
for (let n of t.effects) n.is(X) ? e = new Ue(n.value.create(), e.panel) : n.is(He) && (e = new Ue(e.query, n.value ? $e : null));
|
|
423
424
|
return e;
|
|
424
425
|
},
|
|
425
|
-
provide: (e) =>
|
|
426
|
+
provide: (e) => oe.from(e, (e) => e.panel)
|
|
426
427
|
}), Ue = class {
|
|
427
428
|
constructor(e, t) {
|
|
428
429
|
this.query = e, this.panel = t;
|
|
429
430
|
}
|
|
430
|
-
}, We = /*@__PURE__*/
|
|
431
|
+
}, We = /*@__PURE__*/ y.mark({ class: "cm-searchMatch" }), Ge = /*@__PURE__*/ y.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Ke = /*@__PURE__*/ re.fromClass(class {
|
|
431
432
|
constructor(e) {
|
|
432
433
|
this.view = e, this.decorations = this.highlight(e.state.field(Z));
|
|
433
434
|
}
|
|
@@ -436,8 +437,8 @@ var Ve = class extends Pe {
|
|
|
436
437
|
(t != e.startState.field(Z) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
|
|
437
438
|
}
|
|
438
439
|
highlight({ query: e, panel: t }) {
|
|
439
|
-
if (!t || !e.spec.valid) return
|
|
440
|
-
let { view: n } = this, r = new
|
|
440
|
+
if (!t || !e.spec.valid) return y.none;
|
|
441
|
+
let { view: n } = this, r = new l();
|
|
441
442
|
for (let t = 0, i = n.visibleRanges, a = i.length; t < a; t++) {
|
|
442
443
|
let { from: o, to: s } = i[t];
|
|
443
444
|
for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
|
|
@@ -458,7 +459,7 @@ function Q(e) {
|
|
|
458
459
|
var qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
459
460
|
let { to: n } = e.state.selection.main, r = t.nextMatch(e.state, n, n);
|
|
460
461
|
if (!r) return !1;
|
|
461
|
-
let i =
|
|
462
|
+
let i = A.single(r.from, r.to), a = e.state.facet(q);
|
|
462
463
|
return e.dispatch({
|
|
463
464
|
selection: i,
|
|
464
465
|
effects: [lt(e, r), a.scrollToMatch(i.main, e)],
|
|
@@ -467,7 +468,7 @@ var qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
|
467
468
|
}), Je = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
468
469
|
let { state: n } = e, { from: r } = n.selection.main, i = t.prevMatch(n, r, r);
|
|
469
470
|
if (!i) return !1;
|
|
470
|
-
let a =
|
|
471
|
+
let a = A.single(i.from, i.to), o = e.state.facet(q);
|
|
471
472
|
return e.dispatch({
|
|
472
473
|
selection: a,
|
|
473
474
|
effects: [lt(e, i), o.scrollToMatch(a.main, e)],
|
|
@@ -476,36 +477,36 @@ var qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
|
476
477
|
}), Ye = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
477
478
|
let n = t.matchAll(e.state, 1e3);
|
|
478
479
|
return !n || !n.length ? !1 : (e.dispatch({
|
|
479
|
-
selection:
|
|
480
|
+
selection: A.create(n.map((e) => A.range(e.from, e.to))),
|
|
480
481
|
userEvent: "select.search.matches"
|
|
481
482
|
}), !0);
|
|
482
483
|
}), Xe = ({ state: e, dispatch: t }) => {
|
|
483
484
|
let n = e.selection;
|
|
484
485
|
if (n.ranges.length > 1 || n.main.empty) return !1;
|
|
485
486
|
let { from: r, to: i } = n.main, a = [], o = 0;
|
|
486
|
-
for (let t = new
|
|
487
|
+
for (let t = new G(e.doc, e.sliceDoc(r, i)); !t.next().done;) {
|
|
487
488
|
if (a.length > 1e3) return !1;
|
|
488
|
-
t.value.from == r && (o = a.length), a.push(
|
|
489
|
+
t.value.from == r && (o = a.length), a.push(A.range(t.value.from, t.value.to));
|
|
489
490
|
}
|
|
490
491
|
return t(e.update({
|
|
491
|
-
selection:
|
|
492
|
+
selection: A.create(a, o),
|
|
492
493
|
userEvent: "select.search.matches"
|
|
493
494
|
})), !0;
|
|
494
495
|
}, Ze = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
495
|
-
let { state: n } = e, { from:
|
|
496
|
+
let { state: n } = e, { from: i, to: a } = n.selection.main;
|
|
496
497
|
if (n.readOnly) return !1;
|
|
497
|
-
let
|
|
498
|
-
if (!
|
|
499
|
-
let
|
|
500
|
-
|
|
501
|
-
from:
|
|
502
|
-
to:
|
|
503
|
-
insert:
|
|
504
|
-
}),
|
|
505
|
-
let f = e.state.changes(
|
|
506
|
-
return
|
|
498
|
+
let o = t.nextMatch(n, i, i);
|
|
499
|
+
if (!o) return !1;
|
|
500
|
+
let s = o, c = [], l, u, d = [];
|
|
501
|
+
s.precise ? s.from == i && s.to == a && (u = n.toText(t.getReplacement(s)), c.push({
|
|
502
|
+
from: s.from,
|
|
503
|
+
to: s.to,
|
|
504
|
+
insert: u
|
|
505
|
+
}), s = t.nextMatch(n, s.from, s.to), d.push(r.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(i).number) + "."))) : s = t.nextMatch(n, s.from, s.to);
|
|
506
|
+
let f = e.state.changes(c);
|
|
507
|
+
return s && (l = A.single(s.from, s.to).map(f), d.push(lt(e, s)), d.push(n.facet(q).scrollToMatch(l.main, e))), e.dispatch({
|
|
507
508
|
changes: f,
|
|
508
|
-
selection:
|
|
509
|
+
selection: l,
|
|
509
510
|
effects: d,
|
|
510
511
|
userEvent: "input.replace"
|
|
511
512
|
}), !0;
|
|
@@ -521,21 +522,21 @@ var qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
|
521
522
|
});
|
|
522
523
|
}
|
|
523
524
|
if (!n.length) return !1;
|
|
524
|
-
let
|
|
525
|
+
let i = e.state.phrase("replaced $ matches", n.length) + ".";
|
|
525
526
|
return e.dispatch({
|
|
526
527
|
changes: n,
|
|
527
|
-
effects:
|
|
528
|
+
effects: r.announce.of(i),
|
|
528
529
|
userEvent: "input.replace.all"
|
|
529
530
|
}), !0;
|
|
530
531
|
});
|
|
531
532
|
function $e(e) {
|
|
532
|
-
return e.state.facet(
|
|
533
|
+
return e.state.facet(q).createPanel(e);
|
|
533
534
|
}
|
|
534
535
|
function et(e, t) {
|
|
535
536
|
let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
|
|
536
537
|
if (t && !r) return t;
|
|
537
|
-
let i = e.facet(
|
|
538
|
-
return new
|
|
538
|
+
let i = e.facet(q);
|
|
539
|
+
return new Me({
|
|
539
540
|
search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
|
|
540
541
|
caseSensitive: t?.caseSensitive ?? i.caseSensitive,
|
|
541
542
|
literal: t?.literal ?? i.literal,
|
|
@@ -544,7 +545,7 @@ function et(e, t) {
|
|
|
544
545
|
});
|
|
545
546
|
}
|
|
546
547
|
function tt(e) {
|
|
547
|
-
let t =
|
|
548
|
+
let t = N(e, $e);
|
|
548
549
|
return t && t.dom.querySelector("[main-field]");
|
|
549
550
|
}
|
|
550
551
|
function nt(e) {
|
|
@@ -559,12 +560,12 @@ var rt = (e) => {
|
|
|
559
560
|
let r = et(e.state, t.query.spec);
|
|
560
561
|
r.valid && e.dispatch({ effects: X.of(r) }), n.focus(), n.select();
|
|
561
562
|
}
|
|
562
|
-
} else e.dispatch({ effects: [He.of(!0), t ? X.of(et(e.state, t.query.spec)) :
|
|
563
|
+
} else e.dispatch({ effects: [He.of(!0), t ? X.of(et(e.state, t.query.spec)) : m.appendConfig.of(dt)] });
|
|
563
564
|
return !0;
|
|
564
565
|
}, it = (e) => {
|
|
565
566
|
let t = e.state.field(Z, !1);
|
|
566
567
|
if (!t || !t.panel) return !1;
|
|
567
|
-
let n =
|
|
568
|
+
let n = N(e, $e);
|
|
568
569
|
return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: He.of(!1) }), !0;
|
|
569
570
|
}, at = [
|
|
570
571
|
{
|
|
@@ -597,18 +598,18 @@ var rt = (e) => {
|
|
|
597
598
|
},
|
|
598
599
|
{
|
|
599
600
|
key: "Mod-Alt-g",
|
|
600
|
-
run:
|
|
601
|
+
run: ye
|
|
601
602
|
},
|
|
602
603
|
{
|
|
603
604
|
key: "Mod-d",
|
|
604
|
-
run:
|
|
605
|
+
run: je,
|
|
605
606
|
preventDefault: !0
|
|
606
607
|
}
|
|
607
608
|
], ot = class {
|
|
608
609
|
constructor(e) {
|
|
609
610
|
this.view = e;
|
|
610
611
|
let t = this.query = e.state.field(Z).query.spec;
|
|
611
|
-
this.commit = this.commit.bind(this), this.searchField =
|
|
612
|
+
this.commit = this.commit.bind(this), this.searchField = o("input", {
|
|
612
613
|
value: t.search,
|
|
613
614
|
placeholder: $(e, "Find"),
|
|
614
615
|
"aria-label": $(e, "Find"),
|
|
@@ -618,7 +619,7 @@ var rt = (e) => {
|
|
|
618
619
|
"main-field": "true",
|
|
619
620
|
onchange: this.commit,
|
|
620
621
|
onkeyup: this.commit
|
|
621
|
-
}), this.replaceField =
|
|
622
|
+
}), this.replaceField = o("input", {
|
|
622
623
|
value: t.replace,
|
|
623
624
|
placeholder: $(e, "Replace"),
|
|
624
625
|
"aria-label": $(e, "Replace"),
|
|
@@ -627,19 +628,19 @@ var rt = (e) => {
|
|
|
627
628
|
form: "",
|
|
628
629
|
onchange: this.commit,
|
|
629
630
|
onkeyup: this.commit
|
|
630
|
-
}), this.caseField =
|
|
631
|
+
}), this.caseField = o("input", {
|
|
631
632
|
type: "checkbox",
|
|
632
633
|
name: "case",
|
|
633
634
|
form: "",
|
|
634
635
|
checked: t.caseSensitive,
|
|
635
636
|
onchange: this.commit
|
|
636
|
-
}), this.reField =
|
|
637
|
+
}), this.reField = o("input", {
|
|
637
638
|
type: "checkbox",
|
|
638
639
|
name: "re",
|
|
639
640
|
form: "",
|
|
640
641
|
checked: t.regexp,
|
|
641
642
|
onchange: this.commit
|
|
642
|
-
}), this.wordField =
|
|
643
|
+
}), this.wordField = o("input", {
|
|
643
644
|
type: "checkbox",
|
|
644
645
|
name: "word",
|
|
645
646
|
form: "",
|
|
@@ -647,14 +648,14 @@ var rt = (e) => {
|
|
|
647
648
|
onchange: this.commit
|
|
648
649
|
});
|
|
649
650
|
function n(e, t, n) {
|
|
650
|
-
return
|
|
651
|
+
return o("button", {
|
|
651
652
|
class: "cm-button",
|
|
652
653
|
name: e,
|
|
653
654
|
onclick: t,
|
|
654
655
|
type: "button"
|
|
655
656
|
}, n);
|
|
656
657
|
}
|
|
657
|
-
this.dom =
|
|
658
|
+
this.dom = o("div", {
|
|
658
659
|
onkeydown: (e) => this.keydown(e),
|
|
659
660
|
class: "cm-search"
|
|
660
661
|
}, [
|
|
@@ -662,16 +663,16 @@ var rt = (e) => {
|
|
|
662
663
|
n("next", () => qe(e), [$(e, "next")]),
|
|
663
664
|
n("prev", () => Je(e), [$(e, "previous")]),
|
|
664
665
|
n("select", () => Ye(e), [$(e, "all")]),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
o("label", null, [this.caseField, $(e, "match case")]),
|
|
667
|
+
o("label", null, [this.reField, $(e, "regexp")]),
|
|
668
|
+
o("label", null, [this.wordField, $(e, "by word")]),
|
|
668
669
|
...e.state.readOnly ? [] : [
|
|
669
|
-
|
|
670
|
+
o("br"),
|
|
670
671
|
this.replaceField,
|
|
671
672
|
n("replace", () => Ze(e), [$(e, "replace")]),
|
|
672
673
|
n("replaceAll", () => Qe(e), [$(e, "replace all")])
|
|
673
674
|
],
|
|
674
|
-
|
|
675
|
+
o("button", {
|
|
675
676
|
name: "close",
|
|
676
677
|
onclick: () => it(e),
|
|
677
678
|
"aria-label": $(e, "close"),
|
|
@@ -680,7 +681,7 @@ var rt = (e) => {
|
|
|
680
681
|
]);
|
|
681
682
|
}
|
|
682
683
|
commit() {
|
|
683
|
-
let e = new
|
|
684
|
+
let e = new Me({
|
|
684
685
|
search: this.searchField.value,
|
|
685
686
|
caseSensitive: this.caseField.checked,
|
|
686
687
|
regexp: this.reField.checked,
|
|
@@ -690,7 +691,7 @@ var rt = (e) => {
|
|
|
690
691
|
e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: X.of(e) }));
|
|
691
692
|
}
|
|
692
693
|
keydown(e) {
|
|
693
|
-
|
|
694
|
+
I(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? Je : qe)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Ze(this.view));
|
|
694
695
|
}
|
|
695
696
|
update(e) {
|
|
696
697
|
for (let t of e.transactions) for (let e of t.effects) e.is(X) && !e.value.eq(this.query) && this.setQuery(e.value);
|
|
@@ -705,7 +706,7 @@ var rt = (e) => {
|
|
|
705
706
|
return 80;
|
|
706
707
|
}
|
|
707
708
|
get top() {
|
|
708
|
-
return this.view.state.facet(
|
|
709
|
+
return this.view.state.facet(q).top;
|
|
709
710
|
}
|
|
710
711
|
};
|
|
711
712
|
function $(e, t) {
|
|
@@ -713,22 +714,22 @@ function $(e, t) {
|
|
|
713
714
|
}
|
|
714
715
|
var st = 30, ct = /[\s\.,:;?!]/;
|
|
715
716
|
function lt(e, { from: t, to: n }) {
|
|
716
|
-
let
|
|
717
|
-
if (
|
|
718
|
-
for (let e = 0; e < st; e++) if (!ct.test(
|
|
719
|
-
|
|
717
|
+
let i = e.state.doc.lineAt(t), a = e.state.doc.lineAt(n).to, o = Math.max(i.from, t - st), s = Math.min(a, n + st), c = e.state.sliceDoc(o, s);
|
|
718
|
+
if (o != i.from) {
|
|
719
|
+
for (let e = 0; e < st; e++) if (!ct.test(c[e + 1]) && ct.test(c[e])) {
|
|
720
|
+
c = c.slice(e);
|
|
720
721
|
break;
|
|
721
722
|
}
|
|
722
723
|
}
|
|
723
|
-
if (
|
|
724
|
-
for (let e =
|
|
725
|
-
|
|
724
|
+
if (s != a) {
|
|
725
|
+
for (let e = c.length - 1; e > c.length - st; e--) if (!ct.test(c[e - 1]) && ct.test(c[e])) {
|
|
726
|
+
c = c.slice(0, e);
|
|
726
727
|
break;
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
|
-
return
|
|
730
|
+
return r.announce.of(`${e.state.phrase("current match")}. ${c} ${e.state.phrase("on line")} ${i.number}.`);
|
|
730
731
|
}
|
|
731
|
-
var ut = /*@__PURE__*/
|
|
732
|
+
var ut = /*@__PURE__*/ r.baseTheme({
|
|
732
733
|
".cm-panel.cm-search": {
|
|
733
734
|
padding: "2px 6px 4px",
|
|
734
735
|
position: "relative",
|
|
@@ -755,21 +756,21 @@ var ut = /*@__PURE__*/ u.baseTheme({
|
|
|
755
756
|
"&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
|
|
756
757
|
}), dt = [
|
|
757
758
|
Z,
|
|
758
|
-
/*@__PURE__*/
|
|
759
|
+
/*@__PURE__*/ h.low(Ke),
|
|
759
760
|
ut
|
|
760
761
|
], ft = function(e) {
|
|
761
762
|
e === void 0 && (e = {});
|
|
762
|
-
var t = e.crosshairCursor, n = t !== void 0 && t,
|
|
763
|
-
e.closeBracketsKeymap !== !1 && (
|
|
763
|
+
var t = e.crosshairCursor, n = t !== void 0 && t, r = [];
|
|
764
|
+
e.closeBracketsKeymap !== !1 && (r = r.concat(H)), e.defaultKeymap !== !1 && (r = r.concat(L)), e.searchKeymap !== !1 && (r = r.concat(at)), e.historyKeymap !== !1 && (r = r.concat(R)), e.foldKeymap !== !1 && (r = r.concat(a)), e.completionKeymap !== !1 && (r = r.concat(se)), e.lintKeymap !== !1 && (r = r.concat(B));
|
|
764
765
|
var o = [];
|
|
765
|
-
return e.lineNumbers !== !1 && o.push(
|
|
766
|
+
return e.lineNumbers !== !1 && o.push(T()), e.highlightActiveLineGutter !== !1 && o.push(S()), e.highlightSpecialChars !== !1 && o.push(C()), e.history !== !1 && o.push(V()), e.foldGutter !== !1 && o.push(ae()), e.drawSelection !== !1 && o.push(b()), e.dropCursor !== !1 && o.push(M()), e.allowMultipleSelections !== !1 && o.push(i.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && o.push(k()), e.syntaxHighlighting !== !1 && o.push(c(w, { fallback: !0 })), e.bracketMatching !== !1 && o.push(ne()), e.closeBrackets !== !1 && o.push(ce()), e.autocompletion !== !1 && o.push(le()), e.rectangularSelection !== !1 && o.push(ie()), n !== !1 && o.push(E()), e.highlightActiveLine !== !1 && o.push(P()), e.highlightSelectionMatches !== !1 && o.push(Se()), e.tabSize && typeof e.tabSize == "number" && o.push(D.of(" ".repeat(e.tabSize))), o.concat([j.of(r.flat())]).filter(Boolean);
|
|
766
767
|
}, pt = function(e) {
|
|
767
768
|
e === void 0 && (e = {});
|
|
768
769
|
var t = [];
|
|
769
|
-
e.defaultKeymap !== !1 && (t = t.concat(
|
|
770
|
+
e.defaultKeymap !== !1 && (t = t.concat(L)), e.historyKeymap !== !1 && (t = t.concat(R));
|
|
770
771
|
var n = [];
|
|
771
|
-
return e.highlightSpecialChars !== !1 && n.push(
|
|
772
|
-
}, mt = "#e5c07b", ht = "#e06c75", gt = "#56b6c2", _t = "#ffffff", vt = "#abb2bf", yt = "#7d8799", bt = "#61afef", xt = "#98c379", St = "#d19a66", Ct = "#c678dd", wt = "#21252b", Tt = "#2c313a", Et = "#282c34", Dt = "#353a42", Ot = "#3E4451", kt = "#528bff", At = /*@__PURE__*/
|
|
772
|
+
return e.highlightSpecialChars !== !1 && n.push(C()), e.history !== !1 && n.push(V()), e.drawSelection !== !1 && n.push(b()), e.syntaxHighlighting !== !1 && n.push(c(w, { fallback: !0 })), n.concat([j.of(t.flat())]).filter(Boolean);
|
|
773
|
+
}, mt = "#e5c07b", ht = "#e06c75", gt = "#56b6c2", _t = "#ffffff", vt = "#abb2bf", yt = "#7d8799", bt = "#61afef", xt = "#98c379", St = "#d19a66", Ct = "#c678dd", wt = "#21252b", Tt = "#2c313a", Et = "#282c34", Dt = "#353a42", Ot = "#3E4451", kt = "#528bff", At = /*@__PURE__*/ r.theme({
|
|
773
774
|
"&": {
|
|
774
775
|
color: vt,
|
|
775
776
|
backgroundColor: Et
|
|
@@ -818,122 +819,122 @@ var ut = /*@__PURE__*/ u.baseTheme({
|
|
|
818
819
|
backgroundColor: Tt,
|
|
819
820
|
color: vt
|
|
820
821
|
} }
|
|
821
|
-
}, { dark: !0 }), jt = /*@__PURE__*/
|
|
822
|
+
}, { dark: !0 }), jt = /*@__PURE__*/ te.define([
|
|
822
823
|
{
|
|
823
|
-
tag:
|
|
824
|
+
tag: d.keyword,
|
|
824
825
|
color: Ct
|
|
825
826
|
},
|
|
826
827
|
{
|
|
827
828
|
tag: [
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
829
|
+
d.name,
|
|
830
|
+
d.deleted,
|
|
831
|
+
d.character,
|
|
832
|
+
d.propertyName,
|
|
833
|
+
d.macroName
|
|
833
834
|
],
|
|
834
835
|
color: ht
|
|
835
836
|
},
|
|
836
837
|
{
|
|
837
|
-
tag: [/*@__PURE__*/
|
|
838
|
+
tag: [/*@__PURE__*/ d.function(d.variableName), d.labelName],
|
|
838
839
|
color: bt
|
|
839
840
|
},
|
|
840
841
|
{
|
|
841
842
|
tag: [
|
|
842
|
-
|
|
843
|
-
/*@__PURE__*/
|
|
844
|
-
/*@__PURE__*/
|
|
843
|
+
d.color,
|
|
844
|
+
/*@__PURE__*/ d.constant(d.name),
|
|
845
|
+
/*@__PURE__*/ d.standard(d.name)
|
|
845
846
|
],
|
|
846
847
|
color: St
|
|
847
848
|
},
|
|
848
849
|
{
|
|
849
|
-
tag: [/*@__PURE__*/
|
|
850
|
+
tag: [/*@__PURE__*/ d.definition(d.name), d.separator],
|
|
850
851
|
color: vt
|
|
851
852
|
},
|
|
852
853
|
{
|
|
853
854
|
tag: [
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
855
|
+
d.typeName,
|
|
856
|
+
d.className,
|
|
857
|
+
d.number,
|
|
858
|
+
d.changed,
|
|
859
|
+
d.annotation,
|
|
860
|
+
d.modifier,
|
|
861
|
+
d.self,
|
|
862
|
+
d.namespace
|
|
862
863
|
],
|
|
863
864
|
color: mt
|
|
864
865
|
},
|
|
865
866
|
{
|
|
866
867
|
tag: [
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
/*@__PURE__*/
|
|
868
|
+
d.operator,
|
|
869
|
+
d.operatorKeyword,
|
|
870
|
+
d.url,
|
|
871
|
+
d.escape,
|
|
872
|
+
d.regexp,
|
|
873
|
+
d.link,
|
|
874
|
+
/*@__PURE__*/ d.special(d.string)
|
|
874
875
|
],
|
|
875
876
|
color: gt
|
|
876
877
|
},
|
|
877
878
|
{
|
|
878
|
-
tag: [
|
|
879
|
+
tag: [d.meta, d.comment],
|
|
879
880
|
color: yt
|
|
880
881
|
},
|
|
881
882
|
{
|
|
882
|
-
tag:
|
|
883
|
+
tag: d.strong,
|
|
883
884
|
fontWeight: "bold"
|
|
884
885
|
},
|
|
885
886
|
{
|
|
886
|
-
tag:
|
|
887
|
+
tag: d.emphasis,
|
|
887
888
|
fontStyle: "italic"
|
|
888
889
|
},
|
|
889
890
|
{
|
|
890
|
-
tag:
|
|
891
|
+
tag: d.strikethrough,
|
|
891
892
|
textDecoration: "line-through"
|
|
892
893
|
},
|
|
893
894
|
{
|
|
894
|
-
tag:
|
|
895
|
+
tag: d.link,
|
|
895
896
|
color: yt,
|
|
896
897
|
textDecoration: "underline"
|
|
897
898
|
},
|
|
898
899
|
{
|
|
899
|
-
tag:
|
|
900
|
+
tag: d.heading,
|
|
900
901
|
fontWeight: "bold",
|
|
901
902
|
color: ht
|
|
902
903
|
},
|
|
903
904
|
{
|
|
904
905
|
tag: [
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
/*@__PURE__*/
|
|
906
|
+
d.atom,
|
|
907
|
+
d.bool,
|
|
908
|
+
/*@__PURE__*/ d.special(d.variableName)
|
|
908
909
|
],
|
|
909
910
|
color: St
|
|
910
911
|
},
|
|
911
912
|
{
|
|
912
913
|
tag: [
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
d.processingInstruction,
|
|
915
|
+
d.string,
|
|
916
|
+
d.inserted
|
|
916
917
|
],
|
|
917
918
|
color: xt
|
|
918
919
|
},
|
|
919
920
|
{
|
|
920
|
-
tag:
|
|
921
|
+
tag: d.invalid,
|
|
921
922
|
color: _t
|
|
922
923
|
}
|
|
923
|
-
]), Mt = [At, /*@__PURE__*/
|
|
924
|
+
]), Mt = [At, /*@__PURE__*/ c(jt)], Nt = r.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Pt = function(e) {
|
|
924
925
|
e === void 0 && (e = {});
|
|
925
|
-
var t = e, n = t.indentWithTab,
|
|
926
|
-
switch (
|
|
926
|
+
var t = e, n = t.indentWithTab, a = n === void 0 || n, o = t.editable, s = o === void 0 || o, c = t.readOnly, l = c !== void 0 && c, u = t.theme, d = u === void 0 ? "light" : u, f = t.placeholder, p = f === void 0 ? "" : f, m = t.basicSetup, h = m === void 0 || m, g = [];
|
|
927
|
+
switch (a && g.unshift(j.of([z])), h && (typeof h == "boolean" ? g.unshift(ft()) : g.unshift(ft(h))), p && g.unshift(ee(p)), d) {
|
|
927
928
|
case "light":
|
|
928
|
-
|
|
929
|
+
g.push(Nt);
|
|
929
930
|
break;
|
|
930
931
|
case "dark":
|
|
931
|
-
|
|
932
|
+
g.push(Mt);
|
|
932
933
|
break;
|
|
933
934
|
case "none": break;
|
|
934
|
-
default:
|
|
935
|
+
default: g.push(d);
|
|
935
936
|
}
|
|
936
|
-
return
|
|
937
|
+
return s === !1 && g.push(r.editable.of(!1)), l && g.push(i.readOnly.of(!0)), [...g];
|
|
937
938
|
}, Ft = (e) => ({
|
|
938
939
|
line: e.state.doc.lineAt(e.state.selection.main.from),
|
|
939
940
|
lineCount: e.state.doc.lines,
|
|
@@ -993,99 +994,99 @@ var ut = /*@__PURE__*/ u.baseTheme({
|
|
|
993
994
|
stop() {
|
|
994
995
|
this.interval !== null && (clearInterval(this.interval), this.interval = null);
|
|
995
996
|
}
|
|
996
|
-
}, Rt = null, zt = () => typeof window > "u" ? new Lt() : (Rt ||= new Lt(), Rt), Bt =
|
|
997
|
-
function Ut(e, t, n,
|
|
998
|
-
if (!e && !t && !n && !
|
|
999
|
-
var
|
|
997
|
+
}, Rt = null, zt = () => typeof window > "u" ? new Lt() : (Rt ||= new Lt(), Rt), Bt = r.theme({ "& .cm-scroller": { height: "100% !important" } }), Vt = null, Ht = null;
|
|
998
|
+
function Ut(e, t, n, i, a, o) {
|
|
999
|
+
if (!e && !t && !n && !i && !a && !o) return null;
|
|
1000
|
+
var s = JSON.stringify({
|
|
1000
1001
|
height: e,
|
|
1001
1002
|
minHeight: t,
|
|
1002
1003
|
maxHeight: n,
|
|
1003
|
-
width:
|
|
1004
|
-
minWidth:
|
|
1005
|
-
maxWidth:
|
|
1004
|
+
width: i,
|
|
1005
|
+
minWidth: a,
|
|
1006
|
+
maxWidth: o
|
|
1006
1007
|
});
|
|
1007
|
-
return
|
|
1008
|
+
return s === Vt ? Ht : (Vt = s, Ht = r.theme({ "&": {
|
|
1008
1009
|
height: e,
|
|
1009
1010
|
minHeight: t,
|
|
1010
1011
|
maxHeight: n,
|
|
1011
|
-
width:
|
|
1012
|
-
minWidth:
|
|
1013
|
-
maxWidth:
|
|
1012
|
+
width: i,
|
|
1013
|
+
minWidth: a,
|
|
1014
|
+
maxWidth: o
|
|
1014
1015
|
} }), Ht);
|
|
1015
1016
|
}
|
|
1016
1017
|
//#endregion
|
|
1017
1018
|
//#region ../node_modules/.pnpm/@uiw+react-codemirror@4.25.11_@babel+runtime@7.27.6_@codemirror+autocomplete@6.20.3_@co_623c1289eb80a5520a7e784eefdad0eb/node_modules/@uiw/react-codemirror/esm/useCodeMirror.js
|
|
1018
|
-
var Wt =
|
|
1019
|
+
var Wt = F.define(), Gt = 200, Kt = [];
|
|
1019
1020
|
function qt(e) {
|
|
1020
|
-
var t = e.value, n = e.selection,
|
|
1021
|
-
e.docChanged && typeof
|
|
1022
|
-
if (
|
|
1023
|
-
var e =
|
|
1024
|
-
|
|
1021
|
+
var t = e.value, n = e.selection, a = e.onChange, o = e.onStatistics, s = e.onCreateEditor, c = e.onUpdate, l = e.extensions, u = l === void 0 ? Kt : l, d = e.autoFocus, f = e.theme, p = f === void 0 ? "light" : f, h = e.height, g = h === void 0 ? null : h, _ = e.minHeight, v = _ === void 0 ? null : _, y = e.maxHeight, ee = y === void 0 ? null : y, te = e.width, b = te === void 0 ? null : te, x = e.minWidth, S = x === void 0 ? null : x, C = e.maxWidth, w = C === void 0 ? null : C, T = e.placeholder, E = T === void 0 ? "" : T, D = e.editable, O = D === void 0 || D, k = e.readOnly, A = k !== void 0 && k, j = e.indentWithTab, M = j === void 0 || j, ne = e.basicSetup, N = ne === void 0 || ne, re = e.root, P = e.initialState, ie = (0, W.useState)(), F = ie[0], ae = ie[1], oe = (0, W.useState)(), I = oe[0], L = oe[1], R = (0, W.useState)(), z = R[0], B = R[1], V = (0, W.useState)(() => ({ current: null }))[0], H = (0, W.useState)(() => ({ current: null }))[0], se = Ut(g, v, ee, b, S, w), ce = r.updateListener.of((e) => {
|
|
1022
|
+
e.docChanged && typeof a == "function" && !e.transactions.some((e) => e.annotation(Wt)) && (V.current ? V.current.reset() : (V.current = new It(() => {
|
|
1023
|
+
if (H.current) {
|
|
1024
|
+
var e = H.current;
|
|
1025
|
+
H.current = null, e();
|
|
1025
1026
|
}
|
|
1026
|
-
|
|
1027
|
-
}, Gt), zt().add(
|
|
1028
|
-
}),
|
|
1027
|
+
V.current = null;
|
|
1028
|
+
}, Gt), zt().add(V.current)), a(e.state.doc.toString(), e)), o && o(Ft(e));
|
|
1029
|
+
}), le = Pt({
|
|
1029
1030
|
theme: p,
|
|
1030
|
-
editable:
|
|
1031
|
-
readOnly:
|
|
1032
|
-
placeholder:
|
|
1033
|
-
indentWithTab:
|
|
1034
|
-
basicSetup:
|
|
1035
|
-
}),
|
|
1036
|
-
|
|
1037
|
-
...
|
|
1031
|
+
editable: O,
|
|
1032
|
+
readOnly: A,
|
|
1033
|
+
placeholder: E,
|
|
1034
|
+
indentWithTab: M,
|
|
1035
|
+
basicSetup: N
|
|
1036
|
+
}), U = [
|
|
1037
|
+
ce,
|
|
1038
|
+
...se ? [se] : [],
|
|
1038
1039
|
Bt,
|
|
1039
|
-
...
|
|
1040
|
+
...le
|
|
1040
1041
|
];
|
|
1041
|
-
return
|
|
1042
|
-
if (F && !
|
|
1042
|
+
return c && typeof c == "function" && U.push(r.updateListener.of(c)), U = U.concat(u), (0, W.useLayoutEffect)(() => {
|
|
1043
|
+
if (F && !z) {
|
|
1043
1044
|
var e = {
|
|
1044
1045
|
doc: t,
|
|
1045
1046
|
selection: n,
|
|
1046
|
-
extensions:
|
|
1047
|
-
},
|
|
1048
|
-
if (
|
|
1049
|
-
var
|
|
1050
|
-
state:
|
|
1047
|
+
extensions: U
|
|
1048
|
+
}, a = P ? i.fromJSON(P.json, e, P.fields) : i.create(e);
|
|
1049
|
+
if (B(a), !I) {
|
|
1050
|
+
var o = new r({
|
|
1051
|
+
state: a,
|
|
1051
1052
|
parent: F,
|
|
1052
|
-
root:
|
|
1053
|
+
root: re
|
|
1053
1054
|
});
|
|
1054
|
-
L(
|
|
1055
|
+
L(o), s && s(o, a);
|
|
1055
1056
|
}
|
|
1056
1057
|
}
|
|
1057
1058
|
return () => {
|
|
1058
|
-
I && (
|
|
1059
|
+
I && (B(void 0), L(void 0));
|
|
1059
1060
|
};
|
|
1060
|
-
}, [F,
|
|
1061
|
+
}, [F, z]), (0, W.useEffect)(() => {
|
|
1061
1062
|
e.container && ae(e.container);
|
|
1062
|
-
}, [e.container]), (0,
|
|
1063
|
-
I && (I.destroy(), L(void 0)),
|
|
1064
|
-
}, [I]), (0,
|
|
1065
|
-
|
|
1066
|
-
}, [
|
|
1067
|
-
I && I.dispatch({ effects:
|
|
1063
|
+
}, [e.container]), (0, W.useEffect)(() => () => {
|
|
1064
|
+
I && (I.destroy(), L(void 0)), V.current &&= (V.current.cancel(), null);
|
|
1065
|
+
}, [I]), (0, W.useEffect)(() => {
|
|
1066
|
+
d && I && I.focus();
|
|
1067
|
+
}, [d, I]), (0, W.useEffect)(() => {
|
|
1068
|
+
I && I.dispatch({ effects: m.reconfigure.of(U) });
|
|
1068
1069
|
}, [
|
|
1069
1070
|
p,
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1071
|
+
u,
|
|
1072
|
+
g,
|
|
1073
|
+
v,
|
|
1073
1074
|
ee,
|
|
1074
1075
|
b,
|
|
1075
1076
|
S,
|
|
1076
|
-
C,
|
|
1077
1077
|
w,
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1078
|
+
E,
|
|
1079
|
+
O,
|
|
1080
|
+
A,
|
|
1081
|
+
M,
|
|
1082
|
+
N,
|
|
1083
|
+
a,
|
|
1084
|
+
c
|
|
1085
|
+
]), (0, W.useEffect)(() => {
|
|
1085
1086
|
if (t !== void 0) {
|
|
1086
1087
|
var e = I ? I.state.doc.toString() : "";
|
|
1087
1088
|
if (I && t !== e) {
|
|
1088
|
-
var n =
|
|
1089
|
+
var n = V.current && !V.current.isDone, r = () => {
|
|
1089
1090
|
I && t !== I.state.doc.toString() && I.dispatch({
|
|
1090
1091
|
changes: {
|
|
1091
1092
|
from: 0,
|
|
@@ -1095,12 +1096,12 @@ function qt(e) {
|
|
|
1095
1096
|
annotations: [Wt.of(!0)]
|
|
1096
1097
|
});
|
|
1097
1098
|
};
|
|
1098
|
-
n ?
|
|
1099
|
+
n ? H.current = r : r();
|
|
1099
1100
|
}
|
|
1100
1101
|
}
|
|
1101
1102
|
}, [t, I]), {
|
|
1102
|
-
state:
|
|
1103
|
-
setState:
|
|
1103
|
+
state: z,
|
|
1104
|
+
setState: B,
|
|
1104
1105
|
view: I,
|
|
1105
1106
|
setView: L,
|
|
1106
1107
|
container: F,
|
|
@@ -1133,50 +1134,50 @@ var Jt = n(), Yt = [
|
|
|
1133
1134
|
"readOnly",
|
|
1134
1135
|
"root",
|
|
1135
1136
|
"initialState"
|
|
1136
|
-
], Xt = /*#__PURE__*/ (0,
|
|
1137
|
-
var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection,
|
|
1137
|
+
], Xt = /*#__PURE__*/ (0, W.forwardRef)((e, t) => {
|
|
1138
|
+
var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, o = e.extensions, s = o === void 0 ? [] : o, c = e.onChange, l = e.onStatistics, u = e.onCreateEditor, d = e.onUpdate, f = e.autoFocus, p = e.theme, m = p === void 0 ? "light" : p, h = e.height, g = e.minHeight, _ = e.maxHeight, v = e.width, y = e.minWidth, ee = e.maxWidth, te = e.basicSetup, b = e.placeholder, x = e.indentWithTab, S = e.editable, C = e.readOnly, w = e.root, T = e.initialState, E = ue(e, Yt), D = (0, W.useRef)(null), O = qt({
|
|
1138
1139
|
root: w,
|
|
1139
1140
|
value: i,
|
|
1140
|
-
autoFocus:
|
|
1141
|
-
theme:
|
|
1142
|
-
height:
|
|
1143
|
-
minHeight:
|
|
1144
|
-
maxHeight:
|
|
1145
|
-
width:
|
|
1141
|
+
autoFocus: f,
|
|
1142
|
+
theme: m,
|
|
1143
|
+
height: h,
|
|
1144
|
+
minHeight: g,
|
|
1145
|
+
maxHeight: _,
|
|
1146
|
+
width: v,
|
|
1146
1147
|
minWidth: y,
|
|
1147
|
-
maxWidth:
|
|
1148
|
-
basicSetup:
|
|
1149
|
-
placeholder:
|
|
1150
|
-
indentWithTab:
|
|
1151
|
-
editable:
|
|
1152
|
-
readOnly:
|
|
1148
|
+
maxWidth: ee,
|
|
1149
|
+
basicSetup: te,
|
|
1150
|
+
placeholder: b,
|
|
1151
|
+
indentWithTab: x,
|
|
1152
|
+
editable: S,
|
|
1153
|
+
readOnly: C,
|
|
1153
1154
|
selection: a,
|
|
1154
|
-
onChange:
|
|
1155
|
-
onStatistics:
|
|
1156
|
-
onCreateEditor:
|
|
1157
|
-
onUpdate:
|
|
1158
|
-
extensions:
|
|
1155
|
+
onChange: c,
|
|
1156
|
+
onStatistics: l,
|
|
1157
|
+
onCreateEditor: u,
|
|
1158
|
+
onUpdate: d,
|
|
1159
|
+
extensions: s,
|
|
1159
1160
|
initialState: T
|
|
1160
|
-
}),
|
|
1161
|
-
(0,
|
|
1162
|
-
editor:
|
|
1163
|
-
state:
|
|
1164
|
-
view:
|
|
1161
|
+
}), k = O.state, A = O.view, j = O.container, M = O.setContainer;
|
|
1162
|
+
(0, W.useImperativeHandle)(t, () => ({
|
|
1163
|
+
editor: D.current,
|
|
1164
|
+
state: k,
|
|
1165
|
+
view: A
|
|
1165
1166
|
}), [
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1167
|
+
D,
|
|
1168
|
+
j,
|
|
1169
|
+
k,
|
|
1170
|
+
A
|
|
1170
1171
|
]);
|
|
1171
|
-
var
|
|
1172
|
-
|
|
1173
|
-
}, [
|
|
1172
|
+
var ne = (0, W.useCallback)((e) => {
|
|
1173
|
+
D.current = e, M(e);
|
|
1174
|
+
}, [M]);
|
|
1174
1175
|
if (typeof i != "string") throw Error("value must be typeof string but got " + typeof i);
|
|
1175
|
-
var N = typeof
|
|
1176
|
-
return /*#__PURE__*/ (0, Jt.jsx)("div",
|
|
1177
|
-
ref:
|
|
1176
|
+
var N = typeof m == "string" ? "cm-theme-" + m : "cm-theme";
|
|
1177
|
+
return /*#__PURE__*/ (0, Jt.jsx)("div", U({
|
|
1178
|
+
ref: ne,
|
|
1178
1179
|
className: "" + N + (n ? " " + n : "")
|
|
1179
|
-
},
|
|
1180
|
+
}, E));
|
|
1180
1181
|
});
|
|
1181
1182
|
Xt.displayName = "CodeMirror";
|
|
1182
1183
|
//#endregion
|