stepzen-graphiql 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/dist/GraphiQLExplorer.d.ts +10 -0
- package/dist/Range-CPFFy5pj.mjs +26 -0
- package/dist/Range-CUfOrqgY.js +1 -0
- package/dist/SchemaReference-94TE3IPs.mjs +146 -0
- package/dist/SchemaReference-DKgkDdcV.js +1 -0
- package/dist/brace-fold-9JQ5QTIN.mjs +122 -0
- package/dist/brace-fold-CUTcWTRf.js +1 -0
- package/dist/closebrackets-BL_z-rKi.mjs +165 -0
- package/dist/closebrackets-DHbhKDzk.js +2 -0
- package/dist/codemirror-CxfyhJc1.mjs +27 -0
- package/dist/codemirror-DMBo1i5w.js +24 -0
- package/dist/codemirror-DgPcZxSc.mjs +6121 -0
- package/dist/codemirror-Kv5dN_jU.js +1 -0
- package/dist/comment-CAsllqoy.js +2 -0
- package/dist/comment-DscvXuhU.mjs +150 -0
- package/dist/components/ExplorerPage/ExplorerHeader.d.ts +3 -0
- package/dist/components/ExplorerPage/ExplorerPage.d.ts +8 -0
- package/dist/components/ExplorerPage/GraphiQLInterface.d.ts +60 -0
- package/dist/components/ExplorerPage/Snippets.d.ts +17 -0
- package/dist/components/ExplorerPage/clearTooltip.d.ts +1 -0
- package/dist/components/exporterPlugin/CodeExporter.d.ts +93 -0
- package/dist/components/exporterPlugin/index.d.ts +7 -0
- package/dist/components/exporterPlugin/snippets/__helpers__/getOptionCombinations.d.ts +2 -0
- package/dist/components/exporterPlugin/snippets/index.d.ts +2 -0
- package/dist/components/exporterPlugin/snippets/javascript/fetch.d.ts +3 -0
- package/dist/components/exporterPlugin/snippets/javascript/reactApollo.d.ts +3 -0
- package/dist/components/exporterPlugin/toposort.d.ts +2 -0
- package/dist/components/exporterPlugin/useExporterPlugin.d.ts +19 -0
- package/dist/components/exporterPlugin/utils/capitalizeFirstLetter.d.ts +1 -0
- package/dist/components/exporterPlugin/utils/index.d.ts +7 -0
- package/dist/components/exporterPlugin/utils/jsCommentsFactory.d.ts +1 -0
- package/dist/contexts/EnvironmentContext.d.ts +37 -0
- package/dist/contexts/endpoint.d.ts +39 -0
- package/dist/dialog-BF69fCJO.js +1 -0
- package/dist/dialog-Ci1bnuc2.mjs +74 -0
- package/dist/dialog-Dh2DOTOu.js +1 -0
- package/dist/dialog-nXZjpybF.mjs +26 -0
- package/dist/foldgutter-DiGsqcNo.mjs +238 -0
- package/dist/foldgutter-Do6XNu8o.js +1 -0
- package/dist/forEachState-DA54msa8.mjs +11 -0
- package/dist/forEachState-DY_pA9Bd.js +1 -0
- package/dist/hint-BNpE1H1l.js +1 -0
- package/dist/hint-BQ9WwQj_.mjs +123 -0
- package/dist/hint-dA98kXsJ.js +1 -0
- package/dist/hint-ptEpgPx0.mjs +24 -0
- package/dist/index-BeOZF5ut.js +650 -0
- package/dist/index-GG9J9CZE.js +1 -0
- package/dist/index-Iqk59VQ1.mjs +89463 -0
- package/dist/index-_X52-Rov.mjs +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +4 -0
- package/dist/info-BhA0aX7P.js +1 -0
- package/dist/info-DavOVk27.mjs +99 -0
- package/dist/info-addon-BppfpWGs.js +1 -0
- package/dist/info-addon-jclzOzZb.mjs +66 -0
- package/dist/javascript-Bk78gZXV.js +1 -0
- package/dist/javascript-HLYdFIhF.mjs +26 -0
- package/dist/javascript-RO_jaPiE.mjs +707 -0
- package/dist/javascript-poxRzxcy.js +1 -0
- package/dist/jsx-C8WdRUVV.mjs +414 -0
- package/dist/jsx-LzpFIybc.js +1 -0
- package/dist/jump-BR4c9I5u.mjs +85 -0
- package/dist/jump-C3iGjDkY.js +1 -0
- package/dist/jump-to-line-BZOuAkwy.js +1 -0
- package/dist/jump-to-line-pXiAP2DT.mjs +61 -0
- package/dist/lib/constants.d.ts +6 -0
- package/dist/lib/graphiql-helpers.d.ts +86 -0
- package/dist/lib/helpers.d.ts +53 -0
- package/dist/lint-Aw1wLmnw.mjs +112 -0
- package/dist/lint-Bf0wS1Ab.js +1 -0
- package/dist/lint-DL7I1P7I.mjs +272 -0
- package/dist/lint-GZ9x3Nii.js +6 -0
- package/dist/lint-L3DNAS-R.mjs +216 -0
- package/dist/lint-azLq6zoS.js +1 -0
- package/dist/matchbrackets-BB4g2Y6d.mjs +87 -0
- package/dist/matchbrackets-DJZ2jVlm.js +1 -0
- package/dist/matchbrackets-DNVziiaa.mjs +26 -0
- package/dist/matchbrackets-DPv_MB7c.js +1 -0
- package/dist/mode-Bad_JbYc.js +1 -0
- package/dist/mode-BuM4vqHx.js +1 -0
- package/dist/mode-C9FNlffS.js +1 -0
- package/dist/mode-CtmJdiWw.mjs +73 -0
- package/dist/mode-CxFmwOoU.mjs +25 -0
- package/dist/mode-DQHzanY6.mjs +64 -0
- package/dist/mode-indent-9VnFlqY-.mjs +8 -0
- package/dist/mode-indent-m3TP74Ia.js +1 -0
- package/dist/search-BUZtJ7Zg.mjs +268 -0
- package/dist/search-DxgAMk6j.js +2 -0
- package/dist/searchcursor-BrHSjZde.mjs +26 -0
- package/dist/searchcursor-Cf1_qqgl.js +1 -0
- package/dist/searchcursor-DHtNMOPb.mjs +239 -0
- package/dist/searchcursor-eGwb3e2h.js +7 -0
- package/dist/show-hint-CYURLLrO.js +1 -0
- package/dist/show-hint-CmHZP7k_.mjs +357 -0
- package/dist/style.css +9 -0
- package/dist/sublime-BKhMEkpg.js +6 -0
- package/dist/sublime-Dmy11GSm.mjs +563 -0
- package/dist/types/config.d.ts +7 -0
- package/package.json +111 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { g as K } from "./index-Iqk59VQ1.mjs";
|
|
2
|
+
import { r as L } from "./codemirror-DgPcZxSc.mjs";
|
|
3
|
+
import { r as z } from "./searchcursor-DHtNMOPb.mjs";
|
|
4
|
+
import { r as U } from "./dialog-Ci1bnuc2.mjs";
|
|
5
|
+
function B(m, R) {
|
|
6
|
+
for (var a = 0; a < R.length; a++) {
|
|
7
|
+
const d = R[a];
|
|
8
|
+
if (typeof d != "string" && !Array.isArray(d)) {
|
|
9
|
+
for (const y in d)
|
|
10
|
+
if (y !== "default" && !(y in m)) {
|
|
11
|
+
const g = Object.getOwnPropertyDescriptor(d, y);
|
|
12
|
+
g && Object.defineProperty(m, y, g.get ? g : {
|
|
13
|
+
enumerable: !0,
|
|
14
|
+
get: () => d[y]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze(Object.defineProperty(m, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
}
|
|
21
|
+
var F = { exports: {} }, Q;
|
|
22
|
+
function M() {
|
|
23
|
+
return Q || (Q = 1, function(m, R) {
|
|
24
|
+
(function(a) {
|
|
25
|
+
a(L(), z(), U());
|
|
26
|
+
})(function(a) {
|
|
27
|
+
a.defineOption("search", { bottom: !1 });
|
|
28
|
+
function d(e, t) {
|
|
29
|
+
return typeof e == "string" ? e = new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), t ? "gi" : "g") : e.global || (e = new RegExp(e.source, e.ignoreCase ? "gi" : "g")), { token: function(n) {
|
|
30
|
+
e.lastIndex = n.pos;
|
|
31
|
+
var o = e.exec(n.string);
|
|
32
|
+
if (o && o.index == n.pos)
|
|
33
|
+
return n.pos += o[0].length || 1, "searching";
|
|
34
|
+
o ? n.pos = o.index : n.skipToEnd();
|
|
35
|
+
} };
|
|
36
|
+
}
|
|
37
|
+
function y() {
|
|
38
|
+
this.posFrom = this.posTo = this.lastQuery = this.query = null, this.overlay = null;
|
|
39
|
+
}
|
|
40
|
+
function g(e) {
|
|
41
|
+
return e.state.search || (e.state.search = new y());
|
|
42
|
+
}
|
|
43
|
+
function O(e) {
|
|
44
|
+
return typeof e == "string" && e == e.toLowerCase();
|
|
45
|
+
}
|
|
46
|
+
function S(e, t, n) {
|
|
47
|
+
return e.getSearchCursor(t, n, { caseFold: O(t), multiline: !0 });
|
|
48
|
+
}
|
|
49
|
+
function A(e, t, n, o, r) {
|
|
50
|
+
e.openDialog(t, o, {
|
|
51
|
+
value: n,
|
|
52
|
+
selectValueOnOpen: !0,
|
|
53
|
+
closeOnEnter: !1,
|
|
54
|
+
onClose: function() {
|
|
55
|
+
b(e);
|
|
56
|
+
},
|
|
57
|
+
onKeyDown: r,
|
|
58
|
+
bottom: e.options.search.bottom
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function D(e, t, n, o, r) {
|
|
62
|
+
e.openDialog ? e.openDialog(t, r, { value: o, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : r(prompt(n, o));
|
|
63
|
+
}
|
|
64
|
+
function j(e, t, n, o) {
|
|
65
|
+
e.openConfirm ? e.openConfirm(t, o) : confirm(n) && o[0]();
|
|
66
|
+
}
|
|
67
|
+
function P(e) {
|
|
68
|
+
return e.replace(/\\([nrt\\])/g, function(t, n) {
|
|
69
|
+
return n == "n" ? `
|
|
70
|
+
` : n == "r" ? "\r" : n == "t" ? " " : n == "\\" ? "\\" : t;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function C(e) {
|
|
74
|
+
var t = e.match(/^\/(.*)\/([a-z]*)$/);
|
|
75
|
+
if (t)
|
|
76
|
+
try {
|
|
77
|
+
e = new RegExp(t[1], t[2].indexOf("i") == -1 ? "" : "i");
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
else
|
|
81
|
+
e = P(e);
|
|
82
|
+
return (typeof e == "string" ? e == "" : e.test("")) && (e = /x^/), e;
|
|
83
|
+
}
|
|
84
|
+
function N(e, t, n) {
|
|
85
|
+
t.queryText = n, t.query = C(n), e.removeOverlay(t.overlay, O(t.query)), t.overlay = d(t.query, O(t.query)), e.addOverlay(t.overlay), e.showMatchesOnScrollbar && (t.annotate && (t.annotate.clear(), t.annotate = null), t.annotate = e.showMatchesOnScrollbar(t.query, O(t.query)));
|
|
86
|
+
}
|
|
87
|
+
function x(e, t, n, o) {
|
|
88
|
+
var r = g(e);
|
|
89
|
+
if (r.query) return w(e, t);
|
|
90
|
+
var i = e.getSelection() || r.lastQuery;
|
|
91
|
+
if (i instanceof RegExp && i.source == "x^" && (i = null), n && e.openDialog) {
|
|
92
|
+
var p = null, f = function(l, v) {
|
|
93
|
+
a.e_stop(v), l && (l != r.queryText && (N(e, r, l), r.posFrom = r.posTo = e.getCursor()), p && (p.style.opacity = 1), w(e, v.shiftKey, function(h, c) {
|
|
94
|
+
var u;
|
|
95
|
+
c.line < 3 && document.querySelector && (u = e.display.wrapper.querySelector(".CodeMirror-dialog")) && u.getBoundingClientRect().bottom - 4 > e.cursorCoords(c, "window").top && ((p = u).style.opacity = 0.4);
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
A(e, T(e), i, f, function(l, v) {
|
|
99
|
+
var h = a.keyName(l), c = e.getOption("extraKeys"), u = c && c[h] || a.keyMap[e.getOption("keyMap")][h];
|
|
100
|
+
u == "findNext" || u == "findPrev" || u == "findPersistentNext" || u == "findPersistentPrev" ? (a.e_stop(l), N(e, g(e), v), e.execCommand(u)) : (u == "find" || u == "findPersistent") && (a.e_stop(l), f(v, l));
|
|
101
|
+
}), o && i && (N(e, r, i), w(e, t));
|
|
102
|
+
} else
|
|
103
|
+
D(e, T(e), "Search for:", i, function(l) {
|
|
104
|
+
l && !r.query && e.operation(function() {
|
|
105
|
+
N(e, r, l), r.posFrom = r.posTo = e.getCursor(), w(e, t);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function w(e, t, n) {
|
|
110
|
+
e.operation(function() {
|
|
111
|
+
var o = g(e), r = S(e, o.query, t ? o.posFrom : o.posTo);
|
|
112
|
+
!r.find(t) && (r = S(e, o.query, t ? a.Pos(e.lastLine()) : a.Pos(e.firstLine(), 0)), !r.find(t)) || (e.setSelection(r.from(), r.to()), e.scrollIntoView({ from: r.from(), to: r.to() }, 20), o.posFrom = r.from(), o.posTo = r.to(), n && n(r.from(), r.to()));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function b(e) {
|
|
116
|
+
e.operation(function() {
|
|
117
|
+
var t = g(e);
|
|
118
|
+
t.lastQuery = t.query, t.query && (t.query = t.queryText = null, e.removeOverlay(t.overlay), t.annotate && (t.annotate.clear(), t.annotate = null));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function s(e, t) {
|
|
122
|
+
var n = e ? document.createElement(e) : document.createDocumentFragment();
|
|
123
|
+
for (var o in t)
|
|
124
|
+
n[o] = t[o];
|
|
125
|
+
for (var r = 2; r < arguments.length; r++) {
|
|
126
|
+
var i = arguments[r];
|
|
127
|
+
n.appendChild(typeof i == "string" ? document.createTextNode(i) : i);
|
|
128
|
+
}
|
|
129
|
+
return n;
|
|
130
|
+
}
|
|
131
|
+
function T(e) {
|
|
132
|
+
var t = s(
|
|
133
|
+
"label",
|
|
134
|
+
{ className: "CodeMirror-search-label" },
|
|
135
|
+
e.phrase("Search:"),
|
|
136
|
+
s("input", {
|
|
137
|
+
type: "text",
|
|
138
|
+
style: "width: 10em",
|
|
139
|
+
className: "CodeMirror-search-field",
|
|
140
|
+
id: "CodeMirror-search-field"
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
return t.setAttribute("for", "CodeMirror-search-field"), s(
|
|
144
|
+
"",
|
|
145
|
+
null,
|
|
146
|
+
t,
|
|
147
|
+
" ",
|
|
148
|
+
s(
|
|
149
|
+
"span",
|
|
150
|
+
{ style: "color: #666", className: "CodeMirror-search-hint" },
|
|
151
|
+
e.phrase("(Use /re/ syntax for regexp search)")
|
|
152
|
+
)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
function k(e) {
|
|
156
|
+
return s(
|
|
157
|
+
"",
|
|
158
|
+
null,
|
|
159
|
+
" ",
|
|
160
|
+
s("input", { type: "text", style: "width: 10em", className: "CodeMirror-search-field" }),
|
|
161
|
+
" ",
|
|
162
|
+
s(
|
|
163
|
+
"span",
|
|
164
|
+
{ style: "color: #666", className: "CodeMirror-search-hint" },
|
|
165
|
+
e.phrase("(Use /re/ syntax for regexp search)")
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function I(e) {
|
|
170
|
+
return s(
|
|
171
|
+
"",
|
|
172
|
+
null,
|
|
173
|
+
s("span", { className: "CodeMirror-search-label" }, e.phrase("With:")),
|
|
174
|
+
" ",
|
|
175
|
+
s("input", { type: "text", style: "width: 10em", className: "CodeMirror-search-field" })
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function V(e) {
|
|
179
|
+
return s(
|
|
180
|
+
"",
|
|
181
|
+
null,
|
|
182
|
+
s("span", { className: "CodeMirror-search-label" }, e.phrase("Replace?")),
|
|
183
|
+
" ",
|
|
184
|
+
s("button", {}, e.phrase("Yes")),
|
|
185
|
+
" ",
|
|
186
|
+
s("button", {}, e.phrase("No")),
|
|
187
|
+
" ",
|
|
188
|
+
s("button", {}, e.phrase("All")),
|
|
189
|
+
" ",
|
|
190
|
+
s("button", {}, e.phrase("Stop"))
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
function _(e, t, n) {
|
|
194
|
+
e.operation(function() {
|
|
195
|
+
for (var o = S(e, t); o.findNext(); )
|
|
196
|
+
if (typeof t != "string") {
|
|
197
|
+
var r = e.getRange(o.from(), o.to()).match(t);
|
|
198
|
+
o.replace(n.replace(/\$(\d)/g, function(i, p) {
|
|
199
|
+
return r[p];
|
|
200
|
+
}));
|
|
201
|
+
} else o.replace(n);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function E(e, t) {
|
|
205
|
+
if (!e.getOption("readOnly")) {
|
|
206
|
+
var n = e.getSelection() || g(e).lastQuery, o = t ? e.phrase("Replace all:") : e.phrase("Replace:"), r = s(
|
|
207
|
+
"",
|
|
208
|
+
null,
|
|
209
|
+
s("span", { className: "CodeMirror-search-label" }, o),
|
|
210
|
+
k(e)
|
|
211
|
+
);
|
|
212
|
+
D(e, r, o, n, function(i) {
|
|
213
|
+
i && (i = C(i), D(e, I(e), e.phrase("Replace with:"), "", function(p) {
|
|
214
|
+
if (p = P(p), t)
|
|
215
|
+
_(e, i, p);
|
|
216
|
+
else {
|
|
217
|
+
b(e);
|
|
218
|
+
var f = S(e, i, e.getCursor("from")), l = function() {
|
|
219
|
+
var h = f.from(), c;
|
|
220
|
+
!(c = f.findNext()) && (f = S(e, i), !(c = f.findNext()) || h && f.from().line == h.line && f.from().ch == h.ch) || (e.setSelection(f.from(), f.to()), e.scrollIntoView({ from: f.from(), to: f.to() }), j(
|
|
221
|
+
e,
|
|
222
|
+
V(e),
|
|
223
|
+
e.phrase("Replace?"),
|
|
224
|
+
[
|
|
225
|
+
function() {
|
|
226
|
+
v(c);
|
|
227
|
+
},
|
|
228
|
+
l,
|
|
229
|
+
function() {
|
|
230
|
+
_(e, i, p);
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
));
|
|
234
|
+
}, v = function(h) {
|
|
235
|
+
f.replace(typeof i == "string" ? p : p.replace(/\$(\d)/g, function(c, u) {
|
|
236
|
+
return h[u];
|
|
237
|
+
})), l();
|
|
238
|
+
};
|
|
239
|
+
l();
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
a.commands.find = function(e) {
|
|
246
|
+
b(e), x(e);
|
|
247
|
+
}, a.commands.findPersistent = function(e) {
|
|
248
|
+
b(e), x(e, !1, !0);
|
|
249
|
+
}, a.commands.findPersistentNext = function(e) {
|
|
250
|
+
x(e, !1, !0, !0);
|
|
251
|
+
}, a.commands.findPersistentPrev = function(e) {
|
|
252
|
+
x(e, !0, !0, !0);
|
|
253
|
+
}, a.commands.findNext = x, a.commands.findPrev = function(e) {
|
|
254
|
+
x(e, !0);
|
|
255
|
+
}, a.commands.clearSearch = b, a.commands.replace = E, a.commands.replaceAll = function(e) {
|
|
256
|
+
E(e, !0);
|
|
257
|
+
};
|
|
258
|
+
});
|
|
259
|
+
}()), F.exports;
|
|
260
|
+
}
|
|
261
|
+
var $ = M();
|
|
262
|
+
const W = /* @__PURE__ */ K($), X = /* @__PURE__ */ B({
|
|
263
|
+
__proto__: null,
|
|
264
|
+
default: W
|
|
265
|
+
}, [$]);
|
|
266
|
+
export {
|
|
267
|
+
X as s
|
|
268
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const K=require("./index-BeOZF5ut.js"),L=require("./codemirror-DMBo1i5w.js"),z=require("./searchcursor-eGwb3e2h.js"),U=require("./dialog-Dh2DOTOu.js");function B(O,R){for(var a=0;a<R.length;a++){const d=R[a];if(typeof d!="string"&&!Array.isArray(d)){for(const y in d)if(y!=="default"&&!(y in O)){const h=Object.getOwnPropertyDescriptor(d,y);h&&Object.defineProperty(O,y,h.get?h:{enumerable:!0,get:()=>d[y]})}}}return Object.freeze(Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}))}var F={exports:{}},Q;function M(){return Q||(Q=1,function(O,R){(function(a){a(L.requireCodemirror(),z.requireSearchcursor(),U.requireDialog())})(function(a){a.defineOption("search",{bottom:!1});function d(e,n){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var o=e.exec(t.string);if(o&&o.index==t.pos)return t.pos+=o[0].length||1,"searching";o?t.pos=o.index:t.skipToEnd()}}}function y(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function h(e){return e.state.search||(e.state.search=new y)}function N(e){return typeof e=="string"&&e==e.toLowerCase()}function S(e,n,t){return e.getSearchCursor(n,t,{caseFold:N(n),multiline:!0})}function A(e,n,t,o,r){e.openDialog(n,o,{value:t,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(e)},onKeyDown:r,bottom:e.options.search.bottom})}function D(e,n,t,o,r){e.openDialog?e.openDialog(n,r,{value:o,selectValueOnOpen:!0,bottom:e.options.search.bottom}):r(prompt(t,o))}function j(e,n,t,o){e.openConfirm?e.openConfirm(n,o):confirm(t)&&o[0]()}function P(e){return e.replace(/\\([nrt\\])/g,function(n,t){return t=="n"?`
|
|
2
|
+
`:t=="r"?"\r":t=="t"?" ":t=="\\"?"\\":n})}function C(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],n[2].indexOf("i")==-1?"":"i")}catch{}else e=P(e);return(typeof e=="string"?e=="":e.test(""))&&(e=/x^/),e}function w(e,n,t){n.queryText=t,n.query=C(t),e.removeOverlay(n.overlay,N(n.query)),n.overlay=d(n.query,N(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,N(n.query)))}function x(e,n,t,o){var r=h(e);if(r.query)return m(e,n);var i=e.getSelection()||r.lastQuery;if(i instanceof RegExp&&i.source=="x^"&&(i=null),t&&e.openDialog){var p=null,f=function(l,v){a.e_stop(v),l&&(l!=r.queryText&&(w(e,r,l),r.posFrom=r.posTo=e.getCursor()),p&&(p.style.opacity=1),m(e,v.shiftKey,function(g,c){var u;c.line<3&&document.querySelector&&(u=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&u.getBoundingClientRect().bottom-4>e.cursorCoords(c,"window").top&&((p=u).style.opacity=.4)}))};A(e,T(e),i,f,function(l,v){var g=a.keyName(l),c=e.getOption("extraKeys"),u=c&&c[g]||a.keyMap[e.getOption("keyMap")][g];u=="findNext"||u=="findPrev"||u=="findPersistentNext"||u=="findPersistentPrev"?(a.e_stop(l),w(e,h(e),v),e.execCommand(u)):(u=="find"||u=="findPersistent")&&(a.e_stop(l),f(v,l))}),o&&i&&(w(e,r,i),m(e,n))}else D(e,T(e),"Search for:",i,function(l){l&&!r.query&&e.operation(function(){w(e,r,l),r.posFrom=r.posTo=e.getCursor(),m(e,n)})})}function m(e,n,t){e.operation(function(){var o=h(e),r=S(e,o.query,n?o.posFrom:o.posTo);!r.find(n)&&(r=S(e,o.query,n?a.Pos(e.lastLine()):a.Pos(e.firstLine(),0)),!r.find(n))||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()},20),o.posFrom=r.from(),o.posTo=r.to(),t&&t(r.from(),r.to()))})}function b(e){e.operation(function(){var n=h(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))})}function s(e,n){var t=e?document.createElement(e):document.createDocumentFragment();for(var o in n)t[o]=n[o];for(var r=2;r<arguments.length;r++){var i=arguments[r];t.appendChild(typeof i=="string"?document.createTextNode(i):i)}return t}function T(e){var n=s("label",{className:"CodeMirror-search-label"},e.phrase("Search:"),s("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return n.setAttribute("for","CodeMirror-search-field"),s("",null,n," ",s("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function k(e){return s("",null," ",s("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",s("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function I(e){return s("",null,s("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",s("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function V(e){return s("",null,s("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",s("button",{},e.phrase("Yes"))," ",s("button",{},e.phrase("No"))," ",s("button",{},e.phrase("All"))," ",s("button",{},e.phrase("Stop")))}function _(e,n,t){e.operation(function(){for(var o=S(e,n);o.findNext();)if(typeof n!="string"){var r=e.getRange(o.from(),o.to()).match(n);o.replace(t.replace(/\$(\d)/g,function(i,p){return r[p]}))}else o.replace(t)})}function E(e,n){if(!e.getOption("readOnly")){var t=e.getSelection()||h(e).lastQuery,o=n?e.phrase("Replace all:"):e.phrase("Replace:"),r=s("",null,s("span",{className:"CodeMirror-search-label"},o),k(e));D(e,r,o,t,function(i){i&&(i=C(i),D(e,I(e),e.phrase("Replace with:"),"",function(p){if(p=P(p),n)_(e,i,p);else{b(e);var f=S(e,i,e.getCursor("from")),l=function(){var g=f.from(),c;!(c=f.findNext())&&(f=S(e,i),!(c=f.findNext())||g&&f.from().line==g.line&&f.from().ch==g.ch)||(e.setSelection(f.from(),f.to()),e.scrollIntoView({from:f.from(),to:f.to()}),j(e,V(e),e.phrase("Replace?"),[function(){v(c)},l,function(){_(e,i,p)}]))},v=function(g){f.replace(typeof i=="string"?p:p.replace(/\$(\d)/g,function(c,u){return g[u]})),l()};l()}}))})}}a.commands.find=function(e){b(e),x(e)},a.commands.findPersistent=function(e){b(e),x(e,!1,!0)},a.commands.findPersistentNext=function(e){x(e,!1,!0,!0)},a.commands.findPersistentPrev=function(e){x(e,!0,!0,!0)},a.commands.findNext=x,a.commands.findPrev=function(e){x(e,!0)},a.commands.clearSearch=b,a.commands.replace=E,a.commands.replaceAll=function(e){E(e,!0)}})}()),F.exports}var $=M();const W=K.getDefaultExportFromCjs($),Y=B({__proto__:null,default:W},[$]);exports.search=Y;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { g as n } from "./index-Iqk59VQ1.mjs";
|
|
2
|
+
import { r as f } from "./searchcursor-DHtNMOPb.mjs";
|
|
3
|
+
function u(t, c) {
|
|
4
|
+
for (var o = 0; o < c.length; o++) {
|
|
5
|
+
const r = c[o];
|
|
6
|
+
if (typeof r != "string" && !Array.isArray(r)) {
|
|
7
|
+
for (const e in r)
|
|
8
|
+
if (e !== "default" && !(e in t)) {
|
|
9
|
+
const s = Object.getOwnPropertyDescriptor(r, e);
|
|
10
|
+
s && Object.defineProperty(t, e, s.get ? s : {
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
get: () => r[e]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
18
|
+
}
|
|
19
|
+
var a = f();
|
|
20
|
+
const i = /* @__PURE__ */ n(a), l = /* @__PURE__ */ u({
|
|
21
|
+
__proto__: null,
|
|
22
|
+
default: i
|
|
23
|
+
}, [a]);
|
|
24
|
+
export {
|
|
25
|
+
l as s
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./index-BeOZF5ut.js"),a=require("./searchcursor-eGwb3e2h.js");function i(t,s){for(var o=0;o<s.length;o++){const r=s[o];if(typeof r!="string"&&!Array.isArray(r)){for(const e in r)if(e!=="default"&&!(e in t)){const c=Object.getOwnPropertyDescriptor(r,e);c&&Object.defineProperty(t,e,c.get?c:{enumerable:!0,get:()=>r[e]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var u=a.requireSearchcursor();const f=n.getDefaultExportFromCjs(u),l=i({__proto__:null,default:f},[u]);exports.searchcursor=l;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { r as A } from "./codemirror-DgPcZxSc.mjs";
|
|
2
|
+
var I = { exports: {} }, z;
|
|
3
|
+
function G() {
|
|
4
|
+
return z || (z = 1, function(y, C) {
|
|
5
|
+
(function(v) {
|
|
6
|
+
v(A());
|
|
7
|
+
})(function(v) {
|
|
8
|
+
var s = v.Pos;
|
|
9
|
+
function D(e) {
|
|
10
|
+
var t = e.flags;
|
|
11
|
+
return t ?? (e.ignoreCase ? "i" : "") + (e.global ? "g" : "") + (e.multiline ? "m" : "");
|
|
12
|
+
}
|
|
13
|
+
function O(e, t) {
|
|
14
|
+
for (var n = D(e), r = n, l = 0; l < t.length; l++) r.indexOf(t.charAt(l)) == -1 && (r += t.charAt(l));
|
|
15
|
+
return n == r ? e : new RegExp(e.source, r);
|
|
16
|
+
}
|
|
17
|
+
function S(e) {
|
|
18
|
+
return /\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source);
|
|
19
|
+
}
|
|
20
|
+
function d(e, t, n) {
|
|
21
|
+
t = O(t, "g");
|
|
22
|
+
for (var r = n.line, l = n.ch, i = e.lastLine(); r <= i; r++, l = 0) {
|
|
23
|
+
t.lastIndex = l;
|
|
24
|
+
var h = e.getLine(r), f = t.exec(h);
|
|
25
|
+
if (f)
|
|
26
|
+
return {
|
|
27
|
+
from: s(r, f.index),
|
|
28
|
+
to: s(r, f.index + f[0].length),
|
|
29
|
+
match: f
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function N(e, t, n) {
|
|
34
|
+
if (!S(t)) return d(e, t, n);
|
|
35
|
+
t = O(t, "gm");
|
|
36
|
+
for (var r, l = 1, i = n.line, h = e.lastLine(); i <= h; ) {
|
|
37
|
+
for (var f = 0; f < l && !(i > h); f++) {
|
|
38
|
+
var L = e.getLine(i++);
|
|
39
|
+
r = r == null ? L : r + `
|
|
40
|
+
` + L;
|
|
41
|
+
}
|
|
42
|
+
l = l * 2, t.lastIndex = n.ch;
|
|
43
|
+
var u = t.exec(r);
|
|
44
|
+
if (u) {
|
|
45
|
+
var a = r.slice(0, u.index).split(`
|
|
46
|
+
`), c = u[0].split(`
|
|
47
|
+
`), o = n.line + a.length - 1, g = a[a.length - 1].length;
|
|
48
|
+
return {
|
|
49
|
+
from: s(o, g),
|
|
50
|
+
to: s(
|
|
51
|
+
o + c.length - 1,
|
|
52
|
+
c.length == 1 ? g + c[0].length : c[c.length - 1].length
|
|
53
|
+
),
|
|
54
|
+
match: u
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function E(e, t, n) {
|
|
60
|
+
for (var r, l = 0; l <= e.length; ) {
|
|
61
|
+
t.lastIndex = l;
|
|
62
|
+
var i = t.exec(e);
|
|
63
|
+
if (!i) break;
|
|
64
|
+
var h = i.index + i[0].length;
|
|
65
|
+
if (h > e.length - n) break;
|
|
66
|
+
(!r || h > r.index + r[0].length) && (r = i), l = i.index + 1;
|
|
67
|
+
}
|
|
68
|
+
return r;
|
|
69
|
+
}
|
|
70
|
+
function R(e, t, n) {
|
|
71
|
+
t = O(t, "g");
|
|
72
|
+
for (var r = n.line, l = n.ch, i = e.firstLine(); r >= i; r--, l = -1) {
|
|
73
|
+
var h = e.getLine(r), f = E(h, t, l < 0 ? 0 : h.length - l);
|
|
74
|
+
if (f)
|
|
75
|
+
return {
|
|
76
|
+
from: s(r, f.index),
|
|
77
|
+
to: s(r, f.index + f[0].length),
|
|
78
|
+
match: f
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function b(e, t, n) {
|
|
83
|
+
if (!S(t)) return R(e, t, n);
|
|
84
|
+
t = O(t, "gm");
|
|
85
|
+
for (var r, l = 1, i = e.getLine(n.line).length - n.ch, h = n.line, f = e.firstLine(); h >= f; ) {
|
|
86
|
+
for (var L = 0; L < l && h >= f; L++) {
|
|
87
|
+
var u = e.getLine(h--);
|
|
88
|
+
r = r == null ? u : u + `
|
|
89
|
+
` + r;
|
|
90
|
+
}
|
|
91
|
+
l *= 2;
|
|
92
|
+
var a = E(r, t, i);
|
|
93
|
+
if (a) {
|
|
94
|
+
var c = r.slice(0, a.index).split(`
|
|
95
|
+
`), o = a[0].split(`
|
|
96
|
+
`), g = h + c.length, p = c[c.length - 1].length;
|
|
97
|
+
return {
|
|
98
|
+
from: s(g, p),
|
|
99
|
+
to: s(
|
|
100
|
+
g + o.length - 1,
|
|
101
|
+
o.length == 1 ? p + o[0].length : o[o.length - 1].length
|
|
102
|
+
),
|
|
103
|
+
match: a
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
var F, P;
|
|
109
|
+
String.prototype.normalize ? (F = function(e) {
|
|
110
|
+
return e.normalize("NFD").toLowerCase();
|
|
111
|
+
}, P = function(e) {
|
|
112
|
+
return e.normalize("NFD");
|
|
113
|
+
}) : (F = function(e) {
|
|
114
|
+
return e.toLowerCase();
|
|
115
|
+
}, P = function(e) {
|
|
116
|
+
return e;
|
|
117
|
+
});
|
|
118
|
+
function m(e, t, n, r) {
|
|
119
|
+
if (e.length == t.length) return n;
|
|
120
|
+
for (var l = 0, i = n + Math.max(0, e.length - t.length); ; ) {
|
|
121
|
+
if (l == i) return l;
|
|
122
|
+
var h = l + i >> 1, f = r(e.slice(0, h)).length;
|
|
123
|
+
if (f == n) return h;
|
|
124
|
+
f > n ? i = h : l = h + 1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function B(e, t, n, r) {
|
|
128
|
+
if (!t.length) return null;
|
|
129
|
+
var l = r ? F : P, i = l(t).split(/\r|\n\r?/);
|
|
130
|
+
t: for (var h = n.line, f = n.ch, L = e.lastLine() + 1 - i.length; h <= L; h++, f = 0) {
|
|
131
|
+
var u = e.getLine(h).slice(f), a = l(u);
|
|
132
|
+
if (i.length == 1) {
|
|
133
|
+
var c = a.indexOf(i[0]);
|
|
134
|
+
if (c == -1) continue t;
|
|
135
|
+
var n = m(u, a, c, l) + f;
|
|
136
|
+
return {
|
|
137
|
+
from: s(h, m(u, a, c, l) + f),
|
|
138
|
+
to: s(h, m(u, a, c + i[0].length, l) + f)
|
|
139
|
+
};
|
|
140
|
+
} else {
|
|
141
|
+
var o = a.length - i[0].length;
|
|
142
|
+
if (a.slice(o) != i[0]) continue t;
|
|
143
|
+
for (var g = 1; g < i.length - 1; g++)
|
|
144
|
+
if (l(e.getLine(h + g)) != i[g]) continue t;
|
|
145
|
+
var p = e.getLine(h + i.length - 1), x = l(p), w = i[i.length - 1];
|
|
146
|
+
if (x.slice(0, w.length) != w) continue t;
|
|
147
|
+
return {
|
|
148
|
+
from: s(h, m(u, a, o, l) + f),
|
|
149
|
+
to: s(h + i.length - 1, m(p, x, w.length, l))
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function j(e, t, n, r) {
|
|
155
|
+
if (!t.length) return null;
|
|
156
|
+
var l = r ? F : P, i = l(t).split(/\r|\n\r?/);
|
|
157
|
+
t: for (var h = n.line, f = n.ch, L = e.firstLine() - 1 + i.length; h >= L; h--, f = -1) {
|
|
158
|
+
var u = e.getLine(h);
|
|
159
|
+
f > -1 && (u = u.slice(0, f));
|
|
160
|
+
var a = l(u);
|
|
161
|
+
if (i.length == 1) {
|
|
162
|
+
var c = a.lastIndexOf(i[0]);
|
|
163
|
+
if (c == -1) continue t;
|
|
164
|
+
return {
|
|
165
|
+
from: s(h, m(u, a, c, l)),
|
|
166
|
+
to: s(h, m(u, a, c + i[0].length, l))
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
var o = i[i.length - 1];
|
|
170
|
+
if (a.slice(0, o.length) != o) continue t;
|
|
171
|
+
for (var g = 1, n = h - i.length + 1; g < i.length - 1; g++)
|
|
172
|
+
if (l(e.getLine(n + g)) != i[g]) continue t;
|
|
173
|
+
var p = e.getLine(h + 1 - i.length), x = l(p);
|
|
174
|
+
if (x.slice(x.length - i[0].length) != i[0]) continue t;
|
|
175
|
+
return {
|
|
176
|
+
from: s(h + 1 - i.length, m(p, x, p.length - i[0].length, l)),
|
|
177
|
+
to: s(h, m(u, a, o.length, l))
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function k(e, t, n, r) {
|
|
183
|
+
this.atOccurrence = !1, this.afterEmptyMatch = !1, this.doc = e, n = n ? e.clipPos(n) : s(0, 0), this.pos = { from: n, to: n };
|
|
184
|
+
var l;
|
|
185
|
+
typeof r == "object" ? l = r.caseFold : (l = r, r = null), typeof t == "string" ? (l == null && (l = !1), this.matches = function(i, h) {
|
|
186
|
+
return (i ? j : B)(e, t, h, l);
|
|
187
|
+
}) : (t = O(t, "gm"), !r || r.multiline !== !1 ? this.matches = function(i, h) {
|
|
188
|
+
return (i ? b : N)(e, t, h);
|
|
189
|
+
} : this.matches = function(i, h) {
|
|
190
|
+
return (i ? R : d)(e, t, h);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
k.prototype = {
|
|
194
|
+
findNext: function() {
|
|
195
|
+
return this.find(!1);
|
|
196
|
+
},
|
|
197
|
+
findPrevious: function() {
|
|
198
|
+
return this.find(!0);
|
|
199
|
+
},
|
|
200
|
+
find: function(e) {
|
|
201
|
+
var t = this.doc.clipPos(e ? this.pos.from : this.pos.to);
|
|
202
|
+
if (this.afterEmptyMatch && this.atOccurrence && (t = s(t.line, t.ch), e ? (t.ch--, t.ch < 0 && (t.line--, t.ch = (this.doc.getLine(t.line) || "").length)) : (t.ch++, t.ch > (this.doc.getLine(t.line) || "").length && (t.ch = 0, t.line++)), v.cmpPos(t, this.doc.clipPos(t)) != 0))
|
|
203
|
+
return this.atOccurrence = !1;
|
|
204
|
+
var n = this.matches(e, t);
|
|
205
|
+
if (this.afterEmptyMatch = n && v.cmpPos(n.from, n.to) == 0, n)
|
|
206
|
+
return this.pos = n, this.atOccurrence = !0, this.pos.match || !0;
|
|
207
|
+
var r = s(e ? this.doc.firstLine() : this.doc.lastLine() + 1, 0);
|
|
208
|
+
return this.pos = { from: r, to: r }, this.atOccurrence = !1;
|
|
209
|
+
},
|
|
210
|
+
from: function() {
|
|
211
|
+
if (this.atOccurrence) return this.pos.from;
|
|
212
|
+
},
|
|
213
|
+
to: function() {
|
|
214
|
+
if (this.atOccurrence) return this.pos.to;
|
|
215
|
+
},
|
|
216
|
+
replace: function(e, t) {
|
|
217
|
+
if (this.atOccurrence) {
|
|
218
|
+
var n = v.splitLines(e);
|
|
219
|
+
this.doc.replaceRange(n, this.pos.from, this.pos.to, t), this.pos.to = s(
|
|
220
|
+
this.pos.from.line + n.length - 1,
|
|
221
|
+
n[n.length - 1].length + (n.length == 1 ? this.pos.from.ch : 0)
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}, v.defineExtension("getSearchCursor", function(e, t, n) {
|
|
226
|
+
return new k(this.doc, e, t, n);
|
|
227
|
+
}), v.defineDocExtension("getSearchCursor", function(e, t, n) {
|
|
228
|
+
return new k(this, e, t, n);
|
|
229
|
+
}), v.defineExtension("selectMatches", function(e, t) {
|
|
230
|
+
for (var n = [], r = this.getSearchCursor(e, this.getCursor("from"), t); r.findNext() && !(v.cmpPos(r.to(), this.getCursor("to")) > 0); )
|
|
231
|
+
n.push({ anchor: r.from(), head: r.to() });
|
|
232
|
+
n.length && this.setSelections(n, 0);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
}()), I.exports;
|
|
236
|
+
}
|
|
237
|
+
export {
|
|
238
|
+
G as r
|
|
239
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const A=require("./codemirror-DMBo1i5w.js");var I={exports:{}},z;function y(){return z||(z=1,function(C,W){(function(v){v(A.requireCodemirror())})(function(v){var a=v.Pos;function D(e){var t=e.flags;return t??(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function O(e,t){for(var n=D(e),r=n,l=0;l<t.length;l++)r.indexOf(t.charAt(l))==-1&&(r+=t.charAt(l));return n==r?e:new RegExp(e.source,r)}function S(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function d(e,t,n){t=O(t,"g");for(var r=n.line,l=n.ch,i=e.lastLine();r<=i;r++,l=0){t.lastIndex=l;var h=e.getLine(r),f=t.exec(h);if(f)return{from:a(r,f.index),to:a(r,f.index+f[0].length),match:f}}}function N(e,t,n){if(!S(t))return d(e,t,n);t=O(t,"gm");for(var r,l=1,i=n.line,h=e.lastLine();i<=h;){for(var f=0;f<l&&!(i>h);f++){var L=e.getLine(i++);r=r==null?L:r+`
|
|
2
|
+
`+L}l=l*2,t.lastIndex=n.ch;var u=t.exec(r);if(u){var s=r.slice(0,u.index).split(`
|
|
3
|
+
`),c=u[0].split(`
|
|
4
|
+
`),o=n.line+s.length-1,g=s[s.length-1].length;return{from:a(o,g),to:a(o+c.length-1,c.length==1?g+c[0].length:c[c.length-1].length),match:u}}}}function E(e,t,n){for(var r,l=0;l<=e.length;){t.lastIndex=l;var i=t.exec(e);if(!i)break;var h=i.index+i[0].length;if(h>e.length-n)break;(!r||h>r.index+r[0].length)&&(r=i),l=i.index+1}return r}function R(e,t,n){t=O(t,"g");for(var r=n.line,l=n.ch,i=e.firstLine();r>=i;r--,l=-1){var h=e.getLine(r),f=E(h,t,l<0?0:h.length-l);if(f)return{from:a(r,f.index),to:a(r,f.index+f[0].length),match:f}}}function b(e,t,n){if(!S(t))return R(e,t,n);t=O(t,"gm");for(var r,l=1,i=e.getLine(n.line).length-n.ch,h=n.line,f=e.firstLine();h>=f;){for(var L=0;L<l&&h>=f;L++){var u=e.getLine(h--);r=r==null?u:u+`
|
|
5
|
+
`+r}l*=2;var s=E(r,t,i);if(s){var c=r.slice(0,s.index).split(`
|
|
6
|
+
`),o=s[0].split(`
|
|
7
|
+
`),g=h+c.length,p=c[c.length-1].length;return{from:a(g,p),to:a(g+o.length-1,o.length==1?p+o[0].length:o[o.length-1].length),match:s}}}}var F,P;String.prototype.normalize?(F=function(e){return e.normalize("NFD").toLowerCase()},P=function(e){return e.normalize("NFD")}):(F=function(e){return e.toLowerCase()},P=function(e){return e});function m(e,t,n,r){if(e.length==t.length)return n;for(var l=0,i=n+Math.max(0,e.length-t.length);;){if(l==i)return l;var h=l+i>>1,f=r(e.slice(0,h)).length;if(f==n)return h;f>n?i=h:l=h+1}}function B(e,t,n,r){if(!t.length)return null;var l=r?F:P,i=l(t).split(/\r|\n\r?/);t:for(var h=n.line,f=n.ch,L=e.lastLine()+1-i.length;h<=L;h++,f=0){var u=e.getLine(h).slice(f),s=l(u);if(i.length==1){var c=s.indexOf(i[0]);if(c==-1)continue t;var n=m(u,s,c,l)+f;return{from:a(h,m(u,s,c,l)+f),to:a(h,m(u,s,c+i[0].length,l)+f)}}else{var o=s.length-i[0].length;if(s.slice(o)!=i[0])continue t;for(var g=1;g<i.length-1;g++)if(l(e.getLine(h+g))!=i[g])continue t;var p=e.getLine(h+i.length-1),x=l(p),w=i[i.length-1];if(x.slice(0,w.length)!=w)continue t;return{from:a(h,m(u,s,o,l)+f),to:a(h+i.length-1,m(p,x,w.length,l))}}}}function j(e,t,n,r){if(!t.length)return null;var l=r?F:P,i=l(t).split(/\r|\n\r?/);t:for(var h=n.line,f=n.ch,L=e.firstLine()-1+i.length;h>=L;h--,f=-1){var u=e.getLine(h);f>-1&&(u=u.slice(0,f));var s=l(u);if(i.length==1){var c=s.lastIndexOf(i[0]);if(c==-1)continue t;return{from:a(h,m(u,s,c,l)),to:a(h,m(u,s,c+i[0].length,l))}}else{var o=i[i.length-1];if(s.slice(0,o.length)!=o)continue t;for(var g=1,n=h-i.length+1;g<i.length-1;g++)if(l(e.getLine(n+g))!=i[g])continue t;var p=e.getLine(h+1-i.length),x=l(p);if(x.slice(x.length-i[0].length)!=i[0])continue t;return{from:a(h+1-i.length,m(p,x,p.length-i[0].length,l)),to:a(h,m(u,s,o.length,l))}}}}function k(e,t,n,r){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,n=n?e.clipPos(n):a(0,0),this.pos={from:n,to:n};var l;typeof r=="object"?l=r.caseFold:(l=r,r=null),typeof t=="string"?(l==null&&(l=!1),this.matches=function(i,h){return(i?j:B)(e,t,h,l)}):(t=O(t,"gm"),!r||r.multiline!==!1?this.matches=function(i,h){return(i?b:N)(e,t,h)}:this.matches=function(i,h){return(i?R:d)(e,t,h)})}k.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var t=this.doc.clipPos(e?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(t=a(t.line,t.ch),e?(t.ch--,t.ch<0&&(t.line--,t.ch=(this.doc.getLine(t.line)||"").length)):(t.ch++,t.ch>(this.doc.getLine(t.line)||"").length&&(t.ch=0,t.line++)),v.cmpPos(t,this.doc.clipPos(t))!=0))return this.atOccurrence=!1;var n=this.matches(e,t);if(this.afterEmptyMatch=n&&v.cmpPos(n.from,n.to)==0,n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var r=a(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:r,to:r},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,t){if(this.atOccurrence){var n=v.splitLines(e);this.doc.replaceRange(n,this.pos.from,this.pos.to,t),this.pos.to=a(this.pos.from.line+n.length-1,n[n.length-1].length+(n.length==1?this.pos.from.ch:0))}}},v.defineExtension("getSearchCursor",function(e,t,n){return new k(this.doc,e,t,n)}),v.defineDocExtension("getSearchCursor",function(e,t,n){return new k(this,e,t,n)}),v.defineExtension("selectMatches",function(e,t){for(var n=[],r=this.getSearchCursor(e,this.getCursor("from"),t);r.findNext()&&!(v.cmpPos(r.to(),this.getCursor("to"))>0);)n.push({anchor:r.from(),head:r.to()});n.length&&this.setSelections(n,0)})})}()),I.exports}exports.requireSearchcursor=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const rt=require("./index-BeOZF5ut.js"),ct=require("./codemirror-DMBo1i5w.js");function lt(S,O){for(var r=0;r<O.length;r++){const v=O[r];if(typeof v!="string"&&!Array.isArray(v)){for(const m in v)if(m!=="default"&&!(m in S)){const w=Object.getOwnPropertyDescriptor(v,m);w&&Object.defineProperty(S,m,w.get?w:{enumerable:!0,get:()=>v[m]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var X={exports:{}},G;function ht(){return G||(G=1,function(S,O){(function(r){r(ct.requireCodemirror())})(function(r){var v="CodeMirror-hint",m="CodeMirror-hint-active";r.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var s in i)n[s]=i[s];return t.showHint(n)},r.defineExtension("showHint",function(t){t=tt(this,this.getCursor("start"),t);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;i<e.length;i++)if(e[i].head.line!=e[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new w(this,t);n.options.hint&&(r.signal(this,"startCompletion",this),n.update(!0))}}),r.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function w(t,e){if(this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var i=this;t.on("cursorActivity",this.activityFunc=function(){i.cursorActivity()})}}var Q=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},Z=window.cancelAnimationFrame||clearTimeout;w.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&r.signal(this.data,"close"),this.widget&&this.widget.close(),r.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,e){var i=t.list[e],n=this;this.cm.operation(function(){i.hint?i.hint(n.cm,t,i):n.cm.replaceRange(_(i),i.from||t.from,i.to||t.to,"complete"),r.signal(t,"pick",i),n.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(Z(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),i=this.cm.getLine(e.line);if(e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(i.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=Q(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(t){if(this.tick!=null){var e=this,i=++this.tick;U(this.options.hint,this.cm,this.options,function(n){e.tick==i&&e.finishUpdate(n,t)})}},finishUpdate:function(t,e){this.data&&r.signal(this.data,"update");var i=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(i&&t.list.length==1?this.pick(t,0):(this.widget=new B(this,t),r.signal(t,"shown")))}};function tt(t,e,i){var n=t.options.hintOptions,s={};for(var c in q)s[c]=q[c];if(n)for(var c in n)n[c]!==void 0&&(s[c]=n[c]);if(i)for(var c in i)i[c]!==void 0&&(s[c]=i[c]);return s.hint.resolve&&(s.hint=s.hint.resolve(t,e)),s}function _(t){return typeof t=="string"?t:t.text}function et(t,e){var i={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(-e.menuSize()+1,!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close},n=/Mac/.test(navigator.platform);n&&(i["Ctrl-P"]=function(){e.moveFocus(-1)},i["Ctrl-N"]=function(){e.moveFocus(1)});var s=t.options.customKeys,c=s?{}:i;function o(u,l){var a;typeof l!="string"?a=function(H){return l(H,e)}:i.hasOwnProperty(l)?a=i[l]:a=l,c[u]=a}if(s)for(var f in s)s.hasOwnProperty(f)&&o(f,s[f]);var h=t.options.extraKeys;if(h)for(var f in h)h.hasOwnProperty(f)&&o(f,h[f]);return c}function K(t,e){for(;e&&e!=t;){if(e.nodeName.toUpperCase()==="LI"&&e.parentNode==t)return e;e=e.parentNode}}function B(t,e){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=t,this.data=e,this.picked=!1;var i=this,n=t.cm,s=n.getInputField().ownerDocument,c=s.defaultView||s.parentWindow,o=this.hints=s.createElement("ul");o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.id=this.id;var f=t.cm.options.theme;o.className="CodeMirror-hints "+f,this.selectedHint=e.selectedHint||0;for(var h=e.list,u=0;u<h.length;++u){var l=o.appendChild(s.createElement("li")),a=h[u],H=v+(u!=this.selectedHint?"":" "+m);a.className!=null&&(H=a.className+" "+H),l.className=H,u==this.selectedHint&&l.setAttribute("aria-selected","true"),l.id=this.id+"-"+u,l.setAttribute("role","option"),a.render?a.render(l,e,a):l.appendChild(s.createTextNode(a.displayText||_(a))),l.hintId=u}var A=t.options.container||s.body,y=n.cursorCoords(t.options.alignWithWord?e.from:null),F=y.left,E=y.bottom,D=!0,N=0,I=0;if(A!==s.body){var st=["absolute","relative","fixed"].indexOf(c.getComputedStyle(A).position)!==-1,C=st?A:A.offsetParent,M=C.getBoundingClientRect(),j=s.body.getBoundingClientRect();N=M.left-j.left-C.scrollLeft,I=M.top-j.top-C.scrollTop}o.style.left=F-N+"px",o.style.top=E-I+"px";var x=c.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),W=c.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);A.appendChild(o),n.getInputField().setAttribute("aria-autocomplete","list"),n.getInputField().setAttribute("aria-owns",this.id),n.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var g=t.options.moveOnOverlap?o.getBoundingClientRect():new DOMRect,z=t.options.paddingForScrollbar?o.scrollHeight>o.clientHeight+1:!1,b;setTimeout(function(){b=n.getScrollInfo()});var ot=g.bottom-W;if(ot>0){var L=g.bottom-g.top,P=g.top-(y.bottom-y.top)-2;W-g.top<P?(L>P&&(o.style.height=(L=P)+"px"),o.style.top=(E=y.top-L)+I+"px",D=!1):o.style.height=W-g.top-2+"px"}var T=g.right-x;if(z&&(T+=n.display.nativeBarWidth),T>0&&(g.right-g.left>x&&(o.style.width=x-5+"px",T-=g.right-g.left-x),o.style.left=(F=Math.max(y.left-T-N,0))+"px"),z)for(var k=o.firstChild;k;k=k.nextSibling)k.style.paddingRight=n.display.nativeBarWidth+"px";if(n.addKeyMap(this.keyMap=et(t,{moveFocus:function(p,d){i.changeActive(i.selectedHint+p,d)},setFocus:function(p){i.changeActive(p)},menuSize:function(){return i.screenAmount()},length:h.length,close:function(){t.close()},pick:function(){i.pick()},data:e})),t.options.closeOnUnfocus){var V;n.on("blur",this.onBlur=function(){V=setTimeout(function(){t.close()},100)}),n.on("focus",this.onFocus=function(){clearTimeout(V)})}n.on("scroll",this.onScroll=function(){var p=n.getScrollInfo(),d=n.getWrapperElement().getBoundingClientRect();b||(b=n.getScrollInfo());var $=E+b.top-p.top,R=$-(c.pageYOffset||(s.documentElement||s.body).scrollTop);if(D||(R+=o.offsetHeight),R<=d.top||R>=d.bottom)return t.close();o.style.top=$+"px",o.style.left=F+b.left-p.left+"px"}),r.on(o,"dblclick",function(p){var d=K(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),i.pick())}),r.on(o,"click",function(p){var d=K(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),t.options.completeOnSingleClick&&i.pick())}),r.on(o,"mousedown",function(){setTimeout(function(){n.focus()},20)});var Y=this.getSelectedHintRange();return(Y.from!==0||Y.to!==0)&&this.scrollToActive(),r.signal(e,"select",h[this.selectedHint],o.childNodes[this.selectedHint]),!0}B.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm.getInputField();t.removeAttribute("aria-activedescendant"),t.removeAttribute("aria-owns");var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,e){if(t>=this.data.list.length?t=e?this.data.list.length-1:0:t<0&&(t=e?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+m,""),i.removeAttribute("aria-selected")),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+m,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),r.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var t=this.getSelectedHintRange(),e=this.hints.childNodes[t.from],i=this.hints.childNodes[t.to],n=this.hints.firstChild;e.offsetTop<this.hints.scrollTop?this.hints.scrollTop=e.offsetTop-n.offsetTop:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var t=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-t),to:Math.min(this.data.list.length-1,this.selectedHint+t)}}};function it(t,e){if(!t.somethingSelected())return e;for(var i=[],n=0;n<e.length;n++)e[n].supportsSelection&&i.push(e[n]);return i}function U(t,e,i,n){if(t.async)t(e,n,i);else{var s=t(e,i);s&&s.then?s.then(n):n(s)}}function nt(t,e){var i=t.getHelpers(e,"hint"),n;if(i.length){var s=function(c,o,f){var h=it(c,i);function u(l){if(l==h.length)return o(null);U(h[l],c,f,function(a){a&&a.list.length>0?o(a):u(l+1)})}u(0)};return s.async=!0,s.supportsSelection=!0,s}else return(n=t.getHelper(t.getCursor(),"hintWords"))?function(c){return r.hint.fromList(c,{words:n})}:r.hint.anyword?function(c,o){return r.hint.anyword(c,o)}:function(){}}r.registerHelper("hint","auto",{resolve:nt}),r.registerHelper("hint","fromList",function(t,e){var i=t.getCursor(),n=t.getTokenAt(i),s,c=r.Pos(i.line,n.start),o=i;n.start<i.ch&&/\w/.test(n.string.charAt(i.ch-n.start-1))?s=n.string.substr(0,i.ch-n.start):(s="",c=i);for(var f=[],h=0;h<e.words.length;h++){var u=e.words[h];u.slice(0,s.length)==s&&f.push(u)}if(f.length)return{list:f,from:c,to:o}}),r.commands.autocomplete=r.showHint;var q={hint:r.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};r.defineOption("hintOptions",null)})}()),X.exports}var J=ht();const at=rt.getDefaultExportFromCjs(J),ft=lt({__proto__:null,default:at},[J]);exports.showHint=ft;
|