@marimo-team/islands 0.24.3-dev32 → 0.24.3-dev36
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-BLO7UDpo.js → ConnectedDataExplorerComponent-DeiKXaGB.js} +4 -4
- package/dist/{ErrorBoundary-B7uSdDUm.js → ErrorBoundary-B3IKS4qY.js} +1 -1
- package/dist/{_baseMerge-Bnytch8P.js → _baseMerge-BiGRwuqv.js} +1 -1
- package/dist/{abnfDiagram-VCTEODGH-DCb2K_RB.js → abnfDiagram-VCTEODGH-DKNGRyhn.js} +2 -2
- package/dist/{any-language-editor-C0dftc2Z.js → any-language-editor-BdvsE_1G.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-Bb_n642s.js → architectureDiagram-5GKGNRK7-C9oCEyV-.js} +1 -1
- package/dist/{chat-ui-DiMxe-GH.js → chat-ui-D15itIKJ.js} +8 -8
- package/dist/{chunk-IMKFNOWR-Du9BN2Ul.js → chunk-IMKFNOWR-ByL0a1rh.js} +1 -1
- package/dist/{chunk-SHT3W25Y-tUelricH.js → chunk-SHT3W25Y-D1Nb5X1c.js} +1 -1
- package/dist/{chunk-SVP7TREG-DK3egkfQ.js → chunk-SVP7TREG-BShKxcfD.js} +1 -1
- package/dist/{chunk-TICWLB2K-DRANTdnp.js → chunk-TICWLB2K-zpDbKPt8.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-7wCSVH7o.js → classDiagram-ZZMXUADV-qcsoIIQw.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-QwnvcnhB.js → classDiagram-v2-VYDZK3BY-CAgMct5x.js} +2 -2
- package/dist/{common-Dxt3H8za.js → common-CWnP5Rod.js} +7921 -11807
- package/dist/{cynefinDiagram-5FMLGOSQ-CB7O4IZB.js → cynefinDiagram-5FMLGOSQ-BzBXigwN.js} +1 -1
- package/dist/{dagre-DfYd3btw.js → dagre-BGSfXNEb.js} +21 -21
- package/dist/{dagre-GXQ25YYZ-C-a95ISW.js → dagre-GXQ25YYZ-B-75J283.js} +2 -2
- package/dist/{data-grid-overlay-editor-C5eUZVTo.js → data-grid-overlay-editor-DMu5X3F1.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-BsKLYQaH.js → diagram-S7CK7UJ4-Bzr5oWc0.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-ppYdvuTN.js → diagram-UQ7AKVKN-CVIH_HJ_.js} +1 -1
- package/dist/{diagram-VX7I27RA-CAMK2l0E.js → diagram-VX7I27RA-BmoMwYLC.js} +1 -1
- package/dist/{diagram-Z3DM3KII-CxQ7MggT.js → diagram-Z3DM3KII-BW1w6mnj.js} +1 -1
- package/dist/{dropdown-menu-C73aTomr.js → dropdown-menu-WMrB1UnI.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-DzybELvk.js → ebnfDiagram-PWID7BFC-90Q6gkC0.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-BVxV97ld.js → erDiagram-RLTQ6QDP-BZkLy3TR.js} +1 -1
- package/dist/{esm-blALgIVy.js → esm-qM9GvHZi.js} +293 -307
- package/dist/{flowDiagram-HODETNUW-BKvXsWYX.js → flowDiagram-HODETNUW-CD1F_wj5.js} +2 -2
- package/dist/{formats-vDAoRpYs.js → formats-B-gajYGs.js} +1 -1
- package/dist/{glide-data-editor-Bcy8iaZa.js → glide-data-editor-DzFEatOq.js} +2218 -2209
- package/dist/{glide-utils-BMnFm0vZ.js → glide-utils-4WmLlefP.js} +11 -11
- package/dist/{html-to-image-mVIbKn_Y.js → html-to-image-CZm_DMIE.js} +15 -15
- package/dist/{infoDiagram-27XIBGKW-B_ucqo-U.js → infoDiagram-27XIBGKW-t0zIIRVa.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-BZFx9b-o.js → ishikawaDiagram-5VMMS53U-DtQUIYgx.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-BpIfcu3G.js → kanban-definition-UXKFOSKX-CUMmwuNB.js} +1 -1
- package/dist/main.js +5274 -5283
- package/dist/{mermaid-B1Jb9HfY.js → mermaid-CMLxoJ0m.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-CmpAfv8K.js → mindmap-definition-YA3MSWOX-DnbkiQla.js} +1 -1
- package/dist/{number-overlay-editor-CFofZaOi.js → number-overlay-editor-lGqRHkFt.js} +1 -1
- package/dist/{extends-Do6pRuJa.js → objectWithoutPropertiesLoose-BbiTb8zy.js} +12 -1
- package/dist/{pegDiagram-XKGWAZYB-DO-0Q8SE.js → pegDiagram-XKGWAZYB-qgqAYMdv.js} +2 -2
- package/dist/{pick-B7vX8zxG.js → pick-CJeoxYOS.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-B1MbuA_g.js → pieDiagram-E7YTZNPT-DJUB6w6B.js} +1 -1
- package/dist/{process-output-Cr6U5ULK.js → process-output-DuupNR0m.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-DPVOQUXC.js → railroadDiagram-O6MQD6OU-C0dtw4sR.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-CC7wZ-tM.js → requirementDiagram-BXWQKSXE-DqaTsUuC.js} +1 -1
- package/dist/{reveal-component-Dli5fs0u.js → reveal-component-SdzpGkJs.js} +486 -486
- package/dist/{sequenceDiagram-WJ2MYXX4-DomSyoJI.js → sequenceDiagram-WJ2MYXX4-D2NyWGuu.js} +1 -1
- package/dist/{spec-g740fOWu.js → spec-BiD5y7ft.js} +1 -1
- package/dist/{stateDiagram-D77RDMKH-SQLLjdtF.js → stateDiagram-D77RDMKH-JChw35bc.js} +3 -3
- package/dist/{stateDiagram-v2-MP3YSRHH-Dup4KkIr.js → stateDiagram-v2-MP3YSRHH-BfVY7OxA.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-ZXbhyGv6.js → swimlanes-42K2YHIH-eAB6utyY.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-CluwxV0g.js → swimlanesDiagram-VR7AAH4N-Cnpd2YtA.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-B8i6B9RR.js → timeline-definition-24CTP7MA-DlnODX3U.js} +1 -1
- package/dist/{toDate-C3JOXlJT.js → toDate-0cxDmdsp.js} +1 -1
- package/dist/{useAsyncData-C0f7qnnN.js → useAsyncData-DCIhDLCe.js} +1 -1
- package/dist/{useDeepCompareMemoize-QCa0HbWB.js → useDeepCompareMemoize-CLaZB7Gc.js} +1 -1
- package/dist/{useLifecycle-BGRBkTFT.js → useLifecycle-C1ViBACC.js} +1 -1
- package/dist/{useTheme-iQ0VoptU.js → useTheme-Da9LJvrQ.js} +1 -1
- package/dist/{vega-component-DRI4BDLQ.js → vega-component-Bt6d8B4Q.js} +5 -5
- package/dist/{vennDiagram-4TSXK5OY-CS7lHhxI.js → vennDiagram-4TSXK5OY-B_m5KxUg.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-BSm-L8JI.js → wardleyDiagram-VM6X3IG4-Dw-Lgv3D.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-8fKCJGrJ.js → xychartDiagram-S5SC5T6Z-BjfRms1e.js} +1 -1
- package/package.json +3 -6
- package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -1
- package/src/components/data-table/columns.tsx +64 -67
- package/src/components/editor/header/filename-input.tsx +2 -0
- package/src/components/editor/output/JsonOutput.tsx +182 -632
- package/src/components/editor/output/Outputs.css +49 -17
- package/src/components/editor/output/__tests__/JsonOutput-interactions.test.tsx +254 -0
- package/src/components/editor/output/__tests__/JsonOutput-mimetype.test.tsx +41 -46
- package/src/components/editor/output/__tests__/{json-output.test.ts → json-output-formatting.test.ts} +113 -75
- package/src/components/editor/output/__tests__/json-output-pagination.test.ts +252 -0
- package/src/components/editor/output/json-output/formatting.ts +167 -0
- package/src/components/editor/output/json-output/pagination.ts +155 -0
- package/src/components/editor/output/json-output/renderers.tsx +196 -0
- package/src/components/editor/output/json-output/themes.ts +52 -0
- package/src/hooks/useDebounce.ts +2 -0
- package/src/plugins/core/BadPlugin.tsx +3 -14
- package/src/plugins/core/registerReactComponent.tsx +0 -1
- package/src/plugins/impl/FormPlugin.tsx +2 -0
- package/src/plugins/impl/MatrixPlugin.tsx +2 -0
- package/src/plugins/impl/RangeSliderPlugin.tsx +2 -0
- package/src/plugins/impl/SliderPlugin.tsx +2 -0
- package/src/plugins/layout/JsonOutputPlugin.tsx +7 -10
- package/dist/emotion-is-prop-valid.esm-M57VsT8j.js +0 -14
- package/src/components/editor/output/EmotionCacheProvider.tsx +0 -32
|
@@ -1,11 +1,11 @@
|
|
|
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 { $ as
|
|
6
|
-
import { a as le, c as ue, i as
|
|
4
|
+
import { c as r, d as i, i as a, n as o, s, t as c, u as l } from "./objectWithoutPropertiesLoose-BbiTb8zy.js";
|
|
5
|
+
import { $ as u, At as d, C as f, Ct as p, Dt as m, F as h, Ft as g, Gt as _, H as v, Ht as ee, Kt as te, Lt as y, Nt as b, Rt as x, Ut as S, Vt as ne, Z as C, _t as re, a as w, at as T, bt as ie, dt as E, ft as D, g as O, ht as k, it as A, j, jt as M, k as N, kt as P, mt as F, ot as ae, p as oe, st as I, tt as L, ut as se, vt as R, wt as z, x as B, xt as V, yt as ce } from "./dist-Kxgjxakw.js";
|
|
6
|
+
import { a as le, c as ue, i as H, r as de } from "./dist-B1vYLK28.js";
|
|
7
7
|
//#region ../node_modules/.pnpm/@codemirror+search@6.7.1/node_modules/@codemirror/search/dist/index.js
|
|
8
|
-
var
|
|
8
|
+
var U = /* @__PURE__ */ e(t()), fe = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, W = class {
|
|
9
9
|
constructor(e, t, n = 0, r = e.length, i, a) {
|
|
10
10
|
this.test = a, this.value = {
|
|
11
11
|
from: 0,
|
|
@@ -28,8 +28,8 @@ var H = /* @__PURE__ */ e(t()), fe = typeof String.prototype.normalize == "funct
|
|
|
28
28
|
for (;;) {
|
|
29
29
|
let e = this.peek();
|
|
30
30
|
if (e < 0) return this.done = !0, this;
|
|
31
|
-
let t =
|
|
32
|
-
this.bufferPos +=
|
|
31
|
+
let t = te(e), n = this.bufferStart + this.bufferPos;
|
|
32
|
+
this.bufferPos += ee(e);
|
|
33
33
|
let r = this.normalize(t);
|
|
34
34
|
if (r.length) for (let e = 0, i = n, a = !0;; e++) {
|
|
35
35
|
let n = r.charCodeAt(e), o = this.match(n, i, a, this.bufferPos + this.bufferStart, e == r.length - 1);
|
|
@@ -60,7 +60,7 @@ var H = /* @__PURE__ */ e(t()), fe = typeof String.prototype.normalize == "funct
|
|
|
60
60
|
})), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
typeof Symbol < "u" && (
|
|
63
|
+
typeof Symbol < "u" && (W.prototype[Symbol.iterator] = function() {
|
|
64
64
|
return this;
|
|
65
65
|
});
|
|
66
66
|
var pe = {
|
|
@@ -73,7 +73,7 @@ var pe = {
|
|
|
73
73
|
if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = pe, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new ve(e, t, n, r, i);
|
|
74
74
|
this.re = new RegExp(t, me + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
|
|
75
75
|
let a = e.lineAt(r);
|
|
76
|
-
this.curLineStart = a.from, this.matchPos =
|
|
76
|
+
this.curLineStart = a.from, this.matchPos = G(e, r), this.getLine(this.curLineStart);
|
|
77
77
|
}
|
|
78
78
|
getLine(e) {
|
|
79
79
|
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 +87,7 @@ var pe = {
|
|
|
87
87
|
let t = this.matchPos <= this.to && this.re.exec(this.curLine);
|
|
88
88
|
if (t) {
|
|
89
89
|
let n = this.curLineStart + t.index, r = n + t[0].length;
|
|
90
|
-
if (this.matchPos =
|
|
90
|
+
if (this.matchPos = G(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
91
|
from: n,
|
|
92
92
|
to: r,
|
|
93
93
|
precise: !0,
|
|
@@ -117,7 +117,7 @@ var pe = {
|
|
|
117
117
|
}
|
|
118
118
|
}, ve = class {
|
|
119
119
|
constructor(e, t, n, r, i) {
|
|
120
|
-
this.text = e, this.to = i, this.done = !1, this.value = pe, this.matchPos =
|
|
120
|
+
this.text = e, this.to = i, this.done = !1, this.value = pe, this.matchPos = G(e, r), this.re = new RegExp(t, me + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = _e.get(e, r, this.chunkEnd(r + 5e3));
|
|
121
121
|
}
|
|
122
122
|
chunkEnd(e) {
|
|
123
123
|
return e >= this.to ? this.to : this.text.lineAt(e).to;
|
|
@@ -132,7 +132,7 @@ var pe = {
|
|
|
132
132
|
to: n,
|
|
133
133
|
precise: !0,
|
|
134
134
|
match: t
|
|
135
|
-
}, this.matchPos =
|
|
135
|
+
}, this.matchPos = G(this.text, n + +(e == n)), this;
|
|
136
136
|
}
|
|
137
137
|
if (this.flat.to == this.to) return this.done = !0, this;
|
|
138
138
|
this.flat = _e.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
|
|
@@ -149,7 +149,7 @@ function ye(e) {
|
|
|
149
149
|
return !1;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function G(e, t) {
|
|
153
153
|
if (t >= e.length) return t;
|
|
154
154
|
let n = e.lineAt(t), r;
|
|
155
155
|
for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
|
|
@@ -172,14 +172,14 @@ var be = (e) => {
|
|
|
172
172
|
e.dispatch({ effects: r });
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
let a = t.doc.lineAt(t.selection.main.head), [, o, s, c,
|
|
176
|
-
if (s &&
|
|
175
|
+
let a = t.doc.lineAt(t.selection.main.head), [, o, s, c, l] = i, d = c ? +c.slice(1) : 0, f = s ? +s : a.number;
|
|
176
|
+
if (s && l) {
|
|
177
177
|
let e = f / 100;
|
|
178
178
|
o && (e = e * (o == "-" ? -1 : 1) + a.number / t.doc.lines), f = Math.round(t.doc.lines * e);
|
|
179
179
|
} else s && o && (f = f * (o == "-" ? -1 : 1) + a.number);
|
|
180
|
-
let p = t.doc.line(Math.max(1, Math.min(t.doc.lines, f))), m =
|
|
180
|
+
let p = t.doc.line(Math.max(1, Math.min(t.doc.lines, f))), m = P.cursor(p.from + Math.max(0, Math.min(d, p.length)));
|
|
181
181
|
e.dispatch({
|
|
182
|
-
effects: [r,
|
|
182
|
+
effects: [r, u.scrollIntoView(m.from, { y: "center" })],
|
|
183
183
|
selection: m
|
|
184
184
|
});
|
|
185
185
|
}), !0;
|
|
@@ -188,8 +188,8 @@ var be = (e) => {
|
|
|
188
188
|
minSelectionLength: 1,
|
|
189
189
|
maxMatches: 100,
|
|
190
190
|
wholeWords: !1
|
|
191
|
-
}, Se = /*@__PURE__*/
|
|
192
|
-
return
|
|
191
|
+
}, Se = /*@__PURE__*/ M.define({ combine(e) {
|
|
192
|
+
return S(e, xe, {
|
|
193
193
|
highlightWordAroundCursor: (e, t) => e || t,
|
|
194
194
|
minSelectionLength: Math.min,
|
|
195
195
|
maxMatches: Math.min
|
|
@@ -199,14 +199,14 @@ function Ce(e) {
|
|
|
199
199
|
let t = [ke, Oe];
|
|
200
200
|
return e && t.push(Se.of(e)), t;
|
|
201
201
|
}
|
|
202
|
-
var we = /*@__PURE__*/
|
|
202
|
+
var we = /*@__PURE__*/ C.mark({ class: "cm-selectionMatch" }), Te = /*@__PURE__*/ C.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
|
|
203
203
|
function Ee(e, t, n, r) {
|
|
204
|
-
return (n == 0 || e(t.sliceDoc(n - 1, n)) !=
|
|
204
|
+
return (n == 0 || e(t.sliceDoc(n - 1, n)) != m.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != m.Word);
|
|
205
205
|
}
|
|
206
206
|
function De(e, t, n, r) {
|
|
207
|
-
return e(t.sliceDoc(n, n + 1)) ==
|
|
207
|
+
return e(t.sliceDoc(n, n + 1)) == m.Word && e(t.sliceDoc(r - 1, r)) == m.Word;
|
|
208
208
|
}
|
|
209
|
-
var Oe = /*@__PURE__*/
|
|
209
|
+
var Oe = /*@__PURE__*/ L.fromClass(class {
|
|
210
210
|
constructor(e) {
|
|
211
211
|
this.decorations = this.getDeco(e);
|
|
212
212
|
}
|
|
@@ -215,42 +215,42 @@ var Oe = /*@__PURE__*/ F.fromClass(class {
|
|
|
215
215
|
}
|
|
216
216
|
getDeco(e) {
|
|
217
217
|
let t = e.state.facet(Se), { state: n } = e, r = n.selection;
|
|
218
|
-
if (r.ranges.length > 1) return
|
|
218
|
+
if (r.ranges.length > 1) return C.none;
|
|
219
219
|
let i = r.main, a, o = null;
|
|
220
220
|
if (i.empty) {
|
|
221
|
-
if (!t.highlightWordAroundCursor) return
|
|
221
|
+
if (!t.highlightWordAroundCursor) return C.none;
|
|
222
222
|
let e = n.wordAt(i.head);
|
|
223
|
-
if (!e) return
|
|
223
|
+
if (!e) return C.none;
|
|
224
224
|
o = n.charCategorizer(i.head), a = n.sliceDoc(e.from, e.to);
|
|
225
225
|
} else {
|
|
226
226
|
let e = i.to - i.from;
|
|
227
|
-
if (e < t.minSelectionLength || e > 200) return
|
|
227
|
+
if (e < t.minSelectionLength || e > 200) return C.none;
|
|
228
228
|
if (t.wholeWords) {
|
|
229
|
-
if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(Ee(o, n, i.from, i.to) && De(o, n, i.from, i.to))) return
|
|
230
|
-
} else if (a = n.sliceDoc(i.from, i.to), !a) return
|
|
229
|
+
if (a = n.sliceDoc(i.from, i.to), o = n.charCategorizer(i.head), !(Ee(o, n, i.from, i.to) && De(o, n, i.from, i.to))) return C.none;
|
|
230
|
+
} else if (a = n.sliceDoc(i.from, i.to), !a) return C.none;
|
|
231
231
|
}
|
|
232
232
|
let s = [];
|
|
233
233
|
for (let r of e.visibleRanges) {
|
|
234
|
-
let e = new
|
|
234
|
+
let e = new W(n.doc, a, r.from, r.to);
|
|
235
235
|
for (; !e.next().done;) {
|
|
236
236
|
let { from: r, to: a } = e.value;
|
|
237
|
-
if ((!o || Ee(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(Te.range(r, a)) : (r >= i.to || a <= i.from) && s.push(we.range(r, a)), s.length > t.maxMatches)) return
|
|
237
|
+
if ((!o || Ee(o, n, r, a)) && (i.empty && r <= i.from && a >= i.to ? s.push(Te.range(r, a)) : (r >= i.to || a <= i.from) && s.push(we.range(r, a)), s.length > t.maxMatches)) return C.none;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
return
|
|
240
|
+
return C.set(s);
|
|
241
241
|
}
|
|
242
|
-
}, { decorations: (e) => e.decorations }), ke = /*@__PURE__*/
|
|
242
|
+
}, { decorations: (e) => e.decorations }), ke = /*@__PURE__*/ u.baseTheme({
|
|
243
243
|
".cm-selectionMatch": { backgroundColor: "#99ff7780" },
|
|
244
244
|
".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
|
|
245
245
|
}), Ae = ({ state: e, dispatch: t }) => {
|
|
246
|
-
let { selection: n } = e, r =
|
|
246
|
+
let { selection: n } = e, r = P.create(n.ranges.map((t) => e.wordAt(t.head) || P.cursor(t.head)), n.mainIndex);
|
|
247
247
|
return !r.eq(n) && (t(e.update({ selection: r })), !0);
|
|
248
248
|
};
|
|
249
249
|
function je(e, t) {
|
|
250
250
|
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
|
|
251
|
+
for (let n = !1, i = new W(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
|
|
252
252
|
if (n) return null;
|
|
253
|
-
i = new
|
|
253
|
+
i = new W(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
|
|
254
254
|
} else {
|
|
255
255
|
if (n && r.some((e) => e.from == i.value.from)) continue;
|
|
256
256
|
if (a) {
|
|
@@ -270,18 +270,18 @@ var Me = ({ state: e, dispatch: t }) => {
|
|
|
270
270
|
if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != r)) return !1;
|
|
271
271
|
let i = je(e, r);
|
|
272
272
|
return i ? (t(e.update({
|
|
273
|
-
selection: e.selection.addRange(
|
|
274
|
-
effects:
|
|
273
|
+
selection: e.selection.addRange(P.range(i.from, i.to), !1),
|
|
274
|
+
effects: u.scrollIntoView(i.to)
|
|
275
275
|
})), !0) : !1;
|
|
276
|
-
},
|
|
277
|
-
return
|
|
276
|
+
}, K = /*@__PURE__*/ M.define({ combine(e) {
|
|
277
|
+
return S(e, {
|
|
278
278
|
top: !1,
|
|
279
279
|
caseSensitive: !1,
|
|
280
280
|
literal: !1,
|
|
281
281
|
regexp: !1,
|
|
282
282
|
wholeWord: !1,
|
|
283
|
-
createPanel: (e) => new
|
|
284
|
-
scrollToMatch: (e) =>
|
|
283
|
+
createPanel: (e) => new ot(e),
|
|
284
|
+
scrollToMatch: (e) => u.scrollIntoView(e)
|
|
285
285
|
});
|
|
286
286
|
} }), Ne = class {
|
|
287
287
|
constructor(e) {
|
|
@@ -297,8 +297,8 @@ var Me = ({ state: e, dispatch: t }) => {
|
|
|
297
297
|
return this.regexp ? new Ve(this) : new Le(this);
|
|
298
298
|
}
|
|
299
299
|
getCursor(e, t = 0, n) {
|
|
300
|
-
let r = e.doc ? e :
|
|
301
|
-
return n ??= r.doc.length, this.regexp ?
|
|
300
|
+
let r = e.doc ? e : d.create({ doc: e });
|
|
301
|
+
return n ??= r.doc.length, this.regexp ? J(this, r, t, n) : q(this, r, t, n);
|
|
302
302
|
}
|
|
303
303
|
}, Pe = class {
|
|
304
304
|
constructor(e) {
|
|
@@ -308,28 +308,28 @@ var Me = ({ state: e, dispatch: t }) => {
|
|
|
308
308
|
function Fe(e, t, n) {
|
|
309
309
|
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
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function q(e, t, n, r) {
|
|
312
312
|
let i;
|
|
313
|
-
return e.wholeWord && (i = Ie(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Fe(e.test, t, i)), new
|
|
313
|
+
return e.wholeWord && (i = Ie(t.doc, t.charCategorizer(t.selection.main.head))), e.test && (i = Fe(e.test, t, i)), new W(t.doc, e.unquoted, n, r, e.caseSensitive ? void 0 : (e) => e.toLowerCase(), i);
|
|
314
314
|
}
|
|
315
315
|
function Ie(e, t) {
|
|
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
|
+
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(Y(i, n - a)) != m.Word || t(ze(i, n - a)) != m.Word) && (t(ze(i, r - a)) != m.Word || t(Y(i, r - a)) != m.Word));
|
|
317
317
|
}
|
|
318
318
|
var Le = class extends Pe {
|
|
319
319
|
constructor(e) {
|
|
320
320
|
super(e);
|
|
321
321
|
}
|
|
322
322
|
nextMatch(e, t, n) {
|
|
323
|
-
let r =
|
|
323
|
+
let r = q(this.spec, e, n, e.doc.length).nextOverlapping();
|
|
324
324
|
if (r.done) {
|
|
325
325
|
let n = Math.min(e.doc.length, t + this.spec.unquoted.length);
|
|
326
|
-
r =
|
|
326
|
+
r = q(this.spec, e, 0, n).nextOverlapping();
|
|
327
327
|
}
|
|
328
328
|
return r.done || r.value.from == t && r.value.to == n ? null : r.value;
|
|
329
329
|
}
|
|
330
330
|
prevMatchInRange(e, t, n) {
|
|
331
331
|
for (let r = n;;) {
|
|
332
|
-
let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i =
|
|
332
|
+
let n = Math.max(t, r - 1e4 - this.spec.unquoted.length), i = q(this.spec, e, n, r), a = null;
|
|
333
333
|
for (; !i.nextOverlapping().done;) a = i.value;
|
|
334
334
|
if (a) return a;
|
|
335
335
|
if (n == t) return null;
|
|
@@ -344,7 +344,7 @@ var Le = class extends Pe {
|
|
|
344
344
|
return this.spec.unquote(this.spec.replace);
|
|
345
345
|
}
|
|
346
346
|
matchAll(e, t) {
|
|
347
|
-
let n =
|
|
347
|
+
let n = q(this.spec, e, 0, e.doc.length), r = [];
|
|
348
348
|
for (; !n.next().done;) {
|
|
349
349
|
if (r.length >= t) return null;
|
|
350
350
|
r.push(n.value);
|
|
@@ -352,37 +352,37 @@ var Le = class extends Pe {
|
|
|
352
352
|
return r;
|
|
353
353
|
}
|
|
354
354
|
highlight(e, t, n, r) {
|
|
355
|
-
let i =
|
|
355
|
+
let i = q(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
|
|
356
356
|
for (; !i.next().done;) r(i.value.from, i.value.to);
|
|
357
357
|
}
|
|
358
358
|
};
|
|
359
359
|
function Re(e, t, n) {
|
|
360
360
|
return (r, i, a) => (!n || n(r, i, a)) && e(a[0], t, r, i);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function J(e, t, n, r) {
|
|
363
363
|
let i;
|
|
364
364
|
return e.wholeWord && (i = Be(t.charCategorizer(t.selection.main.head))), e.test && (i = Re(e.test, t, i)), new he(t.doc, e.search, {
|
|
365
365
|
ignoreCase: !e.caseSensitive,
|
|
366
366
|
test: i
|
|
367
367
|
}, n, r);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
return e.slice(
|
|
369
|
+
function Y(e, t) {
|
|
370
|
+
return e.slice(_(e, t, !1), t);
|
|
371
371
|
}
|
|
372
372
|
function ze(e, t) {
|
|
373
|
-
return e.slice(t,
|
|
373
|
+
return e.slice(t, _(e, t));
|
|
374
374
|
}
|
|
375
375
|
function Be(e) {
|
|
376
|
-
return (t, n, r) => !r[0].length || (e(
|
|
376
|
+
return (t, n, r) => !r[0].length || (e(Y(r.input, r.index)) != m.Word || e(ze(r.input, r.index)) != m.Word) && (e(ze(r.input, r.index + r[0].length)) != m.Word || e(Y(r.input, r.index + r[0].length)) != m.Word);
|
|
377
377
|
}
|
|
378
378
|
var Ve = class extends Pe {
|
|
379
379
|
nextMatch(e, t, n) {
|
|
380
|
-
let r =
|
|
381
|
-
return r.done && (r =
|
|
380
|
+
let r = J(this.spec, e, n, e.doc.length).next();
|
|
381
|
+
return r.done && (r = J(this.spec, e, 0, t).next()), r.done ? null : r.value;
|
|
382
382
|
}
|
|
383
383
|
prevMatchInRange(e, t, n) {
|
|
384
384
|
for (let r = 1;; r++) {
|
|
385
|
-
let i = Math.max(t, n - r * 1e4), a =
|
|
385
|
+
let i = Math.max(t, n - r * 1e4), a = J(this.spec, e, i, n), o = null;
|
|
386
386
|
for (; !a.next().done;) o = a.value;
|
|
387
387
|
if (o && (i == t || o.from > i + 10)) return o;
|
|
388
388
|
if (i == t) return null;
|
|
@@ -403,7 +403,7 @@ var Ve = class extends Pe {
|
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
matchAll(e, t) {
|
|
406
|
-
let n =
|
|
406
|
+
let n = J(this.spec, e, 0, e.doc.length), r = [];
|
|
407
407
|
for (; !n.next().done;) {
|
|
408
408
|
if (r.length >= t) return null;
|
|
409
409
|
r.push(n.value);
|
|
@@ -411,33 +411,33 @@ var Ve = class extends Pe {
|
|
|
411
411
|
return r;
|
|
412
412
|
}
|
|
413
413
|
highlight(e, t, n, r) {
|
|
414
|
-
let i =
|
|
414
|
+
let i = J(this.spec, e, Math.max(0, t - 250), Math.min(n + 250, e.doc.length));
|
|
415
415
|
for (; !i.next().done;) r(i.value.from, i.value.to);
|
|
416
416
|
}
|
|
417
|
-
},
|
|
417
|
+
}, X = /*@__PURE__*/ y.define(), He = /*@__PURE__*/ y.define(), Z = /*@__PURE__*/ x.define({
|
|
418
418
|
create(e) {
|
|
419
|
-
return new Ue(
|
|
419
|
+
return new Ue(et(e).create(), null);
|
|
420
420
|
},
|
|
421
421
|
update(e, t) {
|
|
422
|
-
for (let n of t.effects) n.is(
|
|
422
|
+
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
423
|
return e;
|
|
424
424
|
},
|
|
425
|
-
provide: (e) =>
|
|
425
|
+
provide: (e) => V.from(e, (e) => e.panel)
|
|
426
426
|
}), Ue = class {
|
|
427
427
|
constructor(e, t) {
|
|
428
428
|
this.query = e, this.panel = t;
|
|
429
429
|
}
|
|
430
|
-
}, We = /*@__PURE__*/
|
|
430
|
+
}, We = /*@__PURE__*/ C.mark({ class: "cm-searchMatch" }), Ge = /*@__PURE__*/ C.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Ke = /*@__PURE__*/ L.fromClass(class {
|
|
431
431
|
constructor(e) {
|
|
432
|
-
this.view = e, this.decorations = this.highlight(e.state.field(
|
|
432
|
+
this.view = e, this.decorations = this.highlight(e.state.field(Z));
|
|
433
433
|
}
|
|
434
434
|
update(e) {
|
|
435
|
-
let t = e.state.field(
|
|
436
|
-
(t != e.startState.field(
|
|
435
|
+
let t = e.state.field(Z);
|
|
436
|
+
(t != e.startState.field(Z) || e.docChanged || e.selectionSet || e.viewportChanged) && (this.decorations = this.highlight(t));
|
|
437
437
|
}
|
|
438
438
|
highlight({ query: e, panel: t }) {
|
|
439
|
-
if (!t || !e.spec.valid) return
|
|
440
|
-
let { view: n } = this, r = new
|
|
439
|
+
if (!t || !e.spec.valid) return C.none;
|
|
440
|
+
let { view: n } = this, r = new g();
|
|
441
441
|
for (let t = 0, i = n.visibleRanges, a = i.length; t < a; t++) {
|
|
442
442
|
let { from: o, to: s } = i[t];
|
|
443
443
|
for (; t < a - 1 && s > i[t + 1].from - 500;) s = i[++t].to;
|
|
@@ -449,67 +449,67 @@ var Ve = class extends Pe {
|
|
|
449
449
|
return r.finish();
|
|
450
450
|
}
|
|
451
451
|
}, { decorations: (e) => e.decorations });
|
|
452
|
-
function
|
|
452
|
+
function Q(e) {
|
|
453
453
|
return (t) => {
|
|
454
|
-
let n = t.state.field(
|
|
455
|
-
return n && n.query.spec.valid ? e(t, n) :
|
|
454
|
+
let n = t.state.field(Z, !1);
|
|
455
|
+
return n && n.query.spec.valid ? e(t, n) : rt(t);
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
var
|
|
458
|
+
var qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
459
459
|
let { to: n } = e.state.selection.main, r = t.nextMatch(e.state, n, n);
|
|
460
460
|
if (!r) return !1;
|
|
461
|
-
let i =
|
|
461
|
+
let i = P.single(r.from, r.to), a = e.state.facet(K);
|
|
462
462
|
return e.dispatch({
|
|
463
463
|
selection: i,
|
|
464
|
-
effects: [
|
|
464
|
+
effects: [lt(e, r), a.scrollToMatch(i.main, e)],
|
|
465
465
|
userEvent: "select.search"
|
|
466
|
-
}),
|
|
467
|
-
}),
|
|
466
|
+
}), nt(e), !0;
|
|
467
|
+
}), Je = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
468
468
|
let { state: n } = e, { from: r } = n.selection.main, i = t.prevMatch(n, r, r);
|
|
469
469
|
if (!i) return !1;
|
|
470
|
-
let a =
|
|
470
|
+
let a = P.single(i.from, i.to), o = e.state.facet(K);
|
|
471
471
|
return e.dispatch({
|
|
472
472
|
selection: a,
|
|
473
|
-
effects: [
|
|
473
|
+
effects: [lt(e, i), o.scrollToMatch(a.main, e)],
|
|
474
474
|
userEvent: "select.search"
|
|
475
|
-
}),
|
|
476
|
-
}),
|
|
475
|
+
}), nt(e), !0;
|
|
476
|
+
}), Ye = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
477
477
|
let n = t.matchAll(e.state, 1e3);
|
|
478
478
|
return !n || !n.length ? !1 : (e.dispatch({
|
|
479
|
-
selection:
|
|
479
|
+
selection: P.create(n.map((e) => P.range(e.from, e.to))),
|
|
480
480
|
userEvent: "select.search.matches"
|
|
481
481
|
}), !0);
|
|
482
|
-
}),
|
|
482
|
+
}), Xe = ({ state: e, dispatch: t }) => {
|
|
483
483
|
let n = e.selection;
|
|
484
484
|
if (n.ranges.length > 1 || n.main.empty) return !1;
|
|
485
485
|
let { from: r, to: i } = n.main, a = [], o = 0;
|
|
486
|
-
for (let t = new
|
|
486
|
+
for (let t = new W(e.doc, e.sliceDoc(r, i)); !t.next().done;) {
|
|
487
487
|
if (a.length > 1e3) return !1;
|
|
488
|
-
t.value.from == r && (o = a.length), a.push(
|
|
488
|
+
t.value.from == r && (o = a.length), a.push(P.range(t.value.from, t.value.to));
|
|
489
489
|
}
|
|
490
490
|
return t(e.update({
|
|
491
|
-
selection:
|
|
491
|
+
selection: P.create(a, o),
|
|
492
492
|
userEvent: "select.search.matches"
|
|
493
493
|
})), !0;
|
|
494
|
-
},
|
|
494
|
+
}, Ze = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
495
495
|
let { state: n } = e, { from: r, to: i } = n.selection.main;
|
|
496
496
|
if (n.readOnly) return !1;
|
|
497
497
|
let a = t.nextMatch(n, r, r);
|
|
498
498
|
if (!a) return !1;
|
|
499
|
-
let o = a, s = [], c,
|
|
500
|
-
o.precise ? o.from == r && o.to == i && (
|
|
499
|
+
let o = a, s = [], c, l, d = [];
|
|
500
|
+
o.precise ? o.from == r && o.to == i && (l = n.toText(t.getReplacement(o)), s.push({
|
|
501
501
|
from: o.from,
|
|
502
502
|
to: o.to,
|
|
503
|
-
insert:
|
|
504
|
-
}), o = t.nextMatch(n, o.from, o.to), d.push(
|
|
503
|
+
insert: l
|
|
504
|
+
}), o = t.nextMatch(n, o.from, o.to), d.push(u.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(r).number) + "."))) : o = t.nextMatch(n, o.from, o.to);
|
|
505
505
|
let f = e.state.changes(s);
|
|
506
|
-
return o && (c =
|
|
506
|
+
return o && (c = P.single(o.from, o.to).map(f), d.push(lt(e, o)), d.push(n.facet(K).scrollToMatch(c.main, e))), e.dispatch({
|
|
507
507
|
changes: f,
|
|
508
508
|
selection: c,
|
|
509
509
|
effects: d,
|
|
510
510
|
userEvent: "input.replace"
|
|
511
511
|
}), !0;
|
|
512
|
-
}),
|
|
512
|
+
}), Qe = /*@__PURE__*/ Q((e, { query: t }) => {
|
|
513
513
|
if (e.state.readOnly) return !1;
|
|
514
514
|
let n = [];
|
|
515
515
|
for (let r of t.matchAll(e.state, 1e9)) {
|
|
@@ -524,17 +524,17 @@ var Q = /*@__PURE__*/ Z((e, { query: t }) => {
|
|
|
524
524
|
let r = e.state.phrase("replaced $ matches", n.length) + ".";
|
|
525
525
|
return e.dispatch({
|
|
526
526
|
changes: n,
|
|
527
|
-
effects:
|
|
527
|
+
effects: u.announce.of(r),
|
|
528
528
|
userEvent: "input.replace.all"
|
|
529
529
|
}), !0;
|
|
530
530
|
});
|
|
531
|
-
function
|
|
532
|
-
return e.state.facet(
|
|
531
|
+
function $e(e) {
|
|
532
|
+
return e.state.facet(K).createPanel(e);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function et(e, t) {
|
|
535
535
|
let n = e.selection.main, r = n.empty || n.to > n.from + 100 ? "" : e.sliceDoc(n.from, n.to);
|
|
536
536
|
if (t && !r) return t;
|
|
537
|
-
let i = e.facet(
|
|
537
|
+
let i = e.facet(K);
|
|
538
538
|
return new Ne({
|
|
539
539
|
search: t?.literal ?? i.literal ? r : r.replace(/\n/g, "\\n"),
|
|
540
540
|
caseSensitive: t?.caseSensitive ?? i.caseSensitive,
|
|
@@ -543,57 +543,57 @@ function $e(e, t) {
|
|
|
543
543
|
wholeWord: t?.wholeWord ?? i.wholeWord
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let t =
|
|
546
|
+
function tt(e) {
|
|
547
|
+
let t = I(e, $e);
|
|
548
548
|
return t && t.dom.querySelector("[main-field]");
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
let t =
|
|
550
|
+
function nt(e) {
|
|
551
|
+
let t = tt(e);
|
|
552
552
|
t && t == e.root.activeElement && t.select();
|
|
553
553
|
}
|
|
554
|
-
var
|
|
555
|
-
let t = e.state.field(
|
|
554
|
+
var rt = (e) => {
|
|
555
|
+
let t = e.state.field(Z, !1);
|
|
556
556
|
if (t && t.panel) {
|
|
557
|
-
let n =
|
|
557
|
+
let n = tt(e);
|
|
558
558
|
if (n && n != e.root.activeElement) {
|
|
559
|
-
let r =
|
|
560
|
-
r.valid && e.dispatch({ effects:
|
|
559
|
+
let r = et(e.state, t.query.spec);
|
|
560
|
+
r.valid && e.dispatch({ effects: X.of(r) }), n.focus(), n.select();
|
|
561
561
|
}
|
|
562
|
-
} else e.dispatch({ effects: [He.of(!0), t ?
|
|
562
|
+
} else e.dispatch({ effects: [He.of(!0), t ? X.of(et(e.state, t.query.spec)) : y.appendConfig.of(dt)] });
|
|
563
563
|
return !0;
|
|
564
|
-
},
|
|
565
|
-
let t = e.state.field(
|
|
564
|
+
}, it = (e) => {
|
|
565
|
+
let t = e.state.field(Z, !1);
|
|
566
566
|
if (!t || !t.panel) return !1;
|
|
567
|
-
let n =
|
|
567
|
+
let n = I(e, $e);
|
|
568
568
|
return n && n.dom.contains(e.root.activeElement) && e.focus(), e.dispatch({ effects: He.of(!1) }), !0;
|
|
569
|
-
},
|
|
569
|
+
}, at = [
|
|
570
570
|
{
|
|
571
571
|
key: "Mod-f",
|
|
572
|
-
run:
|
|
572
|
+
run: rt,
|
|
573
573
|
scope: "editor search-panel"
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
576
|
key: "F3",
|
|
577
|
-
run:
|
|
578
|
-
shift:
|
|
577
|
+
run: qe,
|
|
578
|
+
shift: Je,
|
|
579
579
|
scope: "editor search-panel",
|
|
580
580
|
preventDefault: !0
|
|
581
581
|
},
|
|
582
582
|
{
|
|
583
583
|
key: "Mod-g",
|
|
584
|
-
run:
|
|
585
|
-
shift:
|
|
584
|
+
run: qe,
|
|
585
|
+
shift: Je,
|
|
586
586
|
scope: "editor search-panel",
|
|
587
587
|
preventDefault: !0
|
|
588
588
|
},
|
|
589
589
|
{
|
|
590
590
|
key: "Escape",
|
|
591
|
-
run:
|
|
591
|
+
run: it,
|
|
592
592
|
scope: "editor search-panel"
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
595
|
key: "Mod-Shift-l",
|
|
596
|
-
run:
|
|
596
|
+
run: Xe
|
|
597
597
|
},
|
|
598
598
|
{
|
|
599
599
|
key: "Mod-Alt-g",
|
|
@@ -604,11 +604,11 @@ var nt = (e) => {
|
|
|
604
604
|
run: Me,
|
|
605
605
|
preventDefault: !0
|
|
606
606
|
}
|
|
607
|
-
],
|
|
607
|
+
], ot = class {
|
|
608
608
|
constructor(e) {
|
|
609
609
|
this.view = e;
|
|
610
|
-
let t = this.query = e.state.field(
|
|
611
|
-
this.commit = this.commit.bind(this), this.searchField =
|
|
610
|
+
let t = this.query = e.state.field(Z).query.spec;
|
|
611
|
+
this.commit = this.commit.bind(this), this.searchField = p("input", {
|
|
612
612
|
value: t.search,
|
|
613
613
|
placeholder: $(e, "Find"),
|
|
614
614
|
"aria-label": $(e, "Find"),
|
|
@@ -618,7 +618,7 @@ var nt = (e) => {
|
|
|
618
618
|
"main-field": "true",
|
|
619
619
|
onchange: this.commit,
|
|
620
620
|
onkeyup: this.commit
|
|
621
|
-
}), this.replaceField =
|
|
621
|
+
}), this.replaceField = p("input", {
|
|
622
622
|
value: t.replace,
|
|
623
623
|
placeholder: $(e, "Replace"),
|
|
624
624
|
"aria-label": $(e, "Replace"),
|
|
@@ -627,19 +627,19 @@ var nt = (e) => {
|
|
|
627
627
|
form: "",
|
|
628
628
|
onchange: this.commit,
|
|
629
629
|
onkeyup: this.commit
|
|
630
|
-
}), this.caseField =
|
|
630
|
+
}), this.caseField = p("input", {
|
|
631
631
|
type: "checkbox",
|
|
632
632
|
name: "case",
|
|
633
633
|
form: "",
|
|
634
634
|
checked: t.caseSensitive,
|
|
635
635
|
onchange: this.commit
|
|
636
|
-
}), this.reField =
|
|
636
|
+
}), this.reField = p("input", {
|
|
637
637
|
type: "checkbox",
|
|
638
638
|
name: "re",
|
|
639
639
|
form: "",
|
|
640
640
|
checked: t.regexp,
|
|
641
641
|
onchange: this.commit
|
|
642
|
-
}), this.wordField =
|
|
642
|
+
}), this.wordField = p("input", {
|
|
643
643
|
type: "checkbox",
|
|
644
644
|
name: "word",
|
|
645
645
|
form: "",
|
|
@@ -647,33 +647,33 @@ var nt = (e) => {
|
|
|
647
647
|
onchange: this.commit
|
|
648
648
|
});
|
|
649
649
|
function n(e, t, n) {
|
|
650
|
-
return
|
|
650
|
+
return p("button", {
|
|
651
651
|
class: "cm-button",
|
|
652
652
|
name: e,
|
|
653
653
|
onclick: t,
|
|
654
654
|
type: "button"
|
|
655
655
|
}, n);
|
|
656
656
|
}
|
|
657
|
-
this.dom =
|
|
657
|
+
this.dom = p("div", {
|
|
658
658
|
onkeydown: (e) => this.keydown(e),
|
|
659
659
|
class: "cm-search"
|
|
660
660
|
}, [
|
|
661
661
|
this.searchField,
|
|
662
|
-
n("next", () =>
|
|
663
|
-
n("prev", () =>
|
|
664
|
-
n("select", () =>
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
662
|
+
n("next", () => qe(e), [$(e, "next")]),
|
|
663
|
+
n("prev", () => Je(e), [$(e, "previous")]),
|
|
664
|
+
n("select", () => Ye(e), [$(e, "all")]),
|
|
665
|
+
p("label", null, [this.caseField, $(e, "match case")]),
|
|
666
|
+
p("label", null, [this.reField, $(e, "regexp")]),
|
|
667
|
+
p("label", null, [this.wordField, $(e, "by word")]),
|
|
668
668
|
...e.state.readOnly ? [] : [
|
|
669
|
-
|
|
669
|
+
p("br"),
|
|
670
670
|
this.replaceField,
|
|
671
|
-
n("replace", () =>
|
|
672
|
-
n("replaceAll", () =>
|
|
671
|
+
n("replace", () => Ze(e), [$(e, "replace")]),
|
|
672
|
+
n("replaceAll", () => Qe(e), [$(e, "replace all")])
|
|
673
673
|
],
|
|
674
|
-
|
|
674
|
+
p("button", {
|
|
675
675
|
name: "close",
|
|
676
|
-
onclick: () =>
|
|
676
|
+
onclick: () => it(e),
|
|
677
677
|
"aria-label": $(e, "close"),
|
|
678
678
|
type: "button"
|
|
679
679
|
}, ["×"])
|
|
@@ -687,13 +687,13 @@ var nt = (e) => {
|
|
|
687
687
|
wholeWord: this.wordField.checked,
|
|
688
688
|
replace: this.replaceField.value
|
|
689
689
|
});
|
|
690
|
-
e.eq(this.query) || (this.query = e, this.view.dispatch({ effects:
|
|
690
|
+
e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: X.of(e) }));
|
|
691
691
|
}
|
|
692
692
|
keydown(e) {
|
|
693
|
-
|
|
693
|
+
ce(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
694
|
}
|
|
695
695
|
update(e) {
|
|
696
|
-
for (let t of e.transactions) for (let e of t.effects) e.is(
|
|
696
|
+
for (let t of e.transactions) for (let e of t.effects) e.is(X) && !e.value.eq(this.query) && this.setQuery(e.value);
|
|
697
697
|
}
|
|
698
698
|
setQuery(e) {
|
|
699
699
|
this.query = e, this.searchField.value = e.search, this.replaceField.value = e.replace, this.caseField.checked = e.caseSensitive, this.reField.checked = e.regexp, this.wordField.checked = e.wholeWord;
|
|
@@ -705,30 +705,30 @@ var nt = (e) => {
|
|
|
705
705
|
return 80;
|
|
706
706
|
}
|
|
707
707
|
get top() {
|
|
708
|
-
return this.view.state.facet(
|
|
708
|
+
return this.view.state.facet(K).top;
|
|
709
709
|
}
|
|
710
710
|
};
|
|
711
711
|
function $(e, t) {
|
|
712
712
|
return e.state.phrase(t);
|
|
713
713
|
}
|
|
714
|
-
var
|
|
715
|
-
function
|
|
716
|
-
let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t -
|
|
714
|
+
var st = 30, ct = /[\s\.,:;?!]/;
|
|
715
|
+
function lt(e, { from: t, to: n }) {
|
|
716
|
+
let r = e.state.doc.lineAt(t), i = e.state.doc.lineAt(n).to, a = Math.max(r.from, t - st), o = Math.min(i, n + st), s = e.state.sliceDoc(a, o);
|
|
717
717
|
if (a != r.from) {
|
|
718
|
-
for (let e = 0; e <
|
|
718
|
+
for (let e = 0; e < st; e++) if (!ct.test(s[e + 1]) && ct.test(s[e])) {
|
|
719
719
|
s = s.slice(e);
|
|
720
720
|
break;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
if (o != i) {
|
|
724
|
-
for (let e = s.length - 1; e > s.length -
|
|
724
|
+
for (let e = s.length - 1; e > s.length - st; e--) if (!ct.test(s[e - 1]) && ct.test(s[e])) {
|
|
725
725
|
s = s.slice(0, e);
|
|
726
726
|
break;
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
|
-
return
|
|
729
|
+
return u.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`);
|
|
730
730
|
}
|
|
731
|
-
var
|
|
731
|
+
var ut = /*@__PURE__*/ u.baseTheme({
|
|
732
732
|
".cm-panel.cm-search": {
|
|
733
733
|
padding: "2px 6px 4px",
|
|
734
734
|
position: "relative",
|
|
@@ -753,37 +753,23 @@ var lt = /*@__PURE__*/ l.baseTheme({
|
|
|
753
753
|
"&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
|
|
754
754
|
"&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
|
|
755
755
|
"&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
|
|
756
|
-
}),
|
|
757
|
-
|
|
756
|
+
}), dt = [
|
|
757
|
+
Z,
|
|
758
758
|
/*@__PURE__*/ b.low(Ke),
|
|
759
|
-
|
|
760
|
-
]
|
|
761
|
-
//#endregion
|
|
762
|
-
//#region ../node_modules/.pnpm/@babel+runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
763
|
-
function dt(e, t) {
|
|
764
|
-
if (e == null) return {};
|
|
765
|
-
var n = {};
|
|
766
|
-
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
767
|
-
if (t.indexOf(r) !== -1) continue;
|
|
768
|
-
n[r] = e[r];
|
|
769
|
-
}
|
|
770
|
-
return n;
|
|
771
|
-
}
|
|
772
|
-
//#endregion
|
|
773
|
-
//#region ../node_modules/.pnpm/@uiw+codemirror-extensions-basic-setup@4.25.11_@codemirror+autocomplete@6.20.3_@codemir_3d8ccf8815e3a97c6d75b59d2740160b/node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js
|
|
774
|
-
var ft = function(e) {
|
|
759
|
+
ut
|
|
760
|
+
], ft = function(e) {
|
|
775
761
|
e === void 0 && (e = {});
|
|
776
|
-
var t = e.crosshairCursor, n = t !== void 0 && t,
|
|
777
|
-
e.closeBracketsKeymap !== !1 && (
|
|
778
|
-
var
|
|
779
|
-
return e.lineNumbers !== !1 &&
|
|
762
|
+
var t = e.crosshairCursor, n = t !== void 0 && t, i = [];
|
|
763
|
+
e.closeBracketsKeymap !== !1 && (i = i.concat(le)), e.defaultKeymap !== !1 && (i = i.concat(s)), e.searchKeymap !== !1 && (i = i.concat(at)), e.historyKeymap !== !1 && (i = i.concat(l)), e.foldKeymap !== !1 && (i = i.concat(f)), e.completionKeymap !== !1 && (i = i.concat(ue)), e.lintKeymap !== !1 && (i = i.concat(a));
|
|
764
|
+
var o = [];
|
|
765
|
+
return e.lineNumbers !== !1 && o.push(k()), e.highlightActiveLineGutter !== !1 && o.push(E()), e.highlightSpecialChars !== !1 && o.push(D()), e.history !== !1 && o.push(r()), e.foldGutter !== !1 && o.push(B()), e.drawSelection !== !1 && o.push(T()), e.dropCursor !== !1 && o.push(ae()), e.allowMultipleSelections !== !1 && o.push(d.allowMultipleSelections.of(!0)), e.indentOnInput !== !1 && o.push(N()), e.syntaxHighlighting !== !1 && o.push(h(O, { fallback: !0 })), e.bracketMatching !== !1 && o.push(oe()), e.closeBrackets !== !1 && o.push(H()), e.autocompletion !== !1 && o.push(de()), e.rectangularSelection !== !1 && o.push(R()), n !== !1 && o.push(A()), e.highlightActiveLine !== !1 && o.push(se()), e.highlightSelectionMatches !== !1 && o.push(Ce()), e.tabSize && typeof e.tabSize == "number" && o.push(j.of(" ".repeat(e.tabSize))), o.concat([F.of(i.flat())]).filter(Boolean);
|
|
780
766
|
}, pt = function(e) {
|
|
781
767
|
e === void 0 && (e = {});
|
|
782
768
|
var t = [];
|
|
783
|
-
e.defaultKeymap !== !1 && (t = t.concat(
|
|
769
|
+
e.defaultKeymap !== !1 && (t = t.concat(s)), e.historyKeymap !== !1 && (t = t.concat(l));
|
|
784
770
|
var n = [];
|
|
785
|
-
return e.highlightSpecialChars !== !1 && n.push(
|
|
786
|
-
}, 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__*/
|
|
771
|
+
return e.highlightSpecialChars !== !1 && n.push(D()), e.history !== !1 && n.push(r()), e.drawSelection !== !1 && n.push(T()), e.syntaxHighlighting !== !1 && n.push(h(O, { fallback: !0 })), n.concat([F.of(t.flat())]).filter(Boolean);
|
|
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__*/ u.theme({
|
|
787
773
|
"&": {
|
|
788
774
|
color: vt,
|
|
789
775
|
backgroundColor: Et
|
|
@@ -832,112 +818,112 @@ var ft = function(e) {
|
|
|
832
818
|
backgroundColor: Tt,
|
|
833
819
|
color: vt
|
|
834
820
|
} }
|
|
835
|
-
}, { dark: !0 }), jt = /*@__PURE__*/
|
|
821
|
+
}, { dark: !0 }), jt = /*@__PURE__*/ w.define([
|
|
836
822
|
{
|
|
837
|
-
tag:
|
|
823
|
+
tag: v.keyword,
|
|
838
824
|
color: Ct
|
|
839
825
|
},
|
|
840
826
|
{
|
|
841
827
|
tag: [
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
828
|
+
v.name,
|
|
829
|
+
v.deleted,
|
|
830
|
+
v.character,
|
|
831
|
+
v.propertyName,
|
|
832
|
+
v.macroName
|
|
847
833
|
],
|
|
848
834
|
color: ht
|
|
849
835
|
},
|
|
850
836
|
{
|
|
851
|
-
tag: [/*@__PURE__*/
|
|
837
|
+
tag: [/*@__PURE__*/ v.function(v.variableName), v.labelName],
|
|
852
838
|
color: bt
|
|
853
839
|
},
|
|
854
840
|
{
|
|
855
841
|
tag: [
|
|
856
|
-
|
|
857
|
-
/*@__PURE__*/
|
|
858
|
-
/*@__PURE__*/
|
|
842
|
+
v.color,
|
|
843
|
+
/*@__PURE__*/ v.constant(v.name),
|
|
844
|
+
/*@__PURE__*/ v.standard(v.name)
|
|
859
845
|
],
|
|
860
846
|
color: St
|
|
861
847
|
},
|
|
862
848
|
{
|
|
863
|
-
tag: [/*@__PURE__*/
|
|
849
|
+
tag: [/*@__PURE__*/ v.definition(v.name), v.separator],
|
|
864
850
|
color: vt
|
|
865
851
|
},
|
|
866
852
|
{
|
|
867
853
|
tag: [
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
854
|
+
v.typeName,
|
|
855
|
+
v.className,
|
|
856
|
+
v.number,
|
|
857
|
+
v.changed,
|
|
858
|
+
v.annotation,
|
|
859
|
+
v.modifier,
|
|
860
|
+
v.self,
|
|
861
|
+
v.namespace
|
|
876
862
|
],
|
|
877
863
|
color: mt
|
|
878
864
|
},
|
|
879
865
|
{
|
|
880
866
|
tag: [
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
/*@__PURE__*/
|
|
867
|
+
v.operator,
|
|
868
|
+
v.operatorKeyword,
|
|
869
|
+
v.url,
|
|
870
|
+
v.escape,
|
|
871
|
+
v.regexp,
|
|
872
|
+
v.link,
|
|
873
|
+
/*@__PURE__*/ v.special(v.string)
|
|
888
874
|
],
|
|
889
875
|
color: gt
|
|
890
876
|
},
|
|
891
877
|
{
|
|
892
|
-
tag: [
|
|
878
|
+
tag: [v.meta, v.comment],
|
|
893
879
|
color: yt
|
|
894
880
|
},
|
|
895
881
|
{
|
|
896
|
-
tag:
|
|
882
|
+
tag: v.strong,
|
|
897
883
|
fontWeight: "bold"
|
|
898
884
|
},
|
|
899
885
|
{
|
|
900
|
-
tag:
|
|
886
|
+
tag: v.emphasis,
|
|
901
887
|
fontStyle: "italic"
|
|
902
888
|
},
|
|
903
889
|
{
|
|
904
|
-
tag:
|
|
890
|
+
tag: v.strikethrough,
|
|
905
891
|
textDecoration: "line-through"
|
|
906
892
|
},
|
|
907
893
|
{
|
|
908
|
-
tag:
|
|
894
|
+
tag: v.link,
|
|
909
895
|
color: yt,
|
|
910
896
|
textDecoration: "underline"
|
|
911
897
|
},
|
|
912
898
|
{
|
|
913
|
-
tag:
|
|
899
|
+
tag: v.heading,
|
|
914
900
|
fontWeight: "bold",
|
|
915
901
|
color: ht
|
|
916
902
|
},
|
|
917
903
|
{
|
|
918
904
|
tag: [
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
/*@__PURE__*/
|
|
905
|
+
v.atom,
|
|
906
|
+
v.bool,
|
|
907
|
+
/*@__PURE__*/ v.special(v.variableName)
|
|
922
908
|
],
|
|
923
909
|
color: St
|
|
924
910
|
},
|
|
925
911
|
{
|
|
926
912
|
tag: [
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
913
|
+
v.processingInstruction,
|
|
914
|
+
v.string,
|
|
915
|
+
v.inserted
|
|
930
916
|
],
|
|
931
917
|
color: xt
|
|
932
918
|
},
|
|
933
919
|
{
|
|
934
|
-
tag:
|
|
920
|
+
tag: v.invalid,
|
|
935
921
|
color: _t
|
|
936
922
|
}
|
|
937
|
-
]), Mt = [At, /*@__PURE__*/
|
|
923
|
+
]), Mt = [At, /*@__PURE__*/ h(jt)], Nt = u.theme({ "&": { backgroundColor: "#fff" } }, { dark: !1 }), Pt = function(e) {
|
|
938
924
|
e === void 0 && (e = {});
|
|
939
|
-
var t = e, n = t.indentWithTab, r = n === void 0 || n,
|
|
940
|
-
switch (r && _.unshift(
|
|
925
|
+
var t = e, n = t.indentWithTab, r = n === void 0 || n, a = t.editable, o = a === void 0 || a, s = t.readOnly, c = s !== void 0 && s, l = t.theme, f = l === void 0 ? "light" : l, p = t.placeholder, m = p === void 0 ? "" : p, h = t.basicSetup, g = h === void 0 || h, _ = [];
|
|
926
|
+
switch (r && _.unshift(F.of([i])), g && (typeof g == "boolean" ? _.unshift(ft()) : _.unshift(ft(g))), m && _.unshift(re(m)), f) {
|
|
941
927
|
case "light":
|
|
942
928
|
_.push(Nt);
|
|
943
929
|
break;
|
|
@@ -947,7 +933,7 @@ var ft = function(e) {
|
|
|
947
933
|
case "none": break;
|
|
948
934
|
default: _.push(f);
|
|
949
935
|
}
|
|
950
|
-
return
|
|
936
|
+
return o === !1 && _.push(u.editable.of(!1)), c && _.push(d.readOnly.of(!0)), [..._];
|
|
951
937
|
}, Ft = (e) => ({
|
|
952
938
|
line: e.state.doc.lineAt(e.state.selection.main.from),
|
|
953
939
|
lineCount: e.state.doc.lines,
|
|
@@ -1007,7 +993,7 @@ var ft = function(e) {
|
|
|
1007
993
|
stop() {
|
|
1008
994
|
this.interval !== null && (clearInterval(this.interval), this.interval = null);
|
|
1009
995
|
}
|
|
1010
|
-
}, Rt = null, zt = () => typeof window > "u" ? new Lt() : (Rt ||= new Lt(), Rt), Bt =
|
|
996
|
+
}, Rt = null, zt = () => typeof window > "u" ? new Lt() : (Rt ||= new Lt(), Rt), Bt = u.theme({ "& .cm-scroller": { height: "100% !important" } }), Vt = null, Ht = null;
|
|
1011
997
|
function Ut(e, t, n, r, i, a) {
|
|
1012
998
|
if (!e && !t && !n && !r && !i && !a) return null;
|
|
1013
999
|
var o = JSON.stringify({
|
|
@@ -1018,7 +1004,7 @@ function Ut(e, t, n, r, i, a) {
|
|
|
1018
1004
|
minWidth: i,
|
|
1019
1005
|
maxWidth: a
|
|
1020
1006
|
});
|
|
1021
|
-
return o === Vt ? Ht : (Vt = o, Ht =
|
|
1007
|
+
return o === Vt ? Ht : (Vt = o, Ht = u.theme({ "&": {
|
|
1022
1008
|
height: e,
|
|
1023
1009
|
minHeight: t,
|
|
1024
1010
|
maxHeight: n,
|
|
@@ -1029,96 +1015,96 @@ function Ut(e, t, n, r, i, a) {
|
|
|
1029
1015
|
}
|
|
1030
1016
|
//#endregion
|
|
1031
1017
|
//#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
|
|
1032
|
-
var Wt =
|
|
1018
|
+
var Wt = z.define(), Gt = 200, Kt = [];
|
|
1033
1019
|
function qt(e) {
|
|
1034
|
-
var t = e.value, n = e.selection, r = e.onChange, i = e.onStatistics, a = e.onCreateEditor, o = e.onUpdate, s = e.extensions, c = s === void 0 ? Kt : s,
|
|
1035
|
-
e.docChanged && typeof r == "function" && !e.transactions.some((e) => e.annotation(Wt)) && (
|
|
1036
|
-
if (
|
|
1037
|
-
var e =
|
|
1038
|
-
|
|
1020
|
+
var t = e.value, n = e.selection, r = e.onChange, i = e.onStatistics, a = e.onCreateEditor, o = e.onUpdate, s = e.extensions, c = s === void 0 ? Kt : s, l = e.autoFocus, f = e.theme, p = f === void 0 ? "light" : f, m = e.height, h = m === void 0 ? null : m, g = e.minHeight, _ = g === void 0 ? null : g, v = e.maxHeight, ee = v === void 0 ? null : v, te = e.width, b = te === void 0 ? null : te, x = e.minWidth, S = x === void 0 ? null : x, ne = e.maxWidth, C = ne === void 0 ? null : ne, re = e.placeholder, w = re === void 0 ? "" : re, T = e.editable, ie = T === void 0 || T, E = e.readOnly, D = E !== void 0 && E, O = e.indentWithTab, k = O === void 0 || O, A = e.basicSetup, j = A === void 0 || A, M = e.root, N = e.initialState, P = (0, U.useState)(), F = P[0], ae = P[1], oe = (0, U.useState)(), I = oe[0], L = oe[1], se = (0, U.useState)(), R = se[0], z = se[1], B = (0, U.useState)(() => ({ current: null }))[0], V = (0, U.useState)(() => ({ current: null }))[0], ce = Ut(h, _, ee, b, S, C), le = u.updateListener.of((e) => {
|
|
1021
|
+
e.docChanged && typeof r == "function" && !e.transactions.some((e) => e.annotation(Wt)) && (B.current ? B.current.reset() : (B.current = new It(() => {
|
|
1022
|
+
if (V.current) {
|
|
1023
|
+
var e = V.current;
|
|
1024
|
+
V.current = null, e();
|
|
1039
1025
|
}
|
|
1040
|
-
|
|
1041
|
-
}, Gt), zt().add(
|
|
1042
|
-
}),
|
|
1026
|
+
B.current = null;
|
|
1027
|
+
}, Gt), zt().add(B.current)), r(e.state.doc.toString(), e)), i && i(Ft(e));
|
|
1028
|
+
}), ue = Pt({
|
|
1043
1029
|
theme: p,
|
|
1044
|
-
editable:
|
|
1030
|
+
editable: ie,
|
|
1045
1031
|
readOnly: D,
|
|
1046
1032
|
placeholder: w,
|
|
1047
1033
|
indentWithTab: k,
|
|
1048
1034
|
basicSetup: j
|
|
1049
|
-
}),
|
|
1050
|
-
|
|
1051
|
-
...
|
|
1035
|
+
}), H = [
|
|
1036
|
+
le,
|
|
1037
|
+
...ce ? [ce] : [],
|
|
1052
1038
|
Bt,
|
|
1053
|
-
...
|
|
1039
|
+
...ue
|
|
1054
1040
|
];
|
|
1055
|
-
return o && typeof o == "function" &&
|
|
1056
|
-
if (
|
|
1041
|
+
return o && typeof o == "function" && H.push(u.updateListener.of(o)), H = H.concat(c), (0, U.useLayoutEffect)(() => {
|
|
1042
|
+
if (F && !R) {
|
|
1057
1043
|
var e = {
|
|
1058
1044
|
doc: t,
|
|
1059
1045
|
selection: n,
|
|
1060
|
-
extensions:
|
|
1061
|
-
}, r =
|
|
1062
|
-
if (
|
|
1063
|
-
var i = new
|
|
1046
|
+
extensions: H
|
|
1047
|
+
}, r = N ? d.fromJSON(N.json, e, N.fields) : d.create(e);
|
|
1048
|
+
if (z(r), !I) {
|
|
1049
|
+
var i = new u({
|
|
1064
1050
|
state: r,
|
|
1065
|
-
parent:
|
|
1066
|
-
root:
|
|
1051
|
+
parent: F,
|
|
1052
|
+
root: M
|
|
1067
1053
|
});
|
|
1068
|
-
|
|
1054
|
+
L(i), a && a(i, r);
|
|
1069
1055
|
}
|
|
1070
1056
|
}
|
|
1071
1057
|
return () => {
|
|
1072
|
-
|
|
1058
|
+
I && (z(void 0), L(void 0));
|
|
1073
1059
|
};
|
|
1074
|
-
}, [
|
|
1075
|
-
e.container &&
|
|
1076
|
-
}, [e.container]), (0,
|
|
1077
|
-
|
|
1078
|
-
}, [
|
|
1079
|
-
|
|
1080
|
-
}, [
|
|
1081
|
-
|
|
1060
|
+
}, [F, R]), (0, U.useEffect)(() => {
|
|
1061
|
+
e.container && ae(e.container);
|
|
1062
|
+
}, [e.container]), (0, U.useEffect)(() => () => {
|
|
1063
|
+
I && (I.destroy(), L(void 0)), B.current &&= (B.current.cancel(), null);
|
|
1064
|
+
}, [I]), (0, U.useEffect)(() => {
|
|
1065
|
+
l && I && I.focus();
|
|
1066
|
+
}, [l, I]), (0, U.useEffect)(() => {
|
|
1067
|
+
I && I.dispatch({ effects: y.reconfigure.of(H) });
|
|
1082
1068
|
}, [
|
|
1083
1069
|
p,
|
|
1084
1070
|
c,
|
|
1085
1071
|
h,
|
|
1086
1072
|
_,
|
|
1087
1073
|
ee,
|
|
1088
|
-
|
|
1089
|
-
|
|
1074
|
+
b,
|
|
1075
|
+
S,
|
|
1090
1076
|
C,
|
|
1091
1077
|
w,
|
|
1092
|
-
|
|
1078
|
+
ie,
|
|
1093
1079
|
D,
|
|
1094
1080
|
k,
|
|
1095
1081
|
j,
|
|
1096
1082
|
r,
|
|
1097
1083
|
o
|
|
1098
|
-
]), (0,
|
|
1084
|
+
]), (0, U.useEffect)(() => {
|
|
1099
1085
|
if (t !== void 0) {
|
|
1100
|
-
var e =
|
|
1101
|
-
if (
|
|
1102
|
-
var n =
|
|
1103
|
-
|
|
1086
|
+
var e = I ? I.state.doc.toString() : "";
|
|
1087
|
+
if (I && t !== e) {
|
|
1088
|
+
var n = B.current && !B.current.isDone, r = () => {
|
|
1089
|
+
I && t !== I.state.doc.toString() && I.dispatch({
|
|
1104
1090
|
changes: {
|
|
1105
1091
|
from: 0,
|
|
1106
|
-
to:
|
|
1092
|
+
to: I.state.doc.toString().length,
|
|
1107
1093
|
insert: t || ""
|
|
1108
1094
|
},
|
|
1109
1095
|
annotations: [Wt.of(!0)]
|
|
1110
1096
|
});
|
|
1111
1097
|
};
|
|
1112
|
-
n ?
|
|
1098
|
+
n ? V.current = r : r();
|
|
1113
1099
|
}
|
|
1114
1100
|
}
|
|
1115
|
-
}, [t,
|
|
1116
|
-
state:
|
|
1117
|
-
setState:
|
|
1118
|
-
view:
|
|
1119
|
-
setView:
|
|
1120
|
-
container:
|
|
1121
|
-
setContainer:
|
|
1101
|
+
}, [t, I]), {
|
|
1102
|
+
state: R,
|
|
1103
|
+
setState: z,
|
|
1104
|
+
view: I,
|
|
1105
|
+
setView: L,
|
|
1106
|
+
container: F,
|
|
1107
|
+
setContainer: ae
|
|
1122
1108
|
};
|
|
1123
1109
|
}
|
|
1124
1110
|
//#endregion
|
|
@@ -1147,49 +1133,49 @@ var Jt = n(), Yt = [
|
|
|
1147
1133
|
"readOnly",
|
|
1148
1134
|
"root",
|
|
1149
1135
|
"initialState"
|
|
1150
|
-
], Xt = /*#__PURE__*/ (0,
|
|
1151
|
-
var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection,
|
|
1152
|
-
root:
|
|
1136
|
+
], Xt = /*#__PURE__*/ (0, U.forwardRef)((e, t) => {
|
|
1137
|
+
var n = e.className, r = e.value, i = r === void 0 ? "" : r, a = e.selection, s = e.extensions, l = s === void 0 ? [] : s, u = e.onChange, d = e.onStatistics, f = e.onCreateEditor, p = e.onUpdate, m = e.autoFocus, h = e.theme, g = h === void 0 ? "light" : h, _ = e.height, v = e.minHeight, ee = e.maxHeight, te = e.width, y = e.minWidth, b = e.maxWidth, x = e.basicSetup, S = e.placeholder, ne = e.indentWithTab, C = e.editable, re = e.readOnly, w = e.root, T = e.initialState, ie = c(e, Yt), E = (0, U.useRef)(null), D = qt({
|
|
1138
|
+
root: w,
|
|
1153
1139
|
value: i,
|
|
1154
|
-
autoFocus:
|
|
1155
|
-
theme:
|
|
1156
|
-
height:
|
|
1157
|
-
minHeight:
|
|
1158
|
-
maxHeight:
|
|
1159
|
-
width:
|
|
1140
|
+
autoFocus: m,
|
|
1141
|
+
theme: g,
|
|
1142
|
+
height: _,
|
|
1143
|
+
minHeight: v,
|
|
1144
|
+
maxHeight: ee,
|
|
1145
|
+
width: te,
|
|
1160
1146
|
minWidth: y,
|
|
1161
1147
|
maxWidth: b,
|
|
1162
|
-
basicSetup:
|
|
1163
|
-
placeholder:
|
|
1148
|
+
basicSetup: x,
|
|
1149
|
+
placeholder: S,
|
|
1164
1150
|
indentWithTab: ne,
|
|
1165
|
-
editable:
|
|
1166
|
-
readOnly:
|
|
1151
|
+
editable: C,
|
|
1152
|
+
readOnly: re,
|
|
1167
1153
|
selection: a,
|
|
1168
|
-
onChange:
|
|
1169
|
-
onStatistics:
|
|
1170
|
-
onCreateEditor:
|
|
1171
|
-
onUpdate:
|
|
1172
|
-
extensions:
|
|
1173
|
-
initialState:
|
|
1174
|
-
}),
|
|
1175
|
-
(0,
|
|
1176
|
-
editor:
|
|
1177
|
-
state:
|
|
1178
|
-
view:
|
|
1154
|
+
onChange: u,
|
|
1155
|
+
onStatistics: d,
|
|
1156
|
+
onCreateEditor: f,
|
|
1157
|
+
onUpdate: p,
|
|
1158
|
+
extensions: l,
|
|
1159
|
+
initialState: T
|
|
1160
|
+
}), O = D.state, k = D.view, A = D.container, j = D.setContainer;
|
|
1161
|
+
(0, U.useImperativeHandle)(t, () => ({
|
|
1162
|
+
editor: E.current,
|
|
1163
|
+
state: O,
|
|
1164
|
+
view: k
|
|
1179
1165
|
}), [
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1166
|
+
E,
|
|
1167
|
+
A,
|
|
1168
|
+
O,
|
|
1169
|
+
k
|
|
1184
1170
|
]);
|
|
1185
|
-
var
|
|
1186
|
-
|
|
1187
|
-
}, [
|
|
1171
|
+
var M = (0, U.useCallback)((e) => {
|
|
1172
|
+
E.current = e, j(e);
|
|
1173
|
+
}, [j]);
|
|
1188
1174
|
if (typeof i != "string") throw Error("value must be typeof string but got " + typeof i);
|
|
1189
|
-
var
|
|
1190
|
-
return /*#__PURE__*/ (0, Jt.jsx)("div",
|
|
1191
|
-
ref:
|
|
1192
|
-
className: "" +
|
|
1175
|
+
var N = typeof g == "string" ? "cm-theme-" + g : "cm-theme";
|
|
1176
|
+
return /*#__PURE__*/ (0, Jt.jsx)("div", o({
|
|
1177
|
+
ref: M,
|
|
1178
|
+
className: "" + N + (n ? " " + n : "")
|
|
1193
1179
|
}, ie));
|
|
1194
1180
|
});
|
|
1195
1181
|
Xt.displayName = "CodeMirror";
|