dsh-ris-ide 1.7.1 → 1.7.3
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 +29 -2
- package/bin/check-listing.mjs +247 -0
- package/bin/proxy-janitor.mjs +88 -0
- package/lib/client-codemirror.js +110 -66
- package/lib/client.js +1809 -70
- package/lib/index.js +1638 -11
- package/lib/janitor.js +286 -0
- package/lib/proxy.js +1498 -0
- package/lib/redirector.js +2109 -0
- package/package.json +4 -2
- package/skills/dsh-ris-ide-debug/SKILL.md +37 -2
- package/test/client-viewer.test.mjs +622 -6
- package/test/companion.test.mjs +65 -0
- package/test/host-search.test.mjs +125 -1
- package/test/host-tail.test.mjs +95 -1
- package/test/inherit-engine.test.mjs +175 -0
- package/test/install-phase.test.mjs +36 -0
- package/test/janitor.test.mjs +144 -0
- package/test/lifecycle.test.mjs +88 -0
- package/test/proxy-route.test.mjs +599 -0
- package/test/proxy.test.mjs +873 -0
- package/test/redirector.test.mjs +521 -0
package/lib/client-codemirror.js
CHANGED
|
@@ -3,7 +3,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
3
3
|
var module = { exports: {} };
|
|
4
4
|
var exports = module.exports;
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
-
|
|
6
|
+
// ../../.dsh/profiles/web/node_modules/@marijn/find-cluster-break/src/index.js
|
|
7
7
|
let rangeFrom = [];
|
|
8
8
|
let rangeTo = [];
|
|
9
9
|
(() => {
|
|
@@ -73,8 +73,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
73
73
|
function codePointSize$1(code) {
|
|
74
74
|
return code < 65536 ? 1 : 2;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/state/dist/index.js
|
|
76
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/state/dist/index.js
|
|
78
77
|
/**
|
|
79
78
|
The data structure for documents. @nonabstract
|
|
80
79
|
*/
|
|
@@ -3487,8 +3486,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
3487
3486
|
}
|
|
3488
3487
|
return strict === true ? -1 : string.length;
|
|
3489
3488
|
}
|
|
3490
|
-
|
|
3491
|
-
//#region ../../.dsh/profiles/web/node_modules/style-mod/src/style-mod.js
|
|
3489
|
+
// ../../.dsh/profiles/web/node_modules/style-mod/src/style-mod.js
|
|
3492
3490
|
const C = "ͼ";
|
|
3493
3491
|
const COUNT = typeof Symbol == "undefined" ? "__ͼ" : Symbol.for(C);
|
|
3494
3492
|
const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet");
|
|
@@ -3584,8 +3582,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
3584
3582
|
if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce) this.styleTag.setAttribute("nonce", nonce);
|
|
3585
3583
|
}
|
|
3586
3584
|
};
|
|
3587
|
-
|
|
3588
|
-
//#region ../../.dsh/profiles/web/node_modules/w3c-keyname/index.js
|
|
3585
|
+
// ../../.dsh/profiles/web/node_modules/w3c-keyname/index.js
|
|
3589
3586
|
var base = {
|
|
3590
3587
|
8: "Backspace",
|
|
3591
3588
|
9: "Tab",
|
|
@@ -3685,8 +3682,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
3685
3682
|
if (name == "Down") name = "ArrowDown";
|
|
3686
3683
|
return name;
|
|
3687
3684
|
}
|
|
3688
|
-
|
|
3689
|
-
//#region ../../.dsh/profiles/web/node_modules/crelt/index.js
|
|
3685
|
+
// ../../.dsh/profiles/web/node_modules/crelt/index.js
|
|
3690
3686
|
function crelt() {
|
|
3691
3687
|
var elt = arguments[0];
|
|
3692
3688
|
if (typeof elt == "string") elt = document.createElement(elt);
|
|
@@ -3708,8 +3704,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
3708
3704
|
else if (Array.isArray(child)) for (var i = 0; i < child.length; i++) add(elt, child[i]);
|
|
3709
3705
|
else throw new RangeError("Unsupported child node: " + child);
|
|
3710
3706
|
}
|
|
3711
|
-
|
|
3712
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/view/dist/index.js
|
|
3707
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/view/dist/index.js
|
|
3713
3708
|
let nav = typeof navigator != "undefined" ? navigator : {
|
|
3714
3709
|
userAgent: "",
|
|
3715
3710
|
vendor: "",
|
|
@@ -12464,8 +12459,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
12464
12459
|
function highlightActiveLineGutter() {
|
|
12465
12460
|
return activeLineGutterHighlighter;
|
|
12466
12461
|
}
|
|
12467
|
-
|
|
12468
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/common/dist/index.js
|
|
12462
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/common/dist/index.js
|
|
12469
12463
|
/**
|
|
12470
12464
|
The default maximum length of a `TreeBuffer` node.
|
|
12471
12465
|
*/
|
|
@@ -14358,8 +14352,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
14358
14352
|
}
|
|
14359
14353
|
return result;
|
|
14360
14354
|
}
|
|
14361
|
-
|
|
14362
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/highlight/dist/index.js
|
|
14355
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/highlight/dist/index.js
|
|
14363
14356
|
let nextTagID = 0;
|
|
14364
14357
|
/**
|
|
14365
14358
|
Highlighting tags are markers that denote a highlighting category.
|
|
@@ -15231,8 +15224,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
15231
15224
|
class: "tok-punctuation"
|
|
15232
15225
|
}
|
|
15233
15226
|
]);
|
|
15234
|
-
|
|
15235
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/language/dist/index.js
|
|
15227
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/language/dist/index.js
|
|
15236
15228
|
var _a;
|
|
15237
15229
|
/**
|
|
15238
15230
|
Node prop stored in a parser's top syntax node to provide the
|
|
@@ -16544,8 +16536,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
16544
16536
|
return type.id;
|
|
16545
16537
|
}
|
|
16546
16538
|
Direction.RTL, Direction.LTR;
|
|
16547
|
-
|
|
16548
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/commands/dist/index.js
|
|
16539
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/commands/dist/index.js
|
|
16549
16540
|
/**
|
|
16550
16541
|
Comment or uncomment the current selection. Will use line comments
|
|
16551
16542
|
if available, otherwise falling back to block comments.
|
|
@@ -18268,8 +18259,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
18268
18259
|
run: indentMore,
|
|
18269
18260
|
shift: indentLess
|
|
18270
18261
|
};
|
|
18271
|
-
|
|
18272
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/lr/dist/index.js
|
|
18262
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/lr/dist/index.js
|
|
18273
18263
|
/**
|
|
18274
18264
|
A parse stack. These are used internally by the parser to track
|
|
18275
18265
|
parsing progress. They also provide some properties and methods
|
|
@@ -19771,8 +19761,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
19771
19761
|
}
|
|
19772
19762
|
return spec.get;
|
|
19773
19763
|
}
|
|
19774
|
-
|
|
19775
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/css/dist/index.js
|
|
19764
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/css/dist/index.js
|
|
19776
19765
|
const descendantOp = 148;
|
|
19777
19766
|
const Unit = 1;
|
|
19778
19767
|
const identifier$2 = 149;
|
|
@@ -20044,8 +20033,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
20044
20033
|
],
|
|
20045
20034
|
tokenPrec: 2433
|
|
20046
20035
|
});
|
|
20047
|
-
|
|
20048
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-css/dist/index.js
|
|
20036
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-css/dist/index.js
|
|
20049
20037
|
let _properties = null;
|
|
20050
20038
|
function properties() {
|
|
20051
20039
|
if (!_properties && typeof document == "object" && document.body) {
|
|
@@ -20953,8 +20941,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
20953
20941
|
function css() {
|
|
20954
20942
|
return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));
|
|
20955
20943
|
}
|
|
20956
|
-
|
|
20957
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/html/dist/index.js
|
|
20944
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/html/dist/index.js
|
|
20958
20945
|
const scriptText = 55;
|
|
20959
20946
|
const StartCloseScriptTag = 1;
|
|
20960
20947
|
const styleText = 56;
|
|
@@ -21424,8 +21411,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
21424
21411
|
return null;
|
|
21425
21412
|
});
|
|
21426
21413
|
}
|
|
21427
|
-
|
|
21428
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/javascript/dist/index.js
|
|
21414
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/javascript/dist/index.js
|
|
21429
21415
|
const noSemi = 317;
|
|
21430
21416
|
const noSemiType = 318;
|
|
21431
21417
|
const incdec = 1;
|
|
@@ -21910,8 +21896,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
21910
21896
|
],
|
|
21911
21897
|
tokenPrec: 15205
|
|
21912
21898
|
});
|
|
21913
|
-
|
|
21914
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/autocomplete/dist/index.js
|
|
21899
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/autocomplete/dist/index.js
|
|
21915
21900
|
/**
|
|
21916
21901
|
An instance of this is passed to completion source functions.
|
|
21917
21902
|
*/
|
|
@@ -22409,8 +22394,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
22409
22394
|
closedBracket.startSide = 1;
|
|
22410
22395
|
closedBracket.endSide = -1;
|
|
22411
22396
|
typeof navigator == "object" && navigator.userAgent;
|
|
22412
|
-
|
|
22413
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-javascript/dist/index.js
|
|
22397
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-javascript/dist/index.js
|
|
22414
22398
|
/**
|
|
22415
22399
|
A collection of JavaScript-related
|
|
22416
22400
|
[snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).
|
|
@@ -22778,8 +22762,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
22778
22762
|
})]);
|
|
22779
22763
|
return true;
|
|
22780
22764
|
});
|
|
22781
|
-
|
|
22782
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-html/dist/index.js
|
|
22765
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-html/dist/index.js
|
|
22783
22766
|
const Targets = [
|
|
22784
22767
|
"_blank",
|
|
22785
22768
|
"_self",
|
|
@@ -23774,8 +23757,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
23774
23757
|
})]);
|
|
23775
23758
|
return true;
|
|
23776
23759
|
});
|
|
23777
|
-
|
|
23778
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/java/dist/index.js
|
|
23760
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/java/dist/index.js
|
|
23779
23761
|
const javaHighlighting = styleTags({
|
|
23780
23762
|
null: tags$1.null,
|
|
23781
23763
|
instanceof: tags$1.operatorKeyword,
|
|
@@ -24009,8 +23991,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
24009
23991
|
}],
|
|
24010
23992
|
tokenPrec: 9164
|
|
24011
23993
|
});
|
|
24012
|
-
|
|
24013
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-java/dist/index.js
|
|
23994
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-java/dist/index.js
|
|
24014
23995
|
/**
|
|
24015
23996
|
A language provider based on the [Lezer Java
|
|
24016
23997
|
parser](https://github.com/lezer-parser/java), extended with
|
|
@@ -24055,8 +24036,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
24055
24036
|
function java() {
|
|
24056
24037
|
return new LanguageSupport(javaLanguage);
|
|
24057
24038
|
}
|
|
24058
|
-
|
|
24059
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/json/dist/index.js
|
|
24039
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/json/dist/index.js
|
|
24060
24040
|
const jsonHighlighting = styleTags({
|
|
24061
24041
|
String: tags$1.string,
|
|
24062
24042
|
Number: tags$1.number,
|
|
@@ -24105,8 +24085,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
24105
24085
|
topRules: { "JsonText": [0, 1] },
|
|
24106
24086
|
tokenPrec: 0
|
|
24107
24087
|
});
|
|
24108
|
-
|
|
24109
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-json/dist/index.js
|
|
24088
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-json/dist/index.js
|
|
24110
24089
|
/**
|
|
24111
24090
|
A language provider that provides JSON parsing.
|
|
24112
24091
|
*/
|
|
@@ -24131,8 +24110,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
24131
24110
|
function json() {
|
|
24132
24111
|
return new LanguageSupport(jsonLanguage);
|
|
24133
24112
|
}
|
|
24134
|
-
|
|
24135
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/markdown/dist/index.js
|
|
24113
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/markdown/dist/index.js
|
|
24136
24114
|
var CompositeBlock = class CompositeBlock {
|
|
24137
24115
|
static create(type, value, from, parentHash, end) {
|
|
24138
24116
|
let hash = parentHash + (parentHash << 8) + type + (value << 4) | 0;
|
|
@@ -26091,8 +26069,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
26091
26069
|
}
|
|
26092
26070
|
}]
|
|
26093
26071
|
};
|
|
26094
|
-
|
|
26095
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-markdown/dist/index.js
|
|
26072
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-markdown/dist/index.js
|
|
26096
26073
|
const data = /*@__PURE__*/ defineLanguageFacet({ commentTokens: { block: {
|
|
26097
26074
|
open: "<!--",
|
|
26098
26075
|
close: "-->"
|
|
@@ -26553,8 +26530,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
26553
26530
|
});
|
|
26554
26531
|
return true;
|
|
26555
26532
|
} });
|
|
26556
|
-
|
|
26557
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-sql/dist/index.js
|
|
26533
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-sql/dist/index.js
|
|
26558
26534
|
const whitespace = 36;
|
|
26559
26535
|
const LineComment = 1;
|
|
26560
26536
|
const BlockComment = 2;
|
|
@@ -27173,8 +27149,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
27173
27149
|
The standard SQL dialect.
|
|
27174
27150
|
*/
|
|
27175
27151
|
const StandardSQL = /*@__PURE__*/ SQLDialect.define({});
|
|
27176
|
-
|
|
27177
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-vue/dist/index.js
|
|
27152
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-vue/dist/index.js
|
|
27178
27153
|
const parser$3 = /*@__PURE__*/ LRParser.deserialize({
|
|
27179
27154
|
version: 14,
|
|
27180
27155
|
states: "%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",
|
|
@@ -27258,8 +27233,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
27258
27233
|
}
|
|
27259
27234
|
return new LanguageSupport(base.language == baseHTML.language ? vueLanguage : makeVue(base.language), [base.support, base.language.data.of({ closeBrackets: { brackets: ["{", "\""] } })]);
|
|
27260
27235
|
}
|
|
27261
|
-
|
|
27262
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/xml/dist/index.js
|
|
27236
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/xml/dist/index.js
|
|
27263
27237
|
const StartTag = 1;
|
|
27264
27238
|
const StartCloseTag = 2;
|
|
27265
27239
|
const MissingCloseTag = 3;
|
|
@@ -27409,8 +27383,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
27409
27383
|
topRules: { "Document": [0, 6] },
|
|
27410
27384
|
tokenPrec: 0
|
|
27411
27385
|
});
|
|
27412
|
-
|
|
27413
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/lang-xml/dist/index.js
|
|
27386
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/lang-xml/dist/index.js
|
|
27414
27387
|
function tagName(doc, tag) {
|
|
27415
27388
|
let name = tag && tag.getChild("TagName");
|
|
27416
27389
|
return name ? doc.sliceString(name.from, name.to) : "";
|
|
@@ -27720,8 +27693,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
27720
27693
|
})]);
|
|
27721
27694
|
return true;
|
|
27722
27695
|
});
|
|
27723
|
-
|
|
27724
|
-
//#region ../../.dsh/profiles/web/node_modules/@lezer/yaml/dist/index.js
|
|
27696
|
+
// ../../.dsh/profiles/web/node_modules/@lezer/yaml/dist/index.js
|
|
27725
27697
|
const blockEnd = 63;
|
|
27726
27698
|
const eof = 64;
|
|
27727
27699
|
const DirectiveEnd = 1;
|
|
@@ -28099,8 +28071,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
28099
28071
|
return new LanguageSupport(yamlLanguage);
|
|
28100
28072
|
}
|
|
28101
28073
|
tags$1.meta;
|
|
28102
|
-
|
|
28103
|
-
//#region ../../.dsh/profiles/web/node_modules/@codemirror/search/dist/index.js
|
|
28074
|
+
// ../../.dsh/profiles/web/node_modules/@codemirror/search/dist/index.js
|
|
28104
28075
|
const basicNormalize = typeof String.prototype.normalize == "function" ? (x) => x.normalize("NFKD") : (x) => x;
|
|
28105
28076
|
/**
|
|
28106
28077
|
A search cursor provides an iterator over text matches in a
|
|
@@ -29263,8 +29234,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29263
29234
|
/*@__PURE__*/ Prec.low(searchHighlighter),
|
|
29264
29235
|
baseTheme
|
|
29265
29236
|
];
|
|
29266
|
-
|
|
29267
|
-
//#region src/chunks/codemirror.js
|
|
29237
|
+
// src/chunks/codemirror.js
|
|
29268
29238
|
/**
|
|
29269
29239
|
* The IDE's editor chunk: CodeMirror 6 + Java syntax, breakpoint gutter, debug
|
|
29270
29240
|
* line highlight and the find/replace panel. Built by `tsdown` into
|
|
@@ -29335,9 +29305,27 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29335
29305
|
})) });
|
|
29336
29306
|
openSearchPanel(view);
|
|
29337
29307
|
findNext(view);
|
|
29308
|
+
caretToEndOfFindField(view);
|
|
29338
29309
|
return true;
|
|
29339
29310
|
}
|
|
29340
29311
|
/**
|
|
29312
|
+
* Puts the caret at the END of the open find panel's search field.
|
|
29313
|
+
*
|
|
29314
|
+
* `openSearchPanel` focuses `[main-field]` **and selects its whole text** whenever
|
|
29315
|
+
* the panel is already open. A selected query means the next keystroke replaces it,
|
|
29316
|
+
* which is the reported "only one character can ever be typed" bug; every
|
|
29317
|
+
* programmatic open therefore normalizes the caret right after CodeMirror's own
|
|
29318
|
+
* focus. The panel itself does the same from its mount/Ctrl+F/button paths.
|
|
29319
|
+
* @param {object} view - the `EditorView` whose panel to normalize.
|
|
29320
|
+
*/
|
|
29321
|
+
function caretToEndOfFindField(view) {
|
|
29322
|
+
const input = view.dom.querySelector(".cm-search [main-field]");
|
|
29323
|
+
if (input === null || input === void 0) return;
|
|
29324
|
+
if (view.root.activeElement !== input) return;
|
|
29325
|
+
const end = typeof input.value === "string" ? input.value.length : 0;
|
|
29326
|
+
input.setSelectionRange(end, end);
|
|
29327
|
+
}
|
|
29328
|
+
/**
|
|
29341
29329
|
* Marks the editor while the document has a non-empty selection.
|
|
29342
29330
|
*
|
|
29343
29331
|
* The active-line tint is drawn on the line itself; a multi-line selection lies
|
|
@@ -29757,12 +29745,21 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29757
29745
|
dom.append(button);
|
|
29758
29746
|
return button;
|
|
29759
29747
|
};
|
|
29760
|
-
/**
|
|
29748
|
+
/**
|
|
29749
|
+
* Puts the caret at the END of the find field — it must never select the query.
|
|
29750
|
+
*
|
|
29751
|
+
* Selecting it here made the next keystroke replace the whole term: with a match
|
|
29752
|
+
* present only one character could ever be typed (the panel re-focuses the field
|
|
29753
|
+
* from Ctrl+F, mount and every button, and `findNext` selects it again while it
|
|
29754
|
+
* has focus — see `restoreSearchCaret`).
|
|
29755
|
+
*/
|
|
29761
29756
|
const focusInput = () => {
|
|
29762
29757
|
searchInput.focus();
|
|
29763
|
-
searchInput.
|
|
29758
|
+
const end = searchInput.value.length;
|
|
29759
|
+
searchInput.setSelectionRange(end, end);
|
|
29764
29760
|
};
|
|
29765
29761
|
const searchInput = makeInput("search", "查找");
|
|
29762
|
+
searchInput.setAttribute("main-field", "true");
|
|
29766
29763
|
makeButton("previous", "↑", "上一个匹配(Shift+Enter)");
|
|
29767
29764
|
makeButton("next", "↓", "下一个匹配(Enter)");
|
|
29768
29765
|
const caseButton = makeButton("case", "Aa", "区分大小写");
|
|
@@ -29803,6 +29800,24 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29803
29800
|
}
|
|
29804
29801
|
return changed;
|
|
29805
29802
|
};
|
|
29803
|
+
/**
|
|
29804
|
+
* Restores the find field's caret/selection after a CodeMirror search command.
|
|
29805
|
+
*
|
|
29806
|
+
* `findNext` / `findPrevious` end by calling `@codemirror/search`'s
|
|
29807
|
+
* `selectSearchInput`, which selects the WHOLE query whenever the panel's
|
|
29808
|
+
* `[main-field]` is the active element — exactly the "typing in the box" case.
|
|
29809
|
+
* Without putting the selection back, the next character replaces the entire
|
|
29810
|
+
* term (the reported "one character and the search box is stuck" bug).
|
|
29811
|
+
* @param {{start?: number, end?: number}} [range] - selection captured BEFORE the
|
|
29812
|
+
* command; omitted ⇒ caret at the end, the natural "keep typing" position.
|
|
29813
|
+
*/
|
|
29814
|
+
const restoreSearchCaret = (range) => {
|
|
29815
|
+
if (document.activeElement !== searchInput) return;
|
|
29816
|
+
const end = searchInput.value.length;
|
|
29817
|
+
const start = range !== void 0 && range !== null && typeof range.start === "number" ? Math.min(range.start, end) : end;
|
|
29818
|
+
const stop = range !== void 0 && range !== null && typeof range.end === "number" ? Math.min(range.end, end) : end;
|
|
29819
|
+
searchInput.setSelectionRange(start, stop);
|
|
29820
|
+
};
|
|
29806
29821
|
/** Total matches of the current query, capped so a pathological regex stays cheap. */
|
|
29807
29822
|
const countMatches = () => {
|
|
29808
29823
|
const query = currentQuery();
|
|
@@ -29832,7 +29847,12 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29832
29847
|
};
|
|
29833
29848
|
const close = () => closeSearchPanel(view);
|
|
29834
29849
|
searchInput.addEventListener("input", () => {
|
|
29850
|
+
const caret = {
|
|
29851
|
+
start: searchInput.selectionStart,
|
|
29852
|
+
end: searchInput.selectionEnd
|
|
29853
|
+
};
|
|
29835
29854
|
apply({ search: searchInput.value }, true);
|
|
29855
|
+
restoreSearchCaret(caret);
|
|
29836
29856
|
});
|
|
29837
29857
|
replaceInput.addEventListener("input", () => {
|
|
29838
29858
|
apply({ replace: replaceInput.value }, false);
|
|
@@ -29840,8 +29860,13 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29840
29860
|
searchInput.addEventListener("keydown", (event) => {
|
|
29841
29861
|
if (event.key === "Enter") {
|
|
29842
29862
|
event.preventDefault();
|
|
29863
|
+
const caret = {
|
|
29864
|
+
start: searchInput.selectionStart,
|
|
29865
|
+
end: searchInput.selectionEnd
|
|
29866
|
+
};
|
|
29843
29867
|
if (event.shiftKey) findPrevious(view);
|
|
29844
29868
|
else findNext(view);
|
|
29869
|
+
restoreSearchCaret(caret);
|
|
29845
29870
|
sync();
|
|
29846
29871
|
} else if (event.key === "Escape") {
|
|
29847
29872
|
event.preventDefault();
|
|
@@ -29859,6 +29884,12 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29859
29884
|
close();
|
|
29860
29885
|
}
|
|
29861
29886
|
});
|
|
29887
|
+
dom.addEventListener("keydown", (event) => {
|
|
29888
|
+
if ((event.ctrlKey === true || event.metaKey === true) && event.altKey !== true && (event.key === "f" || event.key === "F")) {
|
|
29889
|
+
event.preventDefault();
|
|
29890
|
+
focusInput();
|
|
29891
|
+
}
|
|
29892
|
+
});
|
|
29862
29893
|
dom.addEventListener("click", (event) => {
|
|
29863
29894
|
const target = event.target;
|
|
29864
29895
|
const button = target !== null && target !== void 0 && typeof target.closest === "function" ? target.closest("[data-find-action]") : null;
|
|
@@ -29877,7 +29908,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29877
29908
|
else if (action === "replace-all") replaceAll(view);
|
|
29878
29909
|
sync();
|
|
29879
29910
|
if (action === "replace" || action === "replace-all") replaceInput.focus();
|
|
29880
|
-
else
|
|
29911
|
+
else focusInput();
|
|
29881
29912
|
});
|
|
29882
29913
|
return {
|
|
29883
29914
|
dom,
|
|
@@ -29891,7 +29922,8 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29891
29922
|
}, 0);
|
|
29892
29923
|
},
|
|
29893
29924
|
update(update) {
|
|
29894
|
-
|
|
29925
|
+
const queryChanged = update.transactions.some((tr) => tr.effects.some((effect) => effect.is(setSearchQuery)));
|
|
29926
|
+
if (update.docChanged || update.selectionSet || queryChanged) sync();
|
|
29895
29927
|
}
|
|
29896
29928
|
};
|
|
29897
29929
|
}
|
|
@@ -29983,6 +30015,7 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
29983
30015
|
const seeded = searchSelectedText(instance);
|
|
29984
30016
|
openSearchPanel(instance);
|
|
29985
30017
|
if (seeded) findFirstFromStart(instance);
|
|
30018
|
+
caretToEndOfFindField(instance);
|
|
29986
30019
|
return true;
|
|
29987
30020
|
}
|
|
29988
30021
|
},
|
|
@@ -30048,6 +30081,18 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
30048
30081
|
view.focus();
|
|
30049
30082
|
},
|
|
30050
30083
|
/**
|
|
30084
|
+
* Opens the IDE's find panel (or, when it is already open, puts the caret in
|
|
30085
|
+
* its search field): the Ctrl+F entry point for keys pressed OUTSIDE the
|
|
30086
|
+
* document — tabs bar, tree, workspace search box. CodeMirror's own keymap
|
|
30087
|
+
* only sees keys pressed inside the editor, so without this the browser's
|
|
30088
|
+
* find bar opened instead. `openSearchPanel` focuses our input through the
|
|
30089
|
+
* `main-field` attribute.
|
|
30090
|
+
*/
|
|
30091
|
+
find() {
|
|
30092
|
+
openSearchPanel(view);
|
|
30093
|
+
caretToEndOfFindField(view);
|
|
30094
|
+
},
|
|
30095
|
+
/**
|
|
30051
30096
|
* Workspace content-search hand-off: open the find panel on `text` and jump
|
|
30052
30097
|
* to the hit on `line` (1-based, optional).
|
|
30053
30098
|
* @param {string} text - the searched text.
|
|
@@ -30090,7 +30135,6 @@ globalThis.__dshRisIdeChunks__.codemirror = (require) => {
|
|
|
30090
30135
|
}
|
|
30091
30136
|
};
|
|
30092
30137
|
}
|
|
30093
|
-
//#endregion
|
|
30094
30138
|
exports.mount = mount;
|
|
30095
30139
|
return module.exports;
|
|
30096
30140
|
};
|