@uiw/react-codemirror 4.22.0 → 4.22.2

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.
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("react"), require("@codemirror/state"), require("@codemirror/theme-one-dark"), require("@codemirror/view"));
3
+ module.exports = factory(require("react"), require("react/jsx-runtime"), require("@codemirror/state"), require("@codemirror/theme-one-dark"), require("@codemirror/view"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define(["react", , , ], factory);
5
+ define(["react", "react/jsx-runtime", , , ], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["@uiw/codemirror"] = factory(require("react"), require("@codemirror/state"), require("@codemirror/theme-one-dark"), require("@codemirror/view"));
7
+ exports["@uiw/codemirror"] = factory(require("react"), require("react/jsx-runtime"), require("@codemirror/state"), require("@codemirror/theme-one-dark"), require("@codemirror/view"));
8
8
  else
9
- root["@uiw/codemirror"] = factory(root["React"], root["CM"]["@codemirror/state"], root["CM"]["@codemirror/theme-one-dark"], root["CM"]["@codemirror/view"]);
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__442__, __WEBPACK_EXTERNAL_MODULE__60__, __WEBPACK_EXTERNAL_MODULE__708__, __WEBPACK_EXTERNAL_MODULE__730__) => {
9
+ root["@uiw/codemirror"] = factory(root["React"], root["ReactJSXRuntime"], root["CM"]["@codemirror/state"], root["CM"]["@codemirror/theme-one-dark"], root["CM"]["@codemirror/view"]);
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__442__, __WEBPACK_EXTERNAL_MODULE__742__, __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__ = ({
@@ -2683,8 +2683,9 @@ class Snippet {
2683
2683
  let fields = [];
2684
2684
  let lines = [], positions = [], m;
2685
2685
  for (let line of template.split(/\r\n?|\n/)) {
2686
- while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)) {
2687
- let seq = m[1] ? +m[1] : null, name = m[2] || m[3] || "", found = -1;
2686
+ while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(line)) {
2687
+ let seq = m[1] ? +m[1] : null, rawName = m[2] || m[3] || "", found = -1;
2688
+ let name = rawName.replace(/\\[{}]/g, m => m[1]);
2688
2689
  for (let i = 0; i < fields.length; i++) {
2689
2690
  if (seq != null ? fields[i].seq == seq : name ? fields[i].name == name : false)
2690
2691
  found = i;
@@ -2700,16 +2701,16 @@ class Snippet {
2700
2701
  pos.field++;
2701
2702
  }
2702
2703
  positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
2703
- line = line.slice(0, m.index) + name + line.slice(m.index + m[0].length);
2704
+ line = line.slice(0, m.index) + rawName + line.slice(m.index + m[0].length);
2704
2705
  }
2705
- for (let esc; esc = /\\([{}])/.exec(line);) {
2706
- line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
2706
+ line = line.replace(/\\([{}])/g, (_, brace, index) => {
2707
2707
  for (let pos of positions)
2708
- if (pos.line == lines.length && pos.from > esc.index) {
2708
+ if (pos.line == lines.length && pos.from > index) {
2709
2709
  pos.from--;
2710
2710
  pos.to--;
2711
2711
  }
2712
- }
2712
+ return brace;
2713
+ });
2713
2714
  lines.push(line);
2714
2715
  }
2715
2716
  return new Snippet(lines, positions);
@@ -3366,8 +3367,12 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
3366
3367
  return found;
3367
3368
  }
3368
3369
  function hideTooltip(tr, tooltip) {
3370
+ let from = tooltip.pos, to = tooltip.end || from;
3371
+ let result = tr.state.facet(lintConfig).hideOn(tr, from, to);
3372
+ if (result != null)
3373
+ return result;
3369
3374
  let line = tr.startState.doc.lineAt(tooltip.pos);
3370
- return !!(tr.effects.some(e => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, line.to));
3375
+ return !!(tr.effects.some(e => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, Math.max(line.to, to)));
3371
3376
  }
3372
3377
  function maybeEnableLint(state, effects) {
3373
3378
  return state.field(lintState, false) ? effects : effects.concat(state_.StateEffect.appendConfig.of(lintExtensions));
@@ -3394,17 +3399,20 @@ const lintState = /*@__PURE__*/state_.StateField.define({
3394
3399
  return new LintState(view_.Decoration.none, null, null);
3395
3400
  },
3396
3401
  update(value, tr) {
3397
- if (tr.docChanged) {
3398
- let mapped = value.diagnostics.map(tr.changes), selected = null;
3402
+ if (tr.docChanged && value.diagnostics.size) {
3403
+ let mapped = value.diagnostics.map(tr.changes), selected = null, panel = value.panel;
3399
3404
  if (value.selected) {
3400
3405
  let selPos = tr.changes.mapPos(value.selected.from, 1);
3401
3406
  selected = findDiagnostic(mapped, value.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);
3402
3407
  }
3403
- value = new LintState(mapped, value.panel, selected);
3408
+ if (!mapped.size && panel && tr.state.facet(lintConfig).autoPanel)
3409
+ panel = null;
3410
+ value = new LintState(mapped, panel, selected);
3404
3411
  }
3405
3412
  for (let effect of tr.effects) {
3406
3413
  if (effect.is(setDiagnosticsEffect)) {
3407
- value = LintState.init(effect.value, value.panel, tr.state);
3414
+ let panel = !tr.state.facet(lintConfig).autoPanel ? value.panel : effect.value.length ? LintPanel.open : null;
3415
+ value = LintState.init(effect.value, panel, tr.state);
3408
3416
  }
3409
3417
  else if (effect.is(dist_togglePanel)) {
3410
3418
  value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);
@@ -3537,6 +3545,7 @@ const lintPlugin = /*@__PURE__*/(/* unused pure expression or super */ null && (
3537
3545
  this.timeout = setTimeout(this.run, delay);
3538
3546
  }
3539
3547
  run() {
3548
+ clearTimeout(this.timeout);
3540
3549
  let now = Date.now();
3541
3550
  if (now < this.lintTime - 10) {
3542
3551
  this.timeout = setTimeout(this.run, this.lintTime - now);
@@ -3579,7 +3588,8 @@ const lintConfig = /*@__PURE__*/state_.Facet.define({
3579
3588
  delay: 750,
3580
3589
  markerFilter: null,
3581
3590
  tooltipFilter: null,
3582
- needsRefresh: null
3591
+ needsRefresh: null,
3592
+ hideOn: () => null,
3583
3593
  }, {
3584
3594
  needsRefresh: (a, b) => !a ? b : !b ? a : u => a(u) || b(u)
3585
3595
  }));
@@ -3625,7 +3635,7 @@ function assignKeys(actions) {
3625
3635
  function renderDiagnostic(view, diagnostic, inPanel) {
3626
3636
  var _a;
3627
3637
  let keys = inPanel ? assignKeys(diagnostic.actions) : [];
3628
- return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
3638
+ return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
3629
3639
  let fired = false, click = (e) => {
3630
3640
  e.preventDefault();
3631
3641
  if (fired)
@@ -4282,46 +4292,52 @@ __webpack_require__.d(__webpack_exports__, {
4282
4292
  });
4283
4293
 
4284
4294
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
4285
- function _arrayLikeToArray(arr, len) {
4286
- if (len == null || len > arr.length) len = arr.length;
4287
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4288
- return arr2;
4295
+ function _arrayLikeToArray(r, a) {
4296
+ (null == a || a > r.length) && (a = r.length);
4297
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4298
+ return n;
4289
4299
  }
4300
+
4290
4301
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
4291
4302
 
4292
- function _arrayWithoutHoles(arr) {
4293
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
4303
+ function _arrayWithoutHoles(r) {
4304
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
4294
4305
  }
4306
+
4295
4307
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
4296
- function _iterableToArray(iter) {
4297
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4308
+ function _iterableToArray(r) {
4309
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
4298
4310
  }
4311
+
4299
4312
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
4300
4313
 
4301
- function _unsupportedIterableToArray(o, minLen) {
4302
- if (!o) return;
4303
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
4304
- var n = Object.prototype.toString.call(o).slice(8, -1);
4305
- if (n === "Object" && o.constructor) n = o.constructor.name;
4306
- if (n === "Map" || n === "Set") return Array.from(o);
4307
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
4314
+ function _unsupportedIterableToArray(r, a) {
4315
+ if (r) {
4316
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
4317
+ var t = {}.toString.call(r).slice(8, -1);
4318
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
4319
+ }
4308
4320
  }
4321
+
4309
4322
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
4310
4323
  function _nonIterableSpread() {
4311
4324
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4312
4325
  }
4326
+
4313
4327
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
4314
4328
 
4315
4329
 
4316
4330
 
4317
4331
 
4318
- function _toConsumableArray(arr) {
4319
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
4332
+ function _toConsumableArray(r) {
4333
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
4320
4334
  }
4335
+
4321
4336
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
4322
- function _arrayWithHoles(arr) {
4323
- if (Array.isArray(arr)) return arr;
4337
+ function _arrayWithHoles(r) {
4338
+ if (Array.isArray(r)) return r;
4324
4339
  }
4340
+
4325
4341
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
4326
4342
  function _iterableToArrayLimit(r, l) {
4327
4343
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -4350,18 +4366,21 @@ function _iterableToArrayLimit(r, l) {
4350
4366
  return a;
4351
4367
  }
4352
4368
  }
4369
+
4353
4370
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
4354
4371
  function _nonIterableRest() {
4355
4372
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4356
4373
  }
4374
+
4357
4375
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
4358
4376
 
4359
4377
 
4360
4378
 
4361
4379
 
4362
- function _slicedToArray(arr, i) {
4363
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
4380
+ function _slicedToArray(r, e) {
4381
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
4364
4382
  }
4383
+
4365
4384
  // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
4366
4385
  var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(442);
4367
4386
  // EXTERNAL MODULE: external {"root":["CM","@codemirror/state"],"commonjs":"@codemirror/state","commonjs2":"@codemirror/state"}
@@ -4390,41 +4409,17 @@ var getStatistics=function getStatistics(view){return{line:view.state.doc.lineAt
4390
4409
 
4391
4410
  /***/ }),
4392
4411
 
4393
- /***/ 192:
4394
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4395
-
4396
- var __webpack_unused_export__;
4397
- /**
4398
- * @license React
4399
- * react-jsx-runtime.production.min.js
4400
- *
4401
- * Copyright (c) Facebook, Inc. and its affiliates.
4402
- *
4403
- * This source code is licensed under the MIT license found in the
4404
- * LICENSE file in the root directory of this source tree.
4405
- */
4406
- 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};
4407
- 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;
4408
-
4409
-
4410
- /***/ }),
4411
-
4412
- /***/ 540:
4413
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4414
-
4415
-
4416
-
4417
- if (true) {
4418
- module.exports = __webpack_require__(192);
4419
- } else {}
4412
+ /***/ 442:
4413
+ /***/ ((module) => {
4420
4414
 
4415
+ module.exports = __WEBPACK_EXTERNAL_MODULE__442__;
4421
4416
 
4422
4417
  /***/ }),
4423
4418
 
4424
- /***/ 442:
4419
+ /***/ 742:
4425
4420
  /***/ ((module) => {
4426
4421
 
4427
- module.exports = __WEBPACK_EXTERNAL_MODULE__442__;
4422
+ module.exports = __WEBPACK_EXTERNAL_MODULE__742__;
4428
4423
 
4429
4424
  /***/ }),
4430
4425
 
@@ -4468,6 +4463,7 @@ function _typeof(o) {
4468
4463
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
4469
4464
  }, _typeof(o);
4470
4465
  }
4466
+
4471
4467
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
4472
4468
 
4473
4469
  function toPrimitive(t, r) {
@@ -4480,6 +4476,7 @@ function toPrimitive(t, r) {
4480
4476
  }
4481
4477
  return ("string" === r ? String : Number)(t);
4482
4478
  }
4479
+
4483
4480
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
4484
4481
 
4485
4482
 
@@ -4487,22 +4484,18 @@ function toPropertyKey(t) {
4487
4484
  var i = toPrimitive(t, "string");
4488
4485
  return "symbol" == _typeof(i) ? i : i + "";
4489
4486
  }
4487
+
4490
4488
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/defineProperty.js
4491
4489
 
4492
- function _defineProperty(obj, key, value) {
4493
- key = toPropertyKey(key);
4494
- if (key in obj) {
4495
- Object.defineProperty(obj, key, {
4496
- value: value,
4497
- enumerable: true,
4498
- configurable: true,
4499
- writable: true
4500
- });
4501
- } else {
4502
- obj[key] = value;
4503
- }
4504
- return obj;
4490
+ function _defineProperty(e, r, t) {
4491
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
4492
+ value: t,
4493
+ enumerable: !0,
4494
+ configurable: !0,
4495
+ writable: !0
4496
+ }) : e[r] = t, e;
4505
4497
  }
4498
+
4506
4499
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js
4507
4500
 
4508
4501
  function ownKeys(e, r) {
@@ -4527,6 +4520,7 @@ function _objectSpread2(e) {
4527
4520
  return e;
4528
4521
  }
4529
4522
 
4523
+
4530
4524
  /***/ }),
4531
4525
 
4532
4526
  /***/ 644:
@@ -4539,36 +4533,31 @@ __webpack_require__.d(__webpack_exports__, {
4539
4533
  });
4540
4534
 
4541
4535
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
4542
- function _objectWithoutPropertiesLoose(source, excluded) {
4543
- if (source == null) return {};
4544
- var target = {};
4545
- var sourceKeys = Object.keys(source);
4546
- var key, i;
4547
- for (i = 0; i < sourceKeys.length; i++) {
4548
- key = sourceKeys[i];
4549
- if (excluded.indexOf(key) >= 0) continue;
4550
- target[key] = source[key];
4536
+ function _objectWithoutPropertiesLoose(r, e) {
4537
+ if (null == r) return {};
4538
+ var t = {};
4539
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
4540
+ if (e.indexOf(n) >= 0) continue;
4541
+ t[n] = r[n];
4551
4542
  }
4552
- return target;
4543
+ return t;
4553
4544
  }
4545
+
4554
4546
  ;// CONCATENATED MODULE: ../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
4555
4547
 
4556
- function _objectWithoutProperties(source, excluded) {
4557
- if (source == null) return {};
4558
- var target = _objectWithoutPropertiesLoose(source, excluded);
4559
- var key, i;
4548
+ function _objectWithoutProperties(e, t) {
4549
+ if (null == e) return {};
4550
+ var o,
4551
+ r,
4552
+ i = _objectWithoutPropertiesLoose(e, t);
4560
4553
  if (Object.getOwnPropertySymbols) {
4561
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
4562
- for (i = 0; i < sourceSymbolKeys.length; i++) {
4563
- key = sourceSymbolKeys[i];
4564
- if (excluded.indexOf(key) >= 0) continue;
4565
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
4566
- target[key] = source[key];
4567
- }
4554
+ var n = Object.getOwnPropertySymbols(e);
4555
+ for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
4568
4556
  }
4569
- return target;
4557
+ return i;
4570
4558
  }
4571
4559
 
4560
+
4572
4561
  /***/ }),
4573
4562
 
4574
4563
  /***/ 720:
@@ -4580,7 +4569,7 @@ function _objectWithoutProperties(source, excluded) {
4580
4569
  /* harmony export */ cL: () => (/* binding */ historyKeymap),
4581
4570
  /* harmony export */ pw: () => (/* binding */ defaultKeymap)
4582
4571
  /* harmony export */ });
4583
- /* 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, deleteCharBackwardStrict, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertNewlineKeepIndent, 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 */
4572
+ /* 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, deleteCharBackwardStrict, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertNewlineKeepIndent, 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, temporarilySetTabFocusMode, toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment, toggleTabFocusMode, transposeChars, undo, undoDepth, undoSelection */
4584
4573
  /* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60);
4585
4574
  /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(730);
4586
4575
  /* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(194);
@@ -6083,6 +6072,26 @@ const indentLess = ({ state, dispatch }) => {
6083
6072
  return true;
6084
6073
  };
6085
6074
  /**
6075
+ Enables or disables
6076
+ [tab-focus mode](https://codemirror.net/6/docs/ref/#view.EditorView.setTabFocusMode). While on, this
6077
+ prevents the editor's key bindings from capturing Tab or
6078
+ Shift-Tab, making it possible for the user to move focus out of
6079
+ the editor with the keyboard.
6080
+ */
6081
+ const toggleTabFocusMode = view => {
6082
+ view.setTabFocusMode();
6083
+ return true;
6084
+ };
6085
+ /**
6086
+ Temporarily enables [tab-focus
6087
+ mode](https://codemirror.net/6/docs/ref/#view.EditorView.setTabFocusMode) for two seconds or until
6088
+ another key is pressed.
6089
+ */
6090
+ const temporarilySetTabFocusMode = view => {
6091
+ view.setTabFocusMode(2000);
6092
+ return true;
6093
+ };
6094
+ /**
6086
6095
  Insert a tab character at the cursor or, if something is selected,
6087
6096
  use [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) to indent the entire
6088
6097
  selection.
@@ -6209,6 +6218,7 @@ The default keymap. Includes all bindings from
6209
6218
  - Shift-Ctrl-\\ (Shift-Cmd-\\ on macOS): [`cursorMatchingBracket`](https://codemirror.net/6/docs/ref/#commands.cursorMatchingBracket)
6210
6219
  - Ctrl-/ (Cmd-/ on macOS): [`toggleComment`](https://codemirror.net/6/docs/ref/#commands.toggleComment).
6211
6220
  - Shift-Alt-a: [`toggleBlockComment`](https://codemirror.net/6/docs/ref/#commands.toggleBlockComment).
6221
+ - Ctrl-m (Alt-Shift-m on macOS): [`toggleTabFocusMode`](https://codemirror.net/6/docs/ref/#commands.toggleTabFocusMode).
6212
6222
  */
6213
6223
  const defaultKeymap = /*@__PURE__*/[
6214
6224
  { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: cursorSyntaxLeft, shift: selectSyntaxLeft },
@@ -6227,7 +6237,8 @@ const defaultKeymap = /*@__PURE__*/[
6227
6237
  { key: "Shift-Mod-k", run: deleteLine },
6228
6238
  { key: "Shift-Mod-\\", run: cursorMatchingBracket },
6229
6239
  { key: "Mod-/", run: toggleComment },
6230
- { key: "Alt-A", run: toggleBlockComment }
6240
+ { key: "Alt-A", run: toggleBlockComment },
6241
+ { key: "Ctrl-m", mac: "Shift-Alt-m", run: toggleTabFocusMode },
6231
6242
  ].concat(standardKeymap);
6232
6243
  /**
6233
6244
  A binding that binds Tab to [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) and
@@ -9957,9 +9968,13 @@ function buildDeco(view, tree, always) {
9957
9968
  function clipRTLLines(ranges, doc) {
9958
9969
  let cur = doc.iter(), pos = 0, result = [], last = null;
9959
9970
  for (let { from, to } of ranges) {
9960
- if (from != pos) {
9961
- if (pos < from)
9962
- cur.next(from - pos);
9971
+ if (last && last.to > from) {
9972
+ from = last.to;
9973
+ if (from >= to)
9974
+ continue;
9975
+ }
9976
+ if (pos + cur.value.length < from) {
9977
+ cur.next(from - (pos + cur.value.length));
9963
9978
  pos = from;
9964
9979
  }
9965
9980
  for (;;) {
@@ -9970,7 +9985,7 @@ function clipRTLLines(ranges, doc) {
9970
9985
  else
9971
9986
  result.push(last = { from: start, to: Math.min(to, end) });
9972
9987
  }
9973
- if (pos >= to)
9988
+ if (end >= to)
9974
9989
  break;
9975
9990
  pos = end;
9976
9991
  cur.next();
@@ -12253,7 +12268,8 @@ __webpack_require__.r(__webpack_exports__);
12253
12268
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(442);
12254
12269
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12255
12270
  /* harmony import */ var _useCodeMirror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(695);
12256
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(540);
12271
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(742);
12272
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
12257
12273
  /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(730);
12258
12274
  /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_3__);
12259
12275
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};