@uiw/react-codemirror 4.21.21 → 4.21.22
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 +7 -0
- package/dist/codemirror.js +372 -232
- package/dist/codemirror.min.js +1 -1
- package/package.json +2 -2
package/dist/codemirror.js
CHANGED
|
@@ -7,27 +7,27 @@
|
|
|
7
7
|
exports["@uiw/codemirror"] = factory(require("react"), require("@codemirror/state"), require("@codemirror/theme-one-dark"), require("@codemirror/view"));
|
|
8
8
|
else
|
|
9
9
|
root["@uiw/codemirror"] = factory(root["React"], root["CM"]["@codemirror/state"], root["CM"]["@codemirror/theme-one-dark"], root["CM"]["@codemirror/view"]);
|
|
10
|
-
})(self, (
|
|
10
|
+
})(self, (__WEBPACK_EXTERNAL_MODULE__442__, __WEBPACK_EXTERNAL_MODULE__60__, __WEBPACK_EXTERNAL_MODULE__708__, __WEBPACK_EXTERNAL_MODULE__730__) => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/
|
|
15
|
+
/***/ 368:
|
|
16
16
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// EXPORTS
|
|
20
20
|
__webpack_require__.d(__webpack_exports__, {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
o: () => (/* binding */ basicSetup),
|
|
22
|
+
V: () => (/* binding */ minimalSetup)
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/view"],"commonjs":"@codemirror/view","commonjs2":"@codemirror/view"}
|
|
26
|
-
var view_ = __webpack_require__(
|
|
26
|
+
var view_ = __webpack_require__(730);
|
|
27
27
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/state"],"commonjs":"@codemirror/state","commonjs2":"@codemirror/state"}
|
|
28
|
-
var state_ = __webpack_require__(
|
|
28
|
+
var state_ = __webpack_require__(60);
|
|
29
29
|
// EXTERNAL MODULE: ../node_modules/@codemirror/commands/dist/index.js
|
|
30
|
-
var dist = __webpack_require__(
|
|
30
|
+
var dist = __webpack_require__(720);
|
|
31
31
|
;// CONCATENATED MODULE: ../node_modules/crelt/index.js
|
|
32
32
|
function crelt() {
|
|
33
33
|
var elt = arguments[0]
|
|
@@ -142,7 +142,7 @@ class SearchCursor {
|
|
|
142
142
|
let norm = this.normalize(str);
|
|
143
143
|
for (let i = 0, pos = start;; i++) {
|
|
144
144
|
let code = norm.charCodeAt(i);
|
|
145
|
-
let match = this.match(code, pos);
|
|
145
|
+
let match = this.match(code, pos, this.bufferPos + this.bufferStart);
|
|
146
146
|
if (i == norm.length - 1) {
|
|
147
147
|
if (match) {
|
|
148
148
|
this.value = match;
|
|
@@ -155,13 +155,13 @@ class SearchCursor {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
match(code, pos) {
|
|
158
|
+
match(code, pos, end) {
|
|
159
159
|
let match = null;
|
|
160
160
|
for (let i = 0; i < this.matches.length; i += 2) {
|
|
161
161
|
let index = this.matches[i], keep = false;
|
|
162
162
|
if (this.query.charCodeAt(index) == code) {
|
|
163
163
|
if (index == this.query.length - 1) {
|
|
164
|
-
match = { from: this.matches[i + 1], to:
|
|
164
|
+
match = { from: this.matches[i + 1], to: end };
|
|
165
165
|
}
|
|
166
166
|
else {
|
|
167
167
|
this.matches[i]++;
|
|
@@ -175,7 +175,7 @@ class SearchCursor {
|
|
|
175
175
|
}
|
|
176
176
|
if (this.query.charCodeAt(0) == code) {
|
|
177
177
|
if (this.query.length == 1)
|
|
178
|
-
match = { from: pos, to:
|
|
178
|
+
match = { from: pos, to: end };
|
|
179
179
|
else
|
|
180
180
|
this.matches.push(1, pos);
|
|
181
181
|
}
|
|
@@ -523,12 +523,12 @@ const matchHighlighter = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
|
523
523
|
if (conf.wholeWords) {
|
|
524
524
|
query = state.sliceDoc(range.from, range.to); // TODO: allow and include leading/trailing space?
|
|
525
525
|
check = state.charCategorizer(range.head);
|
|
526
|
-
if (!(insideWordBoundaries(check, state, range.from, range.to)
|
|
527
|
-
|
|
526
|
+
if (!(insideWordBoundaries(check, state, range.from, range.to) &&
|
|
527
|
+
insideWord(check, state, range.from, range.to)))
|
|
528
528
|
return view_.Decoration.none;
|
|
529
529
|
}
|
|
530
530
|
else {
|
|
531
|
-
query = state.sliceDoc(range.from, range.to)
|
|
531
|
+
query = state.sliceDoc(range.from, range.to);
|
|
532
532
|
if (!query)
|
|
533
533
|
return view_.Decoration.none;
|
|
534
534
|
}
|
|
@@ -791,10 +791,10 @@ class RegExpQuery extends QueryType {
|
|
|
791
791
|
this.prevMatchInRange(state, curTo, state.doc.length);
|
|
792
792
|
}
|
|
793
793
|
getReplacement(result) {
|
|
794
|
-
return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g, (m, i) => i == "$" ? "$"
|
|
794
|
+
return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g, (m, i) => i == "$" ? "$"
|
|
795
795
|
: i == "&" ? result.match[0]
|
|
796
796
|
: i != "0" && +i < result.match.length ? result.match[i]
|
|
797
|
-
: m)
|
|
797
|
+
: m);
|
|
798
798
|
}
|
|
799
799
|
matchAll(state, limit) {
|
|
800
800
|
let cursor = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];
|
|
@@ -1087,7 +1087,7 @@ Default search-related key bindings.
|
|
|
1087
1087
|
- Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)
|
|
1088
1088
|
- F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)
|
|
1089
1089
|
- Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)
|
|
1090
|
-
- Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)
|
|
1090
|
+
- Mod-Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)
|
|
1091
1091
|
- Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)
|
|
1092
1092
|
*/
|
|
1093
1093
|
const searchKeymap = [
|
|
@@ -1096,7 +1096,7 @@ const searchKeymap = [
|
|
|
1096
1096
|
{ key: "Mod-g", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true },
|
|
1097
1097
|
{ key: "Escape", run: closeSearchPanel, scope: "editor search-panel" },
|
|
1098
1098
|
{ key: "Mod-Shift-l", run: selectSelectionMatches },
|
|
1099
|
-
{ key: "Alt-g", run: gotoLine },
|
|
1099
|
+
{ key: "Mod-Alt-g", run: gotoLine },
|
|
1100
1100
|
{ key: "Mod-d", run: selectNextOccurrence, preventDefault: true },
|
|
1101
1101
|
];
|
|
1102
1102
|
class SearchPanel {
|
|
@@ -1280,7 +1280,7 @@ const searchExtensions = [
|
|
|
1280
1280
|
|
|
1281
1281
|
|
|
1282
1282
|
// EXTERNAL MODULE: ../node_modules/@codemirror/language/dist/index.js + 2 modules
|
|
1283
|
-
var language_dist = __webpack_require__(
|
|
1283
|
+
var language_dist = __webpack_require__(194);
|
|
1284
1284
|
;// CONCATENATED MODULE: ../node_modules/@codemirror/autocomplete/dist/index.js
|
|
1285
1285
|
|
|
1286
1286
|
|
|
@@ -1324,7 +1324,7 @@ class CompletionContext {
|
|
|
1324
1324
|
token before `this.pos`.
|
|
1325
1325
|
*/
|
|
1326
1326
|
tokenBefore(types) {
|
|
1327
|
-
let token = (0,language_dist/* syntaxTree */.
|
|
1327
|
+
let token = (0,language_dist/* syntaxTree */.mv)(this.state).resolveInner(this.pos, -1);
|
|
1328
1328
|
while (token && types.indexOf(token.name) < 0)
|
|
1329
1329
|
token = token.parent;
|
|
1330
1330
|
return token ? { from: token.from, to: this.pos,
|
|
@@ -1611,6 +1611,7 @@ const completionConfig = /*@__PURE__*/state_.Facet.define({
|
|
|
1611
1611
|
combine(configs) {
|
|
1612
1612
|
return (0,state_.combineConfig)(configs, {
|
|
1613
1613
|
activateOnTyping: true,
|
|
1614
|
+
activateOnTypingDelay: 100,
|
|
1614
1615
|
selectOnOpen: true,
|
|
1615
1616
|
override: null,
|
|
1616
1617
|
closeOnBlur: true,
|
|
@@ -2315,6 +2316,7 @@ const completionPlugin = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
|
2315
2316
|
this.debounceUpdate = -1;
|
|
2316
2317
|
this.running = [];
|
|
2317
2318
|
this.debounceAccept = -1;
|
|
2319
|
+
this.pendingStart = false;
|
|
2318
2320
|
this.composing = 0 /* CompositionState.None */;
|
|
2319
2321
|
for (let active of view.state.field(completionState).active)
|
|
2320
2322
|
if (active.state == 1 /* State.Pending */)
|
|
@@ -2348,8 +2350,11 @@ const completionPlugin = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
|
2348
2350
|
}
|
|
2349
2351
|
if (this.debounceUpdate > -1)
|
|
2350
2352
|
clearTimeout(this.debounceUpdate);
|
|
2353
|
+
if (update.transactions.some(tr => tr.effects.some(e => e.is(startCompletionEffect))))
|
|
2354
|
+
this.pendingStart = true;
|
|
2355
|
+
let delay = this.pendingStart ? 50 : update.state.facet(completionConfig).activateOnTypingDelay;
|
|
2351
2356
|
this.debounceUpdate = cState.active.some(a => a.state == 1 /* State.Pending */ && !this.running.some(q => q.active.source == a.source))
|
|
2352
|
-
? setTimeout(() => this.startUpdate(),
|
|
2357
|
+
? setTimeout(() => this.startUpdate(), delay) : -1;
|
|
2353
2358
|
if (this.composing != 0 /* CompositionState.None */)
|
|
2354
2359
|
for (let tr of update.transactions) {
|
|
2355
2360
|
if (getUserEvent(tr) == "input")
|
|
@@ -2360,6 +2365,7 @@ const completionPlugin = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
|
2360
2365
|
}
|
|
2361
2366
|
startUpdate() {
|
|
2362
2367
|
this.debounceUpdate = -1;
|
|
2368
|
+
this.pendingStart = false;
|
|
2363
2369
|
let { state } = this.view, cState = state.field(completionState);
|
|
2364
2370
|
for (let active of cState.active) {
|
|
2365
2371
|
if (active.state == 1 /* State.Pending */ && !this.running.some(r => r.active.source == active.source))
|
|
@@ -2439,7 +2445,7 @@ const completionPlugin = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
|
2439
2445
|
if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {
|
|
2440
2446
|
let dialog = state.open && (0,view_.getTooltip)(this.view, state.open.tooltip);
|
|
2441
2447
|
if (!dialog || !dialog.dom.contains(event.relatedTarget))
|
|
2442
|
-
this.view.dispatch({ effects: closeCompletionEffect.of(null) });
|
|
2448
|
+
setTimeout(() => this.view.dispatch({ effects: closeCompletionEffect.of(null) }), 10);
|
|
2443
2449
|
}
|
|
2444
2450
|
},
|
|
2445
2451
|
compositionstart() {
|
|
@@ -2747,11 +2753,11 @@ function snippet(template) {
|
|
|
2747
2753
|
let spec = {
|
|
2748
2754
|
changes: { from, to, insert: Text.of(text) },
|
|
2749
2755
|
scrollIntoView: true,
|
|
2750
|
-
annotations: completion ? pickedCompletion.of(completion) : undefined
|
|
2756
|
+
annotations: completion ? [pickedCompletion.of(completion), Transaction.userEvent.of("input.complete")] : undefined
|
|
2751
2757
|
};
|
|
2752
2758
|
if (ranges.length)
|
|
2753
2759
|
spec.selection = fieldSelection(ranges, 0);
|
|
2754
|
-
if (ranges.
|
|
2760
|
+
if (ranges.some(r => r.field > 0)) {
|
|
2755
2761
|
let active = new ActiveSnippet(ranges, 0);
|
|
2756
2762
|
let effects = spec.effects = [setActive.of(active)];
|
|
2757
2763
|
if (editor.state.field(snippetState, false) === undefined)
|
|
@@ -2944,11 +2950,11 @@ closedBracket.endSide = -1;
|
|
|
2944
2950
|
const bracketState = /*@__PURE__*/state_.StateField.define({
|
|
2945
2951
|
create() { return state_.RangeSet.empty; },
|
|
2946
2952
|
update(value, tr) {
|
|
2953
|
+
value = value.map(tr.changes);
|
|
2947
2954
|
if (tr.selection) {
|
|
2948
2955
|
let line = tr.state.doc.lineAt(tr.selection.main.head);
|
|
2949
2956
|
value = value.update({ filter: from => from >= line.from && from <= line.to });
|
|
2950
2957
|
}
|
|
2951
|
-
value = value.map(tr.changes);
|
|
2952
2958
|
for (let effect of tr.effects)
|
|
2953
2959
|
if (effect.is(closeBracketEffect))
|
|
2954
2960
|
value = value.update({ add: [closedBracket.range(effect.value, effect.value + 1)] });
|
|
@@ -3134,11 +3140,11 @@ function handleSame(state, token, allowTriple, config) {
|
|
|
3134
3140
|
});
|
|
3135
3141
|
}
|
|
3136
3142
|
function nodeStart(state, pos) {
|
|
3137
|
-
let tree = (0,language_dist/* syntaxTree */.
|
|
3143
|
+
let tree = (0,language_dist/* syntaxTree */.mv)(state).resolveInner(pos + 1);
|
|
3138
3144
|
return tree.parent && tree.from == pos;
|
|
3139
3145
|
}
|
|
3140
3146
|
function probablyInString(state, pos, quoteToken, prefixes) {
|
|
3141
|
-
let node = (0,language_dist/* syntaxTree */.
|
|
3147
|
+
let node = (0,language_dist/* syntaxTree */.mv)(state).resolveInner(pos, -1);
|
|
3142
3148
|
let maxPrefix = prefixes.reduce((m, p) => Math.max(m, p.length), 0);
|
|
3143
3149
|
for (let i = 0; i < 5; i++) {
|
|
3144
3150
|
let start = state.sliceDoc(node.from, Math.min(node.to, node.from + quoteToken.length + maxPrefix));
|
|
@@ -3279,7 +3285,7 @@ class LintState {
|
|
|
3279
3285
|
let markedDiagnostics = diagnostics;
|
|
3280
3286
|
let diagnosticFilter = state.facet(lintConfig).markerFilter;
|
|
3281
3287
|
if (diagnosticFilter)
|
|
3282
|
-
markedDiagnostics = diagnosticFilter(markedDiagnostics);
|
|
3288
|
+
markedDiagnostics = diagnosticFilter(markedDiagnostics, state);
|
|
3283
3289
|
let ranges = view_.Decoration.set(markedDiagnostics.map((d) => {
|
|
3284
3290
|
// For zero-length ranges or ranges covering only a line break, create a widget
|
|
3285
3291
|
return d.from == d.to || (d.from == d.to - 1 && state.doc.lineAt(d.from).to == d.from)
|
|
@@ -3289,7 +3295,8 @@ class LintState {
|
|
|
3289
3295
|
}).range(d.from)
|
|
3290
3296
|
: view_.Decoration.mark({
|
|
3291
3297
|
attributes: { class: "cm-lintRange cm-lintRange-" + d.severity + (d.markClass ? " " + d.markClass : "") },
|
|
3292
|
-
diagnostic: d
|
|
3298
|
+
diagnostic: d,
|
|
3299
|
+
inclusive: true
|
|
3293
3300
|
}).range(d.from, d.to);
|
|
3294
3301
|
}), true);
|
|
3295
3302
|
return new LintState(ranges, panel, findDiagnostic(ranges));
|
|
@@ -3365,7 +3372,7 @@ function diagnosticCount(state) {
|
|
|
3365
3372
|
let lint = state.field(lintState, false);
|
|
3366
3373
|
return lint ? lint.diagnostics.size : 0;
|
|
3367
3374
|
}
|
|
3368
|
-
const activeMark = /*@__PURE__*/view_.Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
3375
|
+
const activeMark = /*@__PURE__*/view_.Decoration.mark({ class: "cm-lintRange cm-lintRange-active", inclusive: true });
|
|
3369
3376
|
function lintTooltip(view, pos, side) {
|
|
3370
3377
|
let { diagnostics } = view.state.field(lintState);
|
|
3371
3378
|
let found = [], stackStart = 2e8, stackEnd = 0;
|
|
@@ -3379,7 +3386,7 @@ function lintTooltip(view, pos, side) {
|
|
|
3379
3386
|
});
|
|
3380
3387
|
let diagnosticFilter = view.state.facet(lintConfig).tooltipFilter;
|
|
3381
3388
|
if (diagnosticFilter)
|
|
3382
|
-
found = diagnosticFilter(found);
|
|
3389
|
+
found = diagnosticFilter(found, view.state);
|
|
3383
3390
|
if (!found.length)
|
|
3384
3391
|
return null;
|
|
3385
3392
|
return {
|
|
@@ -3484,11 +3491,12 @@ const lintPlugin = /*@__PURE__*/(/* unused pure expression or super */ null && (
|
|
|
3484
3491
|
else {
|
|
3485
3492
|
this.set = false;
|
|
3486
3493
|
let { state } = this.view, { sources } = state.facet(lintConfig);
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3494
|
+
if (sources.length)
|
|
3495
|
+
Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {
|
|
3496
|
+
let all = annotations.reduce((a, b) => a.concat(b));
|
|
3497
|
+
if (this.view.state.doc == state.doc)
|
|
3498
|
+
this.view.dispatch(setDiagnostics(this.view.state, all));
|
|
3499
|
+
}, error => { logException(this.view.state, error); });
|
|
3492
3500
|
}
|
|
3493
3501
|
}
|
|
3494
3502
|
update(update) {
|
|
@@ -3514,7 +3522,7 @@ const lintPlugin = /*@__PURE__*/(/* unused pure expression or super */ null && (
|
|
|
3514
3522
|
})));
|
|
3515
3523
|
const lintConfig = /*@__PURE__*/state_.Facet.define({
|
|
3516
3524
|
combine(input) {
|
|
3517
|
-
return Object.assign({ sources: input.map(i => i.source) }, (0,state_.combineConfig)(input.map(i => i.config), {
|
|
3525
|
+
return Object.assign({ sources: input.map(i => i.source).filter(x => x != null) }, (0,state_.combineConfig)(input.map(i => i.config), {
|
|
3518
3526
|
delay: 750,
|
|
3519
3527
|
markerFilter: null,
|
|
3520
3528
|
tooltipFilter: null,
|
|
@@ -3527,7 +3535,8 @@ const lintConfig = /*@__PURE__*/state_.Facet.define({
|
|
|
3527
3535
|
/**
|
|
3528
3536
|
Given a diagnostic source, this function returns an extension that
|
|
3529
3537
|
enables linting with that source. It will be called whenever the
|
|
3530
|
-
editor is idle (after its content changed).
|
|
3538
|
+
editor is idle (after its content changed). If `null` is given as
|
|
3539
|
+
source, this only configures the lint extension.
|
|
3531
3540
|
*/
|
|
3532
3541
|
function linter(source, config = {}) {
|
|
3533
3542
|
return [
|
|
@@ -3885,7 +3894,7 @@ class LintGutterMarker extends view_.GutterMarker {
|
|
|
3885
3894
|
let diagnostics = this.diagnostics;
|
|
3886
3895
|
let diagnosticsFilter = view.state.facet(lintGutterConfig).tooltipFilter;
|
|
3887
3896
|
if (diagnosticsFilter)
|
|
3888
|
-
diagnostics = diagnosticsFilter(diagnostics);
|
|
3897
|
+
diagnostics = diagnosticsFilter(diagnostics, view.state);
|
|
3889
3898
|
if (diagnostics.length)
|
|
3890
3899
|
elt.onmouseover = () => gutterMarkerMouseOver(view, elt, diagnostics);
|
|
3891
3900
|
return elt;
|
|
@@ -3964,7 +3973,7 @@ const lintGutterMarkers = /*@__PURE__*/state_.StateField.define({
|
|
|
3964
3973
|
if (effect.is(setDiagnosticsEffect)) {
|
|
3965
3974
|
let diagnostics = effect.value;
|
|
3966
3975
|
if (diagnosticFilter)
|
|
3967
|
-
diagnostics = diagnosticFilter(diagnostics || []);
|
|
3976
|
+
diagnostics = diagnosticFilter(diagnostics || [], tr.state);
|
|
3968
3977
|
markers = markersForDiagnostics(tr.state.doc, diagnostics.slice(0));
|
|
3969
3978
|
}
|
|
3970
3979
|
}
|
|
@@ -4103,16 +4112,16 @@ var basicSetup = function basicSetup(options) {
|
|
|
4103
4112
|
keymaps = keymaps.concat(closeBracketsKeymap);
|
|
4104
4113
|
}
|
|
4105
4114
|
if (options.defaultKeymap !== false) {
|
|
4106
|
-
keymaps = keymaps.concat(dist/* defaultKeymap */.
|
|
4115
|
+
keymaps = keymaps.concat(dist/* defaultKeymap */.pw);
|
|
4107
4116
|
}
|
|
4108
4117
|
if (options.searchKeymap !== false) {
|
|
4109
4118
|
keymaps = keymaps.concat(searchKeymap);
|
|
4110
4119
|
}
|
|
4111
4120
|
if (options.historyKeymap !== false) {
|
|
4112
|
-
keymaps = keymaps.concat(dist/* historyKeymap */.
|
|
4121
|
+
keymaps = keymaps.concat(dist/* historyKeymap */.cL);
|
|
4113
4122
|
}
|
|
4114
4123
|
if (options.foldKeymap !== false) {
|
|
4115
|
-
keymaps = keymaps.concat(language_dist/* foldKeymap */.
|
|
4124
|
+
keymaps = keymaps.concat(language_dist/* foldKeymap */.f7);
|
|
4116
4125
|
}
|
|
4117
4126
|
if (options.completionKeymap !== false) {
|
|
4118
4127
|
keymaps = keymaps.concat(completionKeymap);
|
|
@@ -4124,23 +4133,23 @@ var basicSetup = function basicSetup(options) {
|
|
|
4124
4133
|
if (options.lineNumbers !== false) extensions.push((0,view_.lineNumbers)());
|
|
4125
4134
|
if (options.highlightActiveLineGutter !== false) extensions.push((0,view_.highlightActiveLineGutter)());
|
|
4126
4135
|
if (options.highlightSpecialChars !== false) extensions.push((0,view_.highlightSpecialChars)());
|
|
4127
|
-
if (options.history !== false) extensions.push((0,dist/* history */.
|
|
4128
|
-
if (options.foldGutter !== false) extensions.push((0,language_dist/* foldGutter */.
|
|
4136
|
+
if (options.history !== false) extensions.push((0,dist/* history */.b6)());
|
|
4137
|
+
if (options.foldGutter !== false) extensions.push((0,language_dist/* foldGutter */.Lv)());
|
|
4129
4138
|
if (options.drawSelection !== false) extensions.push((0,view_.drawSelection)());
|
|
4130
4139
|
if (options.dropCursor !== false) extensions.push((0,view_.dropCursor)());
|
|
4131
4140
|
if (options.allowMultipleSelections !== false) extensions.push(state_.EditorState.allowMultipleSelections.of(true));
|
|
4132
|
-
if (options.indentOnInput !== false) extensions.push((0,language_dist/* indentOnInput */.
|
|
4133
|
-
if (options.syntaxHighlighting !== false) extensions.push((0,language_dist/* syntaxHighlighting */.
|
|
4141
|
+
if (options.indentOnInput !== false) extensions.push((0,language_dist/* indentOnInput */.WD)());
|
|
4142
|
+
if (options.syntaxHighlighting !== false) extensions.push((0,language_dist/* syntaxHighlighting */.y9)(language_dist/* defaultHighlightStyle */.Zt, {
|
|
4134
4143
|
fallback: true
|
|
4135
4144
|
}));
|
|
4136
|
-
if (options.bracketMatching !== false) extensions.push((0,language_dist/* bracketMatching */.
|
|
4145
|
+
if (options.bracketMatching !== false) extensions.push((0,language_dist/* bracketMatching */.SG)());
|
|
4137
4146
|
if (options.closeBrackets !== false) extensions.push(closeBrackets());
|
|
4138
4147
|
if (options.autocompletion !== false) extensions.push(autocompletion());
|
|
4139
4148
|
if (options.rectangularSelection !== false) extensions.push((0,view_.rectangularSelection)());
|
|
4140
4149
|
if (initCrosshairCursor !== false) extensions.push((0,view_.crosshairCursor)());
|
|
4141
4150
|
if (options.highlightActiveLine !== false) extensions.push((0,view_.highlightActiveLine)());
|
|
4142
4151
|
if (options.highlightSelectionMatches !== false) extensions.push(highlightSelectionMatches());
|
|
4143
|
-
if (options.tabSize && typeof options.tabSize === 'number') extensions.push(language_dist/* indentUnit */.
|
|
4152
|
+
if (options.tabSize && typeof options.tabSize === 'number') extensions.push(language_dist/* indentUnit */.Xt.of(' '.repeat(options.tabSize)));
|
|
4144
4153
|
return extensions.concat([view_.keymap.of(keymaps.flat())]).filter(Boolean);
|
|
4145
4154
|
};
|
|
4146
4155
|
/**
|
|
@@ -4157,16 +4166,16 @@ var minimalSetup = function minimalSetup(options) {
|
|
|
4157
4166
|
}
|
|
4158
4167
|
var keymaps = [];
|
|
4159
4168
|
if (options.defaultKeymap !== false) {
|
|
4160
|
-
keymaps = keymaps.concat(dist/* defaultKeymap */.
|
|
4169
|
+
keymaps = keymaps.concat(dist/* defaultKeymap */.pw);
|
|
4161
4170
|
}
|
|
4162
4171
|
if (options.historyKeymap !== false) {
|
|
4163
|
-
keymaps = keymaps.concat(dist/* historyKeymap */.
|
|
4172
|
+
keymaps = keymaps.concat(dist/* historyKeymap */.cL);
|
|
4164
4173
|
}
|
|
4165
4174
|
var extensions = [];
|
|
4166
4175
|
if (options.highlightSpecialChars !== false) extensions.push((0,view_.highlightSpecialChars)());
|
|
4167
|
-
if (options.history !== false) extensions.push((0,dist/* history */.
|
|
4176
|
+
if (options.history !== false) extensions.push((0,dist/* history */.b6)());
|
|
4168
4177
|
if (options.drawSelection !== false) extensions.push((0,view_.drawSelection)());
|
|
4169
|
-
if (options.syntaxHighlighting !== false) extensions.push((0,language_dist/* syntaxHighlighting */.
|
|
4178
|
+
if (options.syntaxHighlighting !== false) extensions.push((0,language_dist/* syntaxHighlighting */.y9)(language_dist/* defaultHighlightStyle */.Zt, {
|
|
4170
4179
|
fallback: true
|
|
4171
4180
|
}));
|
|
4172
4181
|
return extensions.concat([view_.keymap.of(keymaps.flat())]).filter(Boolean);
|
|
@@ -4174,49 +4183,49 @@ var minimalSetup = function minimalSetup(options) {
|
|
|
4174
4183
|
|
|
4175
4184
|
/***/ }),
|
|
4176
4185
|
|
|
4177
|
-
/***/
|
|
4186
|
+
/***/ 89:
|
|
4178
4187
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4179
4188
|
|
|
4180
4189
|
__webpack_require__.r(__webpack_exports__);
|
|
4181
4190
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4182
|
-
/* harmony export */ defaultLightThemeOption: () => (/* reexport safe */ _theme_light__WEBPACK_IMPORTED_MODULE_4__.
|
|
4191
|
+
/* harmony export */ defaultLightThemeOption: () => (/* reexport safe */ _theme_light__WEBPACK_IMPORTED_MODULE_4__.c),
|
|
4183
4192
|
/* harmony export */ getDefaultExtensions: () => (/* binding */ getDefaultExtensions)
|
|
4184
4193
|
/* harmony export */ });
|
|
4185
|
-
/* harmony import */ var _codemirror_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
4186
|
-
/* harmony import */ var _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
4187
|
-
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
4194
|
+
/* harmony import */ var _codemirror_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(720);
|
|
4195
|
+
/* harmony import */ var _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(368);
|
|
4196
|
+
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(730);
|
|
4188
4197
|
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__);
|
|
4189
|
-
/* harmony import */ var _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
4198
|
+
/* harmony import */ var _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(708);
|
|
4190
4199
|
/* harmony import */ var _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__);
|
|
4191
|
-
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
4200
|
+
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60);
|
|
4192
4201
|
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_codemirror_state__WEBPACK_IMPORTED_MODULE_3__);
|
|
4193
|
-
/* harmony import */ var _theme_light__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
4202
|
+
/* harmony import */ var _theme_light__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(806);
|
|
4194
4203
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
4195
4204
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__) if(["default","getDefaultExtensions"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__[__WEBPACK_IMPORT_KEY__]
|
|
4196
4205
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
4197
|
-
var getDefaultExtensions=function getDefaultExtensions(){var optios=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _optios$indentWithTab=optios.indentWithTab,defaultIndentWithTab=_optios$indentWithTab===void 0?true:_optios$indentWithTab,_optios$editable=optios.editable,editable=_optios$editable===void 0?true:_optios$editable,_optios$readOnly=optios.readOnly,readOnly=_optios$readOnly===void 0?false:_optios$readOnly,_optios$theme=optios.theme,theme=_optios$theme===void 0?'light':_optios$theme,_optios$placeholder=optios.placeholder,placeholderStr=_optios$placeholder===void 0?'':_optios$placeholder,_optios$basicSetup=optios.basicSetup,defaultBasicSetup=_optios$basicSetup===void 0?true:_optios$basicSetup;var getExtensions=[];if(defaultIndentWithTab){getExtensions.unshift(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__.keymap.of([_codemirror_commands__WEBPACK_IMPORTED_MODULE_5__/* .indentWithTab */ .
|
|
4206
|
+
var getDefaultExtensions=function getDefaultExtensions(){var optios=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _optios$indentWithTab=optios.indentWithTab,defaultIndentWithTab=_optios$indentWithTab===void 0?true:_optios$indentWithTab,_optios$editable=optios.editable,editable=_optios$editable===void 0?true:_optios$editable,_optios$readOnly=optios.readOnly,readOnly=_optios$readOnly===void 0?false:_optios$readOnly,_optios$theme=optios.theme,theme=_optios$theme===void 0?'light':_optios$theme,_optios$placeholder=optios.placeholder,placeholderStr=_optios$placeholder===void 0?'':_optios$placeholder,_optios$basicSetup=optios.basicSetup,defaultBasicSetup=_optios$basicSetup===void 0?true:_optios$basicSetup;var getExtensions=[];if(defaultIndentWithTab){getExtensions.unshift(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__.keymap.of([_codemirror_commands__WEBPACK_IMPORTED_MODULE_5__/* .indentWithTab */ .Yc]));}if(defaultBasicSetup){if(typeof defaultBasicSetup==='boolean'){getExtensions.unshift((0,_uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_0__/* .basicSetup */ .o)());}else{getExtensions.unshift((0,_uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_0__/* .basicSetup */ .o)(defaultBasicSetup));}}if(placeholderStr){getExtensions.unshift((0,_codemirror_view__WEBPACK_IMPORTED_MODULE_1__.placeholder)(placeholderStr));}switch(theme){case'light':getExtensions.push(_theme_light__WEBPACK_IMPORTED_MODULE_4__/* .defaultLightThemeOption */ .c);break;case'dark':getExtensions.push(_codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_2__.oneDark);break;case'none':break;default:getExtensions.push(theme);break;}if(editable===false){getExtensions.push(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.editable.of(false));}if(readOnly){getExtensions.push(_codemirror_state__WEBPACK_IMPORTED_MODULE_3__.EditorState.readOnly.of(true));}return[].concat(getExtensions);};
|
|
4198
4207
|
|
|
4199
4208
|
/***/ }),
|
|
4200
4209
|
|
|
4201
|
-
/***/
|
|
4210
|
+
/***/ 806:
|
|
4202
4211
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4203
4212
|
|
|
4204
4213
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4205
|
-
/* harmony export */
|
|
4214
|
+
/* harmony export */ c: () => (/* binding */ defaultLightThemeOption)
|
|
4206
4215
|
/* harmony export */ });
|
|
4207
|
-
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
4216
|
+
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(730);
|
|
4208
4217
|
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_0__);
|
|
4209
4218
|
var defaultLightThemeOption=_codemirror_view__WEBPACK_IMPORTED_MODULE_0__.EditorView.theme({'&':{backgroundColor:'#fff'}},{dark:false});
|
|
4210
4219
|
|
|
4211
4220
|
/***/ }),
|
|
4212
4221
|
|
|
4213
|
-
/***/
|
|
4222
|
+
/***/ 695:
|
|
4214
4223
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4215
4224
|
|
|
4216
4225
|
|
|
4217
4226
|
// EXPORTS
|
|
4218
4227
|
__webpack_require__.d(__webpack_exports__, {
|
|
4219
|
-
|
|
4228
|
+
q: () => (/* binding */ useCodeMirror)
|
|
4220
4229
|
});
|
|
4221
4230
|
|
|
4222
4231
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
@@ -4301,34 +4310,34 @@ function _slicedToArray(arr, i) {
|
|
|
4301
4310
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
4302
4311
|
}
|
|
4303
4312
|
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
4304
|
-
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(
|
|
4313
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(442);
|
|
4305
4314
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/state"],"commonjs":"@codemirror/state","commonjs2":"@codemirror/state"}
|
|
4306
|
-
var state_ = __webpack_require__(
|
|
4315
|
+
var state_ = __webpack_require__(60);
|
|
4307
4316
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/view"],"commonjs":"@codemirror/view","commonjs2":"@codemirror/view"}
|
|
4308
|
-
var view_ = __webpack_require__(
|
|
4317
|
+
var view_ = __webpack_require__(730);
|
|
4309
4318
|
// EXTERNAL MODULE: ./src/getDefaultExtensions.ts
|
|
4310
|
-
var getDefaultExtensions = __webpack_require__(
|
|
4319
|
+
var getDefaultExtensions = __webpack_require__(89);
|
|
4311
4320
|
// EXTERNAL MODULE: ./src/utils.ts
|
|
4312
|
-
var utils = __webpack_require__(
|
|
4321
|
+
var utils = __webpack_require__(369);
|
|
4313
4322
|
;// CONCATENATED MODULE: ./src/useCodeMirror.ts
|
|
4314
4323
|
var External=state_.Annotation.define();var emptyExtensions=[];function useCodeMirror(props){var value=props.value,selection=props.selection,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,_props$extensions=props.extensions,extensions=_props$extensions===void 0?emptyExtensions:_props$extensions,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,_props$height=props.height,height=_props$height===void 0?null:_props$height,_props$minHeight=props.minHeight,minHeight=_props$minHeight===void 0?null:_props$minHeight,_props$maxHeight=props.maxHeight,maxHeight=_props$maxHeight===void 0?null:_props$maxHeight,_props$width=props.width,width=_props$width===void 0?null:_props$width,_props$minWidth=props.minWidth,minWidth=_props$minWidth===void 0?null:_props$minWidth,_props$maxWidth=props.maxWidth,maxWidth=_props$maxWidth===void 0?null:_props$maxWidth,_props$placeholder=props.placeholder,placeholderStr=_props$placeholder===void 0?'':_props$placeholder,_props$editable=props.editable,editable=_props$editable===void 0?true:_props$editable,_props$readOnly=props.readOnly,readOnly=_props$readOnly===void 0?false:_props$readOnly,_props$indentWithTab=props.indentWithTab,defaultIndentWithTab=_props$indentWithTab===void 0?true:_props$indentWithTab,_props$basicSetup=props.basicSetup,defaultBasicSetup=_props$basicSetup===void 0?true:_props$basicSetup,root=props.root,initialState=props.initialState;var _useState=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState2=_slicedToArray(_useState,2),container=_useState2[0],setContainer=_useState2[1];var _useState3=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState4=_slicedToArray(_useState3,2),view=_useState4[0],setView=_useState4[1];var _useState5=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState6=_slicedToArray(_useState5,2),state=_useState6[0],setState=_useState6[1];var defaultThemeOption=view_.EditorView.theme({'&':{height:height,minHeight:minHeight,maxHeight:maxHeight,width:width,minWidth:minWidth,maxWidth:maxWidth},'& .cm-scroller':{height:'100% !important'}});var updateListener=view_.EditorView.updateListener.of(function(vu){if(vu.docChanged&&typeof onChange==='function'&&// Fix echoing of the remote changes:
|
|
4315
4324
|
// If transaction is market as remote we don't have to call `onChange` handler again
|
|
4316
|
-
!vu.transactions.some(function(tr){return tr.annotation(External);})){var doc=vu.state.doc;var _value=doc.toString();onChange(_value,vu);}onStatistics&&onStatistics((0,utils/* getStatistics */.
|
|
4325
|
+
!vu.transactions.some(function(tr){return tr.annotation(External);})){var doc=vu.state.doc;var _value=doc.toString();onChange(_value,vu);}onStatistics&&onStatistics((0,utils/* getStatistics */.m)(vu));});var defaultExtensions=(0,getDefaultExtensions.getDefaultExtensions)({theme:theme,editable:editable,readOnly:readOnly,placeholder:placeholderStr,indentWithTab:defaultIndentWithTab,basicSetup:defaultBasicSetup});var getExtensions=[updateListener,defaultThemeOption].concat(_toConsumableArray(defaultExtensions));if(onUpdate&&typeof onUpdate==='function'){getExtensions.push(view_.EditorView.updateListener.of(onUpdate));}getExtensions=getExtensions.concat(extensions);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(container&&!state){var config={doc:value,selection:selection,extensions:getExtensions};var stateCurrent=initialState?state_.EditorState.fromJSON(initialState.json,config,initialState.fields):state_.EditorState.create(config);setState(stateCurrent);if(!view){var viewCurrent=new view_.EditorView({state:stateCurrent,parent:container,root:root});setView(viewCurrent);onCreateEditor&&onCreateEditor(viewCurrent,stateCurrent);}}return function(){if(view){setState(undefined);setView(undefined);}};},[container,state]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){return setContainer(props.container);},[props.container]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){return function(){if(view){view.destroy();setView(undefined);}};},[view]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(autoFocus&&view){view.focus();}},[autoFocus,view]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(view){view.dispatch({effects:state_.StateEffect.reconfigure.of(getExtensions)});}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4317
4326
|
},[theme,extensions,height,minHeight,maxHeight,width,minWidth,maxWidth,placeholderStr,editable,readOnly,defaultIndentWithTab,defaultBasicSetup,onChange,onUpdate]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(value===undefined){return;}var currentValue=view?view.state.doc.toString():'';if(view&&value!==currentValue){view.dispatch({changes:{from:0,to:currentValue.length,insert:value||''},annotations:[External.of(true)]});}},[value,view]);return{state:state,setState:setState,view:view,setView:setView,container:container,setContainer:setContainer};}
|
|
4318
4327
|
|
|
4319
4328
|
/***/ }),
|
|
4320
4329
|
|
|
4321
|
-
/***/
|
|
4330
|
+
/***/ 369:
|
|
4322
4331
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4323
4332
|
|
|
4324
4333
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4325
|
-
/* harmony export */
|
|
4334
|
+
/* harmony export */ m: () => (/* binding */ getStatistics)
|
|
4326
4335
|
/* harmony export */ });
|
|
4327
4336
|
var getStatistics=function getStatistics(view){return{line:view.state.doc.lineAt(view.state.selection.main.from),lineCount:view.state.doc.lines,lineBreak:view.state.lineBreak,length:view.state.doc.length,readOnly:view.state.readOnly,tabSize:view.state.tabSize,selection:view.state.selection,selectionAsSingle:view.state.selection.asSingle().main,ranges:view.state.selection.ranges,selectionCode:view.state.sliceDoc(view.state.selection.main.from,view.state.selection.main.to),selections:view.state.selection.ranges.map(function(r){return view.state.sliceDoc(r.from,r.to);}),selectedText:view.state.selection.ranges.some(function(r){return!r.empty;})};};
|
|
4328
4337
|
|
|
4329
4338
|
/***/ }),
|
|
4330
4339
|
|
|
4331
|
-
/***/
|
|
4340
|
+
/***/ 192:
|
|
4332
4341
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4333
4342
|
|
|
4334
4343
|
var __webpack_unused_export__;
|
|
@@ -4341,59 +4350,59 @@ var __webpack_unused_export__;
|
|
|
4341
4350
|
* This source code is licensed under the MIT license found in the
|
|
4342
4351
|
* LICENSE file in the root directory of this source tree.
|
|
4343
4352
|
*/
|
|
4344
|
-
var f=__webpack_require__(
|
|
4353
|
+
var f=__webpack_require__(442),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
4345
4354
|
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}__webpack_unused_export__=l;exports.jsx=q;__webpack_unused_export__=q;
|
|
4346
4355
|
|
|
4347
4356
|
|
|
4348
4357
|
/***/ }),
|
|
4349
4358
|
|
|
4350
|
-
/***/
|
|
4359
|
+
/***/ 540:
|
|
4351
4360
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4352
4361
|
|
|
4353
4362
|
|
|
4354
4363
|
|
|
4355
4364
|
if (true) {
|
|
4356
|
-
module.exports = __webpack_require__(
|
|
4365
|
+
module.exports = __webpack_require__(192);
|
|
4357
4366
|
} else {}
|
|
4358
4367
|
|
|
4359
4368
|
|
|
4360
4369
|
/***/ }),
|
|
4361
4370
|
|
|
4362
|
-
/***/
|
|
4371
|
+
/***/ 442:
|
|
4363
4372
|
/***/ ((module) => {
|
|
4364
4373
|
|
|
4365
|
-
module.exports =
|
|
4374
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__442__;
|
|
4366
4375
|
|
|
4367
4376
|
/***/ }),
|
|
4368
4377
|
|
|
4369
|
-
/***/
|
|
4378
|
+
/***/ 60:
|
|
4370
4379
|
/***/ ((module) => {
|
|
4371
4380
|
|
|
4372
|
-
module.exports =
|
|
4381
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__60__;
|
|
4373
4382
|
|
|
4374
4383
|
/***/ }),
|
|
4375
4384
|
|
|
4376
|
-
/***/
|
|
4385
|
+
/***/ 708:
|
|
4377
4386
|
/***/ ((module) => {
|
|
4378
4387
|
|
|
4379
|
-
module.exports =
|
|
4388
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__708__;
|
|
4380
4389
|
|
|
4381
4390
|
/***/ }),
|
|
4382
4391
|
|
|
4383
|
-
/***/
|
|
4392
|
+
/***/ 730:
|
|
4384
4393
|
/***/ ((module) => {
|
|
4385
4394
|
|
|
4386
|
-
module.exports =
|
|
4395
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__730__;
|
|
4387
4396
|
|
|
4388
4397
|
/***/ }),
|
|
4389
4398
|
|
|
4390
|
-
/***/
|
|
4399
|
+
/***/ 957:
|
|
4391
4400
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4392
4401
|
|
|
4393
4402
|
|
|
4394
4403
|
// EXPORTS
|
|
4395
4404
|
__webpack_require__.d(__webpack_exports__, {
|
|
4396
|
-
|
|
4405
|
+
A: () => (/* binding */ _objectSpread2)
|
|
4397
4406
|
});
|
|
4398
4407
|
|
|
4399
4408
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
@@ -4408,27 +4417,27 @@ function _typeof(o) {
|
|
|
4408
4417
|
}
|
|
4409
4418
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
4410
4419
|
|
|
4411
|
-
function
|
|
4412
|
-
if (
|
|
4413
|
-
var
|
|
4414
|
-
if (
|
|
4415
|
-
var
|
|
4416
|
-
if (
|
|
4420
|
+
function toPrimitive(t, r) {
|
|
4421
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
4422
|
+
var e = t[Symbol.toPrimitive];
|
|
4423
|
+
if (void 0 !== e) {
|
|
4424
|
+
var i = e.call(t, r || "default");
|
|
4425
|
+
if ("object" != _typeof(i)) return i;
|
|
4417
4426
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
4418
4427
|
}
|
|
4419
|
-
return (
|
|
4428
|
+
return ("string" === r ? String : Number)(t);
|
|
4420
4429
|
}
|
|
4421
4430
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
4422
4431
|
|
|
4423
4432
|
|
|
4424
|
-
function
|
|
4425
|
-
var
|
|
4426
|
-
return _typeof(
|
|
4433
|
+
function toPropertyKey(t) {
|
|
4434
|
+
var i = toPrimitive(t, "string");
|
|
4435
|
+
return "symbol" == _typeof(i) ? i : String(i);
|
|
4427
4436
|
}
|
|
4428
4437
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
4429
4438
|
|
|
4430
4439
|
function _defineProperty(obj, key, value) {
|
|
4431
|
-
key =
|
|
4440
|
+
key = toPropertyKey(key);
|
|
4432
4441
|
if (key in obj) {
|
|
4433
4442
|
Object.defineProperty(obj, key, {
|
|
4434
4443
|
value: value,
|
|
@@ -4467,13 +4476,13 @@ function _objectSpread2(e) {
|
|
|
4467
4476
|
|
|
4468
4477
|
/***/ }),
|
|
4469
4478
|
|
|
4470
|
-
/***/
|
|
4479
|
+
/***/ 644:
|
|
4471
4480
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4472
4481
|
|
|
4473
4482
|
|
|
4474
4483
|
// EXPORTS
|
|
4475
4484
|
__webpack_require__.d(__webpack_exports__, {
|
|
4476
|
-
|
|
4485
|
+
A: () => (/* binding */ _objectWithoutProperties)
|
|
4477
4486
|
});
|
|
4478
4487
|
|
|
4479
4488
|
;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
@@ -4509,20 +4518,20 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
4509
4518
|
|
|
4510
4519
|
/***/ }),
|
|
4511
4520
|
|
|
4512
|
-
/***/
|
|
4521
|
+
/***/ 720:
|
|
4513
4522
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
4514
4523
|
|
|
4515
4524
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4516
|
-
/* harmony export */
|
|
4517
|
-
/* harmony export */
|
|
4518
|
-
/* harmony export */
|
|
4519
|
-
/* harmony export */
|
|
4525
|
+
/* harmony export */ Yc: () => (/* binding */ indentWithTab),
|
|
4526
|
+
/* harmony export */ b6: () => (/* binding */ history),
|
|
4527
|
+
/* harmony export */ cL: () => (/* binding */ historyKeymap),
|
|
4528
|
+
/* harmony export */ pw: () => (/* binding */ defaultKeymap)
|
|
4520
4529
|
/* harmony export */ });
|
|
4521
4530
|
/* unused harmony exports blockComment, blockUncomment, copyLineDown, copyLineUp, cursorCharBackward, cursorCharForward, cursorCharLeft, cursorCharRight, cursorDocEnd, cursorDocStart, cursorGroupBackward, cursorGroupForward, cursorGroupLeft, cursorGroupRight, cursorLineBoundaryBackward, cursorLineBoundaryForward, cursorLineBoundaryLeft, cursorLineBoundaryRight, cursorLineDown, cursorLineEnd, cursorLineStart, cursorLineUp, cursorMatchingBracket, cursorPageDown, cursorPageUp, cursorSubwordBackward, cursorSubwordForward, cursorSyntaxLeft, cursorSyntaxRight, deleteCharBackward, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertTab, invertedEffects, isolateHistory, lineComment, lineUncomment, moveLineDown, moveLineUp, redo, redoDepth, redoSelection, selectAll, selectCharBackward, selectCharForward, selectCharLeft, selectCharRight, selectDocEnd, selectDocStart, selectGroupBackward, selectGroupForward, selectGroupLeft, selectGroupRight, selectLine, selectLineBoundaryBackward, selectLineBoundaryForward, selectLineBoundaryLeft, selectLineBoundaryRight, selectLineDown, selectLineEnd, selectLineStart, selectLineUp, selectMatchingBracket, selectPageDown, selectPageUp, selectParentSyntax, selectSubwordBackward, selectSubwordForward, selectSyntaxLeft, selectSyntaxRight, simplifySelection, splitLine, standardKeymap, toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment, transposeChars, undo, undoDepth, undoSelection */
|
|
4522
|
-
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
4523
|
-
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
4524
|
-
/* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
4525
|
-
/* harmony import */ var _lezer_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
4531
|
+
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60);
|
|
4532
|
+
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(730);
|
|
4533
|
+
/* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(194);
|
|
4534
|
+
/* harmony import */ var _lezer_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(203);
|
|
4526
4535
|
|
|
4527
4536
|
|
|
4528
4537
|
|
|
@@ -4739,11 +4748,6 @@ const historyConfig = /*@__PURE__*/_codemirror_state__WEBPACK_IMPORTED_MODULE_0_
|
|
|
4739
4748
|
});
|
|
4740
4749
|
}
|
|
4741
4750
|
});
|
|
4742
|
-
function changeEnd(changes) {
|
|
4743
|
-
let end = 0;
|
|
4744
|
-
changes.iterChangedRanges((_, to) => end = to);
|
|
4745
|
-
return end;
|
|
4746
|
-
}
|
|
4747
4751
|
const historyField_ = /*@__PURE__*/_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.StateField.define({
|
|
4748
4752
|
create() {
|
|
4749
4753
|
return HistoryState.empty;
|
|
@@ -4752,8 +4756,7 @@ const historyField_ = /*@__PURE__*/_codemirror_state__WEBPACK_IMPORTED_MODULE_0_
|
|
|
4752
4756
|
let config = tr.state.facet(historyConfig);
|
|
4753
4757
|
let fromHist = tr.annotation(fromHistory);
|
|
4754
4758
|
if (fromHist) {
|
|
4755
|
-
let
|
|
4756
|
-
let item = HistEvent.fromTransaction(tr, selection), from = fromHist.side;
|
|
4759
|
+
let item = HistEvent.fromTransaction(tr, fromHist.selection), from = fromHist.side;
|
|
4757
4760
|
let other = from == 0 /* BranchName.Done */ ? state.undone : state.done;
|
|
4758
4761
|
if (item)
|
|
4759
4762
|
other = updateBranch(other, other.length, config.minDepth, item);
|
|
@@ -5034,15 +5037,15 @@ class HistoryState {
|
|
|
5034
5037
|
addMapping(mapping) {
|
|
5035
5038
|
return new HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);
|
|
5036
5039
|
}
|
|
5037
|
-
pop(side, state,
|
|
5040
|
+
pop(side, state, onlySelection) {
|
|
5038
5041
|
let branch = side == 0 /* BranchName.Done */ ? this.done : this.undone;
|
|
5039
5042
|
if (branch.length == 0)
|
|
5040
5043
|
return null;
|
|
5041
|
-
let event = branch[branch.length - 1];
|
|
5042
|
-
if (
|
|
5044
|
+
let event = branch[branch.length - 1], selection = event.selectionsAfter[0] || state.selection;
|
|
5045
|
+
if (onlySelection && event.selectionsAfter.length) {
|
|
5043
5046
|
return state.update({
|
|
5044
5047
|
selection: event.selectionsAfter[event.selectionsAfter.length - 1],
|
|
5045
|
-
annotations: fromHistory.of({ side, rest: popSelection(branch) }),
|
|
5048
|
+
annotations: fromHistory.of({ side, rest: popSelection(branch), selection }),
|
|
5046
5049
|
userEvent: side == 0 /* BranchName.Done */ ? "select.undo" : "select.redo",
|
|
5047
5050
|
scrollIntoView: true
|
|
5048
5051
|
});
|
|
@@ -5058,7 +5061,7 @@ class HistoryState {
|
|
|
5058
5061
|
changes: event.changes,
|
|
5059
5062
|
selection: event.startSelection,
|
|
5060
5063
|
effects: event.effects,
|
|
5061
|
-
annotations: fromHistory.of({ side, rest }),
|
|
5064
|
+
annotations: fromHistory.of({ side, rest, selection }),
|
|
5062
5065
|
filter: false,
|
|
5063
5066
|
userEvent: side == 0 /* BranchName.Done */ ? "undo" : "redo",
|
|
5064
5067
|
scrollIntoView: true
|
|
@@ -5091,7 +5094,7 @@ function setSel(state, selection) {
|
|
|
5091
5094
|
}
|
|
5092
5095
|
function moveSel({ state, dispatch }, how) {
|
|
5093
5096
|
let selection = updateSel(state.selection, how);
|
|
5094
|
-
if (selection.eq(state.selection))
|
|
5097
|
+
if (selection.eq(state.selection, true))
|
|
5095
5098
|
return false;
|
|
5096
5099
|
dispatch(setSel(state, selection));
|
|
5097
5100
|
return true;
|
|
@@ -5216,8 +5219,8 @@ function interestingNode(state, node, bracketProp) {
|
|
|
5216
5219
|
return len && (len > 2 || /[^\s,.;:]/.test(state.sliceDoc(node.from, node.to))) || node.firstChild;
|
|
5217
5220
|
}
|
|
5218
5221
|
function moveBySyntax(state, start, forward) {
|
|
5219
|
-
let pos = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .
|
|
5220
|
-
let bracketProp = forward ? _lezer_common__WEBPACK_IMPORTED_MODULE_2__/* .NodeProp */ .
|
|
5222
|
+
let pos = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .mv)(state).resolveInner(start.head);
|
|
5223
|
+
let bracketProp = forward ? _lezer_common__WEBPACK_IMPORTED_MODULE_2__/* .NodeProp */ .uY.closedBy : _lezer_common__WEBPACK_IMPORTED_MODULE_2__/* .NodeProp */ .uY.openedBy;
|
|
5221
5224
|
// Scan forward through child nodes to see if there's an interesting
|
|
5222
5225
|
// node ahead.
|
|
5223
5226
|
for (let at = start.head;;) {
|
|
@@ -5230,7 +5233,7 @@ function moveBySyntax(state, start, forward) {
|
|
|
5230
5233
|
at = forward ? next.to : next.from;
|
|
5231
5234
|
}
|
|
5232
5235
|
let bracket = pos.type.prop(bracketProp), match, newPos;
|
|
5233
|
-
if (bracket && (match = forward ? (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .
|
|
5236
|
+
if (bracket && (match = forward ? (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, pos.from, 1) : (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, pos.to, -1)) && match.matched)
|
|
5234
5237
|
newPos = forward ? match.end.to : match.end.from;
|
|
5235
5238
|
else
|
|
5236
5239
|
newPos = forward ? pos.to : pos.from;
|
|
@@ -5347,10 +5350,10 @@ Move the selection to the end of the line.
|
|
|
5347
5350
|
const cursorLineEnd = view => moveSel(view, range => _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(view.lineBlockAt(range.head).to, -1));
|
|
5348
5351
|
function toMatchingBracket(state, dispatch, extend) {
|
|
5349
5352
|
let found = false, selection = updateSel(state.selection, range => {
|
|
5350
|
-
let matching = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .
|
|
5351
|
-
|| (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .
|
|
5352
|
-
|| (range.head > 0 && (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .
|
|
5353
|
-
|| (range.head < state.doc.length && (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .
|
|
5353
|
+
let matching = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, range.head, -1)
|
|
5354
|
+
|| (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, range.head, 1)
|
|
5355
|
+
|| (range.head > 0 && (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, range.head - 1, 1))
|
|
5356
|
+
|| (range.head < state.doc.length && (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .matchBrackets */ .jU)(state, range.head + 1, -1));
|
|
5354
5357
|
if (!matching || !matching.end)
|
|
5355
5358
|
return range;
|
|
5356
5359
|
found = true;
|
|
@@ -5539,7 +5542,7 @@ syntax tree.
|
|
|
5539
5542
|
const selectParentSyntax = ({ state, dispatch }) => {
|
|
5540
5543
|
let selection = updateSel(state.selection, range => {
|
|
5541
5544
|
var _a;
|
|
5542
|
-
let stack = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .
|
|
5545
|
+
let stack = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .mv)(state).resolveStack(range.from, 1);
|
|
5543
5546
|
for (let cur = stack; cur; cur = cur.next) {
|
|
5544
5547
|
let { node } = cur;
|
|
5545
5548
|
if (((node.from < range.from && node.to >= range.to) ||
|
|
@@ -5617,7 +5620,7 @@ const deleteByChar = (target, forward) => deleteBy(target, range => {
|
|
|
5617
5620
|
!/[^ \t]/.test(before = line.text.slice(0, pos - line.from))) {
|
|
5618
5621
|
if (before[before.length - 1] == "\t")
|
|
5619
5622
|
return pos - 1;
|
|
5620
|
-
let col = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.countColumn)(before, state.tabSize), drop = col % (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentUnit */ .
|
|
5623
|
+
let col = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.countColumn)(before, state.tabSize), drop = col % (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentUnit */ .tp)(state) || (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentUnit */ .tp)(state);
|
|
5621
5624
|
for (let i = 0; i < drop && before[before.length - 1 - i] == " "; i++)
|
|
5622
5625
|
pos--;
|
|
5623
5626
|
targetPos = pos;
|
|
@@ -5626,6 +5629,8 @@ const deleteByChar = (target, forward) => deleteBy(target, range => {
|
|
|
5626
5629
|
targetPos = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.findClusterBreak)(line.text, pos - line.from, forward, forward) + line.from;
|
|
5627
5630
|
if (targetPos == pos && line.number != (forward ? state.doc.lines : 1))
|
|
5628
5631
|
targetPos += forward ? 1 : -1;
|
|
5632
|
+
else if (!forward && /[\ufe00-\ufe0f]/.test(line.text.slice(targetPos - line.from, pos - line.from)))
|
|
5633
|
+
targetPos = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.findClusterBreak)(line.text, targetPos - line.from, false, false) + line.from;
|
|
5629
5634
|
}
|
|
5630
5635
|
return targetPos;
|
|
5631
5636
|
});
|
|
@@ -5868,10 +5873,10 @@ const insertNewline = ({ state, dispatch }) => {
|
|
|
5868
5873
|
function isBetweenBrackets(state, pos) {
|
|
5869
5874
|
if (/\(\)|\[\]|\{\}/.test(state.sliceDoc(pos - 1, pos + 1)))
|
|
5870
5875
|
return { from: pos, to: pos };
|
|
5871
|
-
let context = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .
|
|
5876
|
+
let context = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .syntaxTree */ .mv)(state).resolveInner(pos);
|
|
5872
5877
|
let before = context.childBefore(pos), after = context.childAfter(pos), closedBy;
|
|
5873
5878
|
if (before && after && before.to <= pos && after.from >= pos &&
|
|
5874
|
-
(closedBy = before.type.prop(_lezer_common__WEBPACK_IMPORTED_MODULE_2__/* .NodeProp */ .
|
|
5879
|
+
(closedBy = before.type.prop(_lezer_common__WEBPACK_IMPORTED_MODULE_2__/* .NodeProp */ .uY.closedBy)) && closedBy.indexOf(after.name) > -1 &&
|
|
5875
5880
|
state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from &&
|
|
5876
5881
|
!/\S/.test(state.sliceDoc(before.to, after.from)))
|
|
5877
5882
|
return { from: before.to, to: after.from };
|
|
@@ -5898,8 +5903,8 @@ function newlineAndIndent(atEof) {
|
|
|
5898
5903
|
let explode = !atEof && from == to && isBetweenBrackets(state, from);
|
|
5899
5904
|
if (atEof)
|
|
5900
5905
|
from = to = (to <= line.to ? line : state.doc.lineAt(to)).to;
|
|
5901
|
-
let cx = new _codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .IndentContext */ .
|
|
5902
|
-
let indent = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentation */ .
|
|
5906
|
+
let cx = new _codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .IndentContext */ .KB(state, { simulateBreak: from, simulateDoubleBreak: !!explode });
|
|
5907
|
+
let indent = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentation */ ._v)(cx, from);
|
|
5903
5908
|
if (indent == null)
|
|
5904
5909
|
indent = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.countColumn)(/^\s*/.exec(state.doc.lineAt(from).text)[0], state.tabSize);
|
|
5905
5910
|
while (to < line.to && /\s/.test(line.text[to - line.from]))
|
|
@@ -5908,9 +5913,9 @@ function newlineAndIndent(atEof) {
|
|
|
5908
5913
|
({ from, to } = explode);
|
|
5909
5914
|
else if (from > line.from && from < line.from + 100 && !/\S/.test(line.text.slice(0, from)))
|
|
5910
5915
|
from = line.from;
|
|
5911
|
-
let insert = ["", (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .
|
|
5916
|
+
let insert = ["", (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .EI)(state, indent)];
|
|
5912
5917
|
if (explode)
|
|
5913
|
-
insert.push((0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .
|
|
5918
|
+
insert.push((0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .EI)(state, cx.lineIndent(line.from, -1)));
|
|
5914
5919
|
return { changes: { from, to, insert: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.Text.of(insert) },
|
|
5915
5920
|
range: _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(from + 1 + insert[1].length) };
|
|
5916
5921
|
});
|
|
@@ -5944,18 +5949,18 @@ const indentSelection = ({ state, dispatch }) => {
|
|
|
5944
5949
|
if (state.readOnly)
|
|
5945
5950
|
return false;
|
|
5946
5951
|
let updated = Object.create(null);
|
|
5947
|
-
let context = new _codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .IndentContext */ .
|
|
5952
|
+
let context = new _codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .IndentContext */ .KB(state, { overrideIndentation: start => {
|
|
5948
5953
|
let found = updated[start];
|
|
5949
5954
|
return found == null ? -1 : found;
|
|
5950
5955
|
} });
|
|
5951
5956
|
let changes = changeBySelectedLine(state, (line, changes, range) => {
|
|
5952
|
-
let indent = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentation */ .
|
|
5957
|
+
let indent = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentation */ ._v)(context, line.from);
|
|
5953
5958
|
if (indent == null)
|
|
5954
5959
|
return;
|
|
5955
5960
|
if (!/\S/.test(line.text))
|
|
5956
5961
|
indent = 0;
|
|
5957
5962
|
let cur = /^\s*/.exec(line.text)[0];
|
|
5958
|
-
let norm = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .
|
|
5963
|
+
let norm = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .EI)(state, indent);
|
|
5959
5964
|
if (cur != norm || range.from < line.from + cur.length) {
|
|
5960
5965
|
updated[line.from] = indent;
|
|
5961
5966
|
changes.push({ from: line.from, to: line.from + cur.length, insert: norm });
|
|
@@ -5973,7 +5978,7 @@ const indentMore = ({ state, dispatch }) => {
|
|
|
5973
5978
|
if (state.readOnly)
|
|
5974
5979
|
return false;
|
|
5975
5980
|
dispatch(state.update(changeBySelectedLine(state, (line, changes) => {
|
|
5976
|
-
changes.push({ from: line.from, insert: state.facet(_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentUnit */ .
|
|
5981
|
+
changes.push({ from: line.from, insert: state.facet(_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentUnit */ .Xt) });
|
|
5977
5982
|
}), { userEvent: "input.indent" }));
|
|
5978
5983
|
return true;
|
|
5979
5984
|
};
|
|
@@ -5989,7 +5994,7 @@ const indentLess = ({ state, dispatch }) => {
|
|
|
5989
5994
|
if (!space)
|
|
5990
5995
|
return;
|
|
5991
5996
|
let col = (0,_codemirror_state__WEBPACK_IMPORTED_MODULE_0__.countColumn)(space, state.tabSize), keep = 0;
|
|
5992
|
-
let insert = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .
|
|
5997
|
+
let insert = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .indentString */ .EI)(state, Math.max(0, col - (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_3__/* .getIndentUnit */ .tp)(state)));
|
|
5993
5998
|
while (keep < space.length && keep < insert.length && space.charCodeAt(keep) == insert.charCodeAt(keep))
|
|
5994
5999
|
keep++;
|
|
5995
6000
|
changes.push({ from: line.from + keep, to: line.from + space.length, insert: insert.slice(keep) });
|
|
@@ -6156,35 +6161,35 @@ const indentWithTab = { key: "Tab", run: indentMore, shift: indentLess };
|
|
|
6156
6161
|
|
|
6157
6162
|
/***/ }),
|
|
6158
6163
|
|
|
6159
|
-
/***/
|
|
6164
|
+
/***/ 194:
|
|
6160
6165
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
6161
6166
|
|
|
6162
6167
|
|
|
6163
6168
|
// EXPORTS
|
|
6164
6169
|
__webpack_require__.d(__webpack_exports__, {
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6170
|
+
KB: () => (/* binding */ IndentContext),
|
|
6171
|
+
SG: () => (/* binding */ bracketMatching),
|
|
6172
|
+
Zt: () => (/* binding */ defaultHighlightStyle),
|
|
6173
|
+
Lv: () => (/* binding */ foldGutter),
|
|
6174
|
+
f7: () => (/* binding */ foldKeymap),
|
|
6175
|
+
tp: () => (/* binding */ getIndentUnit),
|
|
6176
|
+
_v: () => (/* binding */ getIndentation),
|
|
6177
|
+
WD: () => (/* binding */ indentOnInput),
|
|
6178
|
+
EI: () => (/* binding */ indentString),
|
|
6179
|
+
Xt: () => (/* binding */ indentUnit),
|
|
6180
|
+
jU: () => (/* binding */ matchBrackets),
|
|
6181
|
+
y9: () => (/* binding */ syntaxHighlighting),
|
|
6182
|
+
mv: () => (/* binding */ syntaxTree)
|
|
6178
6183
|
});
|
|
6179
6184
|
|
|
6180
|
-
// UNUSED EXPORTS: DocInput, HighlightStyle, LRLanguage, Language, LanguageDescription, LanguageSupport, ParseContext, StreamLanguage, StringStream, TreeIndentContext, bracketMatchingHandle, codeFolding, continuedIndent, defineLanguageFacet, delimitedIndent, ensureSyntaxTree, flatIndent, foldAll, foldCode, foldEffect, foldInside, foldNodeProp, foldService, foldState, foldable, foldedRanges, forceParsing, highlightingFor, indentNodeProp, indentRange, indentService, language, languageDataProp, sublanguageProp, syntaxParserRunning, syntaxTreeAvailable, toggleFold, unfoldAll, unfoldCode, unfoldEffect
|
|
6185
|
+
// UNUSED EXPORTS: DocInput, HighlightStyle, LRLanguage, Language, LanguageDescription, LanguageSupport, ParseContext, StreamLanguage, StringStream, TreeIndentContext, bidiIsolates, bracketMatchingHandle, codeFolding, continuedIndent, defineLanguageFacet, delimitedIndent, ensureSyntaxTree, flatIndent, foldAll, foldCode, foldEffect, foldInside, foldNodeProp, foldService, foldState, foldable, foldedRanges, forceParsing, highlightingFor, indentNodeProp, indentRange, indentService, language, languageDataProp, sublanguageProp, syntaxParserRunning, syntaxTreeAvailable, toggleFold, unfoldAll, unfoldCode, unfoldEffect
|
|
6181
6186
|
|
|
6182
6187
|
// EXTERNAL MODULE: ../node_modules/@lezer/common/dist/index.js
|
|
6183
|
-
var dist = __webpack_require__(
|
|
6188
|
+
var dist = __webpack_require__(203);
|
|
6184
6189
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/state"],"commonjs":"@codemirror/state","commonjs2":"@codemirror/state"}
|
|
6185
|
-
var state_ = __webpack_require__(
|
|
6190
|
+
var state_ = __webpack_require__(60);
|
|
6186
6191
|
// EXTERNAL MODULE: external {"root":["CM","@codemirror/view"],"commonjs":"@codemirror/view","commonjs2":"@codemirror/view"}
|
|
6187
|
-
var view_ = __webpack_require__(
|
|
6192
|
+
var view_ = __webpack_require__(730);
|
|
6188
6193
|
;// CONCATENATED MODULE: ../node_modules/@lezer/highlight/dist/index.js
|
|
6189
6194
|
|
|
6190
6195
|
|
|
@@ -6398,7 +6403,7 @@ function styleTags(spec) {
|
|
|
6398
6403
|
}
|
|
6399
6404
|
return ruleNodeProp.add(byName);
|
|
6400
6405
|
}
|
|
6401
|
-
const ruleNodeProp = new dist/* NodeProp */.
|
|
6406
|
+
const ruleNodeProp = new dist/* NodeProp */.uY();
|
|
6402
6407
|
class Rule {
|
|
6403
6408
|
constructor(tags, mode, context, next) {
|
|
6404
6409
|
this.tags = tags;
|
|
@@ -6552,7 +6557,7 @@ class HighlightBuilder {
|
|
|
6552
6557
|
this.startSpan(Math.max(from, start), cls);
|
|
6553
6558
|
if (rule.opaque)
|
|
6554
6559
|
return;
|
|
6555
|
-
let mounted = cursor.tree && cursor.tree.prop(dist/* NodeProp */.
|
|
6560
|
+
let mounted = cursor.tree && cursor.tree.prop(dist/* NodeProp */.uY.mounted);
|
|
6556
6561
|
if (mounted && mounted.overlay) {
|
|
6557
6562
|
let inner = cursor.node.enter(mounted.overlay[0].from + start, 1);
|
|
6558
6563
|
let innerHighlighters = this.highlighters.filter(h => !h.scope || h.scope(mounted.tree.type));
|
|
@@ -7263,7 +7268,7 @@ var _a;
|
|
|
7263
7268
|
Node prop stored in a parser's top syntax node to provide the
|
|
7264
7269
|
facet that stores language-specific data for that language.
|
|
7265
7270
|
*/
|
|
7266
|
-
const languageDataProp = /*@__PURE__*/new dist/* NodeProp */.
|
|
7271
|
+
const languageDataProp = /*@__PURE__*/new dist/* NodeProp */.uY();
|
|
7267
7272
|
/**
|
|
7268
7273
|
Helper function to define a facet (to be added to the top syntax
|
|
7269
7274
|
node(s) for a language via
|
|
@@ -7273,7 +7278,7 @@ probably only need this when subclassing
|
|
|
7273
7278
|
[`Language`](https://codemirror.net/6/docs/ref/#language.Language).
|
|
7274
7279
|
*/
|
|
7275
7280
|
function defineLanguageFacet(baseData) {
|
|
7276
|
-
return Facet.define({
|
|
7281
|
+
return state_.Facet.define({
|
|
7277
7282
|
combine: baseData ? values => values.concat(baseData) : undefined
|
|
7278
7283
|
});
|
|
7279
7284
|
}
|
|
@@ -7281,7 +7286,7 @@ function defineLanguageFacet(baseData) {
|
|
|
7281
7286
|
Syntax node prop used to register sublanguages. Should be added to
|
|
7282
7287
|
the top level node type for the language.
|
|
7283
7288
|
*/
|
|
7284
|
-
const sublanguageProp = /*@__PURE__*/new dist/* NodeProp */.
|
|
7289
|
+
const sublanguageProp = /*@__PURE__*/new dist/* NodeProp */.uY();
|
|
7285
7290
|
/**
|
|
7286
7291
|
A language object manages parsing and per-language
|
|
7287
7292
|
[metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is
|
|
@@ -7359,7 +7364,7 @@ class Language {
|
|
|
7359
7364
|
result.push({ from, to: from + tree.length });
|
|
7360
7365
|
return;
|
|
7361
7366
|
}
|
|
7362
|
-
let mount = tree.prop(dist/* NodeProp */.
|
|
7367
|
+
let mount = tree.prop(dist/* NodeProp */.uY.mounted);
|
|
7363
7368
|
if (mount) {
|
|
7364
7369
|
if (mount.tree.prop(languageDataProp) == this.data) {
|
|
7365
7370
|
if (mount.overlay)
|
|
@@ -7378,7 +7383,7 @@ class Language {
|
|
|
7378
7383
|
}
|
|
7379
7384
|
for (let i = 0; i < tree.children.length; i++) {
|
|
7380
7385
|
let ch = tree.children[i];
|
|
7381
|
-
if (ch instanceof dist/* Tree */.
|
|
7386
|
+
if (ch instanceof dist/* Tree */.PH)
|
|
7382
7387
|
explore(ch, tree.positions[i] + from);
|
|
7383
7388
|
}
|
|
7384
7389
|
};
|
|
@@ -7398,7 +7403,7 @@ Language.setState = /*@__PURE__*/state_.StateEffect.define();
|
|
|
7398
7403
|
function topNodeAt(state, pos, side) {
|
|
7399
7404
|
let topLang = state.facet(language), tree = syntaxTree(state).topNode;
|
|
7400
7405
|
if (!topLang || topLang.allowsNesting) {
|
|
7401
|
-
for (let node = tree; node; node = node.enter(pos, side, dist/* IterMode */.
|
|
7406
|
+
for (let node = tree; node; node = node.enter(pos, side, dist/* IterMode */.Qj.ExcludeBuffers))
|
|
7402
7407
|
if (node.type.isTop)
|
|
7403
7408
|
tree = node;
|
|
7404
7409
|
}
|
|
@@ -7409,7 +7414,7 @@ A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language)
|
|
|
7409
7414
|
[LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser)
|
|
7410
7415
|
parsers.
|
|
7411
7416
|
*/
|
|
7412
|
-
class LRLanguage extends
|
|
7417
|
+
class LRLanguage extends Language {
|
|
7413
7418
|
constructor(data, parser, name) {
|
|
7414
7419
|
super(data, parser, [], name);
|
|
7415
7420
|
this.parser = parser;
|
|
@@ -7440,7 +7445,7 @@ language available.
|
|
|
7440
7445
|
*/
|
|
7441
7446
|
function syntaxTree(state) {
|
|
7442
7447
|
let field = state.field(Language.state, false);
|
|
7443
|
-
return field ? field.tree : dist/* Tree */.
|
|
7448
|
+
return field ? field.tree : dist/* Tree */.PH.empty;
|
|
7444
7449
|
}
|
|
7445
7450
|
/**
|
|
7446
7451
|
Try to get a parse tree that spans at least up to `upto`. The
|
|
@@ -7587,7 +7592,7 @@ class ParseContext {
|
|
|
7587
7592
|
@internal
|
|
7588
7593
|
*/
|
|
7589
7594
|
static create(parser, state, viewport) {
|
|
7590
|
-
return new ParseContext(parser, state, [], dist/* Tree */.
|
|
7595
|
+
return new ParseContext(parser, state, [], dist/* Tree */.PH.empty, 0, viewport, [], null);
|
|
7591
7596
|
}
|
|
7592
7597
|
startParse() {
|
|
7593
7598
|
return this.parser.startParse(new DocInput(this.state.doc), this.fragments);
|
|
@@ -7598,7 +7603,7 @@ class ParseContext {
|
|
|
7598
7603
|
work(until, upto) {
|
|
7599
7604
|
if (upto != null && upto >= this.state.doc.length)
|
|
7600
7605
|
upto = undefined;
|
|
7601
|
-
if (this.tree != dist/* Tree */.
|
|
7606
|
+
if (this.tree != dist/* Tree */.PH.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
|
|
7602
7607
|
this.takeTree();
|
|
7603
7608
|
return true;
|
|
7604
7609
|
}
|
|
@@ -7616,7 +7621,7 @@ class ParseContext {
|
|
|
7616
7621
|
for (;;) {
|
|
7617
7622
|
let done = this.parse.advance();
|
|
7618
7623
|
if (done) {
|
|
7619
|
-
this.fragments = this.withoutTempSkipped(dist/* TreeFragment */.
|
|
7624
|
+
this.fragments = this.withoutTempSkipped(dist/* TreeFragment */.rr.addTree(done, this.fragments, this.parse.stoppedAt != null));
|
|
7620
7625
|
this.treeLen = (_a = this.parse.stoppedAt) !== null && _a !== void 0 ? _a : this.state.doc.length;
|
|
7621
7626
|
this.tree = done;
|
|
7622
7627
|
this.parse = null;
|
|
@@ -7641,7 +7646,7 @@ class ParseContext {
|
|
|
7641
7646
|
this.withContext(() => { while (!(tree = this.parse.advance())) { } });
|
|
7642
7647
|
this.treeLen = pos;
|
|
7643
7648
|
this.tree = tree;
|
|
7644
|
-
this.fragments = this.withoutTempSkipped(dist/* TreeFragment */.
|
|
7649
|
+
this.fragments = this.withoutTempSkipped(dist/* TreeFragment */.rr.addTree(this.tree, this.fragments, true));
|
|
7645
7650
|
this.parse = null;
|
|
7646
7651
|
}
|
|
7647
7652
|
}
|
|
@@ -7669,8 +7674,8 @@ class ParseContext {
|
|
|
7669
7674
|
if (!changes.empty) {
|
|
7670
7675
|
let ranges = [];
|
|
7671
7676
|
changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
|
|
7672
|
-
fragments = dist/* TreeFragment */.
|
|
7673
|
-
tree = dist/* Tree */.
|
|
7677
|
+
fragments = dist/* TreeFragment */.rr.applyChanges(fragments, ranges);
|
|
7678
|
+
tree = dist/* Tree */.PH.empty;
|
|
7674
7679
|
treeLen = 0;
|
|
7675
7680
|
viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };
|
|
7676
7681
|
if (this.skipped.length) {
|
|
@@ -7731,7 +7736,7 @@ class ParseContext {
|
|
|
7731
7736
|
promise resolves.
|
|
7732
7737
|
*/
|
|
7733
7738
|
static getSkippingParser(until) {
|
|
7734
|
-
return new class extends dist/* Parser */.
|
|
7739
|
+
return new class extends dist/* Parser */.iX {
|
|
7735
7740
|
createParse(input, fragments, ranges) {
|
|
7736
7741
|
let from = ranges[0].from, to = ranges[ranges.length - 1].to;
|
|
7737
7742
|
let parser = {
|
|
@@ -7745,7 +7750,7 @@ class ParseContext {
|
|
|
7745
7750
|
cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
|
|
7746
7751
|
}
|
|
7747
7752
|
this.parsedPos = to;
|
|
7748
|
-
return new dist/* Tree */.
|
|
7753
|
+
return new dist/* Tree */.PH(dist/* NodeType */.Z6.none, [], [], to - from);
|
|
7749
7754
|
},
|
|
7750
7755
|
stoppedAt: null,
|
|
7751
7756
|
stopAt() { }
|
|
@@ -7769,7 +7774,7 @@ class ParseContext {
|
|
|
7769
7774
|
static get() { return currentContext; }
|
|
7770
7775
|
}
|
|
7771
7776
|
function cutFragments(fragments, from, to) {
|
|
7772
|
-
return dist/* TreeFragment */.
|
|
7777
|
+
return dist/* TreeFragment */.rr.applyChanges(fragments, [{ fromA: from, toA: to, fromB: from, toB: to }]);
|
|
7773
7778
|
}
|
|
7774
7779
|
class LanguageState {
|
|
7775
7780
|
constructor(
|
|
@@ -8243,7 +8248,7 @@ context to a column number (see also
|
|
|
8243
8248
|
[`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)) or null, where null
|
|
8244
8249
|
indicates that no definitive indentation can be determined.
|
|
8245
8250
|
*/
|
|
8246
|
-
const indentNodeProp = /*@__PURE__*/new dist/* NodeProp */.
|
|
8251
|
+
const indentNodeProp = /*@__PURE__*/new dist/* NodeProp */.uY();
|
|
8247
8252
|
// Compute the indentation for a given position from the syntax tree.
|
|
8248
8253
|
function syntaxIndentation(cx, ast, pos) {
|
|
8249
8254
|
let stack = ast.resolveStack(pos);
|
|
@@ -8273,7 +8278,7 @@ function indentStrategy(tree) {
|
|
|
8273
8278
|
if (strategy)
|
|
8274
8279
|
return strategy;
|
|
8275
8280
|
let first = tree.firstChild, close;
|
|
8276
|
-
if (first && (close = first.type.prop(dist/* NodeProp */.
|
|
8281
|
+
if (first && (close = first.type.prop(dist/* NodeProp */.uY.closedBy))) {
|
|
8277
8282
|
let last = tree.lastChild, closed = last && close.indexOf(last.name) > -1;
|
|
8278
8283
|
return cx => delimitedStrategy(cx, true, 1, undefined, closed && !ignoreClosed(cx) ? last.from : undefined);
|
|
8279
8284
|
}
|
|
@@ -8477,7 +8482,7 @@ syntax node types. Given a syntax node, it should check whether
|
|
|
8477
8482
|
that tree is foldable and return the range that can be collapsed
|
|
8478
8483
|
when it is.
|
|
8479
8484
|
*/
|
|
8480
|
-
const foldNodeProp = /*@__PURE__*/new dist/* NodeProp */.
|
|
8485
|
+
const foldNodeProp = /*@__PURE__*/new dist/* NodeProp */.uY();
|
|
8481
8486
|
/**
|
|
8482
8487
|
[Fold](https://codemirror.net/6/docs/ref/#language.foldNodeProp) function that folds everything but
|
|
8483
8488
|
the first and the last child of a syntax node. Useful for nodes
|
|
@@ -9003,16 +9008,20 @@ class TreeHighlighter {
|
|
|
9003
9008
|
this.markCache = Object.create(null);
|
|
9004
9009
|
this.tree = syntaxTree(view.state);
|
|
9005
9010
|
this.decorations = this.buildDeco(view, getHighlighters(view.state));
|
|
9011
|
+
this.decoratedTo = view.viewport.to;
|
|
9006
9012
|
}
|
|
9007
9013
|
update(update) {
|
|
9008
9014
|
let tree = syntaxTree(update.state), highlighters = getHighlighters(update.state);
|
|
9009
9015
|
let styleChange = highlighters != getHighlighters(update.startState);
|
|
9010
|
-
|
|
9016
|
+
let { viewport } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);
|
|
9017
|
+
if (tree.length < viewport.to && !styleChange && tree.type == this.tree.type && decoratedToMapped >= viewport.to) {
|
|
9011
9018
|
this.decorations = this.decorations.map(update.changes);
|
|
9019
|
+
this.decoratedTo = decoratedToMapped;
|
|
9012
9020
|
}
|
|
9013
9021
|
else if (tree != this.tree || update.viewportChanged || styleChange) {
|
|
9014
9022
|
this.tree = tree;
|
|
9015
9023
|
this.decorations = this.buildDeco(update.view, highlighters);
|
|
9024
|
+
this.decoratedTo = viewport.to;
|
|
9016
9025
|
}
|
|
9017
9026
|
}
|
|
9018
9027
|
buildDeco(view, highlighters) {
|
|
@@ -9142,9 +9151,9 @@ a node, a ‘handle’—the part of the node that is highlighted, and
|
|
|
9142
9151
|
that the cursor must be on to activate highlighting in the first
|
|
9143
9152
|
place.
|
|
9144
9153
|
*/
|
|
9145
|
-
const bracketMatchingHandle = /*@__PURE__*/new dist/* NodeProp */.
|
|
9154
|
+
const bracketMatchingHandle = /*@__PURE__*/new dist/* NodeProp */.uY();
|
|
9146
9155
|
function matchingNodes(node, dir, brackets) {
|
|
9147
|
-
let byProp = node.prop(dir < 0 ? dist/* NodeProp */.
|
|
9156
|
+
let byProp = node.prop(dir < 0 ? dist/* NodeProp */.uY.openedBy : dist/* NodeProp */.uY.closedBy);
|
|
9148
9157
|
if (byProp)
|
|
9149
9158
|
return byProp;
|
|
9150
9159
|
if (node.name.length == 1) {
|
|
@@ -9443,11 +9452,11 @@ const IndentedFrom = /*@__PURE__*/new WeakMap();
|
|
|
9443
9452
|
A [language](https://codemirror.net/6/docs/ref/#language.Language) class based on a CodeMirror
|
|
9444
9453
|
5-style [streaming parser](https://codemirror.net/6/docs/ref/#language.StreamParser).
|
|
9445
9454
|
*/
|
|
9446
|
-
class StreamLanguage extends
|
|
9455
|
+
class StreamLanguage extends Language {
|
|
9447
9456
|
constructor(parser) {
|
|
9448
9457
|
let data = defineLanguageFacet(parser.languageData);
|
|
9449
9458
|
let p = fullParser(parser), self;
|
|
9450
|
-
let impl = new class extends Parser {
|
|
9459
|
+
let impl = new class extends dist/* Parser */.iX {
|
|
9451
9460
|
createParse(input, fragments, ranges) {
|
|
9452
9461
|
return new Parse(self, input, fragments, ranges);
|
|
9453
9462
|
}
|
|
@@ -9456,7 +9465,7 @@ class StreamLanguage extends (/* unused pure expression or super */ null && (Lan
|
|
|
9456
9465
|
this.topNode = docID(data);
|
|
9457
9466
|
self = this;
|
|
9458
9467
|
this.streamParser = p;
|
|
9459
|
-
this.stateAfter = new NodeProp({ perNode: true });
|
|
9468
|
+
this.stateAfter = new dist/* NodeProp */.uY({ perNode: true });
|
|
9460
9469
|
this.tokenTable = parser.tokenTable ? new TokenTable(p.tokenTable) : defaultTokenTable;
|
|
9461
9470
|
}
|
|
9462
9471
|
/**
|
|
@@ -9515,7 +9524,7 @@ function findState(lang, tree, off, startPos, before) {
|
|
|
9515
9524
|
return { state: lang.streamParser.copyState(state), pos: off + tree.length };
|
|
9516
9525
|
for (let i = tree.children.length - 1; i >= 0; i--) {
|
|
9517
9526
|
let child = tree.children[i], pos = off + tree.positions[i];
|
|
9518
|
-
let found = child instanceof Tree && pos < before && findState(lang, child, pos, startPos, before);
|
|
9527
|
+
let found = child instanceof dist/* Tree */.PH && pos < before && findState(lang, child, pos, startPos, before);
|
|
9519
9528
|
if (found)
|
|
9520
9529
|
return found;
|
|
9521
9530
|
}
|
|
@@ -9528,11 +9537,11 @@ function cutTree(lang, tree, from, to, inside) {
|
|
|
9528
9537
|
inside = true;
|
|
9529
9538
|
for (let i = tree.children.length - 1; i >= 0; i--) {
|
|
9530
9539
|
let pos = tree.positions[i], child = tree.children[i], inner;
|
|
9531
|
-
if (pos < to && child instanceof Tree) {
|
|
9540
|
+
if (pos < to && child instanceof dist/* Tree */.PH) {
|
|
9532
9541
|
if (!(inner = cutTree(lang, child, from - pos, to - pos, inside)))
|
|
9533
9542
|
break;
|
|
9534
9543
|
return !inside ? inner
|
|
9535
|
-
: new Tree(tree.type, tree.children.slice(0, i).concat(inner), tree.positions.slice(0, i + 1), pos + inner.length);
|
|
9544
|
+
: new dist/* Tree */.PH(tree.type, tree.children.slice(0, i).concat(inner), tree.positions.slice(0, i + 1), pos + inner.length);
|
|
9536
9545
|
}
|
|
9537
9546
|
}
|
|
9538
9547
|
return null;
|
|
@@ -9544,7 +9553,7 @@ function findStartInFragments(lang, fragments, startPos, editorState) {
|
|
|
9544
9553
|
if (found && (tree = cutTree(lang, f.tree, startPos + f.offset, found.pos + f.offset, false)))
|
|
9545
9554
|
return { state: found.state, tree };
|
|
9546
9555
|
}
|
|
9547
|
-
return { state: lang.streamParser.startState(editorState ? getIndentUnit(editorState) : 4), tree: Tree.empty };
|
|
9556
|
+
return { state: lang.streamParser.startState(editorState ? getIndentUnit(editorState) : 4), tree: dist/* Tree */.PH.empty };
|
|
9548
9557
|
}
|
|
9549
9558
|
class Parse {
|
|
9550
9559
|
constructor(lang, input, fragments, ranges) {
|
|
@@ -9671,7 +9680,7 @@ class Parse {
|
|
|
9671
9680
|
this.parsedPos++;
|
|
9672
9681
|
}
|
|
9673
9682
|
finishChunk() {
|
|
9674
|
-
let tree = Tree.build({
|
|
9683
|
+
let tree = dist/* Tree */.PH.build({
|
|
9675
9684
|
buffer: this.chunk,
|
|
9676
9685
|
start: this.chunkStart,
|
|
9677
9686
|
length: this.parsedPos - this.chunkStart,
|
|
@@ -9680,7 +9689,7 @@ class Parse {
|
|
|
9680
9689
|
maxBufferLength: 2048 /* C.ChunkSize */,
|
|
9681
9690
|
reused: this.chunkReused
|
|
9682
9691
|
});
|
|
9683
|
-
tree = new Tree(tree.type, tree.children, tree.positions, tree.length, [[this.lang.stateAfter, this.lang.streamParser.copyState(this.state)]]);
|
|
9692
|
+
tree = new dist/* Tree */.PH(tree.type, tree.children, tree.positions, tree.length, [[this.lang.stateAfter, this.lang.streamParser.copyState(this.state)]]);
|
|
9684
9693
|
this.chunks.push(tree);
|
|
9685
9694
|
this.chunkPos.push(this.chunkStart - this.ranges[0].from);
|
|
9686
9695
|
this.chunk = [];
|
|
@@ -9688,7 +9697,7 @@ class Parse {
|
|
|
9688
9697
|
this.chunkStart = this.parsedPos;
|
|
9689
9698
|
}
|
|
9690
9699
|
finish() {
|
|
9691
|
-
return new Tree(this.lang.topNode, this.chunks, this.chunkPos, this.parsedPos - this.ranges[0].from).balance();
|
|
9700
|
+
return new dist/* Tree */.PH(this.lang.topNode, this.chunks, this.chunkPos, this.parsedPos - this.ranges[0].from).balance();
|
|
9692
9701
|
}
|
|
9693
9702
|
}
|
|
9694
9703
|
function readToken(token, stream, state) {
|
|
@@ -9701,9 +9710,11 @@ function readToken(token, stream, state) {
|
|
|
9701
9710
|
throw new Error("Stream parser failed to advance stream.");
|
|
9702
9711
|
}
|
|
9703
9712
|
const noTokens = /*@__PURE__*/Object.create(null);
|
|
9704
|
-
const typeArray = [dist/* NodeType */.
|
|
9705
|
-
const nodeSet = /*@__PURE__*/new dist/* NodeSet */.
|
|
9713
|
+
const typeArray = [dist/* NodeType */.Z6.none];
|
|
9714
|
+
const nodeSet = /*@__PURE__*/new dist/* NodeSet */.fI(typeArray);
|
|
9706
9715
|
const warned = [];
|
|
9716
|
+
// Cache of node types by name and tags
|
|
9717
|
+
const byTag = /*@__PURE__*/Object.create(null);
|
|
9707
9718
|
const defaultTable = /*@__PURE__*/Object.create(null);
|
|
9708
9719
|
for (let [legacyName, name] of [
|
|
9709
9720
|
["variable", "variableName"],
|
|
@@ -9763,7 +9774,11 @@ function createTokenType(extra, tagStr) {
|
|
|
9763
9774
|
}
|
|
9764
9775
|
if (!tags$1.length)
|
|
9765
9776
|
return 0;
|
|
9766
|
-
let name = tagStr.replace(/ /g, "_"),
|
|
9777
|
+
let name = tagStr.replace(/ /g, "_"), key = name + " " + tags$1.map(t => t.id);
|
|
9778
|
+
let known = byTag[key];
|
|
9779
|
+
if (known)
|
|
9780
|
+
return known.id;
|
|
9781
|
+
let type = byTag[key] = dist/* NodeType */.Z6.define({
|
|
9767
9782
|
id: typeArray.length,
|
|
9768
9783
|
name,
|
|
9769
9784
|
props: [styleTags({ [name]: tags$1 })]
|
|
@@ -9772,27 +9787,138 @@ function createTokenType(extra, tagStr) {
|
|
|
9772
9787
|
return type.id;
|
|
9773
9788
|
}
|
|
9774
9789
|
function docID(data) {
|
|
9775
|
-
let type = NodeType.define({ id: typeArray.length, name: "Document", props: [languageDataProp.add(() => data)], top: true });
|
|
9790
|
+
let type = dist/* NodeType */.Z6.define({ id: typeArray.length, name: "Document", props: [languageDataProp.add(() => data)], top: true });
|
|
9776
9791
|
typeArray.push(type);
|
|
9777
9792
|
return type;
|
|
9778
9793
|
}
|
|
9779
9794
|
|
|
9795
|
+
function buildForLine(line) {
|
|
9796
|
+
return line.length <= 4096 && /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(line);
|
|
9797
|
+
}
|
|
9798
|
+
function textHasRTL(text) {
|
|
9799
|
+
for (let i = text.iter(); !i.next().done;)
|
|
9800
|
+
if (buildForLine(i.value))
|
|
9801
|
+
return true;
|
|
9802
|
+
return false;
|
|
9803
|
+
}
|
|
9804
|
+
function changeAddsRTL(change) {
|
|
9805
|
+
let added = false;
|
|
9806
|
+
change.iterChanges((fA, tA, fB, tB, ins) => {
|
|
9807
|
+
if (!added && textHasRTL(ins))
|
|
9808
|
+
added = true;
|
|
9809
|
+
});
|
|
9810
|
+
return added;
|
|
9811
|
+
}
|
|
9812
|
+
const alwaysIsolate = /*@__PURE__*/state_.Facet.define({ combine: values => values.some(x => x) });
|
|
9813
|
+
/**
|
|
9814
|
+
Make sure nodes
|
|
9815
|
+
[marked](https://lezer.codemirror.net/docs/ref/#common.NodeProp^isolate)
|
|
9816
|
+
as isolating for bidirectional text are rendered in a way that
|
|
9817
|
+
isolates them from the surrounding text.
|
|
9818
|
+
*/
|
|
9819
|
+
function bidiIsolates(options = {}) {
|
|
9820
|
+
let extensions = [isolateMarks];
|
|
9821
|
+
if (options.alwaysIsolate)
|
|
9822
|
+
extensions.push(alwaysIsolate.of(true));
|
|
9823
|
+
return extensions;
|
|
9824
|
+
}
|
|
9825
|
+
const isolateMarks = /*@__PURE__*/view_.ViewPlugin.fromClass(class {
|
|
9826
|
+
constructor(view) {
|
|
9827
|
+
this.always = view.state.facet(alwaysIsolate) ||
|
|
9828
|
+
view.textDirection != view_.Direction.LTR ||
|
|
9829
|
+
view.state.facet(view_.EditorView.perLineTextDirection);
|
|
9830
|
+
this.hasRTL = !this.always && textHasRTL(view.state.doc);
|
|
9831
|
+
this.tree = syntaxTree(view.state);
|
|
9832
|
+
this.decorations = this.always || this.hasRTL ? buildDeco(view, this.tree, this.always) : view_.Decoration.none;
|
|
9833
|
+
}
|
|
9834
|
+
update(update) {
|
|
9835
|
+
let always = update.state.facet(alwaysIsolate) ||
|
|
9836
|
+
update.view.textDirection != view_.Direction.LTR ||
|
|
9837
|
+
update.state.facet(view_.EditorView.perLineTextDirection);
|
|
9838
|
+
if (!always && !this.hasRTL && changeAddsRTL(update.changes))
|
|
9839
|
+
this.hasRTL = true;
|
|
9840
|
+
if (!always && !this.hasRTL)
|
|
9841
|
+
return;
|
|
9842
|
+
let tree = syntaxTree(update.state);
|
|
9843
|
+
if (always != this.always || tree != this.tree || update.docChanged || update.viewportChanged) {
|
|
9844
|
+
this.tree = tree;
|
|
9845
|
+
this.always = always;
|
|
9846
|
+
this.decorations = buildDeco(update.view, tree, always);
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
}, {
|
|
9850
|
+
provide: plugin => {
|
|
9851
|
+
function access(view) {
|
|
9852
|
+
var _a, _b;
|
|
9853
|
+
return (_b = (_a = view.plugin(plugin)) === null || _a === void 0 ? void 0 : _a.decorations) !== null && _b !== void 0 ? _b : view_.Decoration.none;
|
|
9854
|
+
}
|
|
9855
|
+
return [view_.EditorView.outerDecorations.of(access),
|
|
9856
|
+
state_.Prec.lowest(view_.EditorView.bidiIsolatedRanges.of(access))];
|
|
9857
|
+
}
|
|
9858
|
+
});
|
|
9859
|
+
function buildDeco(view, tree, always) {
|
|
9860
|
+
let deco = new state_.RangeSetBuilder();
|
|
9861
|
+
let ranges = view.visibleRanges;
|
|
9862
|
+
if (!always)
|
|
9863
|
+
ranges = clipRTLLines(ranges, view.state.doc);
|
|
9864
|
+
for (let { from, to } of ranges) {
|
|
9865
|
+
tree.iterate({
|
|
9866
|
+
enter: node => {
|
|
9867
|
+
let iso = node.type.prop(dist/* NodeProp */.uY.isolate);
|
|
9868
|
+
if (iso)
|
|
9869
|
+
deco.add(node.from, node.to, marks[iso]);
|
|
9870
|
+
},
|
|
9871
|
+
from, to
|
|
9872
|
+
});
|
|
9873
|
+
}
|
|
9874
|
+
return deco.finish();
|
|
9875
|
+
}
|
|
9876
|
+
function clipRTLLines(ranges, doc) {
|
|
9877
|
+
let cur = doc.iter(), pos = 0, result = [], last = null;
|
|
9878
|
+
for (let { from, to } of ranges) {
|
|
9879
|
+
if (from != pos) {
|
|
9880
|
+
if (pos < from)
|
|
9881
|
+
cur.next(from - pos);
|
|
9882
|
+
pos = from;
|
|
9883
|
+
}
|
|
9884
|
+
for (;;) {
|
|
9885
|
+
let start = pos, end = pos + cur.value.length;
|
|
9886
|
+
if (!cur.lineBreak && buildForLine(cur.value)) {
|
|
9887
|
+
if (last && last.to > start - 10)
|
|
9888
|
+
last.to = Math.min(to, end);
|
|
9889
|
+
else
|
|
9890
|
+
result.push(last = { from: start, to: Math.min(to, end) });
|
|
9891
|
+
}
|
|
9892
|
+
if (pos >= to)
|
|
9893
|
+
break;
|
|
9894
|
+
pos = end;
|
|
9895
|
+
cur.next();
|
|
9896
|
+
}
|
|
9897
|
+
}
|
|
9898
|
+
return result;
|
|
9899
|
+
}
|
|
9900
|
+
const marks = {
|
|
9901
|
+
rtl: /*@__PURE__*/view_.Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "rtl" }, bidiIsolate: view_.Direction.RTL }),
|
|
9902
|
+
ltr: /*@__PURE__*/view_.Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "ltr" }, bidiIsolate: view_.Direction.LTR }),
|
|
9903
|
+
auto: /*@__PURE__*/view_.Decoration.mark({ class: "cm-iso", inclusive: true, attributes: { dir: "auto" }, bidiIsolate: null })
|
|
9904
|
+
};
|
|
9905
|
+
|
|
9780
9906
|
|
|
9781
9907
|
|
|
9782
9908
|
|
|
9783
9909
|
/***/ }),
|
|
9784
9910
|
|
|
9785
|
-
/***/
|
|
9911
|
+
/***/ 203:
|
|
9786
9912
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
9787
9913
|
|
|
9788
9914
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9789
|
-
/* harmony export */
|
|
9790
|
-
/* harmony export */
|
|
9791
|
-
/* harmony export */
|
|
9792
|
-
/* harmony export */
|
|
9793
|
-
/* harmony export */
|
|
9794
|
-
/* harmony export */
|
|
9795
|
-
/* harmony export */
|
|
9915
|
+
/* harmony export */ PH: () => (/* binding */ Tree),
|
|
9916
|
+
/* harmony export */ Qj: () => (/* binding */ IterMode),
|
|
9917
|
+
/* harmony export */ Z6: () => (/* binding */ NodeType),
|
|
9918
|
+
/* harmony export */ fI: () => (/* binding */ NodeSet),
|
|
9919
|
+
/* harmony export */ iX: () => (/* binding */ Parser),
|
|
9920
|
+
/* harmony export */ rr: () => (/* binding */ TreeFragment),
|
|
9921
|
+
/* harmony export */ uY: () => (/* binding */ NodeProp)
|
|
9796
9922
|
/* harmony export */ });
|
|
9797
9923
|
/* unused harmony exports DefaultBufferLength, MountedTree, NodeWeakMap, TreeBuffer, TreeCursor, parseMixed */
|
|
9798
9924
|
/**
|
|
@@ -9862,6 +9988,22 @@ types that represent an expression could be tagged with an
|
|
|
9862
9988
|
*/
|
|
9863
9989
|
NodeProp.group = new NodeProp({ deserialize: str => str.split(" ") });
|
|
9864
9990
|
/**
|
|
9991
|
+
Attached to nodes to indicate these should be
|
|
9992
|
+
[displayed](https://codemirror.net/docs/ref/#language.syntaxTree)
|
|
9993
|
+
in a bidirectional text isolate, so that direction-neutral
|
|
9994
|
+
characters on their sides don't incorrectly get associated with
|
|
9995
|
+
surrounding text. You'll generally want to set this for nodes
|
|
9996
|
+
that contain arbitrary text, like strings and comments, and for
|
|
9997
|
+
nodes that appear _inside_ arbitrary text, like HTML tags. When
|
|
9998
|
+
not given a value, in a grammar declaration, defaults to
|
|
9999
|
+
`"auto"`.
|
|
10000
|
+
*/
|
|
10001
|
+
NodeProp.isolate = new NodeProp({ deserialize: value => {
|
|
10002
|
+
if (value && value != "rtl" && value != "ltr" && value != "auto")
|
|
10003
|
+
throw new RangeError("Invalid value for isolate: " + value);
|
|
10004
|
+
return value || "auto";
|
|
10005
|
+
} });
|
|
10006
|
+
/**
|
|
9865
10007
|
The hash of the [context](#lr.ContextTracker.constructor)
|
|
9866
10008
|
that the node was parsed in, if any. Used to limit reuse of
|
|
9867
10009
|
contextual nodes.
|
|
@@ -10581,9 +10723,11 @@ function getChildren(node, type, before, after) {
|
|
|
10581
10723
|
if (!cur.firstChild())
|
|
10582
10724
|
return result;
|
|
10583
10725
|
if (before != null)
|
|
10584
|
-
|
|
10726
|
+
for (let found = false; !found;) {
|
|
10727
|
+
found = cur.type.is(before);
|
|
10585
10728
|
if (!cur.nextSibling())
|
|
10586
10729
|
return result;
|
|
10730
|
+
}
|
|
10587
10731
|
for (;;) {
|
|
10588
10732
|
if (after != null && cur.type.is(after))
|
|
10589
10733
|
return result;
|
|
@@ -11733,18 +11877,14 @@ function sliceBuf(buf, startI, endI, nodes, positions, off) {
|
|
|
11733
11877
|
// any other code, making violations of the immutability safe.
|
|
11734
11878
|
function materialize(cursor) {
|
|
11735
11879
|
let { node } = cursor, stack = [];
|
|
11880
|
+
let buffer = node.context.buffer;
|
|
11736
11881
|
// Scan up to the nearest tree
|
|
11737
11882
|
do {
|
|
11738
11883
|
stack.push(cursor.index);
|
|
11739
11884
|
cursor.parent();
|
|
11740
11885
|
} while (!cursor.tree);
|
|
11741
11886
|
// Find the index of the buffer in that tree
|
|
11742
|
-
let
|
|
11743
|
-
for (;; i++) {
|
|
11744
|
-
off = base.positions[i] + cursor.from;
|
|
11745
|
-
if (off <= node.from && off + base.children[i].length >= node.to)
|
|
11746
|
-
break;
|
|
11747
|
-
}
|
|
11887
|
+
let base = cursor.tree, i = base.children.indexOf(buffer);
|
|
11748
11888
|
let buf = base.children[i], b = buf.buffer, newStack = [i];
|
|
11749
11889
|
// Split a level in the buffer, putting the nodes before and after
|
|
11750
11890
|
// the child that contains `node` into new buffers.
|
|
@@ -12021,36 +12161,36 @@ var __webpack_exports__ = {};
|
|
|
12021
12161
|
(() => {
|
|
12022
12162
|
__webpack_require__.r(__webpack_exports__);
|
|
12023
12163
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12024
|
-
/* harmony export */ basicSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__.
|
|
12164
|
+
/* harmony export */ basicSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__.o),
|
|
12025
12165
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
12026
|
-
/* harmony export */ getStatistics: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_7__.
|
|
12027
|
-
/* harmony export */ minimalSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__.
|
|
12028
|
-
/* harmony export */ useCodeMirror: () => (/* reexport safe */ _useCodeMirror__WEBPACK_IMPORTED_MODULE_1__.
|
|
12166
|
+
/* harmony export */ getStatistics: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_7__.m),
|
|
12167
|
+
/* harmony export */ minimalSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__.V),
|
|
12168
|
+
/* harmony export */ useCodeMirror: () => (/* reexport safe */ _useCodeMirror__WEBPACK_IMPORTED_MODULE_1__.q)
|
|
12029
12169
|
/* harmony export */ });
|
|
12030
|
-
/* harmony import */ var _home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
|
12031
|
-
/* harmony import */ var _home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
12032
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
12170
|
+
/* harmony import */ var _home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(957);
|
|
12171
|
+
/* harmony import */ var _home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(644);
|
|
12172
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(442);
|
|
12033
12173
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
12034
|
-
/* harmony import */ var _useCodeMirror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
12035
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
12036
|
-
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
12174
|
+
/* harmony import */ var _useCodeMirror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(695);
|
|
12175
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(540);
|
|
12176
|
+
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(730);
|
|
12037
12177
|
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_3__);
|
|
12038
12178
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
12039
12179
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _codemirror_view__WEBPACK_IMPORTED_MODULE_3__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _codemirror_view__WEBPACK_IMPORTED_MODULE_3__[__WEBPACK_IMPORT_KEY__]
|
|
12040
12180
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
12041
|
-
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
12181
|
+
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60);
|
|
12042
12182
|
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_codemirror_state__WEBPACK_IMPORTED_MODULE_4__);
|
|
12043
12183
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
12044
12184
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _codemirror_state__WEBPACK_IMPORTED_MODULE_4__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _codemirror_state__WEBPACK_IMPORTED_MODULE_4__[__WEBPACK_IMPORT_KEY__]
|
|
12045
12185
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
12046
|
-
/* harmony import */ var _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
12047
|
-
/* harmony import */ var _getDefaultExtensions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
12186
|
+
/* harmony import */ var _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(368);
|
|
12187
|
+
/* harmony import */ var _getDefaultExtensions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89);
|
|
12048
12188
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
12049
12189
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _getDefaultExtensions__WEBPACK_IMPORTED_MODULE_6__) if(["default","basicSetup","minimalSetup","useCodeMirror"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _getDefaultExtensions__WEBPACK_IMPORTED_MODULE_6__[__WEBPACK_IMPORT_KEY__]
|
|
12050
12190
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
12051
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
12052
|
-
var _excluded=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"];var ReactCodeMirror=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function(props,ref){var className=props.className,_props$value=props.value,value=_props$value===void 0?'':_props$value,selection=props.selection,_props$extensions=props.extensions,extensions=_props$extensions===void 0?[]:_props$extensions,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,height=props.height,minHeight=props.minHeight,maxHeight=props.maxHeight,width=props.width,minWidth=props.minWidth,maxWidth=props.maxWidth,basicSetup=props.basicSetup,placeholder=props.placeholder,indentWithTab=props.indentWithTab,editable=props.editable,readOnly=props.readOnly,root=props.root,initialState=props.initialState,other=(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .
|
|
12053
|
-
if(typeof value!=='string'){throw new Error("value must be typeof string but got ".concat(typeof value));}var defaultClassNames=typeof theme==='string'?"cm-theme-".concat(theme):'cm-theme';return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .
|
|
12191
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(369);
|
|
12192
|
+
var _excluded=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"];var ReactCodeMirror=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function(props,ref){var className=props.className,_props$value=props.value,value=_props$value===void 0?'':_props$value,selection=props.selection,_props$extensions=props.extensions,extensions=_props$extensions===void 0?[]:_props$extensions,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,height=props.height,minHeight=props.minHeight,maxHeight=props.maxHeight,width=props.width,minWidth=props.minWidth,maxWidth=props.maxWidth,basicSetup=props.basicSetup,placeholder=props.placeholder,indentWithTab=props.indentWithTab,editable=props.editable,readOnly=props.readOnly,root=props.root,initialState=props.initialState,other=(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(props,_excluded);var editor=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);var _useCodeMirror=(0,_useCodeMirror__WEBPACK_IMPORTED_MODULE_1__/* .useCodeMirror */ .q)({container:editor.current,root:root,value:value,autoFocus:autoFocus,theme:theme,height:height,minHeight:minHeight,maxHeight:maxHeight,width:width,minWidth:minWidth,maxWidth:maxWidth,basicSetup:basicSetup,placeholder:placeholder,indentWithTab:indentWithTab,editable:editable,readOnly:readOnly,selection:selection,onChange:onChange,onStatistics:onStatistics,onCreateEditor:onCreateEditor,onUpdate:onUpdate,extensions:extensions,initialState:initialState}),state=_useCodeMirror.state,view=_useCodeMirror.view,container=_useCodeMirror.container;(0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref,function(){return{editor:editor.current,state:state,view:view};},[editor,container,state,view]);// check type of value
|
|
12193
|
+
if(typeof value!=='string'){throw new Error("value must be typeof string but got ".concat(typeof value));}var defaultClassNames=typeof theme==='string'?"cm-theme-".concat(theme):'cm-theme';return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)({ref:editor,className:"".concat(defaultClassNames).concat(className?" ".concat(className):'')},other));});ReactCodeMirror.displayName='CodeMirror';/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReactCodeMirror);
|
|
12054
12194
|
})();
|
|
12055
12195
|
|
|
12056
12196
|
/******/ return __webpack_exports__;
|